PageSourceSearch

https://dillinger.io/_next/static/chunks/1460.1382bc1fa152629a.js

js dillinger.io collected 2026-09-24 08:34:28 UTC 2,460,403 bytes, 671 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1460],{20942:function(e,t,i){"use strict";var n,s;function r(e){if(0===e.length)throw Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function o(e,t,i=(e,t)=>e===t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0,s=e.length;n<s;n++)if(!i(e[n],t[n]))return!1;return!0}function a(e,t){let i=e.length-1;t<i&&(e[t]=e[i]),e.pop()}function l(e,t,i){return h(e.length,n=>i(e[n],t))}function h(e,t){let i=0,n=e-1;for(;i<=n;){let e=(i+n)/2|0,s=t(e);if(s<0)i=e+1;else{if(!(s>0))return e;n=e-1}}return-(i+1)}function*d(e,t){let i,n;for(let s of e)void 0!==n&&t(n,s)?i.push(s):(i&&(yield i),i=[s]),n=s;i&&(yield i)}function u(e,t){for(let i=0;i<=e.length;i++)t(0===i?void 0:e[i-1],i===e.length?void 0:e[i])}function c(e,t){for(let i=0;i<e.length;i++)t(0===i?void 0:e[i-1],e[i],i+1===e.length?void 0:e[i+1])}function g(e){return e.filter(e=>!!e)}function f(e){let t=0;for(let i=0;i<e.length;i++)e[i]&&(e[t]=e[i],t+=1);e.length=t}function m(e){return!Array.isArray(e)||0===e.length}function p(e){return Array.isArray(e)&&e.length>0}function _(e,t=e=>e){let i=new Set;return e.filter(e=>{let n=t(e);return!i.has(n)&&(i.add(n),!0)})}function v(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);let n=[];if(i<=t)for(let e=i;e<t;e++)n.push(e);else for(let e=i;e>t;e--)n.push(e);return n}function b(e,t,i){let n=e.slice(0,t),s=e.slice(t);return n.concat(i,s)}function C(e,t){let i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function w(e,t){let i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function y(e,t){for(let i of t)e.push(i)}function S(e,t,i,n){let s=L(e,t),r=e.splice(s,i);return void 0===r&&(r=[]),!function(e,t,i){let n=L(e,t),s=e.length,r=i.length;e.length=s+r;for(let t=s-1;t>=n;t--)e[t+r]=e[t];for(let t=0;t<r;t++)e[t+n]=i[t]}(e,s,n),r}function L(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}function x(e,t){return(i,n)=>t(e(i),e(n))}function k(...e){return(t,i)=>{for(let s of e){let e=s(t,i);if(!n.isNeitherLessOrGreaterThan(e))return e}return n.neitherLessOrGreaterThan}}i.d(t,{BV:function(){return E},EB:function(){return _},Gb:function(){return r},H9:function(){return T},KO:function(){return c},LS:function(){return a},Of:function(){return p},Rs:function(){return f},W$:function(){return I},XY:function(){return m},Zv:function(){return b},al:function(){return w},db:function(){return S},em:function(){return h},fS:function(){return o},f_:function(){return k},fv:function(){return N},kX:function(){return g},mw:function(){return d},nW:function(){return D},ry:function(){return l},tT:function(){return x},vA:function(){return y},w6:function(){return v},zI:function(){return C},zy:function(){return u}}),(s=n||(n={})).isLessThan=function(e){return e<0},s.isLessThanOrEqual=function(e){return e<=0},s.isGreaterThan=function(e){return e>0},s.isNeitherLessOrGreaterThan=function(e){return 0===e},s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0;let N=(e,t)=>e-t,D=(e,t)=>N(e?1:0,t?1:0);function E(e){return(t,i)=>-e(t,i)}class T{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;let i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;let i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(0!==this.length)return this.items[this.firstIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){let t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class I{static{this.empty=new I(e=>{})}constructor(e){this.iterate=e}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new I(t=>this.iterate(i=>!e(i)||t(i)))}map(e){return new I(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t;let i=!0;return this.iterate(s=>((i||n.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}}},7148:function(e,t,i){"use strict";i.d(t,{DM:function(){return h},eZ:function(){return l},hu:function(){return o},ok:function(){return s},vE:function(){return r},wN:function(){return a}});var n=i(63888);function s(e,t){if(!e)throw Error(t?`Assertion failed (${t})`:"Assertion Failed")}function r(e,t="Unreachable"){throw Error(t)}function o(e,t="unexpected state"){if(!e)throw"string"==typeof t?new n.he(`Assertion Failed: ${t}`):t}function a(e,t="Soft Assertion Failed"){e||(0,n.dL)(new n.he(t))}function l(e){e()||(e(),(0,n.dL)(new n.he("Assertion Failed")))}function h(e,t){let i=0;for(;i<e.length-1;){if(!t(e[i],e[i+1]))return!1;i++}return!0}},63888:function(e,t,i){"use strict";i.d(t,{B8:function(){return f},Cp:function(){return a},F0:function(){return u},FU:function(){return d},L6:function(){return g},b1:function(){return c},dL:function(){return o},he:function(){return p},n2:function(){return h},qU:function(){return r},ri:function(){return function e(t){if(t instanceof Error){let{name:i,message:n,
1cause:s}=t;return{$isError:!0,name:i,message:n,stack:t.stacktrace||t.stack,noTelemetry:m.isErrorNoTelemetry(t),cause:s?e(s):void 0,code:t.code}}return t}}});class n{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{if(e.stack){if(m.isErrorNoTelemetry(e))throw new m(e.message+"\n\n"+e.stack);throw Error(e.message+"\n\n"+e.stack)}throw e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}let s=new n;function r(e){s.onUnexpectedError(e)}function o(e){h(e)||s.onUnexpectedError(e)}function a(e){h(e)||s.onUnexpectedExternalError(e)}let l="Canceled";function h(e){return e instanceof d||e instanceof Error&&e.name===l&&e.message===l}class d extends Error{constructor(){super(l),this.name=this.message}}function u(){let e=Error(l);return e.name=e.message,e}function c(e){return e?Error(`Illegal argument: ${e}`):Error("Illegal argument")}function g(e){return e?Error(`Illegal state: ${e}`):Error("Illegal state")}class f extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class m extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof m)return e;let t=new m;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}}
1class p extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,p.prototype)}}},68607:function(e,t,i){"use strict";i.d(t,{D0:function(){return b},E7:function(){return y},K3:function(){return v},Q5:function(){return m},SZ:function(){return C},Sp:function(){return p},ZD:function(){return S},ju:function(){return n},z5:function(){return w}});var n,s=i(63888),r=i(76519),o=i(68795),a=i(805),l=i(2899);!function(e){function t(e){return(t,i=null,n)=>{let s,r=!1;return s=e(e=>r?void 0:(s?s.dispose():r=!0,t.call(i,e)),null,n),r&&s.dispose(),s}}function i(e,t,i){return s((i,n=null,s)=>e(e=>i.call(n,t(e)),null,s),i)}function n(e,t,i){return s((i,n=null,s)=>e(e=>t(e)&&i.call(n,e),null,s),i)}function s(e,t){let i;let n=new m({onWillAddFirstListener(){i=e(n.fire,n)},onDidRemoveLastListener(){i?.dispose()}});return t?.add(n),n.event}function r(e,t,i=100,n=!1,s=!1,r,o){let a,l,h,d;let u=0,c=new m({leakWarningThreshold:r,onWillAddFirstListener(){a=e(e=>{u++,h=t(h,e),n&&!d&&(c.fire(h),h=void 0),l=()=>{let e=h;h=void 0,d=void 0,(!n||u>1)&&c.fire(e),u=0},"number"==typeof i?(d&&clearTimeout(d),d=setTimeout(l,i)):void 0===d&&(d=null,queueMicrotask(l))})},onWillRemoveListener(){s&&u>0&&l?.()},onDidRemoveLastListener(){l=void 0,a.dispose()}});return o?.add(c),c.event}e.None=()=>o.JT.None,e.defer=function(e,t){return r(e,()=>void 0,0,void 0,!0,void 0,t)},e.once=t,e.onceIf=function(t,i){return e.once(e.filter(t,i))},e.map=i,e.forEach=function(e,t,i){return s((i,n=null,s)=>e(e=>{t(e),i.call(n,e)},null,s),i)},e.filter=n,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,n)=>{var s;return s=(0,o.F8)(...e.map(e=>e(e=>t.call(i,e)))),n instanceof Array?n.push(s):n&&n.add(s),s}},e.reduce=function(e,t,n,s){let r=n;return i(e,e=>r=t(r,e),s)},e.debounce=r,e.accumulate=function(t,i=0,n){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],i,void 0,!0,void 0,n)},e.latch=function(e,t=(e,t)=>e===t,i){let s,r=!0;return n(e,e=>{let i=r||!t(e,s);return r=!1,s=e,i},i)},e.split=function(t,i,n){return[e.filter(t,i,n),e.filter(t,e=>!i(e),n)]},e.buffer=function(e,t=!1,i=[],n){let s=i.slice(),r=e(e=>{s?s.push(e):a.fire(e)});n&&n.add(r);let o=()=>{s?.forEach(e=>a.fire(e)),s=null},a=new m({onWillAddFirstListener(){!r&&(r=e(e=>a.fire(e)),n&&n.add(r))},onDidAddFirstListener(){s&&(t?setTimeout(o):o())},onDidRemoveLastListener(){r&&r.dispose(),r=null}});return n&&n.add(a),a.event},e.chain=function(e,t){return(i,n,s)=>{let r=t(new l);return e(function(e){let t=r.evaluate(e);t!==a&&i.call(n,t)},void 0,s)}};let a=Symbol("HaltChainable");class l{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:a),this}reduce(e,t){let i=t;return this.steps.push(t=>i=e(i,t)),this}latch(e=(e,t)=>e===t){let t,i=!0;return this.steps.push(n=>{let s=i||!e(n,t);return i=!1,t=n,s?n:a}),this}evaluate(e){for(let t of this.steps)if((e=t(e))===a)break;return e}}e.fromNodeEventEmitter=function(e,t,i=e=>e){let n=(...e)=>s.fire(i(...e)),s=new m({onWillAddFirstListener:()=>e.on(t,n),onDidRemoveLastListener:()=>e.removeListener(t,n)});return s.event},e.fromDOMEventEmitter=function(e,t,i=e=>e){let n=(...e)=>s.fire(i(...e)),s=new m({onWillAddFirstListener:()=>e.addEventListener(t,n),onDidRemoveLastListener:()=>e.removeEventListener(t,n)});return s.event},e.toPromise=function(e,i){let n;let s=new Promise((s,r)=>{let o=t(e)(s,null,i);n=()=>o.dispose()});return s.cancel=n,s},e.forward=function(e,t){return e(e=>t.fire(e))},e.runAndSubscribe=function(e,t,i){return t(i),e(e=>t(e))};class h{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1,this.emitter=new m({onWillAddFirstListener:()=>{e.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{e.removeObserver(this)}}),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,0===this._counter&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}e.fromObservable=function(e,t){return new h(e,t).emitter.event},e.fromObservableLight=function(e){return(t,i,n)=>{let s=0,r=!1,a={beginUpdate(){s++},endUpdate(){0==--s&&(e.reportChanges(),r&&(r=!1,t.call(i)))},handlePossibleChange(){},handleChange(){r=!0}};e.addObserver(a),e.reportChanges();let l={dispose(){e.removeObserver(a)}};return n instanceof o.SL?n.add(l):Array.isArray(n)&&n.push(l),l}}}(n||(n={}));
1class h{static{this.all=new Set}static{this._idPool=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${h._idPool++}`,h.all.add(this)}start(e){this._stopWatch=new l.G,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}class d{static{this._idPool=1}constructor(e,t,i=(d._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);let n=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,n+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=.5*i;let[e,n]=this.getMostFrequentStack(),s=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${n}):`;console.warn(s),console.warn(e);let r=new c(s,e);this._errorHandler(r)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){let e;if(!this._stacks)return;let t=0;for(let[i,n]of this._stacks)(!e||t<n)&&(e=[i,n],t=n);return e}}class u{static create(){return new u(Error().stack??"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class c extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class g extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class f{constructor(e){this.value=e}}class m{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new d(e?.onListenerError??s.dL,this._options?.leakWarningThreshold??-1):void 0,this._perfMon=this._options?._profName?new h(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,i)=>{let n;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],i=new g(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||s.dL)(i),o.JT.None}if(this._disposed)return o.JT.None;t&&(e=e.bind(t));let r=new f(e);this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(r.stack=u.create(),n=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof f?(this._deliveryQueue??=new _,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=(0,o.OF)(()=>{n?.(),this._removeListener(r)});return i instanceof o.SL?i.add(a):Array.isArray(i)&&i.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(1===this._size){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(-1===i)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let n=this._deliveryQueue.current===this;if(2*this._size<=t.length){let e=0;for(let i=0;i<t.length;i++)t[i]?t[e++]=t[i]:n&&e<this._deliveryQueue.end&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||s.dL;if(!i){e.value(t);return}try{e.value(t)}catch(e){i(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof f)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}}let p=()=>new _;class _{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class v extends m{constructor(e){super(e),this._isPaused=0,this._eventQueue=new a.S,this._mergeFn=e?.merge}
1pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused){if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}}fire(e){this._size&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class b extends v{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class C extends m{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),1===this._queuedEvents.length&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(e=>super.fire(e)),this._queuedEvents=[]}))}}class w{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new m({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){let t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),(0,o.OF)((0,r.M)(()=>{this.hasListeners&&this.unhook(t);let e=this.events.indexOf(t);this.events.splice(e,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(e=>this.emitter.fire(e))}unhook(e){e.listener?.dispose(),e.listener=null}dispose(){for(let e of(this.emitter.dispose(),this.events))e.listener?.dispose();this.events=[]}}class y{constructor(){this.data=[]}wrapEvent(e,t,i){return(n,s,r)=>e(e=>{let r=this.data[this.data.length-1];if(!t){r?r.buffers.push(()=>n.call(s,e)):n.call(s,e);return}if(!r){n.call(s,t(i,e));return}r.items??=[],r.items.push(e),0===r.buffers.length&&r.buffers.push(()=>{r.reducedResult??=i?r.items.reduce(t,i):r.items.reduce(t),n.call(s,r.reducedResult)})},void 0,r)}bufferEvents(e){let t={buffers:[]};this.data.push(t);let i=e();return this.data.pop(),t.buffers.forEach(e=>e()),i}}class S{constructor(){this.listening=!1,this.inputEvent=n.None,this.inputEventListener=o.JT.None,this.emitter=new m({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},76519:function(e,t,i){"use strict";function n(e,t){let i;let n=this,s=!1;return function(){return s?i:(s=!0,i=e.apply(n,arguments))}}i.d(t,{M:function(){return n}})},8642:function(e,t,i){"use strict";i.d(t,{$:function(){return n}});var n,s=i(11447);!function(e){function t(e){return!!e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;let i=Object.freeze([]);function*n(e){yield e}async function r(e){let t=[];for await(let i of e)t.push(i);return t}async function o(e){let t=[];for await(let i of e)t=t.concat(i);return t}e.empty=function(){return i},e.single=n,e.wrap=function(e){return t(e)?e:n(e)},e.from=function(e){return e||i},e.reverse=function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){let i=0;for(let n of e)if(t(n,i++))return!0;return!1},e.every=function(e,t){let i=0;for(let n of e)if(!t(n,i++))return!1;return!0},e.find=function(e,t){for(let i of e)if(t(i))return i},e.filter=function*(e,t){for(let i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(let n of e)yield t(n,i++)},e.flatMap=function*(e,t){let i=0;for(let n of e)yield*t(n,i++)},e.concat=function*(...e){for(let t of e)(0,s.TW)(t)?yield*t:yield t},e.reduce=function(e,t,i){let n=i;for(let i of e)n=t(n,i);return n},e.length=function(e){let t=0;for(let i of e)t++;return t},e.slice=function*(e,t,i=e.length){for(t<-e.length&&(t=0),t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);t<i;t++)yield e[t]},e.consume=function(t,i=Number.POSITIVE_INFINITY){let n=[];if(0===i)return[n,t];let s=t[Symbol.iterator]();for(let t=0;t<i;t++){let t=s.next();if(t.done)return[n,e.empty()];n.push(t.value)}return[n,{[Symbol.iterator]:()=>s}]},e.asyncToArray=r,e.asyncToArrayFlat=o}(n||(n={}))},68795:function(e,t,i){"use strict";i.d(t,{B9:function(){return o},F8:function(){return a},JT:function(){return u},Jz:function(){return g},OF:function(){return h},SL:function(){return d},Wf:function(){return r},XK:function(){return c},b2:function(){return f},dk:function(){return s}});var n=i(8642);function s(e){return e}function r(e){return"object"==typeof e&&null!==e&&"function"==typeof e.dispose&&0===e.dispose.length}function o(e){if(n.$.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(e){t.push(e)}if(1===t.length)throw t[0];if(t.length>1)throw AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function a(...e){return h(()=>o(e))}class l{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function h(e){return new l(e)}class d{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{o(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===u.None)return e;if(e===this)throw Error("Cannot register a disposable on itself!");return this._isDisposed?d.DISABLE_DISPOSED_WARNING||console.warn(Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}}class u{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new d,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw Error("Cannot register a disposable on itself!");return this._store.add(e)}}class c{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}}class g{constructor(e){this.object=e}dispose(){}}class f{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{o(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){this._isDisposed&&console.warn(Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||this._store.get(e)?.dispose(),this._store.set(e,t)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}},805:function(e,t,i){"use strict";i.d(t,{S:function(){return s}});
1class n{static{this.Undefined=new n(void 0)}constructor(e){this.element=e,this.next=n.Undefined,this.prev=n.Undefined}}class s{constructor(){this._first=n.Undefined,this._last=n.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===n.Undefined}clear(){let e=this._first;for(;e!==n.Undefined;){let t=e.next;e.prev=n.Undefined,e.next=n.Undefined,e=t}this._first=n.Undefined,this._last=n.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new n(e);if(this._first===n.Undefined)this._first=i,this._last=i;else if(t){let e=this._last;this._last=i,i.prev=e,e.next=i}else{let e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==n.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==n.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==n.Undefined&&e.next!==n.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===n.Undefined&&e.next===n.Undefined?(this._first=n.Undefined,this._last=n.Undefined):e.next===n.Undefined?(this._last=this._last.prev,this._last.next=n.Undefined):e.prev===n.Undefined&&(this._first=this._first.next,this._first.prev=n.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==n.Undefined;)yield e.element,e=e.next}}},8297:function(e,t,i){"use strict";i.d(t,{I8:function(){return function e(t){if(!t||"object"!=typeof t||t instanceof RegExp)return t;let i=Array.isArray(t)?[]:{};return Object.entries(t).forEach(([t,n])=>{i[t]=n&&"object"==typeof n?e(n):n}),i}},_A:function(){return s},fS:function(){return function e(t,i){let n,s;if(t===i)return!0;if(null==t||null==i||typeof t!=typeof i||"object"!=typeof t||Array.isArray(t)!==Array.isArray(i))return!1;if(Array.isArray(t)){if(t.length!==i.length)return!1;for(n=0;n<t.length;n++)if(!e(t[n],i[n]))return!1}else{let r=[];for(s in t)r.push(s);r.sort();let o=[];for(s in i)o.push(s);if(o.sort(),!e(r,o))return!1;for(n=0;n<r.length;n++)if(!e(t[r[n]],i[r[n]]))return!1}return!0}},rs:function(){return o}});var n=i(11447);function s(e){if(!e||"object"!=typeof e)return e;let t=[e];for(;t.length>0;){let e=t.shift();for(let i in Object.freeze(e),e)if(r.call(e,i)){let s=e[i];"object"!=typeof s||Object.isFrozen(s)||(0,n.fU)(s)||t.push(s)}}return e}let r=Object.prototype.hasOwnProperty;function o(e,t){return function e(t,i,s){if((0,n.Jp)(t))return t;let o=i(t);if(void 0!==o)return o;if(Array.isArray(t)){let n=[];for(let r of t)n.push(e(r,i,s));return n}if((0,n.Kn)(t)){if(s.has(t))throw Error("Cannot clone recursive data-structure");s.add(t);let n={};for(let o in t)r.call(t,o)&&(n[o]=e(t[o],i,s));return s.delete(t),n}return t}(e,t,new Set)}},8764:function(e,t,i){"use strict";let n,s;i.d(t,{$L:function(){return y},Dt:function(){return B},ED:function(){return v},G6:function(){return P},IJ:function(){return C},Jv:function(){return k},OS:function(){return T},cr:function(){return a},dz:function(){return b},fn:function(){return E},gn:function(){return L},i7:function(){return A},qB:function(){return S},r:function(){return R},tY:function(){return w},tq:function(){return x},un:function(){return F},vU:function(){return O}}),i(34187);var r=i(16675),o=i(40257);let a="en",l=!1,h=!1,d=!1,u=!1,c=!1,g=!1,f=!1,m=globalThis;void 0!==m.vscode&&void 0!==m.vscode.process?s=m.vscode.process:void 0!==o&&"string"==typeof o?.versions?.node&&(s=o);let p="string"==typeof s?.versions?.electron&&s?.type==="renderer";if("object"==typeof s){l="win32"===s.platform,h="darwin"===s.platform,(d="linux"===s.platform)&&s.env.SNAP&&s.env.SNAP_REVISION,s.env.CI||s.env.BUILD_ARTIFACTSTAGINGDIRECTORY||s.env.GITHUB_WORKSPACE;let e=s.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,t.resolvedLanguage,t.languagePack?.translationsConfigFile}catch(e){}u=!0}else"object"!=typeof navigator||p?console.error("Unable to resolve platform."):(l=(n=navigator.userAgent).indexOf("Windows")>=0,h=n.indexOf("Macintosh")>=0,g=(n.indexOf("Macintosh")>=0||n.indexOf("iPad")>=0||n.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,d=n.indexOf("Linux")>=0,f=n?.indexOf("Mobi")>=0,c=!0,(0,r.f)(),navigator.language.toLowerCase());let _=0;h?_=1:l?_=3:d&&(_=2);let v=l,b=h,C=d,w=u,y=c,S=c&&"function"==typeof m.importScripts?m.origin:void 0,L=g,x=f,k=_,N=n,D="function"==typeof m.postMessage&&!m.importScripts,E=(()=>
1{if(D){let e=[];m.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=e.length;i<n;i++){let n=e[i];if(n.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),n.callback();return}}});let t=0;return i=>{let n=++t;e.push({id:n,callback:i}),m.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),T=h||g?2:l?1:3,I=!0,M=!1;function R(){if(!M){M=!0;let e=new Uint8Array(2);e[0]=1,e[1]=2,I=513===new Uint16Array(e.buffer)[0]}return I}let A=!!(N&&N.indexOf("Chrome")>=0),O=!!(N&&N.indexOf("Firefox")>=0),P=!!(!A&&N&&N.indexOf("Safari")>=0),F=!!(N&&N.indexOf("Edg/")>=0),B=!!(N&&N.indexOf("Android")>=0)},2899:function(e,t,i){"use strict";i.d(t,{G:function(){return s}});let n=globalThis.performance.now.bind(globalThis.performance);class s{static create(e){return new s(e)}constructor(e){this._now=!1===e?Date.now:n,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return -1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}}},11447:function(e,t,i){"use strict";i.d(t,{$K:function(){return u},D8:function(){return p},HD:function(){return s},Jp:function(){return c},Kn:function(){return r},TW:function(){return l},d9:function(){return f},fU:function(){return o},hj:function(){return a},jn:function(){return h},mf:function(){return m},o8:function(){return d},p_:function(){return g}});var n=i(7148);function s(e){return"string"==typeof e}function r(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function o(e){let t=Object.getPrototypeOf(Uint8Array);return"object"==typeof e&&e instanceof t}function a(e){return"number"==typeof e&&!isNaN(e)}function l(e){return!!e&&"function"==typeof e[Symbol.iterator]}function h(e){return!0===e||!1===e}function d(e){return void 0===e}function u(e){return!c(e)}function c(e){return d(e)||null===e}function g(e,t){if(!e)throw Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function f(e){return(0,n.hu)(null!=e,"Argument is `undefined` or `null`."),e}function m(e){return"function"==typeof e}function p(e,t){let i=Math.min(e.length,t.length);for(let n=0;n<i;n++)!function(e,t){if(s(t)){if(typeof e!==t)throw Error(`argument does not match constraint: typeof ${t}`)}else if(m(t)){try{if(e instanceof t)return}catch{}if(!c(e)&&e.constructor===t||1===t.length&&!0===t.call(void 0,e))return;throw Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}(e[n],t[n])}},28432:function(e,t,i){"use strict";i.d(t,{C:function(){return s}});var n=i(68607);let s=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new n.Q5,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}}},25790:function(e,t,i){"use strict";i.d(t,{E4:function(){return o},I9:function(){return l},Mk:function(){return h},hL:function(){return d},pR:function(){return a}});var n=i(8764),s=i(28432);let r=n.dz?1.5:1.35;class o{static _create(e,t,i,n,a,d,u,c,g){0===d?d=r*i:d<8&&(d*=i),(d=Math.round(d))<8&&(d=8);let f=1+(g?0:.1*s.C.getZoomLevel());if(i*=f,d*=f,a===h){if("normal"===t||"bold"===t)a=l;else{let e=parseInt(t,10);a=`'wght' ${e}`,t="normal"}}return new o({pixelRatio:c,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:n,fontVariationSettings:a,lineHeight:d,letterSpacing:u})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=0|e.lineHeight,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){let e=d.fontFamily,t=o._wrapInQuotes(this.fontFamily);return this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}class a extends o{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=2,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWi
1dth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}}let l="normal",h="translate",d={fontFamily:n.dz?"Menlo, Monaco, 'Courier New', monospace":n.ED?"Consolas, 'Courier New', monospace":"'Droid Sans Mono', 'monospace', monospace",fontWeight:"normal",fontSize:n.dz?12:14,lineHeight:0,letterSpacing:0}},67677:function(e,t,i){"use strict";i.d(t,{D:function(){return n}});let n={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}}},23719:function(e,t,i){"use strict";i.d(t,{Af:function(){return o},eq:function(){return a},t2:function(){return function e(t,i,s,r,o){if(i=a(i),o||(o=n.$.first(l)),s.length>o.maxLen){let n=t-o.maxLen/2;return n<0?n=0:r+=n,s=s.substring(n,t+o.maxLen/2),e(t,i,s,r,o)}let h=Date.now(),d=t-1-r,u=-1,c=null;for(let e=1;!(Date.now()-h>=o.timeBudget);e++){let t=d-o.windowSize*e;i.lastIndex=Math.max(0,t);let n=function(e,t,i,n){let s;for(;s=e.exec(t);){let t=s.index||0;if(t<=i&&e.lastIndex>=i)return s;if(n>0&&t>n)break}return null}(i,s,d,u);if(!n&&c||(c=n,t<=0))break;u=t}if(c){let e={word:c[0],startColumn:r+1+c.index,endColumn:r+1+c.index+c[0].length};return i.lastIndex=0,e}return null}},vu:function(){return r}});var n=i(8642),s=i(805);let r="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",o=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(let i of r)e.indexOf(i)>=0||(t+="\\"+i);return RegExp(t+="\\s]+)","g")}();function a(e){let t=o;if(e&&e instanceof RegExp){if(e.global)t=e;else{let i="g";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),t=new RegExp(e.source,i)}}return t.lastIndex=0,t}let l=new s.S;l.unshift({maxLen:1e3,windowSize:15,timeBudget:150})},11460:function(e,t,i){"use strict";let n,s,r,o,a,l,h,d,u,c,g,f,m,p,_,v,b,C,w,y,S,L,x,k;i.r(t),i.d(t,{CancellationTokenSource:function(){return Ki},Emitter:function(){return Kn},KeyCode:function(){return Ks},KeyMod:function(){return Kr},MarkerSeverity:function(){return Kd},MarkerTag:function(){return Ku},Position:function(){return Ko},Range:function(){return Ka},Selection:function(){return Kl},SelectionDirection:function(){return Kh},Token:function(){return Kg},Uri:function(){return Kc},editor:function(){return Kf},languages:function(){return Km}});var N,D,E,T,I,M,R,A,O,P,F,B,V,W,H,z,U,K,$,j,q,G,Q,Y,J,Z,X,ee,et,ei,en,es,er,eo,ea,el,eh,ed,eu,ec,eg,ef,em,ep,e_,ev,eb,eC,ew,ey,eS,eL,ex,ek,eN,eD,eE,eT,eI,eM,eR,eA,eO,eP,eF,eB,eV,eW,eH,ez,eU,eK,e$,ej,eq,eG,eQ,eY,eJ,eZ,eX,e1,e0,e2,e5,e4,e6,e7,e3,e9,e8,te,tt,ti,tn,ts,tr,to,ta,tl,th,td,tu,tc,tg,tf,tm,tp,t_,tv,tb,tC,tw,ty,tS,tL,tx,tk,tN,tD,tE,tT,tI,tM,tR,tA,tO,tP,tF,tB,tV,tW,tH,tz,tU,tK,t$,tj,tq,tG,tQ,tY,tJ,tZ,tX,t1,t0,t2,t5,t4,t6,t7,t3,t9,t8,ie,it,ii,is,ir,io,ia,il,ih,id,iu,ic,ig,im,ip,i_,iv,ib,iC,iw,iy,iS,iL,ix,ik,iN,iD,iE,iT,iI,iM,iR,iA,iO,iP,iF,iB,iV,iW,iH,iz,iU,iK,i$,ij,iq,iG,iQ,iY,iJ,iZ,iX,i1,i0,i2,i5,i4,i6,i7,i3,i9,i8,ne,nt,ni,nn,ns,nr,no,na,nl,nh,nd,nu,nc,ng,nf,nm,np,n_,nv,nb,nC,nw,ny,nS,nL,nx,nk,nN,nD,nE,nT,nI,nM,nR,nA,nO,nP,nF,nB,nV,nW,nH,nz,nU,nK,n$,nj,nq,nG,nQ,nY,nJ,nZ,nX,n1,n0,n2,n5,n4,n6,n7,n3,n9,n8,se,st,si,sn,ss,sr,so,sa,sl={};i.r(sl),i.d(sl,{CancellationTokenSource:function(){return Ki},Emitter:function(){return Kn},KeyCode:function(){return Ks},KeyMod:function(){return Kr},MarkerSeverity:function(){return Kd},MarkerTag:function(){return Ku},Position:function(){return Ko},Range:function(){return Ka},Selection:function(){return Kl},SelectionDirection:function(){return Kh},Token:function(){return Kg},Uri:function(){return Kc},editor:function(){return Kf},languages:function(){return Km}});var sh=i(48607),sd=i(68607);let su=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(D=tI||(tI={})).isCancellationToken=function(e){return e===D.None||e===D.Cancelled||e instanceof sc||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},D.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:sd.ju.None}),D.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:su});class sc{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){!this._isCancelled&&(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?su:(this._emitter||(this._emitter=new sd.Q5),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class sg{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new sc),this._token}
1cancel(){this._token?this._token instanceof sc&&this._token.cancel():this._token=tI.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof sc&&this._token.dispose():this._token=tI.None}}class sf{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}let sm=new sf,sp=new sf,s_=new sf,sv=Array(230),sb=Object.create(null),sC=Object.create(null),sw=[];for(let e=0;e<=193;e++)sw[e]=-1;function sy(e,t){return(e|(65535&t)<<16>>>0)>>>0}!function(){let e=[],t=[];for(let i of[[1,0,"None",0,"unknown",0,"VK_UNKNOWN","",""],[1,1,"Hyper",0,"",0,"","",""],[1,2,"Super",0,"",0,"","",""],[1,3,"Fn",0,"",0,"","",""],[1,4,"FnLock",0,"",0,"","",""],[1,5,"Suspend",0,"",0,"","",""],[1,6,"Resume",0,"",0,"","",""],[1,7,"Turbo",0,"",0,"","",""],[1,8,"Sleep",0,"",0,"VK_SLEEP","",""],[1,9,"WakeUp",0,"",0,"","",""],[0,10,"KeyA",31,"A",65,"VK_A","",""],[0,11,"KeyB",32,"B",66,"VK_B","",""],[0,12,"KeyC",33,"C",67,"VK_C","",""],[0,13,"KeyD",34,"D",68,"VK_D","",""],[0,14,"KeyE",35,"E",69,"VK_E","",""],[0,15,"KeyF",36,"F",70,"VK_F","",""],[0,16,"KeyG",37,"G",71,"VK_G","",""],[0,17,"KeyH",38,"H",72,"VK_H","",""],[0,18,"KeyI",39,"I",73,"VK_I","",""],[0,19,"KeyJ",40,"J",74,"VK_J","",""],[0,20,"KeyK",41,"K",75,"VK_K","",""],[0,21,"KeyL",42,"L",76,"VK_L","",""],[0,22,"KeyM",43,"M",77,"VK_M","",""],[0,23,"KeyN",44,"N",78,"VK_N","",""],[0,24,"KeyO",45,"O",79,"VK_O","",""],[0,25,"KeyP",46,"P",80,"VK_P","",""],[0,26,"KeyQ",47,"Q",81,"VK_Q","",""],[0,27,"KeyR",48,"R",82,"VK_R","",""],[0,28,"KeyS",49,"S",83,"VK_S","",""],[0,29,"KeyT",50,"T",84,"VK_T","",""],[0,30,"KeyU",51,"U",85,"VK_U","",""],[0,31,"KeyV",52,"V",86,"VK_V","",""],[0,32,"KeyW",53,"W",87,"VK_W","",""],[0,33,"KeyX",54,"X",88,"VK_X","",""],[0,34,"KeyY",55,"Y",89,"VK_Y","",""],[0,35,"KeyZ",56,"Z",90,"VK_Z","",""],[0,36,"Digit1",22,"1",49,"VK_1","",""],[0,37,"Digit2",23,"2",50,"VK_2","",""],[0,38,"Digit3",24,"3",51,"VK_3","",""],[0,39,"Digit4",25,"4",52,"VK_4","",""],[0,40,"Digit5",26,"5",53,"VK_5","",""],[0,41,"Digit6",27,"6",54,"VK_6","",""],[0,42,"Digit7",28,"7",55,"VK_7","",""],[0,43,"Digit8",29,"8",56,"VK_8","",""],[0,44,"Digit9",30,"9",57,"VK_9","",""],[0,45,"Digit0",21,"0",48,"VK_0","",""],[1,46,"Enter",3,"Enter",13,"VK_RETURN","",""],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE","",""],[1,48,"Backspace",1,"Backspace",8,"VK_BACK","",""],[1,49,"Tab",2,"Tab",9,"VK_TAB","",""],[1,50,"Space",10,"Space",32,"VK_SPACE","",""],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,"",0,"","",""],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL","",""],[1,64,"F1",59,"F1",112,"VK_F1","",""],[1,65,"F2",60,"F2",113,"VK_F2","",""],[1,66,"F3",61,"F3",114,"VK_F3","",""],[1,67,"F4",62,"F4",115,"VK_F4","",""],[1,68,"F5",63,"F5",116,"VK_F5","",""],[1,69,"F6",64,"F6",117,"VK_F6","",""],[1,70,"F7",65,"F7",118,"VK_F7","",""],[1,71,"F8",66,"F8",119,"VK_F8","",""],[1,72,"F9",67,"F9",120,"VK_F9","",""],[1,73,"F10",68,"F10",121,"VK_F10","",""],[1,74,"F11",69,"F11",122,"VK_F11","",""],[1,75,"F12",70,"F12",123,"VK_F12","",""],[1,76,"PrintScreen",0,"",0,"","",""],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL","",""],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE","",""],[1,79,"Insert",19,"Insert",45,"VK_INSERT","",""],[1,80,"Home",14,"Home",36,"VK_HOME","",""],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR","",""],[1,82,"Delete",20,"Delete",46,"VK_DELETE","",""],[1,83,"End",13,"End",35,"VK_END","",""],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT","",""],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",""],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",""],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",""],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",""],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK","",""],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD","",""],[1,94,"NumpadEnter",3,"",0,"","",""],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1","",""],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2","",""],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3","",""],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4","",""],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5","",""],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6","",""],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7","",""],[1,102,"Numpad8",106,"
1NumPad8",104,"VK_NUMPAD8","",""],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9","",""],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0","",""],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102","",""],[1,107,"ContextMenu",58,"ContextMenu",93,"","",""],[1,108,"Power",0,"",0,"","",""],[1,109,"NumpadEqual",0,"",0,"","",""],[1,110,"F13",71,"F13",124,"VK_F13","",""],[1,111,"F14",72,"F14",125,"VK_F14","",""],[1,112,"F15",73,"F15",126,"VK_F15","",""],[1,113,"F16",74,"F16",127,"VK_F16","",""],[1,114,"F17",75,"F17",128,"VK_F17","",""],[1,115,"F18",76,"F18",129,"VK_F18","",""],[1,116,"F19",77,"F19",130,"VK_F19","",""],[1,117,"F20",78,"F20",131,"VK_F20","",""],[1,118,"F21",79,"F21",132,"VK_F21","",""],[1,119,"F22",80,"F22",133,"VK_F22","",""],[1,120,"F23",81,"F23",134,"VK_F23","",""],[1,121,"F24",82,"F24",135,"VK_F24","",""],[1,122,"Open",0,"",0,"","",""],[1,123,"Help",0,"",0,"","",""],[1,124,"Select",0,"",0,"","",""],[1,125,"Again",0,"",0,"","",""],[1,126,"Undo",0,"",0,"","",""],[1,127,"Cut",0,"",0,"","",""],[1,128,"Copy",0,"",0,"","",""],[1,129,"Paste",0,"",0,"","",""],[1,130,"Find",0,"",0,"","",""],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,136,"KanaMode",0,"",0,"","",""],[0,137,"IntlYen",0,"",0,"","",""],[1,138,"Convert",0,"",0,"","",""],[1,139,"NonConvert",0,"",0,"","",""],[1,140,"Lang1",0,"",0,"","",""],[1,141,"Lang2",0,"",0,"","",""],[1,142,"Lang3",0,"",0,"","",""],[1,143,"Lang4",0,"",0,"","",""],[1,144,"Lang5",0,"",0,"","",""],[1,145,"Abort",0,"",0,"","",""],[1,146,"Props",0,"",0,"","",""],[1,147,"NumpadParenLeft",0,"",0,"","",""],[1,148,"NumpadParenRight",0,"",0,"","",""],[1,149,"NumpadBackspace",0,"",0,"","",""],[1,150,"NumpadMemoryStore",0,"",0,"","",""],[1,151,"NumpadMemoryRecall",0,"",0,"","",""],[1,152,"NumpadMemoryClear",0,"",0,"","",""],[1,153,"NumpadMemoryAdd",0,"",0,"","",""],[1,154,"NumpadMemorySubtract",0,"",0,"","",""],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR","",""],[1,156,"NumpadClearEntry",0,"",0,"","",""],[1,0,"",5,"Ctrl",17,"VK_CONTROL","",""],[1,0,"",4,"Shift",16,"VK_SHIFT","",""],[1,0,"",6,"Alt",18,"VK_MENU","",""],[1,0,"",57,"Meta",91,"VK_COMMAND","",""],[1,157,"ControlLeft",5,"",0,"VK_LCONTROL","",""],[1,158,"ShiftLeft",4,"",0,"VK_LSHIFT","",""],[1,159,"AltLeft",6,"",0,"VK_LMENU","",""],[1,160,"MetaLeft",57,"",0,"VK_LWIN","",""],[1,161,"ControlRight",5,"",0,"VK_RCONTROL","",""],[1,162,"ShiftRight",4,"",0,"VK_RSHIFT","",""],[1,163,"AltRight",6,"",0,"VK_RMENU","",""],[1,164,"MetaRight",57,"",0,"VK_RWIN","",""],[1,165,"BrightnessUp",0,"",0,"","",""],[1,166,"BrightnessDown",0,"",0,"","",""],[1,167,"MediaPlay",0,"",0,"","",""],[1,168,"MediaRecord",0,"",0,"","",""],[1,169,"MediaFastForward",0,"",0,"","",""],[1,170,"MediaRewind",0,"",0,"","",""],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,174,"Eject",0,"",0,"","",""],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,179,"LaunchApp1",0,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,180,"SelectTask",0,"",0,"","",""],[1,181,"LaunchScreenSaver",0,"",0,"","",""],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,186,"BrowserStop",0,"",0,"VK_BROWSER_STOP","",""],[1,187,"BrowserRefresh",0,"",0,"VK_BROWSER_REFRESH","",""],[1,188,"BrowserFavorites",0,"",0,"VK_BROWSER_FAVORITES","",""],[1,189,"ZoomToggle",0,"",0,"","",""],[1,190,"MailReply",0,"",0,"","",""],[1,191,"MailForward",0,"",0,"","",""],[1,192,"MailSend",0,"",0,"","",""],[1,0,"",114,"KeyInComposition",229,"","",""],[1,0,"",116,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,0,"",96,"OEM_8",223,"VK_OEM_8","",""],[1,0,"",0,"",0,"VK_KANA","",""],[1,0,"",0,"",0,"VK_HANGUL","",""],[1,0,"",0,"",0,"VK_JUNJA","",""],[1,0,"",0,"",0,"VK_FINAL","",""],[1,0,"",0,"",0,"VK_HANJA","",""],[1,0,"",0,"",0,"VK_KANJI","",""],[1,0,"",0,"",0,"VK_CONVERT","",""],[1,0,"",0,"",0,"VK_NONCONVERT","",""],[1,0,"",0,"",0,"VK_ACCEPT","",""],[1,0,"",0,"",0,"VK_MODECHANGE","",""],[1,0,"",0,"",0,"VK_SELECT","",""],[1,0,"",0,"",0,"VK_PRINT","",""],[1,0,"",0,"",0,"VK_EXECUTE","",""],[1,0,"",0,"",0,"VK_SNAPSHOT","",""],[1,0,"",0,"",0,"VK_HELP","",""],[1,0,"",0,"",0,"VK_APPS","",""],[1,0,"",0,"",0,"VK_PROCESSKEY","",""],[1,0,"",0,"",0,"VK_PACKET","",""],[1,0,"",0,"",0,"VK_DBE_SBCSCHAR","",""],[1,0,"",0,"",0,"VK_DBE_DBCSCHAR","",""],[1,0,"",0,"",0,"VK_ATTN","",""],[1,0,"",0,"",0,"VK_CRSEL","",""],[1,0,"",0,"",0,"VK_EXSEL","",""],[1,0,"",0,"",0,"VK_EREOF","",""],[1,0,"",0,"",0,"VK_PLAY","",""],[1,0,"",0,"",0,"VK_ZOOM","",""],[1,0,"",0,"",0,"VK_NONAME","",""],[1,0,"",0,"",0,"VK_PA1","",""],[1,0,"",0,"",0,"VK_OEM_CLEAR","",""]]){let[
1n,s,r,o,a,l,h,d,u]=i;if(!t[s]&&(t[s]=!0,sb[r]=s,sC[r.toLowerCase()]=s,n&&(sw[s]=o)),!e[o]){if(e[o]=!0,!a)throw Error(`String representation missing for key code ${o} around scan code ${r}`);sm.define(o,a),sp.define(o,d||a),s_.define(o,u||d||a)}l&&(sv[l]=o)}}(),(E=tM||(tM={})).toString=function(e){return sm.keyCodeToStr(e)},E.fromString=function(e){return sm.strToKeyCode(e)},E.toUserSettingsUS=function(e){return sp.keyCodeToStr(e)},E.toUserSettingsGeneral=function(e){return s_.keyCodeToStr(e)},E.fromUserSettings=function(e){return sp.strToKeyCode(e)||s_.strToKeyCode(e)},E.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return sm.keyCodeToStr(e)};var sS=i(8764),sL=i(40257);let sx=globalThis.vscode;if(void 0!==sx&&void 0!==sx.process){let e=sx.process;n={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd:()=>e.cwd()}}else n=void 0!==sL&&"string"==typeof sL?.versions?.node?{get platform(){return sL.platform},get arch(){return sL.arch},get env(){return sL.env},cwd:()=>sL.env.VSCODE_CWD||sL.cwd()}:{get platform(){return sS.ED?"win32":sS.dz?"darwin":"linux"},get arch(){return},get env(){return{}},cwd:()=>"/"};let sk=n.cwd,sN=n.env,sD=n.platform;
1class sE extends Error{constructor(e,t,i){let n;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let s=-1!==e.indexOf(".")?"property":"argument",r=`The "${e}" ${s} ${n} of type ${t}`;super(r+=`. Received type ${typeof i}`),this.code="ERR_INVALID_ARG_TYPE"}}function sT(e,t){if("string"!=typeof e)throw new sE(t,"string",e)}let sI="win32"===sD;function sM(e){return 47===e||92===e}function sR(e){return 47===e}function sA(e){return e>=65&&e<=90||e>=97&&e<=122}function sO(e,t,i,n){let s="",r=0,o=-1,a=0,l=0;for(let h=0;h<=e.length;++h){if(h<e.length)l=e.charCodeAt(h);else if(n(l))break;else l=47;if(n(l)){if(o===h-1||1===a);else if(2===a){if(s.length<2||2!==r||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){let e=s.lastIndexOf(i);-1===e?(s="",r=0):r=(s=s.slice(0,e)).length-1-s.lastIndexOf(i),o=h,a=0;continue}if(0!==s.length){s="",r=0,o=h,a=0;continue}}t&&(s+=s.length>0?`${i}..`:"..",r=2)}else s.length>0?s+=`${i}${e.slice(o+1,h)}`:s=e.slice(o+1,h),r=h-o-1;o=h,a=0}else 46===l&&-1!==a?++a:a=-1}return s}function sP(e,t){var i;!function(e,t){if(null===e||"object"!=typeof e)throw new sE(t,"Object",e)}(t,"pathObject");let n=t.dir||t.root,s=t.base||`${t.name||""}${(i=t.ext)?`${"."===i[0]?"":"."}${i}`:""}`;return n?n===t.root?`${n}${s}`:`${n}${e}${s}`:s}let sF={resolve(...e){let t="",i="",n=!1;for(let s=e.length-1;s>=-1;s--){let r;if(s>=0){if(sT(r=e[s],`paths[${s}]`),0===r.length)continue}else 0===t.length?r=sk():(void 0===(r=sN[`=${t}`]||sk())||r.slice(0,2).toLowerCase()!==t.toLowerCase()&&92===r.charCodeAt(2))&&(r=`${t}\\`);let o=r.length,a=0,l="",h=!1,d=r.charCodeAt(0);if(1===o)sM(d)&&(a=1,h=!0);else if(sM(d)){if(h=!0,sM(r.charCodeAt(1))){let e=2,t=2;for(;e<o&&!sM(r.charCodeAt(e));)e++;if(e<o&&e!==t){let i=r.slice(t,e);for(t=e;e<o&&sM(r.charCodeAt(e));)e++;if(e<o&&e!==t){for(t=e;e<o&&!sM(r.charCodeAt(e));)e++;(e===o||e!==t)&&(l=`\\\\${i}\\${r.slice(t,e)}`,a=e)}}}else a=1}else sA(d)&&58===r.charCodeAt(1)&&(l=r.slice(0,2),a=2,o>2&&sM(r.charCodeAt(2))&&(h=!0,a=3));if(l.length>0){if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l}if(n){if(t.length>0)break}else if(i=`${r.slice(a)}\\${i}`,n=h,h&&t.length>0)break}return i=sO(i,!n,"\\",sM),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){let t;sT(e,"path");let i=e.length;if(0===i)return".";let n=0,s=!1,r=e.charCodeAt(0);if(1===i)return sR(r)?"\\":e;if(sM(r)){if(s=!0,sM(e.charCodeAt(1))){let s=2,r=2;for(;s<i&&!sM(e.charCodeAt(s));)s++;if(s<i&&s!==r){let o=e.slice(r,s);for(r=s;s<i&&sM(e.charCodeAt(s));)s++;if(s<i&&s!==r){for(r=s;s<i&&!sM(e.charCodeAt(s));)s++;if(s===i)return`\\\\${o}\\${e.slice(r)}\\`;s!==r&&(t=`\\\\${o}\\${e.slice(r,s)}`,n=s)}}}else n=1}else sA(r)&&58===e.charCodeAt(1)&&(t=e.slice(0,2),n=2,i>2&&sM(e.charCodeAt(2))&&(s=!0,n=3));let o=n<i?sO(e.slice(n),!s,"\\",sM):"";if(0!==o.length||s||(o="."),o.length>0&&sM(e.charCodeAt(i-1))&&(o+="\\"),!s&&void 0===t&&e.includes(":")){if(o.length>=2&&sA(o.charCodeAt(0))&&58===o.charCodeAt(1))return`.\\${o}`;let t=e.indexOf(":");do if(t===i-1||sM(e.charCodeAt(t+1)))return`.\\${o}`;while(-1!==(t=e.indexOf(":",t+1)))}return void 0===t?s?`\\${o}`:o:s?`${t}\\${o}`:`${t}${o}`},isAbsolute(e){sT(e,"path");let t=e.length;if(0===t)return!1;let i=e.charCodeAt(0);return sM(i)||t>2&&sA(i)&&58===e.charCodeAt(1)&&sM(e.charCodeAt(2))},join(...e){let t,i;if(0===e.length)return".";for(let n=0;n<e.length;++n){let s=e[n];sT(s,"path"),s.length>0&&(void 0===t?t=i=s:t+=`\\${s}`)}if(void 0===t)return".";let n=!0,s=0;if("string"==typeof i&&sM(i.charCodeAt(0))){++s;let e=i.length;e>1&&sM(i.charCodeAt(1))&&(++s,e>2&&(sM(i.charCodeAt(2))?++s:n=!1))}if(n){for(;s<t.length&&sM(t.charCodeAt(s));)s++;s>=2&&(t=`\\${t.slice(s)}`)}return sF.normalize(t)},relative(e,t){if(sT(e,"from"),sT(t,"to"),e===t)return"";let i=sF.resolve(e),n=sF.resolve(t);if(i===n||(e=i.toLowerCase(),t=n.toLowerCase(),e===t))return"";if(i.length!==e.length||n.length!==t.length){let e;let t=i.split("\\"),s=n.split("\\");""===t[t.length-1]&&t.pop(),""===s[s.length-1]&&s.pop();let r=t.length,o=s.length,a=r<o?r:o;for(e=0;e<a&&t[e].toLowerCase()===s[e].toLowerCase();e++);return 0===e?n:e===a?o>a?s.slice(e).join("\\"):r>a?"..\\".repeat(r-1-e)+"..":"":"..\\".repeat(r-e)+s.slice(e).join("\\")}let s=0;for(;s<e.length&&92===e.charCodeAt(s);)s++;let r=e.length;for(;r-1>s&&92===e.charCodeAt(r-1);)r--;let o=r-s,a=0;for(;a<t.length&&92===t.charCodeAt(a);)a++;let l=t.length;for(;l-1>a&&92===t.charCodeAt(l-1);)l--;let h=l-a,d=o<h?o:h,u=-1,c=0;for(;c<d;c++){let i=e.charCodeAt(s+c);if(i!==t.charCodeAt(a+c))break;92===i&&(u=c)}if(c!==d){if(-1===u)return n}else{if(h>d){if(92===t.charCodeAt(a+c))return n.slice(a+c+1);if(2===c)return n.slice(a+c)}o>d&&(92===e.charCodeAt(s+c)?u=c:2===c&&(u=3)),-1===u&&(u=0)}let g="";for(c=s+u+1;c<=r;++c)(c===r||92===e.charCodeAt(c))&&(g+=0===g.length?"..":"\\..");return(a+=u,g.length>0)?`${g}${n.slice(a,l)}`:(92===n.charCodeAt(a)&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e||0===e.length)return e;let t=sF.resolve(e);if(t.length<=2)return e;if(92===t.charCodeAt(0)){if(92===t.charCodeAt(1)){let e=t.charCodeAt(2);if(63!==e&&46!==e)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(sA(t.charCodeAt(0))&&58===t.charCodeAt(1)&&92===t.charCodeAt(2))return`\\\\?\\${t}`;return t},dirname(e){sT(e,"path");let t=e.length;if(0===t)return".";let i=-1,n=0,s=e.charCodeAt(0);if(1===t)return sM(s)?e:".";if(sM(s)){if(i=n=1,sM(e.charCodeAt(1))){let s=2,r=2;for(;s<t&&!sM(e.charCodeAt(s));)s++;if(s<t&&s!==r){for(r=s;s<t&&sM(e.charCodeAt(s));)s++;if(s<t&&s!==r){for(r=s;s<t&&!sM(e.charCodeAt(s));)s++;if(s===t)return e;s!==r&&(i=n=s+1)}}}}else sA(s)&&58===e.charCodeAt(1)&&(n=i=t>2&&sM(e.charCodeAt(2))?3:2);let r=-1,o=!0;for(let i=t-1;i>=n;--i)if(sM(e.charCodeAt(i))){if(!o){r=i;break}}else o=!1;if(-1===r){if(-1===i)return".";r=i}return e.slice(0,r)},basename(e,t){let i;void 0!==t&&sT(t,"suffix"),sT(e,"path");let n=0,s=-1,r=!0;if(e.length>=2&&sA(e.charCodeAt(0))&&58===e.charCodeAt(1)&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let o=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){let l=e.charCodeAt(i);if(sM(l)){if(!r){n=i+1;break}}else -1===a&&(r=!1,a=i+1),o>=0&&(l===t.charCodeAt(o)?-1==--o&&(s=i):(o=-1,s=a))}return n===s?s=a:-1===s&&(s=e.length),e.slice(n,s)}for(i=e.length-1;i>=n;--i)if(sM(e.charCodeAt(i))){if(!r){n=i+1;break}}else -1===s&&(r=!1,s=i+1);return -1===s?"":e.slice(n,s)},extname(e){sT(e,"path");let t=0,i=-1,n=0,s=-1,r=!0,o=0;e.length>=2&&58===e.charCodeAt(1)&&sA(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){let t=e.charCodeAt(a);if(sM(t)){if(!r){n=a+1;break}continue}-1===s&&(r=!1,s=a+1),46===t?-1===i?i=a:1!==o&&(o=1):-1!==i&&(o=-1)}
1return -1===i||-1===s||0===o||1===o&&i===s-1&&i===n+1?"":e.slice(i,s)},format:sP.bind(null,"\\"),parse(e){sT(e,"path");let t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;let i=e.length,n=0,s=e.charCodeAt(0);if(1===i)return sM(s)?t.root=t.dir=e:t.base=t.name=e,t;if(sM(s)){if(n=1,sM(e.charCodeAt(1))){let t=2,s=2;for(;t<i&&!sM(e.charCodeAt(t));)t++;if(t<i&&t!==s){for(s=t;t<i&&sM(e.charCodeAt(t));)t++;if(t<i&&t!==s){for(s=t;t<i&&!sM(e.charCodeAt(t));)t++;t===i?n=t:t!==s&&(n=t+1)}}}}else if(sA(s)&&58===e.charCodeAt(1)){if(i<=2)return t.root=t.dir=e,t;if(n=2,sM(e.charCodeAt(2))){if(3===i)return t.root=t.dir=e,t;n=3}}n>0&&(t.root=e.slice(0,n));let r=-1,o=n,a=-1,l=!0,h=e.length-1,d=0;for(;h>=n;--h){if(sM(s=e.charCodeAt(h))){if(!l){o=h+1;break}continue}-1===a&&(l=!1,a=h+1),46===s?-1===r?r=h:1!==d&&(d=1):-1!==r&&(d=-1)}return -1!==a&&(-1===r||0===d||1===d&&r===a-1&&r===o+1?t.base=t.name=e.slice(o,a):(t.name=e.slice(o,r),t.base=e.slice(o,a),t.ext=e.slice(r,a))),o>0&&o!==n?t.dir=e.slice(0,o-1):t.dir=t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},sB=(()=>{if(sI){let e=/\\/g;return()=>{let t=sk().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>sk()})(),sV={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=0&&!i;n--){let s=e[n];sT(s,`paths[${n}]`),0!==s.length&&(t=`${s}/${t}`,i=47===s.charCodeAt(0))}if(!i){let e=sB();t=`${e}/${t}`,i=47===e.charCodeAt(0)}return(t=sO(t,!i,"/",sR),i)?`/${t}`:t.length>0?t:"."},normalize(e){if(sT(e,"path"),0===e.length)return".";let t=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0===(e=sO(e,!t,"/",sR)).length?t?"/":i?"./":".":(i&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(sT(e,"path"),e.length>0&&47===e.charCodeAt(0)),join(...e){if(0===e.length)return".";let t=[];for(let i=0;i<e.length;++i){let n=e[i];sT(n,"path"),n.length>0&&t.push(n)}return 0===t.length?".":sV.normalize(t.join("/"))},relative(e,t){if(sT(e,"from"),sT(t,"to"),e===t||(e=sV.resolve(e),t=sV.resolve(t),e===t))return"";let i=e.length,n=i-1,s=t.length-1,r=n<s?n:s,o=-1,a=0;for(;a<r;a++){let i=e.charCodeAt(1+a);if(i!==t.charCodeAt(1+a))break;47===i&&(o=a)}if(a===r){if(s>r){if(47===t.charCodeAt(1+a))return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>r&&(47===e.charCodeAt(1+a)?o=a:0===a&&(o=0))}let l="";for(a=1+o+1;a<=i;++a)(a===i||47===e.charCodeAt(a))&&(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+o)}`},toNamespacedPath:e=>e,dirname(e){if(sT(e,"path"),0===e.length)return".";let t=47===e.charCodeAt(0),i=-1,n=!0;for(let t=e.length-1;t>=1;--t)if(47===e.charCodeAt(t)){if(!n){i=t;break}}else n=!1;return -1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){let i;void 0!==t&&sT(t,"suffix"),sT(e,"path");let n=0,s=-1,r=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let o=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){let l=e.charCodeAt(i);if(47===l){if(!r){n=i+1;break}}else -1===a&&(r=!1,a=i+1),o>=0&&(l===t.charCodeAt(o)?-1==--o&&(s=i):(o=-1,s=a))}return n===s?s=a:-1===s&&(s=e.length),e.slice(n,s)}for(i=e.length-1;i>=0;--i)if(47===e.charCodeAt(i)){if(!r){n=i+1;break}}else -1===s&&(r=!1,s=i+1);return -1===s?"":e.slice(n,s)},extname(e){sT(e,"path");let t=-1,i=0,n=-1,s=!0,r=0;for(let o=e.length-1;o>=0;--o){let a=e[o];if("/"===a){if(!s){i=o+1;break}continue}-1===n&&(s=!1,n=o+1),"."===a?-1===t?t=o:1!==r&&(r=1):-1!==t&&(r=-1)}return -1===t||-1===n||0===r||1===r&&t===n-1&&t===i+1?"":e.slice(t,n)},format:sP.bind(null,"/"),parse(e){let t;sT(e,"path");let i={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return i;let n=47===e.charCodeAt(0);n?(i.root="/",t=1):t=0;let s=-1,r=0,o=-1,a=!0,l=e.length-1,h=0;for(;l>=t;--l){let t=e.charCodeAt(l);if(47===t){if(!a){r=l+1;break}continue}-1===o&&(a=!1,o=l+1),46===t?-1===s?s=l:1!==h&&(h=1):-1!==s&&(h=-1)}if(-1!==o){let t=0===r&&n?1:r;-1===s||0===h||1===h&&s===o-1&&s===r+1?i.base=i.name=e.slice(t,o):(i.name=e.slice(t,s),i.base=e.slice(t,o),i.ext=e.slice(s,o))}return r>0?i.dir=e.slice(0,r-1):n&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};sV.win32=sF.win32=sF,sV.posix=sF.posix=sV;let sW=sI?sF.normalize:sV.normalize,sH=sI?sF.resolve:sV.resolve,sz=sI?sF.relative:sV.relative,sU=sI?sF.dirname:sV.dirname,sK=sI?sF.basename:sV.basename,s$=sI?sF.extname:sV.extname,sj=sI?sF.sep:sV.sep,sq=/^\w[\w\d+.-]*$/,sG=/^\//,sQ=/^\/\//,sY=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class sJ{static isUri(e){return e instanceof sJ||!!e&&"object"==typeof e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}constructor(e,t,i,n,s,r=!1){"object"==typeof e?(this.scheme=e.scheme||"",this.authority=e.authority||"",this.path=e.path||"",this.query=e.query||"",this.fragment=e.fragment||""):(this.scheme=e||r?e:"file",this.authority=t||"",this.path=function(e,t){switch(e){case"https":case"http":case"file":t?"/"!==t[0]&&(t="/"+t):t="/"}return t}(this.scheme,i||""),this.query=n||"",this.fragment=s||"",function(e,t){if(!e.scheme&&t)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!sq.test(e.scheme))throw Error("[UriError]: Scheme contains illegal characters.");if(e.path){if(e.authority){if(!sG.test(e.path))throw Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(sQ.test(e.path))throw Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}(this,r))}get fsPath(){return s5(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:s,fragment:r}=e;return(void 0===t?t=this.scheme:null===t&&(t=""),void 0===i?i=this.authority:null===i&&(i=""),void 0===n?n=this.path:null===n&&(n=""),void 0===s?s=this.query:null===s&&(s=""),void 0===r?r=this.fragment:null===r&&(r=""),t===this.scheme&&i===this.authority&&n===this.path&&s===this.query&&r===this.fragment)?this:new sX(t,i,n,s,r)}static parse(e,t=!1){let i=sY.exec(e);return i?new sX(i[2]||"",s7(i[4]||""),s7(i[5]||""),s7(i[7]||""),s7(i[9]||""),t):new sX("","","","","")}static file(e){let t="";if(sS.ED&&(e=e.replace(/\\/g,"/")),"/"===e[0]&&"/"===e[1]){let i=e.indexOf("/",2);-1===i?(t=e.substring(2),e="/"):(t=e.substring(2,i),e=e.substring(i)||"/")}return new sX("file",t,e,"","")}static from(e,t){return new sX(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){let i;if(!e.path)throw Error("[UriError]: cannot call joinPath on URI without path");return i=sS.ED&&"file"===e.scheme?sJ.file(sF.join(s5(e,!0),...t)).path:sV.join(e.path,...t),e.with({path:i})}toString(e=!1){return s4(this,e)}toJSON(){return this}static revive(e){if(!e||e instanceof sJ)return e;{let t=new sX(e);return t._formatted=e.external??null,t._fsPath=e._sep===sZ?e.fsPath??null:null,t}}}let sZ=sS.ED?1:void 0;class sX extends sJ{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=s5(this,!1)),this._fsPath}toString(e=!1){return e?s4(this,!0):(this._formatted||(this._formatted=s4(this,!1)),this._formatted)}toJSON(){let e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=sZ),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}let s1={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function s0(e,t,i){let n;let s=-1;for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||45===o||46===o||95===o||126===o||t&&47===o||i&&91===o||i&&93===o||i&&58===o)-1!==s&&(n+=encodeURIComponent(e.substring(s,r)),s=-1),void 0!==n&&(n+=e.charAt(r));else{void 0===n&&(n=e.substr(0,r));let t=s1[o];void 0!==t?(-1!==s&&(n+=encodeURIComponent(e.substring(s,r)),s=-1),n+=t):-1===s&&(s=r)}}return -1!==s&&(n+=encodeURIComponent(e.substring(s))),void 0!==n?n:e}function s2(e){let t;for(let i=0;i<e.length;i++){let n=e.charCodeAt(i);35===n||63===n?(void 0===t&&(t=e.substr(0,i)),t+=s1[n]):void 0!==t&&(t+=e[i])}return void 0!==t?t:e}function s5(e,t){let i;return i=e.authority&&e.path.length>1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&90>=e.path.charCodeAt(1)||e.path.charCodeAt(1)>=97&&122>=e.path.charCodeAt(1))&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,sS.ED&&(i=i.replace(/\//g,"\\")),i}function s4(e,t){let i=t?s2:s0,n="",{scheme:s,authority:r,path:o,query:a,fragment:l}=e;if(s&&(n+=s+":"),(r||"file"===s)&&(n+="//"),r){let e=r.indexOf("@");if(-1!==e){let t=r.substr(0,e);r=r.substr(e+1),-1===(e=t.lastIndexOf(":"))?n+=i(t,!1,!1):n+=i(t.substr(0,e),!1,!1)+":"+i(t.substr(e+1),!1,!0),n+="@"}-1===(e=(r=r.toLowerCase()).lastIndexOf(":"))?n+=i(r,!1,!0):n+=i(r.substr(0,e),!1,!0)+r.substr(e)}if(o){if(o.length>
1=3&&47===o.charCodeAt(0)&&58===o.charCodeAt(2)){let e=o.charCodeAt(1);e>=65&&e<=90&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&58===o.charCodeAt(1)){let e=o.charCodeAt(0);e>=65&&e<=90&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}n+=i(o,!0,!1)}return a&&(n+="?"+i(a,!1,!1)),l&&(n+="#"+(t?l:s0(l,!1,!1))),n}let s6=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function s7(e){return e.match(s6)?e.replace(s6,e=>(function e(t){try{return decodeURIComponent(t)}catch{if(t.length>3)return t.substr(0,3)+e(t.substr(3));return t}})(e)):e}class s3{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new s3(e,t)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(e){return s3.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return s3.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column}isBeforeOrEqual(e){return s3.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column}static compare(e,t){let i=0|e.lineNumber,n=0|t.lineNumber;return i===n?(0|e.column)-(0|t.column):i-n}clone(){return new s3(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new s3(e.lineNumber,e.column)}static isIPosition(e){return!!e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}}class s9{constructor(e,t,i,n){e>i||e===i&&t>n?(this.startLineNumber=i,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=n)}isEmpty(){return s9.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return s9.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber)&&!(t.lineNumber>e.endLineNumber)&&(t.lineNumber!==e.startLineNumber||!(t.column<e.startColumn))&&(t.lineNumber!==e.endLineNumber||!(t.column>e.endColumn))}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber)&&!(t.lineNumber>e.endLineNumber)&&(t.lineNumber!==e.startLineNumber||!(t.column<=e.startColumn))&&(t.lineNumber!==e.endLineNumber||!(t.column>=e.endColumn))}containsRange(e){return s9.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber)&&!(t.endLineNumber<e.startLineNumber)&&!(t.startLineNumber>e.endLineNumber)&&!(t.endLineNumber>e.endLineNumber)&&(t.startLineNumber!==e.startLineNumber||!(t.startColumn<e.startColumn))&&(t.endLineNumber!==e.endLineNumber||!(t.endColumn>e.endColumn))}strictContainsRange(e){return s9.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber)&&!(t.endLineNumber<e.startLineNumber)&&!(t.startLineNumber>e.endLineNumber)&&!(t.endLineNumber>e.endLineNumber)&&(t.startLineNumber!==e.startLineNumber||!(t.startColumn<=e.startColumn))&&(t.endLineNumber!==e.endLineNumber||!(t.endColumn>=e.endColumn))}plusRange(e){return s9.plusRange(this,e)}static plusRange(e,t){let i,n,s,r;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,n=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,n=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,n=e.startColumn),t.endLineNumber>e.endLineNumber?(s=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(s=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(s=e.endLineNumber,r=e.endColumn),new s9(i,n,s,r)}intersectRanges(e){return s9.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn,o=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,h=t.endColumn;return(i<o?(i=o,n=a):i===o&&(n=Math.max(n,a)),s>l?(s=l,r=h):s===l&&(r=Math.min(r,h)),i>s||i===s&&n>r)?null:new s9(i,n,s,r)}equalsRange(e){return s9.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return s9.getEndPosition(this)}static getEndPosition(e){return new s3(e.endLineNumber,e.endColumn)}getStartPosition(){return s9.getStartPosition(this)}static getStartPosition(e){return new s3(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new s9(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new s9(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return s9.collapseToStart(this)}static collapseToStart(e){return new s9(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return s9.collapseToEnd(this)}static collapseToEnd(e){return new s9(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new s9(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,t=e){return new s9(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new s9(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return!!e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber)&&(e.endLineNumber!==t.startLineNumber||!(e.endColumn<t.startColumn))&&!(t.endLineNumber<e.startLineNumber)&&(t.endLineNumber!==e.startLineNumber||!(t.endColumn<e.startColumn))}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber)&&(e.endLineNumber!==t.startLineNumber||!(e.endColumn<=t.startColumn))&&!(t.endLineNumber<e.startLineNumber)&&(t.endLineNumber!==e.startLineNumber||!(t.endColumn<=e.startColumn))}static areOnlyIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber-1)&&(e.endLineNumber!==t.startLineNumber||!(e.endColumn<t.startColumn-1))&&!(t.endLineNumber<e.startLineNumber-1)&&(t.endLineNumber!==e.startLineNumber||!(t.endColumn<e.startColumn-1))}static compareRangesUsingStarts(e,t){if(e&&t){let i=0|e.startLineNumber,n=0|t.startLineNumber;if(i===n){let i=0|e.startColumn,n=0|t.startColumn;if(i===n){let i=0|e.endLineNumber,n=0|t.endLineNumber;return i===n?(0|e.endColumn)-(0|t.endColumn):i-n}return i-n}return i-n}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}}class s8 extends s9{constructor(e,t,i,n){super(e,t,i,n),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=n}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return s8.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return 0===this.getDirection()?new s8(this.startLineNumber,this.startColumn,e,t):new s8(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new s3(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new s3(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return 0===this.getDirection()?new s8(e,t,this.endLineNumber,this.endColumn):new s8(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new s8(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return 0===t?new s8(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new s8(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new s8(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;
1if(e.length!==t.length)return!1;for(let i=0,n=e.length;i<n;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return!!e&&"number"==typeof e.selectionStartLineNumber&&"number"==typeof e.selectionStartColumn&&"number"==typeof e.positionLineNumber&&"number"==typeof e.positionColumn}static createWithDirection(e,t,i,n,s){return 0===s?new s8(e,t,i,n):new s8(i,n,e,t)}}var re=i(11447);let rt=Object.create(null);function ri(e,t){if((0,re.HD)(t)){let i=rt[t];if(void 0===i)throw Error(`${e} references an unknown codicon: ${t}`);t=i}return rt[e]=t,{id:e}}let rn={add:ri("add",6e4),plus:ri("plus",6e4),gistNew:ri("gist-new",6e4),repoCreate:ri("repo-create",6e4),lightbulb:ri("lightbulb",60001),lightBulb:ri("light-bulb",60001),repo:ri("repo",60002),repoDelete:ri("repo-delete",60002),gistFork:ri("gist-fork",60003),repoForked:ri("repo-forked",60003),gitPullRequest:ri("git-pull-request",60004),gitPullRequestAbandoned:ri("git-pull-request-abandoned",60004),recordKeys:ri("record-keys",60005),keyboard:ri("keyboard",60005),tag:ri("tag",60006),gitPullRequestLabel:ri("git-pull-request-label",60006),tagAdd:ri("tag-add",60006),tagRemove:ri("tag-remove",60006),person:ri("person",60007),personFollow:ri("person-follow",60007),personOutline:ri("person-outline",60007),personFilled:ri("person-filled",60007),sourceControl:ri("source-control",60008),mirror:ri("mirror",60009),mirrorPublic:ri("mirror-public",60009),star:ri("star",60010),starAdd:ri("star-add",60010),starDelete:ri("star-delete",60010),starEmpty:ri("star-empty",60010),comment:ri("comment",60011),commentAdd:ri("comment-add",60011),alert:ri("alert",60012),warning:ri("warning",60012),search:ri("search",60013),searchSave:ri("search-save",60013),logOut:ri("log-out",60014),signOut:ri("sign-out",60014),logIn:ri("log-in",60015),signIn:ri("sign-in",60015),eye:ri("eye",60016),eyeUnwatch:ri("eye-unwatch",60016),eyeWatch:ri("eye-watch",60016),circleFilled:ri("circle-filled",60017),primitiveDot:ri("primitive-dot",60017),closeDirty:ri("close-dirty",60017),debugBreakpoint:ri("debug-breakpoint",60017),debugBreakpointDisabled:ri("debug-breakpoint-disabled",60017),debugHint:ri("debug-hint",60017),terminalDecorationSuccess:ri("terminal-decoration-success",60017),primitiveSquare:ri("primitive-square",60018),edit:ri("edit",60019),pencil:ri("pencil",60019),info:ri("info",60020),issueOpened:ri("issue-opened",60020),gistPrivate:ri("gist-private",60021),gitForkPrivate:ri("git-fork-private",60021),lock:ri("lock",60021),mirrorPrivate:ri("mirror-private",60021),close:ri("close",60022),removeClose:ri("remove-close",60022),x:ri("x",60022),repoSync:ri("repo-sync",60023),sync:ri("sync",60023),clone:ri("clone",60024),desktopDownload:ri("desktop-download",60024),beaker:ri("beaker",60025),microscope:ri("microscope",60025),vm:ri("vm",60026),deviceDesktop:ri("device-desktop",60026),file:ri("file",60027),more:ri("more",60028),ellipsis:ri("ellipsis",60028),kebabHorizontal:ri("kebab-horizontal",60028),mailReply:ri("mail-reply",60029),reply:ri("reply",60029),organization:ri("organization",60030),organizationFilled:ri("organization-filled",60030),organizationOutline:ri("organization-outline",60030),newFile:ri("new-file",60031),fileAdd:ri("file-add",60031),newFolder:ri("new-folder",60032),fileDirectoryCreate:ri("file-directory-create",60032),trash:ri("trash",60033),trashcan:ri("trashcan",60033),history:ri("history",60034),clock:ri("clock",60034),folder:ri("folder",60035),fileDirectory:ri("file-directory",60035),symbolFolder:ri("symbol-folder",60035),logoGithub:ri("logo-github",60036),markGithub:ri("mark-github",60036),github:ri("github",60036),terminal:ri("terminal",60037),console:ri("console",60037),repl:ri("repl",60037),zap:ri("zap",60038),symbolEvent:ri("symbol-event",60038),error:ri("error",60039),stop:ri("stop",60039),variable:ri("variable",60040),symbolVariable:ri("symbol-variable",60040),array:ri("array",60042),symbolArray:ri("symbol-array",60042),symbolModule:ri("symbol-module",60043),symbolPackage:ri("symbol-package",60043),symbolNamespace:ri("symbol-namespace",60043),symbolObject:ri("symbol-object",60043),symbolMethod:ri("symbol-method",60044),symbolFunction:ri("symbol-function",60044),symbolConstructor:ri("symbol-constructor",60044),symbolBoolean:ri("symbol-boolean",60047),symbolNull:ri("symbol-null",60047),symbolNumeric:ri("symbol-numeric",60048),symbolNumber:ri("symbol-number",60048),symbolStructure:ri("symbol-structure",60049),symbolStruct:ri("symbol-struct",60049),symbolParameter:ri("symbol-parameter",60050),symbolTypeParameter:ri("symbol-type-parameter",60050),symbolKey:ri("symbol-key",60051),symbolText:ri("symbol-text",60051),symbolReference:ri("symbol-reference",600
152),goToFile:ri("go-to-file",60052),symbolEnum:ri("symbol-enum",60053),symbolValue:ri("symbol-value",60053),symbolRuler:ri("symbol-ruler",60054),symbolUnit:ri("symbol-unit",60054),activateBreakpoints:ri("activate-breakpoints",60055),archive:ri("archive",60056),arrowBoth:ri("arrow-both",60057),arrowDown:ri("arrow-down",60058),arrowLeft:ri("arrow-left",60059),arrowRight:ri("arrow-right",60060),arrowSmallDown:ri("arrow-small-down",60061),arrowSmallLeft:ri("arrow-small-left",60062),arrowSmallRight:ri("arrow-small-right",60063),arrowSmallUp:ri("arrow-small-up",60064),arrowUp:ri("arrow-up",60065),bell:ri("bell",60066),bold:ri("bold",60067),book:ri("book",60068),bookmark:ri("bookmark",60069),debugBreakpointConditionalUnverified:ri("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:ri("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:ri("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:ri("debug-breakpoint-data-unverified",60072),debugBreakpointData:ri("debug-breakpoint-data",60073),debugBreakpointDataDisabled:ri("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:ri("debug-breakpoint-log-unverified",60074),debugBreakpointLog:ri("debug-breakpoint-log",60075),debugBreakpointLogDisabled:ri("debug-breakpoint-log-disabled",60075),briefcase:ri("briefcase",60076),broadcast:ri("broadcast",60077),browser:ri("browser",60078),bug:ri("bug",60079),calendar:ri("calendar",60080),caseSensitive:ri("case-sensitive",60081),check:ri("check",60082),checklist:ri("checklist",60083),chevronDown:ri("chevron-down",60084),chevronLeft:ri("chevron-left",60085),chevronRight:ri("chevron-right",60086),chevronUp:ri("chevron-up",60087),chromeClose:ri("chrome-close",60088),chromeMaximize:ri("chrome-maximize",60089),chromeMinimize:ri("chrome-minimize",60090),chromeRestore:ri("chrome-restore",60091),circleOutline:ri("circle-outline",60092),circle:ri("circle",60092),debugBreakpointUnverified:ri("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:ri("terminal-decoration-incomplete",60092),circleSlash:ri("circle-slash",60093),circuitBoard:ri("circuit-board",60094),clearAll:ri("clear-all",60095),clippy:ri("clippy",60096),closeAll:ri("close-all",60097),cloudDownload:ri("cloud-download",60098),cloudUpload:ri("cloud-upload",60099),code:ri("code",60100),collapseAll:ri("collapse-all",60101),colorMode:ri("color-mode",60102),commentDiscussion:ri("comment-discussion",60103),creditCard:ri("credit-card",60105),dash:ri("dash",60108),dashboard:ri("dashboard",60109),database:ri("database",60110),debugContinue:ri("debug-continue",60111),debugDisconnect:ri("debug-disconnect",60112),debugPause:ri("debug-pause",60113),debugRestart:ri("debug-restart",60114),debugStart:ri("debug-start",60115),debugStepInto:ri("debug-step-into",60116),debugStepOut:ri("debug-step-out",60117),debugStepOver:ri("debug-step-over",60118),debugStop:ri("debug-stop",60119),debug:ri("debug",60120),deviceCameraVideo:ri("device-camera-video",60121),deviceCamera:ri("device-camera",60122),deviceMobile:ri("device-mobile",60123),diffAdded:ri("diff-added",60124),diffIgnored:ri("diff-ignored",60125),diffModified:ri("diff-modified",60126),diffRemoved:ri("diff-removed",60127),diffRenamed:ri("diff-renamed",60128),diff:ri("diff",60129),diffSidebyside:ri("diff-sidebyside",60129),discard:ri("discard",60130),editorLayout:ri("editor-layout",60131),emptyWindow:ri("empty-window",60132),exclude:ri("exclude",60133),extensions:ri("extensions",60134),eyeClosed:ri("eye-closed",60135),fileBinary:ri("file-binary",60136),fileCode:ri("file-code",60137),fileMedia:ri("file-media",60138),filePdf:ri("file-pdf",60139),fileSubmodule:ri("file-submodule",60140),fileSymlinkDirectory:ri("file-symlink-directory",60141),fileSymlinkFile:ri("file-symlink-file",60142),fileZip:ri("file-zip",60143),files:ri("files",60144),filter:ri("filter",60145),flame:ri("flame",60146),foldDown:ri("fold-down",60147),foldUp:ri("fold-up",60148),fold:ri("fold",60149),folderActive:ri("folder-active",60150),folderOpened:ri("folder-opened",60151),gear:ri("gear",60152),gift:ri("gift",60153),gistSecret:ri("gist-secret",60154),gist:ri("gist",60155),gitCommit:ri("git-commit",60156),gitCompare:ri("git-compare",60157),compareChanges:ri("compare-changes",60157),gitMerge:ri("git-merge",60158),githubAction:ri("github-action",60159),githubAlt:ri("github-alt",60160),globe:ri("globe",60161),grabber:ri("grabber",60162),graph:ri("graph",60163),gripper:ri("gripper",60164),heart:ri("heart",60165),home:ri("home",60166),horizontalRule:ri("horizontal-rule",60167),hubot:ri("hubot",60168),inbox:ri("inbox",60169),issueReopened:ri("issue-reopened",60171),issues:ri("issues",60172),italic:ri("italic",60173),jersey:ri("jersey",60174),json:ri("json",60175),kebabVertical:ri("kebab-vertical",60176),key:ri("key",60177),law:ri("law",60178),lightbulbAutofix:ri("lightbulb-autofix",60179),linkExternal:ri("link-external",60180),link:ri("link",60181),listOrdered:ri("list-ordered",60182),listUnordered:ri("list-unordered",60183),liveShare:ri("live-share",60184),loading:ri("loading",60185),location:ri("location",60186),mailRead:ri("mail-read",60187),mail:ri("mail",60188),markdown:ri("markdown",60189),megaphone:ri("megaphone",60190),mention:ri("mention",60191),milestone:ri("milestone",60192),gitPullRequestMilestone:ri("git-pull-request-milestone",60192),mortarBoard:ri("mortar-board",60193),move:ri("move",60194),multipleWindows:ri("multiple-windows",60195),mute:ri("mute",60196),noNewline:ri("no-newline",60197),note:ri("note",60198),octoface:ri("octoface",60199),openPreview:ri("open-preview",60200),package:ri("package",60201),paintcan:ri("paintcan",60202),pin:ri("pin",60203),play:ri("play",60204),run:ri("run",60204),plug:ri("plug",60205),preserveCase:ri("preserve-case",60206),preview:ri("preview",60207),project:ri("project",60208),pulse:ri("pulse",60209),question:ri("question",60210),quote:ri("quote",60211),radioTower:ri("radio-tower",60212),reactions:ri("reactions",60213),references:ri("references",60214),refresh:ri("refresh",60215),regex:ri("regex",60216),remoteExplorer:ri("remote-explorer",60217),remote:ri("remote",60218),remove:ri("remove",60219),replaceAll:ri("replace-all",60220),replace:ri("replace",60221),repoClone:ri("repo-clone",60222),repoForcePush:ri("repo-force-push",60223),repoPull:ri("repo-pull",60224),repoPush:ri("repo-push",60225),report:ri("report",60226),requestChanges:ri("request-changes",60227),rocket:ri("rocket",60228),rootFolderOpened:ri("root-folder-opened",60229),rootFolder:ri("root-folder",60230),rss:ri("rss",60231),ruby:ri("ruby",60232),saveAll:ri("save-all",60233),saveAs:ri("save-as",60234),save:ri("save",60235),screenFull:ri("screen-full",60236),screenNormal:ri("screen-normal",60237),searchStop:ri("search-stop",60238),server:ri("server",60240),settingsGear:ri("settings-gear",60241),settings:ri("settings",60242),shield:ri("shield",60243),smiley:ri("smiley",60244),sortPrecedence:ri("sort-precedence",60245),splitHorizontal:ri("split-horizontal",60246),splitVertical:ri("split-vertical",60247),squirrel:ri("squirrel",60248),starFull:ri("star-full",60249),starHalf:ri("star-half",60250),symbolClass:ri("symbol-class",60251),symbolColor:ri("symbol-color",60252),symbolConstant:ri("symbol-constant",60253),symbolEnumMember:ri("symbol-enum-member",60254),symbolField:ri("symbol-field",60255),symbolFile:ri("symbol-file",60256),symbolInterface:ri("symbol-interface",60257),symbolKeyword:ri("symbol-keyword",60258),symbolMisc:ri("symbol-misc",60259),symbolOperator:ri("symbol-operator",60260),symbolProperty:ri("symbol-property",60261),wrench:ri("wrench",60261),wrenchSubaction:ri("wrench-subaction",60261),symbolSnippet:ri("symbol-snippet",60262),tasklist:ri("tasklist",60263),telescope:ri("telescope",60264),textSize:ri("text-size",60265),threeBars:ri("three-bars",60266),thumbsdown:ri("thumbsdown",60267),thumbsup:ri("thumbsup",60268),tools:ri("tools",60269),triangleDown:ri("triangle-down",60270),triangleLeft:ri("triangle-left",60271),triangleRight:ri("triangle-right",60272),triangleUp:ri("triangle-up",60273),twitter:ri("twitter",60274),unfold:ri("unfold",60275),unlock:ri("unlock",60276),unmute:ri("unmute",60277),unverified:ri("unverified",60278),verified:ri("verified",60279),versions:ri("versions",60280),vmActive:ri("vm-active",60281),vmOutline:ri("vm-outline",60282),vmRunning:ri("vm-running",60283),watch:ri("watch",60284),whitespace:ri("whitespace",60285),wholeWord:ri("whole-word",60286
1),window:ri("window",60287),wordWrap:ri("word-wrap",60288),zoomIn:ri("zoom-in",60289),zoomOut:ri("zoom-out",60290),listFilter:ri("list-filter",60291),listFlat:ri("list-flat",60292),listSelection:ri("list-selection",60293),selection:ri("selection",60293),listTree:ri("list-tree",60294),debugBreakpointFunctionUnverified:ri("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:ri("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:ri("debug-breakpoint-function-disabled",60296),debugStackframeActive:ri("debug-stackframe-active",60297),circleSmallFilled:ri("circle-small-filled",60298),debugStackframeDot:ri("debug-stackframe-dot",60298),terminalDecorationMark:ri("terminal-decoration-mark",60298),debugStackframe:ri("debug-stackframe",60299),debugStackframeFocused:ri("debug-stackframe-focused",60299),debugBreakpointUnsupported:ri("debug-breakpoint-unsupported",60300),symbolString:ri("symbol-string",60301),debugReverseContinue:ri("debug-reverse-continue",60302),debugStepBack:ri("debug-step-back",60303),debugRestartFrame:ri("debug-restart-frame",60304),debugAlt:ri("debug-alt",60305),callIncoming:ri("call-incoming",60306),callOutgoing:ri("call-outgoing",60307),menu:ri("menu",60308),expandAll:ri("expand-all",60309),feedback:ri("feedback",60310),gitPullRequestReviewer:ri("git-pull-request-reviewer",60310),groupByRefType:ri("group-by-ref-type",60311),ungroupByRefType:ri("ungroup-by-ref-type",60312),account:ri("account",60313),gitPullRequestAssignee:ri("git-pull-request-assignee",60313),bellDot:ri("bell-dot",60314),debugConsole:ri("debug-console",60315),library:ri("library",60316),output:ri("output",60317),runAll:ri("run-all",60318),syncIgnored:ri("sync-ignored",60319),pinned:ri("pinned",60320),githubInverted:ri("github-inverted",60321),serverProcess:ri("server-process",60322),serverEnvironment:ri("server-environment",60323),pass:ri("pass",60324),issueClosed:ri("issue-closed",60324),stopCircle:ri("stop-circle",60325),playCircle:ri("play-circle",60326),record:ri("record",60327),debugAltSmall:ri("debug-alt-small",60328),vmConnect:ri("vm-connect",60329),cloud:ri("cloud",60330),merge:ri("merge",60331),export:ri("export",60332),graphLeft:ri("graph-left",60333),magnet:ri("magnet",60334),notebook:ri("notebook",60335),redo:ri("redo",60336),checkAll:ri("check-all",60337),pinnedDirty:ri("pinned-dirty",60338),passFilled:ri("pass-filled",60339),circleLargeFilled:ri("circle-large-filled",60340),circleLarge:ri("circle-large",60341),circleLargeOutline:ri("circle-large-outline",60341),combine:ri("combine",60342),gather:ri("gather",60342),table:ri("table",60343),variableGroup:ri("variable-group",60344),typeHierarchy:ri("type-hierarchy",60345),typeHierarchySub:ri("type-hierarchy-sub",60346),typeHierarchySuper:ri("type-hierarchy-super",60347),gitPullRequestCreate:ri("git-pull-request-create",60348),runAbove:ri("run-above",60349),runBelow:ri("run-below",60350),notebookTemplate:ri("notebook-template",60351),debugRerun:ri("debug-rerun",60352),workspaceTrusted:ri("workspace-trusted",60353),workspaceUntrusted:ri("workspace-untrusted",60354),workspaceUnknown:ri("workspace-unknown",60355),terminalCmd:ri("terminal-cmd",60356),terminalDebian:ri("terminal-debian",60357),terminalLinux:ri("terminal-linux",60358),terminalPowershell:ri("terminal-powershell",60359),terminalTmux:ri("terminal-tmux",60360),terminalUbuntu:ri("terminal-ubuntu",60361),terminalBash:ri("terminal-bash",60362),arrowSwap:ri("arrow-swap",60363),copy:ri("copy",60364),personAdd:ri("person-add",60365),filterFilled:ri("filter-filled",60366),wand:ri("wand",60367),debugLineByLine:ri("debug-line-by-line",60368),inspect:ri("inspect",60369),layers:ri("layers",60370),layersDot:ri("layers-dot",60371),layersActive:ri("layers-active",60372),compass:ri("compass",60373),compassDot:ri("compass-dot",60374),compassActive:ri("compass-active",60375),azure:ri("azure",60376),issueDraft:ri("issue-draft",60377),gitPullRequestClosed:ri("git-pull-request-closed",60378),gitPullRequestDraft:ri("git-pull-request-draft",60379),debugAll:ri("debug-all",60380),debugCoverage:ri("debug-coverage",60381),runErrors:ri("run-errors",60382),folderLibrary:ri("folder-library",60383),debugContinueSmall:ri("debug-continue-small",60384),beakerStop:ri("beaker-stop",60385),graphLine:ri("graph-line",60386),graphScatter:ri("graph-scatter",60387),pieChart:ri("pie-chart",60388),bracket:ri("bracket",60175),bracketDot:ri("bracket-dot",60389),bracketError:ri("bracket-error",60390),lockSmall:ri("lock-small",60391),azureDevops:ri("azure-devops",60392),verifiedFilled:ri("verified-filled",60393),newline:ri("newline",60394),layout:ri("layout",60395),layoutActivitybarLeft:ri("layout-activitybar-left",60396),layoutActivitybarRight:ri("layout-activitybar-right",60397),layoutPanelLeft:ri("layout-panel-left",60398),layoutPanelCenter:ri("layout-panel-center",60399),layoutPanelJustify:ri("layout-panel-justify",60400),layoutPanelRight:ri("layout-panel-right",60401),layoutPanel:ri("layout-panel",60402),layoutSidebarLeft:ri("layout-sidebar-left",60403),layoutSidebarRight:ri("layout-sidebar-right",60404),layoutStatusbar:ri("layout-statusbar",60405),layoutMenubar:ri("layout-menubar",60406),layoutCentered:ri("layout-centered",60407),target:ri("target",60408),indent:ri("indent",60409),recordSmall:ri("record-small",60410),errorSmall:ri("error-small",60411),terminalDecorationError:ri("terminal-decoration-error",60411),arrowCircleDown:ri("arrow-circle-down",60412),arrowCircleLeft:ri("arrow-circle-left",60413),arrowCircleRight:ri("arrow-circle-right",60414),arrowCircleUp:ri("arrow-circle-up",60415),layoutSidebarRightOff:ri("layout-sidebar-right-off",60416),layoutPanelOff:ri("layout-panel-off",60417),layoutSidebarLeftOff:ri("layout-sidebar-left-
1off",60418),blank:ri("blank",60419),heartFilled:ri("heart-filled",60420),map:ri("map",60421),mapHorizontal:ri("map-horizontal",60421),foldHorizontal:ri("fold-horizontal",60421),mapFilled:ri("map-filled",60422),mapHorizontalFilled:ri("map-horizontal-filled",60422),foldHorizontalFilled:ri("fold-horizontal-filled",60422),circleSmall:ri("circle-small",60423),bellSlash:ri("bell-slash",60424),bellSlashDot:ri("bell-slash-dot",60425),commentUnresolved:ri("comment-unresolved",60426),gitPullRequestGoToChanges:ri("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:ri("git-pull-request-new-changes",60428),searchFuzzy:ri("search-fuzzy",60429),commentDraft:ri("comment-draft",60430),send:ri("send",60431),sparkle:ri("sparkle",60432),insert:ri("insert",60433),mic:ri("mic",60434),thumbsdownFilled:ri("thumbsdown-filled",60435),thumbsupFilled:ri("thumbsup-filled",60436),coffee:ri("coffee",60437),snake:ri("snake",60438),game:ri("game",60439),vr:ri("vr",60440),chip:ri("chip",60441),piano:ri("piano",60442),music:ri("music",60443),micFilled:ri("mic-filled",60444),repoFetch:ri("repo-fetch",60445),copilot:ri("copilot",60446),lightbulbSparkle:ri("lightbulb-sparkle",60447),robot:ri("robot",60448),sparkleFilled:ri("sparkle-filled",60449),diffSingle:ri("diff-single",60450),diffMultiple:ri("diff-multiple",60451),surroundWith:ri("surround-with",60452),share:ri("share",60453),gitStash:ri("git-stash",60454),gitStashApply:ri("git-stash-apply",60455),gitStashPop:ri("git-stash-pop",60456),vscode:ri("vscode",60457),vscodeInsiders:ri("vscode-insiders",60458),codeOss:ri("code-oss",60459),runCoverage:ri("run-coverage",60460),runAllCoverage:ri("run-all-coverage",60461),coverage:ri("coverage",60462),githubProject:ri("github-project",60463),mapVertical:ri("map-vertical",60464),foldVertical:ri("fold-vertical",60464),mapVerticalFilled:ri("map-vertical-filled",60465),foldVerticalFilled:ri("fold-vertical-filled",60465),goToSearch:ri("go-to-search",60466),percentage:ri("percentage",60467),sortPercentage:ri("sort-percentage",60467),attach:ri("attach",60468),goToEditingSession:ri("go-to-editing-session",60469),editSession:ri("edit-session",60470),codeReview:ri("code-review",60471),copilotWarning:ri("copilot-warning",60472),python:ri("python",60473),copilotLarge:ri("copilot-large",60474),copilotWarningLarge:ri("copilot-warning-large",60475),keyboardTab:ri("keyboard-tab",60476),copilotBlocked:ri("copilot-blocked",60477),copilotNotConnected:ri("copilot-not-connected",60478),flag:ri("flag",60479),lightbulbEmpty:ri("lightbulb-empty",60480),symbolMethodArrow:ri("symbol-method-arrow",60481),copilotUnavailable:ri("copilot-unavailable",60482),repoPinned:ri("repo-pinned",60483),keyboardTabAbove:ri("keyboard-tab-above",60484),keyboardTabBelow:ri("keyboard-tab-below",60485),gitPullRequestDone:ri("git-pull-request-done",60486),mcp:ri("mcp",60487),extensionsLarge:ri("extensions-large",60488),layoutPanelDock:ri("layout-panel-dock",60489),layoutSidebarLeftDock:ri("layout-sidebar-left-dock",60490),layoutSidebarRightDock:ri("layout-sidebar-right-dock",60491),copilotInProgress:ri("copilot-in-progress",60492),copilotError:ri("copilot-error",60493),copilotSuccess:ri("copilot-success",60494),chatSparkle:ri("chat-sparkle",60495),searchSparkle:ri("search-sparkle",60496),editSparkle:ri("edit-sparkle",60497),copilotSnooze:ri("copilot-snooze",60498),sendToRemoteAgent:ri("send-to-remote-agent",60499),commentDiscussionSparkle:ri("comment-discussion-sparkle",60500),chatSparkleWarning:ri("chat-sparkle-warning",60501),chatSparkleError:ri("chat-sparkle-error",60502),collection:ri("collection",60503),newCollection:ri("new-collection",60504),thinking:ri("thinking",60505),build:ri("build",60506),commentDiscussionQuote:ri("comment-discussion-quote",60507),cursor:ri("cursor",60508),eraser:ri("eraser",60509),fileText:ri("file-text",60510),gitLens:ri("git-lens",60511),quotes:ri("quotes",60512),rename:ri("rename",60513),runWithDeps:ri("run-with-deps",60514),debugConnected:ri("debug-connected",60515),strikethrough:ri("strikethrough",60516),openInProduct:ri("open-in-product",60517),indexZero:ri("index-zero",60518),agent:ri("agent",60519),editCode:ri("edit-code",60520),repoSelected:ri("repo-selected",60521),skip:ri("skip",60522),mergeInto:ri("merge-into",60523),gitBranchChanges:ri("git-branch-changes",60524),gitBranchStagedChanges:ri("git-branch-staged-changes",60525),gitBranchConflicts:ri("git-branch-conflicts",60526),gitBranch:ri("git-branch",60527),gitBranchCreate:ri("git-branch-create",60527),gitBranchDelete:ri("git-branch-delete",60527),searchLarge:ri("search-large",60528),terminalGitBash:ri("terminal-git-bash",60529)},rs={dialogError:ri("dialog-error","error"),dialogWarning:ri("dialog-warning","warning"),dialogInfo:ri("dialog-info","info"),dialogClose:ri("dialog-close","close"),treeItemExpanded:ri("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:ri("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:ri("tree-filter-on-type-off","list-selection"),treeFilterClear:ri("tree-filter-clear","close"),treeItemLoading:ri("tree-item-loading","loading"),menuSelection:ri("menu-selection","check"),menuSubmenu:ri("menu-submenu","chevron-right"),menuBarMore:ri("menubar-more","more"),scrollbarButtonLeft:ri("scrollbar-button-left","triangle-left"),scrollbarButtonRight:ri("scrollbar-button-right","triangle-right"),scrollbarButtonUp:ri("scrollbar-button-up","triangle-up"),scrollbarButtonDown:ri("scrollbar-button-down","triangle-down"),toolBarMore:ri("toolbar-more","more"),quickInputBack:ri("quick-input-back","arrow-left"),dropDownButton:ri("drop-down-button",60084),symbolCustomColor:ri("symbol-customcolor",60252),exportIcon:ri("export",60332),workspaceUnspecified:ri("workspace-unspecified",60355),newLine:ri("newline",60394),thumbsDownFilled:ri("thumbsdown-filled",60435),thumbsUpFilled:ri("thumbsup-filled",60436),gitFetch:ri("git-fetch",60445),lightbulbSparkleAutofix:ri("lightbulb-sparkle-autofix",60447),debugBreakp
1ointPending:ri("debug-breakpoint-pending",60377)},rr={...rn,...rs};var ro=i(68795);class ra{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new sd.Q5,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),(0,ro.OF)(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();let i=new rl(this,e,t);return this._factories.set(e,i),(0,ro.OF)(()=>{let t=this._factories.get(e);t&&t===i&&(this._factories.delete(e),t.dispose())})}async getOrCreate(e){let t=this.get(e);if(t)return t;let i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;let t=this._factories.get(e);return!t||!!t.isResolved}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}}class rl extends ro.JT{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){let e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}var rh=i(34187);class rd{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}class ru{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class rc{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}(T=tR||(tR={}))[T.Increase=0]="Increase",T[T.Decrease=1]="Decrease",function(e){let t=new Map;t.set(0,rr.symbolMethod),t.set(1,rr.symbolFunction),t.set(2,rr.symbolConstructor),t.set(3,rr.symbolField),t.set(4,rr.symbolVariable),t.set(5,rr.symbolClass),t.set(6,rr.symbolStruct),t.set(7,rr.symbolInterface),t.set(8,rr.symbolModule),t.set(9,rr.symbolProperty),t.set(10,rr.symbolEvent),t.set(11,rr.symbolOperator),t.set(12,rr.symbolUnit),t.set(13,rr.symbolValue),t.set(15,rr.symbolEnum),t.set(14,rr.symbolConstant),t.set(15,rr.symbolEnum),t.set(16,rr.symbolEnumMember),t.set(17,rr.symbolKeyword),t.set(28,rr.symbolSnippet),t.set(18,rr.symbolText),t.set(19,rr.symbolColor),t.set(20,rr.symbolFile),t.set(21,rr.symbolReference),t.set(22,rr.symbolCustomColor),t.set(23,rr.symbolFolder),t.set(24,rr.symbolTypeParameter),t.set(25,rr.account),t.set(26,rr.issues),t.set(27,rr.tools),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for CompletionItemKind "+e),i=rr.symbolProperty),i},e.toLabel=function(e){switch(e){case 0:return(0,rh.NC)(728,"Method");case 1:return(0,rh.NC)(729,"Function");case 2:return(0,rh.NC)(730,"Constructor");case 3:return(0,rh.NC)(731,"Field");case 4:return(0,rh.NC)(732,"Variable");case 5:return(0,rh.NC)(733,"Class");case 6:return(0,rh.NC)(734,"Struct");case 7:return(0,rh.NC)(735,"Interface");case 8:return(0,rh.NC)(736,"Module");case 9:return(0,rh.NC)(737,"Property");case 10:return(0,rh.NC)(738,"Event");case 11:return(0,rh.NC)(739,"Operator");case 12:return(0,rh.NC)(740,"Unit");case 13:return(0,rh.NC)(741,"Value");case 14:return(0,rh.NC)(742,"Constant");case 15:return(0,rh.NC)(743,"Enum");case 16:return(0,rh.NC)(744,"Enum Member");case 17:return(0,rh.NC)(745,"Keyword");case 18:return(0,rh.NC)(746,"Text");case 19:return(0,rh.NC)(747,"Color");case 20:return(0,rh.NC)(748,"File");case 21:return(0,rh.NC)(749,"Reference");case 22:return(0,rh.NC)(750,"Custom Color");case 23:return(0,rh.NC)(751,"Folder");case 24:return(0,rh.NC)(752,"Type Parameter");case 25:return(0,rh.NC)(753,"User");case 26:return(0,rh.NC)(754,"Issue");case 27:return(0,rh.NC)(755,"Tool");case 28:return(0,rh.NC)(756,"Snippet");default:return""}};let i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",28),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),i.set("tool",27),e.fromString=function(e,t){let n=i.get(e);return void 0!==n||t||(n=9),n}}(tA||(tA={})),(I=tO||(tO={}))[I.Automatic=0]="Automatic",I[I.Explicit=1]="Explicit";class rg{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return s9.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}(M=tP||(tP={}))[M.Code=1]="Code",M[M.Label=2]="Label",(R=tF||(tF={}))[R.Accepted=0]="Accepted",R[R.Rejected=1]="Rejected",R[R.Ignored=2]="Ignored",(A=tB||(tB={}))[A.Automatic=0]="Automatic",A[A.PasteAs=1]="PasteAs",(O=tV||(tV={}))[O.Invoke=1]="Invoke",O[O.TriggerCharacter=2]="TriggerCharacter",O[O.ContentChange=3]="ContentChange",(P=tW||(tW={}))[P.Text=0]="Text",P[P.Read=1]="Read",P[P.Write=2]="Write",(0,rh.NC)(757,"array"),(0,rh.NC)(758,"boolean"),(0,rh.NC)(759,"class"),(0,rh.NC)(760,"constant"),(0,rh.NC)(761,"constructor"),(0,rh.NC)(762,"enumeration"),(0,rh.NC)(763,"enumeration member"),(0,rh.NC)(764,"event"),(0,rh.NC)(765,"field"),(0,rh.NC)(766,"file"),(0,rh.NC)(76
17,"function"),(0,rh.NC)(768,"interface"),(0,rh.NC)(769,"key"),(0,rh.NC)(770,"method"),(0,rh.NC)(771,"module"),(0,rh.NC)(772,"namespace"),(0,rh.NC)(773,"null"),(0,rh.NC)(774,"number"),(0,rh.NC)(775,"object"),(0,rh.NC)(776,"operator"),(0,rh.NC)(777,"package"),(0,rh.NC)(778,"property"),(0,rh.NC)(779,"string"),(0,rh.NC)(780,"struct"),(0,rh.NC)(781,"type parameter"),(0,rh.NC)(782,"variable"),function(e){let t=new Map;t.set(0,rr.symbolFile),t.set(1,rr.symbolModule),t.set(2,rr.symbolNamespace),t.set(3,rr.symbolPackage),t.set(4,rr.symbolClass),t.set(5,rr.symbolMethod),t.set(6,rr.symbolProperty),t.set(7,rr.symbolField),t.set(8,rr.symbolConstructor),t.set(9,rr.symbolEnum),t.set(10,rr.symbolInterface),t.set(11,rr.symbolFunction),t.set(12,rr.symbolVariable),t.set(13,rr.symbolConstant),t.set(14,rr.symbolString),t.set(15,rr.symbolNumber),t.set(16,rr.symbolBoolean),t.set(17,rr.symbolArray),t.set(18,rr.symbolObject),t.set(19,rr.symbolKey),t.set(20,rr.symbolNull),t.set(21,rr.symbolEnumMember),t.set(22,rr.symbolStruct),t.set(23,rr.symbolEvent),t.set(24,rr.symbolOperator),t.set(25,rr.symbolTypeParameter),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for SymbolKind "+e),i=rr.symbolProperty),i};let i=new Map;i.set(0,20),i.set(1,8),i.set(2,8),i.set(3,8),i.set(4,5),i.set(5,0),i.set(6,9),i.set(7,3),i.set(8,2),i.set(9,15),i.set(10,7),i.set(11,1),i.set(12,4),i.set(13,14),i.set(14,18),i.set(15,13),i.set(16,13),i.set(17,13),i.set(18,13),i.set(19,17),i.set(20,13),i.set(21,16),i.set(22,6),i.set(23,10),i.set(24,11),i.set(25,24),e.toCompletionKind=function(e){let t=i.get(e);return void 0===t&&(console.info("No completion kind found for SymbolKind "+e),t=20),t}}(tH||(tH={}));class rf{static{this.Comment=new rf("comment")}static{this.Imports=new rf("imports")}static{this.Region=new rf("region")}static fromValue(e){switch(e){case"comment":return rf.Comment;case"imports":return rf.Imports;case"region":return rf.Region}return new rf(e)}constructor(e){this.value=e}}(F=tz||(tz={}))[F.AIGenerated=1]="AIGenerated",(B=tU||(tU={}))[B.Invoke=0]="Invoke",B[B.Automatic=1]="Automatic",(tK||(tK={})).is=function(e){return!!e&&"object"==typeof e&&"string"==typeof e.id&&"string"==typeof e.title},(V=t$||(t$={}))[V.Type=1]="Type",V[V.Parameter=2]="Parameter";class rm{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}let rp=new ra;(W=tj||(tj={}))[W.Unknown=0]="Unknown",W[W.Disabled=1]="Disabled",W[W.Enabled=2]="Enabled",(H=tq||(tq={}))[H.Invoke=1]="Invoke",H[H.Auto=2]="Auto",(z=tG||(tG={}))[z.None=0]="None",z[z.KeepWhitespace=1]="KeepWhitespace",z[z.InsertAsSnippet=4]="InsertAsSnippet",(U=tQ||(tQ={}))[U.Method=0]="Method",U[U.Function=1]="Function",U[U.Constructor=2]="Constructor",U[U.Field=3]="Field",U[U.Variable=4]="Variable",U[U.Class=5]="Class",U[U.Struct=6]="Struct",U[U.Interface=7]="Interface",U[U.Module=8]="Module",U[U.Property=9]="Property",U[U.Event=10]="Event",U[U.Operator=11]="Operator",U[U.Unit=12]="Unit",U[U.Value=13]="Value",U[U.Constant=14]="Constant",U[U.Enum=15]="Enum",U[U.EnumMember=16]="EnumMember",U[U.Keyword=17]="Keyword",U[U.Text=18]="Text",U[U.Color=19]="Color",U[U.File=20]="File",U[U.Reference=21]="Reference",U[U.Customcolor=22]="Customcolor",U[U.Folder=23]="Folder",U[U.TypeParameter=24]="TypeParameter",U[U.User=25]="User",U[U.Issue=26]="Issue",U[U.Tool=27]="Tool",U[U.Snippet=28]="Snippet",(K=tY||(tY={}))[K.Deprecated=1]="Deprecated",($=tJ||(tJ={}))[$.Invoke=0]="Invoke",$[$.TriggerCharacter=1]="TriggerCharacter",$[$.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions",(j=tZ||(tZ={}))[j.EXACT=0]="EXACT",j[j.ABOVE=1]="ABOVE",j[j.BELOW=2]="BELOW",(q=tX||(tX={}))[q.NotSet=0]="NotSet",q[q.ContentFlush=1]="ContentFlush",q[q.RecoverFromMarkers=2]="RecoverFromMarkers",q[q.Explicit=3]="Explicit",q[q.Paste=4]="Paste",q[q.Undo=5]="Undo",q[q.Redo=6]="Redo",(G=t1||(t
11={}))[G.LF=1]="LF",G[G.CRLF=2]="CRLF",(Q=t0||(t0={}))[Q.Text=0]="Text",Q[Q.Read=1]="Read",Q[Q.Write=2]="Write",(Y=t2||(t2={}))[Y.None=0]="None",Y[Y.Keep=1]="Keep",Y[Y.Brackets=2]="Brackets",Y[Y.Advanced=3]="Advanced",Y[Y.Full=4]="Full",(J=t5||(t5={}))[J.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",J[J.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",J[J.accessibilitySupport=2]="accessibilitySupport",J[J.accessibilityPageSize=3]="accessibilityPageSize",J[J.allowOverflow=4]="allowOverflow",J[J.allowVariableLineHeights=5]="allowVariableLineHeights",J[J.allowVariableFonts=6]="allowVariableFonts",J[J.allowVariableFontsInAccessibilityMode=7]="allowVariableFontsInAccessibilityMode",J[J.ariaLabel=8]="ariaLabel",J[J.ariaRequired=9]="ariaRequired",J[J.autoClosingBrackets=10]="autoClosingBrackets",J[J.autoClosingComments=11]="autoClosingComments",J[J.screenReaderAnnounceInlineSuggestion=12]="screenReaderAnnounceInlineSuggestion",J[J.autoClosingDelete=13]="autoClosingDelete",J[J.autoClosingOvertype=14]="autoClosingOvertype",J[J.autoClosingQuotes=15]="autoClosingQuotes",J[J.autoIndent=16]="autoIndent",J[J.autoIndentOnPaste=17]="autoIndentOnPaste",J[J.autoIndentOnPasteWithinString=18]="autoIndentOnPasteWithinString",J[J.automaticLayout=19]="automaticLayout",J[J.autoSurround=20]="autoSurround",J[J.bracketPairColorization=21]="bracketPairColorization",J[J.guides=22]="guides",J[J.codeLens=23]="codeLens",J[J.codeLensFontFamily=24]="codeLensFontFamily",J[J.codeLensFontSize=25]="codeLensFontSize",J[J.colorDecorators=26]="colorDecorators",J[J.colorDecoratorsLimit=27]="colorDecoratorsLimit",J[J.columnSelection=28]="columnSelection",J[J.comments=29]="comments",J[J.contextmenu=30]="contextmenu",J[J.copyWithSyntaxHighlighting=31]="copyWithSyntaxHighlighting",J[J.cursorBlinking=32]="cursorBlinking",J[J.cursorSmoothCaretAnimation=33]="cursorSmoothCaretAnimation",J[J.cursorStyle=34]="cursorStyle",J[J.cursorSurroundingLines=35]="cursorSurroundingLines",J[J.cursorSurroundingLinesStyle=36]="cursorSurroundingLinesStyle",J[J.cursorWidth=37]="cursorWidth",J[J.cursorHeight=38]="cursorHeight",J[J.disableLayerHinting=39]="disableLayerHinting",J[J.disableMonospaceOptimizations=40]="disableMonospaceOptimizations",J[J.domReadOnly=41]="domReadOnly",J[J.dragAndDrop=42]="dragAndDrop",J[J.dropIntoEditor=43]="dropIntoEditor",J[J.editContext=44]="editContext",J[J.emptySelectionClipboard=45]="emptySelectionClipboard",J[J.experimentalGpuAcceleration=46]="experimentalGpuAcceleration",J[J.experimentalWhitespaceRendering=47]="experimentalWhitespaceRendering",J[J.extraEditorClassName=48]="extraEditorClassName",J[J.fastScrollSensitivity=49]="fastScrollSensitivity",J[J.find=50]="find",J[J.fixedOverflowWidgets=51]="fixedOverflowWidgets",J[J.folding=52]="folding",J[J.foldingStrategy=53]="foldingStrategy",J[J.foldingHighlight=54]="foldingHighlight",J[J.foldingImportsByDefault=55]="foldingImportsByDefault",J[J.foldingMaximumRegions=56]="foldingMaximumRegions",J[J.unfoldOnClickAfterEndOfLine=57]="unfoldOnClickAfterEndOfLine",J[J.fontFamily=58]="fontFamily",J[J.fontInfo=59]="fontInfo",J[J.fontLigatures=60]="fontLigatures",J[J.fontSize=61]="fontSize",J[J.fontWeight=62]="fontWeight",J[J.fontVariations=63]="fontVariations",J[J.formatOnPaste=64]="formatOnPaste",J[J.formatOnType=65]="formatOnType",J[J.glyphMargin=66]="glyphMargin",J[J.gotoLocation=67]="gotoLocation",J[J.hideCursorInOverviewRuler=68]="hideCursorInOverviewRuler",J[J.hover=69]="hover",J[J.inDiffEditor=70]="inDiffEditor",J[J.inlineSuggest=71]="inlineSuggest",J[J.letterSpacing=72]="letterSpacing",J[J.lightbulb=73]="lightbulb",J[J.lineDecorationsWidth=74]="lineDecorationsWidth",J[J.lineHeight=75]="lineHeight",J[J.lineNumbers=76]="lineNumbers",J[J.lineNumbersMinChars=77]="lineNumbersMinChars",J[J.linkedEditing=78]="linkedEditing",J[J.links=79]="links",J[J.matchBrackets=80]="matchBrackets",J[J.minimap=81]="minimap",J[J.mouseStyle=82]="mouseStyle",J[J.mouseWheelScrollSensitivity=83]="mouseWheelScrollSensitivity",J[J.mouseWheelZoom=84]="mouseWheelZoom",J[J.multiCursorMergeOverlapping=85]="multiCursorMergeOverlapping",J[J.multiCursorModifier=86]="multiCursorModifier",J[J.mouseMiddleClickAction=87]="mouseMiddleClickAction",J[J.multiCursorPaste=88]="multiCursorPaste",J[J.multiCursorLimit=89]="multiCursorLimit",J[J.occurrencesHighlight=90]="occurrencesHighlight",J[J.occurrencesHighlightDelay=91]="occurrencesHighlightDelay",J[J.overtypeCursorStyle=92]="overtypeCursorStyle",J[J.overtypeOnPaste=93]="overtypeOnPaste",J[J.overviewRulerBorder=94]="overviewRulerBorder",J[J.overviewRulerLanes=95]="overviewRulerLanes",J[J.padding=96]="padding",J[J.pasteAs=97]="pasteAs",J[J.parameterHints=98]="parameterHints",J[J.peekWidgetDefaultFocus=99]="peekWidgetDefaultFocus",J[J.placeholder=100]="placeholder",J[J.definitionLinkOpensInPeek=101]="definitionLinkOpensInPeek",J[J.quickSuggestions=102]="quickSuggestions",J[J.quickSuggestionsDelay=103]="quickSuggestionsDelay",J[J.readOnly=104]="readOnly",J[J.readOnlyMessage=105]="readOnlyMessage",J[J.renameOnType=106]="renameOnType",J[J.renderRichScreenReaderContent=107]="renderRichScreenReaderContent",J[J.renderControlCharacters=108]="renderControlCharacters",J[J.renderFinalNewline=109]="renderFinalNewline",J[J.renderLineHighlight=110]="renderLineHighlight",J[J.renderLineHighlightOnlyWhenFocus=111]="renderLineHighlightOnlyWhenFocus",J[J.renderValidationDecorations=112]="renderValidationDecorations",J[J.renderWhitespace=113]="renderWhitespace",J[J.revealHorizontalRightPadding=114]="revealHorizontalRightPadding",J[J.roundedSelection=115]="roundedSelection",J[J.rulers=116]="rulers",J[J.
1scrollbar=117]="scrollbar",J[J.scrollBeyondLastColumn=118]="scrollBeyondLastColumn",J[J.scrollBeyondLastLine=119]="scrollBeyondLastLine",J[J.scrollPredominantAxis=120]="scrollPredominantAxis",J[J.selectionClipboard=121]="selectionClipboard",J[J.selectionHighlight=122]="selectionHighlight",J[J.selectionHighlightMaxLength=123]="selectionHighlightMaxLength",J[J.selectionHighlightMultiline=124]="selectionHighlightMultiline",J[J.selectOnLineNumbers=125]="selectOnLineNumbers",J[J.showFoldingControls=126]="showFoldingControls",J[J.showUnused=127]="showUnused",J[J.snippetSuggestions=128]="snippetSuggestions",J[J.smartSelect=129]="smartSelect",J[J.smoothScrolling=130]="smoothScrolling",J[J.stickyScroll=131]="stickyScroll",J[J.stickyTabStops=132]="stickyTabStops",J[J.stopRenderingLineAfter=133]="stopRenderingLineAfter",J[J.suggest=134]="suggest",J[J.suggestFontSize=135]="suggestFontSize",J[J.suggestLineHeight=136]="suggestLineHeight",J[J.suggestOnTriggerCharacters=137]="suggestOnTriggerCharacters",J[J.suggestSelection=138]="suggestSelection",J[J.tabCompletion=139]="tabCompletion",J[J.tabIndex=140]="tabIndex",J[J.trimWhitespaceOnDelete=141]="trimWhitespaceOnDelete",J[J.unicodeHighlighting=142]="unicodeHighlighting",J[J.unusualLineTerminators=143]="unusualLineTerminators",J[J.useShadowDOM=144]="useShadowDOM",J[J.useTabStops=145]="useTabStops",J[J.wordBreak=146]="wordBreak",J[J.wordSegmenterLocales=147]="wordSegmenterLocales",J[J.wordSeparators=148]="wordSeparators",J[J.wordWrap=149]="wordWrap",J[J.wordWrapBreakAfterCharacters=150]="wordWrapBreakAfterCharacters",J[J.wordWrapBreakBeforeCharacters=151]="wordWrapBreakBeforeCharacters",J[J.wordWrapColumn=152]="wordWrapColumn",J[J.wordWrapOverride1=153]="wordWrapOverride1",J[J.wordWrapOverride2=154]="wordWrapOverride2",J[J.wrappingIndent=155]="wrappingIndent",J[J.wrappingStrategy=156]="wrappingStrategy",J[J.showDeprecated=157]="showDeprecated",J[J.inertialScroll=158]="inertialScroll",J[J.inlayHints=159]="inlayHints",J[J.wrapOnEscapedLineFeeds=160]="wrapOnEscapedLineFeeds",J[J.effectiveCursorStyle=161]="effectiveCursorStyle",J[J.editorClassName=162]="editorClassName",J[J.pixelRatio=163]="pixelRatio",J[J.tabFocusMode=164]="tabFocusMode",J[J.layoutInfo=165]="layoutInfo",J[J.wrappingInfo=166]="wrappingInfo",J[J.defaultColorDecorators=167]="defaultColorDecorators",J[J.colorDecoratorsActivatedOn=168]="colorDecoratorsActivatedOn",J[J.inlineCompletionsAccessibilityVerbose=169]="inlineCompletionsAccessibilityVerbose",J[J.effectiveEditContext=170]="effectiveEditContext",J[J.scrollOnMiddleClick=171]="scrollOnMiddleClick",J[J.effectiveAllowVariableFonts=172]="effectiveAllowVariableFonts",(Z=t4||(t4={}))[Z.TextDefined=0]="TextDefined",Z[Z.LF=1]="LF",Z[Z.CRLF=2]="CRLF",(X=t6||(t6={}))[X.LF=0]="LF",X[X.CRLF=1]="CRLF",(ee=t7||(t7={}))[ee.Left=1]="Left",ee[ee.Center=2]="Center",ee[ee.Right=3]="Right",(et=t3||(t3={}))[et.Increase=0]="Increase",et[et.Decrease=1]="Decrease",(ei=t9||(t9={}))[ei.None=0]="None",ei[ei.Indent=1]="Indent",ei[ei.IndentOutdent=2]="IndentOutdent",ei[ei.Outdent=3]="Outdent",(en=t8||(t8={}))[en.Both=0]="Both",en[en.Right=1]="Right",en[en.Left=2]="Left",en[en.None=3]="None",(es=ie||(ie={}))[es.Type=1]="Type",es[es.Parameter=2]="Parameter",(er=it||(it={}))[er.Accepted=0]="Accepted",er[er.Rejected=1]="Rejected",er[er.Ignored=2]="Ignored",(eo=ii||(ii={}))[eo.Code=1]="Code",eo[eo.Label=2]="Label",(ea=is||(is={}))[ea.Automatic=0]="Automatic",ea[ea.Explicit=1]="Explicit",(el=ir||(ir={}))[el.DependsOnKbLayout=-1]="DependsOnKbLayout",el[el.Unknown=0]="Unknown",el[el.Backspace=1]="Backspace",el[el.Tab=2]="Tab",el[el.Enter=3]="Enter",el[el.Shift=4]="Shift",el[el.Ctrl=5]="Ctrl",el[el.Alt=6]="Alt",el[el.PauseBreak=7]="PauseBreak",el[el.CapsLock=8]="CapsLock",el[el.Escape=9]="Escape",el[el.Space=10]="Space",el[el.PageUp=11]="PageUp",el[el.PageDown=12]="PageDown",el[el.End=13]="End",el[el.Home=14]="Home",el[el.LeftArrow=15]="LeftArrow",el[el.UpArrow=16]="UpArrow",el[el.RightArrow=17]="RightArrow",el[el.DownArrow=18]="DownArrow",el[el.Insert=19]="Insert",el[el.Delete=20]="Delete",el[el.Digit0=21]="Digit0",el[el.Digit1=22]="Digit1",el[el.Digit2=23]="Digit2",el[el.Digit3=24]="Digit3",el[el.Digit4=25]="Digit4",el[el.Digit5=26]="Digit5",el[el.Digit6=27]="Digit6",el[el.Digit7=28]="Digit7",el[el.Digit8=29]="Digit8",el[el.Digit9=30]="Digit9",el[el.KeyA=31]="KeyA",el[el.KeyB=32]="KeyB",el[el.KeyC=33]="KeyC",el[el.KeyD=34]="KeyD",el[el.KeyE=35]="KeyE",el[el.KeyF=36]="KeyF",el[el.KeyG=37]="KeyG",el[el.KeyH=38]="KeyH",el[el.KeyI=39]="KeyI",el[el.KeyJ=40]="KeyJ",el[el.KeyK=41]="KeyK",el[el.KeyL=42]="KeyL",el[el.KeyM=43]="KeyM",el[el.KeyN=44]="KeyN",el[el.KeyO=45]="KeyO",el[el.KeyP=46]="KeyP",el[el.KeyQ=47]="KeyQ",el[el.KeyR=48]="KeyR",el[el.KeyS=49]="KeyS",el[el.KeyT=50]="KeyT",el[el.KeyU=51]="KeyU",el[el.KeyV=52]="KeyV",el[el.KeyW=53]="KeyW",el[el.KeyX=54]="KeyX",el[el.KeyY=55]="KeyY",el[el.KeyZ=56]="KeyZ",el[el.Meta=57]="Meta",el[el.ContextMenu=58]="ContextMenu",el[el.F1=59]="F1",el[el.F2=60]="F2",el[el.F3=61]="F3",el[el.F4=62]="F4",el[el.F5=63]="F5",el[el.F6=64]="F6",el[el.F7=65]="F7",el[el.F8=66]="F8",el[el.F9=67]="F9",el[el.F10=68]="F10",el[el.F11=69]="F11",el[el.F12=70]="F12",el[el.F13=71]="F13",el[el.F14=72]="F14",el[el.F15=73]="F15",el[el.F16=74]="F16",el[el.F17=75]="F17",el[el.F18=76]="F18",el[el.F19=77]="F19",el[el.F20=78]="F20",el[el.F21=79]="F21",el[el.F22=80]="F22",el[el.F23=81]="F23",el[el.F24=82]="F24",el[el.NumLock=83]="NumLock",el[el.ScrollLock=84]="ScrollLock",el[el.Semicolon=85]="Semicolon",el[el.Equal=86]="Equal",el[el.Comma=87]="Comma",el[el.Minus=88]="Minus",el[el.Period=89]="Perio
1d",el[el.Slash=90]="Slash",el[el.Backquote=91]="Backquote",el[el.BracketLeft=92]="BracketLeft",el[el.Backslash=93]="Backslash",el[el.BracketRight=94]="BracketRight",el[el.Quote=95]="Quote",el[el.OEM_8=96]="OEM_8",el[el.IntlBackslash=97]="IntlBackslash",el[el.Numpad0=98]="Numpad0",el[el.Numpad1=99]="Numpad1",el[el.Numpad2=100]="Numpad2",el[el.Numpad3=101]="Numpad3",el[el.Numpad4=102]="Numpad4",el[el.Numpad5=103]="Numpad5",el[el.Numpad6=104]="Numpad6",el[el.Numpad7=105]="Numpad7",el[el.Numpad8=106]="Numpad8",el[el.Numpad9=107]="Numpad9",el[el.NumpadMultiply=108]="NumpadMultiply",el[el.NumpadAdd=109]="NumpadAdd",el[el.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",el[el.NumpadSubtract=111]="NumpadSubtract",el[el.NumpadDecimal=112]="NumpadDecimal",el[el.NumpadDivide=113]="NumpadDivide",el[el.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",el[el.ABNT_C1=115]="ABNT_C1",el[el.ABNT_C2=116]="ABNT_C2",el[el.AudioVolumeMute=117]="AudioVolumeMute",el[el.AudioVolumeUp=118]="AudioVolumeUp",el[el.AudioVolumeDown=119]="AudioVolumeDown",el[el.BrowserSearch=120]="BrowserSearch",el[el.BrowserHome=121]="BrowserHome",el[el.BrowserBack=122]="BrowserBack",el[el.BrowserForward=123]="BrowserForward",el[el.MediaTrackNext=124]="MediaTrackNext",el[el.MediaTrackPrevious=125]="MediaTrackPrevious",el[el.MediaStop=126]="MediaStop",el[el.MediaPlayPause=127]="MediaPlayPause",el[el.LaunchMediaPlayer=128]="LaunchMediaPlayer",el[el.LaunchMail=129]="LaunchMail",el[el.LaunchApp2=130]="LaunchApp2",el[el.Clear=131]="Clear",el[el.MAX_VALUE=132]="MAX_VALUE",(eh=io||(io={}))[eh.Hint=1]="Hint",eh[eh.Info=2]="Info",eh[eh.Warning=4]="Warning",eh[eh.Error=8]="Error",(ed=ia||(ia={}))[ed.Unnecessary=1]="Unnecessary",ed[ed.Deprecated=2]="Deprecated",(eu=il||(il={}))[eu.Inline=1]="Inline",eu[eu.Gutter=2]="Gutter",(ec=ih||(ih={}))[ec.Normal=1]="Normal",ec[ec.Underlined=2]="Underlined",(eg=id||(id={}))[eg.UNKNOWN=0]="UNKNOWN",eg[eg.TEXTAREA=1]="TEXTAREA",eg[eg.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",eg[eg.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",eg[eg.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",eg[eg.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",eg[eg.CONTENT_TEXT=6]="CONTENT_TEXT",eg[eg.CONTENT_EMPTY=7]="CONTENT_EMPTY",eg[eg.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",eg[eg.CONTENT_WIDGET=9]="CONTENT_WIDGET",eg[eg.OVERVIEW_RULER=10]="OVERVIEW_RULER",eg[eg.SCROLLBAR=11]="SCROLLBAR",eg[eg.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",eg[eg.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR",(ef=iu||(iu={}))[ef.AIGenerated=1]="AIGenerated",(em=ic||(ic={}))[em.Invoke=0]="Invoke",em[em.Automatic=1]="Automatic",(ep=ig||(ig={}))[ep.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",ep[ep.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",ep[ep.TOP_CENTER=2]="TOP_CENTER",(e_=im||(im={}))[e_.Left=1]="Left",e_[e_.Center=2]="Center",e_[e_.Right=4]="Right",e_[e_.Full=7]="Full",(ev=ip||(ip={}))[ev.Word=0]="Word",ev[ev.Line=1]="Line",ev[ev.Suggest=2]="Suggest",(eb=i_||(i_={}))[eb.Left=0]="Left",eb[eb.Right=1]="Right",eb[eb.None=2]="None",eb[eb.LeftOfInjectedText=3]="LeftOfInjectedText",eb[eb.RightOfInjectedText=4]="RightOfInjectedText",(eC=iv||(iv={}))[eC.Off=0]="Off",eC[eC.On=1]="On",eC[eC.Relative=2]="Relative",eC[eC.Interval=3]="Interval",eC[eC.Custom=4]="Custom",(ew=ib||(ib={}))[ew.None=0]="None",ew[ew.Text=1]="Text",ew[ew.Blocks=2]="Blocks",(ey=iC||(iC={}))[ey.Smooth=0]="Smooth",ey[ey.Immediate=1]="Immediate",(eS=iw||(iw={}))[eS.Auto=1]="Auto",eS[eS.Hidden=2]="Hidden",eS[eS.Visible=3]="Visible",(eL=iy||(iy={}))[eL.LTR=0]="LTR",eL[eL.RTL=1]="RTL",(ex=iS||(iS={})).Off="off",ex.OnCode="onCode",ex.On="on",(ek=iL||(iL={}))[ek.Invoke=1]="Invoke",ek[ek.TriggerCharacter=2]="TriggerCharacter",ek[ek.ContentChange=3]="ContentChange",(eN=ix||(ix={}))[eN.File=0]="File",eN[eN.Module=1]="Module",eN[eN.Namespace=2]="Namespace",eN[eN.Package=3]="Package",eN[eN.Class=4]="Class",eN[eN.Method=5]="Method",eN[eN.Property=6]="Property",eN[eN.Field=7]="Field",eN[eN.Constructor=8]="Constructor",eN[eN.Enum=9]="Enum",eN[eN.Interface=10]="Interface",eN[eN.Function=11]="Function",eN[eN.Variable=12]="Variable",eN[eN.Constant=13]="Constant",eN[eN.String=14]="String",eN[eN.Number=15]="Number",eN[eN.Boolean=16]="Boolean",eN[eN.Array=17]="Array",eN[eN.Object=18]="Object",eN[eN.Key=19]="Key",eN[eN.Null=20]="Null",eN[eN.EnumMember=21]="EnumMember",eN[eN.Struct=22]="Struct",eN[eN.Event=23]="Event",eN[eN.Operator=24]="Operator",eN[eN.TypeParameter=25]="TypeParameter",(eD=ik||(ik={}))[eD.Deprecated=1]="Deprecated",(eE=iN||(iN={}))[eE.LTR=0]="LTR",eE[eE.RTL=1]="RTL",(eT=iD||(iD={}))[eT.Hidden=0]="Hidden",eT[eT.Blink=1]="Blink",eT[eT.Smooth=2]="Smooth",eT[eT.Phase=3]="Phase",eT[eT.Expand=4]="Expand",eT[eT.Solid=5]="Solid",(eI=iE||(iE={}))[eI.Line=1]="Line",eI[eI.Block=2]="Block",eI[eI.Underline=3]="Underline",eI[eI.LineThin=4]="LineThin",eI[eI.BlockOutline=5]="BlockOutline",eI[eI.UnderlineThin=6]="UnderlineThin",(eM=iT||(iT={}))[eM.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",eM[eM.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",eM[eM.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",eM[eM.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter",(eR=iI||(iI={}))[eR.None=0]="None",eR[eR.Same=1]="Same",eR[eR.Indent=2]="Indent",eR[eR.DeepIndent=3]="DeepIndent";class r_{static{this.CtrlCmd=2048}static{this.Shift=1024}static{this.Alt=512}static{this.WinCtrl=256}static chord(e,t){return sy(e,t)}}function rv(){return{editor:void 0,languages:void 0,CancellationTokenSource:sg,Emitter:sd.Q5,KeyCode:ir,KeyMod:r_,Position:s3,Range:s9,Selection:s8,SelectionDirection:iy,MarkerSeverity:io,MarkerTag:ia,Uri:sJ,Token:rd}}let rb=window;function rC(e){return e}class rw{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,"function"==typeof e?(this._fn=e,this._computeKey=rC):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){let t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}}class ry{get cachedValues(){return this._map}constructor(e,t){this._map=new Map,this._map2=new Map,"function"==typeof e?(this._fn=e,this._computeKey=rC):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){let t=this._computeKey(e);if(this._map2.has(t))return this._map2.get(t);let i=this._fn(e);return this._map.set(e,i),this._map2.set(t,i),i}}(eA=iM||(iM={}))[eA.Uninitialized=0]="Uninitialized",eA[eA.Running=1]="Running",eA[eA.Completed=2]="Completed";class rS{constructor(e){this.executor=e,this._state=iM.Uninitialized}get value(){if(this._state===iM.Uninitialized){this._state=iM.Running;try{this._value=this.executor()}catch(e){this._error=e}
1finally{this._state=iM.Completed}}else if(this._state===iM.Running)throw Error("Cannot read the value of a lazy that is being initialized");if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}let rL=/{(\d+)}/g;function rx(e,...t){return 0===t.length?e:e.replace(rL,function(e,i){let n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]})}function rk(e){return e.replace(/[<>&]/g,function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}})}function rN(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function rD(e,t){if(!e||!t)return e;let i=t.length;if(0===i||0===e.length)return e;let n=0;for(;e.indexOf(t,n)===n;)n+=i;return e.substring(n)}function rE(e,t,i={}){if(!e)throw Error("Cannot create regex from empty string");t||(e=rN(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let n="";return i.global&&(n+="g"),i.matchCase||(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),new RegExp(e,n)}function rT(e){return"^"!==e.source&&"^$"!==e.source&&"$"!==e.source&&"^\\s*$"!==e.source&&!!(e.exec("")&&0===e.lastIndex)}function rI(e){return e.split(/\r\n|\r|\n/)}function rM(e){for(let t=0,i=e.length;t<i;t++){let i=e.charCodeAt(t);if(32!==i&&9!==i)return t}return -1}function rR(e,t=0,i=e.length){for(let n=t;n<i;n++){let i=e.charCodeAt(n);if(32!==i&&9!==i)return e.substring(t,n)}return e.substring(t,i)}function rA(e,t=e.length-1){for(let i=t;i>=0;i--){let t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return -1}function rO(e,t){return e<t?-1:e>t?1:0}function rP(e,t,i=0,n=e.length,s=0,r=t.length){for(;i<n&&s<r;i++,s++){let n=e.charCodeAt(i),r=t.charCodeAt(s);if(n<r)return -1;if(n>r)return 1}let o=n-i,a=r-s;return o<a?-1:o>a?1:0}function rF(e,t){return rB(e,t,0,e.length,0,t.length)}function rB(e,t,i=0,n=e.length,s=0,r=t.length){for(;i<n&&s<r;i++,s++){let o=e.charCodeAt(i),a=t.charCodeAt(s);if(o===a)continue;if(o>=128||a>=128)return rP(e.toLowerCase(),t.toLowerCase(),i,n,s,r);rW(o)&&(o-=32),rW(a)&&(a-=32);let l=o-a;if(0!==l)return l}let o=n-i,a=r-s;return o<a?-1:o>a?1:0}function rV(e){return e>=48&&e<=57}function rW(e){return e>=97&&e<=122}function rH(e){return e>=65&&e<=90}function rz(e,t){return e.length===t.length&&0===rB(e,t)}function rU(e,t){let i=t.length;return i<=e.length&&0===rB(e,t,0,i)}function rK(e,t){let i=e.length,n=i-t.length;return n>=0&&0===rB(e,t,n,i)}function r$(e,t){let i;let n=Math.min(e.length,t.length);for(i=0;i<n;i++)if(e.charCodeAt(i)!==t.charCodeAt(i))return i;return n}function rj(e,t){let i;let n=Math.min(e.length,t.length),s=e.length-1,r=t.length-1;for(i=0;i<n;i++)if(e.charCodeAt(s-i)!==t.charCodeAt(r-i))return i;return n}function rq(e){return 55296<=e&&e<=56319}function rG(e){return 56320<=e&&e<=57343}function rQ(e,t){return(e-55296<<10)+(t-56320)+65536}function rY(e,t,i){let n=e.charCodeAt(i);if(rq(n)&&i+1<t){let t=e.charCodeAt(i+1);if(rG(t))return rQ(n,t)}return n}class rJ{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){let e=function(e,t){let i=e.charCodeAt(t-1);if(rG(i)&&t>1){let n=e.charCodeAt(t-2);if(rq(n))return rQ(n,i)}return i}(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){let e=rY(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class rZ{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new rJ(e,t)}nextGraphemeLength(){let e=ot.getInstance(),t=this._iterator,i=t.offset,n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){let i=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(oe(n,s)){t.setOffset(i);break}n=s}return t.offset-i}prevGraphemeLength(){let e=ot.getInstance(),t=this._iterator,i=t.offset,n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){let i=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(oe(s,n)){t.setOffset(i);break}n=s}return i-t.offset}eol(){return this._iterator.eol()}}function rX(e,t){return new rZ(e,t).nextGraphemeLength()}function r1(e,t){return new rZ(e,t).prevGraphemeLength()}function r0(e){return y||(y=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uD
1F86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/),y.test(e)}let r2=/^[\t\n\r\x20-\x7E]*$/;function r5(e){return r2.test(e)}let r4=/[\u2028\u2029]/;function r6(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function r7(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}let r3=String.fromCharCode(65279);function r9(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function r8(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function oe(e,t){return 0===e?5!==t&&7!==t:(2!==e||3!==t)&&(4===e||2===e||3===e||4===t||2===t||3===t||(8!==e||8!==t&&9!==t&&11!==t&&12!==t)&&(11!==e&&9!==e||9!==t&&10!==t)&&(12!==e&&10!==e||10!==t)&&5!==t&&13!==t&&7!==t&&1!==e&&(13!==e||14!==t)&&(6!==e||6!==t))}class ot{static{this._INSTANCE=null}static getInstance(){return ot._INSTANCE||(ot._INSTANCE=new ot),ot._INSTANCE}constructor(){this._data=JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,850
15,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70
1502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,
112,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,23
162,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,4649
16,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54
1168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;let t=this._data,i=t.length/3,n=1;for(;n<=i;)if(e<t[3*n])n*=2;else{if(!(e>t[3*n+1]))return t[3*n+2];n=2*n+1}return 0}}class oi{static{this.ambiguousCharacterData=new rS(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,583
16,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,
1120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,12
10368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,12
10,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.cache=new rw({getCacheKey:JSON.stringify},e=>{let t;function i(e){let t=new Map;for(let i=0;i<e.length;i+=2)t.set(e[i],e[i+1]);return t}let n=this.ambiguousCharacterData.value,s=e.filter(e=>!e.startsWith("_")&&Object.hasOwn(n,e));for(let e of(0===s.length&&(s=["_default"]),s))t=function(e,t){if(!e)return t;let i=new Map;for(let[n,s]of e)t.has(n)&&i.set(n,s);return i}(t,i(n[e]));return new oi(function(e,t){let i=new Map(e);for(let[e,n]of t)i.set(e,n);return i}(i(n._common),t))})}static getInstance(e){return oi.cache.get(Array.from(e))}static{this._locales=new rS(()=>Object.keys(oi.ambiguousCharacterData.value).filter(e=>!e.startsWith("_")))}static getLocales(){return oi._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}class on{static getRawData(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,9
117552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static{this._data=void 0}static getData(){return this._data||(this._data=new Set([...Object.values(on.getRawData())].flat())),this._data}static isInvisibleCharacter(e){return on.getData().has(e)}static get codePoints(){return on.getData()}}i(16291);class os{constructor(){this.mapWindowIdToZoomFactor=new Map}static{this.INSTANCE=new os}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}getWindowId(e){return e.vscodeWindowId}}function or(e,t,i){"string"==typeof t&&(t=e.matchMedia(t)),t.addEventListener("change",i)}function oo(e){return os.INSTANCE.getZoomFactor(e)}let oa=navigator.userAgent,ol=oa.indexOf("Firefox")>=0,oh=oa.indexOf("AppleWebKit")>=0,od=oa.indexOf("Chrome")>=0,ou=!od&&oa.indexOf("Safari")>=0,oc=!od&&!ou&&oh;oa.indexOf("Electron/");let og=oa.indexOf("Android")>=0,of=!1;if("function"==typeof rb.matchMedia){let e=rb.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=rb.matchMedia("(display-mode: fullscreen)");of=e.matches,or(rb,e,({matches:e})=>{of&&t.matches||(of=e)})}function om(){return globalThis.MonacoEnvironment}let op={clipboard:{writeText:sS.tY||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:sS.tY||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},pointerEvents:rb.PointerEvent&&("ontouchstart"in rb||navigator.maxTouchPoints>0)};var o_=i(63888);function ov(e,t){if("number"==typeof e){if(0===e)return null;let i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new ow(0!==n?[ob(i,t),ob(n,t)]:[ob(i,t)])}{let i=[];for(let n=0;n<e.length;n++)i.push(ob(e[n],t));return new ow(i)}}function ob(e,t){let i=!!(2048&e),n=!!(256&e);return new oC(2===t?n:i,!!(1024&e),!!(512&e),2===t?i:n,255&e)}class oC{constructor(e,t,i,n,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=s}equals(e){return e instanceof oC&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class ow{constructor(e){if(0===e.length)throw(0,o_.b1)("chords");this.chords=e}}class oy{constructor(e,t,i,n,s,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=s,this.keyAri
1aLabel=r}}class oS{}let oL=sS.dz?256:2048,ox=sS.dz?2048:256;class ok{constructor(e){this._standardKeyboardEventBrand=!0,this.browserEvent=e,this.target=e.target,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.altGraphKey=e.getModifierState?.("AltGraph"),this.keyCode=function(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return tM.fromString(t)}let t=e.keyCode;if(3===t)return 7;if(ol)switch(t){case 59:return 85;case 60:if(sS.IJ)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(sS.dz)return 57}else if(oh&&(sS.dz&&93===t||!sS.dz&&92===t))return 57;return sv[t]||0}(e),this.code=e.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;
1return this.ctrlKey&&(t|=oL),this.altKey&&(t|=512),this.shiftKey&&(t|=1024),this.metaKey&&(t|=ox),t|=e}_computeKeyCodeChord(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new oC(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let oN=new WeakMap;class oD{static getSameOriginWindowChain(e){let t=oN.get(e);if(!t){let i;t=[],oN.set(e,t);let n=e;do(i=function(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return null}catch(e){return null}return e.parent}(n))?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=i;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0;for(let s of this.getSameOriginWindowChain(e)){let e=s.window.deref();if(i+=e?.scrollY??0,n+=e?.scrollX??0,e===t||!s.iframeElement)break;let r=s.iframeElement.getBoundingClientRect();i+=r.top,n+=r.left}return{top:i,left:n}}}class oE{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=0===t.button,this.middleButton=1===t.button,this.rightButton=2===t.button,this.buttons=t.buttons,this.defaultPrevented=t.defaultPrevented,this.target=t.target,this.detail=t.detail||1,"dblclick"===t.type&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,"number"==typeof t.pageX?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let i=oD.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class oT{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let n=!1;if(od){let e=navigator.userAgent.match(/Chrome\/(\d+)/);n=(e?parseInt(e[1]):123)<=122}if(e){let t=e.view?.devicePixelRatio||1;void 0!==e.wheelDeltaY?n?this.deltaY=e.wheelDeltaY/(120*t):this.deltaY=e.wheelDeltaY/120:void 0!==e.VERTICAL_AXIS&&e.axis===e.VERTICAL_AXIS?this.deltaY=-e.detail/3:"wheel"===e.type&&(e.deltaMode===e.DOM_DELTA_LINE?ol&&!sS.dz?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40),void 0!==e.wheelDeltaX?ou&&sS.ED?this.deltaX=-(e.wheelDeltaX/120):n?this.deltaX=e.wheelDeltaX/(120*t):this.deltaX=e.wheelDeltaX/120:void 0!==e.HORIZONTAL_AXIS&&e.axis===e.HORIZONTAL_AXIS?this.deltaX=-e.detail/3:"wheel"===e.type&&(e.deltaMode===e.DOM_DELTA_LINE?ol&&!sS.dz?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40),0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*t):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}}let oI=Symbol("MicrotaskDelay");function oM(e){return!!e&&"function"==typeof e.then}function oR(e){let t=new sg,i=e(t.token),n=!1,s=new Promise((e,s)=>{let r=t.token.onCancellationRequested(()=>{n=!0,r.dispose(),s(new o_.FU)});Promise.resolve(i).then(i=>{r.dispose(),t.dispose(),n?(0,ro.Wf)(i)&&i.dispose():e(i)},e=>{r.dispose(),t.dispose(),s(e)})});return new class{cancel(){t.cancel(),t.dispose()}then(e,t){return s.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return s.finally(e)}}}class oA{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new sg}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let e=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise(t=>{this.activePromise.then(e,e).then(t)})}return new Promise((e,t)=>
1{this.queuedPromise.then(e,t)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((e,t)=>{this.activePromise.then(t=>{this.activePromise=null,e(t)},e=>{this.activePromise=null,t(e)})})}dispose(){this.cancellationTokenSource.cancel()}}let oO=(e,t)=>{let i=!0,n=setTimeout(()=>{i=!1,t()},e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(n),i=!1}}},oP=e=>{let t=!0;return queueMicrotask(()=>{t&&(t=!1,e())}),{isTriggered:()=>t,dispose:()=>{t=!1}}};class oF{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((e,t)=>{this.doResolve=e,this.doReject=t}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let e=this.task;return this.task=null,e()}}));let i=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===oI?oP(i):oO(t,i),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new o_.FU),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}class oB{constructor(e){this.delayer=new oF(e),this.throttler=new oA}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function oV(e,t){return t?new Promise((i,n)=>{let s=setTimeout(()=>{r.dispose(),i()},e),r=t.onCancellationRequested(()=>{clearTimeout(s),r.dispose(),n(new o_.FU)})}):oR(t=>oV(e,t))}function oW(e,t=0,i){let n=setTimeout(()=>{e(),i&&s.dispose()},t),s=(0,ro.OF)(()=>{clearTimeout(n),i?.delete(s)});return i?.add(s),s}class oH{constructor(){this._runningTask=void 0,this._pendingTasks=[]}schedule(e){let t=new oq;return this._pendingTasks.push({task:e,deferred:t,setUndefinedWhenCleared:!1}),this._runIfNotRunning(),t.p}_runIfNotRunning(){void 0===this._runningTask&&this._processQueue()}async _processQueue(){if(0===this._pendingTasks.length)return;let e=this._pendingTasks.shift();if(e){if(this._runningTask)throw new o_.he;this._runningTask=e.task;try{let t=await e.task();e.deferred.complete(t)}catch(t){e.deferred.error(t)}finally{this._runningTask=void 0,this._processQueue()}}}clearPending(){let e=this._pendingTasks;for(let t of(this._pendingTasks=[],e))t.setUndefinedWhenCleared?t.deferred.complete(void 0):t.deferred.error(new o_.FU)}}class oz{constructor(e,t){this._isDisposed=!1,this._token=void 0,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){void 0!==this._token&&(clearTimeout(this._token),this._token=void 0)}cancelAndSet(e,t){if(this._isDisposed)throw new o_.he("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=void 0,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new o_.he("Calling 'setIfNotSet' on a disposed TimeoutTimer");void 0===this._token&&(this._token=setTimeout(()=>{this._token=void 0,e()},t))}}class oU{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new o_.he("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=i.setInterval(()=>{e()},t);this.disposable=(0,ro.OF)(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}}class oK{constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return void 0!==this.timeoutToken}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}}!function(){let e=globalThis;r="function"!=typeof e.requestIdleCallback||"function"!=typeof e.cancelIdleCallback?(e,t,i)=>{(0,sS.fn)(()=>
1{if(n)return;let e=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,e-Date.now())}))});let n=!1;return{dispose(){n||(n=!0)}}}:(e,t,i)=>{let n=e.requestIdleCallback(t,"number"==typeof i?{timeout:i}:void 0),s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(n))}}},s=(e,t)=>r(globalThis,e,t)}();class o${constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=r(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class oj extends o${constructor(e){super(globalThis,e)}}class oq{get isRejected(){return this.outcome?.outcome===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new o_.FU)}}!function(e){async function t(e){let t;let i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if(void 0!==t)throw t;return i}e.settled=t,e.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})}}(iR||(iR={}));class oG{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){for(let t of(this._ensureNoFinalValue(),this._finalValue=e,this._unsatisfiedConsumers))this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new o_.he("ProducerConsumer: cannot produce after final value has been set")}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}{let e=new oq;return this._unsatisfiedConsumers.push(e),e.p}}}class oQ{constructor(e,t){this._onReturn=t,this._producerConsumer=new oG,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async e=>(this._finishError(e),{done:!0,value:void 0})},queueMicrotask(async()=>{let t=e({emitOne:e=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:e}}),emitMany:e=>{for(let t of e)this._producerConsumer.produce({ok:!0,value:{done:!1,value:t}})},reject:e=>this._finishError(e)});if(!this._producerConsumer.hasFinalValue)try{await t,this._finishOk()}catch(e){this._finishError(e)}})}static fromArray(e){return new oQ(t=>{t.emitMany(e)})}static fromPromise(e){return new oQ(async t=>{t.emitMany(await e)})}static fromPromisesResolveOrder(e){return new oQ(async t=>{await Promise.all(e.map(async e=>t.emitOne(await e)))})}static merge(e){return new oQ(async t=>{await Promise.all(e.map(async e=>{for await(let i of e)t.emitOne(i)}))})}static{this.EMPTY=oQ.fromArray([])}static map(e,t){return new oQ(async i=>{for await(let n of e)i.emitOne(t(n))})}map(e){return oQ.map(this,e)}static coalesce(e){return oQ.filter(e,e=>!!e)}coalesce(){return oQ.coalesce(this)}static filter(e,t){return new oQ(async i=>{for await(let n of e)t(n)&&i.emitOne(n)})}filter(e){return oQ.filter(this,e)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}}function oY(e,t){return sJ.isUri(e)?rz(e.scheme,t):rU(e,t+":")}function oJ(e,...t){return t.some(t=>oY(e,t))}(eO=iA||(iA={})).inMemory="inmemory",eO.vscode="vscode",eO.internal="private",eO.walkThrough="walkThrough",eO.w
1alkThroughSnippet="walkThroughSnippet",eO.http="http",eO.https="https",eO.file="file",eO.mailto="mailto",eO.untitled="untitled",eO.data="data",eO.command="command",eO.vscodeRemote="vscode-remote",eO.vscodeRemoteResource="vscode-remote-resource",eO.vscodeManagedRemoteResource="vscode-managed-remote-resource",eO.vscodeUserData="vscode-userdata",eO.vscodeCustomEditor="vscode-custom-editor",eO.vscodeNotebookCell="vscode-notebook-cell",eO.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",eO.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",eO.vscodeNotebookCellOutput="vscode-notebook-cell-output",eO.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",eO.vscodeNotebookMetadata="vscode-notebook-metadata",eO.vscodeInteractiveInput="vscode-interactive-input",eO.vscodeSettings="vscode-settings",eO.vscodeWorkspaceTrust="vscode-workspace-trust",eO.vscodeTerminal="vscode-terminal",eO.vscodeChatCodeBlock="vscode-chat-code-block",eO.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",eO.vscodeChatEditor="vscode-chat-editor",eO.vscodeChatInput="chatSessionInput",eO.vscodeLocalChatSession="vscode-chat-session",eO.webviewPanel="webview-panel",eO.vscodeWebview="vscode-webview",eO.extension="extension",eO.vscodeFileResource="vscode-file",eO.tmp="tmp",eO.vsls="vsls",eO.vscodeSourceControl="vscode-scm",eO.commentsInput="comment",eO.codeSetting="code-setting",eO.outputChannel="output",eO.accessibleView="accessible-view",eO.chatEditingSnapshotScheme="chat-editing-snapshot-text-model",eO.chatEditingModel="chat-editing-text-model",eO.copilotPr="copilot-pr";class oZ{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._serverRootPath="/"}setPreferredWebSchema(e){this._preferredWebSchema=e}get _remoteResourcesPath(){return sV.join(this._serverRootPath,iA.vscodeRemoteResource)}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(t){return(0,o_.dL)(t),e}let t=e.authority,i=this._hosts[t];i&&-1!==i.indexOf(":")&&-1===i.indexOf("[")&&(i=`[${i}]`);let n=this._ports[t],s=this._connectionTokens[t],r=`path=${encodeURIComponent(e.path)}`;return"string"==typeof s&&(r+=`&tkn=${encodeURIComponent(s)}`),sJ.from({scheme:sS.$L?this._preferredWebSchema:iA.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:r})}}let oX=new oZ;class o1{static{this.FALLBACK_AUTHORITY="vscode-app"}uriToBrowserUri(e){return e.scheme===iA.vscodeRemote?oX.rewrite(e):e.scheme===iA.file&&(sS.tY||sS.qB===`${iA.vscodeFileResource}://${o1.FALLBACK_AUTHORITY}`)?e.with({scheme:iA.vscodeFileResource,authority:e.authority||o1.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}let o0=new o1;!function(e){let t=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);e.CoopAndCoep=Object.freeze(t.get("3"));let i="vscode-coi";e.getHeadersFromQuery=function(e){let n;"string"==typeof e?n=new URL(e).searchParams:e instanceof URL?n=e.searchParams:sJ.isUri(e)&&(n=new URL(e.toString(!0)).searchParams);let s=n?.get(i);if(s)return t.get(s)},e.addSearchParam=function(e,t,n){if(!globalThis.crossOriginIsolated)return;let s=t&&n?"3":n?"2":"1";e instanceof URLSearchParams?e.set(i,s):e[i]=s}}(iO||(iO={}));var o2=i(96434).Buffer;let o5=void 0!==o2;new rS(()=>new Uint8Array(256));class o4{static wrap(e){return o5&&!o2.isBuffer(e)&&(e=o2.from(e.buffer,e.byteOffset,e.byteLength)),new o4(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return o5?this.buffer.toString():(o||(o=new TextDecoder),o.decode(this.buffer))}}function o6(e,t){return 16777216*e[t]+65536*e[t+1]+256*e[t+2]+e[t+3]}function o7(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}let o3="0123456789abcdef";function o9(e,t){switch(typeof e){case"object":var i,n;if(null===e)return o8(349,t);if(Array.isArray(e))return i=o8(104579,i=t),e.reduce((e,t)=>o9(t,e),i);return n=o8(181387,n=t),Object.keys(e).sort().reduce((t,i)=>(t=ae(i,t),o9(e[i],t)),n);case"string":return ae(e,t);case"boolean":return o8(e?433:863,t);case"number":return o8(e,t);case"undefined":return o8(937,t);default:return o8(617,t)}}function o8(e,t){return(t<<5)-t+e|0}function ae(e,t){t=o8(149417,t);for(let i=0,n=e.length;i<n;i++)t=o8(e.charCodeAt(i),t);return t}function at(e,t,i=32){let n=i-t;return(e<<t|(~((1<<n)-1)&e)>>>n)>>>0}function ai(e,t=32){return e instanceof ArrayBuffer?function({buffer:e}){let t="";for(let i=0;i<e.length;i++){let n=e[i];t+=o3[n>>>4]+o3[15&n]}return t}(o4.wrap(new Uint8Array(e))):(e>>>0).toString(16).padStart(t/4,"0")}class an{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let t,i;let n=e.length;if(0===n)return;let s=this._buff,r=this._buffLen,o=this._leftoverHighSurrogate;for(0!==o?(t=o,i=-1,o=0):(t=e.charCodeAt(0),i=0);;){let a=t;if(rq(t)){if(i+1<n){let n=e.charCodeAt(i+1);rG(n)?(i++,a=rQ(t,n)):a=65533}else{o=t;break}}else rG(t)&&(a=65533);if(r=this._push(s,r,a),++i<n)t=e.charCodeAt(i);else break}this._buffLen=r,this._leftoverHighSurrogate=o}_push(e,t,i){return i<128?e[t++]=i:(i<2048?e[t++]=192|(1984&i)>>>6:(i<65536?e[t++]=224|(61440&i)>>>12:(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12),e[t++]=128|(4032&i)>>>6),e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),ai(this._h0)+ai(this._h1)+ai(this._h2)+ai(this._h3)+ai(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>
156&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let e,t,i;let n=an._bigBlock32,s=this._buffDV;for(let e=0;e<64;e+=4)n.setUint32(e,s.getUint32(e,!1),!1);for(let e=64;e<320;e+=4)n.setUint32(e,at(n.getUint32(e-12,!1)^n.getUint32(e-32,!1)^n.getUint32(e-56,!1)^n.getUint32(e-64,!1),1),!1);let r=this._h0,o=this._h1,a=this._h2,l=this._h3,h=this._h4;for(let s=0;s<80;s++)s<20?(e=o&a|~o&l,t=1518500249):s<40?(e=o^a^l,t=1859775393):s<60?(e=o&a|o&l|a&l,t=2400959708):(e=o^a^l,t=3395469782),i=at(r,5)+e+h+t+n.getUint32(4*s,!1)&4294967295,h=l,l=a,a=at(o,30),o=r,r=i;this._h0=this._h0+r&4294967295,this._h1=this._h1+o&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+h&4294967295}}var as=i(20942);class ar{constructor(e){this.loggers=e}handleObservableCreated(e,t){for(let i of this.loggers)i.handleObservableCreated(e,t)}handleOnListenerCountChanged(e,t){for(let i of this.loggers)i.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(let i of this.loggers)i.handleObservableUpdated(e,t)}handleAutorunCreated(e,t){for(let i of this.loggers)i.handleAutorunCreated(e,t)}handleAutorunDisposed(e){for(let t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,i){for(let n of this.loggers)n.handleAutorunDependencyChanged(e,t,i)}handleAutorunStarted(e){for(let t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(let t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,i){for(let n of this.loggers)n.handleDerivedDependencyChanged(e,t,i)}handleDerivedCleared(e){for(let t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(let t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(let t of this.loggers)t.handleEndTransaction(e)}}eP=iP||(iP={}),S=!1,eP.enable=function(){S=!0},eP.ofCaller=function(){if(!S)return;let e=Error,t=e.stackTraceLimit;e.stackTraceLimit=3;let i=Error().stack;return e.stackTraceLimit=t,ao.fromStack(i,2)};class ao{static fromStack(e,t){let i=function(e){let t=e.match(/\((.*):(\d+):(\d+)\)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:e};let i=e.match(/at ([^\(\)]*):(\d+):(\d+)/);if(i)return{fileName:i[1],line:parseInt(i[2]),column:parseInt(i[3]),id:e}}(e.split("\n")[t+1]);return i?new ao(i.fileName,i.line,i.column,i.id):void 0}constructor(e,t,i,n){this.fileName=e,this.line=t,this.column=i,this.id=n}}let aa=(e,t)=>e===t;function al(e=aa){return(t,i)=>(0,as.fS)(t,i,e)}function ah(e,t,i){return void 0===i?(t,i)=>null==t||null==i?i===t:e(t,i):null==e||null==t?t===e:i(e,t)}class ad{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return function(e,t){let i=ac.get(e);if(i)return i;let n=function(e,t){let i;let n=ac.get(e);if(n)return n;let s=t.owner?function(e){let t=af.get(e);if(t)return t;let i=am(e)??"Object",n=ag.get(i)??0;n++,ag.set(i,n);let s=1===n?i:`${i}#${n}`;return af.set(e,s),s}(t.owner)+".":"",r=t.debugNameSource;if(void 0!==r){if("function"!=typeof r)return s+r;if(void 0!==(i=r()))return s+i}let o=t.referenceFn;if(void 0!==o&&void 0!==(i=ap(o)))return s+i;if(void 0!==t.owner){let i=function(e,t){for(let i in e)if(e[i]===t)return i}(t.owner,e);if(void 0!==i)return s+i}}(e,t);if(n){let t=au.get(n)??0;t++,au.set(n,t);let i=1===t?n:`${n}#${t}`;return ac.set(e,i),i}}(e,this)}}let au=new Map,ac=new WeakMap,ag=new Map,af=new WeakMap;function am(e){let t=e.constructor;if(t){if("Object"===t.name)return;return t.name}}function ap(e){let t=e.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t),n=i?i[1]:void 0;return n?.trim()}class a_{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t,i=iP.ofCaller()){let n=void 0===t?void 0:e,s=void 0===t?e:t;return l({owner:n,debugName:()=>{let e=ap(s);if(void 0!==e)return e;let t=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());return t?`${this.debugName}.${t[2]}`:n?void 0:`${this.debugName} (mapped)`},debugReferenceFn:s},e=>s(this.read(e),e),i)}flatten(){return l({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(h(this,t)),this}}class av extends a_{constructor(e){super(),this._observers=new Set,a?.handleObservableCreated(this,e)}addObserver(e){let t=this._observers.size;this._observers.add(e),0===t&&this.onFirstObserverAdded(),t!==this._observers.size&&a?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let t=this._observers.delete(e);t&&0===this._observers.size&&this.onLastObserverRemoved(),t&&a?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}debugGetObservers(){return this._observers}}var ab=i(7148);class aC extends av{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n,s,r){super(r),this._debugNameData=e,this._computeFn=t,this._changeTracker=i,this._handleLastObserverRemoved=n,this._equalityComparator=s,this._state=0,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){for(let e of(this._state=0,this._value=void 0,a?.handleDerivedCleared(this),this._dependencies))e.removeObserver(this);this._dependencies.clear(),void 0!==this._store&&(this._store.dispose(),this._store=void 0),void 0!==this._delayedStore&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._isComputing,0===this._observers.size){let e;try{let t;this._isReaderValid=!0,this._changeTracker&&(t=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,t)),e=this._computeFn(this,t)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),e}do{if(1===this._state){for(let e of this._dependencies)if(e.reportChanges(),2===this._state)break}1===this._state&&(this._state=3),3!==this._state&&this._recompute()}while(3!==this._state);return this._value}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{let t=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,t),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(t));let i=0!==this._state,n=this._value;this._state=3;let s=this._delayedStore;void 0!==s&&(this._delayedStore=void 0);try{void 0!==this._store&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,t)}finally{for(let e of(this._isReaderValid=!1,this._dependenciesToBeRemoved))e.removeObserver(this);this._dependenciesToBeRemoved.clear(),void 0!==s&&s.dispose()}e=this._didReportChange||i&&!this._equalityComparator(n,this._value),a?.handleObservableUpdated(this,{oldValue:n,newValue:this._value,change:void 0,didChange:e,hadValue:i})}catch(e){(0,o_.qU)(e)}if(this._isComputing=!1,!this._didReportChange&&e)for(let e of this._observers)e.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new o_.he("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{let e=1===this._updateCount;if(3===this._state&&(this._state=1,!e))for(let e of this._observers)e.handlePossibleChange(this);if(e)for(let e of this._observers)e.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,0===this._updateCount){for(let e of[...this._observers])e.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let e=[...this._removedObserverToCallEndUpdateOn];for(let t of(this._removedObserverToCallEndUpdateOn=null,e))t.endUpdate(this)}}(0,ab.eZ)(()=>this._updateCount>=0)}handlePossibleChange(e){if(3===this._state&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e))for(let e of(this._state=1,this._observers))e.handlePossibleChange(this)}handleChange(e,t){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){a?.handleDerivedDependencyChanged(this,e,t);let i=!1;try{i=!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:t,didChange:t=>t===e},this._changeSummary)}catch(e){(0,o_.qU)(e)}let n=3===this._state;if(i&&(1===this._state||n)&&(this._state=2,n))for(let e of this._observers)e.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new o_.he("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}
1get store(){return this._ensureReaderValid(),void 0===this._store&&(this._store=new ro.SL),this._store}addObserver(e){let t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn&&this._removedObserverToCallEndUpdateOn.has(e)?this._removedObserverToCallEndUpdateOn.delete(e):e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:function(e){switch(e){case 0:return"initial";case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this._isComputing?this._state=2:this._recompute()}setValue(e,t,i){this._value=e;let n=this._observers;for(let e of(t.updateObserver(this,this),n))e.handleChange(this,i)}}class aw extends aC{constructor(e,t,i,n,s,r,o){super(e,t,i,n,s,o),this.set=r}}function ay(e,t,i=iP.ofCaller()){return void 0!==t?new aC(new ad(e,void 0,t),t,void 0,void 0,aa,i):new aC(new ad(void 0,void 0,e),e,void 0,void 0,aa,i)}function aS(e,t,i,n=iP.ofCaller()){return new aw(new ad(e,void 0,t),t,void 0,void 0,aa,i,n)}function aL(e,t,i=iP.ofCaller()){return new aC(new ad(e.owner,e.debugName,e.debugReferenceFn),t,void 0,e.onLastObserverRemoved,e.equalsFn??aa,i)}function ax(e,t,i=iP.ofCaller()){let n,s,r;return void 0===t?(n=e,s=void 0):(s=e,n=t),new aC(new ad(s,void 0,n),e=>{r?r.clear():r=new ro.SL;let t=n(e);return t&&r.add(t),t},void 0,()=>{r&&(r.dispose(),r=void 0)},aa,i)}l=aL;class ak{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,n){this._debugNameData=e,this._runFn=t,this._changeTracker=i,this._state=2,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),a?.handleAutorunCreated(this,n),this._run()}dispose(){if(!this._disposed){for(let e of(this._disposed=!0,this._dependencies))e.removeObserver(this);this._dependencies.clear(),void 0!==this._store&&this._store.dispose(),void 0!==this._delayedStore&&this._delayedStore.dispose(),a?.handleAutorunDisposed(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=3;try{if(!this._disposed){a?.handleAutorunStarted(this);let e=this._changeSummary,t=this._delayedStore;void 0!==t&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,e),this._changeSummary=this._changeTracker.createChangeSummary(e)),void 0!==this._store&&(this._store.dispose(),this._store=void 0),this._runFn(this,e)}catch(e){(0,o_.qU)(e)}finally{this._isRunning=!1,void 0!==t&&t.dispose()}}}finally{for(let e of(this._disposed||a?.handleAutorunFinished(this),this._dependenciesToBeRemoved))e.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){3===this._state&&(this._state=1),this._updateCount++}endUpdate(e){try{if(1===this._updateCount)do{if(1===this._state){for(let e of(this._state=3,this._dependencies))if(e.reportChanges(),2===this._state)break}3!==this._state&&this._run()}while(3!==this._state)}finally{this._updateCount--}(0,ab.eZ)(()=>this._updateCount>=0)}handlePossibleChange(e){3===this._state&&this._isDependency(e)&&(this._state=1)}handleChange(e,t){if(this._isDependency(e)){a?.handleAutorunDependencyChanged(this,e,t);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:t,didChange:t=>t===e},this._changeSummary))&&(this._state=2)}catch(e){(0,o_.qU)(e)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new o_.he("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}
1get store(){if(this._ensureNoRunning(),this._disposed)throw new o_.he("Cannot access store after dispose");return void 0===this._store&&(this._store=new ro.SL),this._store}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:function(e){switch(e){case 1:return"dependenciesMightHaveChanged";case 2:return"stale";case 3:return"upToDate";default:return"<unknown>"}}(this._state)}}debugRerun(){this._isRunning?this._state=2:this._run()}}function aN(e,t=iP.ofCaller()){return new ak(new ad(void 0,void 0,e),e,void 0,t)}function aD(e,t,i=iP.ofCaller()){return new ak(new ad(e.owner,e.debugName,e.debugReferenceFn??t),t,void 0,i)}function aE(e,t,i=iP.ofCaller()){return new ak(new ad(e.owner,e.debugName,e.debugReferenceFn??t),t,e.changeTracker,i)}function aT(e){let t=new ro.SL,i=aD({owner:void 0,debugName:void 0,debugReferenceFn:e},i=>{t.clear(),e(i,t)});return(0,ro.OF)(()=>{i.dispose(),t.dispose()})}function aI(e){let t=Error("BugIndicatingErrorRecovery: "+e);(0,o_.dL)(t),console.error("recovered from an error that indicates a bug",t)}function aM(e,t){let i=new aO(e,t);try{e(i)}finally{i.finish()}}function aR(e){if(L)e(L);else{let t=new aO(e,void 0);L=t;try{e(t)}finally{t.finish(),L=void 0}}}function aA(e,t,i){e?t(e):aM(t,i)}class aO{constructor(e,t){this._fn=e,this._getDebugName=t,this._updatingObservers=[],a?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():ap(this._fn)}updateObserver(e,t){if(!this._updatingObservers){aI("Transaction already finished!"),aM(i=>{i.updateObserver(e,t)});return}this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){let e=this._updatingObservers;if(!e){aI("transaction.finish() has already been called!");return}for(let t=0;t<e.length;t++){let{observer:i,observable:n}=e[t];i.endUpdate(n)}this._updatingObservers=null,a?.handleEndTransaction(this)}debugGetUpdatingObservers(){return this._updatingObservers}}function aP(...e){let t,i,n,s;return 2===e.length?[i,n]=e:[t,i,n,s]=e,new aF(new ad(t,void 0,n),i,n,()=>aF.globalTransaction,aa,s??iP.ofCaller())}class aF extends av{constructor(e,t,i,n,s,r){super(r),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=n,this._equalityComparator=s,this._hasValue=!1,this.handleEvent=e=>{let t=this._getValue(e),i=this._value,n=!this._hasValue||!this._equalityComparator(i,t),s=!1;n&&(this._value=t,this._hasValue&&(s=!0,aA(this._getTransaction(),e=>{for(let s of(a?.handleObservableUpdated(this,{oldValue:i,newValue:t,change:void 0,didChange:n,hadValue:this._hasValue}),this._observers))e.updateObserver(s,this),s.handleChange(this,void 0)},()=>{let e=this.getDebugName();return"Event fired"+(e?`: ${e}`:"")})),this._hasValue=!0),s||a?.handleObservableUpdated(this,{oldValue:i,newValue:t,change:void 0,didChange:n,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}debugGetState(){return{value:this._value,hasValue:this._hasValue}}}function aB(e,t){let i=new aV(!0,t);e.addObserver(i);try{i.beginUpdate(e)}finally{i.endUpdate(e)}return(0,ro.OF)(()=>{e.removeObserver(i)})}(eF=aP||(aP={})).Observer=aF,eF.batchEventsGlobally=function(e,t){let i=!1;void 0===aF.globalTransaction&&(aF.globalTransaction=e,i=!0);try{t()}finally{i&&(aF.globalTransaction=void 0)}},h=aB;class aV{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){1===this._counter&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}}function aW(e,t){switch(typeof e){case"number":default:return""+e;case"string":if(e.length+2<=t)return`"${e}"`;return`"${e.substr(0,t-7)}"+...`;case"boolean":return e?"true":"false";case"undefined":return"undefined";case"object":if(null===e)return"null";if(Array.isArray(e))return function(e,t){let i="[ ",n=!0;for(let s of e){if(n||(i+=", "),i.length-5>t){i+="...";break}n=!1,i+=`${aW(s,t-i.length)}`}return i+" ]"}(e,t);return function(e,t){if("function"==typeof e.toString&&e.toString!==Object.prototype.toString){let i=e.toString();return i.length<=t?i:i.substring(0,t-3)+"..."}let i=am(e),n=i?i+"(":"{ ",s=!0;for(let[i,r]of Object.entries(e)){if(s||(n+=", "),n.length-5>t){n+="...";break}s=!1,n+=`${i}: ${aW(r,t-n.length)}`}return n+(i?")":" }")}(e,t);case"symbol":return e.toString();case"function":return`[[Function${e.name?" "+e.name:""}]]`}}class aH{static createClient(e,t){return new aH(e,t)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:e=>{let t=this._getHandler().notifications[e[0]];if(!t)throw Error(`Unknown notification "${e[0]}"!`);t(...e[1])},handleRequest:e=>{try{let t=this._getHandler().requests[e[0]](...e[1]);return{type:"result",value:t}}catch(e){return{type:"error",value:e}}}});let i=new Proxy({},{get:(e,t)=>async(...e)=>{let i=await this._channel.sendRequest([t,e]);if("error"!==i.type)return i.value;throw i.value}}),n=new Proxy({},{get:(e,t)=>(...e)=>{this._channel.sendNotification([t,e])}});this.api={notifications:n,requests:i}}}class az{constructor(){this._timeout=void 0}throttle(e,t){void 0===this._timeout&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},t))}dispose(){void 0!==this._timeout&&clearTimeout(this._timeout)}}function aU(e,t,i=iP.ofCaller()){return new aK("string"==typeof e?new ad(void 0,e,void 0):new ad(e,void 0,void 0),t,aa,i)}class aK extends av{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._value=t,a?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,i){let n;if(!(void 0===i&&this._equalityComparator(this._value,e))){t||(t=n=new aO(()=>{},()=>`Setting ${this.debugName}`));try{let n=this._value;for(let s of(this._setValue(e),a?.handleObservableUpdated(this,{oldValue:n,newValue:e,change:i,didChange:!0,hadValue:!0}),this._observers))t.updateObserver(s,this),s.handleChange(this,i)}finally{n&&n.finish()}}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}function a$(e,t,i=iP.ofCaller()){return new aj("string"==typeof e?new ad(void 0,e,void 0):new ad(e,void 0,void 0),t,aa,i)}class aj extends aK{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){this._value?.dispose()}}class aq{static{this._instance=void 0}static getInstance(){return void 0===aq._instance&&(aq._instance=new aq),aq._instance}getTransactionState(){let e=[],t=[...this._activeTransactions];if(0===t.length)return;let i=t.flatMap(e=>e.debugGetUpdatingObservers()??[]).map(e=>e.observer),n=new Set;for(;i.length>0;){let t=i.shift();if(n.has(t))continue;n.add(t);let s=this._getInfo(t,e=>{n.has(e)||i.push(e)});s&&e.push(s)}return{names:t.map(e=>e.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){let t=this._instanceInfos.get(e);if(!t){(0,o_.dL)(new o_.he("No info found"));return}return t}_getAutorunInfo(e){let t=this._instanceInfos.get(e);if(!t){(0,o_.dL)(new o_.he("No info found"));return}return t}_getInfo(e,t){if(e instanceof aC){for(let i of[...e.debugGetObservers()])t(i);let i=this._getObservableInfo(e);if(!i)return;
1let n=e.debugGetState(),s={name:e.debugName,instanceId:i.instanceId,updateCount:n.updateCount},r=[...i.changedObservables].map(e=>this._instanceInfos.get(e)?.instanceId).filter(re.$K);if(n.isComputing)return{...s,type:"observable/derived",state:"updating",changedDependencies:r,initialComputation:!1};switch(n.state){case 0:return{...s,type:"observable/derived",state:"noValue"};case 3:return{...s,type:"observable/derived",state:"upToDate"};case 2:return{...s,type:"observable/derived",state:"stale",changedDependencies:r};case 1:return{...s,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof ak){let t=this._getAutorunInfo(e);if(!t)return;let i={name:e.debugName,instanceId:t.instanceId,updateCount:t.updateCount},n=[...t.changedObservables].map(e=>this._instanceInfos.get(e).instanceId);if(e.debugGetState().isRunning)return{...i,type:"autorun",state:"updating",changedDependencies:n};switch(e.debugGetState().state){case 3:return{...i,type:"autorun",state:"upToDate"};case 2:return{...i,type:"autorun",state:"stale",changedDependencies:n};case 1:return{...i,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){let t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){if(e instanceof aC)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};let t=this._getAutorunInfo(e);if(t)return{name:e.toString(),instanceId:t.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=function(e,t){var i;let n,s,r;let o=globalThis,a=[],{channel:l,handler:h}=(i={sendNotification:e=>{n?n.sendNotification(e):a.push(e)}},{channel:e=>(r=e,{sendNotification:e=>{i.sendNotification(e)},sendRequest:e=>{throw Error("not supported")}}),handler:{handleRequest:e=>"notification"===e.type?r?.handleNotification(e.data):r?.handleRequest(e.data)}});return(o.$$debugValueEditor_debugChannels??(o.$$debugValueEditor_debugChannels={}))[e]=e=>{for(let i of(s=t(),n=e,a))e.sendNotification(i);return a=[],h},aH.createClient(l,()=>{if(!s)throw Error("Not supported");return s})}("observableDevTools",()=>({notifications:{setDeclarationIdFilter:e=>{},logObservableValue:e=>{console.log("logObservableValue",e)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{let e={};for(let t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(e=>this._formatObserver(e)).filter(re.$K)}),getDerivedInfo:e=>{let t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map(e=>this._formatObservable(e)).filter(re.$K),observers:[...t.debugGetObservers()].map(e=>this._formatObserver(e)).filter(re.$K)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(e=>this._formatObservable(e)).filter(re.$K)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{let i=this._aliveInstances.get(e);if(i instanceof aC)i.debugSetValue(t);else if(i instanceof aK)i.debugSetValue(t);else if(i instanceof aF)i.debugSetValue(t);else throw new o_.he("Observable is not supported");let n=[...i.debugGetObservers()];for(let e of n)e.beginUpdate(i);for(let e of n)e.handleChange(i,void 0);for(let e of n)e.endUpdate(i)},getValue:e=>{let t=this._aliveInstances.get(e);return t instanceof aC?aW(t.debugGetState().value,200):t instanceof aK?aW(t.debugGetState().value,200):void 0},logValue:e=>{let t=this._aliveInstances.get(e);if(t&&"get"in t)console.log("Logged Value:",t.get());else throw new o_.he("Observable is not supported")},rerun:e=>{let t=this._aliveInstances.get(e);if(t instanceof aC)t.debugRecompute();else if(t instanceof ak)t.debugRerun();else throw new o_.he("Observable is not supported")}}})),this._pendingChanges=null,this._changeThrottler=new az,this._fullState={},this._flushUpdates=()=>
1{null!==this._pendingChanges&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},iP.enable()}_handleChange(e){!function e(t,i){for(let n in i)null===i[n]?delete t[n]:t[n]&&"object"==typeof t[n]&&i[n]&&"object"==typeof i[n]?e(t[n],i[n]):t[n]=i[n]}(this._fullState,e),null===this._pendingChanges?this._pendingChanges=e:function e(t,i){for(let n in i)t[n]&&"object"==typeof t[n]&&i[n]&&"object"==typeof i[n]?e(t[n],i[n]):t[n]=i[n]}(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,t){if(!t)return -1;let i=this._declarations.get(t.id);return void 0===i&&(i={id:this._declarationId++,type:e,url:t.fileName,line:t.line,column:t.column},this._declarations.set(t.id,i),this._handleChange({decls:{[i.id]:i}})),i.id}handleObservableCreated(e,t){let i={declarationId:this._getDeclarationId("observable/value",t),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,i)}handleOnListenerCountChanged(e,t){let i=this._getObservableInfo(e);i&&(0===i.listenerCount&&t>0?(this._aliveInstances.set(i.instanceId,e),this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,formattedValue:i.lastValue,type:e instanceof aC?"observable/derived":"observable/value",name:e.debugName}}})):i.listenerCount>0&&0===t&&(this._handleChange({instances:{[i.instanceId]:null}}),this._aliveInstances.delete(i.instanceId)),i.listenerCount=t)}handleObservableUpdated(e,t){if(e instanceof aC){this._handleDerivedRecomputed(e,t);return}let i=this._getObservableInfo(e);i&&t.didChange&&(i.lastValue=aW(t.newValue,30),i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:i.lastValue}}}))}handleAutorunCreated(e,t){let i={declarationId:this._getDeclarationId("autorun",t),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,i),this._aliveInstances.set(i.instanceId,e),i&&this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){let t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,i){let n=this._getAutorunInfo(e);n&&n.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){let t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,i){let n=this._getObservableInfo(e);n&&n.changedObservables.add(t)}_handleDerivedRecomputed(e,t){let i=this._getObservableInfo(e);if(!i)return;let n=aW(t.newValue,30);i.updateCount++,i.changedObservables.clear(),i.lastValue=n,i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:n,recomputationCount:i.updateCount}}})}handleDerivedCleared(e){let t=this._getObservableInfo(e);t&&(t.lastValue=void 0,t.changedObservables.clear(),t.listenerCount>0&&this._handleChange({instances:{[t.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}}sN&&sN.VSCODE_DEV_DEBUG_OBSERVABLES&&(eB=aq.getInstance(),a?a instanceof ar?a.loggers.push(eB):a=new ar([a,eB]):a=eB);let{getWindow:aG,getDocument:aQ,getWindows:aY,getWindowsCount:aJ,getWindowId:aZ,getWindowById:aX,onDidRegisterWindow:a1,onWillUnregisterWindow:a0,onDidUnregisterWindow:a2}=function(){let e=new Map;"number"!=typeof rb.vscodeWindowId&&Object.defineProperty(rb,"vscodeWindowId",{get:()=>1});let t={window:rb,disposables:new ro.SL};e.set(rb.vscodeWindowId,t);let i=new sd.Q5,n=new sd.Q5,s=new sd.Q5;return{onDidRegisterWindow:i.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:n.event,registerWindow(t){if(e.has(t.vscodeWindowId))return ro.JT.None;let r=new ro.SL,o={window:t,disposables:r.add(new ro.SL)};return e.set(t.vscodeWindowId,o),r.add((0,ro.OF)(()=>{e.delete(t.vscodeWindowId),n.fire(t)}
1)),r.add(a6(t,ly.BEFORE_UNLOAD,()=>{s.fire(t)})),i.fire(o),r},getWindows:()=>e.values(),getWindowsCount:()=>e.size,getWindowId:e=>e.vscodeWindowId,hasWindow:t=>e.has(t),getWindowById:function(i,n){return("number"==typeof i?e.get(i):void 0)??(n?t:void 0)},getWindow:e=>e?.ownerDocument?.defaultView?e.ownerDocument.defaultView.window:e?.view?e.view.window:rb,getDocument:e=>aG(e).document}}();function a5(e){for(;e.firstChild;)e.firstChild.remove()}class a4{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function a6(e,t,i,n){return new a4(e,t,i,n)}let a7=function(e,t,i,n){var s;let r=i;return"click"===t||"mousedown"===t||"contextmenu"===t?(s=aG(e),r=function(e){return i(new oE(s,e))}):("keydown"===t||"keypress"===t||"keyup"===t)&&(r=function(e){return i(new ok(e))}),a6(e,t,r,n)};function a3(e,t,i){return a6(e,sS.gn&&op.pointerEvents?ly.POINTER_UP:ly.MOUSE_UP,t,i)}class a9 extends oU{constructor(e){super(),this.defaultTarget=e&&aG(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}}class a8{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){(0,o_.dL)(e)}}static sort(e,t){return t.priority-e.priority}}function le(e){return aG(e).getComputedStyle(e,null)}function lt(e,t,i){let n=aG(e),s=n.document;if(e!==s.body)return new ln(e.clientWidth,e.clientHeight);if(sS.gn&&n?.visualViewport)return new ln(n.visualViewport.width,n.visualViewport.height);if(n?.innerWidth&&n.innerHeight)return new ln(n.innerWidth,n.innerHeight);if(s.body&&s.body.clientWidth&&s.body.clientHeight)return new ln(s.body.clientWidth,s.body.clientHeight);if(s.documentElement&&s.documentElement.clientWidth&&s.documentElement.clientHeight)return new ln(s.documentElement.clientWidth,s.documentElement.clientHeight);throw Error("Unable to figure out browser width and height")}!function(){let e=new Map,t=new Map,i=new Map,n=new Map,s=s=>{i.set(s,!1);let r=e.get(s)??[];for(t.set(s,r),e.set(s,[]),n.set(s,!0);r.length>0;)r.sort(a8.sort),r.shift().execute();n.set(s,!1)};u=(t,n,r=0)=>{let o=aZ(t),a=new a8(n,r),l=e.get(o);return l||(l=[],e.set(o,l)),l.push(a),i.get(o)||(i.set(o,!0),t.requestAnimationFrame(()=>s(o))),a},d=(e,i,s)=>{let r=aZ(e);if(!n.get(r))return u(e,i,s);{let e=new a8(i,s),n=t.get(r);return n||(n=[],t.set(r,n)),n.push(e),e}}}();class li{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t){let i=le(e),n=i?i.getPropertyValue(t):"0";return li.convertToPixels(e,n)}static getBorderLeftWidth(e){return li.getDimension(e,"border-left-width")}static getBorderRightWidth(e){return li.getDimension(e,"border-right-width")}static getBorderTopWidth(e){return li.getDimension(e,"border-top-width")}static getBorderBottomWidth(e){return li.getDimension(e,"border-bottom-width")}static getPaddingLeft(e){return li.getDimension(e,"padding-left")}static getPaddingRight(e){return li.getDimension(e,"padding-right")}static getPaddingTop(e){return li.getDimension(e,"padding-top")}static getPaddingBottom(e){return li.getDimension(e,"padding-bottom")}static getMarginLeft(e){return li.getDimension(e,"margin-left")}static getMarginTop(e){return li.getDimension(e,"margin-top")}static getMarginRight(e){return li.getDimension(e,"margin-right")}static getMarginBottom(e){return li.getDimension(e,"margin-bottom")}}class ln{static{this.None=new ln(0,0)}constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new ln(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof ln?e:new ln(e.width,e.height)}static equals(e,t){return e===t||!!e&&!!t&&e.width===t.width&&e.height===t.height}}function ls(e){let t=e.getBoundingClientRect(),i=aG(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}function lr(e){let t=e,i=1;do{let e=le(t).zoom;null!=e&&"1"!==e&&(i*=e),t=t.parentElement}while(null!==t&&t!==t.ownerDocument.documentElement);return i}function lo(e){let t=li.getMarginLeft(e)+li.getMarginRight(e);return e.offsetWidth+t}function la(e){let t=li.getBorderLeftWidth(e)+li.getBorderRightWidth(e),i=li.getPaddingLeft(e)+li.getPaddingRight(e);return e.offsetWidth-t-i}function ll(e){let t=li.getMarginTop(e)+li.getMarginBottom(e);return e.offsetHeight+t}function lh(e,t){return!!t?.contains(e)}function ld(e,t,i){return!!function(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i){if("string"==typeof i){if(e.classList.contains(i))break}else if(e===i)break}e=e.parentNode}return null}(e,t,i)}function lu(e){return e&&!!e.host&&!!e.mode}function lc(e){for(;e.parentNode;){if(e===e.ownerDocument?.body)return null;e=e.parentNode}return lu(e)?e:null}function lg(){let e=lf().activeElement;for(;e?.shadowRoot;)e=e.shadowRoot.activeElement;return e}function lf(){return 1>=aJ()?rb.document:Array.from(aY()).map(({window:e})=>e.document).find(e=>e.hasFocus())??rb.document}function lm(){let e=lf();return e.defaultView?.window??rb}let lp=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let n=this.mutationObservers.get(e);n||(n=new Map,this.mutationObservers.set(e,n));let s=o9(i,0),r=n.get(s);if(r)r.users+=1;else{let o=new sd.Q5,a=new MutationObserver(e=>o.fire(e));a.observe(e,i);let l=r={users:1,observer:a,onDidMutate:o.event};t.add((0,ro.OF)(()=>{l.users-=1,0===l.users&&(o.dispose(),a.disconnect(),n?.delete(s),n?.size===0&&this.mutationObservers.delete(e))})),n.set(s,r)}return r.onDidMutate}};function l_(e){return e instanceof HTMLElement||e instanceof aG(e).HTMLElement}function lv(e){return e instanceof HTMLAnchorElement||e instanceof aG(e).HTMLAnchorElement}function lb(e){return e instanceof SVGElement||e instanceof aG(e).SVGElement}function lC(e){return e instanceof MouseEvent||e instanceof aG(e).MouseEvent}function lw(e){return e instanceof KeyboardEvent||e instanceof aG(e).KeyboardEvent}let ly={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MO
1VE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend"},lS={stop:(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e)};class lL extends ro.JT{get onDidFocus(){return this._onDidFocus.event}get onDidBlur(){return this._onDidBlur.event}static hasFocusWithin(e){if(!l_(e))return lh(e.document.activeElement,e.document);{let t=lc(e);return lh(t?t.activeElement:e.ownerDocument.activeElement,e)}}constructor(e){super(),this._onDidFocus=this._register(new sd.Q5),this._onDidBlur=this._register(new sd.Q5);let t=lL.hasFocusWithin(e),i=!1,n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},s=()=>{t&&(i=!0,(l_(e)?aG(e):e).setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{lL.hasFocusWithin(e)!==t&&(t?s():n())},this._register(a6(e,ly.FOCUS,n,!0)),this._register(a6(e,ly.BLUR,s,!0)),l_(e)&&(this._register(a6(e,ly.FOCUS_IN,()=>this._refreshStateHandler())),this._register(a6(e,ly.FOCUS_OUT,()=>this._refreshStateHandler())))}}function lx(e){return new lL(e)}function lk(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function lN(e,t){return e.insertBefore(t,e.firstChild),t}function lD(e,...t){e.textContent="",lk(e,...t)}let lE=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function lT(e,t,i,...n){let s;let r=lE.exec(t);if(!r)throw Error("Bad use of emmet");let o=r[1]||"div";return s=e!==iF.HTML?document.createElementNS(e,o):document.createElement(o),r[3]&&(s.id=r[3]),r[4]&&(s.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([e,t])=>{void 0!==t&&(/^on\w+$/.test(e)?s[e]=t:"selected"===e?t&&s.setAttribute(e,"true"):s.setAttribute(e,t))}),s.append(...n),s}function lI(e,t,...i){return lT(iF.HTML,e,t,...i)}function lM(...e){for(let t of e)t.style.display="",t.removeAttribute("aria-hidden")}function lR(...e){for(let t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function lA(e,t){return Math.max(1,Math.floor(e.devicePixelRatio*t))/e.devicePixelRatio}function lO(e){rb.open(e,"_blank","noopener")}(eV=iF||(iF={})).HTML="http://www.w3.org/1999/xhtml",eV.SVG="http://www.w3.org/2000/svg",lI.SVG=function(e,t,...i){return lT(iF.SVG,e,t,...i)},oX.setPreferredWebSchema(/^https:/.test(rb.location.href)?"https":"http");class lP extends sd.Q5{constructor(){super(),this._subscriptions=new ro.SL,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(sd.ju.runAndSubscribe(a1,({window:e,disposables:t})=>this.registerListeners(e,t),{window:rb,disposables:this._subscriptions}))}registerListeners(e,t){t.add(a6(e,"keydown",e=>{if(e.defaultPrevented)return;let t=new ok(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),t.add(a6(e,"keyup",e=>{!e.defaultPrevented&&(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),t.add(a6(e.document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(a6(e.document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),t.add(a6(e.document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),t.add(a6(e,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return lP.instance||(lP.instance=new lP),lP.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class lF extends ro.JT{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this.callbacks.onDragStart&&this._register(a6(this.element,ly.DRAG_START,e=>{this.callbacks.onDragStart?.(e)})),this.callbacks.onDrag&&this._register(a6(this.element,ly.DRAG,e=>{this.callbacks.onDrag?.(e)})),this._register(a6(this.element,ly.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter?.(e)})),this._register(a6(this.element,ly.DRAG_OVER,e=>{e.preventDefault(),this.callbacks.onDragOver?.(e,e.timeStamp-this.dragStartTime)})),this._register(a6(this.element,ly.DRAG_LEAVE,e=>{this.counter--,0===this.counter&&(this.dragStartTime=0,this.callbacks.onDragLeave?.(e))})),this._register(a6(this.element,ly.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd?.(e)})),this._register(a6(this.element,ly.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop?.(e)}))}}let lB=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>
1(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function lV(e,...t){let i,n;Array.isArray(t[0])?(i={},n=t[0]):(i=t[0]||{},n=t[1]);let s=lB.exec(e);if(!s||!s.groups)throw Error("Bad use of h");let r=s.groups.tag||"div",o=document.createElement(r);s.groups.id&&(o.id=s.groups.id);let a=[];if(s.groups.class)for(let e of s.groups.class.split("."))""!==e&&a.push(e);if(void 0!==i.className)for(let e of i.className.split("."))""!==e&&a.push(e);a.length>0&&(o.className=a.join(" "));let l={};if(s.groups.name&&(l[s.groups.name]=o),n)for(let e of n)l_(e)?o.appendChild(e):"string"==typeof e?o.append(e):"root"in e&&(Object.assign(l,e),o.appendChild(e.root));for(let[e,t]of Object.entries(i))if("className"!==e){if("style"===e)for(let[e,i]of Object.entries(t))o.style.setProperty(lW(e),"number"==typeof i?i+"px":""+i);else"tabIndex"===e?o.tabIndex=t:o.setAttribute(lW(e),t.toString())}return l.root=o,l}function lW(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function lH(e){return"input"===e.tagName.toLowerCase()||"textarea"===e.tagName.toLowerCase()||l_(e)&&!!e.editContext}!function(e){function t(e){return(t,i,n)=>{let s=i.class;delete i.class;let r=i.ref;delete i.ref;let o=i.obsRef;return delete i.obsRef,new lq(t,r,o,e,s,i,n)}}function i(e,i){let n=t(i);return(t,i)=>n(e,t,i)}e.div=i("div"),e.elem=t(void 0),e.svg=i("svg","http://www.w3.org/2000/svg"),e.svgElem=t("http://www.w3.org/2000/svg"),e.ref=function(){let e;let t=function(t){e=t};
1return Object.defineProperty(t,"element",{get(){if(!e)throw new o_.he("Make sure the ref is set before accessing the element. Maybe wrong initialization order?");return e}}),t}}(iB||(iB={}));class lz{constructor(e,t,i,n,s,r,o){for(let[o,a]of(this._deriveds=[],this._element=n?document.createElementNS(n,e):document.createElement(e),t&&t(this._element),i&&this._deriveds.push(ay(e=>{i(this),e.store.add({dispose:()=>{i(null)}})})),s&&(function e(t){return!!lQ(t)||!!Array.isArray(t)&&t.some(t=>e(t))}(s)?this._deriveds.push(ay(this,e=>{lU(this._element,lK(s,e))})):lU(this._element,lK(s,void 0))),Object.entries(r)))if("style"===o)for(let[e,t]of Object.entries(a)){let i=lW(e);lQ(t)?this._deriveds.push(aL({owner:this,debugName:()=>`set.style.${i}`},e=>{this._element.style.setProperty(i,l$(t.read(e)))})):this._element.style.setProperty(i,l$(t))}else"tabIndex"===o?lQ(a)?this._deriveds.push(ay(this,e=>{this._element.tabIndex=a.read(e)})):this._element.tabIndex=a:o.startsWith("on")?this._element[o]=a:lQ(a)?this._deriveds.push(aL({owner:this,debugName:()=>`set.${o}`},e=>{lG(this._element,o,a.read(e))})):lG(this._element,o,a);if(o){let e=ay(this,e=>{this._element.replaceChildren(...function e(t,i){return lQ(i)?e(t,i.read(t)):Array.isArray(i)?i.flatMap(i=>e(t,i)):i instanceof lz?(t&&i.readEffect(t),[i._element]):i?[i]:[]}(e,o))});this._deriveds.push(e),!function e(t){return!!lQ(t)||!!Array.isArray(t)&&t.some(t=>e(t))}(o)&&e.get()}}readEffect(e){for(let t of this._deriveds)t.read(e)}keepUpdated(e){return ay(e=>{this.readEffect(e)}).recomputeInitiallyAndOnChange(e),this}toDisposableLiveElement(){let e=new ro.SL;return this.keepUpdated(e),new lj(this._element,e)}}function lU(e,t){lb(e)?e.setAttribute("class",t):e.className=t}function lK(e,t){let i="";return!function e(t,i,n){if(lQ(t)){n(t.read(i));return}if(Array.isArray(t)){for(let s of t)e(s,i,n);return}n(t)}(e,t,e=>{e&&(0===i.length?i=e:i+=" "+e)}),i}function l$(e){return"number"==typeof e?e+"px":e}class lj{constructor(e,t){this.element=e,this._disposable=t}dispose(){this._disposable.dispose()}}class lq extends lz{constructor(){super(...arguments),this._isHovered=void 0,this._didMouseMoveDuringHover=void 0}get element(){return this._element}get isHovered(){if(!this._isHovered){let e=aU("hovered",!1);this._element.addEventListener("mouseenter",t=>e.set(!0,void 0)),this._element.addEventListener("mouseleave",t=>e.set(!1,void 0)),this._isHovered=e}return this._isHovered}get didMouseMoveDuringHover(){if(!this._didMouseMoveDuringHover){let e=!1,t=aU("didMouseMoveDuringHover",!1);this._element.addEventListener("mouseenter",t=>{e=!0}),this._element.addEventListener("mousemove",i=>{e&&t.set(!0,void 0)}),this._element.addEventListener("mouseleave",i=>{e=!1,t.set(!1,void 0)}),this._didMouseMoveDuringHover=t}return this._didMouseMoveDuringHover}}function lG(e,t,i){null==i?e.removeAttribute(lW(t)):e.setAttribute(lW(t),String(i))}function lQ(e){return!!e&&void 0!==e.read&&void 0!==e.reportChanges}class lY extends ro.JT{constructor(e){super(),this._onDidChange=this._register(new sd.Q5),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(e,!0),this._mediaQueryList=null,this._handleChange(e,!1)}_handleChange(e,t){this._mediaQueryList?.removeEventListener("change",this._listener),this._mediaQueryList=e.matchMedia(`(resolution: ${e.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),t&&this._onDidChange.fire()}}class lJ extends ro.JT{get value(){return this._value}constructor(e){super(),this._onDidChange=this._register(new sd.Q5),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio(e);let t=this._register(new lY(e));this._register(t.onDidChange(()=>{this._value=this._getPixelRatio(e),this._onDidChange.fire(this._value)}))}_getPixelRatio(e){let t=document.createElement("canvas").getContext("2d");return(e.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}}class lZ{constructor(){this.mapWindowIdToPixelRatioMonitor=new Map}_getOrCreatePixelRatioMonitor(e){let t=aZ(e),i=this.mapWindowIdToPixelRatioMonitor.get(t);
1return i||(i=(0,ro.dk)(new lJ(e)),this.mapWindowIdToPixelRatioMonitor.set(t,i),(0,ro.dk)(sd.ju.once(a2)(({vscodeWindowId:e})=>{e===t&&(i?.dispose(),this.mapWindowIdToPixelRatioMonitor.delete(t))}))),i}getInstance(e){return this._getOrCreatePixelRatioMonitor(e)}}let lX=new lZ;class l1{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}focus(){this.domNode.focus()}setMaxWidth(e){let t=l0(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=l0(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=l0(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=l0(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=l0(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=l0(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=l0(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){let t=l0(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=l0(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=l0(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=l0(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function l0(e){return"number"==typeof e?`${e}px`:e}function l2(e){return new l1(e)}function l5(e,t){e instanceof l1?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setFontVariationSettings(t.fontVariationSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.fontVariationSettings=t.fontVariationSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}class l4{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class l6{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(e){this._createDomElements(),e.document.body.appendChild(this._container),this._readFromDomElements(),this._container?.remove(),this._container=null,this._testElements=null}_createDomElements(){let e=document.createElement("div");
1e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";let t=document.createElement("div");l5(t,this._bareFontInfo),e.appendChild(t);let i=document.createElement("div");l5(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);let n=document.createElement("div");l5(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);let s=[];for(let e of this._requests){let r;0===e.type&&(r=t),2===e.type&&(r=i),1===e.type&&(r=n),r.appendChild(document.createElement("br"));let o=document.createElement("span");l6._render(o,e),r.appendChild(o),s.push(o)}this._container=e,this._testElements=s}static _render(e,t){if(" "===t.chr){let t="\xa0";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){let t=this._requests[e],i=this._testElements[e];t.fulfill(i.offsetWidth/256)}}}var l7=i(25790);class l3 extends ro.JT{constructor(){super(...arguments),this._cache=new Map,this._evictUntrustedReadingsTimeout=-1,this._onDidChange=this._register(new sd.Q5),this.onDidChange=this._onDidChange.event}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache.clear(),this._onDidChange.fire()}_ensureCache(e){let t=aZ(e),i=this._cache.get(t);return i||(i=new l9,this._cache.set(t,i)),i}_writeToCache(e,t,i){this._ensureCache(e).put(t,i),i.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=e.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings(e)},5e3))}_evictUntrustedReadings(e){let t=this._ensureCache(e),i=t.getValues(),n=!1;for(let e of i)e.isTrusted||(n=!0,t.remove(e));n&&this._onDidChange.fire()}readFontInfo(e,t){let i=this._ensureCache(e);if(!i.has(t)){let i=this._actualReadFontInfo(e,t);(i.typicalHalfwidthCharacterWidth<=2||i.typicalFullwidthCharacterWidth<=2||i.spaceWidth<=2||i.maxDigitWidth<=2)&&(i=new l7.pR({pixelRatio:lX.getInstance(e).value,fontFamily:i.fontFamily,fontWeight:i.fontWeight,fontSize:i.fontSize,fontFeatureSettings:i.fontFeatureSettings,fontVariationSettings:i.fontVariationSettings,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,isMonospace:i.isMonospace,typicalHalfwidthCharacterWidth:Math.max(i.t
1ypicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(i.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:i.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(i.spaceWidth,5),middotWidth:Math.max(i.middotWidth,5),wsmiddotWidth:Math.max(i.wsmiddotWidth,5),maxDigitWidth:Math.max(i.maxDigitWidth,5)},!1)),this._writeToCache(e,t,i)}return i.get(t)}_createRequest(e,t,i,n){let s=new l4(e,t);return i.push(s),n?.push(s),s}_actualReadFontInfo(e,t){let i=[],n=[],s=this._createRequest("n",0,i,n),r=this._createRequest("m",0,i,null),o=this._createRequest(" ",0,i,n),a=this._createRequest("0",0,i,n),l=this._createRequest("1",0,i,n),h=this._createRequest("2",0,i,n),d=this._createRequest("3",0,i,n),u=this._createRequest("4",0,i,n),c=this._createRequest("5",0,i,n),g=this._createRequest("6",0,i,n),f=this._createRequest("7",0,i,n),m=this._createRequest("8",0,i,n),p=this._createRequest("9",0,i,n),_=this._createRequest("→",0,i,n),v=this._createRequest("→",0,i,null),b=this._createRequest("\xb7",0,i,n),C=this._createRequest(String.fromCharCode(11825),0,i,null),w="|/-_ilm%";for(let e=0,t=w.length;e<t;e++)this._createRequest(w.charAt(e),0,i,n),this._createRequest(w.charAt(e),1,i,n),this._createRequest(w.charAt(e),2,i,n);!function(e,t,i){new l6(t,i).read(e)}(e,t,i);let y=Math.max(a.width,l.width,h.width,d.width,u.width,c.width,g.width,f.width,m.width,p.width),S=t.fontFeatureSettings===sh.n0.OFF,L=n[0].width;for(let e=1,t=n.length;S&&e<t;e++){let t=L-n[e].width;if(t<-.001||t>.001){S=!1;break}}let x=!0;return S&&v.width!==L&&(x=!1),v.width>_.width&&(x=!1),new l7.pR({pixelRatio:lX.getInstance(e).value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:S,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:r.width,canUseHalfwidthRightwardsArrow:x,spaceWidth:o.width,middotWidth:b.width,wsmiddotWidth:C.width,maxDigitWidth:y},!0)}}class l9{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){let t=e.getId();return!!this._values[t]}get(e){let t=e.getId();return this._values[t]}put(e,t){let i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){let t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}let l8=new l3;(eW=iV||(iV={})).serviceIds=new Map,eW.DI_TARGET="$di$target",eW.DI_DEPENDENCIES="$di$dependencies",eW.getServiceDependencies=function(e){return e[eW.DI_DEPENDENCIES]||[]};let he=ht("instantiationService");function ht(e){if(iV.serviceIds.has(e))return iV.serviceIds.get(e);let t=function(e,i,n){if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");e[iV.DI_TARGET]===e?e[iV.DI_DEPENDENCIES].push({id:t,index:n}):(e[iV.DI_DEPENDENCIES]=[{id:t,index:n}],e[iV.DI_TARGET]=e)};return t.toString=()=>e,iV.serviceIds.set(e,t),t}let hi=ht("codeEditorService"),hn=ht("modelService"),hs=ht("textModelService");class hr extends ro.JT{get onDidChange(){return this._onDidChange.event}constructor(e,t="",i="",n=!0,s){super(),this._onDidChange=this._register(new sd.Q5),this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=n,this._actionCallback=s}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}class ho extends ro.JT{constructor(){super(...arguments),this._onWillRun=this._register(new sd.Q5),this._onDidRun=this._register(new sd.Q5)}get onWillRun(){return this._onWillRun.event}get onDidRun(){return this._onDidRun.event}async run(e,t){let i;if(e.enabled){this._onWillRun.fire({action:e});try{await this.runAction(e,t)}catch(e){i=e}this._onDidRun.fire({action:e,error:i})}}async runAction(e,t){await e.run(t)}}class ha{constructor(){this.id=ha.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}
1static join(...e){let t=[];for(let i of e)i.length&&(t=t.length?[...t,new ha,...i]:i);return t}static{this.ID="vs.actions.separator"}async run(){}}class hl{get actions(){return this._actions}constructor(e,t,i,n){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=n,this._actions=i}async run(){}}class hh extends hr{static{this.ID="vs.actions.empty"}constructor(){super(hh.ID,(0,rh.NC)(28,"(empty)"),void 0,!1)}}function hd(e){return{id:e.id,label:e.label,tooltip:e.tooltip??e.label,class:e.class,enabled:e.enabled??!0,checked:e.checked,run:async(...t)=>e.run(...t)}}var hu=i(805);(iW||(iW={})).isThemeColor=function(e){return!!e&&"object"==typeof e&&"string"==typeof e.id},function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9-]+",e.iconModifierExpression="~[A-Za-z]+",e.iconNameCharacter="[A-Za-z0-9~-]";let t=RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){let n=t.exec(e.id);if(!n)return i(rr.error);let[,s,r]=n,o=["codicon","codicon-"+s];return r&&o.push("codicon-modifier-"+r.substring(1)),o}e.asClassNameArray=i,e.asClassName=function(e){return i(e).join(" ")},e.asCSSSelector=function(e){return"."+i(e).join(".")},e.isThemeIcon=function(e){return!!e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||iW.isThemeColor(e.color))};let n=RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);e.fromString=function(e){let t=n.exec(e);if(!t)return;let[,i]=t;return{id:i}},e.fromId=function(e){return{id:e}},e.modify=function(e,t){let i=e.id,n=i.lastIndexOf("~");return -1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}},e.getModifier=function(e){let t=e.id.lastIndexOf("~");if(-1!==t)return e.id.substring(t+1)},e.isEqual=function(e,t){return e.id===t.id&&e.color?.id===t.color?.id},e.isFile=function(e){return e?.id===rr.file.id},e.isFolder=function(e){return e?.id===rr.folder.id}}(iH||(iH={}));var hc=i(8642);let hg=ht("commandService"),hf=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new sd.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw Error("invalid command");if("string"==typeof e){if(!t)throw Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.metadata&&Array.isArray(e.metadata.args)){let t=[];for(let i of e.metadata.args)t.push(i.constraint);let i=e.handler;e.handler=function(e,...n){return(0,re.D8)(n,t),i(e,...n)}}let{id:i}=e,n=this._commands.get(i);n||(n=new hu.S,this._commands.set(i,n));let s=n.unshift(e),r=(0,ro.OF)(()=>{s();let e=this._commands.get(i);e?.isEmpty()&&this._commands.delete(i)});return this._onDidRegisterCommand.fire(i),(0,ro.dk)(r)}registerCommandAlias(e,t){return hf.registerCommand(e,(e,...i)=>e.get(hg).executeCommand(t,...i))}getCommand(e){let t=this._commands.get(e);if(!(!t||t.isEmpty()))return hc.$.first(t)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let i=this.getCommand(t);i&&e.set(t,i)}return e}};function hm(...e){switch(e.length){case 1:return(0,rh.NC)(1693,"Did you mean {0}?",e[0]);case 2:return(0,rh.NC)(1694,"Did you mean {0} or {1}?",e[0],e[1]);case 3:return(0,rh.NC)(1695,"Did you mean {0}, {1} or {2}?",e[0],e[1],e[2]);default:return}}hf.registerCommand("noop",()=>{});let hp=(0,rh.NC)(1696,"Did you forget to open or close the quote?"),h_=(0,rh.NC)(1697,"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class hv{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:case 8:return">=";case 9:return"=~";case 10:case 17:case 18:case 19:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 20:return"EOF";default:throw(0,o_.L6)(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0)))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){let e=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:e})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){let e=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:e})}else this._match(126)?this._addToken(9):this._error(hm("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(hm("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(hm("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return!this._isAtEnd()&&this._input.charCodeAt(this._current)===e&&(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){let t=this._start,i=this._input.substring(this._start,this._current),n={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(n)}_string(){this.stringRe.lastIndex=this._start;let e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;let t=this._input.substring(this._start,this._current),i=hv._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;39!==this._peek()&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(hp);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(h_);return}let n=this._input.charCodeAt(e);if(t)t=!1;else if(47!==n||i)91===n?i=!0:92===n?t=!0:93===n&&(i=!1);else{e++;break}e++}for(;e<this._input.length&&hv._regexFlags.has(this._input.charCodeAt(e));)e++;this._current=e;let n=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:n,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}}let hb=new Map;hb.set("false",!1),hb.set("true",!0),hb.set("isMac",sS.dz),hb.set("isLinux",sS.IJ),hb.set("isWindows",sS.ED),hb.set("isWeb",sS.$L),hb.set("isMacNative",sS.dz&&!sS.$L),hb.set("isEdge",sS.un),hb.set("isFirefox",sS.vU),hb.set("isChrome",sS.i7),hb.set("isSafari",sS.G6);let hC=Object.prototype.hasOwnProperty,hw={regexParsingWithErrorRecovery:!0},hy=(0,rh.NC)(1675,"Empty context key expression"),hS=(0,rh.NC)(1676,"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),hL=(0,rh.NC)(1677,"'in' after 'not'."),hx=(0,rh.NC)(1678,"closing parenthesis ')'"),hk=(0,rh.NC)(1679,"Unexpected token"),hN=(0,rh.NC)(1680,"Did you forget to put && or || before the token?"),hD=(0,rh.NC)(1681,"Unexpected end of expression"),hE=(0,rh.NC)(1682,"Did you forget to put a context key?");class hT{static{this._parseError=Error()}constructor(e=hw){this._config=e,this._scanner=new hv,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(""===e){this._parsingErrors.push({message:hy,offset:0,lexeme:"",additionalInfo:hS});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{let e=this._expr();if(!this._isAtEnd()){let e=this._peek(),t=17===e.type?hN:void 0;throw this._parsingErrors.push({message:hk,offset:e.offset,lexeme:hv.getLexeme(e),additionalInfo:t}),hT._parseError}return e}catch(e){if(e!==hT._parseError)throw e;return}}_expr(){return this._or()}_or(){let e=[this._and()];for(;this._matchOne(16);){let t=this._and();e.push(t)}return 1===e.length?e[0]:hI.or(...e)}_and(){let e=[this._term()];for(;this._matchOne(15);){let t=this._term();e.push(t)}return 1===e.length?e[0]:hI.and(...e)}_term(){if(this._matchOne(2)){let e=this._peek();switch(e.type){case 11:return this._advance(),hR.INSTANCE;case 12:return this._advance(),hA.INSTANCE;case 0:{this._advance();let e=this._expr();return this._consume(1,hx),e?.negate()}case 17:return this._advance(),hW.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){let e=this._peek();switch(e.type){case 11:return this._advance(),hI.true();case 12:return this._advance(),hI.false();case 0:{this._advance();let e=this._expr();return this._consume(1,hx),e}case 17:{let t=e.lexeme;if(this._advance(),this._matchOne(9)){let e=this._peek();if(!this._config.regexParsingWithErrorRecovery){let i;if(this._advance(),10!==e.type)throw this._errExpectedButGot("REGEX",e);let n=e.lexeme,s=n.lastIndexOf("/"),r=s===n.length-1?void 0:this._removeFlagsGY(n.substring(s+1));try{i=new RegExp(n.substring(1,s),r)}catch(t){throw this._errExpectedButGot("REGEX",e)}return hj.create(t,i)}switch(e.type){case 10:case 19:{let i;let n=[e.lexeme];this._advance();let s=this._peek(),r=0;for(let t=0;t<e.lexeme.length;t++)40===e.lexeme.charCodeAt(t)?r++:41===e.lexeme.charCodeAt(t)&&r--;for(;!this._isAtEnd()&&15!==s.type&&16!==s.type;){switch(s.type){case 0:r++;break;case 1:r--;break;case 10:case 18:for(let t=0;t<s.lexeme.length;t++)40===s.lexeme.charCodeAt(t)?r++:41===e.lexeme.charCodeAt(t)&&r--}if(r<0)break;n.push(hv.getLexeme(s)),this._advance(),s=this._peek()}let o=n.join(""),a=o.lastIndexOf("/"),l=a===o.length-1?void 0:this._removeFlagsGY(o.substring(a+1));try{i=new RegExp(o.substring(1,a),l)}catch(t){throw this._errExpectedButGot("REGEX",e)}return hI.regex(t,i)}case 18:{let i=e.lexeme;this._advance();let n=null;if(!(!i||"string"!=typeof i||0===i.trim().length)){let t=i.indexOf("/"),s=i.lastIndexOf("/");if(t!==s&&t>=0){let r=i.slice(t+1,s),o="i"===i[s+1]?"i":"";try{n=new RegExp(r,o)}catch(t){throw this._errExpectedButGot("REGEX",e)}}}if(null===n)throw this._errExpectedButGot("REGEX",e);return hj.create(t,n)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,hL);
1let e=this._value();return hI.notIn(t,e)}switch(this._peek().type){case 3:{this._advance();let e=this._value();if(18===this._previous().type)return hI.equals(t,e);switch(e){case"true":return hI.has(t);case"false":return hI.not(t);default:return hI.equals(t,e)}}case 4:{this._advance();let e=this._value();if(18===this._previous().type)return hI.notEquals(t,e);switch(e){case"true":return hI.not(t);case"false":return hI.has(t);default:return hI.notEquals(t,e)}}case 5:return this._advance(),hK.create(t,this._value());case 6:return this._advance(),h$.create(t,this._value());case 7:return this._advance(),hz.create(t,this._value());case 8:return this._advance(),hU.create(t,this._value());case 13:return this._advance(),hI.in(t,this._value());default:return hI.has(t)}}case 20:throw this._parsingErrors.push({message:hD,offset:e.offset,lexeme:"",additionalInfo:hE}),hT._parseError;default:throw this._errExpectedButGot(`true | false | KEY 
2	| KEY '=~' REGEX 
3	| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){let e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return!!this._check(e)&&(this._advance(),!0)}_advance(){return!this._isAtEnd()&&this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){let n=(0,rh.NC)(1683,"Expected: {0}\nReceived: '{1}'.",e,hv.getLexeme(t)),s=t.offset,r=hv.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:r,additionalInfo:i}),hT._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return 20===this._peek().type}}class hI{static false(){return hR.INSTANCE}static true(){return hA.INSTANCE}static has(e){return hO.create(e)}static equals(e,t){return hP.create(e,t)}static notEquals(e,t){return hV.create(e,t)}static regex(e,t){return hj.create(e,t)}static in(e,t){return hF.create(e,t)}static notIn(e,t){return hB.create(e,t)}static not(e){return hW.create(e)}static and(...e){return hQ.create(e,null,!0)}static or(...e){return hY.create(e,null,!0)}static{this._parser=new hT({regexParsingWithErrorRecovery:!1})}static deserialize(e){if(null!=e)return this._parser.parse(e)}}function hM(e,t){return e.cmp(t)}class hR{static{this.INSTANCE=new hR}constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return hA.INSTANCE}}class hA{static{this.INSTANCE=new hA}constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return hR.INSTANCE}}class hO{static create(e,t=null){let i=hb.get(e);return"boolean"==typeof i?i?hA.INSTANCE:hR.INSTANCE:new hO(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){var t,i;return e.type!==this.type?this.type-e.type:(t=this.key,t<(i=e.key)?-1:t>i?1:0)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){let e=hb.get(this.key);return"boolean"==typeof e?e?hA.INSTANCE:hR.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=hW.create(this.key,this)),this.negated}}class hP{static create(e,t,i=null){if("boolean"==typeof t)return t?hO.create(e,i):hW.create(e,i);let n=hb.get(e);return"boolean"==typeof n?t===(n?"true":"false")?hA.INSTANCE:hR.INSTANCE:new hP(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:hX(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){let e=hb.get(this.key);return"boolean"==typeof e?this.value===(e?"true":"false")?hA.INSTANCE:hR.INSTANCE:this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hV.create(this.key,this.value,this)),this.negated}}class hF{static create(e,t){return new hF(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:hX(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&this.key===e.key&&this.valueKey===e.valueKey}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):"string"==typeof i&&"object"==typeof t&&null!==t&&hC.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=hB.create(this.key,this.valueKey)),this.negated}}class hB{static create(e,t){return new hB(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=hF.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type&&this._negated.equals(e._negated)}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class hV{static create(e,t,i=null){if("boolean"==typeof t)return t?hW.create(e,i):hO.create(e,i);let n=hb.get(e);return"boolean"==typeof n?t===(n?"true":"false")?hR.INSTANCE:hA.INSTANCE:new hV(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:hX(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){let e=hb.get(this.key);return"boolean"==typeof e?this.value===(e?"true":"false")?hR.INSTANCE:hA.INSTANCE:this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hP.create(this.key,this.value,this)),this.negated}}class hW{static create(e,t=null){let i=hb.get(e);return"boolean"==typeof i?i?hR.INSTANCE:hA.INSTANCE:new hW(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){var t,i;return e.type!==this.type?this.type-e.type:(t=this.key,t<(i=e.ke
3y)?-1:t>i?1:0)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){let e=hb.get(this.key);return"boolean"==typeof e?e?hR.INSTANCE:hA.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hO.create(this.key,this)),this.negated}}function hH(e,t){if("string"==typeof e){let t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):hR.INSTANCE}class hz{static create(e,t,i=null){return hH(t,t=>new hz(e,t,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:hX(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=h$.create(this.key,this.value,this)),this.negated}}class hU{static create(e,t,i=null){return hH(t,t=>new hU(e,t,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:hX(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hK.create(this.key,this.value,this)),this.negated}}class hK{static create(e,t,i=null){return hH(t,t=>new hK(e,t,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:hX(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hU.create(this.key,this.value,this)),this.negated}}class h${static create(e,t,i=null){return hH(t,t=>new h$(e,t,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:hX(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&this.key===e.key&&this.value===e.value}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hz.create(this.key,this.value,this)),this.negated}}class hj{static create(e,t){return new hj(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return -1;if(this.key>e.key)return 1;let t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){let t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){let e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=hq.create(this)),this.negated}}class hq{static create(e){return new hq(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function hG(e){let t=null;for(let i=0,n=e.length;i<n;i++){let n=e[i].substituteConstants();if(e[i]!==n&&null===t){t=[];for(let n=0;n<i;n++)t[n]=e[n]}null!==t&&(t[i]=n)}return null===t?e:t}class hQ{static create(e,t,i){return hQ._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return -1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){let i=hM(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){let e=hG(this.expr);return e===this.expr?this:hQ.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t,i){let n=[],s=!1;for(let t of e)if(t){if(1===t.type){s=!0;continue}if(0===t.type)return hR.INSTANCE;if(6===t.type){n.push(...t.expr);continue}n.push(t)}if(0===n.length&&s)return hA.INSTANCE;if(0!==n.length){if(1===n.length)return n[0];n.sort(hM);for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];for(;n.length>1;){let e=n[n.length-1];if(9!==e.type)break;n.pop();let t=n.pop(),s=0===n.length,r=hY.create(e.expr.map(e=>hQ.create([e,t],null,i)),null,s);r&&(n.push(r),n.sort(hM))}if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return hR.INSTANCE;if(1===n.length)return n[0]}return new hQ(n,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){let e=[];
3for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());this.negated=hY.create(e,this,!0)}return this.negated}}class hY{static create(e,t,i){return hY._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return -1;if(this.expr.length>e.expr.length)return 1;for(let t=0,i=this.expr.length;t<i;t++){let i=hM(this.expr[t],e.expr[t]);if(0!==i)return i}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){let e=hG(this.expr);return e===this.expr?this:hY.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,i){let n=[],s=!1;if(e){for(let t=0,i=e.length;t<i;t++){let i=e[t];if(i){if(0===i.type){s=!0;continue}if(1===i.type)return hA.INSTANCE;if(9===i.type){n=n.concat(i.expr);continue}n.push(i)}}if(0===n.length&&s)return hR.INSTANCE;n.sort(hM)}if(0!==n.length){if(1===n.length)return n[0];for(let e=1;e<n.length;e++)n[e-1].equals(n[e])&&(n.splice(e,1),e--);if(1===n.length)return n[0];if(i){for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++)if(n[e].negate().equals(n[t]))return hA.INSTANCE;if(1===n.length)return n[0]}return new hY(n,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());for(;e.length>1;){let t=e.shift(),i=e.shift(),n=[];for(let e of h0(t))for(let t of h0(i))n.push(hQ.create([e,t],null,!1));e.unshift(hY.create(n,null,!1))}this.negated=hY.create(e,this,!0)}return this.negated}}class hJ extends hO{static{this._info=[]}static all(){return hJ._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,"object"==typeof i?hJ._info.push({...i,key:e}):!0!==i&&hJ._info.push({key:e,description:i,type:null!=t?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return hP.create(this.key,e)}}let hZ=ht("contextKeyService");function hX(e,t,i,n){return e<i?-1:e>i?1:t<n?-1:t>n?1:0}function h1(e,t){let i=0,n=0;for(;i<e.length&&n<t.length;){let s=e[i].cmp(t[n]);if(s<0)return!1;0===s&&i++,n++}return i===e.length}function h0(e){return 9===e.type?e.expr:[e]}class h2{constructor(){this.data=new Map}add(e,t){(0,ab.ok)((0,re.HD)(e)),(0,ab.ok)((0,re.Kn)(t)),(0,ab.ok)(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}as(e){return this.data.get(e)||null}dispose(){this.data.forEach(e=>{(0,re.mf)(e.dispose)&&e.dispose()}),this.data.clear()}}let h5=new h2;class h4{constructor(){this._coreKeybindings=new hu.S,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(1===sS.OS){if(e&&e.win)return e.win}else if(2===sS.OS){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){let t=h4.bindToCurrentPlatform(e),i=new ro.SL;if(t&&t.primary){let n=ov(t.primary,sS.OS);n&&i.add(this._registerDefaultKeybinding(n,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let n=0,s=t.secondary.length;n<s;n++){let s=ov(t.secondary[n],sS.OS);s&&i.add(this._registerDefaultKeybinding(s,e.id,e.args,e.weight,-n-1,e.when))}return i}registerCommandAndKeybindingRule(e){return(0,ro.F8)(this.registerKeybindingRule(e),hf.registerCommand(e))}_registerDefaultKeybinding(e,t,i,n,s,r){let o=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:r,weight1:n,weight2:s,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,(0,ro.OF)(()=>{o(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(h7)),this._cachedMergedKeybindings.slice(0)}}let h6=new h4;function h7(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.command<t.command)return -1;if(e.command>t.command)return 1}return e.weight2-t.weight2}h5.add("platform.keybindingsRegistry",h6);var h3=function(e,t){return function(i,n){t(i,n,e)}};function h9(e){return void 0!==e.command}class h8{static{this._instances=new Map}static{this.CommandPalette=new h8("CommandPalette")}
3static{this.DebugBreakpointsContext=new h8("DebugBreakpointsContext")}static{this.DebugCallStackContext=new h8("DebugCallStackContext")}static{this.DebugConsoleContext=new h8("DebugConsoleContext")}static{this.DebugVariablesContext=new h8("DebugVariablesContext")}static{this.NotebookVariablesContext=new h8("NotebookVariablesContext")}static{this.DebugHoverContext=new h8("DebugHoverContext")}static{this.DebugWatchContext=new h8("DebugWatchContext")}static{this.DebugToolBar=new h8("DebugToolBar")}static{this.DebugToolBarStop=new h8("DebugToolBarStop")}static{this.DebugDisassemblyContext=new h8("DebugDisassemblyContext")}static{this.DebugCallStackToolbar=new h8("DebugCallStackToolbar")}static{this.DebugCreateConfiguration=new h8("DebugCreateConfiguration")}static{this.EditorContext=new h8("EditorContext")}static{this.SimpleEditorContext=new h8("SimpleEditorContext")}static{this.EditorContent=new h8("EditorContent")}static{this.EditorLineNumberContext=new h8("EditorLineNumberContext")}static{this.EditorContextCopy=new h8("EditorContextCopy")}static{this.EditorContextPeek=new h8("EditorContextPeek")}static{this.EditorContextShare=new h8("EditorContextShare")}static{this.EditorTitle=new h8("EditorTitle")}static{this.CompactWindowEditorTitle=new h8("CompactWindowEditorTitle")}static{this.EditorTitleRun=new h8("EditorTitleRun")}static{this.EditorTitleContext=new h8("EditorTitleContext")}static{this.EditorTitleContextShare=new h8("EditorTitleContextShare")}static{this.EmptyEditorGroup=new h8("EmptyEditorGroup")}static{this.EmptyEditorGroupContext=new h8("EmptyEditorGroupContext")}static{this.EditorTabsBarContext=new h8("EditorTabsBarContext")}static{this.EditorTabsBarShowTabsSubmenu=new h8("EditorTabsBarShowTabsSubmenu")}static{this.EditorTabsBarShowTabsZenModeSubmenu=new h8("EditorTabsBarShowTabsZenModeSubmenu")}static{this.EditorActionsPositionSubmenu=new h8("EditorActionsPositionSubmenu")}static{this.EditorSplitMoveSubmenu=new h8("EditorSplitMoveSubmenu")}static{this.ExplorerContext=new h8("ExplorerContext")}static{this.ExplorerContextShare=new h8("ExplorerContextShare")}static{this.ExtensionContext=new h8("ExtensionContext")}static{this.ExtensionEditorContextMenu=new h8("ExtensionEditorContextMenu")}static{this.GlobalActivity=new h8("GlobalActivity")}static{this.CommandCenter=new h8("CommandCenter")}static{this.CommandCenterCenter=new h8("CommandCenterCenter")}static{this.LayoutControlMenuSubmenu=new h8("LayoutControlMenuSubmenu")}static{this.LayoutControlMenu=new h8("LayoutControlMenu")}static{this.MenubarMainMenu=new h8("MenubarMainMenu")}static{this.MenubarAppearanceMenu=new h8("MenubarAppearanceMenu")}static{this.MenubarDebugMenu=new h8("MenubarDebugMenu")}static{this.MenubarEditMenu=new h8("MenubarEditMenu")}static{this.MenubarCopy=new h8("MenubarCopy")}static{this.MenubarFileMenu=new h8("MenubarFileMenu")}static{this.MenubarGoMenu=new h8("MenubarGoMenu")}static{this.MenubarHelpMenu=new h8("MenubarHelpMenu")}static{this.MenubarLayoutMenu=new h8("MenubarLayoutMenu")}static{this.MenubarNewBreakpointMenu=new h8("MenubarNewBreakpointMenu")}static{this.PanelAlignmentMenu=new h8("PanelAlignmentMenu")}static{this.PanelPositionMenu=new h8("PanelPositionMenu")}static{this.ActivityBarPositionMenu=new h8("ActivityBarPositionMenu")}static{this.MenubarPreferencesMenu=new h8("MenubarPreferencesMenu")}static{this.MenubarRecentMenu=new h8("MenubarRecentMenu")}static{this.MenubarSelectionMenu=new h8("MenubarSelectionMenu")}static{this.MenubarShare=new h8("MenubarShare")}static{this.MenubarSwitchEditorMenu=new h8("MenubarSwitchEditorMenu")}static{this.MenubarSwitchGroupMenu=new h8("MenubarSwitchGroupMenu")}static{this.MenubarTerminalMenu=new h8("MenubarTerminalMenu")}static{this.MenubarTerminalSuggestStatusMenu=new h8("MenubarTerminalSuggestStatusMenu")}static{this.MenubarViewMenu=new h8("MenubarViewMenu")}static{this.MenubarHomeMenu=new h8("MenubarHomeMenu")}static{this.OpenEditorsContext=new h8("OpenEditorsContext")}static{this.OpenEditorsContextShare=new h8("OpenEditorsContextShare")}static{this.ProblemsPanelContext=new h8("ProblemsPanelContext")}static{this.SCMInputBox=new h8("SCMInputBox")}static{this.SCMChangeContext=new h8("SCMChangeContext")}static{this.SCMResourceContext=new h8("SCMResourceContext")}static{this.SCMResourceContextShare=new h8("SCMResourceContextShare")}static{this.SCMResourceFolderContext=new h8("SCMResourceFolderContext")}static{this.SCMResourceGroupContext=new h8("SCMResourceGroupContext")}static{this.SCMSourceControl=new h8("SCMSourceControl")}static{this.SCMSourceControlInline=new h8("SCMSourceControlInline")}static{this.SCMSourceControlTitle=new h8("SCMSourceControlTitle")}static{this.SCMHistoryTitle=new h8("SCMHistoryTitle")}static{this.SCMHistoryItemContext=new h8("SCMHistoryItemContext")}static{this.SCMHistoryItemChangeContext=new h8("SCMHistoryItemChangeContext")}static{this.SCMHistoryItemRefContext=new h8("SCMHistoryItemRefContext")}static{this.SCMArtifactGroupContext=new h8("SCMArtifactGroupContext")}static{this.SCMArtifactContext=new h8("SCMArtifactContext")}static{this.SCMQuickDiffDecorations=new h8("SCMQuickDiffDecorations")}static{this.SCMTitle=new h8("SCMTitle")}static{this.SearchContext=new h8("SearchContext")}static{this.SearchActionMenu=new h8("SearchActionContext")}static{this.StatusBarWindowIndicatorMenu=new h8("StatusBarWindowIndicatorMenu")}static{this.StatusBarRemoteIndicatorMenu=new h8("StatusBarRemoteIndicatorMenu")}static{this.StickyScrollContext=new h8("StickyScrollContext")}static{this.TestItem=new h8("TestItem")}static{this.TestItemGutter=new h8("TestItemGutter")}static{this.TestProfilesContext=new h8("TestProfilesContext")}static{this.TestMessageContext=new h8("TestMessageContext")}static{this.TestMessageContent=new h8("TestMessageContent")}static{this.TestPeekElement=new h8("TestPeekElement")}static{this.TestPeekTitle=new h8("TestPeekTitle")}static{this.TestCallStack=new h8("TestCallStack")}static{this.TestCoverageFilterItem=new h8("TestCoverageFilterItem")}
3static{this.TouchBarContext=new h8("TouchBarContext")}static{this.TitleBar=new h8("TitleBar")}static{this.TitleBarContext=new h8("TitleBarContext")}static{this.TitleBarTitleContext=new h8("TitleBarTitleContext")}static{this.TunnelContext=new h8("TunnelContext")}static{this.TunnelPrivacy=new h8("TunnelPrivacy")}static{this.TunnelProtocol=new h8("TunnelProtocol")}static{this.TunnelPortInline=new h8("TunnelInline")}static{this.TunnelTitle=new h8("TunnelTitle")}static{this.TunnelLocalAddressInline=new h8("TunnelLocalAddressInline")}static{this.TunnelOriginInline=new h8("TunnelOriginInline")}static{this.ViewItemContext=new h8("ViewItemContext")}static{this.ViewContainerTitle=new h8("ViewContainerTitle")}static{this.ViewContainerTitleContext=new h8("ViewContainerTitleContext")}static{this.ViewTitle=new h8("ViewTitle")}static{this.ViewTitleContext=new h8("ViewTitleContext")}static{this.CommentEditorActions=new h8("CommentEditorActions")}static{this.CommentThreadTitle=new h8("CommentThreadTitle")}static{this.CommentThreadActions=new h8("CommentThreadActions")}static{this.CommentThreadAdditionalActions=new h8("CommentThreadAdditionalActions")}static{this.CommentThreadTitleContext=new h8("CommentThreadTitleContext")}static{this.CommentThreadCommentContext=new h8("CommentThreadCommentContext")}static{this.CommentTitle=new h8("CommentTitle")}static{this.CommentActions=new h8("CommentActions")}static{this.CommentsViewThreadActions=new h8("CommentsViewThreadActions")}static{this.InteractiveToolbar=new h8("InteractiveToolbar")}static{this.InteractiveCellTitle=new h8("InteractiveCellTitle")}static{this.InteractiveCellDelete=new h8("InteractiveCellDelete")}static{this.InteractiveCellExecute=new h8("InteractiveCellExecute")}static{this.InteractiveInputExecute=new h8("InteractiveInputExecute")}static{this.InteractiveInputConfig=new h8("InteractiveInputConfig")}static{this.ReplInputExecute=new h8("ReplInputExecute")}static{this.IssueReporter=new h8("IssueReporter")}
3static{this.NotebookToolbar=new h8("NotebookToolbar")}static{this.NotebookToolbarContext=new h8("NotebookToolbarContext")}static{this.NotebookStickyScrollContext=new h8("NotebookStickyScrollContext")}static{this.NotebookCellTitle=new h8("NotebookCellTitle")}static{this.NotebookCellDelete=new h8("NotebookCellDelete")}static{this.NotebookCellInsert=new h8("NotebookCellInsert")}static{this.NotebookCellBetween=new h8("NotebookCellBetween")}static{this.NotebookCellListTop=new h8("NotebookCellTop")}static{this.NotebookCellExecute=new h8("NotebookCellExecute")}static{this.NotebookCellExecuteGoTo=new h8("NotebookCellExecuteGoTo")}static{this.NotebookCellExecutePrimary=new h8("NotebookCellExecutePrimary")}static{this.NotebookDiffCellInputTitle=new h8("NotebookDiffCellInputTitle")}static{this.NotebookDiffDocumentMetadata=new h8("NotebookDiffDocumentMetadata")}static{this.NotebookDiffCellMetadataTitle=new h8("NotebookDiffCellMetadataTitle")}static{this.NotebookDiffCellOutputsTitle=new h8("NotebookDiffCellOutputsTitle")}static{this.NotebookOutputToolbar=new h8("NotebookOutputToolbar")}static{this.NotebookOutlineFilter=new h8("NotebookOutlineFilter")}static{this.NotebookOutlineActionMenu=new h8("NotebookOutlineActionMenu")}static{this.NotebookEditorLayoutConfigure=new h8("NotebookEditorLayoutConfigure")}static{this.NotebookKernelSource=new h8("NotebookKernelSource")}static{this.BulkEditTitle=new h8("BulkEditTitle")}static{this.BulkEditContext=new h8("BulkEditContext")}static{this.TimelineItemContext=new h8("TimelineItemContext")}static{this.TimelineTitle=new h8("TimelineTitle")}static{this.TimelineTitleContext=new h8("TimelineTitleContext")}static{this.TimelineFilterSubMenu=new h8("TimelineFilterSubMenu")}static{this.AccountsContext=new h8("AccountsContext")}static{this.SidebarTitle=new h8("SidebarTitle")}static{this.PanelTitle=new h8("PanelTitle")}static{this.AuxiliaryBarTitle=new h8("AuxiliaryBarTitle")}static{this.TerminalInstanceContext=new h8("TerminalInstanceContext")}static{this.TerminalEditorInstanceContext=new h8("TerminalEditorInstanceContext")}static{this.TerminalNewDropdownContext=new h8("TerminalNewDropdownContext")}static{this.TerminalTabContext=new h8("TerminalTabContext")}static{this.TerminalTabEmptyAreaContext=new h8("TerminalTabEmptyAreaContext")}static{this.TerminalStickyScrollContext=new h8("TerminalStickyScrollContext")}static{this.WebviewContext=new h8("WebviewContext")}static{this.InlineCompletionsActions=new h8("InlineCompletionsActions")}static{this.InlineEditsActions=new h8("InlineEditsActions")}static{this.NewFile=new h8("NewFile")}static{this.MergeInput1Toolbar=new h8("MergeToolbar1Toolbar")}static{this.MergeInput2Toolbar=new h8("MergeToolbar2Toolbar")}static{this.MergeBaseToolbar=new h8("MergeBaseToolbar")}static{this.MergeInputResultToolbar=new h8("MergeToolbarResultToolbar")}static{this.InlineSuggestionToolbar=new h8("InlineSuggestionToolbar")}static{this.InlineEditToolbar=new h8("InlineEditToolbar")}static{this.ChatContext=new h8("ChatContext")}static{this.ChatCodeBlock=new h8("ChatCodeblock")}static{this.ChatCompareBlock=new h8("ChatCompareBlock")}static{this.ChatMessageTitle=new h8("ChatMessageTitle")}static{this.ChatHistory=new h8("ChatHistory")}static{this.ChatWelcomeContext=new h8("ChatWelcomeContext")}static{this.ChatMessageFooter=new h8("ChatMessageFooter")}static{this.ChatExecute=new h8("ChatExecute")}static{this.ChatInput=new h8("ChatInput")}static{this.ChatInputSide=new h8("ChatInputSide")}static{this.ChatModePicker=new h8("ChatModePicker")}static{this.ChatEditingWidgetToolbar=new h8("ChatEditingWidgetToolbar")}static{this.ChatEditingEditorContent=new h8("ChatEditingEditorContent")}static{this.ChatEditingEditorHunk=new h8("ChatEditingEditorHunk")}static{this.ChatEditingDeletedNotebookCell=new h8("ChatEditingDeletedNotebookCell")}static{this.ChatInputAttachmentToolbar=new h8("ChatInputAttachmentToolbar")}static{this.ChatEditingWidgetModifiedFilesToolbar=new h8("ChatEditingWidgetModifiedFilesToolbar")}static{this.ChatInputResourceAttachmentContext=new h8("ChatInputResourceAttachmentContext")}static{this.ChatInputSymbolAttachmentContext=new h8("ChatInputSymbolAttachmentContext")}static{this.ChatInlineResourceAnchorContext=new h8("ChatInlineResourceAnchorContext")}
3static{this.ChatInlineSymbolAnchorContext=new h8("ChatInlineSymbolAnchorContext")}static{this.ChatMessageCheckpoint=new h8("ChatMessageCheckpoint")}static{this.ChatMessageRestoreCheckpoint=new h8("ChatMessageRestoreCheckpoint")}static{this.ChatNewMenu=new h8("ChatNewMenu")}static{this.ChatEditingCodeBlockContext=new h8("ChatEditingCodeBlockContext")}static{this.ChatTitleBarMenu=new h8("ChatTitleBarMenu")}static{this.ChatAttachmentsContext=new h8("ChatAttachmentsContext")}static{this.ChatToolOutputResourceToolbar=new h8("ChatToolOutputResourceToolbar")}static{this.ChatTextEditorMenu=new h8("ChatTextEditorMenu")}static{this.ChatToolOutputResourceContext=new h8("ChatToolOutputResourceContext")}static{this.ChatMultiDiffContext=new h8("ChatMultiDiffContext")}static{this.ChatSessionsMenu=new h8("ChatSessionsMenu")}static{this.ChatSessionsCreateSubMenu=new h8("ChatSessionsCreateSubMenu")}static{this.ChatConfirmationMenu=new h8("ChatConfirmationMenu")}static{this.ChatEditorInlineExecute=new h8("ChatEditorInputExecute")}static{this.ChatEditorInlineInputSide=new h8("ChatEditorInputSide")}static{this.AccessibleView=new h8("AccessibleView")}static{this.MultiDiffEditorFileToolbar=new h8("MultiDiffEditorFileToolbar")}
3static{this.DiffEditorHunkToolbar=new h8("DiffEditorHunkToolbar")}static{this.DiffEditorSelectionToolbar=new h8("DiffEditorSelectionToolbar")}constructor(e){if(h8._instances.has(e))throw TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);h8._instances.set(e,this),this.id=e}}let de=ht("menuService");class dt{static{this._all=new Map}static for(e){let t=this._all.get(e);return t||(t=new dt(e),this._all.set(e,t)),t}static merge(e){let t=new Set;for(let i of e)i instanceof dt&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}let di=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new sd.SZ({merge:dt.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(dt.for(h8.CommandPalette)),(0,ro.dk)((0,ro.OF)(()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(dt.for(h8.CommandPalette))}))}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;return this._commands.forEach((t,i)=>e.set(i,t)),e}appendMenuItem(e,t){let i=this._menuItems.get(e);i||(i=new hu.S,this._menuItems.set(e,i));let n=i.push(t);return this._onDidChangeMenu.fire(dt.for(e)),(0,ro.dk)((0,ro.OF)(()=>{n(),this._onDidChangeMenu.fire(dt.for(e))}))}appendMenuItems(e){let t=new ro.SL;for(let{id:i,item:n}of e)t.add(this.appendMenuItem(i,n));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===h8.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){let t=new Set;for(let i of e)h9(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach((i,n)=>{t.has(n)||e.push({command:i})})}};class dn extends hl{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let ds=iz=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?"string"==typeof e.shortTitle?e.shortTitle:e.shortTitle.value:"string"==typeof e.title?e.title:e.title.value}constructor(e,t,i,n,s,r,o){let a;if(this.hideActions=n,this.menuKeybinding=s,this._commandService=o,this.id=e.id,this.label=iz.label(e,i),this.tooltip=("string"==typeof e.tooltip?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||r.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){let t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=r.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip="string"==typeof t.tooltip?t.tooltip:t.tooltip.value),this.checked&&iH.isThemeIcon(t.icon)&&(a=t.icon),this.checked&&t.title&&(this.label="string"==typeof t.title?t.title:t.title.value)}a||(a=iH.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new iz(t,void 0,i,n,void 0,r,o):void 0,this._options=i,this.class=a&&iH.asClassName(a)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};ds=iz=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([h3(5,hZ),h3(6,hg)],ds);class dr{constructor(e){this.desc=e}}let da=ht("telemetryService");class dl{constructor(e,t){this.uri=e,this.value=t}}class dh{static{this.defaultToKey=e=>e.toString()}constructor(e,t){if(this[iU]="ResourceMap",e instanceof dh)this.map=new Map(e.map),this.toKey=t??dh.defaultToKey;else if(Array.isArray(e))for(let[i,n]of(this.map=new Map,this.toKey=t??dh.defaultToKey,e))this.set(i,n);else this.map=new Map,this.toKey=e??dh.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new dl(e,t)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){for(let[i,n]of(void 0!==t&&(e=e.bind(t)),this.map))e(n.value,
3n.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(iU=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}}class dd{constructor(e,t){this[iK]="ResourceSet",e&&"function"!=typeof e?(this._map=new dh(t),e.forEach(this.add,this)):this._map=new dh(e)}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,t){this._map.forEach((i,n)=>e.call(t,n,n,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(iK=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}}class du{constructor(){this[i$]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=0){let i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:case 2:default:this.addItemLast(n);break;case 1:this.addItemFirst(n)}this._map.set(e,n),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let i=this._state,n=this._head;for(;n;){if(t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),this._state!==i)throw Error("LinkedMap got modified during iteration.");n=n.next}}keys(){let e=this,t=this._state,i=this._head,n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw Error("LinkedMap got modified during iteration.");if(!i)return{value:void 0,done:!0};{let e={value:i.key,done:!1};return i=i.next,e}}};return n}values(){let e=this,t=this._state,i=this._head,n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw Error("LinkedMap got modified during iteration.");if(!i)return{value:void 0,done:!0};{let e={value:i.value,done:!1};return i=i.next,e}}};return n}entries(){let e=this,t=this._state,i=this._head,n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw Error("LinkedMap got modified during iteration.");if(!i)return{value:void 0,done:!0};{let e={value:[i.key,i.value],done:!1};return i=i.next,e}}};return n}[(i$=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(0===e){this.clear();return}let t=this._tail,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.previous,i--;this._tail=t,this._size=i,t&&(t.next=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(this._head)e.next=this._head,this._head.previous=e;else throw Error("Invalid list")}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error("Invalid list")}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,i=e.previous;if(!t||!i)throw Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error("Invalid list");if(1===t||2===t){if(1===t){if(e===this._head)return;let t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state
3++}else if(2===t){if(e===this._tail)return;let t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){for(let[t,i]of(this.clear(),e))this.set(t,i)}}class dc extends du{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}}class dg extends dc{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}}class df{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(let[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){let t=this._m1.get(e);return void 0!==t&&(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class dm{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}}class dp{constructor(){this._data=new Map}set(e,...t){let i=this._data;for(let e=0;e<t.length-1;e++)i.has(t[e])||i.set(t[e],new Map),i=i.get(t[e]);i.set(t[t.length-1],e)}get(...e){let t=this._data;for(let i=0;i<e.length-1;i++){if(!t.has(e[i]))return;t=t.get(e[i])}return t.get(e[e.length-1])}clear(){this._data.clear()}toString(){let e=(t,i)=>{let n="";for(let[s,r]of t)n+=`${"  ".repeat(i)}${s}: `,r instanceof Map?n+="\n"+e(r,i+1):n+=`${r}
4`;return n};return e(this._data,0)}}function d_(e){return 47===e||92===e}function dv(e){return e.replace(/[\\/]/g,sV.sep)}function db(e,t=sV.sep){if(!e)return"";let i=e.length,n=e.charCodeAt(0);if(d_(n)){if(d_(e.charCodeAt(1))&&!d_(e.charCodeAt(2))){let n=3;for(;n<i&&!d_(e.charCodeAt(n));n++);if(3!==n&&!d_(e.charCodeAt(n+1))){for(n+=1;n<i;n++)if(d_(e.charCodeAt(n)))return e.slice(0,n+1).replace(/[\\/]/g,t)}}return t}if((n>=65&&n<=90||n>=97&&n<=122)&&58===e.charCodeAt(1))return d_(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);let s=e.indexOf("://");if(-1!==s){for(s+=3;s<i;s++)if(d_(e.charCodeAt(s)))return e.slice(0,s+1)}return""}function dC(e,t,i,n=sj){if(e===t)return!0;if(!e||!t||t.length>e.length)return!1;if(i){if(!rU(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function dw(e){return s5(e,!0)}class dy{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:rO(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!!e&&!!t&&this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===iA.file)return dC(dw(e),dw(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(dT(e.authority,t.authority))return dC(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return sJ.joinPath(e,...t)}basenameOrAuthority(e){return dx(e)||e.authority}basename(e){return sV.basename(e.path)}extname(e){return sV.extname(e.path)}dirname(e){let t;return 0===e.path.length?e:(e.scheme===iA.file?t=sJ.file(sU(dw(e))).path:(t=sV.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t}))}normalizePath(e){let t;return e.path.length?(t=e.scheme===iA.file?sJ.file(sW(dw(e))).path:sV.normalize(e.path),e.with({path:t})):e}relativePath(e,t){if(e.scheme!==t.scheme||!dT(e.authority,t.authority))return;
4if(e.scheme===iA.file){let i=sz(dw(e),dw(t));return sS.ED?dv(i):i}let i=e.path||"/",n=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(let t=Math.min(i.length,n.length);e<t&&(i.charCodeAt(e)===n.charCodeAt(e)||i.charAt(e).toLowerCase()===n.charAt(e).toLowerCase());e++);i=n.substr(0,e)+i.substr(e)}return sV.relative(i,n)}resolvePath(e,t){var i;if(e.scheme===iA.file){let i=sJ.file(sH(dw(e),t));return e.with({authority:i.authority,path:i.path})}return -1===(i=t).indexOf("/")&&(i=dv(i)),/^[a-zA-Z]:(\/|$)/.test(i)&&(i="/"+i),t=i,e.with({path:sV.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&"/"===e.path[0]}isEqualAuthority(e,t){return e===t||void 0!==e&&void 0!==t&&rz(e,t)}hasTrailingPathSeparator(e,t=sj){if(e.scheme===iA.file){let i=dw(e);return i.length>db(i).length&&i[i.length-1]===t}{let t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=sj){return dI(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=sj){let i=!1;if(e.scheme===iA.file){let n=dw(e);i=void 0!==n&&n.length===db(n).length&&n[n.length-1]===t}else{t="/";let n=e.path;i=1===n.length&&47===n.charCodeAt(n.length-1)}return i||dI(e,t)?e:e.with({path:e.path+"/"})}}let dS=new dy(()=>!1),dL=dS.isEqual.bind(dS);dS.isEqualOrParent.bind(dS),dS.getComparisonKey.bind(dS),dS.basenameOrAuthority.bind(dS);let dx=dS.basename.bind(dS);dS.extname.bind(dS);let dk=dS.dirname.bind(dS),dN=dS.joinPath.bind(dS),dD=dS.normalizePath.bind(dS);dS.relativePath.bind(dS);let dE=dS.resolvePath.bind(dS);dS.isAbsolutePath.bind(dS);let dT=dS.isEqualAuthority.bind(dS),dI=dS.hasTrailingPathSeparator.bind(dS);dS.removeTrailingPathSeparator.bind(dS),dS.addTrailingPathSeparator.bind(dS),(eH=ij||(ij={})).META_DATA_LABEL="label",eH.META_DATA_DESCRIPTION="description",eH.META_DATA_SIZE="size",eH.META_DATA_MIME="mime",eH.parseMetaData=function(e){let t=new Map;e.path.substring(e.path.indexOf(";")+1,e.path.lastIndexOf(";")).split(";").forEach(e=>{let[i,n]=e.split(":");i&&n&&t.set(i,n)});let i=e.path.substring(0,e.path.indexOf(";"));return i&&t.set(eH.META_DATA_MIME,i),t};let dM=ht("logService"),dR=ht("loggerService");(ez=iq||(iq={}))[ez.Off=0]="Off",ez[ez.Trace=1]="Trace",ez[ez.Debug=2]="Debug",ez[ez.Info=3]="Info",ez[ez.Warning=4]="Warning",ez[ez.Error=5]="Error";let dA=iq.Info;class dO extends ro.JT{constructor(){super(...arguments),this.level=dA,this._onDidChangeLogLevel=this._register(new sd.Q5)}get onDidChangeLogLevel(){return this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){var t;return(t=this.level)!==iq.Off&&t<=e}canLog(e){return!this._store.isDisposed&&this.checkLogLevel(e)}}class dP extends dO{constructor(e=dA,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.canLog(iq.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.canLog(iq.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.canLog(iq.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.canLog(iq.Warning)&&(this.useColors?console.warn("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.canLog(iq.Error)&&(this.useColors?console.error("%c  ERR","color: #f33",e,...t):console.error(e,...t))}}class dF extends dO{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(let t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(let i of this.loggers)i.trace(e,...t)}debug(e,...t){for(let i of this.loggers)i.debug(e,...t)}info(e,...t){for(let i of this.loggers)i.info(e,...t)}warn(e,...t){for(let i of this.loggers)i.warn(e,...t)}error(e,...t){for(let i of this.loggers)i.error(e,...t)}dispose(){for(let e of this.loggers)e.dispose();super.dispose()}}class dB extends ro.JT{constructor(e,t,i){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new dh,this._onDidChangeLoggers=this._register(new sd.Q5),this._onDidChangeVisibility=this._register(new sd.Q5),i)for(let e of i)this._loggers.set(e.resource,{logger:void 0,info:e})}getLoggerEntry(e){return(0,re.HD)(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}createLogger(e,t){let i=this.toResource(e),n=(0,re.HD)(e)?e:t?.id??o9(i.toString(),0).toString(16),s=this._loggers.get(i)?.logger,r=t?.logLevel==="always"?iq.Trace:t?.logLevel;s||(s=this.doCreateLogger(i,r??this.getLogLevel(i)??this.logLevel,{...t,id:n}));let o={logger:s,info:{resource:i,id:n,logLevel:r,name:t?.name,hidden:t?.hidden,group:t?.group,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(o.info),this._loggers.set(i,o),s}toResource(e){return(0,re.HD)(e)?dN(this.logsHome,`${e}.log`):e}setVisibility(e,t){let i=this.getLoggerEntry(e);i&&!i.info.hidden!==t&&(i.info.hidden=!t,this._loggers.set(i.info.resource,i),this._onDidChangeVisibility.fire([i.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){let t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}
4dispose(){this._loggers.forEach(e=>e.logger?.dispose()),this._loggers.clear(),super.dispose()}}class dV{constructor(){this.onDidChangeLogLevel=new sd.Q5().event}setLevel(e){}getLevel(){return iq.Info}trace(e,...t){}debug(e,...t){}info(e,...t){}warn(e,...t){}error(e,...t){}dispose(){}}class dW extends dB{constructor(){super(iq.Off,sJ.parse("log:///log"))}doCreateLogger(e,t,i){return new dV}}new hJ("logLevel",function(e){switch(e){case iq.Trace:return"trace";case iq.Debug:return"debug";case iq.Info:return"info";case iq.Warning:return"warn";case iq.Error:return"error";case iq.Off:return"off"}}(iq.Info));class dH{static{this.REGISTERED_COMMANDS=new Set}static getRegisteredCommands(){return[...dH.REGISTERED_COMMANDS]}static registerCommand(e){dH.REGISTERED_COMMANDS.add(e)}}class dz{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this.metadata=e.metadata,this.canTriggerInlineEdits=e.canTriggerInlineEdits}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts)for(let e of Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts]){let t=e.kbExpr;this.precondition&&(t=t?hI.and(t,this.precondition):this.precondition);let i={id:this.id,weight:e.weight,args:e.args,when:t,primary:e.primary,secondary:e.secondary,win:e.win,linux:e.linux,mac:e.mac};h6.registerKeybindingRule(i)}hf.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),metadata:this.metadata}),this.canTriggerInlineEdits&&dH.registerCommand(this.id)}_registerMenuItem(e){di.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class dU extends dz{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,n){return this._implementations.push({priority:e,name:t,implementation:i,when:n}),this._implementations.sort((e,t)=>t.priority-e.priority),{dispose:()=>{for(let e=0;e<this._implementations.length;e++)if(this._implementations[e].implementation===i){this._implementations.splice(e,1);return}}}}runCommand(e,t){let i=e.get(dM),n=e.get(hZ);for(let s of(i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`),this._implementations)){if(s.when){let e=n.getContext(lg());if(!s.when.evaluate(e))continue}let r=s.implementation(e,t);if(r){if(i.trace(`Command '${this.id}' was handled by '${s.name}'.`),"boolean"==typeof r)return;return r}}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class dK extends dz{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class d$ extends dz{static bindToContribution(e){return class extends d${constructor(e){super(e),this._callback=e.handler}runEditorCommand(t,i,n){let s=e(i);s&&this._callback(s,n)}}}static runEditorCommand(e,t,i,n){let s=e.get(hi),r=s.getFocusedCodeEditor()||s.getActiveCodeEditor();if(r)return r.invokeWithinContext(e=>{if(e.get(hZ).contextMatchesRules(i??void 0))return n(e,r,t)})}runCommand(e,t){return d$.runEditorCommand(e,t,this.precondition,(e,t,i)=>this.runEditorCommand(e,t,i))}}
4function dj(e){return dG.INSTANCE.registerEditorCommand(e),e}function dq(e,t,i){dG.INSTANCE.registerEditorContribution(e,t,i)}(eU=iG||(iG={})).getEditorCommand=function(e){return dG.INSTANCE.getEditorCommand(e)},eU.getEditorActions=function(){return dG.INSTANCE.getEditorActions()},eU.getEditorContributions=function(){return dG.INSTANCE.getEditorContributions()},eU.getSomeEditorContributions=function(e){return dG.INSTANCE.getEditorContributions().filter(t=>e.indexOf(t.id)>=0)},eU.getDiffEditorContributions=function(){return dG.INSTANCE.getDiffEditorContributions()};class dG{static{this.INSTANCE=new dG}constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}function dQ(e){return e.register(),e}h5.add("editor.contributions",dG.INSTANCE);let dY=dQ(new dU({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:h8.MenubarEditMenu,group:"1_do",title:(0,rh.NC)(69,"&&Undo"),order:1},{menuId:h8.CommandPalette,group:"",title:(0,rh.NC)(70,"Undo"),order:1},{menuId:h8.SimpleEditorContext,group:"1_do",title:(0,rh.NC)(71,"Undo"),order:1}]}));dQ(new dK(dY,{id:"default:undo",precondition:void 0}));let dJ=dQ(new dU({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:h8.MenubarEditMenu,group:"1_do",title:(0,rh.NC)(72,"&&Redo"),order:2},{menuId:h8.CommandPalette,group:"",title:(0,rh.NC)(73,"Redo"),order:1},{menuId:h8.SimpleEditorContext,group:"1_do",title:(0,rh.NC)(74,"Redo"),order:2}]}));dQ(new dK(dJ,{id:"default:redo",precondition:void 0}));let dZ=dQ(new dU({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:h8.MenubarSelectionMenu,group:"1_basic",title:(0,rh.NC)(75,"&&Select All"),order:1},{menuId:h8.CommandPalette,group:"",title:(0,rh.NC)(76,"Select All"),order:1},{menuId:h8.SimpleEditorContext,group:"9_select",title:(0,rh.NC)(77,"Select All"),order:1}]})),dX="default",d1=!1;function d0(e){sS.$L&&(d1||(d1=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(e.message))}class d2{constructor(e,t,i,n,s){this.vsWorker=e,this.req=t,this.channel=i,this.method=n,this.args=s,this.type=0}}class d5{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class d4{constructor(e,t,i,n,s){this.vsWorker=e,this.req=t,this.channel=i,this.eventName=n,this.arg=s,this.type=2}}class d6{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class d7{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class d3{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}async sendMessage(e,t,i){let n=String(++this._lastSentReq);return new Promise((s,r)=>{this._pendingReplies[n]={resolve:s,reject:r},this._send(new d2(this._workerId,n,e,t,i))})}listen(e,t,i){let n=null,s=new sd.Q5({onWillAddFirstListener:()=>{n=String(++this._lastSentReq),this._pendingEmitters.set(n,s),this._send(new d4(this._workerId,n,e,t,i))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(n),this._send(new d7(this._workerId,n)),n=null}});return s.event}handleMessage(e){e&&e.vsWorker&&(-1===this._workerId||e.vsWorker===this._workerId)&&this._handleMessage(e)}createProxyToRemoteChannel(e,t){return new Proxy(Object.create(null),{get:(i,n)=>("string"!=typeof n||i[n]||(ue(n)?i[n]=t=>this.listen(e,n,t):d8(n)?i[n]=this.listen(e,n,void 0):36!==n.charCodeAt(0)||(i[n]=async(...i)=>(await t?.(),this.sendMessage(e,n,i)))),i[n])})}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}
4_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}let t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;if(e.err.$isError){let t=Error();t.name=e.err.name,t.message=e.err.message,t.stack=e.err.stack,i=t}t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){let t=e.req;this._handler.handleMessage(e.channel,e.method,e.args).then(e=>{this._send(new d5(this._workerId,t,e,void 0))},e=>{e.detail instanceof Error&&(e.detail=(0,o_.ri)(e.detail)),this._send(new d5(this._workerId,t,void 0,(0,o_.ri)(e)))})}_handleSubscribeEventMessage(e){let t=e.req,i=this._handler.handleEvent(e.channel,e.eventName,e.arg)(e=>{this._send(new d6(this._workerId,t,e))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}
4this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){let t=[];if(0===e.type)for(let i=0;i<e.args.length;i++){let n=e.args[i];n instanceof ArrayBuffer&&t.push(n)}else 1===e.type&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class d9 extends ro.JT{constructor(e){super(),this._localChannels=new Map,this._worker=this._register(e),this._register(this._worker.onMessage(e=>{this._protocol.handleMessage(e)})),this._register(this._worker.onError(e=>{d0(e),(0,o_.dL)(e)})),this._protocol=new d3({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t,i)=>this._handleMessage(e,t,i),handleEvent:(e,t,i)=>this._handleEvent(e,t,i)}),this._protocol.setWorkerId(this._worker.getId()),this._onModuleLoaded=this._protocol.sendMessage(dX,"$initialize",[this._worker.getId()]).then(()=>{}),this.proxy=this._protocol.createProxyToRemoteChannel(dX,async()=>{await this._onModuleLoaded}),this._onModuleLoaded.catch(e=>{this._onError("Worker failed to load ",e)})}_handleMessage(e,t,i){let n=this._localChannels.get(e);if(!n)return Promise.reject(Error(`Missing channel ${e} on main thread`));let s=n[t];if("function"!=typeof s)return Promise.reject(Error(`Missing method ${t} on main thread channel ${e}`));try{return Promise.resolve(s.apply(n,i))}catch(e){return Promise.reject(e)}}_handleEvent(e,t,i){let n=this._localChannels.get(e);if(!n)throw Error(`Missing channel ${e} on main thread`);if(ue(t)){let s=n[t];if("function"!=typeof s)throw Error(`Missing dynamic event ${t} on main thread channel ${e}.`);let r=s.call(n,i);if("function"!=typeof r)throw Error(`Missing dynamic event ${t} on main thread channel ${e}.`);return r}if(d8(t)){let i=n[t];if("function"!=typeof i)throw Error(`Missing event ${t} on main thread channel ${e}.`);return i}throw Error(`Malformed event name ${t}`)}setChannel(e,t){this._localChannels.set(e,t)}_onError(e,t){console.error(e),console.info(t)}}function d8(e){return"o"===e[0]&&"n"===e[1]&&rH(e.charCodeAt(2))}function ue(e){return/^onDynamic/.test(e)&&rH(e.charCodeAt(9))}function ut(e,t){let i=om();if(i?.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(e,t)}catch(e){(0,o_.dL)(e);return}try{return globalThis.trustedTypes?.createPolicy(e,t)}catch(e){(0,o_.dL)(e);return}}var ui=i(16675);"object"==typeof self&&self.constructor&&"DedicatedWorkerGlobalScope"===self.constructor.name&&void 0!==globalThis.workerttPolicy?c=globalThis.workerttPolicy:c=ut("defaultWorkerFactory",{createScriptURL:e=>e});class un extends ro.JT{static{this.LAST_WORKER_ID=0}constructor(e){super(),this._onMessage=this._register(new sd.Q5),this.onMessage=this._onMessage.event,this._onError=this._register(new sd.Q5),this.onError=this._onError.event,this.id=++un.LAST_WORKER_ID;let t=e instanceof Worker?e:"then"in e?e:function(e,t){let i=e.label||"anonymous"+t,n=om();if(n){if("function"==typeof n.getWorker)return n.getWorker("workerMain.js",i);if("function"==typeof n.getWorkerUrl){let e=n.getWorkerUrl("workerMain.js",i);return new Worker(c?c.createScriptURL(e):e,{name:i,type:"module"})}}let s=e.esmModuleLocation;if(s){var r;let e=function(e,t){if(/^((http:)|(https:)|(file:))/.test(t)&&t.substring(0,globalThis.origin.length)!==globalThis.origin);else{let i=t.lastIndexOf("?"),n=t.lastIndexOf("#",i),s=i>0?new URLSearchParams(t.substring(i+1,~n?n:void 0)):new URLSearchParams;iO.addSearchParam(s,!0,!0),t=s.toString()?`${t}?${s.toString()}#${e}`:`${t}#${e}`}let i=new Blob([(0,as.kX)([`/*${e}*/`,`globalThis._VSCODE_NLS_MESSAGES = ${JSON.stringify((0,ui.$)())};`,`globalThis._VSCODE_NLS_LANGUAGE = ${JSON.stringify((0,ui.f)())};`,`globalThis._VSCODE_FILE_ROOT = ${JSON.stringify(globalThis._VSCODE_FILE_ROOT)};`,"const ttPolicy = globalThis.trustedTypes?.createPolicy('defaultWorkerFactory', { createScriptURL: value => value });","globalThis.workerttPolicy = ttPolicy;",`await import(ttPolicy?.createScriptURL(${JSON.stringify(t)}) ?? ${JSON.stringify(t)});`,"globalThis.postMessage({ type: 'vscode-worker-ready' });",`/*${e}*/`]).join("")],{type:"application/javascript"});return URL.createObjectURL(i)}(i,s.toString(!0));return r=new Worker(c?c.createScriptURL(e):e,{name:i,type:"module"}),new Promise((e,t)=>
4{r.onmessage=function(t){"vscode-worker-ready"===t.data.type&&(r.onmessage=null,e(r))},r.onerror=t})}throw Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}(e,this.id);t&&"function"==typeof t.then?this.worker=t:this.worker=Promise.resolve(t),this.postMessage("-please-ignore-",[]);let i=e=>{this._onError.fire(e)};this.worker.then(e=>{e.onmessage=e=>{this._onMessage.fire(e.data)},e.onmessageerror=e=>{this._onError.fire(e)},"function"==typeof e.addEventListener&&e.addEventListener("error",i)}),this._register((0,ro.OF)(()=>{this.worker?.then(e=>{e.onmessage=null,e.onmessageerror=null,e.removeEventListener("error",i),e.terminate()}),this.worker=null}))}getId(){return this.id}postMessage(e,t){this.worker?.then(i=>{try{i.postMessage(e,t)}catch(e){o_.dL(e),o_.dL(Error("FAILED to post message to worker",{cause:e}))}})}}class us{constructor(e,t){this.esmModuleLocation=e,this.label=t}}var ur=i(23719);(eK=iQ||(iQ={}))[eK.None=0]="None",eK[eK.Indent=1]="Indent",eK[eK.IndentOutdent=2]="IndentOutdent",eK[eK.Outdent=3]="Outdent";class uo{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1}}isOK(e){switch(e){case 0:return!0;case 1:return this._inComment;case 2:return this._inString;case 3:return this._inRegEx}}shouldAutoClose(e,t){if(0===e.getTokenCount())return!0;let i=e.findTokenIndexAtOffset(t-2),n=e.getStandardTokenType(i);return this.isOK(n)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){let e=String.fromCharCode(i);if(!this.open.includes(e)&&!this.close.includes(e))return e}return null}findNeutralCharacter(){return this._neutralCharacterSearched||(this._neutralCharacterSearched=!0,this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(48,57)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(97,122)),this._neutralCharacter||(this._neutralCharacter=this._findNeutralCharacterInRange(65,90))),this._neutralCharacter}}class ua{constructor(e){for(let t of(this.autoClosingPairsOpenByStart=new Map,this.autoClosingPairsOpenByEnd=new Map,this.autoClosingPairsCloseByStart=new Map,this.autoClosingPairsCloseByEnd=new Map,this.autoClosingPairsCloseSingleChar=new Map,e))ul(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),ul(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),ul(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),ul(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),1===t.close.length&&1===t.open.length&&ul(this.autoClosingPairsCloseSingleChar,t.close,t)}}function ul(e,t,i){e.has(t)?e.get(t).push(i):e.set(t,[i])}class uh{static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n	"}static{this.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n	"}constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(e=>new uo(e)):e.brackets?this._autoClosingPairs=e.brackets.map(e=>new uo({open:e[0],close:e[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){let t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new uo({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes="string"==typeof e.autoCloseBefore?e.autoCloseBefore:uh.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets="string"==typeof e.autoCloseBefore?e.autoCloseBefore:uh.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}function ud(e,t){let i=e.getCount(),n=e.findTokenIndexAtOffset(t),s=e.getLanguageId(n),r=n;for(;r+1<i&&e.getLanguageId(r+1)===s;)r++;let o=n;for(;o>0&&e.getLanguageId(o-1)===s;)o--;return new uu(e,s,o,r+1,e.getStartOffset(o),e.getEndOffset(r))}class uu{constructor(e,t,i,n,s,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=s,this._lastCharOffset=r,this.languageIdCodec=e.languageIdCodec}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getLineLength(){return this._lastCharOffset-this.firstCharOffset}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}toIViewLineTokens(){return this._actual.sliceAndInflate(this.firstCharOffset,this._lastCharOffset,0)}}function uc(e){return(3&e)!=0}
4function ug(){return g||(g=new TextDecoder("UTF-16LE")),g}function uf(){return m||(m=(0,sS.r)()?ug():(f||(f=new TextDecoder("UTF-16BE")),f)),m}class um{constructor(e){this._capacity=0|e,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return null!==this._completedStrings?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(0===this._bufferLength)return"";let e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return uf().decode(e)}_flushBuffer(){let e=this._buildBuffer();this._bufferLength=0,null===this._completedStrings?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){let t=this._capacity-this._bufferLength;t<=1&&(0===t||rq(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){let t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class up{constructor(e,t,i,n,s,r){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=s,this.reversedRegex=r,this._openSet=up._toSet(this.open),this._closeSet=up._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){let t=new Set;for(let i of e)t.add(i);return t}}class u_{constructor(e,t){this._richEditBracketsBrand=void 0;let i=function(e){let t=e.length;e=e.map(e=>[e[0].toLowerCase(),e[1].toLowerCase()]);let i=[];for(let e=0;e<t;e++)i[e]=e;let n=(e,t)=>{let[i,n]=e,[s,r]=t;return i===s||i===r||n===s||n===r},s=(e,n)=>{let s=Math.min(e,n),r=Math.max(e,n);for(let e=0;e<t;e++)i[e]===r&&(i[e]=s)};for(let r=0;r<t;r++){let o=e[r];for(let a=r+1;a<t;a++)n(o,e[a])&&s(i[r],i[a])}let r=[];for(let n=0;n<t;n++){let s=[],o=[];for(let r=0;r<t;r++)if(i[r]===n){let[t,i]=e[r];s.push(t),o.push(i)}s.length>0&&r.push({open:s,close:o})}return r}(t);for(let t of(this.brackets=i.map((t,n)=>new up(e,n,t.open,t.close,function(e,t,i,n){let s=[];s=(s=s.concat(e)).concat(t);for(let e=0,t=s.length;e<t;e++)uv(s[e],i,n,s);return(s=uC(s)).sort(ub),s.reverse(),uy(s)}(t.open,t.close,i,n),function(e,t,i,n){let s=[];s=(s=s.concat(e)).concat(t);for(let e=0,t=s.length;e<t;e++)uv(s[e],i,n,s);return(s=uC(s)).sort(ub),s.reverse(),uy(s.map(uS))}(t.open,t.close,i,n))),this.forwardRegex=function(e){let t=[];for(let i of e){for(let e of i.open)t.push(e);for(let e of i.close)t.push(e)}return uy(t=uC(t))}(this.brackets),this.reversedRegex=function(e){let t=[];for(let i of e){for(let e of i.open)t.push(e);for(let e of i.close)t.push(e)}return uy((t=uC(t)).map(uS))}(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0,this.brackets)){for(let e of t.open)this.textIsBracket[e]=t,this.textIsOpenBracket[e]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,e.length);for(let e of t.close)this.textIsBracket[e]=t,this.textIsOpenBracket[e]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,e.length)}}}function uv(e,t,i,n){for(let s=0,r=t.length;s<r;s++){if(s===i)continue;let r=t[s];for(let t of r.open)t.indexOf(e)>=0&&n.push(t);for(let t of r.close)t.indexOf(e)>=0&&n.push(t)}}function ub(e,t){return e.length-t.length}function uC(e){if(e.length<=1)return e;let t=[],i=new Set;for(let n of e)i.has(n)||(t.push(n),i.add(n));return t}function uw(e){let t=/^[\w ]+$/.test(e);return e=rN(e),t?`\\b${e}\\b`:e}function uy(e,t){return rE(`(${e.map(uw).join(")|(")})`,!0,t)}let uS=(x=null,k=null,function(e){return x!==e&&(k=function(e){let t=new Uint16Array(e.length),i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return uf().decode(t)}(x=e)),k});class uL{static _findPrevBracketInText(e,t,i,n){let s=i.match(e);if(!s)return null;let r=i.length-(s.index||0),o=s[0].length,a=n+r;return new s9(t,a-o+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,s){let r=uS(i).substring(i.length-s,i.length-n);return this._findPrevBracketInText(e,t,r,n)}static findNextBracketInText(e,t,i,n){let s=i.match(e);if(!s)return null;let r=s.index||0,o=s[0].length;if(0===o)return null;let a=n+r;return new s9(t,a+1,t,a+1+o)}static findNextBracketInRange(e,t,i,n,s){let r=i.substring(n,s);return this.findNextBracketInText(e,t,r,n)}}class ux{constructor(e){this._richEditBrackets=e}getElectricCharacters(){let e=[];
4if(this._richEditBrackets)for(let t of this._richEditBrackets.brackets)for(let i of t.close){let t=i.charAt(i.length-1);e.push(t)}return(0,as.EB)(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;let n=t.findTokenIndexAtOffset(i-1);if(uc(t.getStandardTokenType(n)))return null;let s=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,o=uL.findPrevBracketInRange(s,1,r,0,r.length);if(!o)return null;let a=r.substring(o.startColumn-1,o.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;let l=t.getActualLineContentBefore(o.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function uk(e){return e.global&&(e.lastIndex=0),!0}class uN{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&uk(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&uk(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&uk(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&uk(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class uD{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(e=>{let t=uD._createOpenBracketRegExp(e[0]),i=uD._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let e=0,s=this._regExpRules.length;e<s;e++){let s=this._regExpRules[e];if([{reg:s.beforeText,text:i},{reg:s.afterText,text:n},{reg:s.previousLineText,text:t}].every(e=>!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text))))return s.action}if(e>=2&&i.length>0&&n.length>0)for(let e=0,t=this._brackets.length;e<t;e++){let t=this._brackets[e];if(t.openRegExp.test(i)&&t.closeRegExp.test(n))return{indentAction:iQ.IndentOutdent}}if(e>=2&&i.length>0){for(let e=0,t=this._brackets.length;e<t;e++)if(this._brackets[e].openRegExp.test(i))return{indentAction:iQ.Indent}}return null}static _createOpenBracketRegExp(e){let t=rN(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",uD._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=rN(e);return/\B/.test(t.charAt(t.length-1))||(t+="\\b"),t="^\\s*"+t,uD._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(e){return(0,o_.dL)(e),null}}}let uE=ht("configurationService");function uT(e,t){let i=Object.create(null);for(let n in e)uI(i,n,e[n],t);return i}function uI(e,t,i,n){let s=t.split("."),r=s.pop(),o=e;for(let e=0;e<s.length;e++){let i=s[e],r=o[i];switch(typeof r){case"undefined":r=o[i]=Object.create(null);break;case"object":if(null===r){n(`Ignoring ${t} as ${s.slice(0,e+1).join(".")} is null`);return}break;default:n(`Ignoring ${t} as ${s.slice(0,e+1).join(".")} is ${JSON.stringify(r)}`);return}o=r}if("object"==typeof o&&null!==o)try{o[r]=i}catch(e){n(`Ignoring ${t} as ${s.join(".")} is ${JSON.stringify(o)}`)}else n(`Ignoring ${t} as ${s.join(".")} is ${JSON.stringify(o)}`)}function uM(e,t,i){let n=function(e,t){let i=e;for(let e of t){if("object"!=typeof i||null===i)return;i=i[e]}return i}(e,t.split("."));return void 0===n?i:n}let uR=ht("languageService");class uA{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}let uO=[];function uP(e,t,i){t instanceof uA||(t=new uA(t,[],!!i)),uO.push([e,t])}let uF=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-l
4ist",html:"text/html"}),uB="base.contributions.json";class uV extends ro.JT{constructor(){super(...arguments),this.schemasById={},this._onDidChangeSchema=this._register(new sd.Q5)}registerSchema(e,t,i){let n=e.length>0&&"#"===e.charAt(e.length-1)?e.substring(0,e.length-1):e;this.schemasById[n]=t,this._onDidChangeSchema.fire(e),i&&i.add((0,ro.OF)(()=>{delete this.schemasById[n],this._onDidChangeSchema.fire(e)}))}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}let uW=new uV;h5.add(uB,uW);let uH=globalThis.vscode;if(void 0!==uH&&void 0!==uH.context){let e=uH.context.configuration();if(e)p=e.product;else throw Error("Sandbox: unable to resolve product configuration from preload script.")}else globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON?(p=globalThis._VSCODE_PRODUCT_JSON,sN.VSCODE_DEV&&Object.assign(p,{nameShort:`${p.nameShort} Dev`,nameLong:`${p.nameLong} Dev`,dataFolderName:`${p.dataFolderName}-dev`,serverDataFolderName:p.serverDataFolderName?`${p.serverDataFolderName}-dev`:void 0}),p.version||Object.assign(p,{version:globalThis._VSCODE_PACKAGE_JSON.version})):0===Object.keys(p={}).length&&Object.assign(p,{version:"1.104.0-dev",nameShort:"Code - OSS Dev",nameLong:"Code - OSS Dev",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt"});var uz=p;let uU="base.contributions.configuration",uK="vscode://schemas/settings/resourceLanguage",u$=h5.as(uB);class uj extends ro.JT{constructor(){super(),this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=this._register(new sd.Q5),this._onDidUpdateConfiguration=this._register(new sd.Q5),this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:(0,rh.NC)(1664,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},u$.registerSchema(uK,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){return this.registerConfigurations([e],t),e}registerConfigurations(e,t=!0){let i=new Set;this.doRegisterConfigurations(e,t,i),u$.registerSchema(uK,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){let t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);let i=[];for(let{overrides:n,source:s}of e)for(let e in n){t.add(e);let r=this.configurationDefaultsOverrides.get(e)??this.configurationDefaultsOverrides.set(e,{configurationDefaultOverrides:[]}).get(e),o=n[e];if(r.configurationDefaultOverrides.push({value:o,source:s}),uQ.test(e)){let t=this.mergeDefaultConfigurationsForOverrideIdentifier(e,o,s,r.configurationDefaultOverrideValue);if(!t)continue;r.configurationDefaultOverrideValue=t,this.updateDefaultOverrideProperty(e,t,s),i.push(...uY(e))}else{let t=this.mergeDefaultConfigurationsForConfigurationProperty(e,o,s,r.configurationDefaultOverrideValue);if(!t)continue;r.configurationDefaultOverrideValue=t;let i=this.configurationProperties[e];i&&(this.updatePropertyDefaultValue(e,i),this.updateSchema(e,i))}}this.doRegisterOverrideIdentifiers(i)}updateDefaultOverrideProperty(e,t,i){let n={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:"object",default:t.value,description:(0,rh.NC)(1665,"Configure settings to be overridden for {0}.",e.replace(/^\[/,"").replace(/]$/g,"").replace(/\]\[/g,", ")),$ref:uK,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=n,this.defaultLanguageConfigurationOverridesNode.properties[e]=n}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,n){let s=n?.value||{},r=n?.source??new Map;if(!(r instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(let e of Object.keys(t)){let n=t[e];if((0,re.Kn)(n)&&((0,re.o8)(s[e])||(0,re.Kn)(s[e]))){if(s[e]={...s[e]??{},...n},i)for(let t in n)r.set(`${e}.${t}`,i)}else s[e]=n,i?r.set(e,i):r.delete(e)}return{value:s,source:r}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,n){let s=this.configurationProperties[e],r=n?.value??s?.defaultDefaultValue,o=i;if((0,re.Kn)(t)&&(void 0!==s&&"object"===s.type||void 0===s&&((0,re.o8)(r)||(0,re.Kn)(r)))){if(!((o=n?.source??new Map)instanceof Map)){console.error("defaultValueSource is not a Map");return}for(let n in t)i&&o.set(`${e}.${n}
4`,i);t={...(0,re.Kn)(r)?r:{},...t}}return{value:t,source:o}}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(let t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,i),this.configurationContributors.push(e),this.registerJSONConfiguration(e)})}validateAndRegisterProperties(e,t=!0,i,n,s=4,r){s=(0,re.Jp)(e.scope)?s:e.scope;let o=e.properties;if(o)for(let l in o){var a;let h=o[l];if(h.section={id:e.id,title:e.title,order:e.order,extensionInfo:e.extensionInfo},t&&(a=i?.id,l.trim()?uQ.test(l)?(0,rh.NC)(1671,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",l):void 0===uJ.getConfigurationProperties()[l]||a&&uZ.has(a.toLowerCase())?h.policy?.name&&void 0!==uJ.getPolicyConfigurations().get(h.policy?.name)?(0,rh.NC)(1673,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",l,h.policy?.name,uJ.getPolicyConfigurations().get(h.policy?.name)):null:(0,rh.NC)(1672,"Cannot register '{0}'. This property is already registered.",l):(0,rh.NC)(1670,"Cannot register an empty property"))){delete o[l];continue}h.source=i,h.defaultDefaultValue=o[l].default,this.updatePropertyDefaultValue(l,h),uQ.test(l)?h.scope=void 0:(h.scope=(0,re.Jp)(h.scope)?s:h.scope,h.restricted=(0,re.Jp)(h.restricted)?!!n?.includes(l):h.restricted),h.experiment?h.tags?.some(e=>"onexp"===e.toLowerCase())||(h.tags=h.tags??[],h.tags.push("onExP")):h.tags?.some(e=>"onexp"===e.toLowerCase())&&(console.error(`Invalid tag 'onExP' found for property '${l}'. Please use 'experiment' property instead.`),h.experiment={mode:"startup"});let d=o[l].hasOwnProperty("included")&&!o[l].included,u=o[l].policy?.name;d?(this.excludedConfigurationProperties[l]=o[l],u&&(this.policyConfigurations.set(u,l),r.add(l)),delete o[l]):(r.add(l),u&&this.policyConfigurations.set(u,l),this.configurationProperties[l]=o[l],!o[l].deprecationMessage&&o[l].markdownDeprecationMessage&&(o[l].deprecationMessage=o[l].markdownDeprecationMessage))}let l=e.allOf;if(l)for(let e of l)this.validateAndRegisterProperties(e,t,i,n,s,r)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}registerJSONConfiguration(e){let t=e=>{let i=e.properties;if(i)for(let e in i)this.updateSchema(e,i[e]);let n=e.allOf;n?.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:case 2:case 3:case 7:case 4:case 5:break;case 6:this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(let e of this.overrideIdentifiers.values()){let t=`[${e}]`,i={type:"object",description:(0,rh.NC)(1666,"Configure editor settings to be overridden for a language."),errorMessage:(0,rh.NC)(1667,"This setting does not support per-language configuration."),$ref:uK};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){(0,rh.NC)(1668,"Configure editor settings to be overridden for a language."),(0,rh.NC)(1669,"This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let i,n;let s=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;!s||t.disallowConfigurationDefault&&s.source||(i=s.value,n=s.source),(0,re.o8)(i)&&(i=t.defaultDefaultValue,n=void 0),(0,re.o8)(i)&&(i=function(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}(t.type)),t.default=i,t.defaultValueSource=n}}let uq="\\[([^\\]]+)\\]",uG=RegExp(uq,"g"),uQ=RegExp(`^(${uq})+$`);function uY(e){let t=[];if(uQ.test(e)){let i=uG.exec(e);for(;i?.length;){let n=i[1].trim();n&&t.push(n),i=uG.exec(e)}}return(0,as.EB)(t)}let uJ=new uj;h5.add(uU,uJ);let uZ=new Set(uz.defaultChatAgent?[uz.defaultChatAgent.extensionId,uz.defaultChatAgent.chatExtensionId].map(e=>e.toLowerCase()):[]);class uX extends ro.JT{constructor(){super(),this._onDidChangeLanguages=this._register(new sd.Q5),this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e){this._languages.splice(t,1);return}}}}getLanguages(){return this._languages}}let u1=new uX;h5.add("editor.modesRegistry",u1);let u0="plaintext";u1.registerLanguage({id:u0,extensions:[".txt"],aliases:[(0,rh.NC)(784,"Plain Text"),"text"],mimetypes:[uF.text]}),h5.as(uU).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1},"[go]":{"editor.insertSpaces":!1},"[makefile]":{"editor.insertSpaces":!1},"[shellscript]":{"files.eol":"\n"},"[yaml]":{"editor.insertSpaces":!0,"editor.tabSize":2}}}]);class u2{constructor(e,t){this.languageId=e;
4let i=t.brackets?u5(t.brackets):[],n=new ry(e=>{let t=new Set;return{info:new u6(this,e,t),closing:t}}),s=new ry(e=>{let t=new Set,i=new Set;return{info:new u7(this,e,t,i),opening:t,openingColorized:i}});for(let[e,t]of i){let i=n.get(e),r=s.get(t);i.closing.add(r.info),r.opening.add(i.info)}for(let[e,r]of t.colorizedBracketPairs?u5(t.colorizedBracketPairs):i.filter(e=>!("<"===e[0]&&">"===e[1]))){let t=n.get(e),i=s.get(r);t.closing.add(i.info),i.openingColorized.add(t.info),i.opening.add(t.info)}this._openingBrackets=new Map([...n.cachedValues].map(([e,t])=>[e,t.info])),this._closingBrackets=new Map([...s.cachedValues].map(([e,t])=>[e,t.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}getBracketRegExp(e){return uy(Array.from([...this._openingBrackets.keys(),...this._closingBrackets.keys()]),e)}}function u5(e){return e.filter(([e,t])=>""!==e&&""!==t)}class u4{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class u6 extends u4{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class u7 extends u4{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config===this.config&&this.openingBrackets.has(e)}closesColorized(e){return e.config===this.config&&this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var u3=function(e,t){return function(i,n){t(i,n,e)}};class u9{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}let u8=ht("languageConfigurationService"),ce=class extends ro.JT{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new cl),this.onDidChangeEmitter=this._register(new sd.Q5),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;let i=new Set(Object.values(ct));this._register(this.configurationService.onDidChangeConfiguration(e=>{let t=e.change.keys.some(e=>i.has(e)),n=e.change.overrides.filter(([e,t])=>t.some(e=>i.has(e))).map(([e])=>e);if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new u9(void 0));else for(let e of n)this.languageService.isRegisteredLanguageId(e)&&(this.configurations.delete(e),this.onDidChangeEmitter.fire(new u9(e)))})),this._register(this._registry.onDidChange(e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new u9(e.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=function(e,t,i,n){let s=t.getLanguageConfiguration(e);if(!s){if(!n.isRegisteredLanguageId(e))return new ch(e,{});s=new ch(e,{})}let r=function(e,t){let i=t.getValue(ct.brackets,{overrideIdentifier:e}),n=t.getValue(ct.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:ci(i),colorizedBracketPairs:ci(n)}}(s.languageId,i),o=cr([s.underlyingConfig,r]);return new ch(s.languageId,o)}(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};ce=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([u3(0,uE),u3(1,uR)],ce);let ct={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function ci(e){if(Array.isArray(e))return e.map(e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]}).filter(e=>!!e)}function cn(e,t,i){let n=rR(e.getLineContent(t));return n.length>i-1&&(n=n.substring(0,i-1)),n}class cs{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){let i=new co(e,t,++this._order);return this._entries.push(i),this._resolved=null,(0,ro.dk)((0,ro.OF)(()=>{for(let e=0;e<this._entries.length;e++)if(this._entries[e]===i){this._entries.splice(e,1),this._resolved=null;break}}
4))}getResolvedConfiguration(){if(!this._resolved){let e=this._resolve();e&&(this._resolved=new ch(this.languageId,e))}return this._resolved}_resolve(){return 0===this._entries.length?null:(this._entries.sort(co.cmp),cr(this._entries.map(e=>e.configuration)))}}function cr(e){let t={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(let i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}class co{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class ca{constructor(e){this.languageId=e}}class cl extends ro.JT{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new sd.Q5),this.onDidChange=this._onDidChange.event,this._register(this.register(u0,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let n=this._entries.get(e);n||(n=new cs(e),this._entries.set(e,n));let s=n.register(t,i);return this._onDidChange.fire(new ca(e)),(0,ro.dk)((0,ro.OF)(()=>{s.dispose(),this._onDidChange.fire(new ca(e))}))}getLanguageConfiguration(e){let t=this._entries.get(e);return t?.getResolvedConfiguration()||null}}class ch{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new uD(this.underlyingConfig):null,this.comments=ch._handleComments(this.underlyingConfig),this.characterPair=new uh(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||ur.Af,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new uN(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new u2(e,this.underlyingConfig)}getWordDefinition(){return(0,ur.eq)(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new u_(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new ux(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new ua(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){let t=e.comments;if(!t)return null;let i={};if(t.lineComment&&("string"==typeof t.lineComment?i.lineCommentToken=t.lineComment:(i.lineCommentToken=t.lineComment.comment,i.lineCommentNoIndent=t.lineComment.noIndent)),t.blockComment){let[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}uP(u8,ce,1);class cd{constructor(e,t,i,n){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=n}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}class cu{constructor(e){this.source=e}getElements(){let e=this.source,t=new Int32Array(e.length);for(let i=0,n=e.length;i<n;i++)t[i]=e.charCodeAt(i);return t}}class cc{static Assert(e,t){if(!e)throw Error(t)}}class cg{static Copy(e,t,i,n,s){for(let r=0;r<s;r++)i[n+r]=e[t+r]}static Copy2(e,t,i,n,s){for(let r=0;r<s;r++)i[n+r]=e[t+r]}}class cf{constructor(){this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new cd(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}
4class cm{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;let[n,s,r]=cm._getElements(e),[o,a,l]=cm._getElements(t);this._hasStrings=r&&l,this._originalStringElements=n,this._originalElementsOrHash=s,this._modifiedStringElements=o,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){let t=e.getElements();if(cm._isStringArray(t)){let e=new Int32Array(t.length);for(let i=0,n=t.length;i<n;i++)e[i]=ae(t[i],0);return[t,e,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._modifiedStringElements[t])}ElementsAreStrictEqual(e,t){return!!this.ElementsAreEqual(e,t)&&cm._getStrictElement(this._originalSequence,e)===cm._getStrictElement(this._modifiedSequence,t)}static _getStrictElement(e,t){return"function"==typeof e.getStrictElement?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]===this._originalElementsOrHash[t]&&(!this._hasStrings||this._originalStringElements[e]===this._originalStringElements[t])}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]===this._modifiedElementsOrHash[t]&&(!this._hasStrings||this._modifiedStringElements[e]===this._modifiedStringElements[t])}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,n,s){let r=[!1],o=this.ComputeDiffRecursive(e,t,i,n,r);return s&&(o=this.PrettifyChanges(o)),{quitEarly:r[0],changes:o}}ComputeDiffRecursive(e,t,i,n,s){for(s[0]=!1;e<=t&&i<=n&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let s;return i<=n?(cc.Assert(e===t+1,"originalStart should only be one more than originalEnd"),s=[new cd(e,0,i,n-i+1)]):e<=t?(cc.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),s=[new cd(e,t-e+1,i,0)]):(cc.Assert(e===t+1,"originalStart should only be one more than originalEnd"),cc.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),s=[]),s}let r=[0],o=[0],a=this.ComputeRecursionPoint(e,t,i,n,r,o,s),l=r[0],h=o[0];if(null!==a)return a;if(!s[0]){let r=this.ComputeDiffRecursive(e,l,i,h,s),o=[];return o=s[0]?[new cd(l+1,t-(l+1)+1,h+1,n-(h+1)+1)]:this.ComputeDiffRecursive(l+1,t,h+1,n,s),this.ConcatenateChanges(r,o)}return[new cd(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,s,r,o,a,l,h,d,u,c,g,f,m,p,_){let v=null,b=null,C=new cf,w=t,y=i,S=c[0]-m[0]-n,L=-1073741824,x=this.m_forwardHistory.length-1;do{let t=S+e;t===w||t<y&&l[t-1]<l[t+1]?(g=(d=l[t+1])-S-n,d<L&&C.MarkNextChange(),L=d,C.AddModifiedElement(d+1,g),S=t+1-e):(g=(d=l[t-1]+1)-S-n,d<L&&C.MarkNextChange(),L=d-1,C.AddOriginalElement(d,g+1),S=t-1-e),x>=0&&(e=(l=this.m_forwardHistory[x])[0],w=1,y=l.length-1)}while(--x>=-1);if(v=C.getReverseChanges(),_[0]){let e=c[0]+1,t=m[0]+1;if(null!==v&&v.length>0){let i=v[v.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}b=[new cd(e,u-e+1,t,f-t+1)]}else{C=new cf,w=r,y=o,S=c[0]-m[0]-a,L=1073741824,x=p?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{let e=S+s;e===w||e<y&&h[e-1]>=h[e+1]?(g=(d=h[e+1]-1)-S-a,d>L&&C.MarkNextChange(),L=d+1,C.AddOriginalElement(d+1,g+1),S=e+1-s):(g=(d=h[e-1])-S-a,d>L&&C.MarkNextChange(),L=d,C.AddModifiedElement(d+1,g+1),S=e-1-s),x>=0&&(s=(h=this.m_reverseHistory[x])[0],w=1,y=h.length-1)}while(--x>=-1);b=C.getChanges()}return this.ConcatenateChanges(v,b)}ComputeRecursionPoint(e,t,i,n,s,r,o){let a=0,l=0,h=0,d=0,u=0,c=0;e--,i--,s[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];let g=t-e+(n-i),f=g+1,m=new Int32Array(f),p=new Int32Array(f),_=n-i,v=t-e,b=e-i,C=t-n,w=(v-_)%2==0;m[_]=e,p[v]=t,o[0]=!1;for(let y=1;y<=g/2+1;y++){let g=0,S=0;h=this.ClipDiagonalBound(_-y,y,_,f),d=this.ClipDiagonalBound(_+y,y,_,f);for(let e=h;e<=d;e+=2){l=(a=e===h||e<d&&m[e-1]<m[e+1]?m[e+1]:m[e-1]+1)-(e-_)-b;let i=a;for(;a<t&&l<n&&this.ElementsAreEqual(a+1,l+1);)a++,l++;if(m[e]=a,a+l>g+S&&(g=a,S=l),!w&&Math.abs(e-v)<=y-1&&a>=p[e]){if(s[0]=a,r[0]=l,i<=p[e]&&y<=1448)return this.WALKTRACE(_,h,d,b,v,u,c,C,m,p,a,t,s,l,n,r,w,o);return null}}let L=(g-e+(S-i)-y)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,L)){if(o[
40]=!0,s[0]=g,r[0]=S,!(L>0)||!(y<=1448))return e++,i++,[new cd(e,t-e+1,i,n-i+1)];break}u=this.ClipDiagonalBound(v-y,y,v,f),c=this.ClipDiagonalBound(v+y,y,v,f);for(let g=u;g<=c;g+=2){l=(a=g===u||g<c&&p[g-1]>=p[g+1]?p[g+1]-1:p[g-1])-(g-v)-C;let f=a;for(;a>e&&l>i&&this.ElementsAreEqual(a,l);)a--,l--;if(p[g]=a,w&&Math.abs(g-_)<=y&&a<=m[g]){if(s[0]=a,r[0]=l,f>=m[g]&&y<=1448)return this.WALKTRACE(_,h,d,b,v,u,c,C,m,p,a,t,s,l,n,r,w,o);return null}}if(y<=1447){let e=new Int32Array(d-h+2);e[0]=_-h+1,cg.Copy2(m,h,e,1,d-h+1),this.m_forwardHistory.push(e),(e=new Int32Array(c-u+2))[0]=v-u+1,cg.Copy2(p,u,e,1,c-u+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,h,d,b,v,u,c,C,m,p,a,t,s,l,n,r,w,o)}PrettifyChanges(e){for(let t=0;t<e.length;t++){let i=e[t],n=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,s=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,r=i.originalLength>0,o=i.modifiedLength>0;for(;i.originalStart+i.originalLength<n&&i.modifiedStart+i.modifiedLength<s&&(!r||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!o||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){let e=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!e)break;i.originalStart++,i.modifiedStart++}let a=[null];if(t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],a)){e[t]=a[0],e.splice(t+1,1),t--;continue}}for(let t=e.length-1;t>=0;t--){let i=e[t],n=0,s=0;if(t>0){let i=e[t-1];n=i.originalStart+i.originalLength,s=i.modifiedStart+i.modifiedLength}let r=i.originalLength>0,o=i.modifiedLength>0,a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){let t=i.originalStart-e,h=i.modifiedStart-e;if(t<n||h<s||r&&!this.OriginalElementsAreEqual(t,t+i.originalLength)||o&&!this.ModifiedElementsAreEqual(h,h+i.modifiedLength))break;let d=(t===n&&h===s?5:0)+this._boundaryScore(t,i.originalLength,h,i.modifiedLength);d>l&&(l=d,a=e)}i.originalStart-=a,i.modifiedStart-=a;let h=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],h)){e[t-1]=h[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){let i=e[t-1],n=e[t],s=n.originalStart-i.originalStart-i.originalLength,r=i.originalStart,o=n.originalStart+n.originalLength,a=o-r,l=i.modifiedStart,h=n.modifiedStart+n.modifiedLength,d=h-l;if(s<5&&a<20&&d<20){let e=this._findBetterContiguousSequence(r,a,l,d,s);if(e){let[t,r]=e;(t!==i.originalStart+i.originalLength||r!==i.modifiedStart+i.modifiedLength)&&(i.originalLength=t-i.originalStart,i.modifiedLength=r-i.modifiedStart,n.originalStart=t+s,n.modifiedStart=r+s,n.originalLength=o-n.originalStart,n.modifiedLength=h-n.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,n,s){if(t<s||n<s)return null;let r=e+t-s+1,o=i+n-s+1,a=0,l=0,h=0;for(let t=e;t<r;t++)for(let e=i;e<o;e++){let i=this._contiguousSequenceScore(t,e,s);i>0&&i>a&&(a=i,l=t,h=e)}return a>0?[l,h]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let s=0;s<i;s++){if(!this.ElementsAreEqual(e+s,t+s))return 0;n+=this._originalStringElements[e+s].length}return n}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){let i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1||this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){let i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,n){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){let i=[];if(0===e.length||0===t.length)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){let n=Array(e.length+t.length-1);return cg.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],cg.Copy(t,1,n,e.length,t.length-1),n}{let i=Array(e.length+t.length);return cg.Copy(e,0,i,0,e.length),cg.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(cc.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),cc.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),!(e.originalStart+e.originalLength>=t.originalStart)&&!(e.modifiedStart+e.modifiedLength>=t.modifiedStart))return i[0]=null,!1;{let n=e.originalStart,s=e.originalLength,r=e.modifiedStart,o=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(s=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(o=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new cd(n,s,r,o),!0}}ClipDiagonalBound(e,t,i,n){if(e>=0&&e<n)return e;let s=t%2==0;return e<0?s===(i%2==0)?0:1:s===((n-i-1)%2==0)?n-1:n-2}}function cp(e){return e<0?0:e>255?255:0|e}function c_(e){return e<0?0:e>4294967295?4294967295:0|e}class cv{constructor(e){let t=cp(e);this._defaultValue=t,this._asciiMap=cv._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);return t.fill(e),t}set(e,t){let i=cp(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class cb{constructor(e,t,i){let n=new Uint8Array(e*t);for(let s=0,r=e*t;s<r;s++)n[s]=i;this._data=n,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class cC{constructor(e){let t=0,i=0;for(let n=0,s=e.length;n<s;n++){let[s,r,o]=e[n];r>t&&(t=r),s>i&&(i=s),o>i&&(i=o)}t++;let n=new cb(++i,t,0);for(let t=0,i=e.length;t<i;t++){let[i,s,r]=e[t];n.set(i,s,r)}
4this._states=n,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let cw=null;function cy(){return null===cw&&(cw=new cC([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),cw}let cS=null;class cL{static _createLink(e,t,i,n,s){let r=s-1;do{let i=t.charCodeAt(r);if(2!==e.get(i))break;r--}while(r>n);if(n>0){let e=t.charCodeAt(n-1),i=t.charCodeAt(r);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&r--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:r+2},url:t.substring(n,r+1)}}static computeLinks(e,t=cy()){let i=function(){if(null===cS){cS=new cv(0);let e=" 	<>'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…|";for(let t=0;t<e.length;t++)cS.set(e.charCodeAt(t),1);let t=".,;:";for(let e=0;e<t.length;e++)cS.set(t.charCodeAt(e),2)}return cS}(),n=[];for(let s=1,r=e.getLineCount();s<=r;s++){let r=e.getLineContent(s),o=r.length,a=0,l=0,h=0,d=1,u=!1,c=!1,g=!1,f=!1;for(;a<o;){let e=!1,o=r.charCodeAt(a);if(13===d){let t;switch(o){case 40:u=!0,t=0;break;case 41:t=u?0:1;break;case 91:g=!0,c=!0,t=0;break;case 93:g=!1,t=c?0:1;break;case 123:f=!0,t=0;break;case 125:t=f?0:1;break;case 39:case 34:case 96:t=h===o?1:39===h||34===h||96===h?0:1;break;case 42:t=42===h?1:0;break;case 32:t=g?0:1;break;default:t=i.get(o)}1===t&&(n.push(cL._createLink(i,r,s,l,a)),e=!0)}else if(12===d){let t;91===o?(c=!0,t=0):t=i.get(o),1===t?e=!0:d=13}else 0===(d=t.nextState(d,o))&&(e=!0);e&&(d=1,u=!1,c=!1,f=!1,l=a+1,h=o),a++}13===d&&n.push(cL._createLink(i,r,s,l,o))}return n}}class cx{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}static{this.INSTANCE=new cx}navigateValueSet(e,t,i,n,s){if(e&&t){let i=this.doNavigateValueSet(t,s);if(i)return{range:e,value:i}}if(i&&n){let e=this.doNavigateValueSet(n,s);if(e)return{range:i,value:e}}return null}doNavigateValueSet(e,t){let i=this.numberReplace(e,t);return null!==i?i:this.textReplace(e,t)}numberReplace(e,t){let i=Math.pow(10,e.length-(e.lastIndexOf(".")+1)),n=Number(e),s=parseFloat(e);return isNaN(n)||isNaN(s)||n!==s||0===n&&!t?null:String((n=Math.floor(n*i)+(t?i:-i))/i)}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let n=null;for(let s=0,r=e.length;null===n&&s<r;s++)n=this.valueSetReplace(e[s],t,i);return n}valueSetReplace(e,t,i){let n=e.indexOf(t);return n>=0?((n+=i?1:-1)<0?n=e.length-1:n%=e.length,e[n]):null}}var ck=i(2899);let cN={Collator:(e,t)=>new rS(()=>{try{return new Intl.Collator(e,t)}catch{return new Intl.Collator(void 0,t)}}),Segmenter:(e,t)=>new rS(()=>{try{return new Intl.Segmenter(e,t)}catch{return new Intl.Segmenter(void 0,t)}})};class cD extends cv{constructor(e,t){super(0),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=cN.Segmenter(this.intlSegmenterLocales,{granularity:"word"}):this._segmenter=null;for(let t=0,i=e.length;t<i;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}findPrevIntlWordBeforeOrAtOffset(e,t){let i=null;for(let n of this._getIntlSegmenterWordsOnLine(e)){if(n.index>t)break;i=n}return i}findNextIntlWordAtOrAfterOffset(e,t){for(let i of this._getIntlSegmenterWordsOnLine(e))if(!(i.index<t))return i;return null}_getIntlSegmenterWordsOnLine(e){return this._segmenter?(this._cachedLine===e||(this._cachedLine=e,this._cachedSegments=this._filterWordSegments(this._segmenter.value.segment(e))),this._cachedSegments):[]}_filterWordSegments(e){let t=[];for(let i of e)this._isWordLike(i)&&t.push(i);return t}_isWordLike(e){return!!e.isWordLike}}let cE=new dg(10);function cT(e,t){let i=`${e}/${t.join(",")}`,n=cE.get(i);return n||(n=new cD(e,t),cE.set(i,n)),n}var cI=i(8297);(e$=iY||(iY={}))[e$.Left=1]="Left",e$[e$.Center=2]="Center",e$[e$.Right=4]="Right",e$[e$.Full=7]="Full",(ej=iJ||(iJ={}))[ej.Left=1]="Left",ej[ej.Center=2]="Center",ej[ej.Right=3]="Right",(eq=iZ||
4(iZ={}))[eq.LTR=0]="LTR",eq[eq.RTL=1]="RTL",(eG=iX||(iX={}))[eG.Both=0]="Both",eG[eG.Right=1]="Right",eG[eG.Left=2]="Left",eG[eG.None=3]="None";class cM{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,0|e.tabSize),"tabSize"===e.indentSize?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,0|e.indentSize),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=0|e.defaultEOL,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&(0,cI.fS)(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class cR{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}class cA{constructor(e,t,i,n,s,r){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=n,this.isAutoWhitespaceEdit=s,this._isTracked=r}}class cO{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class cP{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}class cF{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){let e;if(""===this.searchString)return null;e=this.isRegex?cB(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=rE(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(e){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new cO(t,this.wordSeparators?cT(this.wordSeparators,[]):null,i?this.searchString:null)}}function cB(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t<i;t++){let n=e.charCodeAt(t);if(10===n)return!0;if(92===n){if(++t>=i)break;let n=e.charCodeAt(t);if(110===n||114===n||87===n)return!0}}return!1}function cV(e,t,i){if(!i)return new cR(e,null);let n=[];for(let e=0,i=t.length;e<i;e++)n[e]=t[e];return new cR(e,n)}class cW{constructor(e){let t=[],i=0;for(let n=0,s=e.length;n<s;n++)10===e.charCodeAt(n)&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){let t=this._lineFeedsOffsets,i=0,n=t.length-1;if(-1===n||e<=t[0])return 0;for(;i<n;){let s=i+((n-i)/2>>0);t[s]>=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class cH{static findMatches(e,t,i,n,s){let r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new cU(r.wordSeparators,r.regex),n,s):this._doFindMatchesLineByLine(e,i,r,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,r){let o,a;let l=0;if(n?(l=n.findLineFeedCountBeforeOffset(s),o=t+s+l):o=t+s,n){let e=n.findLineFeedCountBeforeOffset(s+r.length)-l;a=o+r.length+e}else a=o+r.length;let h=e.getPositionAt(o),d=e.getPositionAt(a);return new s9(h.lineNumber,h.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,n,s){let r;let o=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l="\r\n"===e.getEOL()?new cW(a):null,h=[],d=0;for(i.reset(0);(r=i.next(a))&&(h[d++]=cV(this._getMultilineMatchRange(e,o,a,l,r.index,r[0]),r,n),!(d>=s)););return h}static _doFindMatchesLineByLine(e,t,i,n,s){let r=[],o=0;if(t.startLineNumber===t.endLineNumber){let a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return o=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,o,r,n,s),r}let a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);o=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,o,r,n,s);for(let a=t.startLineNumber+1;a<t.endLineNumber&&o<s;a++)o=this._findMatchesInLine(i,e.getLineContent(a),a,0,o,r,n,s);if(o<s){let a=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);o=this._findMatchesInLine(i,a,t.endLineNumber,0,o,r,n,s)}return r}static _findMatchesInLine(e,t,i,n,s,r,o,a){let l;let h=e.wordSeparators;if(!o&&e.simpleSearch){let o=e.simpleSearch,l=o.length,d=t.length,u=-l;for(;
4-1!==(u=t.indexOf(o,u+l))&&(!(!h||cz(h,t,d,u,l))||(r[s++]=new cR(new s9(i,u+1+n,i,u+1+l+n),null),!(s>=a))););return s}let d=new cU(e.wordSeparators,e.regex);d.reset(0);do if((l=d.next(t))&&(r[s++]=cV(new s9(i,l.index+1+n,i,l.index+1+l[0].length+n),l,o),s>=a))break;while(l);return s}static findNextMatch(e,t,i,n){let s=t.parseSearchRequest();if(!s)return null;let r=new cU(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){let s=new s3(t.lineNumber,1),r=e.getOffsetAt(s),o=e.getLineCount(),a=e.getValueInRange(new s9(s.lineNumber,s.column,o,e.getLineMaxColumn(o)),1),l="\r\n"===e.getEOL()?new cW(a):null;i.reset(t.column-1);let h=i.next(a);return h?cV(this._getMultilineMatchRange(e,r,a,l,h.index,h[0]),h,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new s3(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){let s=e.getLineCount(),r=t.lineNumber,o=e.getLineContent(r),a=this._findFirstMatchInLine(i,o,r,t.column,n);if(a)return a;for(let t=1;t<=s;t++){let o=(r+t-1)%s,a=e.getLineContent(o+1),l=this._findFirstMatchInLine(i,a,o+1,1,n);if(l)return l}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);let r=e.next(t);return r?cV(new s9(i,r.index+1,i,r.index+1+r[0].length),r,s):null}static findPreviousMatch(e,t,i,n){let s=t.parseSearchRequest();if(!s)return null;let r=new cU(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){let s=this._doFindMatchesMultiline(e,new s9(1,1,t.lineNumber,t.column),i,n,9990);if(s.length>0)return s[s.length-1];let r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new s3(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){let s=e.getLineCount(),r=t.lineNumber,o=e.getLineContent(r).substring(0,t.column-1),a=this._findLastMatchInLine(i,o,r,n);if(a)return a;for(let t=1;t<=s;t++){let o=(s+r-t-1)%s,a=e.getLineContent(o+1),l=this._findLastMatchInLine(i,a,o+1,n);if(l)return l}return null}static _findLastMatchInLine(e,t,i,n){let s,r=null;for(e.reset(0);s=e.next(t);)r=cV(new s9(i,s.index+1,i,s.index+1+s[0].length),s,n);return r}}function cz(e,t,i,n,s){return function(e,t,i,n,s){if(0===n)return!0;let r=t.charCodeAt(n-1);if(0!==e.get(r)||13===r||10===r)return!0;if(s>0){let i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,s)&&function(e,t,i,n,s){if(n+s===i)return!0;let r=t.charCodeAt(n+s);if(0!==e.get(r)||13===r||10===r)return!0;if(s>0){let i=t.charCodeAt(n+s-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,s)}class cU{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){let t;let i=e.length;do{if(this._prevMatchStartIndex+this._prevMatchLength===i||!(t=this._searchRegex.exec(e)))break;let n=t.index,s=t[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(0===s){rY(e,i,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}break}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||cz(this._wordSeparators,e,i,n,s))return t}while(t);return null}}class cK{static computeUnicodeHighlights(e,t,i){var n;let s;let r=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),a=new c$(t),l=a.getCandidateCodePoints(),h=new cU(null,"allNonBasicAscii"===l?RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):RegExp(`${(n=Array.from(l),`[${rN(n.map(e=>String.fromCodePoint(e)).join(""))}]`)}`,"g")),d=[],u=!1,c=0,g=0,f=0;e:for(let t=r;t<=o;t++){let i=e.getLineContent(t),n=i.length;h.reset(0);do if(s=h.next(i)){let e=s.index,r=s.index+s[0].length;e>0&&rq(i.charCodeAt(e-1))&&e--,r+1<n&&rq(i.charCodeAt(r-1))&&r++;let o=i.substring(e,r),l=(0,ur.t2)(e+1,ur.Af,i,0);l&&l.endColumn<=e+1&&(l=null);let h=a.shouldHighlightNonBasicASCII(o,l?l.word:null);if(0!==h){if(3===h?c++:2===h?g++:1===h?f++:(0,ab.vE)(),d.length>=1e3){u=!0;break e}d.push(new s9(t,e+1,t,r+1))}}while(s)}return{ranges:d,hasMore:u,ambiguousCharacterCount:c,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:f}}static computeUnicodeHighlightReason(e,t){let i=new c$(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{let n=e.codePointAt(0),s=i.ambiguousCharacters.getPrimaryConfusable(n),r=oi.getL
4ocales().filter(e=>!oi.getInstance(new Set([...t.allowedLocales,e])).isAmbiguous(n));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:r}}case 1:return{kind:2}}}}class c${constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=oi.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";let e=new Set;if(this.options.invisibleCharacters)for(let t of on.codePoints)cj(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(let t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(let t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){let i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let n=!1,s=!1;if(t)for(let e of t){let t=e.codePointAt(0),i=r5(e);n=n||i,i||this.ambiguousCharacters.isAmbiguous(t)||on.isInvisibleCharacter(t)||(s=!0)}return!n&&s?0:this.options.invisibleCharacters&&!cj(e)&&on.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function cj(e){return" "===e||"\n"===e||"	"===e}class cq{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class cG{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class cQ{static fromTo(e,t){return new cQ(e,t)}static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let n=i;for(;n<t.length&&t[n].start<=e.endExclusive;)n++;if(i===n)t.splice(i,0,e);else{let s=Math.min(e.start,t[i].start),r=Math.max(e.endExclusive,t[n-1].endExclusive);t.splice(i,n-i,new cQ(s,r))}}static tryCreate(e,t){if(!(e>t))return new cQ(e,t)}static ofLength(e){return new cQ(0,e)}static ofStartAndLength(e,t){return new cQ(e,e+t)}static emptyAt(e){return new cQ(e,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new o_.he(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new cQ(this.start+e,this.endExclusive+e)}deltaStart(e){return new cQ(this.start+e,this.endExclusive)}deltaEnd(e){return new cQ(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new cQ(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){let t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new cQ(t,i)}intersectionLength(e){let t=Math.max(this.start,e.start);return Math.max(0,Math.min(this.endExclusive,e.endExclusive)-t)}intersects(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)}intersectsOrTouches(e){return Math.max(this.start,e.start)<=Math.min(this.endExclusive,e.endExclusive)}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new o_.he(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new o_.he(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}joinRightTouching(e){if(this.endExclusive!==e.start)throw new o_.he(`Invalid join: ${this.toString()} and ${e.toString()}`);return new cQ(this.start,e.endExclusive)}}class cY{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{let n=Math.min(e.start,this._sortedRanges[t].start),s=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new cQ(n,s))}}toString(){return this._sortedRanges.map(e=>e.toString()).join(", ")}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(e){let t=new cY;for(let i of this._sortedRanges){let n=i.intersect(e);n&&t.addRange(n)}return t}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce((e,t)=>
4e+t.length,0)}}function cJ(e,t,i=e.length-1){let n=function(e,t,i=e.length-1){for(let n=i;n>=0;n--)if(t(e[n],n))return n;return -1}(e,t,i);if(-1!==n)return e[n]}function cZ(e,t){let i=cX(e,t);return -1===i?void 0:e[i]}function cX(e,t,i=0,n=e.length){let s=i,r=n;for(;s<r;){let i=Math.floor((s+r)/2);t(e[i])?s=i+1:r=i}return s-1}function c1(e,t,i=0,n=e.length){let s=i,r=n;for(;s<r;){let i=Math.floor((s+r)/2);t(e[i])?r=i:s=i+1}return s}class c0{static{this.assertInvariants=!1}constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(c0.assertInvariants){if(this._prevFindLastPredicate){for(let t of this._array)if(this._prevFindLastPredicate(t)&&!e(t))throw Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}let t=cX(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,-1===t?void 0:this._array[t]}}function c2(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){let s=e[n];t(s,i)>0&&(i=s)}return i}class c5{static ofLength(e,t){return new c5(e,e+t)}static fromRange(e){return new c5(e.startLineNumber,e.endLineNumber)}static fromRangeInclusive(e){return new c5(e.startLineNumber,e.endLineNumber+1)}static{this.compareByStart=(0,as.tT)(e=>e.startLineNumber,as.fv)}static joinMany(e){if(0===e.length)return[];let t=new c4(e[0].slice());for(let i=1;i<e.length;i++)t=t.getUnion(new c4(e[i].slice()));return t.ranges}static join(e){if(0===e.length)throw new o_.he("lineRanges cannot be empty");let t=e[0].startLineNumber,i=e[0].endLineNumberExclusive;for(let n=1;n<e.length;n++)t=Math.min(t,e[n].startLineNumber),i=Math.max(i,e[n].endLineNumberExclusive);return new c5(t,i)}static deserialize(e){return new c5(e[0],e[1])}constructor(e,t){if(e>t)throw new o_.he(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(e){return new c5(this.startLineNumber+e,this.endLineNumberExclusive+e)}deltaLength(e){return new c5(this.startLineNumber,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new c5(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}intersect(e){let t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumberExclusive,e.endLineNumberExclusive);if(t<=i)return new c5(t,i)}intersectsStrict(e){return this.startLineNumber<e.endLineNumberExclusive&&e.startLineNumber<this.endLineNumberExclusive}intersectsOrTouches(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive}equals(e){return this.startLineNumber===e.startLineNumber&&this.endLineNumberExclusive===e.endLineNumberExclusive}toInclusiveRange(){return this.isEmpty?null:new s9(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)}toExclusiveRange(){return new s9(this.startLineNumber,1,this.endLineNumberExclusive,1)}mapToLineArray(e){let t=[];for(let i=this.startLineNumber;i<this.endLineNumberExclusive;i++)t.push(e(i));return t}forEach(e){for(let t=this.startLineNumber;t<this.endLineNumberExclusive;t++)e(t)}serialize(){return[this.startLineNumber,this.endLineNumberExclusive]}toOffsetRange(){return new cQ(this.startLineNumber-1,this.endLineNumberExclusive-1)}addMargin(e,t){return new c5(this.startLineNumber-e,this.endLineNumberExclusive+t)}}class c4{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(0===e.length)return;let t=c1(this._normalizedRanges,t=>t.endLineNumberExclusive>=e.startLineNumber),i=cX(this._normalizedRanges,t=>
4t.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){let i=this._normalizedRanges[t];this._normalizedRanges[t]=i.join(e)}else{let n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}contains(e){let t=cZ(this._normalizedRanges,t=>t.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}intersects(e){let t=cZ(this._normalizedRanges,t=>t.startLineNumber<e.endLineNumberExclusive);return!!t&&t.endLineNumberExclusive>e.startLineNumber}getUnion(e){if(0===this._normalizedRanges.length)return e;if(0===e._normalizedRanges.length)return this;let t=[],i=0,n=0,s=null;for(;i<this._normalizedRanges.length||n<e._normalizedRanges.length;){let r=null;if(i<this._normalizedRanges.length&&n<e._normalizedRanges.length){let t=this._normalizedRanges[i],s=e._normalizedRanges[n];t.startLineNumber<s.startLineNumber?(r=t,i++):(r=s,n++)}else i<this._normalizedRanges.length?(r=this._normalizedRanges[i],i++):(r=e._normalizedRanges[n],n++);null===s?s=r:s.endLineNumberExclusive>=r.startLineNumber?s=new c5(s.startLineNumber,Math.max(s.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(s),s=r)}return null!==s&&t.push(s),new c4(t)}subtractFrom(e){let t=c1(this._normalizedRanges,t=>t.endLineNumberExclusive>=e.startLineNumber),i=cX(this._normalizedRanges,t=>
4t.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new c4([e]);let n=[],s=e.startLineNumber;for(let e=t;e<i;e++){let t=this._normalizedRanges[e];t.startLineNumber>s&&n.push(new c5(s,t.startLineNumber)),s=t.endLineNumberExclusive}return s<e.endLineNumberExclusive&&n.push(new c5(s,e.endLineNumberExclusive)),new c4(n)}toString(){return this._normalizedRanges.map(e=>e.toString()).join(", ")}getIntersection(e){let t=[],i=0,n=0;for(;i<this._normalizedRanges.length&&n<e._normalizedRanges.length;){let s=this._normalizedRanges[i],r=e._normalizedRanges[n],o=s.intersect(r);o&&!o.isEmpty&&t.push(o),s.endLineNumberExclusive<r.endLineNumberExclusive?i++:n++}return new c4(t)}getWithDelta(e){return new c4(this._normalizedRanges.map(t=>t.delta(e)))}}class c6{static{this.zero=new c6(0,0)}static betweenPositions(e,t){return e.lineNumber===t.lineNumber?new c6(0,t.column-e.column):new c6(t.lineNumber-e.lineNumber,t.column-1)}static fromPosition(e){return new c6(e.lineNumber-1,e.column-1)}static ofRange(e){return c6.betweenPositions(e.getStartPosition(),e.getEndPosition())}static ofText(e){let t=0,i=0;for(let n of e)"\n"===n?(t++,i=0):i++;return new c6(t,i)}constructor(e,t){this.lineCount=e,this.columnCount=t}isGreaterThanOrEqualTo(e){return this.lineCount!==e.lineCount?this.lineCount>e.lineCount:this.columnCount>=e.columnCount}add(e){return 0===e.lineCount?new c6(this.lineCount,this.columnCount+e.columnCount):new c6(this.lineCount+e.lineCount,e.columnCount)}createRange(e){return 0===this.lineCount?new s9(e.lineNumber,e.column,e.lineNumber,e.column+this.columnCount):new s9(e.lineNumber,e.column,e.lineNumber+this.lineCount,this.columnCount+1)}toRange(){return new s9(1,1,this.lineCount+1,this.columnCount+1)}toLineRange(){return c5.ofLength(1,this.lineCount+1)}addToPosition(e){return 0===this.lineCount?new s3(e.lineNumber,e.column+this.columnCount):new s3(e.lineNumber+this.lineCount,this.columnCount+1)}toString(){return`${this.lineCount},${this.columnCount}`}}class c7{getOffsetRange(e){return new cQ(this.getOffset(e.getStartPosition()),this.getOffset(e.getEndPosition()))}getRange(e){return s9.fromPositions(this.getPosition(e.start),this.getPosition(e.endExclusive))}getStringReplacement(e){return new c3.deps.StringReplacement(this.getOffsetRange(e.range),e.text)}getTextReplacement(e){return new c3.deps.TextReplacement(this.getRange(e.replaceRange),e.newText)}getTextEdit(e){let t=e.replacements.map(e=>this.getTextReplacement(e));return new c3.deps.TextEdit(t)}}class c3{static{this._deps=void 0}static get deps(){if(!this._deps)throw Error("Dependencies not set. Call _setDependencies first.");return this._deps}}class c9 extends c7{constructor(e){super(),this.text=e,this.lineStartOffsetByLineIdx=[],this.lineEndOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)"\n"===e.charAt(t)&&(this.lineStartOffsetByLineIdx.push(t+1),t>0&&"\r"===e.charAt(t-1)?this.lineEndOffsetByLineIdx.push(t-1):this.lineEndOffsetByLineIdx.push(t));this.lineEndOffsetByLineIdx.push(e.length)}getOffset(e){let t=this._validatePosition(e);return this.lineStartOffsetByLineIdx[t.lineNumber-1]+t.column-1}_validatePosition(e){if(e.lineNumber<1)return new s3(1,1);let t=this.textLength.lineCount+1;if(e.lineNumber>t){let e=this.getLineLength(t);return new s3(t,e+1)}if(e.column<1)return new s3(e.lineNumber,1);let i=this.getLineLength(e.lineNumber);return e.column-1>i?new s3(e.lineNumber,i+1):e}getPosition(e){let t=cX(this.lineStartOffsetByLineIdx,t=>t<=e),i=e-this.lineStartOffsetByLineIdx[t]+1;return new s3(t+1,i)}get textLength(){let e=this.lineStartOffsetByLineIdx.length-1;return new c3.deps.TextLength(e,this.text.length-this.lineStartOffsetByLineIdx[e])}getLineLength(e){return this.lineEndOffsetByLineIdx[e-1]-this.lineStartOffsetByLineIdx[e-1]}}class c8{constructor(){this._transformer=void 0}get endPositionExclusive(){return this.length.addToPosition(new s3(1,1))}get lineRange(){return this.length.toLineRange()}getValue(){return this.getValueOfRange(this.length.toRange())}getValueOfOffsetRange(e){return this.getValueOfRange(this.getTransformer().getRange(e))}getLineLength(e){return this.getValueOfRange(new s9(e,1,e,Number.MAX_SAFE_INTEGER)).length}getTransformer(){return this._transformer||(this._transformer=new c9(this.getValue())),this._transformer}getLineAt(e){return this.getValueOfRange(new s9(e,1,e,Number.MAX_SAFE_INTEGER))}}
4class ge extends c8{constructor(e,t){(0,ab.hu)(t>=1),super(),this._getLineContent=e,this._lineCount=t}getValueOfRange(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);let t=this._getLineContent(e.startLineNumber).substring(e.startColumn-1);for(let i=e.startLineNumber+1;i<e.endLineNumber;i++)t+="\n"+this._getLineContent(i);return t+"\n"+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1)}getLineLength(e){return this._getLineContent(e).length}get length(){let e=this._getLineContent(this._lineCount);return new c6(this._lineCount-1,e.length)}}class gt extends ge{constructor(e){super(t=>e[t-1],e.length)}}class gi extends c8{constructor(e){super(),this.value=e,this._t=new c9(this.value)}getValueOfRange(e){return this._t.getOffsetRange(e).substring(this.value)}get length(){return this._t.textLength}getTransformer(){return this._t}}class gn{static fromStringEdit(e,t){return new gn(e.replacements.map(e=>gs.fromStringReplacement(e,t)))}static fromParallelReplacementsUnsorted(e){return new gn(e.slice().sort((0,as.tT)(e=>e.range,s9.compareRangesUsingStarts)))}constructor(e){this.replacements=e,(0,ab.eZ)(()=>(0,ab.DM)(e,(e,t)=>e.range.getEndPosition().isBeforeOrEqual(t.range.getStartPosition())))}mapPosition(e){let t=0,i=0,n=0;for(let s of this.replacements){let r=s.range.getStartPosition();if(e.isBeforeOrEqual(r))break;let o=s.range.getEndPosition(),a=c6.ofText(s.text);if(e.isBefore(o)){let e=new s3(r.lineNumber+t,r.column+(r.lineNumber+t===i?n:0)),s=a.addToPosition(e);return gr(e,s)}r.lineNumber+t!==i&&(n=0),t+=a.lineCount-(s.range.endLineNumber-s.range.startLineNumber),0===a.lineCount?o.lineNumber!==r.lineNumber?n+=a.columnCount-(o.column-1):n+=a.columnCount-(o.column-r.column):n=a.columnCount,i=o.lineNumber+t}return new s3(e.lineNumber+t,e.column+(e.lineNumber+t===i?n:0))}mapRange(e){var t,i;return gr((t=this.mapPosition(e.getStartPosition()))instanceof s3?t:t.getStartPosition(),(i=this.mapPosition(e.getEndPosition()))instanceof s3?i:i.getEndPosition())}apply(e){let t="",i=new s3(1,1);for(let n of this.replacements){let s=n.range,r=s.getStartPosition(),o=s.getEndPosition(),a=gr(i,r);a.isEmpty()||(t+=e.getValueOfRange(a)),t+=n.text,i=o}let n=gr(i,e.endPositionExclusive);return n.isEmpty()||(t+=e.getValueOfRange(n)),t}applyToString(e){let t=new gi(e);return this.apply(t)}getNewRanges(){let e=[],t=0,i=0,n=0;for(let s of this.replacements){let r=c6.ofText(s.text),o=s3.lift({lineNumber:s.range.startLineNumber+i,column:s.range.startColumn+(s.range.startLineNumber===t?n:0)}),a=r.createRange(o);e.push(a),i=a.endLineNumber-s.range.endLineNumber,n=a.endColumn-s.range.endColumn,t=s.range.endLineNumber}return e}toReplacement(e){if(0===this.replacements.length)throw new o_.he;if(1===this.replacements.length)return this.replacements[0];let t=this.replacements[0].range.getStartPosition(),i=this.replacements[this.replacements.length-1].range.getEndPosition(),n="";for(let t=0;t<this.replacements.length;t++){let i=this.replacements[t];if(n+=i.text,t<this.replacements.length-1){let s=this.replacements[t+1],r=s9.fromPositions(i.range.getEndPosition(),s.range.getStartPosition());n+=e.getValueOfRange(r)}}return new gs(s9.fromPositions(t,i),n)}toString(e){return void 0===e?this.replacements.map(e=>e.toString()).join("\n"):"string"==typeof e?this.toString(new gi(e)):0===this.replacements.length?"":this.replacements.map(t=>{let i=e.getValueOfRange(t.range),n=s9.fromPositions(new s3(Math.max(1,t.range.startLineNumber-1),1),t.range.getStartPosition()),s=e.getValueOfRange(n);s.length>10&&(s="..."+s.substring(s.length-10));let r=s9.fromPositions(t.range.getEndPosition(),new s3(t.range.endLineNumber+1,1)),o=e.getValueOfRange(r);o.length>10&&(o=o.substring(0,10)+"...");let a=i;if(a.length>10){let e=Math.floor(5);a=a.substring(0,e)+"..."+a.substring(a.length-e)}let l=t.text;if(l.length>10){let e=Math.floor(5);l=l.substring(0,e)+"..."+l.substring(l.length-e)}return 0===a.length?`${s}❰${l}❱${o}`:`${s}❰${a}↦${l}❱${o}`}).join("\n")}}class gs{static joinReplacements(e,t){if(0===e.length)throw new o_.he;if(1===e.length)return e[0];let i=e[0].range.getStartPosition(),n=e[e.length-1].range.getEndPosition(),s="";for(let i=0;i<e.length;i++){let n=e[i];if(s+=n.text,i<e.length-1){let r=e[i+1],o=s9.fromPositions(n.range.getEndPosition(),r.range.getStartPosition());s+=t.getValueOfRange(o)}}return new gs(s9.fromPositions(i,n),s)}static fromStringReplacement(e,t){return new gs(t.getTransformer().getRange(e.replaceRange),e.newText)}static delete(e){return new gs(e,"")}constructor(e,t){this.range=e,this.text=t}get isEmpty(){return this.range.isEmpty()&&0===this.text.length}static equals(e,t){return e.range.equalsRange(t.range)&&e.text===t.text}equals(e){return gs.equals(this,e)}
4removeCommonPrefixAndSuffix(e){return this.removeCommonPrefix(e).removeCommonSuffix(e)}removeCommonPrefix(e){let t=e.getValueOfRange(this.range).replaceAll("\r\n","\n"),i=this.text.replaceAll("\r\n","\n"),n=r$(t,i),s=c6.ofText(t.substring(0,n)).addToPosition(this.range.getStartPosition()),r=i.substring(n);return new gs(s9.fromPositions(s,this.range.getEndPosition()),r)}removeCommonSuffix(e){let t=e.getValueOfRange(this.range).replaceAll("\r\n","\n"),i=this.text.replaceAll("\r\n","\n"),n=rj(t,i),s=c6.ofText(t.substring(0,t.length-n)).addToPosition(this.range.getStartPosition()),r=i.substring(0,i.length-n);return new gs(s9.fromPositions(this.range.getStartPosition(),s),r)}toString(){let e=this.range.getStartPosition(),t=this.range.getEndPosition();return`(${e.lineNumber},${e.column} -> ${t.lineNumber},${t.column}): "${this.text}"`}}function gr(e,t){if(e.lineNumber===t.lineNumber&&e.column===Number.MAX_SAFE_INTEGER)return s9.fromPositions(t,t);if(!e.isBeforeOrEqual(t))throw new o_.he("start must be before end");return new s9(e.lineNumber,e.column,t.lineNumber,t.column)}class go{static inverse(e,t,i){let n=[],s=1,r=1;for(let t of e){let e=new go(new c5(s,t.original.startLineNumber),new c5(r,t.modified.startLineNumber));e.modified.isEmpty||n.push(e),s=t.original.endLineNumberExclusive,r=t.modified.endLineNumberExclusive}let o=new go(new c5(s,t+1),new c5(r,i+1));return o.modified.isEmpty||n.push(o),n}static clip(e,t,i){let n=[];for(let s of e){let e=s.original.intersect(t),r=s.modified.intersect(i);e&&!e.isEmpty&&r&&!r.isEmpty&&n.push(new go(e,r))}return n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new go(this.modified,this.original)}join(e){return new go(this.original.join(e.original),this.modified.join(e.modified))}toRangeMapping(){let e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new gd(e,t);if(1!==this.original.startLineNumber&&1!==this.modified.startLineNumber)return new gd(new s9(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new s9(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER));if(!(1===this.modified.startLineNumber&&1===this.original.startLineNumber))throw new o_.he("not a valid diff");return new gd(new s9(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new s9(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}toRangeMapping2(e,t){if(gl(this.original.endLineNumberExclusive,e)&&gl(this.modified.endLineNumberExclusive,t))return new gd(new s9(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new s9(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new gd(s9.fromPositions(new s3(this.original.startLineNumber,1),ga(new s3(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),s9.fromPositions(new s3(this.modified.startLineNumber,1),ga(new s3(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new gd(s9.fromPositions(ga(new s3(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),ga(new s3(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),s9.fromPositions(ga(new s3(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),ga(new s3(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new o_.he}}function ga(e,t){if(e.lineNumber<1)return new s3(1,1);if(e.lineNumber>t.length)return new s3(t.length,t[t.length-1].length+1);let i=t[e.lineNumber-1];return e.column>i.length+1?new s3(e.lineNumber,i.length+1):e}function gl(e,t){return e>=1&&e<=t.length}class gh extends go{static fromRangeMappings(e){return new gh(c5.join(e.map(e=>c5.fromRangeInclusive(e.originalRange))),c5.join(e.map(e=>c5.fromRangeInclusive(e.modifiedRange))),e)}constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){return new gh(this.modified,this.original,this.innerChanges?.map(e=>
4e.flip()))}withInnerChangesFromLineRanges(){return new gh(this.original,this.modified,[this.toRangeMapping()])}}class gd{static fromEdit(e){let t=e.getNewRanges();return e.replacements.map((e,i)=>new gd(e.range,t[i]))}static assertSorted(e){for(let t=1;t<e.length;t++){let i=e[t-1],n=e[t];if(!(i.originalRange.getEndPosition().isBeforeOrEqual(n.originalRange.getStartPosition())&&i.modifiedRange.getEndPosition().isBeforeOrEqual(n.modifiedRange.getStartPosition())))throw new o_.he("Range mappings must be sorted")}}constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new gd(this.modifiedRange,this.originalRange)}toTextEdit(e){let t=e.getValueOfRange(this.modifiedRange);return new gs(this.originalRange,t)}}function gu(e,t,i,n=!1){let s=[];for(let n of(0,as.mw)(e.map(e=>{let n,s;return n=0,s=0,1===e.modifiedRange.endColumn&&1===e.originalRange.endColumn&&e.originalRange.startLineNumber+n<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+n<=e.modifiedRange.endLineNumber&&(s=-1),e.modifiedRange.startColumn-1>=i.getLineLength(e.modifiedRange.startLineNumber)&&e.originalRange.startColumn-1>=t.getLineLength(e.originalRange.startLineNumber)&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+s&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+s&&(n=1),new gh(new c5(e.originalRange.startLineNumber+n,e.originalRange.endLineNumber+1+s),new c5(e.modifiedRange.startLineNumber+n,e.modifiedRange.endLineNumber+1+s),[e])}),(e,t)=>e.original.intersectsOrTouches(t.original)||e.modified.intersectsOrTouches(t.modified))){let e=n[0],t=n[n.length-1];s.push(new gh(e.original.join(t.original),e.modified.join(t.modified),n.map(e=>e.innerChanges[0])))}return(0,ab.eZ)(()=>(!!n||!(s.length>0)||s[0].modified.startLineNumber===s[0].original.startLineNumber&&i.length.lineCount-s[s.length-1].modified.endLineNumberExclusive==t.length.lineCount-s[s.length-1].original.endLineNumberExclusive)&&(0,ab.DM)(s,(e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber)),s}class gc{computeDiff(e,t,i){let n=new gv(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),s=[],r=null;for(let e of n.changes){let t=new gh(0===e.originalEndLineNumber?new c5(e.originalStartLineNumber+1,e.originalStartLineNumber+1):new c5(e.originalStartLineNumber,e.originalEndLineNumber+1),0===e.modifiedEndLineNumber?new c5(e.modifiedStartLineNumber+1,e.modifiedStartLineNumber+1):new c5(e.modifiedStartLineNumber,e.modifiedEndLineNumber+1),e.charChanges?.map(e=>new gd(new s9(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),new s9(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn))));r&&(r.modified.endLineNumberExclusive===t.modified.startLineNumber||r.original.endLineNumberExclusive===t.original.startLineNumber)&&(t=new gh(r.original.join(t.original),r.modified.join(t.modified),r.innerChanges&&t.innerChanges?r.innerChanges.concat(t.innerChanges):void 0),s.pop()),s.push(t),r=t}return(0,ab.eZ)(()=>(0,ab.DM)(s,(e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber)),new cq(s,[],n.quitEarly)}}function gg(e,t,i,n){return new cm(e,t,i).ComputeDiff(n)}class gf{constructor(e){let t=[],i=[];for(let n=0,s=e.length;n<s;n++)t[n]=gb(e[n],1),i[n]=gC(e[n],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){let e=[];for(let t=0,i=this.lines.length;t<i;t++)e[t]=this.lines[t].substring(this._startColumns[t]-1,this._endColumns[t]-1);return e}getStrictElement(e){return this.lines[e]}getStartLineNumber(e){return e+1}getEndLineNumber(e){return e+1}createCharSequence(e,t,i){let n=[],s=[],r=[],o=0;for(let a=t;a<=i;a++){let t=this.lines[a],l=e?this._startColumns[a]:1,h=e?this._endColumns[a]:t.length+1;for(let e=l;e<h;e++)n[o]=t.charCodeAt(e-1),s[o]=a+1,r[o]=e,o++;!e&&a<i&&(n[o]=10,s[o]=a+1,r[o]=t.length+1,o++)}return new gm(n,s,r)}}
4class gm{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}toString(){return"["+this._charCodes.map((e,t)=>(10===e?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return -1===e?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),10===this._charCodes[e])?this._lineNumbers[e]+1:this._lineNumbers[e]}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return -1===e?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),10===this._charCodes[e])?1:this._columns[e]+1}}class gp{constructor(e,t,i,n,s,r,o,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=s,this.modifiedStartColumn=r,this.modifiedEndLineNumber=o,this.modifiedEndColumn=a}static createFromDiffChange(e,t,i){let n=t.getStartLineNumber(e.originalStart),s=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),o=t.getEndColumn(e.originalStart+e.originalLength-1),a=i.getStartLineNumber(e.modifiedStart);return new gp(n,s,r,o,a,i.getStartColumn(e.modifiedStart),i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),i.getEndColumn(e.modifiedStart+e.modifiedLength-1))}}class g_{constructor(e,t,i,n,s){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=s}static createFromDiffResult(e,t,i,n,s,r,o){let a,l,h,d,u;if(0===t.originalLength?(a=i.getStartLineNumber(t.originalStart)-1,l=0):(a=i.getStartLineNumber(t.originalStart),l=i.getEndLineNumber(t.originalStart+t.originalLength-1)),0===t.modifiedLength?(h=n.getStartLineNumber(t.modifiedStart)-1,d=0):(h=n.getStartLineNumber(t.modifiedStart),d=n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),r&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&s()){let r=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(r.getElements().length>0&&a.getElements().length>0){let e=gg(r,a,s,!0).changes;o&&(e=function(e){if(e.length<=1)return e;let t=[e[0]],i=t[0];for(let n=1,s=e.length;n<s;n++){let s=e[n];3>Math.min(s.originalStart-(i.originalStart+i.originalLength),s.modifiedStart-(i.modifiedStart+i.modifiedLength))?(i.originalLength=s.originalStart+s.originalLength-i.originalStart,i.modifiedLength=s.modifiedStart+s.modifiedLength-i.modifiedStart):(t.push(s),i=s)}return t}(e)),u=[];for(let t=0,i=e.length;t<i;t++)u.push(gp.createFromDiffChange(e[t],r,a))}}return new g_(a,l,h,d,u)}}class gv{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new gf(e),this.modified=new gf(t),this.continueLineDiff=gw(i.maxComputationTime),this.continueCharDiff=gw(0===i.maxComputationTime?0:Math.min(i.maxComputationTime,5e3))}
4computeDiff(){if(1===this.original.lines.length&&0===this.original.lines[0].length)return 1===this.modified.lines.length&&0===this.modified.lines[0].length?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:void 0}]};if(1===this.modified.lines.length&&0===this.modified.lines[0].length)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:void 0}]};let e=gg(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){let e=[];for(let i=0,n=t.length;i<n;i++)e.push(g_.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[i],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:e}}let n=[],s=0,r=0;for(let e=-1,i=t.length;e<i;e++){let o=e+1<i?t[e+1]:null,a=o?o.originalStart:this.originalLines.length,l=o?o.modifiedStart:this.modifiedLines.length;for(;s<a&&r<l;){let e=this.originalLines[s],t=this.modifiedLines[r];if(e!==t){{let i=gb(e,1),o=gb(t,1);for(;i>1&&o>1&&e.charCodeAt(i-2)===t.charCodeAt(o-2);)i--,o--;(i>1||o>1)&&this._pushTrimWhitespaceCharChange(n,s+1,1,i,r+1,1,o)}{let i=gC(e,1),o=gC(t,1),a=e.length+1,l=t.length+1;for(;i<a&&o<l&&e.charCodeAt(i-1)===e.charCodeAt(o-1);)i++,o++;(i<a||o<l)&&this._pushTrimWhitespaceCharChange(n,s+1,i,a,r+1,o,l)}}s++,r++}o&&(n.push(g_.createFromDiffResult(this.shouldIgnoreTrimWhitespace,o,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),s+=o.originalLength,r+=o.modifiedLength)}return{quitEarly:i,changes:n}}_pushTrimWhitespaceCharChange(e,t,i,n,s,r,o){let a;this._mergeTrimWhitespaceCharChange(e,t,i,n,s,r,o)||(this.shouldComputeCharChanges&&(a=[new gp(t,i,t,n,s,r,s,o)]),e.push(new g_(t,t,s,s,a)))}_mergeTrimWhitespaceCharChange(e,t,i,n,s,r,o){let a=e.length;if(0===a)return!1;let l=e[a-1];return 0!==l.originalEndLineNumber&&0!==l.modifiedEndLineNumber&&(l.originalEndLineNumber===t&&l.modifiedEndLineNumber===s?(this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new gp(t,i,t,n,s,r,s,o)),!0):l.originalEndLineNumber+1===t&&l.modifiedEndLineNumber+1===s&&(l.originalEndLineNumber=t,l.modifiedEndLineNumber=s,this.shouldComputeCharChanges&&l.charChanges&&l.charChanges.push(new gp(t,i,t,n,s,r,s,o)),!0))}}function gb(e,t){let i=rM(e);return -1===i?t:i+1}function gC(e,t){let i=rA(e);return -1===i?t:i+2}function gw(e){if(0===e)return()=>!0;let t=Date.now();return()=>Date.now()-t<e}class gy{static trivial(e,t){return new gy([new gS(cQ.ofLength(e.length),cQ.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new gy([new gS(cQ.ofLength(e.length),cQ.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class gS{static invert(e,t){let i=[];return(0,as.zy)(e,(e,n)=>{i.push(gS.fromOffsetPairs(e?e.getEndExclusives():gL.zero,n?n.getStarts():new gL(t,(e?e.seq2Range.endExclusive-e.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new gS(new cQ(e.offset1,t.offset1),new cQ(e.offset2,t.offset2))}static assertSorted(e){let t;for(let i of e){if(t&&!(t.seq1Range.endExclusive<=i.seq1Range.start&&t.seq2Range.endExclusive<=i.seq2Range.start))throw new o_.he("Sequence diffs must be sorted");t=i}}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new gS(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new gS(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return 0===e?this:new gS(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return 0===e?this:new gS(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return 0===e?this:new gS(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){let t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(t&&i)return new gS(t,i)}getStarts(){return new gL(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new gL(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class gL{static{this.zero=new gL(0,0)}static{this.max=new gL(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER)}constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}delta(e){return 0===e?this:new gL(this.offset1+e,this.offset2+e)}equals(e){return this.offset1===e.offset1&&this.offset2===e.offset2}}class gx{static{this.instance=new gx}isValid(){return!0}}class gk{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new o_.he("timeout must be positive")}isValid(){return!(Date.now()-this.startTime<this.timeout)&&this.valid&&(this.valid=!1),this.valid}}class gN{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}function gD(e){return 32===e||9===e}class gE{static{this.chrKeys=new Map}static getKey(e){let t=this.chrKeys.get(e);return void 0===t&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let n=0;for(let i=e.startLineNumber-1;i<e.endLineNumberExclusive-1;i++){let e=t[i];for(let t=0;t<e.length;t++){n++;let i=e[t],s=gE.getKey(i);this.histogram[s]=(this.histogram[s]||0)+1}n++;let s=gE.getKey("\n");this.histogram[s]=(this.histogram[s]||0)+1}this.totalCount=n}computeSimilarity(e){let t=0,i=Math.max(this.histogram.length,e.histogram.length);for(let n=0;n<i;n++)t+=Math.abs((this.histogram[n]??0)-(e.histogram[n]??0));return 1-t/(this.totalCount+e.totalCount)}}class gT{compute(e,t,i=gx.instance,n){if(0===e.length||0===t.length)return gy.trivial(e,t);let s=new gN(e.length,t.length),r=new gN(e.length,t.length),o=new gN(e.length,t.length);for(let a=0;a<e.length;a++)for(let l=0;l<t.length;l++){let h;if(!i.isValid())return gy.trivialTimedOut(e,t);let d=0===a?0:s.get(a-1,l),u=0===l?0:s.get(a,l-1);e.getElement(a)===t.getElement(l)?(h=0===a||0===l?0:s.get(a-1,l-1),a>0&&l>0&&3===r.get(a-1,l-1)&&(h+=o.get(a-1,l-1)),h+=n?n(a,l):1):h=-1;let c=Math.max(d,u,h);if(c===h){let e=a>0&&l>0?o.get(a-1,l-1):0;o.set(a,l,e+1),r.set(a,l,3)}else c===d?(o.set(a,l,0),r.set(a,l,1)):c===u&&(o.set(a,l,0),r.set(a,l,2));s.set(a,l,c)}let a=[],l=e.length,h=t.length;function d(e,t){(e+1!==l||t+1!==h)&&a.push(new gS(new cQ(e+1,l),new cQ(t+1,h))),l=e,h=t}let u=e.length-1,c=t.length-1;for(;u>=0&&c>=0;)3===r.get(u,c)?(d(u,c),u--,c--):1===r.get(u,c)?u--:c--;return d(-1,-1),a.reverse(),new gy(a,!1)}}class gI{compute(e,t,i=gx.instance){if(0===e.length||0===t.length)return gy.trivial(e,t);function n(i,n){for(;i<e.length&&n<t.length&&e.getElement(i)===t.getElement(n);)i++,n++;return i}let s=0,r=new gR;r.set(0,n(0,0));let o=new gA;o.set(0,0===r.get(0)?null:new gM(null,0,0,r.get(0)));let a=0;t:for(;;){if(s++,!i.isValid())return gy.trivialTimedOut(e,t);let l=-Math.min(s,t.length+s%2),h=Math.min(s,e.length+s%2);for(a=l;a<=h;a+=2){let i=a===h?-1:r.get(a+1),s=Math.min(Math.max(i,a===l?-1:r.get(a-1)+1),e.length),d=s-a;if(s>e.length||d>t.length)continue;let u=n(s,d);r.set(a,u);let c=s===i?o.get(a+1):o.get(a-1);
4if(o.set(a,u!==s?new gM(c,s,d,u-s):c),r.get(a)===e.length&&r.get(a)-a===t.length)break t}}let l=o.get(a),h=[],d=e.length,u=t.length;for(;;){let e=l?l.x+l.length:0,t=l?l.y+l.length:0;if((e!==d||t!==u)&&h.push(new gS(new cQ(e,d),new cQ(t,u))),!l)break;d=l.x,u=l.y,l=l.prev}return h.reverse(),new gy(h,!1)}}class gM{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class gR{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if((e=-e-1)>=this.negativeArr.length){let e=this.negativeArr;this.negativeArr=new Int32Array(2*e.length),this.negativeArr.set(e)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){let e=this.positiveArr;this.positiveArr=new Int32Array(2*e.length),this.positiveArr.set(e)}this.positiveArr[e]=t}}}class gA{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}class gO{constructor(e,t,i){this.lines=e,this.range=t,this.considerWhitespaceChanges=i,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(let t=this.range.startLineNumber;t<=this.range.endLineNumber;t++){let n=e[t-1],s=0;t===this.range.startLineNumber&&this.range.startColumn>1&&(s=this.range.startColumn-1,n=n.substring(s)),this.lineStartOffsets.push(s);let r=0;if(!i){let e=n.trimStart();r=n.length-e.length,n=e.trimEnd()}this.trimmedWsLengthsByLineIdx.push(r);let o=t===this.range.endLineNumber?Math.min(this.range.endColumn-1-s-r,n.length):n.length;for(let e=0;e<o;e++)this.elements.push(n.charCodeAt(e));t<this.range.endLineNumber&&(this.elements.push(10),this.firstElementOffsetByLineIdx.push(this.elements.length))}}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new cQ(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(e=>String.fromCharCode(e)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){let t=gV(e>0?this.elements[e-1]:-1),i=gV(e<this.elements.length?this.elements[e]:-1);if(7===t&&8===i)return 0;if(8===t)return 150;let n=0;return t!==i&&(n+=10,0===t&&1===i&&(n+=1)),n+=gB[t]+gB[i]}translateOffset(e,t="right"){let i=cX(this.firstElementOffsetByLineIdx,t=>t<=e),n=e-this.firstElementOffsetByLineIdx[i];return new s3(this.range.startLineNumber+i,1+this.lineStartOffsets[i]+n+(0===n&&"left"===t?0:this.trimmedWsLengthsByLineIdx[i]))}translateRange(e){let t=this.translateOffset(e.start,"right"),i=this.translateOffset(e.endExclusive,"left");return i.isBefore(t)?s9.fromPositions(i,i):s9.fromPositions(t,i)}findWordContaining(e){if(e<0||e>=this.elements.length||!gP(this.elements[e]))return;let t=e;for(;t>0&&gP(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&gP(this.elements[i]);)i++;return new cQ(t,i)}findSubWordContaining(e){if(e<0||e>=this.elements.length||!gP(this.elements[e]))return;let t=e;for(;t>0&&gP(this.elements[t-1])&&!gF(this.elements[t]);)t--;let i=e;for(;i<this.elements.length&&gP(this.elements[i])&&!gF(this.elements[i]);)i++;return new cQ(t,i)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,t){return this.elements[e]===this.elements[t]}extendToFullLines(e){return new cQ(cZ(this.firstElementOffsetByLineIdx,t=>t<=e.start)??0,function(e,t){let i=c1(e,t);return i===e.length?void 0:e[i]}(this.firstElementOffsetByLineIdx,t=>e.endExclusive<=t)??this.elements.length)}}function gP(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}function gF(e){return e>=65&&e<=90}let gB={0:0,1:0,2:0,3:10,4:2,5:30,6:3,7:10,8:10};function gV(e){if(10===e)return 8;if(13===e)return 7;if(gD(e))return 6;if(e>=97&&e<=122)return 0;if(e>=65&&e<=90)return 1;if(e>=48&&e<=57)return 2;if(-1===e)return 3;else if(44===e||59===e)return 5;else return 4}function gW(e,t,i){if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;let n=new gI().compute(new gO([e],new s9(1,1,1,e.length),!1),new gO([t],new s9(1,1,1,t.length),!1),i),s=0;for(let t of gS.invert(n.diffs,e.length))t.seq1Range.forEach(t=>{!gD(e.charCodeAt(t))&&s++});let r=function(t){let i=0;for(let n=0;n<e.length;n++)!gD(t.charCodeAt(n))&&i++;return i}(e.length>t.length?e:t);return s/r>.6&&r>10}function gH(e,t,i){let n=i;return n=gz(e,t,n),n=gz(e,t,n),n=function(e,t,i){if(!e.getBoundaryScore||!t.getBoundaryScore)return i;for(let n=0;n<i.length;n++){let s=n>0?i[n-1]:void 0,r=i[n],o=n+1<i.length?i[n+1]:void 0,a=new cQ(s?s.seq1Range.endExclusive+1:0,o?o.seq1Range.start-1:e.length),l=new cQ(s?s.seq2Range.endExclusive+1:0,o?o.seq2Range.start-1:t.length);r.seq1Range.isEmpty?i[n]=gU(r,e,t,a,l):r.seq2Range.isEmpty&&(i[n]=gU(r.swap(),t,e,l,a).swap())}return i}
4(e,t,n)}function gz(e,t,i){if(0===i.length)return i;let n=[];n.push(i[0]);for(let s=1;s<i.length;s++){let r=n[n.length-1],o=i[s];if(o.seq1Range.isEmpty||o.seq2Range.isEmpty){let i;let s=o.seq1Range.start-r.seq1Range.endExclusive;for(i=1;i<=s&&e.getElement(o.seq1Range.start-i)===e.getElement(o.seq1Range.endExclusive-i)&&t.getElement(o.seq2Range.start-i)===t.getElement(o.seq2Range.endExclusive-i);i++);if(--i===s){n[n.length-1]=new gS(new cQ(r.seq1Range.start,o.seq1Range.endExclusive-s),new cQ(r.seq2Range.start,o.seq2Range.endExclusive-s));continue}o=o.delta(-i)}n.push(o)}let s=[];for(let i=0;i<n.length-1;i++){let r=n[i+1],o=n[i];if(o.seq1Range.isEmpty||o.seq2Range.isEmpty){let s;let a=r.seq1Range.start-o.seq1Range.endExclusive;for(s=0;s<a&&e.isStronglyEqual(o.seq1Range.start+s,o.seq1Range.endExclusive+s)&&t.isStronglyEqual(o.seq2Range.start+s,o.seq2Range.endExclusive+s);s++);if(s===a){n[i+1]=new gS(new cQ(o.seq1Range.start+a,r.seq1Range.endExclusive),new cQ(o.seq2Range.start+a,r.seq2Range.endExclusive));continue}s>0&&(o=o.delta(s))}s.push(o)}return n.length>0&&s.push(n[n.length-1]),s}function gU(e,t,i,n,s){let r=1;for(;e.seq1Range.start-r>=n.start&&e.seq2Range.start-r>=s.start&&i.isStronglyEqual(e.seq2Range.start-r,e.seq2Range.endExclusive-r)&&r<100;)r++;r--;let o=0;for(;e.seq1Range.start+o<n.endExclusive&&e.seq2Range.endExclusive+o<s.endExclusive&&i.isStronglyEqual(e.seq2Range.start+o,e.seq2Range.endExclusive+o)&&o<100;)o++;if(0===r&&0===o)return e;let a=0,l=-1;for(let n=-r;n<=o;n++){let s=e.seq2Range.start+n,r=e.seq2Range.endExclusive+n,o=e.seq1Range.start+n,h=t.getBoundaryScore(o)+i.getBoundaryScore(s)+i.getBoundaryScore(r);h>l&&(l=h,a=n)}return e.delta(a)}function gK(e,t,i,n,s=!1){let r=gS.invert(i,e.length),o=[],a=new gL(0,0);function l(i,l){if(i.offset1<a.offset1||i.offset2<a.offset2)return;let h=n(e,i.offset1),d=n(t,i.offset2);if(!h||!d)return;let u=new gS(h,d),c=u.intersect(l),g=c.seq1Range.length,f=c.seq2Range.length;for(;r.length>0;){let i=r[0];if(!(i.seq1Range.intersects(u.seq1Range)||i.seq2Range.intersects(u.seq2Range)))break;let s=new gS(n(e,i.seq1Range.start),n(t,i.seq2Range.start)),o=s.intersect(i);if(g+=o.seq1Range.length,f+=o.seq2Range.length,(u=u.join(s)).seq1Range.endExclusive>=i.seq1Range.endExclusive)r.shift();else break}(s&&g+f<u.seq1Range.length+u.seq2Range.length||g+f<(u.seq1Range.length+u.seq2Range.length)*2/3)&&o.push(u),a=u.getEndExclusives()}for(;r.length>0;){let e=r.shift();e.seq1Range.isEmpty||(l(e.getStarts(),e),l(e.getEndExclusives().delta(-1),e))}return function(e,t){let i=[];for(;e.length>0||t.length>0;){let n;let s=e[0],r=t[0];n=s&&(!r||s.seq1Range.start<r.seq1Range.start)?e.shift():t.shift(),i.length>0&&i[i.length-1].seq1Range.endExclusive>=n.seq1Range.start?i[i.length-1]=i[i.length-1].join(n):i.push(n)}return i}(i,o)}class g${constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){return 1e3-((0===e?0:gj(this.lines[e-1]))+(e===this.lines.length?0:gj(this.lines[e])))}getText(e){return this.lines.slice(e.start,e.endExclusive).join("\n")}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function gj(e){let t=0;for(;t<e.length&&(32===e.charCodeAt(t)||9===e.charCodeAt(t));)t++;return t}class gq{constructor(){this.dynamicProgrammingDiffing=new gT,this.myersDiffingAlgorithm=new gI}computeDiff(e,t,i){if(e.length<=1&&(0,as.fS)(e,t,(e,t)=>e===t))return new cq([],[],!1);if(1===e.length&&0===e[0].length||1===t.length&&0===t[0].length)return new cq([new gh(new c5(1,e.length+1),new c5(1,t.length+1),[new gd(new s9(1,1,e.length,e[e.length-1].length+1),new s9(1,1,t.length,t[t.length-1].length+1))])],[],!1);let n=0===i.maxComputationTimeMs?gx.instance:new gk(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,r=new Map;function o(e){let t=r.get(e);return void 0===t&&(t=r.size,r.set(e,t)),t}let a=e.map(e=>o(e.trim())),l=t.map(e=>o(e.trim())),h=new g$(a,e),d=new g$(l,t),u=h.length+d.length<1700?this.dynamicProgrammingDiffing.compute(h,d,n,(i,n)=>e[i]===t[n]?0===t[n].length?.1:1+Math.log(1+t[n].length):.99):this.myersDiffingAlgorithm.compute(h,d,n),c=u.diffs,g=u.hitTimeout;c=gH(h,d,c);let f=[],m=r=>{if(s)for(let o=0;o<r;o++){let r=p+o,a=_+o;
4if(e[r]!==t[a]){let o=this.refineDiff(e,t,new gS(new cQ(r,r+1),new cQ(a,a+1)),n,s,i);for(let e of o.mappings)f.push(e);o.hitTimeout&&(g=!0)}}},p=0,_=0;for(let r of c=function(e,t,i){let n,s=i;if(0===s.length)return s;let r=0;do{n=!1;let t=[s[0]];for(let i=1;i<s.length;i++){let r=s[i],o=t[t.length-1];!function(t,i){let n=new cQ(o.seq1Range.endExclusive,r.seq1Range.start);return e.getText(n).replace(/\s/g,"").length<=4&&(t.seq1Range.length+t.seq2Range.length>5||i.seq1Range.length+i.seq2Range.length>5)}(o,r)?t.push(r):(n=!0,t[t.length-1]=t[t.length-1].join(r))}s=t}while(r++<10&&n);return s}(h,0,c)){(0,ab.eZ)(()=>r.seq1Range.start-p==r.seq2Range.start-_),m(r.seq1Range.start-p),p=r.seq1Range.endExclusive,_=r.seq2Range.endExclusive;let o=this.refineDiff(e,t,r,n,s,i);for(let e of(o.hitTimeout&&(g=!0),o.mappings))f.push(e)}m(e.length-p);let v=gu(f,new gt(e),new gt(t)),b=[];return i.computeMoves&&(b=this.computeMoves(v,e,t,a,l,n,s,i)),(0,ab.eZ)(()=>{function i(e,t){if(e.lineNumber<1||e.lineNumber>t.length)return!1;let i=t[e.lineNumber-1];return!(e.column<1)&&!(e.column>i.length+1)}function n(e,t){return!(e.startLineNumber<1)&&!(e.startLineNumber>t.length+1)&&!(e.endLineNumberExclusive<1)&&!(e.endLineNumberExclusive>t.length+1)}for(let s of v){if(!s.innerChanges)return!1;for(let n of s.innerChanges)if(!(i(n.modifiedRange.getStartPosition(),t)&&i(n.modifiedRange.getEndPosition(),t)&&i(n.originalRange.getStartPosition(),e)&&i(n.originalRange.getEndPosition(),e)))return!1;if(!n(s.modified,t)||!n(s.original,e))return!1}return!0}),new cq(v,b,g)}computeMoves(e,t,i,n,s,r,o,a){return(function(e,t,i,n,s,r){let{moves:o,excludedChanges:a}=function(e,t,i,n){let s=[],r=e.filter(e=>e.modified.isEmpty&&e.original.length>=3).map(e=>new gE(e.original,t,e)),o=new Set(e.filter(e=>e.original.isEmpty&&e.modified.length>=3).map(e=>new gE(e.modified,i,e))),a=new Set;for(let e of r){let t,i=-1;for(let n of o){let s=e.computeSimilarity(n);s>i&&(i=s,t=n)}if(i>.9&&t&&(o.delete(t),s.push(new go(e.range,t.range)),a.add(e.source),a.add(t.source)),!n.isValid())break}return{moves:s,excludedChanges:a}}(e,t,i,r);if(!r.isValid())return[];let l=function(e,t,i,n,s,r){let o=[],a=new dm;for(let i of e)for(let e=i.original.startLineNumber;e<i.original.endLineNumberExclusive-2;e++){let i=`${t[e-1]}:${t[e+1-1]}:${t[e+2-1]}`;a.add(i,{range:new c5(e,e+3)})}let l=[];for(let t of(e.sort((0,as.tT)(e=>e.modified.startLineNumber,as.fv)),e)){let e=[];for(let n=t.modified.startLineNumber;n<t.modified.endLineNumberExclusive-2;n++){let t=`${i[n-1]}:${i[n+1-1]}:${i[n+2-1]}`,s=new c5(n,n+3),r=[];a.forEach(t,({range:t})=>{for(let i of e)if(i.originalLineRange.endLineNumberExclusive+1===t.endLineNumberExclusive&&i.modifiedLineRange.endLineNumberExclusive+1===s.endLineNumberExclusive){i.originalLineRange=new c5(i.originalLineRange.startLineNumber,t.endLineNumberExclusive),i.modifiedLineRange=new c5(i.modifiedLineRange.startLineNumber,s.endLineNumberExclusive),r.push(i);return}let i={modifiedLineRange:s,originalLineRange:t};l.push(i),r.push(i)}),e=r}if(!r.isValid())return[]}l.sort((0,as.BV)((0,as.tT)(e=>e.modifiedLineRange.length,as.fv)));let h=new c4,d=new c4;for(let e of l){let t=e.modifiedLineRange.startLineNumber-e.originalLineRange.startLineNumber,i=h.subtractFrom(e.modifiedLineRange),n=d.subtractFrom(e.originalLineRange).getWithDelta(t);for(let e of i.getIntersection(n).ranges){if(e.length<3)continue;let i=e.delta(-t);o.push(new go(i,e)),h.addRange(e),d.addRange(i)}}o.sort((0,as.tT)(e=>e.original.startLineNumber,as.fv));let u=new c0(e);for(let t=0;t<o.length;t++){let i,a;let l=o[t],c=u.findLastMonotonous(e=>e.original.startLineNumber<=l.original.startLineNumber),g=cZ(e,e=>e.modified.startLineNumber<=l.modified.startLineNumber),f=Math.max(l.original.startLineNumber-c.original.startLineNumber,l.modified.startLineNumber-g.modified.startLineNumber),m=u.findLastMonotonous(e=>e.original.startLineNumber<l.original.endLineNumberExclusive),p=cZ(e,e=>e.modified.startLineNumber<l.modified.endLineNumberExclusive),_=Math.max(m.original.endLineNumberExclusive-l.original.endLineNumberExclusive,p.modified.endLineNumberExclusive-l.modified.endLineNumberExclusive);for(i=0;i<f;i++){let e=l.original.startLineNumber-i-1,t=l.modified.startLineNumber-i-1;if(e>n.length||t>s.length||h.contains(t)||d.contains(e)||!gW(n[e-1],s[t-1],r))break}for(i>0&&(d.addRange(new c5(l.original.startLineNumber-i,l.original.startLineNumber)),h.addRange(new c5(l.modified.startLineNumber-i,l.modified.startLineNumber))),a=0;a<_;a++){let e=l.original.endLineNumberExclusive+a,t=l.modified.endLineNumberExclusive+a;if(e>n.length||t>s.length||h.contains(t)||d.contains(e)||!gW(n[e-1],s[t-1],r))break}a>0&&(d.addRange(new c5(l.original.endLineNumberExclusive,l.original.endLineNumberExclusive+a)),h.addRange(new c5(l.modified.endLineNumberExclusive,l.modified.endLineNumberExclusive+a))),(i>0||a>0)&&(o[t]=new go(new c5(l.original.startLineNumber-i,l.original.endLineNumberExclusive+a),new c5(l.modified.startLineNumber-i,l.modified.endLineNumberExclusive+a)))}return o}(e.filter(e=>!a.has(e)),n,s,t,i,r);return(0,as.vA)(o,l),o=function(e,t){let i=new c0(e);return t=t.filter(t=>(i.findLastMonotonous(e=>e.original.startLineNumber<t.original.endLineNumberExclusive)||new go(new c5(1,1),new c5(1,1)))!==cZ(e,e=>e.modified.startLineNumber<t.modified.endLineNumberExclusive))}(e,o=(o=function(e){if(0===e.length)return e;e.sort((0,as.tT)(e=>e.original.startLineNumber,as.fv));let t=[e[0]];for(let i=1;i<e.length;i++){let n=t[t.length-1],s=e[i],r=s.original.startLineNumber-n.original.endLineNumberExclusive,o=s.modified.startLineNumber-n.modified.endLineNumberExclusive;if(r>=0&&o>=0&&r+o<=2){t[t.length-1]=n.join(s);continue}t.push(s)}return t}(o)).filter(e=>{let i=e.original.toOffsetRange().slice(t).map(e=>e.trim());return i.join("\n").length>=15&&function(e,t){let i=0;for(let n of e)t(n)&&i++;return i}(i,e=>e.length>=2)>=2}))})(e,t,i,n,s,r).map(e=>{let n=gu(this.refineDiff(t,i,new gS(e.original.toOffsetRange(),e.modified.toOffsetRange()),r,o,a).mappings,new gt(t),new gt(i),!0);return new cG(e,n)})}refineDiff(e,t,i,n,s,r){let o=new go(new c5(i.seq1Range.start+1,i.seq1Range.endExclusive+1),new c5(i.seq2Range.start+1,i.seq2Range.endExclusive+1)).toRangeMapping2(e,t),a=new gO(e,o.originalRange,s),l=new gO(t,o.modifiedRange,s),h=a.length+l.length<500?this.dynamicProgrammingDiffing.compute(a,l,n):this.myersDiffingAlgorithm.compute(a,l,n),d=h.diffs;return d=gH(a,l,d),d=gK(a,l,d,(e,t)=>e.findWordContaining(t)),r.extendToSubwords&&(d=gK(a,l,d,(e,t)=>e.findSubWordContaining(t),!0)),{mappings:(d=function(e,t,i){let n,s=i;if(0===s.length)return s;let r=0;do{n=!1;let i=[s[0]];for(let r=1;r<s.length;r++){let o=s[r],a=i[i.length-1];(function(i,n){let s=new cQ(a.seq1Range.endExclusive,o.seq1Range.start);if(e.countLinesIn(s)>5||s.length>500)return!1;let r=e.getText(s).trim();if(r.length>20||r.split(/\r\n|\r|\n/).length>1)return!1;let l=e.countLinesIn(i.seq1Range),h=i.seq1Range.length,d=t.countLinesIn(i.seq2Range),u=i.seq2Range.length,c=e.countLinesIn(n.seq1Range),g=n.seq1Range.length,f=t.countLinesIn(n.seq2Range),m=n.seq2Range.length;function p(e){return Math.min(e,130)}return Math.pow(Math.pow(p(40*l+h),1.5)+Math.pow(p(40*d+u),1.5),1.5)+Math.pow(Math.pow(p(40*c+g),1.5)+Math.pow(p(40*f+m),1.5),1.5)>74184.96480721243})(a,o)?(n=!0,i[i.length-1]=i[i.length-1].join(o)):i.push(o)}s=i}while(r++<10&&n);let o=[];return(0,as.KO)(s,(t,i,n)=>{let s=i;function r(e){return e.length>0&&e.trim().length<=3&&i.seq1Range.length+i.seq2Range.length>100}let a=e.extendToFullLines(i.seq1Range),l=e.getText(new cQ(a.start,i.seq1Range.start));r(l)&&(s=s.deltaStart(-l.length));let h=e.getText(new cQ(i.seq1Range.endExclusive,a.endExclusive));r(h)&&(s=s.deltaEnd(h.length));let d=gS.fromOffsetPairs(t?t.getEndExclusives():gL.zero,n?n.getStarts():gL.max),u=s.intersect(d);o.length>0&&u.getStarts().equals(o[o.length-1].getEndExclusives())?o[o.length-1]=o[o.length-1].join(u):o.push(u)}),o}(a,l,d=function(e,t,i){let n=[];for(let e of i){let t=n[n.length-1];if(!t){n.push(e);continue}e.seq1Range.start-t.seq1Range.endExclusive<=2||e.seq2Range.start-t.seq2Range.endExclusive<=2?n[n.length-1]=new gS(t.seq1Range.join(e.seq1Range),t.seq2Range.join(e.seq2Range)):n.push(e)}return n}(0,0,d))).map(e=>new gd(a.translateRange(e.seq1Range),l.translateRange(e.seq2Range))),hitTimeout:h.hitTimeout}}}let gG={getLegacy:()=>new gc,getDefault:()=>new gq};function gQ(e,t){let i=Math.pow(10,t);return Math.round(e*i)/i}class gY{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=gQ(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class gJ{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=gQ(Math.max(Math.min(1,t),0),3),this.l=gQ(Math.max(Math.min(1,i),0),3),this.a=gQ(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){let t=e.r/255,i=e.g/255,n=e.b/255,s=e.a,r=Math.max(t,i,n),o=Math.min(t,i,n),a=0,l=0,h=(o+r)/2,d=r-o;if(d>0){switch(l=Math.min(h<=.5?d/(2*h):d/(2-2*h),1),r){case t:a=(i-n)/d+(i<n?6:0);break;case i:a=(n-t)/d+2;break;case n:a=(t-i)/d+4}a*=60,a=Math.round(a)}return new gJ(a,l,h,s)}static _hue2rgb(e,t,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?e+(t-e)*6*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){let t,i,n;let s=e.h/360,{s:r,l:o,a}=e;if(0===r)t=i=n=o;else{let e=o<.5?o*(1+r):o+r-o*r,a=2*o-e;t=gJ._hue2rgb(a,e,s+1/3),i=gJ._hue2rgb(a,e,s),n=gJ._hue2rgb(a,e,s-1/3)}return new gY(Math.round(255*t),Math.round(255*i),Math.round(255*n),a)}}class gZ{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=gQ(Math.max(Math.min(1,t),0),3),this.v=gQ(Math.max(Math.min(1,i),0),3),this.a=gQ(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){let t=e.r/255,i=e.g/255,n=e.b/255,s=Math.max(t,i,n),r=s-Math.min(t,i,n);return new gZ(Math.round(60*(0===r?0:s===t?((i-n)/r%6+6)%6:s===i?(n-t)/r+2:(t-i)/r+4)),0===s?0:r/s,s,e.a)}
4static toRGBA(e){let{h:t,s:i,v:n,a:s}=e,r=n*i,o=r*(1-Math.abs(t/60%2-1)),a=n-r,[l,h,d]=[0,0,0];return t<60?(l=r,h=o):t<120?(l=o,h=r):t<180?(h=r,d=o):t<240?(h=o,d=r):t<300?(l=o,d=r):t<=360&&(l=r,d=o),new gY(l=Math.round((l+a)*255),h=Math.round((h+a)*255),d=Math.round((d+a)*255),s)}}class gX{static fromHex(e){return gX.Format.CSS.parseHex(e)||gX.red}static equals(e,t){return!e&&!t||!!e&&!!t&&e.equals(t)}get hsla(){return this._hsla?this._hsla:gJ.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:gZ.fromRGBA(this.rgba)}constructor(e){if(e){if(e instanceof gY)this.rgba=e;else if(e instanceof gJ)this._hsla=e,this.rgba=gJ.toRGBA(e);else if(e instanceof gZ)this._hsva=e,this.rgba=gZ.toRGBA(e);else throw Error("Invalid color ctor argument")}else throw Error("Color needs a value")}equals(e){return!!e&&gY.equals(this.rgba,e.rgba)&&gJ.equals(this.hsla,e.hsla)&&gZ.equals(this.hsva,e.hsva)}getRelativeLuminance(){let e=gX._relativeLuminanceForComponent(this.rgba.r);return gQ(.2126*e+.7152*gX._relativeLuminanceForComponent(this.rgba.g)+.0722*gX._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){let t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()<e.getRelativeLuminance()}lighten(e){return new gX(new gJ(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new gX(new gJ(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}
4transparent(e){let{r:t,g:i,b:n,a:s}=this.rgba;return new gX(new gY(t,i,n,s*e))}isTransparent(){return 0===this.rgba.a}isOpaque(){return 1===this.rgba.a}opposite(){return new gX(new gY(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}mix(e,t=.5){let i=Math.min(Math.max(t,0),1),n=this.rgba,s=e.rgba,r=n.r+(s.r-n.r)*i,o=n.g+(s.g-n.g)*i,a=n.b+(s.b-n.b)*i,l=n.a+(s.a-n.a)*i;return new gX(new gY(r,o,a,l))}makeOpaque(e){if(this.isOpaque()||1!==e.rgba.a)return this;let{r:t,g:i,b:n,a:s}=this.rgba;return new gX(new gY(e.rgba.r-s*(e.rgba.r-t),e.rgba.g-s*(e.rgba.g-i),e.rgba.b-s*(e.rgba.b-n),1))}toString(){return this._toString||(this._toString=gX.Format.CSS.format(this)),this._toString}toNumber32Bit(){return this._toNumber32Bit||(this._toNumber32Bit=(this.rgba.r<<24|this.rgba.g<<16|this.rgba.b<<8|255*this.rgba.a<<0)>>>0),this._toNumber32Bit}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;let n=e.getRelativeLuminance(),s=t.getRelativeLuminance();return i=i*(s-n)/s,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;let n=e.getRelativeLuminance(),s=t.getRelativeLuminance();return i=i*(n-s)/n,e.darken(i)}static{this.white=new gX(new gY(255,255,255,1))}static{this.black=new gX(new gY(0,0,0,1))}static{this.red=new gX(new gY(255,0,0,1))}static{this.blue=new gX(new gY(0,0,255,1))}static{this.green=new gX(new gY(0,255,0,1))}static{this.cyan=new gX(new gY(0,255,255,1))}static{this.lightgrey=new gX(new gY(211,211,211,1))}static{this.transparent=new gX(new gY(0,0,0,0))}}function g1(e){let t=[];for(let i of e){let e=Number(i);(e||0===e&&""!==i.replace(/\s/g,""))&&t.push(e)}return t}function g0(e,t,i,n){return{red:e/255,blue:i/255,green:t/255,alpha:n}}function g2(e,t){let i=t.index,n=t[0].length;if(void 0===i)return;let s=e.positionAt(i);return{startLineNumber:s.lineNumber,startColumn:s.column,endLineNumber:s.lineNumber,endColumn:s.column+n}}function g5(e,t,i){if(!e||1!==t.length)return;let n=g1(t[0].values());return{range:e,color:g0(n[0],n[1],n[2],i?n[3]:1)}}function g4(e,t,i){if(!e||1!==t.length)return;let n=g1(t[0].values()),s=new gX(new gJ(n[0],n[1]/100,n[2]/100,i?n[3]:1));return{range:e,color:g0(s.rgba.r,s.rgba.g,s.rgba.b,s.rgba.a)}}function g6(e,t){return"string"==typeof e?[...e.matchAll(t)]:e.findMatches(t)}!function(e){function t(e){let t=e.toString(16);return 2!==t.length?"0"+t:t}function i(e){let t=e.length;if(0===t||35!==e.charCodeAt(0))return null;if(7===t){let t=16*n(e.charCodeAt(1))+n(e.charCodeAt(2)),i=16*n(e.charCodeAt(3))+n(e.charCodeAt(4));return new eQ(new gY(t,i,16*n(e.charCodeAt(5))+n(e.charCodeAt(6)),1))}if(9===t){let t=16*n(e.charCodeAt(1))+n(e.charCodeAt(2)),i=16*n(e.charCodeAt(3))+n(e.charCodeAt(4)),s=16*n(e.charCodeAt(5))+n(e.charCodeAt(6));return new eQ(new gY(t,i,s,(16*n(e.charCodeAt(7))+n(e.charCodeAt(8)))/255))}if(4===t){let t=n(e.charCodeAt(1)),i=n(e.charCodeAt(2)),s=n(e.charCodeAt(3));return new eQ(new gY(16*t+t,16*i+i,16*s+s))}if(5===t){let t=n(e.charCodeAt(1)),i=n(e.charCodeAt(2)),s=n(e.charCodeAt(3)),r=n(e.charCodeAt(4));return new eQ(new gY(16*t+t,16*i+i,16*s+s,(16*r+r)/255))}return null}function n(e){switch(e){case 48:break;case 49:return 1;case 50:return 2;case 51:return 3;case 52:return 4;case 53:return 5;case 54:return 6;case 55:return 7;case 56:return 8;case 57:return 9;case 97:case 65:return 10;case 98:case 66:return 11;case 99:case 67:return 12;case 100:case 68:return 13;case 101:case 69:return 14;case 102:case 70:return 15}return 0}e.formatRGB=function(e){return 1===e.rgba.a?`rgb(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b})`:eQ.Format.CSS.formatRGBA(e)},e.formatRGBA=function(e){return`rgba(${e.rgba.r}, ${e.rgba.g}, ${e.rgba.b}, ${+e.rgba.a.toFixed(2)})`},e.formatHSL=function(e){return 1===e.hsla.a?`hsl(${e.hsla.h}, ${Math.round(100*e.hsla.s)}%, ${Math.round(100*e.hsla.l)}%)`:eQ.Format.CSS.formatHSLA(e)},e.formatHSLA=function(e){return`hsla(${e.hsla.h}, ${Math.round(100*e.hsla.s)}%, ${Math.round(100*e.hsla.l)}%, ${e.hsla.a.toFixed(2)})`},e.formatHex=function(e){return`#${t(e.rgba.r)}${t(e.rgba.g)}${t(e.rgba.b)}`},e.formatHexA=function(e,i=!1){return i&&1===e.rgba.a?eQ.Format.CSS.formatHex(e):`#${t(e.rgba.r)}${t(e.rgba.g)}${t(e.rgba.b)}${t(Math.round(255*e.rgba.a))}`}
4,e.format=function(e){return e.isOpaque()?eQ.Format.CSS.formatHex(e):eQ.Format.CSS.formatRGBA(e)},e.parse=function(e){if("transparent"===e)return eQ.transparent;if(e.startsWith("#"))return i(e);if(e.startsWith("rgba(")){let t=e.match(/rgba\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+), *(?<a>(?:\+|-)?\d+(\.\d+)?)\)/);if(!t)throw Error("Invalid color format "+e);let i=parseInt(t.groups?.r??"0"),n=parseInt(t.groups?.g??"0"),s=parseInt(t.groups?.b??"0");return new eQ(new gY(i,n,s,parseFloat(t.groups?.a??"0")))}if(e.startsWith("rgb(")){let t=e.match(/rgb\((?<r>(?:\+|-)?\d+), *(?<g>(?:\+|-)?\d+), *(?<b>(?:\+|-)?\d+)\)/);if(!t)throw Error("Invalid color format "+e);let i=parseInt(t.groups?.r??"0"),n=parseInt(t.groups?.g??"0");return new eQ(new gY(i,n,parseInt(t.groups?.b??"0")))}return function(e){switch(e){case"aliceblue":return new eQ(new gY(240,248,255,1));case"antiquewhite":return new eQ(new gY(250,235,215,1));case"aqua":case"cyan":return new eQ(new gY(0,255,255,1));case"aquamarine":return new eQ(new gY(127,255,212,1));case"azure":return new eQ(new gY(240,255,255,1));case"beige":return new eQ(new gY(245,245,220,1));case"bisque":return new eQ(new gY(255,228,196,1));case"black":return new eQ(new gY(0,0,0,1));case"blanchedalmond":return new eQ(new gY(255,235,205,1));case"blue":return new eQ(new gY(0,0,255,1));case"blueviolet":return new eQ(new gY(138,43,226,1));case"brown":return new eQ(new gY(165,42,42,1));case"burlywood":return new eQ(new gY(222,184,135,1));case"cadetblue":return new eQ(new gY(95,158,160,1));case"chartreuse":return new eQ(new gY(127,255,0,1));case"chocolate":return new eQ(new gY(210,105,30,1));case"coral":return new eQ(new gY(255,127,80,1));case"cornflowerblue":return new eQ(new gY(100,149,237,1));case"cornsilk":return new eQ(new gY(255,248,220,1));case"crimson":return new eQ(new gY(220,20,60,1));case"darkblue":return new eQ(new gY(0,0,139,1));case"darkcyan":return new eQ(new gY(0,139,139,1));case"darkgoldenrod":return new eQ(new gY(184,134,11,1));case"darkgray":case"darkgrey":return new eQ(new gY(169,169,169,1));case"darkgreen":return new eQ(new gY(0,100,0,1));case"darkkhaki":return new eQ(new gY(189,183,107,1));case"darkmagenta":return new eQ(new gY(139,0,139,1));case"darkolivegreen":return new eQ(new gY(85,107,47,1));case"darkorange":return new eQ(new gY(255,140,0,1));case"darkorchid":return new eQ(new gY(153,50,204,1));case"darkred":return new eQ(new gY(139,0,0,1));case"darksalmon":return new eQ(new gY(233,150,122,1));case"darkseagreen":return new eQ(new gY(143,188,143,1));case"darkslateblue":return new eQ(new gY(72,61,139,1));case"darkslategray":case"darkslategrey":return new eQ(new gY(47,79,79,1));case"darkturquoise":return new eQ(new gY(0,206,209,1));case"darkviolet":return new eQ(new gY(148,0,211,1));case"deeppink":return new eQ(new gY(255,20,147,1));case"deepskyblue":return new eQ(new gY(0,191,255,1));case"dimgray":case"dimgrey":return new eQ(new gY(105,105,105,1));case"dodgerblue":return new eQ(new gY(30,144,255,1));case"firebrick":return new eQ(new gY(178,34,34,1));case"floralwhite":return new eQ(new gY(255,250,240,1));case"forestgreen":return new eQ(new gY(34,139,34,1));case"fuchsia":case"magenta":return new eQ(new gY(255,0,255,1));case"gainsboro":return new eQ(new gY(220,220,220,1));case"ghostwhite":return new eQ(new gY(248,248,255,1));case"gold":return new eQ(new gY(255,215,0,1));case"goldenrod":return new eQ(new gY(218,165,32,1));case"gray":case"grey":return new eQ(new gY(128,128,128,1));case"green":return new eQ(new gY(0,128,0,1));case"greenyellow":return new eQ(new gY(173,255,47,1));case"honeydew":return new eQ(new gY(240,255,240,1));case"hotpink":return new eQ(new gY(255,105,180,1));case"indianred":return new eQ(new gY(205,92,92,1));case"indigo":return new eQ(new gY(75,0,130,1));case"ivory":return new eQ(new gY(255,255,240,1));case"khaki":return new eQ(new gY(240,230,140,1));case"lavender":return new eQ(new gY(230,230,250,1));case"lavenderblush":return new eQ(new gY(255,240,245,1));case"lawngreen":return new eQ(new gY(124,252,0,1));case"lemonchiffon":return new eQ(new gY(255,250,205,1));case"lightblue":return new eQ(new gY(173,216,230,1));case"lightcoral":return new eQ(new gY(240,128,128,1));case"lightcyan":return new eQ(new gY(224,255,255,1));case"lightgoldenrodyellow":return new eQ(new gY(250,250,210,1));case"lightgray":case"lightgrey":return new eQ(new gY(211,211,211,1));case"lightgreen":return new eQ(new gY(144,238,144,1));case"lightpink":return new eQ(new gY(255,182,193,1));case"lightsalmon":return new eQ(new gY(255,160,122,1));case"lightseagreen":return new eQ(new gY(32,178,170,1));case"lightskyblue":return new eQ(new gY(135,206,250,1));case"lightslategray":case"lightslategrey":return new eQ(new gY(119,136,153,1));case"lightsteelblue":return new eQ(new gY(176,196,222,1));case"lightyellow":return new eQ(new gY(255,255,224,1));case"lime":return new eQ(new gY(0,255,0,1));case"limegreen":return new eQ(new gY(50,205,50,1));case"linen":return new eQ(new gY(250,240,230,1));case"maroon":return new eQ(new gY(128,0,0,1));case"mediumaquamarine":return new eQ(new gY(102,205,170,1));case"mediumblue":return new eQ(new gY(0,0,205,1));case"mediumorchid":return new eQ(new gY(186,85,211,1));case"mediumpurple":return new eQ(new gY(147,112,219,1));case"mediumseagreen":return new eQ(new gY(60,179,113,1));case"mediumslateblue":return new eQ(new gY(123,104,238,1));case"mediumspringgreen":return new eQ(new gY(0,250,154,1));
4case"mediumturquoise":return new eQ(new gY(72,209,204,1));case"mediumvioletred":return new eQ(new gY(199,21,133,1));case"midnightblue":return new eQ(new gY(25,25,112,1));case"mintcream":return new eQ(new gY(245,255,250,1));case"mistyrose":return new eQ(new gY(255,228,225,1));case"moccasin":return new eQ(new gY(255,228,181,1));case"navajowhite":return new eQ(new gY(255,222,173,1));case"navy":return new eQ(new gY(0,0,128,1));case"oldlace":return new eQ(new gY(253,245,230,1));case"olive":return new eQ(new gY(128,128,0,1));case"olivedrab":return new eQ(new gY(107,142,35,1));case"orange":return new eQ(new gY(255,165,0,1));case"orangered":return new eQ(new gY(255,69,0,1));case"orchid":return new eQ(new gY(218,112,214,1));case"palegoldenrod":return new eQ(new gY(238,232,170,1));case"palegreen":return new eQ(new gY(152,251,152,1));case"paleturquoise":return new eQ(new gY(175,238,238,1));case"palevioletred":return new eQ(new gY(219,112,147,1));case"papayawhip":return new eQ(new gY(255,239,213,1));case"peachpuff":return new eQ(new gY(255,218,185,1));case"peru":return new eQ(new gY(205,133,63,1));case"pink":return new eQ(new gY(255,192,203,1));case"plum":return new eQ(new gY(221,160,221,1));case"powderblue":return new eQ(new gY(176,224,230,1));case"purple":return new eQ(new gY(128,0,128,1));case"rebeccapurple":return new eQ(new gY(102,51,153,1));case"red":return new eQ(new gY(255,0,0,1));case"rosybrown":return new eQ(new gY(188,143,143,1));case"royalblue":return new eQ(new gY(65,105,225,1));case"saddlebrown":return new eQ(new gY(139,69,19,1));case"salmon":return new eQ(new gY(250,128,114,1));case"sandybrown":return new eQ(new gY(244,164,96,1));case"seagreen":return new eQ(new gY(46,139,87,1));case"seashell":return new eQ(new gY(255,245,238,1));case"sienna":return new eQ(new gY(160,82,45,1));case"silver":return new eQ(new gY(192,192,192,1));case"skyblue":return new eQ(new gY(135,206,235,1));case"slateblue":return new eQ(new gY(106,90,205,1));case"slategray":case"slategrey":return new eQ(new gY(112,128,144,1));case"snow":return new eQ(new gY(255,250,250,1));case"springgreen":return new eQ(new gY(0,255,127,1));case"steelblue":return new eQ(new gY(70,130,180,1));case"tan":return new eQ(new gY(210,180,140,1));case"teal":return new eQ(new gY(0,128,128,1));case"thistle":return new eQ(new gY(216,191,216,1));case"tomato":return new eQ(new gY(255,99,71,1));case"turquoise":return new eQ(new gY(64,224,208,1));case"violet":return new eQ(new gY(238,130,238,1));case"wheat":return new eQ(new gY(245,222,179,1));case"white":return new eQ(new gY(255,255,255,1));case"whitesmoke":return new eQ(new gY(245,245,245,1));case"yellow":return new eQ(new gY(255,255,0,1));case"yellowgreen":return new eQ(new gY(154,205,50,1));default:return null}}(e)},e.parseHex=i}((eY=(eQ=gX||(gX={})).Format||(eQ.Format={})).CSS||(eY.CSS={}));let g7=/^-+|-+$/g;class g3{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=c_(e);let i=this.values,n=this.prefixSum,s=t.length;return 0!==s&&(this.values=new Uint32Array(i.length+s),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+s),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=c_(e),t=c_(t),this.values[e]!==t&&(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=c_(e),t=c_(t);let i=this.values,n=this.prefixSum;if(e>=i.length)return!1;let s=i.length-e;return t>=s&&(t=s),0!==t&&(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(n.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=c_(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,n=0,s=0,r=0;for(;t<=i;)if(n=t+(i-t)/2|0,r=(s=this.prefixSum[n])-this.values[n],e<r)i=n-1;else if(e>=s)t=n+1;else break;return new g8(n,e-r)}}class g9{constructor(e){this._values=e,this._isValid=!1,this._val
4idEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return(this._ensureValid(),0===e)?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();let t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new g8(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=(0,as.Zv)(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e<t;e++){let t=this._values[e],i=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=i+t;for(let n=0;n<t;n++)this._indexBySum[i+n]=e}this._prefixSum.length=this._values.length,this._indexBySum.length=this._prefixSum[this._prefixSum.length-1],this._isValid=!0,this._validEndIndex=this._values.length-1}}setValue(e,t){this._values[e]!==t&&(this._values[e]=t,this._invalidate(e))}}class g8{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class fe{constructor(e,t,i,n){this._uri=e,this._lines=t,this._eol=i,this._versionId=n,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return null===this._cachedTextValue&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){for(let t of(e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null),e.changes))this._acceptDeleteRange(t.range),this._acceptInsertText(new s3(t.range.startLineNumber,t.range.startColumn),t.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){let e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let n=0;n<t;n++)i[n]=this._lines[n].length+e;this._lineStarts=new g3(i)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1));return}this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){if(0===t.length)return;let i=rI(t);if(1===i.length){this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));return}i[i.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]);let n=new Uint32Array(i.length-1);for(let t=1;t<i.length;t++)this._lines.splice(e.lineNumber+t-1,0,i[t]),n[t-1]=i[t].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,n)}}class ft extends ro.JT{constructor(e,t,i=!1){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){let e=new oU;e.cancelAndSet(()=>this._checkStopModelSync(),Math.round(3e4)),this._register(e)}}dispose(){for(let e in this._syncedModels)(0,ro.B9)(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t=!1){for(let i of e){let e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=new Date().getTime())}}_checkStopModelSync(){let e=new Date().getTime(),t=[];for(let i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i);for(let e of t)this._stopModelSync(e)}_beginModelSync(e,t){let i=this._modelService.getModel(e);
4if(!i||!t&&i.isTooLargeForSyncing())return;let n=e.toString();this._proxy.$acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});let s=new ro.SL;s.add(i.onDidChangeContent(e=>{this._proxy.$acceptModelChanged(n.toString(),e)})),s.add(i.onWillDispose(()=>{this._stopModelSync(n)})),s.add((0,ro.OF)(()=>{this._proxy.$acceptRemovedModel(n)})),this._syncedModels[n]=s}_stopModelSync(e){let t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],(0,ro.B9)(t)}}class fi{constructor(){this._models=Object.create(null)}getModel(e){return this._models[e]}getModels(){let e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}$acceptNewModel(e){this._models[e.url]=new fn(sJ.parse(e.url),e.lines,e.EOL,e.versionId)}$acceptModelChanged(e,t){this._models[e]&&this._models[e].onEvents(t)}$acceptRemovedModel(e){this._models[e]&&delete this._models[e]}}class fn extends fe{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){let t=[];for(let i=0;i<this._lines.length;i++){let n=this._lines[i],s=this.offsetAt(new s3(i+1,1));for(let i of n.matchAll(e))(i.index||0===i.index)&&(i.index=i.index+s),t.push(i)}return t}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){let i=(0,ur.t2)(e.column,(0,ur.eq)(t),this._lines[e.lineNumber-1],0);return i?new s9(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){let t=this._lines,i=this._wordenize.bind(this),n=0,s="",r=0,o=[];return{*[Symbol.iterator](){for(;;)if(r<o.length){let e=s.substring(o[r].start,o[r].end);r+=1,yield e}else if(n<t.length)o=i(s=t[n],e),r=0,n+=1;else break}}}getLineWords(e,t){let i=this._lines[e-1],n=this._wordenize(i,t),s=[];for(let e of n)s.push({word:i.substring(e.start,e.end),startColumn:e.start+1,endColumn:e.end+1});return s}_wordenize(e,t){let i;let n=[];for(t.lastIndex=0;(i=t.exec(e))&&0!==i[0].length;)n.push({start:i.index,end:i.index+i[0].length});return n}getValueInRange(e){if((e=this._validateRange(e)).startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);let t=this._eol,i=e.startLineNumber-1,n=e.endLineNumber-1,s=[];s.push(this._lines[i].substring(e.startColumn-1));for(let e=i+1;e<n;e++)s.push(this._lines[e]);return s.push(this._lines[n].substring(0,e.endColumn-1)),s.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.max(0,e=Math.floor(e)),this._ensureLineStarts();let t=this._lineStarts.getIndexOf(e),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){let t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!s3.isIPosition(e))throw Error("bad position");let{lineNumber:t,column:i}=e,n=!1;if(t<1)t=1,i=1,n=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,n=!0;else{let e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}}class fs{constructor(e=null){this._foreignModule=e,this._requestHandlerBrand=void 0,this._workerTextModelSyncServer=new fi}dispose(){}async $ping(){return"pong"}_getModel(e){return this._workerTextModelSyncServer.getModel(e)}getModels(){return this._workerTextModelSyncServer.getModels()}$acceptNewModel(e){this._workerTextModelSyncServer.$acceptNewModel(e)}$acceptModelChanged(e,t){this._workerTextModelSyncServer.$acceptModelChanged(e,t)}$acceptRemovedModel(e){this._workerTextModelSyncServer.$acceptRemovedModel(e)}async $computeUnicodeHighlights(e,t,i){let n=this._getModel(e);return n?cK.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}async $findSectionHeaders(e,t){let i=this._getModel(e);return i?function(e,t){let i=[];if(t.findRegionSectionHeaders&&t.foldingRules?.markers){let n=function(e,t){let i=[],n=e.getLineCount();for(let s=1;s<=n;s++){let n=e.getLineContent(s),r=n.match(t.foldingRules.markers.start);if(r){let e={startLineNumber:s,startColumn:r[0].length+1,endLineNumber:s,endColumn:n.length+1};if(e.endColumn>e.startColumn){let t={range:e,...function(e){let t=(e=e.trim()).startsWith("-");return{text:e=e.replace(g7,""),hasSeparatorLine:t}}(n.substring(r[0].length)),shouldBeInComments:!1};(t.text||t.hasSeparatorLine)&&i.push(t)}}}return i}(e,t);i=i.concat(n)}if(t.findMarkSectionHeaders){let n=function(e,t){let i=[],n=e.getLineCount();if(!t.markSectionHeaderRegex||""===t.markSectionHeaderRegex.trim())return i;let s=cB(t.markSectionHeaderRegex),r=RegExp(t.markSectionHeaderRegex,`gdm${s?"s":""}`);if(rT(r))return i;for(let t=1;t<=n;t+=95){let s;let o=Math.min(t+100-1,n),a=[];for(let i=t;i<=o;i++)a.push(e.getLineContent(i));let l=a.join("\n");for(r.lastIndex=0;null!==(s=r.exec(l));){let e=l.substring(0,s.index),n=t+(e.match(/\n/g)||[]).length,o=s[0].split("\n"),a=o.length,h=n+a-1,d=e.lastIndexOf("\n")+1,u=s.index-d+1,c=o[o.length-1],g=1===a?u+s[0].length:c.length+1,f={range:{startLineNumber:n,startColumn:u,endLineNumber:h,endColumn:g},text:(s.groups??{}).label??"",hasSeparatorLine:((s.groups??{}).separator??"")!=="",shouldBeInComments:!0};(f.text||f.hasSeparatorLine)&&(0===i.length||i[i.length-1].range.endLineNumber<f.range.startLineNumber)&&i.push(f),r.lastIndex=s.index+s[0].length}}return i}(e,t);i=i.concat(n)}return i}(i,t):[]}async $computeDiff(e,t,i,n){let s=this._getModel(e),r=this._getModel(t);return s&&r?fs.computeDiff(s,r,i,n):null}static computeDiff(e,t,i,n){let s="advanced"===n?gG.getDefault():gG.getLegacy(),r=e.getLinesContent(),o=t.getLinesContent(),a=s.computeDiff(r,o,i);function l(e){return e.map(e=>[e.original.startLineNumber,e.original.endLineNumberExclusive,e.modified.startLineNumber,e.modified.endLineNumberExclusive,e.innerChanges?.map(e=>[e.originalRange.startLineNumber,e.originalRange.startColumn,e.originalRange.endLineNumber,e.originalRange.endColumn,e.modifiedRange.startLineNumber,e.modifiedRange.startColumn,e.modifiedRange.endLineNumber,e.modifiedRange.endColumn])])}return{identical:!(a.changes.length>0)&&this._modelsAreIdentical(e,t),quitEarly:a.hitTimeout,changes:l(a.changes),moves:a.moves.map(e=>[e.lineRangeMapping.original.startLineNumber,e.lineRangeMapping.original.endLineNumberExclusive,e.lineRangeMapping.modified.startLineNumber,e.lineRangeMapping.modified.endLineNumberExclusive,l(e.changes)])}}static _modelsAreIdentical(e,t){let i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++)if(e.getLineContent(n)!==t.getLineContent(n))return!1;return!0}static{this._diffLimit=1e5}async $computeMoreMinimalEdits(e,t,i){let n;let s=this._getModel(e);
4if(!s)return t;let r=[];t=t.slice(0).sort((e,t)=>e.range&&t.range?s9.compareRangesUsingStarts(e.range,t.range):(e.range?0:1)-(t.range?0:1));let o=0;for(let e=1;e<t.length;e++)s9.getEndPosition(t[o].range).equals(s9.getStartPosition(t[e].range))?(t[o].range=s9.fromPositions(s9.getStartPosition(t[o].range),s9.getEndPosition(t[e].range)),t[o].text+=t[e].text):t[++o]=t[e];for(let{range:e,text:l,eol:h}of(t.length=o+1,t)){var a;if("number"==typeof h&&(n=h),s9.isEmpty(e)&&!l)continue;let t=s.getValueInRange(e);if(t===(l=l.replace(/\r\n|\n|\r/g,s.eol)))continue;if(Math.max(l.length,t.length)>fs._diffLimit){r.push({range:e,text:l});continue}let o=(a=l,new cm(new cu(t),new cu(a)).ComputeDiff(i).changes),d=s.offsetAt(s9.lift(e).getStartPosition());for(let e of o){let t=s.positionAt(d+e.originalStart),i=s.positionAt(d+e.originalStart+e.originalLength),n={text:l.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}};s.getValueInRange(n.range)!==n.text&&r.push(n)}}return"number"==typeof n&&r.push({eol:n,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),r}async $computeLinks(e){let t=this._getModel(e);return t?t&&"function"==typeof t.getLineCount&&"function"==typeof t.getLineContent?cL.computeLinks(t):[]:null}async $computeDefaultDocumentColors(e){let t=this._getModel(e);return t?t&&"function"==typeof t.getValue&&"function"==typeof t.positionAt?function(e){let t=[],i=g6(e,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|^(#)([A-Fa-f0-9]{3})\b|^(#)([A-Fa-f0-9]{4})\b|^(#)([A-Fa-f0-9]{6})\b|^(#)([A-Fa-f0-9]{8})\b|(?<=['"\s])(#)([A-Fa-f0-9]{3})\b|(?<=['"\s])(#)([A-Fa-f0-9]{4})\b|(?<=['"\s])(#)([A-Fa-f0-9]{6})\b|(?<=['"\s])(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(let n of i){let i;let s=n.filter(e=>void 0!==e),r=s[1],o=s[2];if(o){if("rgb"===r){let t=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;i=g5(g2(e,n),g6(o,t),!1)}else if("rgba"===r){let t=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;i=g5(g2(e,n),g6(o,t),!0)}else if("hsl"===r){let t=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;i=g4(g2(e,n),g6(o,t),!1)}else if("hsla"===r){let t=/^\(\s*((?:360(?:\.0+)?|(?:36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])(?:\.\d+)?))\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*[\s,]\s*(0[.][0-9]+|[.][0-9]+|[01][.]0*|[01])\s*\)$/gm;i=g4(g2(e,n),g6(o,t),!0)}else"#"===r&&(i=function(e,t){if(!e)return;let i=gX.Format.CSS.parseHex(t);if(i)return{range:e,color:g0(i.rgba.r,i.rgba.g,i.rgba.b,i.rgba.a)}}(g2(e,n),r+o));i&&t.push(i)}}return t}(t):[]:null}static{this._suggestionsLimit=1e4}async $textualSuggest(e,t,i,n){let s=new ck.G,r=new RegExp(i,n),o=new Set;i:for(let i of e){let e=this._getModel(i);if(e){for(let i of e.words(r))if(i!==t&&isNaN(Number(i))&&(o.add(i),o.size>fs._suggestionsLimit))break i}}return{words:Array.from(o),duration:s.elapsed()}}async $computeWordRanges(e,t,i,n){let s=this._getModel(e);if(!s)return Object.create(null);let r=new RegExp(i,n),o=Object.create(null);for(let e=t.startLineNumber;e<t.endLineNumber;e++)for(let t of s.getLineWords(e,r)){if(!isNaN(Number(t.word)))continue;let i=o[t.word];i||(i=[],o[t.word]=i),i.push({startLineNumber:e,startColumn:t.startColumn,endLineNumber:e,endColumn:t.endColumn})}return o}async $navigateValueSet(e,t,i,n,s){let r=this._getModel(e);if(!r)return null;let o=new RegExp(n,s);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});let a=r.getValueInRange(t),l=r.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},o);if(!l)return null;let h=r.getValueInRange(l);return cx.INSTANCE.navigateValueSet(t,a,l,h,i)}$fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(e){return Promise.reject(e)}}}"function"==typeof importScripts&&(globalThis.monaco=rv());let fr=ht("textResourceConfigurationService"),fo=ht("textResourcePropertiesService"),fa=ht("ILanguageFeaturesService");class fl{static{this.CHANNEL_NAME="editorWorkerHost"}static getChannel(e){return e.getChannel(fl.CHANNEL_NAME)}static setChannel(e,t){e.setChannel(fl.CHANNEL_NAME,t)}}var fh=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},fd=function(e,t){return function(i,n){t(i,n,e)}};function fu(e,t){let i=e.getModel(t);return!(!i||i.isTooLargeForSyncing())}let fc=class extends ro.JT{constructor(e,t,i,n,s,r){super(),this._languageConfigurationService=s,this._modelService=t,this._workerManager=this._register(new ff(e,this._modelService)),this._logService=n,this._register(r.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:async(e,t)=>{if(!fu(this._modelService,e.uri))return Promise.resolve({links:[]});let i=await this._workerWithResources([e.uri]),n=await i.$computeLinks(e.uri.toString());return n&&{links:n}}})),this._register(r.completionProvider.register("*",new fg(this._workerManager,i,this._modelService,this._languageConfigurationService,this._logService)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return fu(this._modelService,e)}async computedUnicodeHighlights(e,t,i){return(await this._workerWithResources([e])).$computeUnicodeHighlights(e.toString(),t,i)}async computeDiff(e,t,i,n){let s=await this._workerWithResources([e,t],!0),r=await s.$computeDiff(e.toString(),t.toString(),i,n);if(!r)return null;return{identical:r.identical,quitEarly:r.quitEarly,changes:o(r.changes),moves:r.moves.map(e=>new cG(new go(new c5(e[0],e[1]),new c5(e[2],e[3])),o(e[4])))};function o(e){return e.map(e=>new gh(new c5(e[0],e[1]),new c5(e[2],e[3]),e[4]?.map(e=>new gd(new s9(e[0],e[1],e[2],e[3]),new s9(e[4],e[5],e[6],e[7])))))}}async computeMoreMinimalEdits(e,t,i=!1){if(!(0,as.Of)(t))return Promise.resolve(void 0);{if(!fu(this._modelService,e))return Promise.resolve(t);let n=ck.G.create(),s=this._workerWithResources([e]).then(n=>n.$computeMoreMinimalEdits(e.toString(),t,i));return s.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed())),Promise.race([s,oV(1e3).then(()=>t)])}}canNavigateValueSet(e){return fu(this._modelService,e)}async navigateValueSet(e,t,i){let n=this._modelService.getModel(e);
4if(!n)return null;let s=this._languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),r=s.source,o=s.flags;return(await this._workerWithResources([e])).$navigateValueSet(e.toString(),t,i,r,o)}canComputeWordRanges(e){return fu(this._modelService,e)}async computeWordRanges(e,t){let i=this._modelService.getModel(e);if(!i)return Promise.resolve(null);let n=this._languageConfigurationService.getLanguageConfiguration(i.getLanguageId()).getWordDefinition(),s=n.source,r=n.flags;return(await this._workerWithResources([e])).$computeWordRanges(e.toString(),t,s,r)}async findSectionHeaders(e,t){return(await this._workerWithResources([e])).$findSectionHeaders(e.toString(),t)}async computeDefaultDocumentColors(e){return(await this._workerWithResources([e])).$computeDefaultDocumentColors(e.toString())}async _workerWithResources(e,t=!1){let i=await this._workerManager.withWorker();return await i.workerWithSyncedResources(e,t)}};fc=fh([fd(1,hn),fd(2,fr),fd(3,dM),fd(4,u8),fd(5,fa)],fc);class fg{constructor(e,t,i,n,s){this.languageConfigurationService=n,this.logService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}async provideCompletionItems(e,t){let i=this._configurationService.getValue(e.uri,t,"editor");if("off"===i.wordBasedSuggestions)return;let n=[];if("currentDocument"===i.wordBasedSuggestions)fu(this._modelService,e.uri)&&n.push(e.uri);else for(let t of this._modelService.getModels())fu(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):("allDocuments"===i.wordBasedSuggestions||t.getLanguageId()===e.getLanguageId())&&n.push(t.uri));if(0===n.length)return;let s=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),o=r?new s9(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):s9.fromPositions(t),a=o.setEndPosition(t.lineNumber,t.column);this.logService.trace("[WordBasedCompletionItemProvider]",`word: "${r?.word||""}", wordDef: "${s}", replace: [${o.toString()}], insert: [${a.toString()}]`);let l=await this._workerManager.withWorker(),h=await l.textualSuggest(n,r?.word,s);if(h)return{duration:h.duration,suggestions:h.words.map(e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:o}}))}}}let ff=class extends ro.JT{constructor(e,t){super(),this._workerDescriptor=e,this._modelService=t,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new a9).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(15e4),rb),this._register(this._modelService.onModelRemoved(e=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){this._editorWorkerClient&&0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){this._editorWorkerClient&&new Date().getTime()-this._lastWorkerUsedTime>3e5&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new fp(this._workerDescriptor,!1,this._modelService)),Promise.resolve(this._editorWorkerClient)}};ff=fh([fd(1,hn)],ff);class fm{constructor(e){this._instance=e,this.proxy=this._instance}dispose(){this._instance.dispose()}setChannel(e,t){throw Error("Not supported")}}let fp=class extends ro.JT{constructor(e,t,i){super(),this._workerDescriptorOrWorker=e,this._disposed=!1,this._modelService=i,this._keepIdleModels=t,this._worker=null,this._modelManager=null}fhr(e,t){throw Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{var e;this._worker=this._register((e=this._workerDescriptorOrWorker,new d9(new un(sJ.isUri(e)?new us(e,void 0):e)))),fl.setChannel(this._worker,this._createEditorWorkerHost())}catch(e){d0(e),this._worker=this._createFallbackLocalWorker()}return this._worker}async _getProxy(){try{let e=this._getOrCreateWorker().proxy;return await e.$ping(),e}catch(e){return d0(e),this._worker=this._createFallbackLocalWorker(),this._worker.proxy}}_createFallbackLocalWorker(){return new fm(new fs(null))}_createEditorWorkerHost(){return{$fhr:(e,t)=>
4this.fhr(e,t)}}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new ft(e,this._modelService,this._keepIdleModels))),this._modelManager}async workerWithSyncedResources(e,t=!1){if(this._disposed)return Promise.reject((0,o_.F0)());let i=await this._getProxy();return this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i}async textualSuggest(e,t,i){let n=await this.workerWithSyncedResources(e),s=i.source,r=i.flags;return n.$textualSuggest(e.map(e=>e.toString()),t,s,r)}dispose(){super.dispose(),this._disposed=!0}};fp=fh([fd(2,hn)],fp);class f_ extends fp{constructor(e,t){super(t.worker,t.keepIdleModels||!1,e),this._foreignModuleHost=t.host||null,this._foreignProxy=this._getProxy().then(e=>new Proxy({},{get(t,i,n){if("then"!==i){if("string"!=typeof i)throw Error("Not supported");return(...t)=>e.$fmr(i,t)}}}))}fhr(e,t){if(!this._foreignModuleHost||"function"!=typeof this._foreignModuleHost[e])return Promise.reject(Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(e){return Promise.reject(e)}}getProxy(){return this._foreignProxy}withSyncedResources(e){return this.workerWithSyncedResources(e).then(e=>this.getProxy())}}var fv=i(28432);let fb={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},fC=new class{clone(){return this}equals(e){return this===e}};function fw(e,t){return new ru([new rd(0,"",e)],t)}function fy(e,t){let i=new Uint32Array(2);return i[0]=0,i[1]=(e<<0|33587200)>>>0,new rc(i,null===t?fC:t)}class fS{static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return(1024&e)!=0}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e),i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),8&i&&(t+=" mtks"),t}static getInlineStyleFromMetadata(e,t){let i=this.getForeground(e),n=this.getFontStyle(e),s=`color: ${t[i]};`;1&n&&(s+="font-style: italic;"),2&n&&(s+="font-weight: bold;");let r="";return 4&n&&(r+=" underline"),8&n&&(r+=" line-through"),r&&(s+=`text-decoration:${r};`),s}static getPresentationFromMetadata(e){let t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(1&i),bold:!!(2&i),underline:!!(4&i),strikethrough:!!(8&i)}}}class fL{static createEmpty(e,t){let i=fL.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new fL(n,e,t)}static createFromTextAndMetadata(e,t){let i=0,n="",s=[];for(let{text:t,metadata:r}of e)s.push(i+t.length,r),i+=t.length,n+=t;return new fL(new Uint32Array(s),n,t)}static convertToEndOffset(e,t){let i=(e.length>>>1)-1;for(let t=0;t<i;t++)e[t<<1]=e[t+1<<1];e[i<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,n=(e.length>>>1)-1;for(;i<n;){let s=i+Math.floor((n-i)/2),r=e[s<<1];if(r===t)return s+1;r<t?i=s+1:r>t&&(n=s)}return i}static{this.defaultTokenMetadata=33587200}constructor(e,t,i){this._lineTokensBrand=void 0,(e.length>1?e[e.length-2]:0)!==t.length&&(0,o_.dL)(Error("Token length and text length do not match!")),this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this.languageIdCodec=i}getTextLength(){return this._text.length}equals(e){return e instanceof fL&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;let n=t<<1,s=n+(i<<1);for(let t=n;t<s;t++)if(this._tokens[t]!==e._tokens[t])return!1;return!0}getLineContent(){return this._text}getCount(){return this._tokensCount}getStartOffset(e){return e>0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){let t=this._tokens[(e<<1)+1],i=fS.getLanguageId(t);return this.languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){let t=this._tokens[(e<<1)+1];return fS.getTokenType(t)}getForeground(e){let t=this._tokens[(e<<1)+1];return fS.getForeground(t)}getClassName(e){let t=this._tokens[(e<<1)+1];return fS.getClassNameFromMetadata(t)}getInlineStyle(e,t){let i=this._tokens[(e<<1)+1];return fS.getInlineStyleFromMetadata(i,t)}getPresentation(e){let t=this._tokens[(e<<1)+1];return fS.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return fL.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new fx(this,e,t,i)}sliceZeroCopy(e){return this.sliceAndInflate(e.start,e.endExclusive,0)}withInserted(e){if(0===e.length)return this;let t=0,i=0,n="",s=[],r=0;for(;;){let o=t<this._tokensCount?this._tokens[t<<1]:-1,a=i<e.length?e[i]:null;if(-1!==o&&(null===a||o<=a.offset)){n+=this._text.substring(r,o);let e=this._tokens[(t<<1)+1];s.push(n.length,e),t++,r=o}else if(a){if(a.offset>r){n+=this._text.substring(r,a.offset);let e=this._tokens[(t<<1)+1];s.push(n.length,e),r=a.offset}n+=a.text,s.push(n.length,a.tokenMetadata),i++}else break}return new fL(new Uint32Array(s),n,this.languageIdCodec)}getTokensInRange(e){let t=new fD,i=this.findTokenIndexAtOffset(e.start),n=this.findTokenIndexAtOffset(e.endExclusive);for(let s=i;s<=n;s++){let i=new cQ(this.getStartOffset(s),this.getEndOffset(s)).intersectionLength(e);i>0&&t.add(i,this.getMetadata(s))}return t.build()}getTokenText(e){let t=this.getStartOffset(e),i=this.getEndOffset(e);return this._text.substring(t,i)}forEach(e){let t=this.getCount();for(let i=0;i<t;i++)e(i)}toString(){let e="";return this.forEach(t=>{e+=`[${this.getTokenText(t)}]{${this.getClassName(t)}}`}),e}}class fx{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this.languageIdCodec=e.languageIdCodec,this._tokensCount=0;for(let t=this._firstTokenIndex,n=e.getCount();t<n&&!(e.getStartOffset(t)>=i);t++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof fx&&this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount)}getCount(){return this._tokensCount}getStandardTokenType(e){return this._source.getStandardTokenType(this._firstTokenIndex+e)}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){let t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}getTokenText(e){let t=this._firstTokenIndex+e,i=this._source.getStartOffset(t),n=this._source.getEndOffset(t),s=this._source.getTokenText(t);return i<this._startOffset&&(s=s.substring(this._startOffset-i)),n>this._endOffset&&(s=s.substring(0,s.length-(n-this._endOffset))),s}forEach(e){for(let t=0;t<this.getCount();t++)e(t)}}class fk{static fromLineTokens(e){let t=[];for(let i=0;i<e.getCount();i++)t.push(new fN(e.getEndOffset(i)-e.getStartOffset(i),e.getMetadata(i)));return fk.create(t)}static create(e){return new fk(e)}constructor(e){this._tokenInfo=e}toLineTokens(e,t){return fL.createFromTextAndMetadata(this.map((t,i)=>({text:t.substring(e),metadata:i.metadata})),t)}forEach(e){let t=0;for(let i of this._tokenInfo)e(new cQ(t,t+i.length),i),t+=i.length}map(e){let t=[],i=0;for(let n of this._tokenInfo){let s=new cQ(i,i+n.length);t.push(e(s,n)),i+=n.length}return t}slice(e){let t=[],i=0;for(let n of this._tokenInfo){let s=i,r=s+n.length;if(r>e.start){if(s>=e.endExclusive)break;let i=Math.max(0,e.start-s),o=Math.max(0,r-e.endExclusive);t.push(new fN(n.length-i-o,n.metadata))}i+=n.length}return fk.create(t)}}class fN{constructor(e,t){this.length=e,this.metadata=t}}class fD{constructor(){this._tokens=[]}add(e,t){this._tokens.push(new fN(e,t))}build(){return fk.create(this._tokens)}}class fE{constructor(e,t,i,n){this.startColumn=e,this.endColumn=t,this.className=i,this.type=n,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){let i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!fE._equals(e[n],t[n]))return!1;return!0}static extractWrapped(e,t,i){if(0===e.length)return e;let n=t+1,s=i+1,r=i-t,o=[],a=0;for(let t of e)t.endColumn<=n||t.startColumn>=s||(o[a++]=new fE(Math.max(1,t.startColumn-n+1),Math.min(r+1,t.endColumn-n+1),t.className,t.type));return o}static filter(e,t,i,n){if(0===e.length)return[];let s=[],r=0;for(let o=0,a=e.length;o<a;o++){let a=e[o],l=a.range;if(l.endLineNumber<t||l.startLineNumber>t||l.isEmpty()&&(0===a.type||3===a.type))continue;let h=l.startLineNumber===t?l.startColumn:i,d=l.endLineNumber===t?l.endColumn:n;s[r++]=new fE(h,d,a.inlineClassName,a.type)}return s}static _typeCompare(e,t){let i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;let i=fE._typeCompare(e.type,t.type);return 0!==i?i:e.className!==t.className?e.className<t.className?-1:1:0}}class fT{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=n}}class fI{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,n=e.length;i<n;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let e=0;for(;e+1<this.count&&this.stopOffsets[e]===this.stopOffsets[e+1];)e++;i.push(new fT(t,this.stopOffsets[e],this.classNames.join(" "),fI._metadata(this.metadata))),t=this.stopOffsets[e]+1,this.stopOffsets.splice(0,e+1),this.classNames.splice(0,e+1),this.metadata.splice(0,e+1),this.count-=e+1}return this.count>0&&t<e&&(i.push(new fT(t,e-1,this.classNames.join(" "),fI._metadata(this.metadata))),t=e),t}insert(e,t,i){if(0===this.count||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let n=0;n<this.count;n++)if(this.stopOffsets[n]>=e){this.stopOffsets.splice(n,0,e),this.classNames.splice(n,0,t),this.metadata.splice(n,0,i);break}this.count++}}class fM{static normalize(e,t){if(0===t.length)return[];let i=[],n=new fI,s=0;for(let r=0,o=t.length;r<o;r++){let o=t[r],a=o.startColumn,l=o.endColumn,h=o.className,d=1===o.type?2:2===o.type?4:0;a>1&&rq(e.charCodeAt(a-2))&&a--,l>1&&rq(e.charCodeAt(l-2))&&l--;let u=a-1,c=l-2;s=n.consumeLowerThan(u,s,i),0===n.count&&(s=u),n.insert(c,h,d)}return n.consumeLowerThan(1073741824,s,i),i}}class fR{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class fA{get isLTR(){return!this.containsRTL&&this.textDirection!==iZ.RTL}constructor(e,t,i,n,s,r,o,a,l,h,d,u,c,g,f,m,p,_,v,b,C,w=!1){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=s,this.containsRTL=r,this.fauxIndentLength=o,this.lineTokens=a,this.lineDecorations=l.sort(fE.compare),this.tabSize=h,this.startVisibleColumn=d,this.spaceWidth=u,this.stopRenderingLineAfter=f,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=p,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort((e,t)=>
4e.start<t.start?-1:1),this.renderNewLineWhenEmpty=w,this.textDirection=b,this.verticalScrollbarSize=C,Math.abs(g-u)<Math.abs(c-u)?(this.renderSpaceWidth=g,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=c,this.renderSpaceCharCode=183)}sameSelection(e){if(null===this.selectionsOnLine)return null===e;if(null===e||e.length!==this.selectionsOnLine.length)return!1;for(let t=0;t<this.selectionsOnLine.length;t++)if(!this.selectionsOnLine[t].equals(e[t]))return!1;return!0}equals(e){return this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineContent===e.lineContent&&this.continuesWithWrappedLine===e.continuesWithWrappedLine&&this.isBasicASCII===e.isBasicASCII&&this.containsRTL===e.containsRTL&&this.fauxIndentLength===e.fauxIndentLength&&this.tabSize===e.tabSize&&this.startVisibleColumn===e.startVisibleColumn&&this.spaceWidth===e.spaceWidth&&this.renderSpaceWidth===e.renderSpaceWidth&&this.renderSpaceCharCode===e.renderSpaceCharCode&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.fontLigatures===e.fontLigatures&&fE.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)&&this.textDirection===e.textDirection&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.renderNewLineWhenEmpty===e.renderNewLineWhenEmpty}}class fO{constructor(e,t){this.partIndex=e,this.charIndex=t}}class fP{static getPartIndex(e){return(4294901760&e)>>>16}static getCharIndex(e){return(65535&e)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){this._data[e-1]=(t<<16|i<<0)>>>0,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return 0===this._horizontalOffset.length?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return 0===this.length?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){let t=this.charOffsetToPartData(e-1);return new fO(fP.getPartIndex(t),fP.getCharIndex(t))}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(0===this.length)return 0;let n=(e<<16|i<<0)>>>0,s=0,r=this.length-1;for(;s+1<r;){let e=s+r>>>1,t=this._data[e];if(t===n)return e;t>n?r=e:s=e}if(s===r)return s;let o=this._data[s],a=this._data[r];if(o===n)return s;if(a===n)return r;let l=fP.getPartIndex(o);return i-fP.getCharIndex(o)<=(l!==fP.getPartIndex(a)?t:fP.getCharIndex(a))-i?s:r}}class fF{constructor(e,t){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsForeignElements=t}}function fB(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendString("<span>");let i=0,n=0,s=0;for(let r of e.lineDecorations)(1===r.type||2===r.type)&&(t.appendString('
4<span class="'),t.appendString(r.className),t.appendString('"></span>'),1===r.type&&(s|=1,i++),2===r.type&&(s|=2,n++));t.appendString("</span>");let r=new fP(1,i+n);return r.setColumnInfo(1,i,0,0),new fF(r,s)}return e.renderNewLineWhenEmpty?t.appendString("<span><span>\n</span></span>"):t.appendString("<span><span></span></span>"),new fF(new fP(0,0),0)}return function(e,t){let i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,s=e.containsForeignElements,r=e.lineContent,o=e.len,a=e.isOverflowing,l=e.overflowingCharCount,h=e.parts,d=e.fauxIndentLength,u=e.tabSize,c=e.startVisibleColumn,g=e.spaceWidth,f=e.renderSpaceCharCode,m=e.renderWhitespace,p=e.renderControlCharacters,_=new fP(o+1,h.length),v=!1,b=0,C=c,w=0,y=0,S=0;t.appendString("<span>");for(let e=0,a=h.length;e<a;e++){let a=h[e],l=a.endIndex,c=a.type,L=a.containsRTL,x=0!==m&&a.isWhitespace(),k=x&&!i&&("mtkw"===c||!s),N=b===l&&a.isPseudoAfter();if(w=0,t.appendString("<span "),L&&t.appendString('dir="rtl" style="unicode-bidi:isolate" '),t.appendString('class="'),t.appendString(k?"mtkz":c),t.appendASCIICharCode(34),x){let i=0;{let e=b,t=C;for(;e<l;e++){let n=(9===r.charCodeAt(e)?u-t%u:1)|0;i+=n,e>=d&&(t+=n)}}for(k&&(t.appendString(' style="width:'),t.appendString(String(g*i)),t.appendString('px"')),t.appendASCIICharCode(62);b<l;b++){let i,s;if(_.setColumnInfo(b+1,e-S,w,y),S=0,9===r.charCodeAt(b)){s=i=u-C%u|0,!n||s>1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=s;e++)t.appendCharCode(160)}else i=2,s=1,t.appendCharCode(f),t.appendCharCode(8204);w+=i,y+=s,b>=d&&(C+=s)}}else for(t.appendASCIICharCode(62);b<l;b++){_.setColumnInfo(b+1,e-S,w,y),S=0;let i=r.charCodeAt(b),n=1,s=1;switch(i){case 9:s=n=u-C%u;for(let e=1;e<=n;e++)t.appendCharCode(160);break;case 32:t.appendCharCode(160);break;case 60:t.appendString("&lt;");break;case 62:t.appendString("&gt;");break;case 38:t.appendString("&amp;");break;case 0:p?t.appendCharCode(9216):t.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:t.appendCharCode(65533);break;default:r6(i)&&s++,p&&i<32?t.appendCharCode(9216+i):p&&127===i?t.appendCharCode(9249):p&&fz(i)?(t.appendString("[U+"),t.appendString(i.toString(16).toUpperCase().padStart(4,"0")),t.appendString("]"),s=n=8):t.appendCharCode(i)}w+=n,y+=s,b>=d&&(C+=s)}N?S++:S=0,b>=o&&!v&&a.isPseudoAfter()&&(v=!0,_.setColumnInfo(b+1,e,w,y)),t.appendString("</span>")}return v||_.setColumnInfo(o+1,h.length-1,w,y),a&&(t.appendString('
4<span class="mtkoverflow">'),t.appendString((0,rh.NC)(796,"Show more ({0})",l<1024?(0,rh.NC)(797,"{0} chars",l):l<1048576?`${(l/1024).toFixed(1)} KB`:`${(l/1024/1024).toFixed(1)} MB`)),t.appendString("</span>")),t.appendString("</span>"),new fF(_,s)}(function(e){let t,i,n;let s=e.lineContent;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter<s.length?(t=!0,i=s.length-e.stopRenderingLineAfter,n=e.stopRenderingLineAfter):(t=!1,i=0,n=s.length);let r=function(e,t,i,n,s){let r=[],o=0;n>0&&(r[o++]=new fR(n,"",0,!1));let a=n;for(let l=0,h=i.getCount();l<h;l++){let h=i.getEndOffset(l);if(h<=n)continue;let d=i.getClassName(l);if(h>=s){let i=!!t&&r0(e.substring(a,s));r[o++]=new fR(s,d,0,i);break}let u=!!t&&r0(e.substring(a,h));r[o++]=new fR(h,d,0,u),a=h}return r}(s,e.containsRTL,e.lineTokens,e.fauxIndentLength,n);e.renderControlCharacters&&!e.isBasicASCII&&(r=function(e,t){let i=[],n=new fR(0,"",0,!1),s=0;for(let r of t){let t=r.endIndex;for(;s<t;s++)fz(e.charCodeAt(s))&&(s>n.endIndex&&(n=new fR(s,r.type,r.metadata,r.containsRTL),i.push(n)),n=new fR(s+1,"mtkcontrol",r.metadata,!1),i.push(n));s>n.endIndex&&(n=new fR(t,r.type,r.metadata,r.containsRTL),i.push(n))}return i}(s,r)),(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace&&!e.continuesWithWrappedLine)&&(r=function(e,t,i,n){let s;let r=e.continuesWithWrappedLine,o=e.fauxIndentLength,a=e.tabSize,l=e.startVisibleColumn,h=e.useMonospaceOptimizations,d=e.selectionsOnLine,u=1===e.renderWhitespace,c=3===e.renderWhitespace,g=e.renderSpaceWidth!==e.spaceWidth,f=[],m=0,p=0,_=n[0].type,v=n[p].containsRTL,b=n[p].endIndex,C=n.length,w=!1,y=rM(t);-1===y?(w=!0,y=i,s=i):s=rA(t);let S=!1,L=0,x=d&&d[L],k=l%a;for(let e=o;e<i;e++){let r;let l=t.charCodeAt(e);if(x&&x.endExclusive<=e&&(L++,x=d&&d[L]),e<y||e>s)r=!0;else if(9===l)r=!0;else if(32===l){if(u){if(S)r=!0;else{let n=e+1<i?t.charCodeAt(e+1):0;r=32===n||9===n}}else r=!0}else r=!1;if(r&&d&&(r=!!x&&x.start<=e&&e<x.endExclusive),r&&c&&(r=w||e>s),r&&v&&e>=y&&e<=s&&(r=!1),S){if(!r||!h&&k>=a){if(g){let t=m>0?f[m-1].endIndex:o;for(let i=t+1;i<=e;i++)f[m++]=new fR(i,"mtkw",1,!1)}else f[m++]=new fR(e,"mtkw",1,!1);k%=a}}else(e===b||r&&e>o)&&(f[m++]=new fR(e,_,0,v),k%=a);for(9===l?k=a:r6(l)?k+=2:k++,S=r;e===b;)if(++p<C)_=n[p].type,v=n[p].containsRTL,b=n[p].endIndex;else break}let N=!1;if(S){if(r&&u){let e=i>0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(N=!0)}else N=!0}if(N){if(g){let e=m>0?f[m-1].endIndex:o;for(let t=e+1;t<=i;t++)f[m++]=new fR(t,"mtkw",1,!1)}else f[m++]=new fR(i,"mtkw",1,!1)}else f[m++]=new fR(i,_,0,v);return f}(e,s,n,r));let o=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;t<i;t++){let i=e.lineDecorations[t];3===i.type?o|=1:1===i.type?o|=1:2===i.type&&(o|=2)}r=function(e,t,i,n){n.sort(fE.compare);let s=fM.normalize(e,n),r=s.length,o=0,a=[],l=0,h=0;for(let e=0,t=i.length;e<t;e++){let t=i[e],n=t.endIndex,d=t.type,u=t.metadata,c=t.containsRTL;for(;o<r&&s[o].startOffset<n;){let e=s[o];if(e.startOffset>h&&(h=e.startOffset,a[l++]=new fR(h,d,u,c)),e.endOffset+1<=n)h=e.endOffset+1,a[l++]=new fR(h,d+" "+e.className,u|e.metadata,c),o++;else{h=n,a[l++]=new fR(h,d+" "+e.className,u|e.metadata,c);break}}n>h&&(h=n,a[l++]=new fR(h,d,u,c))}let d=i[i.length-1].endIndex;if(o<r&&s[o].startOffset===d)for(;o<r&&s[o].startOffset===d;){let e=s[o];a[l++]=new fR(h,e.className,e.metadata,!1),o++}return a}(s,0,r,e.lineDecorations)}return r=e.containsRTL?function(e,t){if(0===t.length)return t;let i=t[0];if(!i.containsRTL)return t;let n=i.endIndex,s=0;for(let t=0;t<n;t++){let i=e.charCodeAt(t);if(32!==i&&9!==i){s=t;break}}if(0===s)return t;let r=[];r.push(new fR(s,i.type,i.metadata,!1)),r.push(new fR(n,i.type,i.metadata,i.containsRTL));for(let e=1;e<t.length;e++)r.push(t[e]);return r}(s,r):function(e,t,i){let n=0,s=[],r=0;if(i)for(let i=0,o=t.length;i<o;i++){let o=t[i],a=o.endIndex;if(n+50<a){let t=o.type,i=o.metadata,l=o.containsRTL,h=-1,d=n;for(let o=n;o<a;o++)32===e.charCodeAt(o)&&(h=o),-1!==h&&o-d>=50&&(s[r++]=new fR(h+1,t,i,l),d=h+1,h=-1);d!==a&&(s[r++]=new fR(a,t,i,l))}else s[r++]=o;n=a}else for(let e=0,i=t.length;e<i;e++){let i=t[e],o=i.endIndex,a=o-n;if(a>50){let e=i.type,t=i.metadata,l=i.containsRTL,h=Math.ceil(a/50);for(let i=1;i<h;i++){let o=n+50*i;s[r++]=new fR(o,e,t,l)}s[r++]=new fR(o,e,t,l)}else s[r++]=i;n=o}return s}(s,r,!e.isBasicASCII||e.fontLigatures),new fH(e.useMonospaceOptimizations,e.canUseHalfwidthRightwardsArrow,s,n,t,i,r,o,e.fauxIndentLength,e.tabSize,e.startVisibleColumn,e.spaceWi
4dth,e.renderSpaceCharCode,e.renderWhitespace,e.renderControlCharacters)}(e),t)}class fV{constructor(e,t,i){this.characterMapping=e,this.html=t,this.containsForeignElements=i}}function fW(e){let t=new um(1e4),i=fB(e,t);return new fV(i.characterMapping,t.build(),i.containsForeignElements)}class fH{constructor(e,t,i,n,s,r,o,a,l,h,d,u,c,g,f){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=n,this.isOverflowing=s,this.overflowingCharCount=r,this.parts=o,this.containsForeignElements=a,this.fauxIndentLength=l,this.tabSize=h,this.startVisibleColumn=d,this.spaceWidth=u,this.renderSpaceCharCode=c,this.renderWhitespace=g,this.renderControlCharacters=f}}function fz(e){return e<32?9!==e:127===e||e>=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e}class fU{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class fK{constructor(e,t){this.tabSize=e,this.data=t}}class f${constructor(e,t,i,n,s,r,o){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=s,this.tokens=r,this.inlineDecorations=o}}class fj{constructor(e,t,i,n,s,r,o,a,l,h,d,u){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=fj.isBasicASCII(i,r),this.containsRTL=fj.containsRTL(i,this.isBasicASCII,s),this.tokens=o,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=h,this.textDirection=d,this.hasVariableFonts=u}static isBasicASCII(e,t){return!t||r5(e)}static containsRTL(e,t,i){return!t&&!!i&&r0(e)}}class fq{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&(0,as.fS)(e.data,t.data)}static equalsArr(e,t){return(0,as.fS)(e,t,fq.equals)}}function fG(e){return"string"==typeof e}function fQ(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function fY(e){return e.replace(/[&<>'"_]/g,"-")}function fJ(e,t){return Error(`${e.languageId}: ${t}`)}function fZ(e,t,i,n,s){let r=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,function(t,o,a,l,h,d,u,c,g){return a?"$":l?fQ(e,i):h&&h<n.length?fQ(e,n[h]):u&&e&&"string"==typeof e[u]?e[u]:(null===r&&(r=s.split(".")).unshift(s),d&&d<r.length)?fQ(e,r[d]):""})}function fX(e,t){let i=t;for(;i&&i.length>0;){let t=e.tokenizer[i];if(t)return t;let n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}class f1{static{this._INSTANCE=new f1(5)}static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new f0(e,t);let i=f0.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new f0(e,t),this._entries[i]=n),n}}class f0{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return f0._equals(this,e)}push(e){return f1.create(this,e)}pop(){return this.parent}
4popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return f1.create(this.parent,e)}}class f2{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new f2(this.languageId,this.state)}}class f5{static{this._INSTANCE=new f5(5)}static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==t||null!==e&&e.depth>=this._maxCacheDepth)return new f4(e,t);let i=f0.getStackElementId(e),n=this._entries[i];return n||(n=new f4(e,null),this._entries[i]=n),n}}class f4{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:f5.create(this.stack,this.embeddedLanguageData)}equals(e){return!!(e instanceof f4&&this.stack.equals(e.stack))&&(null===this.embeddedLanguageData&&null===e.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==e.embeddedLanguageData&&this.embeddedLanguageData.equals(e.embeddedLanguageData))}}class f6{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){(this._lastTokenType!==t||this._lastTokenLanguage!==this._languageId)&&(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new rd(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){let s=i.languageId,r=i.state,o=rp.get(s);if(!o)return this.enterLanguage(s),this.emit(n,""),r;let a=o.tokenize(e,t,r);if(0!==n)for(let e of a.tokens)this._tokens.push(new rd(e.offset+n,e.type,e.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new ru(this._tokens,e)}}class f7{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){let i=1024|this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){let n=null!==e?e.length:0,s=t.length,r=null!==i?i.length:0;if(0===n&&0===s&&0===r)return new Uint32Array(0);if(0===n&&0===s)return i;if(0===s&&0===r)return e;let o=new Uint32Array(n+s+r);null!==e&&o.set(e);for(let e=0;e<s;e++)o[n+e]=t[e];return null!==i&&o.set(i,n+s),o}nestedLanguageTokenize(e,t,i,n){let s=i.languageId,r=i.state,o=rp.get(s);if(!o)return this.enterLanguage(s),this.emit(n,""),r;let a=o.tokenizeEncoded(e,t,r);if(0!==n)for(let e=0,t=a.tokens.length;e<t;e+=2)a.tokens[e]+=n;return this._prependTokens=f7._merge(this._prependTokens,this._tokens,a.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,a.endState}finalize(e){return new rc(f7._merge(this._prependTokens,this._tokens,null),e)}}let f3=i1=class extends ro.JT{constructor(e,t,i,n,s){super(),this._configurationService=s,this._languageService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=n,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let r=!1;this._register(rp.onDidChange(e=>{if(r)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i<n;i++){let n=e.changedLanguages[i];if(this._embeddedLanguages[n]){t=!0;break}}t&&(r=!0,rp.handleChange([this._languageId]),r=!1)})),this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}),this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){let e=[];for(let t in this._embeddedLanguages){let i=rp.get(t);
4if(i){if(i instanceof i1){let t=i.getLoadStatus();!1===t.loaded&&e.push(t.promise)}continue}rp.isResolved(t)||e.push(rp.getOrCreate(t))}return 0===e.length?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(e=>void 0)}}getInitialState(){let e=f1.create(null,this._lexer.start);return f5.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return fw(this._languageId,i);let n=new f6,s=this._tokenize(e,t,i,n);return n.finalize(s)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return fy(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);let n=new f7(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(e,t,i,n);return n.finalize(s)}_tokenize(e,t,i,n){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,n):this._myTokenize(e,t,i,0,n)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&!(i=fX(this._lexer,t.stack.state)))throw fJ(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,s=!1;for(let r of i){if(fG(r.action)||!("@pop"===r.action.nextEmbedded||r.action.hasEmbeddedEndInCases))continue;s=!0;let i=r.resolveRegex(t.stack.state),o=i.source;if("^(?:"===o.substr(0,4)&&")"===o.substr(o.length-1,1)){let e=(i.ignoreCase?"i":"")+(i.unicode?"u":"");i=new RegExp(o.substr(4,o.length-5),e)}let a=e.search(i);-1!==a&&(0===a||!r.matchOnlyAtLineStart)&&(-1===n||a<n)&&(n=a)}if(!s)throw fJ(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return n}_nestedTokenize(e,t,i,n,s){let r=this._findLeavingNestedLanguageOffset(e,i);if(-1===r){let r=s.nestedLanguageTokenize(e,t,i.embeddedLanguageData,n);return f5.create(i.stack,new f2(i.embeddedLanguageData.languageId,r))}let o=e.substring(0,r);o.length>0&&s.nestedLanguageTokenize(o,!1,i.embeddedLanguageData,n);let a=e.substring(r);return this._myTokenize(a,t,i,n+r,s)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,s){s.enterLanguage(this._languageId);let r=e.length,o=t&&this._lexer.includeLF?e+"\n":e,a=o.length,l=i.embeddedLanguageData,h=i.stack,d=0,u=null,c=!0;for(;c||d<a;){let i=d,m=h.depth,p=u?u.groups.length:0,_=h.state,v=null,b=null,C=null,w=null,y=null;if(u){v=u.matches;let e=u.groups.shift();b=e.matched,C=e.action,w=u.rule,0===u.groups.length&&(u=null)}else{if(!c&&d>=a)break;c=!1;let e=this._lexer.tokenizer[_];if(!e&&!(e=fX(this._lexer,_)))throw fJ(this._lexer,"tokenizer state is not defined: "+_);let t=o.substr(d);for(let i of e)if((0===d||!i.matchOnlyAtLineStart)&&(v=t.match(i.resolveRegex(_)))){b=v[0],C=i.action;break}}if(v||(v=[""],b=""),C||(d<a&&(b=(v=[o.charAt(d)])[0]),C=this._lexer.defaultToken),null===b)break;for(d+=b.length;!Array.isArray(C)&&!fG(C)&&C.test;)C=C.test(b,v,_,d===a);let S=null;if("string"==typeof C||Array.isArray(C))S=C;else if(C.group)S=C.group;else if(null!==C.token&&void 0!==C.token){if(S=C.tokenSubst?fZ(this._lexer,C.token,b,v,_):C.token,C.nextEmbedded){if("@pop"===C.nextEmbedded){if(!l)throw fJ(this._lexer,"cannot pop embedded language if not inside one");l=null}else if(l)throw fJ(this._lexer,"cannot enter embedded language from within an embedded language");else y=fZ(this._lexer,C.nextEmbedded,b,v,_)}if(C.goBack&&(d=Math.max(0,d-C.goBack)),C.switchTo&&"string"==typeof C.switchTo){let e=fZ(this._lexer,C.switchTo,b,v,_);if("@"===e[0]&&(e=e.substr(1)),fX(this._lexer,e))h=h.switchTo(e);else throw fJ(this._lexer,"trying to switch to a state '"+e+"' that is undefined in rule: "+this._safeRuleName(w))}else if(C.transform&&"function"==typeof C.transform)throw fJ(this._lexer,"action.transform not supported");else if(C.next){if("@push"===C.next){if(h.depth>=this._lexer.maxStack)throw fJ(this._lexer,"maximum tokenizer stack size reached: ["+h.state+","+h.parent.state+",...]");h=h.push(_)}else if("@pop"===C.next){if(h.depth<=1)throw fJ(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(w));h=h.pop()}else if("@popall"===C.next)h=h.popall();else{let e=fZ(this._lexer,C.next,b,v,_);if("@"===e[0]&&(e=e.substr(1)),fX(this._lexer,e))h=h.push(e);else throw fJ(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(w))}}if(C.log&&"string"==typeof C.log){var g,f;g=this._lexer,f=this._lexer.languageId+": "+fZ(this._lexer,C.log,b,v,_),console.log(`${g.languageId}: ${f}`)}}if(null===S)throw fJ(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(w));let L=i=>{let r=this._languageService.getLanguageIdByLanguageName(i)||this._languageService.getLanguageIdByMimeType(i)||i,o=this._getNestedEmbeddedLanguageData(r);if(!(d<a))return f5.create(h,o);{let i=e.substr(d);return this._nestedTokenize(i,t,f5.create(h,o),n+d,s)}};if(Array.isArray(S)){if(u&&u.groups.length>0)throw fJ(this._lexer,"groups cannot be nested: "+this._safeRuleName(w));if(v.length!==S.length+1)throw fJ(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(w));let e=0;for(let t=1;t<v.length;t++)e+=v[t].length;if(e!==b.length)throw fJ(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(w));u={rule:w,matches:v,groups:[]};for(let e=0;e<S.length;e++)u.groups[e]={action:S[e],matched:v[e+1]};d-=b.length;continue}{if("@rematch"===S&&(d-=b.length,b="",v=null,S="",null!==y))return L(y);if(0===b.length){if(0===a||m!==h.depth||_!==h.state||(u?u.groups.length:0)!==p)continue;throw fJ(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(w))}let e=null;if(fG(S)&&0===S.indexOf("@brackets")){let t=S.substr(9),i=function(e,t){if(!t)return null;for(let i of(t=fQ(e,t),e.brackets)){if(i.open===t)return{token:i.token,bracketType:1};if(i.close===t)return{token:i.token,bracketType:-1}}return null}(this._lexer,b);if(!i)throw fJ(this._lexer,"@brackets token returned but no bracket defined as: "+b);e=fY(i.token+t)}else e=fY(""===S?"":S+this._lexer.tokenPostfix);i<r&&s.emit(i+n,e)}if(null!==y)return L(y)}return f5.create(h,l)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new f2(e,fC);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),rp.getOrCreate(e),this._embeddedLanguages[e]=!0);let t=rp.get(e);return t?new f2(e,t.getInitialState()):new f2(e,fC)}};f3=i1=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){uE(e,t,4)}],f3);let f9=ut("standaloneColorizer",{createHTML:e=>e});class f8{static colorizeElement(e,t,i,n){let s=(n=n||{}).theme||"vs",r=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();let o=t.getLanguageIdByMimeType(r)||r;e.setTheme(s);let a=i.firstChild?i.firstChild.nodeValue:"";return i.className+=" "+s,this.colorize(t,a||"",o,n).then(e=>{let t=f9?.createHTML(e)??e;i.innerHTML=t},e=>console.error(e))}static async colorize(e,t,i,n){var s;let r=e.languageIdCodec,o=4;
4n&&"number"==typeof n.tabSize&&(o=n.tabSize),r9(t)&&(t=t.substr(1));let a=rI(t);if(!e.isRegisteredLanguageId(i))return me(a,o,r);let l=await rp.getOrCreate(i);return l?(s=o,new Promise((e,t)=>{let i=()=>{let n=function(e,t,i,n){let s=[],r=i.getInitialState();for(let o=0,a=e.length;o<a;o++){let a=e[o],l=i.tokenizeEncoded(a,!0,r);fL.convertToEndOffset(l.tokens,a.length);let h=new fL(l.tokens,a,n),d=fj.isBasicASCII(a,!0),u=fj.containsRTL(a,d,!0),c=fW(new fA(!1,!0,a,!1,d,u,0,h.inflate(),[],t,0,0,0,0,-1,"none",!1,!1,null,null,0));(s=s.concat(c.html)).push("<br/>"),r=l.endState}return s.join("")}(a,s,l,r);if(l instanceof f3){let e=l.getLoadStatus();if(!1===e.loaded){e.promise.then(i,t);return}}e(n)};i()})):me(a,o,r)}static colorizeLine(e,t,i,n,s=4){let r=fj.isBasicASCII(e,t),o=fj.containsRTL(e,r,i);return fW(new fA(!1,!0,e,!1,r,o,0,n,[],s,0,0,0,0,-1,"none",!1,!1,null,null,0)).html}static colorizeModelLine(e,t,i=4){let n=e.getLineContent(t);e.tokenization.forceTokenization(t);let s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,i)}}function me(e,t,i){let n=[],s=new Uint32Array(2);s[0]=0,s[1]=33587200;for(let r=0,o=e.length;r<o;r++){let o=e[r];s[0]=o.length;let a=new fL(s,o,i),l=fj.isBasicASCII(o,!0),h=fj.containsRTL(o,l,!0),d=fW(new fA(!1,!0,o,!1,l,h,0,a,[],t,0,0,0,0,-1,"none",!1,!1,null,null,0));(n=n.concat(d.html)).push("<br/>")}return n.join("")}function mt(e){_&&(v.textContent!==e?(a5(b),mn(v,e)):(a5(v),mn(b,e)))}function mi(e){_&&(C.textContent!==e?(a5(w),mn(C,e)):(a5(C),mn(w,e)))}function mn(e,t){a5(e),t.length>2e4&&(t=t.substr(0,2e4)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}i(55893);let ms=ht("markerDecorationsService"),mr=class{static{this.ID="editor.contrib.markerDecorations"}constructor(e,t){}dispose(){}};dq((mr=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){ms(e,t,1)}],mr)).ID,mr,0),i(49378);class mo extends ro.JT{constructor(e,t){super(),this._onDidChange=this._register(new sd.Q5),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null,t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()},i=!1,n=!1,s=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{u(aG(this._referenceDomElement),()=>{n=!1,s()})}};this._resizeObserver=new ResizeObserver(t=>{e=t&&t[0]&&t[0].contentRect?{width:t[0].contentRect.width,height:t[0].contentRect.height}:null,i=!0,s()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,n=0;t?(i=t.width,n=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,n=this._referenceDomElement.clientHeight),i=Math.max(5,i),n=Math.max(5,n),(this._width!==i||this._height!==n)&&(this._width=i,this._height=n,e&&this._onDidChange.fire())}}class ma{static{this.items=[]}constructor(e,t){this.key=e,this.migrate=t}apply(e){let t=ma._read(e,this.key);this.migrate(t,t=>ma._read(e,t),(t,i)=>ma._write(e,t,i))}static _read(e,t){if(null==e)return;let i=t.indexOf(".");if(i>=0){let n=t.substring(0,i);return this._read(e[n],t.substring(i+1))}return e[t]}static _write(e,t,i){let n=t.indexOf(".");if(n>=0){let s=t.substring(0,n);e[s]=e[s]||{},this._write(e[s],t.substring(n+1),i);return}e[t]=i}}function ml(e,t){ma.items.push(new ma(e,t))}function mh(e,t){ml(e,(i,n,s)=>{if(void 0!==i){for(let[n,r]of t)if(i===n){s(e,r);return}}})}mh("wordWrap",[[!0,"on"],[!1,"off"]]),mh("lineNumbers",[[!0,"on"],[!1,"off"]]),mh("cursorBlinking",[["visible","solid"]]),mh("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),mh("renderLineHighlight",[[!0,"line"],[!1,"none"]]),mh("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),mh("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),mh("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),mh("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),mh("autoIndent",[[!1,"advanced"],[!0,"full"]]),mh("matchBrackets",[[!0,"always"],[!1,"never"]]),mh("renderFinalNewline",[[!0,"on"],[!1,"off"]]),mh("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]),mh("occurrencesHighlight",[[!0,"singleFile"],[!1,"off"]]),mh("wordBasedSuggestions",[[!0,"matchingDocuments"],[!1,"off"]]),mh("defaultColorDecorators",[[!0,"auto"],[!1,"never"]]),mh("minimap.autohide",[[!0,"mouseover"],[!1,"none"]]),ml("autoClosingBrackets",(e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),void 0===t("autoClosingQuotes")&&i("autoClosingQuotes","never"),void 0===t("autoSurround")&&i("autoSurround","never"))}),ml("renderIndentGuides",(e,t,i)=>{void 0!==e&&(i("renderIndentGuides",void 0),void 0===t("guides.indentation")&&i("guides.indentation",!!e))}),ml("highlightActiveIndentGuide",(e,t,i)=>{void 0!==e&&(i("highlightActiveIndentGuide",void 0),void 0===t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))});let md={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};ml("suggest.filteredTypes",(e,t,i)=>{if(e&&"object"==typeof e){for(let n of Object.entries(md))!1===e[n[0]]&&void 0===t(`suggest.${n[1]}`)&&i(`suggest.${n[1]}`,!1);i("suggest.filteredTypes",void 0)}}),ml("quickSuggestions",(e,t,i)=>{if("boolean"==typeof e){let t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}}),ml("experimental.stickyScroll.enabled",(e,t,i)=>{"boolean"==typeof e&&(i("experimental.stickyScroll.enabled",void 0),void 0===t("stickyScroll.enabled")&&i("stickyScroll.enabled",e))}),ml("experimental.stickyScroll.maxLineCount",(e,t,i)=>{"number"==typeof e&&(i("experimental.stickyScroll.maxLineCount",void 0),void 0===t("stickyScroll.maxLineCount")&&i("stickyScroll.maxLineCount",e))}),ml("editor.experimentalEditContextEnabled",(e,t,i)=>{"boolean"==typeof e&&(i("editor.experimentalEditContextEnabled",void 0),void 0===t("editor.editContext")&&i("editor.editContext",e))}),ml("codeActionsOnSave",(e,t,i)=>{if(e&&"object"==typeof e){let t=!1,n={};for(let i of Object.entries(e))"boolean"==typeof i[1]?(t=!0,n[i[0]]=i[1]?"explicit":"never"):n[i[0]]=i[1];t&&i("codeActionsOnSave",n)}}),ml("codeActionWidget.includeNearbyQuickfixes",(e,t,i)=>{"boolean"==typeof e&&(i("codeActionWidget.includeNearbyQuickfixes",void 0),void 0===t("codeActionWidget.includeNearbyQuickFixes")&&i("codeActionWidget.includeNearbyQuickFixes",e))}),ml("lightbulb.enabled",(e,t,i)=>{"boolean"==typeof e&&i("lightbulb.enabled",e?void 0:"off")}),ml("inlineSuggest.edits.codeShifting",(e,t,i)=>{"boolean"==typeof e&&(i("inlineSuggest.edits.codeShifting",void 0),i("inlineSuggest.edits.allowCodeShifting",e?"always":"never"))});class mu{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new sd.Q5,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}let mc=new mu,mg=ht("accessibilityService"),mf=new hJ("accessibilityModeEnabled",!1);class mm{constructor(){this._inputMode="insert",this._onDidChangeInputMode=new sd.Q5,this.onDidChangeInputMode=this._onDidChangeInputMode.event}getInputMode(){return this._inputMode}}let mp=new mm,m_=class extends ro.JT{constructor(e,t,i,n,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new sd.Q5),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new sd.Q5),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new sh.LJ,this.isSimpleWidget=e,this.contextMenuId=t,this._containerObserver=this._register(new mo(n,i.dimension)),this._targetWindowId=aG(n).vscodeWindowId,this._rawOptions=mw(i),this._val
4idatedOptions=mC.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(19)&&this._containerObserver.startObserving(),this._register(fv.C.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(mc.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(l8.onDidChange(()=>this._recomputeOptions())),this._register(lX.getInstance(aG(n)).onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions())),this._register(mp.onDidChangeInputMode(()=>this._recomputeOptions()))}_recomputeOptions(){let e=this._computeOptions(),t=mC.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){let e=this._readEnvConfiguration(),t=function(e,t,i){let n=e.get(58),s=e.get(62),r=e.get(61),o=e.get(60),a=e.get(63),l=e.get(75),h=e.get(72);return l7.E4._create(n,s,r,o,a,l,h,t,i)}(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),n={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:this._validatedOptions.get(164)||mc.getTabFocusMode(),inputMode:mp.getInputMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount,editContextSupported:e.editContextSupported};return mC.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){let e;return{extraEditorClassName:(e="",ou||oc?e+="no-minimap-shadow enable-user-select ":e+="no-user-select ",sS.dz&&(e+="mac "),e),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:oh||ol,pixelRatio:lX.getInstance(aX(this._targetWindowId,!0).window).value,editContextSupported:"function"==typeof globalThis.EditContext,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return l8.readFontInfo(aX(this._targetWindowId,!0).window,e)}getRawOptions(){return this._rawOptions}updateOptions(e){let t=mw(e);mC.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=mC.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){let t=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};m_=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){mg(e,t,4)}],m_);class mv{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class mb{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class mC{static validateOptions(e){let t=new mv;for(let i of sh.Bc){let n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){let i=new mb;for(let n of sh.Bc)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!!(Array.isArray(e)&&Array.isArray(t))&&(0,as.fS)(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(!mC._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){let i=[],n=!1;for(let s of sh.Bc){let r=!mC._deepEquals(e._read(s.id),t._read(s.id));i[s.id]=r,r&&(n=!0)}return n?new sh.Bb(i):null}static applyUpdate(e,t){let i=!1;for(let n of sh.Bc)if(t.hasOwnProperty(n.name)){let s=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=s.newValue,i=i||s.didChange}return i}}function mw(e){let t=(0,cI.I8)(e);
4return ma.items.forEach(e=>e.apply(t)),t}!function(e){let t={total:0,min:Number.MAX_VALUE,max:0},i={...t},n={...t},s={...t},r=0,o={keydown:0,input:0,render:0};function a(){1===o.keydown&&(performance.mark("keydown/end"),o.keydown=2)}function l(){performance.mark("input/start"),o.input=1,u()}function h(){1===o.input&&(performance.mark("input/end"),o.input=2)}function d(){1===o.render&&(performance.mark("render/end"),o.render=2)}function u(){setTimeout(c)}function c(){2===o.keydown&&2===o.input&&2===o.render&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),g("keydown",t),g("input",i),g("render",n),g("inputlatency",s),r++,performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),o.keydown=0,o.input=0,o.render=0)}function g(e,t){let i=performance.getEntriesByName(e)[0].duration;t.total+=i,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}function f(e){return{average:e.total/r,max:e.max,min:e.min}}function m(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}e.onKeyDown=function(){c(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),o.keydown=1,queueMicrotask(a)},e.onBeforeInput=l,e.onInput=function(){0===o.input&&l(),queueMicrotask(h)},e.onKeyUp=function(){c()},e.onSelectionChange=function(){c()},e.onRenderStart=function(){2===o.keydown&&2===o.input&&0===o.render&&(performance.mark("render/start"),o.render=1,queueMicrotask(d),u())},e.getAndClearMeasurements=function(){if(0===r)return;let e={keydown:f(t),input:f(i),render:f(n),total:f(s),sampleCount:r};return m(t),m(i),m(n),m(s),r=0,e}}(i0||(i0={}));let my=new Map;function mS(e=rb.document.head,t,i){let n=document.createElement("style");if(n.type="text/css",n.media="screen",t?.(n),e.appendChild(n),i&&i.add((0,ro.OF)(()=>n.remove())),e===rb.document.head){let e=new Set;for(let{window:t,disposables:s}of(my.set(n,e),i&&i.add((0,ro.OF)(()=>my.delete(n))),aY())){if(t===rb)continue;let r=s.add(function(e,t,i){let n=new ro.SL,s=e.cloneNode(!0);for(let t of(i.document.head.appendChild(s),n.add((0,ro.OF)(()=>s.remove())),e?.sheet?.rules?e.sheet.rules:e?.sheet?.cssRules?e.sheet.cssRules:[]))s.sheet?.insertRule(t.cssText,s.sheet?.cssRules.length);return n.add(lp.observe(e,n,{childList:!0,subtree:ol,characterData:ol})(()=>{s.textContent=e.textContent})),t.add(s),n.add((0,ro.OF)(()=>t.delete(s))),n}(n,e,t));i?.add(r)}}return n}let mL=null;function mx(e,t,i=(mL||(mL=mS()),mL)){if(i&&t)for(let n of(i.sheet?.insertRule(`${e} {${t}}`,0),my.get(i)??[]))mx(e,t,n)}class mk{constructor(){this._hooks=new ro.SL,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=s;let r=e;try{e.setPointerCapture(t),this._hooks.add((0,ro.OF)(()=>{try{e.releasePointerCapture(t)}catch(e){}}))}catch(t){r=aG(e)}this._hooks.add(a6(r,ly.POINTER_MOVE,e=>{if(e.buttons!==i){this.stopMonitoring(!0);return}e.preventDefault(),this._pointerMoveCallback(e)})),this._hooks.add(a6(r,ly.POINTER_UP,e=>this.stopMonitoring(!0)))}}function mN(e){return`--vscode-${e.replace(/\./g,"-")}`}function mD(e){return`var(${mN(e)})`}let mE="base.contributions.colors";class mT extends ro.JT{constructor(){super(),this._onDidChangeSchema=this._register(new sd.Q5),this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,s){this.colorsById[e]={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:s};let r={type:"string",format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return s&&(r.deprecationMessage=s),n&&(r.pattern="^#(?:(?<rgba>[0-9a-fA-f]{3}[0-9a-eA-E])|(?:[0-9a-fA-F]{6}(?:(?![fF]{2})(?:[0-9a-fA-F]{2}))))?$",r.patternErrorMessage=(0,rh.NC)(2022,"This color must be transparent or it will obscure content")),this.colorSchema.properties[e]={description:i,oneOf:[r,{type:"string",const:"default",description:(0,rh.NC)(2023,"Use the default color.")}]},this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){let i=this.colorsById[e];if(i?.defaults){var n;return function e(t,i){if(null===t);else if("string"==typeof t)return"#"===t[0]?gX.fromHex(t):i.getColor(t);else if(t instanceof gX)return t;else if("object"==typeof t)return function(t,i){switch(t.op){case 0:return e(t.value,i)?.darken(t.factor);case 1:return e(t.value,i)?.lighten(t.factor);
4case 2:return e(t.value,i)?.transparent(t.factor);case 7:{let n=e(t.color,i)||gX.transparent,s=e(t.with,i)||gX.transparent;return n.mix(s,t.ratio)}case 3:{let n=e(t.background,i);if(!n)return e(t.value,i);return e(t.value,i)?.makeOpaque(n)}case 4:for(let n of t.values){let t=e(n,i);if(t)return t}return;case 6:return e(i.defines(t.if)?t.then:t.else,i);case 5:{let n=e(t.value,i);if(!n)return;let s=e(t.background,i);if(!s)return n.transparent(t.factor*t.transparency);return n.isDarkerThan(s)?gX.getLighterColor(n,s,t.factor).transparent(t.transparency):gX.getDarkerColor(n,s,t.factor).transparent(t.transparency)}default:throw(0,ab.vE)()}}(t,i)}(null!==(n=i.defaults)&&"object"==typeof n&&"light"in n&&"dark"in n?i.defaults[t.type]:i.defaults,t)}}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort((e,t)=>{let i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)}).map(e=>`- \`${e}\`: ${this.colorsById[e].description}`).join("\n")}}let mI=new mT;function mM(e,t,i,n,s){return mI.registerColor(e,t,i,n,s)}function mR(e,t){return{op:0,value:e,factor:t}}function mA(e,t){return{op:1,value:e,factor:t}}function mO(e,t){return{op:2,value:e,factor:t}}function mP(...e){return{op:4,values:e}}function mF(e,t,i,n){return{op:5,value:e,background:t,factor:i,transparency:n}}h5.add(mE,mI);let mB="vscode://schemas/workbench-colors",mV=h5.as(uB);mV.registerSchema(mB,mI.getColorSchema());let mW=new oK(()=>mV.notifySchemaChanged(mB),200);mI.onDidChangeSchema(()=>{mW.isScheduled()||mW.schedule()});let mH=mM("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},(0,rh.NC)(1773,"Overall foreground color. This color is only used if not overridden by a component."));mM("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},(0,rh.NC)(1774,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),mM("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},(0,rh.NC)(1775,"Overall foreground color for error messages. This color is only used if not overridden by a component.")),mM("descriptionForeground",{light:"#717171",dark:mO(mH,.7),hcDark:mO(mH,.7),hcLight:mO(mH,.7)},(0,rh.NC)(1776,"Foreground color for description text providing additional information, for example for a label."));let mz=mM("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},(0,rh.NC)(1777,"The default color for icons in the workbench.")),mU=mM("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},(0,rh.NC)(1778,"Overall border color for focused elements. This color is only used if not overridden by a component.")),mK=mM("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},(0,rh.NC)(1779,"An extra border around elements to separate them from others for greater contrast.")),m$=mM("contrastActiveBorder",{light:null,dark:null,hcDark:mU,hcLight:mU},(0,rh.NC)(1780,"An extra border around active elements to separate them from others for greater contrast."));mM("selection.background",null,(0,rh.NC)(1781,"The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));let mj=mM("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},(0,rh.NC)(1782,"Foreground color for links in text."));mM("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#21A6FF",hcLight:"#0F4A85"},(0,rh.NC)(1783,"Foreground color for links in text when clicked on and on mouse hover.")),mM("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:gX.black,hcLight:"#292929"},(0,rh.NC)(1784,"Color for text separators.")),mM("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#000000",hcLight:"#FFFFFF"},(0,rh.NC)(1785,"Foreground color for preformatted text segments.")),mM("textPreformat.background",{light:"#0000001A",dark:"#FFFFFF1A",hcDark:"#FFFFFF",hcLight:"#09345f"}
4,(0,rh.NC)(1786,"Background color for preformatted text segments.")),mM("textBlockQuote.background",{light:"#f2f2f2",dark:"#222222",hcDark:null,hcLight:"#F2F2F2"},(0,rh.NC)(1787,"Background color for block quotes in text.")),mM("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:gX.white,hcLight:"#292929"},(0,rh.NC)(1788,"Border color for block quotes in text.")),mM("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:gX.black,hcLight:"#F2F2F2"},(0,rh.NC)(1789,"Background color for code blocks in text.")),mM("sash.hoverBorder",mU,(0,rh.NC)(1994,"Border color of active sashes."));let mq=mM("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:gX.black,hcLight:"#0F4A85"},(0,rh.NC)(1995,"Badge background color. Badges are small information labels, e.g. for search results count.")),mG=mM("badge.foreground",{dark:gX.white,light:"#333",hcDark:gX.white,hcLight:gX.white},(0,rh.NC)(1996,"Badge foreground color. Badges are small information labels, e.g. for search results count."));mM("activityWarningBadge.foreground",{dark:gX.black.lighten(.2),light:gX.white,hcDark:null,hcLight:gX.black.lighten(.2)},(0,rh.NC)(1997,"Foreground color of the warning activity badge")),mM("activityWarningBadge.background",{dark:"#CCA700",light:"#BF8803",hcDark:null,hcLight:"#CCA700"},(0,rh.NC)(1998,"Background color of the warning activity badge")),mM("activityErrorBadge.foreground",{dark:gX.black.lighten(.2),light:gX.white,hcDark:null,hcLight:gX.black.lighten(.2)},(0,rh.NC)(1999,"Foreground color of the error activity badge")),mM("activityErrorBadge.background",{dark:"#F14C4C",light:"#E51400",hcDark:null,hcLight:"#F14C4C"},(0,rh.NC)(2e3,"Background color of the error activity badge"));let mQ=mM("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},(0,rh.NC)(2001,"Scrollbar shadow to indicate that the view is scrolled.")),mY=mM("scrollbarSlider.background",{dark:gX.fromHex("#797979").transparent(.4),light:gX.fromHex("#646464").transparent(.4),hcDark:mO(mK,.6),hcLight:mO(mK,.4)},(0,rh.NC)(2002,"Scrollbar slider background color.")),mJ=mM("scrollbarSlider.hoverBackground",{dark:gX.fromHex("#646464").transparent(.7),light:gX.fromHex("#646464").transparent(.7),hcDark:mO(mK,.8),hcLight:mO(mK,.8)},(0,rh.NC)(2003,"Scrollbar slider background color when hovering.")),mZ=mM("scrollbarSlider.activeBackground",{dark:gX.fromHex("#BFBFBF").transparent(.4),light:gX.fromHex("#000000").transparent(.6),hcDark:mK,hcLight:mK},(0,rh.NC)(2004,"Scrollbar slider background color when clicked on."));mM("scrollbar.background",null,(0,rh.NC)(2005,"Scrollbar track background color."));let mX=mM("progressBar.background",{dark:gX.fromHex("#0E70C0"),light:gX.fromHex("#0E70C0"),hcDark:mK,hcLight:mK},(0,rh.NC)(2006,"Background color of the progress bar that can show for long running operations."));mM("chart.line",{dark:"#236B8E",light:"#236B8E",hcDark:"#236B8E",hcLight:"#236B8E"},(0,rh.NC)(2007,"Line color for the chart.")),mM("chart.axis",{dark:gX.fromHex("#BFBFBF").transparent(.4),light:gX.fromHex("#000000").transparent(.6),hcDark:mK,hcLight:mK},(0,rh.NC)(2008,"Axis color for the chart.")),mM("chart.guide",{dark:gX.fromHex("#BFBFBF").transparent(.2),light:gX.fromHex("#000000").transparent(.2),hcDark:mK,hcLight:mK},(0,rh.NC)(2009,"Guide line for the chart."));let m1=mM("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:gX.black,hcLight:gX.white},(0,rh.NC)(1798,"Editor background color.")),m0=mM("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:gX.white,hcLight:mH},(0,rh.NC)(1799,"Editor default foreground color."));mM("editorStickyScroll.background",m1,(0,rh.NC)(1800,"Background color of sticky scroll in the editor")),mM("editorStickyScrollGutter.background",m1,(0,rh.NC)(1801,"Background color of the gutter part of sticky scroll in the editor")),mM("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:gX.fromHex("#0F4A85").transparent(.1)},(0,rh.NC)(1802,"Background color of sticky scroll on hover in the editor")),mM("editorStickyScroll.border",{dark:null,light:null,hcDark:mK,hcLight:mK}
4,(0,rh.NC)(1803,"Border color of sticky scroll in the editor")),mM("editorStickyScroll.shadow",mQ,(0,rh.NC)(1804," Shadow color of sticky scroll in the editor"));let m2=mM("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:gX.white},(0,rh.NC)(1805,"Background color of editor widgets, such as find/replace.")),m5=mM("editorWidget.foreground",mH,(0,rh.NC)(1806,"Foreground color of editor widgets, such as find/replace.")),m4=mM("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:mK,hcLight:mK},(0,rh.NC)(1807,"Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget."));mM("editorWidget.resizeBorder",null,(0,rh.NC)(1808,"Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),mM("editorError.background",null,(0,rh.NC)(1809,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);let m6=mM("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},(0,rh.NC)(1810,"Foreground color of error squigglies in the editor."));mM("editorError.border",{dark:null,light:null,hcDark:gX.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},(0,rh.NC)(1811,"If set, color of double underlines for errors in the editor."));let m7=mM("editorWarning.background",null,(0,rh.NC)(1812,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),m3=mM("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},(0,rh.NC)(1813,"Foreground color of warning squigglies in the editor.")),m9=mM("editorWarning.border",{dark:null,light:null,hcDark:gX.fromHex("#FFCC00").transparent(.8),hcLight:gX.fromHex("#FFCC00").transparent(.8)},(0,rh.NC)(1814,"If set, color of double underlines for warnings in the editor."));mM("editorInfo.background",null,(0,rh.NC)(1815,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);let m8=mM("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},(0,rh.NC)(1816,"Foreground color of info squigglies in the editor.")),pe=mM("editorInfo.border",{dark:null,light:null,hcDark:gX.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},(0,rh.NC)(1817,"If set, color of double underlines for infos in the editor.")),pt=mM("editorHint.foreground",{dark:gX.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},(0,rh.NC)(1818,"Foreground color of hint squigglies in the editor."));mM("editorHint.border",{dark:null,light:null,hcDark:gX.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},(0,rh.NC)(1819,"If set, color of double underlines for hints in the editor.")),mM("editorLink.activeForeground",{dark:"#4E94CE",light:gX.blue,hcDark:gX.cyan,hcLight:"#292929"},(0,rh.NC)(1820,"Color of active links."));let pi=mM("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},(0,rh.NC)(1821,"Color of the editor selection.")),pn=mM("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:gX.white},(0,rh.NC)(1822,"Color of the selected text for high contrast.")),ps=mM("editor.inactiveSelectionBackground",{light:mO(pi,.5),dark:mO(pi,.5),hcDark:mO(pi,.7),hcLight:mO(pi,.5)},(0,rh.NC)(1823,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),pr=mM("editor.selectionHighlightBackgroun
4d",{light:mF(pi,m1,.3,.6),dark:mF(pi,m1,.3,.6),hcDark:null,hcLight:null},(0,rh.NC)(1824,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);mM("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:m$,hcLight:m$},(0,rh.NC)(1825,"Border color for regions with the same content as the selection.")),mM("editor.compositionBorder",{light:"#000000",dark:"#ffffff",hcLight:"#000000",hcDark:"#ffffff"},(0,rh.NC)(1826,"The border color for an IME composition.")),mM("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},(0,rh.NC)(1827,"Color of the current search match.")),mM("editor.findMatchForeground",null,(0,rh.NC)(1828,"Text color of the current search match."));let po=mM("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},(0,rh.NC)(1829,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0);mM("editor.findMatchHighlightForeground",null,(0,rh.NC)(1830,"Foreground color of the other search matches."),!0),mM("editor.findRangeHighlightBackgroun
4d",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},(0,rh.NC)(1831,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),mM("editor.findMatchBorder",{light:null,dark:null,hcDark:m$,hcLight:m$},(0,rh.NC)(1832,"Border color of the current search match."));let pa=mM("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:m$,hcLight:m$},(0,rh.NC)(1833,"Border color of the other search matches."));mM("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:mO(m$,.4),hcLight:mO(m$,.4)},(0,rh.NC)(1834,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),mM("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},(0,rh.NC)(1835,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);let pl=mM("editorHoverWidget.background",m2,(0,rh.NC)(1836,"Background color of the editor hover."));mM("editorHoverWidget.foreground",m5,(0,rh.NC)(1837,"Foreground color of the editor hover."));let ph=mM("editorHoverWidget.border",m4,(0,rh.NC)(1838,"Border color of the editor hover."));
4mM("editorHoverWidget.statusBarBackground",{dark:mA(pl,.2),light:mR(pl,.05),hcDark:m2,hcLight:m2},(0,rh.NC)(1839,"Background color of the editor hover status bar."));let pd=mM("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:gX.white,hcLight:gX.black},(0,rh.NC)(1840,"Foreground color of inline hints")),pu=mM("editorInlayHint.background",{dark:mO(mq,.1),light:mO(mq,.1),hcDark:mO(gX.white,.1),hcLight:mO(mq,.1)},(0,rh.NC)(1841,"Background color of inline hints"));mM("editorInlayHint.typeForeground",pd,(0,rh.NC)(1842,"Foreground color of inline hints for types")),mM("editorInlayHint.typeBackground",pu,(0,rh.NC)(1843,"Background color of inline hints for types")),mM("editorInlayHint.parameterForeground",pd,(0,rh.NC)(1844,"Foreground color of inline hints for parameters")),mM("editorInlayHint.parameterBackground",pu,(0,rh.NC)(1845,"Background color of inline hints for parameters"));let pc=mM("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},(0,rh.NC)(1846,"The color used for the lightbulb actions icon."));mM("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},(0,rh.NC)(1847,"The color used for the lightbulb auto fix actions icon.")),mM("editorLightBulbAi.foreground",pc,(0,rh.NC)(1848,"The color used for the lightbulb AI icon.")),mM("editor.snippetTabstopHighlightBackgroun
4d",{dark:new gX(new gY(124,124,124,.3)),light:new gX(new gY(10,50,100,.2)),hcDark:new gX(new gY(124,124,124,.3)),hcLight:new gX(new gY(10,50,100,.2))},(0,rh.NC)(1849,"Highlight background color of a snippet tabstop.")),mM("editor.snippetTabstopHighlightBorder",null,(0,rh.NC)(1850,"Highlight border color of a snippet tabstop.")),mM("editor.snippetFinalTabstopHighlightBackground",null,(0,rh.NC)(1851,"Highlight background color of the final tabstop of a snippet.")),mM("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new gX(new gY(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},(0,rh.NC)(1852,"Highlight border color of the final tabstop of a snippet."));let pg=new gX(new gY(155,185,85,.2)),pf=new gX(new gY(255,0,0,.2)),pm=mM("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},(0,rh.NC)(1853,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),pp=mM("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},(0,rh.NC)(1854,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);mM("diffEditor.insertedLineBackground",{dark:pg,light:pg,hcDark:null,hcLight:null},(0,rh.NC)(1855,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),mM("diffEditor.removedLineBackground",{dark:pf,light:pf,hcDark:null,hcLight:null},(0,rh.NC)(1856,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),mM("diffEditorGutter.insertedLineBackground",null,(0,rh.NC)(1857,"Background color for the margin where lines got inserted.")),mM("diffEditorGutter.removedLineBackground",null,(0,rh.NC)(1858,"Background color for the margin where lines got removed."));let p_=mM("diffEditorOverview.insertedForeground",null,(0,rh.NC)(1859,"Diff overview ruler foreground for inserted content.")),pv=mM("diffEditorOverview.removedForeground",null,(0,rh.NC)(1860,"Diff overview ruler foreground for removed content."));mM("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"}
4,(0,rh.NC)(1861,"Outline color for the text that got inserted.")),mM("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},(0,rh.NC)(1862,"Outline color for text that got removed.")),mM("diffEditor.border",{dark:null,light:null,hcDark:mK,hcLight:mK},(0,rh.NC)(1863,"Border color between the two text editors.")),mM("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},(0,rh.NC)(1864,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),mM("diffEditor.unchangedRegionBackground","sideBar.background",(0,rh.NC)(1865,"The background color of unchanged blocks in the diff editor.")),mM("diffEditor.unchangedRegionForeground","foreground",(0,rh.NC)(1866,"The foreground color of unchanged blocks in the diff editor.")),mM("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},(0,rh.NC)(1867,"The background color of unchanged code in the diff editor."));let pb=mM("widget.shadow",{dark:mO(gX.black,.36),light:mO(gX.black,.16),hcDark:null,hcLight:null},(0,rh.NC)(1868,"Shadow color of widgets such as find/replace inside the editor.")),pC=mM("widget.border",{dark:null,light:null,hcDark:mK,hcLight:mK},(0,rh.NC)(1869,"Border color of widgets such as find/replace inside the editor.")),pw=mM("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},(0,rh.NC)(1870,"Toolbar background when hovering over actions using the mouse"));mM("toolbar.hoverOutline",{dark:null,light:null,hcDark:m$,hcLight:m$},(0,rh.NC)(1871,"Toolbar outline when hovering over actions using the mouse")),mM("toolbar.activeBackground",{dark:mA(pw,.1),light:mR(pw,.1),hcDark:null,hcLight:null},(0,rh.NC)(1872,"Toolbar background when holding the mouse over actions"));let py=mM("breadcrumb.foreground",mO(mH,.8),(0,rh.NC)(1873,"Color of focused breadcrumb items.")),pS=mM("breadcrumb.background",m1,(0,rh.NC)(1874,"Background color of breadcrumb items.")),pL=mM("breadcrumb.focusForeground",{light:mR(mH,.2),dark:mA(mH,.1),hcDark:mA(mH,.1),hcLight:mA(mH,.1)},(0,rh.NC)(1875,"Color of focused breadcrumb items.")),px=mM("breadcrumb.activeSelectionForeground",{light:mR(mH,.2),dark:mA(mH,.1),hcDark:mA(mH,.1),hcLight:mA(mH,.1)},(0,rh.NC)(1876,"Color of selected breadcrumb items."));mM("breadcrumbPicker.background",m2,(0,rh.NC)(1877,"Background color of breadcrumb item picker."));let pk=gX.fromHex("#40C8AE").transparent(.5),pN=gX.fromHex("#40A6FF").transparent(.5),pD=gX.fromHex("#606060").transparent(.4),pE=mM("merge.currentHeaderBackground",{dark:pk,light:pk,hcDark:null,hcLight:null},(0,rh.NC)(1878,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);mM("merge.currentContentBackground",mO(pE,.4),(0,rh.NC)(1879,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);let pT=mM("merge.incomingHeaderBackground",{dark:pN,light:pN,hcDark:null,hcLight:null},(0,rh.NC)(1880,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);mM("merge.incomingContentBackground",mO(pT,.4),(0,rh.NC)(1881,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);let pI=mM("merge.commonHeaderBackground",{dark:pD,light:pD,hcDark:null,hcLight:null},(0,rh.NC)(1882,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);mM("merge.commonContentBackground",mO(pI,.4),(0,rh.NC)(1883,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);let pM=mM("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},(0,rh.NC)(1884,"Border color on headers and the splitter in inline merge-conflicts."));mM("editorOverviewRuler.currentContentForeground",{dark:mO(pE,1),light:mO(pE,1),hcDark:pM,hcLight:pM},(0,rh.NC)(1885,"Current overview ruler foreground for inline merge-conflicts.")),mM("editorOverviewRuler.incomingContentForeground",{dark:mO(pT,1),light:mO(pT,1),hcDark:pM,hcLight:pM},(0,rh.NC)(1886,"Incoming overview ruler foreground for inline merge-conflicts.")),mM("editorOverviewRuler.commonContentForeground",{dark:mO(pI,1),light:mO(pI,1),hcDark:pM,hcLight:pM},(0,rh.NC)(1887,"Common ancestor overview ruler foreground for inline merge-conflicts.")),mM("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:"#AB5A00"},(0,rh.NC)(1888,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),mM("editorOverviewRuler.selectionHighlightForeground","#A0A0A0CC",(0,rh.NC)(1889,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0);let pR=mM("problemsErrorIcon.foreground",m6,(0,rh.NC)(1890,"The color used for the problems error icon.")),pA=mM("problemsWarningIcon.foreground",m3,(0,rh.NC)(1891,"The color used for the problems warning icon.")),pO=mM("problemsInfoIcon.foreground",m8,(0,rh.NC)(1892,"The color used for the problems info icon.")),pP=mM("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},(0,rh.NC)(1983,"Minimap marker color for find matches."),!0);
4mM("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},(0,rh.NC)(1984,"Minimap marker color for repeating editor selections."),!0);let pF=mM("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},(0,rh.NC)(1985,"Minimap marker color for the editor selection."),!0),pB=mM("minimap.infoHighlight",{dark:m8,light:m8,hcDark:pe,hcLight:pe},(0,rh.NC)(1986,"Minimap marker color for infos.")),pV=mM("minimap.warningHighlight",{dark:m3,light:m3,hcDark:m9,hcLight:m9},(0,rh.NC)(1987,"Minimap marker color for warnings.")),pW=mM("minimap.errorHighlight",{dark:new gX(new gY(255,18,18,.7)),light:new gX(new gY(255,18,18,.7)),hcDark:new gX(new gY(255,50,50,1)),hcLight:"#B5200D"},(0,rh.NC)(1988,"Minimap marker color for errors.")),pH=mM("minimap.background",null,(0,rh.NC)(1989,"Minimap background color.")),pz=mM("minimap.foregroundOpacity",gX.fromHex("#000f"),(0,rh.NC)(1990,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));mM("minimapSlider.background",mO(mY,.5),(0,rh.NC)(1991,"Minimap slider background color.")),mM("minimapSlider.hoverBackground",mO(mJ,.5),(0,rh.NC)(1992,"Minimap slider background color when hovering.")),mM("minimapSlider.activeBackground",mO(mZ,.5),(0,rh.NC)(1993,"Minimap slider background color when clicked on.")),mM("charts.foreground",mH,(0,rh.NC)(1790,"The foreground color used in charts.")),mM("charts.lines",mO(mH,.5),(0,rh.NC)(1791,"The color used for horizontal lines in charts.")),mM("charts.red",m6,(0,rh.NC)(1792,"The red color used in chart visualizations.")),mM("charts.blue",m8,(0,rh.NC)(1793,"The blue color used in chart visualizations.")),mM("charts.yellow",m3,(0,rh.NC)(1794,"The yellow color used in chart visualizations.")),mM("charts.orange",pP,(0,rh.NC)(1795,"The orange color used in chart visualizations.")),mM("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},(0,rh.NC)(1796,"The green color used in chart visualizations.")),mM("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},(0,rh.NC)(1797,"The purple color used in chart visualizations."));let pU=mM("input.background",{dark:"#3C3C3C",light:gX.white,hcDark:gX.black,hcLight:gX.white},(0,rh.NC)(1893,"Input box background.")),pK=mM("input.foreground",mH,(0,rh.NC)(1894,"Input box foreground.")),p$=mM("input.border",{dark:null,light:null,hcDark:mK,hcLight:mK},(0,rh.NC)(1895,"Input box border.")),pj=mM("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:mK,hcLight:mK},(0,rh.NC)(1896,"Border color of activated options in input fields.")),pq=mM("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},(0,rh.NC)(1897,"Background color of activated options in input fields.")),pG=mM("inputOption.activeBackground",{dark:mO(mU,.4),light:mO(mU,.2),hcDark:gX.transparent,hcLight:gX.transparent},(0,rh.NC)(1898,"Background hover color of options in input fields.")),pQ=mM("inputOption.activeForeground",{dark:gX.white,light:gX.black,hcDark:mH,hcLight:mH},(0,rh.NC)(1899,"Foreground color of activated options in input fields."));mM("input.placeholderForeground",{light:mO(mH,.5),dark:mO(mH,.5),hcDark:mO(mH,.7),hcLight:mO(mH,.7)},(0,rh.NC)(1900,"Input box foreground color for placeholder text."));let pY=mM("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:gX.black,hcLight:gX.white},(0,rh.NC)(1901,"Input validation background color for information severity.")),pJ=mM("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:mH},(0,rh.NC)(1902,"Input validation foreground color for information severity.")),pZ=mM("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:mK,hcLight:mK},(0,rh.NC)(1903,"Input validation border color for information severity.")),pX=mM("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:gX.black,hcLight:gX.white},(0,rh.NC)(1904,"Input validation background color for warning severity.")),p1=mM("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:mH},(0,rh.NC)(1905,"Input validation foreground color for warning severity.")),p0=mM("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:mK,hcLight:mK},(0,rh.NC)(1906,"Input validation border color for warning severity.")),p2=mM("inputValidation.errorBackgroun
4d",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:gX.black,hcLight:gX.white},(0,rh.NC)(1907,"Input validation background color for error severity.")),p5=mM("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:mH},(0,rh.NC)(1908,"Input validation foreground color for error severity.")),p4=mM("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:mK,hcLight:mK},(0,rh.NC)(1909,"Input validation border color for error severity.")),p6=mM("dropdown.background",{dark:"#3C3C3C",light:gX.white,hcDark:gX.black,hcLight:gX.white},(0,rh.NC)(1910,"Dropdown background.")),p7=mM("dropdown.listBackground",{dark:null,light:null,hcDark:gX.black,hcLight:gX.white},(0,rh.NC)(1911,"Dropdown list background.")),p3=mM("dropdown.foreground",{dark:"#F0F0F0",light:mH,hcDark:gX.white,hcLight:mH},(0,rh.NC)(1912,"Dropdown foreground.")),p9=mM("dropdown.border",{dark:p6,light:"#CECECE",hcDark:mK,hcLight:mK},(0,rh.NC)(1913,"Dropdown border.")),p8=mM("button.foreground",gX.white,(0,rh.NC)(1914,"Button foreground color.")),_e=mM("button.separator",mO(p8,.4),(0,rh.NC)(1915,"Button separator color.")),_t=mM("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:gX.black,hcLight:"#0F4A85"},(0,rh.NC)(1916,"Button background color.")),_i=mM("button.hoverBackground",{dark:mA(_t,.2),light:mR(_t,.2),hcDark:_t,hcLight:_t},(0,rh.NC)(1917,"Button background color when hovering.")),_n=mM("button.border",mK,(0,rh.NC)(1918,"Button border color.")),_s=mM("button.secondaryForeground",{dark:gX.white,light:gX.white,hcDark:gX.white,hcLight:mH},(0,rh.NC)(1919,"Secondary button foreground color.")),_r=mM("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:gX.white},(0,rh.NC)(1920,"Secondary button background color.")),_o=mM("button.secondaryHoverBackground",{dark:mA(_r,.2),light:mR(_r,.2),hcDark:null,hcLight:null},(0,rh.NC)(1921,"Secondary button background color when hovering.")),_a=mM("radio.activeForeground",pQ,(0,rh.NC)(1922,"Foreground color of active radio option.")),_l=mM("radio.activeBackground",pG,(0,rh.NC)(1923,"Background color of active radio option.")),_h=mM("radio.activeBorder",pj,(0,rh.NC)(1924,"Border color of the active radio option.")),_d=mM("radio.inactiveForeground",null,(0,rh.NC)(1925,"Foreground color of inactive radio option.")),_u=mM("radio.inactiveBackground",null,(0,rh.NC)(1926,"Background color of inactive radio option.")),_c=mM("radio.inactiveBorder",{light:mO(_a,.2),dark:mO(_a,.2),hcDark:mO(_a,.4),hcLight:mO(_a,.2)},(0,rh.NC)(1927,"Border color of the inactive radio option.")),_g=mM("radio.inactiveHoverBackground",pq,(0,rh.NC)(1928,"Background color of inactive active radio option when hovering.")),_f=mM("checkbox.background",p6,(0,rh.NC)(1929,"Background color of checkbox widget."));mM("checkbox.selectBackground",m2,(0,rh.NC)(1930,"Background color of checkbox widget when the element it's in is selected."));let _m=mM("checkbox.foreground",p3,(0,rh.NC)(1931,"Foreground color of checkbox widget.")),_p=mM("checkbox.border",p9,(0,rh.NC)(1932,"Border color of checkbox widget."));mM("checkbox.selectBorder",mz,(0,rh.NC)(1933,"Border color of checkbox widget when the element it's in is selected."));let __=mM("checkbox.disabled.background",{op:7,color:_f,with:_m,ratio:.33},(0,rh.NC)(1934,"Background of a disabled checkbox.")),_v=mM("checkbox.disabled.foreground",{op:7,color:_m,with:_f,ratio:.33},(0,rh.NC)(1935,"Foreground of a disabled checkbox.")),_b=mM("keybindingLabel.background",{dark:new gX(new gY(128,128,128,.17)),light:new gX(new gY(221,221,221,.4)),hcDark:gX.transparent,hcLight:gX.transparent},(0,rh.NC)(1936,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),_C=mM("keybindingLabel.foreground",{dark:gX.fromHex("#CCCCCC"),light:gX.fromHex("#555555"),hcDark:gX.white,hcLight:mH},(0,rh.NC)(1937,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),_w=mM("keybindingLabel.border",{dark:new gX(new gY(51,51,51,.6)),light:new gX(new gY(204,204,204,.4)),hcDark:new gX(new gY(111,195,223)),hcLight:mK},(0,rh.NC)(1938,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),_y=mM("keybindingLabel.bottomBorder",{dark:new gX(new gY(68,68,68,.6)),light:new gX(new gY(187,187,187,.4)),hcDark:new gX(new gY(111,195,223)),hcLight:mH},(0,rh.NC)(1939,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),_S=mM("list.focusB
4ackground",null,(0,rh.NC)(1940,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_L=mM("list.focusForeground",null,(0,rh.NC)(1941,"List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_x=mM("list.focusOutline",{dark:mU,light:mU,hcDark:m$,hcLight:m$},(0,rh.NC)(1942,"List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_k=mM("list.focusAndSelectionOutline",null,(0,rh.NC)(1943,"List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),_N=mM("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:gX.fromHex("#0F4A85").transparent(.1)},(0,rh.NC)(1944,"List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_D=mM("list.activeSelectionForeground",{dark:gX.white,light:gX.white,hcDark:null,hcLight:null},(0,rh.NC)(1945,"List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_E=mM("list.activeSelectionIconForeground",null,(0,rh.NC)(1946,"List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),_T=mM("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:gX.fromHex("#0F4A85").transparent(.1)},(0,rh.NC)(1947,"List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),_I=mM("list.inactiveSelectionForeground",null,(0,rh.NC)(1948,"List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),_M=mM("list.inactiveSelectionIconForeground",null,(0,rh.NC)(1949,"List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),_R=mM("list.inactiveFocusBackground",null,(0,rh.NC)(1950,"List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),_A=mM("list.inactiveFocusOutline",null,(0,rh.NC)(1951,"List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),_O=mM("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:gX.white.transparent(.1),hcLight:gX.fromHex("#0F4A85").transparent(.1)},(0,rh.NC)(1952,"List/Tree background when hovering over items using the mouse.")),_P=mM("list.hoverForeground",null,(0,rh.NC)(1953,"List/Tree foreground when hovering over items using the mouse.")),_F=mM("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},(0,rh.NC)(1954,"List/Tree drag and drop background when moving items over other items when using the mouse.")),_B=mM("list.dropBetweenBackground",{dark:mz,light:mz,hcDark:null,hcLight:null},(0,rh.NC)(1955,"List/Tree drag and drop border color when moving items between items when using the mouse.")),_V=mM("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:mU,hcLight:mU},(0,rh.NC)(1956,"List/Tree foreground color of the match highlights when searching inside the list/tree."));mM("list.focusHighlightForeground",{dark:_V,light:{op:6,if:_N,then:_V,else:"#BBE7FF"},hcDark:_V,hcLight:_V},(0,rh.NC)(1957,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.")),mM("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},(0,rh.NC)(1958,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),mM("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},(0,rh.NC)(1959,"Foreground color of list items containing errors.")),mM("list.
4warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},(0,rh.NC)(1960,"Foreground color of list items containing warnings."));let _W=mM("listFilterWidget.background",{light:mR(m2,0),dark:mA(m2,0),hcDark:m2,hcLight:m2},(0,rh.NC)(1961,"Background color of the type filter widget in lists and trees.")),_H=mM("listFilterWidget.outline",{dark:gX.transparent,light:gX.transparent,hcDark:"#f38518",hcLight:"#007ACC"},(0,rh.NC)(1962,"Outline color of the type filter widget in lists and trees.")),_z=mM("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:mK,hcLight:mK},(0,rh.NC)(1963,"Outline color of the type filter widget in lists and trees, when there are no matches.")),_U=mM("listFilterWidget.shadow",pb,(0,rh.NC)(1964,"Shadow color of the type filter widget in lists and trees."));mM("list.filterMatchBackground",{dark:po,light:po,hcDark:null,hcLight:null},(0,rh.NC)(1965,"Background color of the filtered match.")),mM("list.filterMatchBorder",{dark:pa,light:pa,hcDark:mK,hcLight:m$},(0,rh.NC)(1966,"Border color of the filtered match.")),mM("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},(0,rh.NC)(1967,"List/Tree foreground color for items that are deemphasized."));let _K=mM("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},(0,rh.NC)(1968,"Tree stroke color for the indentation guides.")),_$=mM("tree.inactiveIndentGuidesStroke",mO(_K,.4),(0,rh.NC)(1969,"Tree stroke color for the indentation guides that are not active.")),_j=mM("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},(0,rh.NC)(1970,"Table border color between columns.")),_q=mM("tree.tableOddRowsBackground",{dark:mO(mH,.04),light:mO(mH,.04),hcDark:null,hcLight:null},(0,rh.NC)(1971,"Background color for odd table rows."));mM("editorActionList.background",m2,(0,rh.NC)(1972,"Action List background color.")),mM("editorActionList.foreground",m5,(0,rh.NC)(1973,"Action List foreground color.")),mM("editorActionList.focusForeground",_D,(0,rh.NC)(1974,"Action List foreground color for the focused item.")),mM("editorActionList.focusBackground",_N,(0,rh.NC)(1975,"Action List background color for the focused item."));let _G=mM("menu.border",{dark:null,light:null,hcDark:mK,hcLight:mK},(0,rh.NC)(1976,"Border color of menus.")),_Q=mM("menu.foreground",p3,(0,rh.NC)(1977,"Foreground color of menu items.")),_Y=mM("menu.background",p6,(0,rh.NC)(1978,"Background color of menu items.")),_J=mM("menu.selectionForeground",_D,(0,rh.NC)(1979,"Foreground color of the selected menu item in menus.")),_Z=mM("menu.selectionBackground",_N,(0,rh.NC)(1980,"Background color of the selected menu item in menus.")),_X=mM("menu.selectionBorder",{dark:null,light:null,hcDark:m$,hcLight:m$},(0,rh.NC)(1981,"Border color of the selected menu item in menus.")),_1=mM("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:mK,hcLight:mK},(0,rh.NC)(1982,"Color of a separator menu item in menus.")),_0=mM("quickInput.background",m2,(0,rh.NC)(2010,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),_2=mM("quickInput.foreground",m5,(0,rh.NC)(2011,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),_5=mM("quickInputTitle.background",{dark:new gX(new gY(255,255,255,.105)),light:new gX(new gY(0,0,0,.06)),hcDark:"#000000",hcLight:gX.white},(0,rh.NC)(2012,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),_4=mM("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:gX.white,hcLight:"#0F4A85"},(0,rh.NC)(2013,"Quick picker color for grouping labels.")),_6=mM("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:gX.white,hcLight:"#0F4A85"},(0,rh.NC)(2014,"Quick picker color for grouping borders.")),_7=mM("quickInput.list.focusBackground",null,"",void 0,(0,rh.NC)(2015,"Please use quickInputList.focusBackground instead")),_3=mM("quickInputList.focusForeground",_D,(0,rh.NC)(2016,"Quick picker foreground color for the focused item.")),_9=mM("quickInputList.focusIconForeground",_E,(0,rh.NC)(2017,"Quick picker icon foreground color for the focused item.")),_8=mM("quickInputList.focusB
4ackground",{dark:mP(_7,_N),light:mP(_7,_N),hcDark:null,hcLight:null},(0,rh.NC)(2018,"Quick picker background color for the focused item."));mM("search.resultsInfoForeground",{light:mH,dark:mO(mH,.65),hcDark:mH,hcLight:mH},(0,rh.NC)(2019,"Color of the text in the search viewlet's completion message.")),mM("searchEditor.findMatchBackground",{light:mO(po,.66),dark:mO(po,.66),hcDark:po,hcLight:po},(0,rh.NC)(2020,"Color of the Search Editor query matches.")),mM("searchEditor.findMatchBorder",{light:mO(pa,.66),dark:mO(pa,.66),hcDark:pa,hcLight:pa},(0,rh.NC)(2021,"Border color of the Search Editor query matches."));class ve{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(e){return new vt(this.x-e.scrollX,this.y-e.scrollY)}}class vt{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(e){return new ve(this.clientX+e.scrollX,this.clientY+e.scrollY)}}class vi{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class vn{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function vs(e){let t=ls(e);return new vi(t.left,t.top,t.width,t.height)}function vr(e,t,i){let n=t.width/e.offsetWidth,s=t.height/e.offsetHeight;return new vn((i.x-t.x)/n,(i.y-t.y)/s)}class vo extends oE{constructor(e,t,i){super(aG(i),e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new ve(this.posx,this.posy),this.editorPos=vs(i),this.relativePos=vr(i,this.editorPos,this.pos)}}class va{constructor(e){this._editorViewDomNode=e}_create(e){return new vo(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return a6(e,ly.CONTEXT_MENU,e=>{t(this._create(e))})}onMouseUp(e,t){return a6(e,ly.MOUSE_UP,e=>{t(this._create(e))})}onMouseDown(e,t){return a6(e,ly.MOUSE_DOWN,e=>{t(this._create(e))})}onPointerDown(e,t){return a6(e,ly.POINTER_DOWN,e=>{t(this._create(e),e.pointerId)})}onMouseLeave(e,t){return a6(e,ly.MOUSE_LEAVE,e=>{t(this._create(e))})}onMouseMove(e,t){return a6(e,ly.MOUSE_MOVE,e=>t(this._create(e)))}}class vl{constructor(e){this._editorViewDomNode=e}_create(e){return new vo(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return a6(e,"pointerup",e=>{t(this._create(e))})}onPointerDown(e,t){return a6(e,ly.POINTER_DOWN,e=>{t(this._create(e),e.pointerId)})}onPointerLeave(e,t){return a6(e,ly.POINTER_LEAVE,e=>{t(this._create(e))})}onPointerMove(e,t){return a6(e,"pointermove",e=>t(this._create(e)))}}class vh extends ro.JT{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new mk),this._keydownListener=null}startMonitoring(e,t,i,n,s){this._keydownListener=a7(e.ownerDocument,"keydown",e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,e=>{n(new vo(e,!0,this._editorViewDomNode))},e=>{this._keydownListener.dispose(),s(e)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class vd{static{this._idPool=0}constructor(e){this._editor=e,this._instanceId=++vd._idPool,this._counter=0,this._rules=new ro.b2,this._garbageCollectionScheduler=new oK(()=>this.garbageCollect(),1e3)}dispose(){this._rules.dispose(),this._garbageCollectionScheduler.dispose()}createClassNameRef(e){let t=this.getOrCreateRule(e);return t.increaseRefCount(),{className:t.className,dispose:()=>{t.decreaseRefCount(),this._garbageCollectionScheduler.schedule()}}}getOrCreateRule(e){let t=this.computeUniqueKey(e),i=this._rules.get(t);if(!i){let n=this._counter++;i=new vu(t,`dyn-rule-${this._instanceId}-${n}`,lc(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(let e of this._rules.values())e.hasReferences()||this._rules.deleteAndDispose(e.key)}}class vu{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElementDisposables=new ro.SL,this._styleElement=mS(i,void 0,this._styleElementDisposables),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;
4for(let e in t){let n;let s=t[e];n="object"==typeof s?mD(s.id):s;let r=e.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`);i+=`
5	${r}: ${n};`}return i+`
6}`}dispose(){this._styleElementDisposables.dispose(),this._styleElement=void 0}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}class vc extends ro.JT{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){let n=e[i];switch(n.type){case 0:this.onCompositionStart(n)&&(t=!0);break;case 1:this.onCompositionEnd(n)&&(t=!0);break;case 2:this.onConfigurationChanged(n)&&(t=!0);break;case 3:this.onCursorStateChanged(n)&&(t=!0);break;case 4:this.onDecorationsChanged(n)&&(t=!0);break;case 5:this.onFlushed(n)&&(t=!0);break;case 6:this.onFocusChanged(n)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(n)&&(t=!0);break;case 8:this.onLineMappingChanged(n)&&(t=!0);break;case 9:this.onLinesChanged(n)&&(t=!0);break;case 10:this.onLinesDeleted(n)&&(t=!0);break;case 11:this.onLinesInserted(n)&&(t=!0);break;case 12:this.onRevealRangeRequest(n)&&(t=!0);break;case 13:this.onScrollChanged(n)&&(t=!0);break;case 15:this.onTokensChanged(n)&&(t=!0);break;case 14:this.onThemeChanged(n)&&(t=!0);break;case 16:this.onTokensColorsChanged(n)&&(t=!0);break;case 17:this.onZonesChanged(n)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(n)}}t&&(this._shouldRender=!0)}}class vg extends vc{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class vf{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){let t=e.getAttribute("data-mprt");return null===t?0:parseInt(t,10)}static collect(e,t){let i=[],n=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;let s=new Uint8Array(n);for(let e=0;e<n;e++)s[e]=i[n-e-1];return s}}class vm{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;let i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._viewLayout.getLineHeightForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class vp extends vm{constructor(e,t,i,n){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i,this._viewLinesGpu=n}linesVisibleRangesForRange(e,t){let i=this._viewLines.linesVisibleRangesForRange(e,t);if(!this._viewLinesGpu)return i??null;let n=this._viewLinesGpu.linesVisibleRangesForRange(e,t);return i?n?i.concat(n).sort((e,t)=>e.lineNumber-t.lineNumber):i:n}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)??this._viewLinesGpu?.visibleRangeForPosition(e)??null}}class v_{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class vv{static from(e){let t=Array(e.length);for(let i=0,n=e.length;i<n;i++){let n=e[i];t[i]=new vv(n.left,n.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class vb{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}static compare(e,t){return e.left-t.left}}class vC{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class vw{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class vy{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,n,s){let r=this._createRange();try{return r.setStart(e,t),r.setEnd(i,n),r.getClientRects()}catch(e){return null}finally{this._detachRange(r,s)}}static _mergeAdjacentRanges(e){if(1===e.length)return e;e.sort(vb.compare);let t=[],i=0,n=e[0];for(let s=1,r=e.length;s<r;
6s++){let r=e[s];n.left+n.width+.9>=r.left?n.width=Math.max(n.width,r.left+r.width-n.left):(t[i++]=n,n=r)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;let n=[];for(let s=0,r=e.length;s<r;s++){let r=e[s];n[s]=new vb(Math.max(0,(r.left-t)/i),r.width/i)}return this._mergeAdjacentRanges(n)}static readHorizontalRanges(e,t,i,n,s,r){let o=e.children.length-1;if(0>o)return null;if((t=Math.min(o,Math.max(0,t)))===(n=Math.min(o,Math.max(0,n)))&&i===s&&0===i&&!e.children[t].firstChild){let i=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(i,r.clientRectDeltaLeft,r.clientRectScale)}t!==n&&n>0&&0===s&&(n--,s=1073741824);let a=e.children[t].firstChild,l=e.children[n].firstChild;if(a&&l||(!a&&0===i&&t>0&&(a=e.children[t-1].firstChild,i=1073741824),l||0!==s||!(n>0)||(l=e.children[n-1].firstChild,s=1073741824)),!a||!l)return null;i=Math.min(a.textContent.length,Math.max(0,i)),s=Math.min(l.textContent.length,Math.max(0,s));let h=this._readClientRects(a,i,l,s,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}}function vS(e){return e===i2.HIGH_CONTRAST_DARK||e===i2.HIGH_CONTRAST_LIGHT}function vL(e){return e===i2.DARK||e===i2.HIGH_CONTRAST_DARK}(eJ=i2||(i2={})).DARK="dark",eJ.LIGHT="light",eJ.HIGH_CONTRAST_DARK="hcDark",eJ.HIGH_CONTRAST_LIGHT="hcLight",(eZ=i5||(i5={})).VS="vs",eZ.VS_DARK="vs-dark",eZ.HC_BLACK="hc-black",eZ.HC_LIGHT="hc-light";let vx=!!sS.tY||!sS.IJ&&!ol&&!ou,vk=!0;class vN{static{this.CLASS_NAME="view-line"}constructor(e,t){this._viewGpuContext=e,this._options=t,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=l2(e);else throw Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return(!!vS(this._options.themeType)||this._renderedViewLine?.input.renderWhitespace===2)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,i,n,s){if(this._options.useGpu&&this._viewGpuContext?.canRender(this._options,n,e))return this._renderedViewLine?.domNode?.domNode.remove(),this._renderedViewLine=null,!1;if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;let r=n.getViewLineRenderingData(e),o=this._options,a=fE.filter(r.inlineDecorations,e,r.minColumn,r.maxColumn),l=r.hasVariableFonts||"off"===o.experimentalWhitespaceRendering?o.renderWhitespace:"none",h=!r.hasVariableFonts,d=null;if(vS(o.themeType)||"selection"===l)for(let t of n.selections){if(t.endLineNumber<e||t.startLineNumber>e)continue;let i=t.startLineNumber===e?t.startColumn:r.minColumn,n=t.endLineNumber===e?t.endColumn:r.maxColumn;i<n&&(vS(o.themeType)&&a.push(new fE(i,n,"inline-selected-text",0)),"selection"===l&&(d||(d=[]),d.push(new cQ(i-1,n-1))))}let u=new fA(o.useMonospaceOptimizations,o.canUseHalfwidthRightwardsArrow,r.content,r.continuesWithWrappedLine,r.isBasicASCII,r.containsRTL,r.minColumn-1,r.tokens,a,r.tabSize,r.startVisibleColumn,o.spaceWidth,o.middotWidth,o.wsmiddotWidth,o.stopRenderingLineAfter,l,o.renderControlCharacters,o.fontLigatures!==sh.n0.OFF,d,r.textDirection,o.verticalScrollbarSize);if(this._renderedViewLine&&this._renderedViewLine.input.equals(u))return!1;s.appendString("<div "),r.textDirection===iZ.RTL?s.appendString('dir="rtl" '):r.containsRTL&&s.appendString('dir="ltr" '),s.appendString('style="top:'),s.appendString(String(t)),s.appendString("px;height:"),s.appendString(String(i)),s.appendString("px;line-height:"),s.appendString(String(i)),r.textDirection===iZ.RTL&&(s.appendString("px;padding-right:"),s.appendString(String(o.verticalScrollbarSize))),s.appendString('px;" class="'),s.appendString(vN.CLASS_NAME),s.appendString('">');let c=fB(u,s);s.appendString("</div>");let g=null;return h&&vk&&vx&&r.isBasicASCII&&u.isLTR&&o.useMonospaceOptimizations&&0===c.containsForeignElements&&(g=new vD(this._renderedViewLine?this._renderedViewLine.dom
6Node:null,u,c.characterMapping)),g||(g=vI(this._renderedViewLine?this._renderedViewLine.domNode:null,u,c.characterMapping,c.containsForeignElements)),this._renderedViewLine=g,!0}layoutLine(e,t,i){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(i),this._renderedViewLine.domNode.setLineHeight(i))}isRenderedRTL(){return!!this._renderedViewLine&&this._renderedViewLine.input.textDirection===iZ.RTL}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof vD}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof vD?this._renderedViewLine.monospaceAssumptionsAreValid():vk}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof vD&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,n){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));let s=this._renderedViewLine.input.stopRenderingLineAfter;if(-1!==s&&t>s+1&&i>s+1)return new vw(!0,[new vb(this.getWidth(n),0)]);-1!==s&&t>s+1&&(t=s+1),-1!==s&&i>s+1&&(i=s+1);let r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return r&&r.length>0?new vw(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}class vD{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;let n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let e=0;e<n;e++)this._keyColumnPixelOffsetCache[e]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<300){let e=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*e)}return -1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||-1!==this._cachedWidth}monospaceAssumptionsAreValid(){return this.domNode&&this.input.lineContent.length<300&&Math.abs(this.getWidth(null)-this.domNode.domNode.firstChild.offsetWidth)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),vk=!1),vk}toSlowRenderedLine(){return vI(this.domNode,this.input,this._characterMapping,0)}getVisibleRangesForRange(e,t,i,n){let s=this._getColumnPixelOffset(e,t,n);return[new vb(s,this._getColumnPixelOffset(e,i,n)-s)]}_getColumnPixelOffset(e,t,i){if(t<=300){let e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}let n=Math.floor((t-1)/300)-1,s=(n+1)*300+1,r=-1;if(this._keyColumnPixelOffsetCache&&-1===(r=this._keyColumnPixelOffsetCache[n])&&(r=this._actualReadPixelOffset(e,s,i),this._keyColumnPixelOffsetCache[n]=r),-1===r){let e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}let o=this._characterMapping.getHorizontalOffset(s),a=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(a-o)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return -1;let n=this._characterMapping.getDomPosition(t),s=vy.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return s&&0!==s.length?s[0].left:-1}getColumnOfNodeOffset(e,t){return vM(this._characterMapping,e,t)}}class vE{constructor(e,t,i,n){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=n,this._cachedWidth=-1,this._pixelOffsetCache=null,t.isLTR){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;
6e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e?.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return -1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){let s=this._readPixelOffset(this.domNode,e,t,n);if(-1===s)return null;let r=this._readPixelOffset(this.domNode,e,i,n);return -1===r?null:[new vb(s,r-s)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,s){if(i!==n)return this._readRawVisibleRangesForRange(e,i,n,s);{let n=this._readPixelOffset(e,t,i,s);return -1===n?null:[new vb(n,0)]}}_readPixelOffset(e,t,i,n){if(this.input.isLTR&&0===this._characterMapping.length){if(0===this._containsForeignElements||2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth(n);let t=this._getReadingTarget(e);return t.firstChild?(n.markDidDomLayout(),t.firstChild.offsetWidth):0}if(null!==this._pixelOffsetCache){let s=this._pixelOffsetCache[i];if(-1!==s)return s;let r=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){let t=vy.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return t&&0!==t.length?t[0].left:-1}if(this.input.isLTR&&i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth(n);let s=this._characterMapping.getDomPosition(i),r=vy.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,s.partIndex,s.charIndex,n);if(!r||0===r.length)return -1;let o=r[0].left;if(this.input.isBasicASCII){let e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(1>=Math.abs(t-o))return t}return o}_readRawVisibleRangesForRange(e,t,i,n){if(this.input.isLTR&&1===t&&i===this._characterMapping.length)return[new vb(0,this.getWidth(n))];let s=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return vy.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,r.partIndex,r.charIndex,n)}getColumnOfNodeOffset(e,t){return vM(this._characterMapping,e,t)}}class vT extends vE{_readVisibleRangesForRange(e,t,i,n,s){let r=super._readVisibleRangesForRange(e,t,i,n,s);if(!r||0===r.length||i===n||1===i&&n===this._characterMapping.length)return r;if(this.input.isLTR){let i=this._readPixelOffset(e,t,n,s);if(-1!==i){let e=r[r.length-1];e.left<i&&(e.width=i-e.left)}}return r}}let vI=oh?function(e,t,i,n){return new vT(e,t,i,n)}:function(e,t,i,n){return new vE(e,t,i,n)};function vM(e,t,i){let n=t.textContent.length,s=-1;for(;t;)t=t.previousSibling,s++;return e.getColumn(new fO(s,i),n)}class vR{static _nextVisibleColumn(e,t,i){return 9===e?vR.nextRenderTabStop(t,i):r6(e)||r7(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){let n=Math.min(t-1,e.length),s=e.substring(0,n),r=new rZ(s),o=0;for(;!r.eol();){let e=rY(s,n,r.offset);r.nextGraphemeLength(),o=this._nextVisibleColumn(e,o,i)}return o}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;let n=e.length,s=new rZ(e),r=0,o=1;for(;!s.eol();){let a=rY(e,n,s.offset);s.nextGraphemeLength();let l=this._nextVisibleColumn(a,r,i),h=s.offset+1;if(l>=t){let e=t-r;if(l-t<e)return h;return o}r=l,o=h}return n+1}static nextRenderTabStop(e,t){return e+t-e%t}static nextIndentTabStop(e,t){return vR.nextRenderTabStop(e,t)}static prevRenderTabStop(e,t){return Math.max(0,e-1-(e-1)%t)}static prevIndentTabStop(e,t){return vR.prevRenderTabStop(e,t)}}class vA{static whitespaceVisibleColumn(e,t,i){let n=e.length,s=0,r=-1,o=-1;for(let a=0;a<n;a++){if(a===t)return[r,o,s];switch(s%i==0&&(r=a,o=s),e.charCodeAt(a)){case 32:s+=1;break;case 9:s=vR.nextRenderTabStop(s,i);break;default:return[-1,-1,-1]}}return t===n?[r,o,s]:[-1,-1,-1]}static atomicPosition(e,t,i,n){let s;let r=e.length,[o,a,l]=vA.whitespaceVisibleColumn(e,t,i);if(-1===l)return -1;switch(n){case 0:s=!0;break;case 1:s=!1;break;case 2:if(l%i==0)return t;s=l%i<=i/2}if(s){if(-1===o)return -1;let t=a;for(let n=o;n<r;++n){if(t===a+i)return o;switch(e.charCodeAt(n)){case 32:t+=1;break;case 9:t=vR.nextRenderTabStop(t,i);break;default:return -1}}return t===a+i?o:-1}let h=vR.nextRenderTabStop(l,i),d=l;for(let n=t;n<r;n++){if(d===h)return n;switch(e.charCodeAt(n)){case 32:d+=1;break;case 9:d=vR.nextRenderTabStop(d,i);break;default:return -1}}return d===h?r:-1}}class vO{constructor(e=null){this.hitTarget=e,this.type=0}}class vP{get hitTarget(){return this.spanNode}constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}(i4||(i4={})).createFromDOMInfo=function(e,t,i){let n=e.getPositionFromDOMInfo(t,i);return n?new vP(n,t,null):new vO(t)};class vF{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class vB{static _deduceRage(e,t=null){return!t&&e?new s9(e.lineNumber,e.column,e.lineNumber,e.column):t??null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,n,s,r){return{type:e,element:t,mouseColumn:i,position:n,range:s,detail:r}}static createViewZone(e,t,i,n,s){return{type:e,element:t,mouseColumn:i,position:n,range:this._deduceRage(n),detail:s}}static createContentText(e,t,i,n,s){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,n),detail:s}}static createContentEmpty(e,t,i,n){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:n}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail
6:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,n){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:n}}static _typeToString(e){return 1===e?"TEXTAREA":2===e?"GUTTER_GLYPH_MARGIN":3===e?"GUTTER_LINE_NUMBERS":4===e?"GUTTER_LINE_DECORATIONS":5===e?"GUTTER_VIEW_ZONE":6===e?"CONTENT_TEXT":7===e?"CONTENT_EMPTY":8===e?"CONTENT_VIEW_ZONE":9===e?"CONTENT_WIDGET":10===e?"OVERVIEW_RULER":11===e?"SCROLLBAR":12===e?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class vV{static isTextArea(e){return 2===e.length&&3===e[0]&&7===e[1]}static isChildOfViewLines(e){return e.length>=4&&3===e[0]&&8===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&8===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&6===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&9===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowGuard(e){return e.length>=1&&3===e[0]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}static isChildOfOverflowingOverlayWidgets(e){return e.length>=1&&5===e[0]}}class vW{constructor(e,t,i){this.viewModel=e.viewModel;let n=e.configuration.options;this.layoutInfo=n.get(165),this.viewDomNode=t.viewDomNode,this.viewLinesGpu=t.viewLinesGpu,this.lineHeight=n.get(75),this.stickyTabStops=n.get(132),this.typicalHalfwidthCharacterWidth=n.get(59).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return vW.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){let i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){let n;let s=i.verticalOffset+i.height/2,r=e.viewModel.getLineCount(),o=null,a=null;return i.afterLineNumber!==r&&(a=new s3(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(o=new s3(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),n=null===a?o:null===o?a:t<s?o:a,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:o,positionAfter:a,position:n}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){let e=this._context.viewModel.getLineCount(),t=this._context.viewModel.getLineMaxColumn(e);return{range:new s9(e,t,e,t),isAfterLines:!0}}let t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new s9(t,1,t,i),isAfterLines:!1}}getLineNumberAtVerticalOffset(e){return this._context.viewLayout.getLineNumberAtVerticalOffset(e)}isAfterLines(e){return this._context.viewLayout.isAfterLines(e)}isInTopPadding(e){return this._context.viewLayout.isInTopPadding(e)}isInBottomPadding(e){return this._context.viewLayout.isInBottomPadding(e)}getVerticalOffsetForLineNumber(e){return this._context.viewLayout.getVerticalOffsetForLineNumber(e)}findAttribute(e,t){return vW._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==e.ownerDocument.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)break;e=e.parentNode}return null}getLineWidth(e){return this._viewHelper.getLineWidth(e)}isRtl(e){return this.viewModel.getTextDirection(e)===iZ.RTL}visibleRangeForPosition(e,t){return this._viewHelper.visibleRangeForPosition(e,t)}getPositionFromDOMInfo(e,t){return this._viewHelper.getPositionFromDOMInfo(e,t)}getCurrentScrollTop(){return this._context.viewLayout.getCurrentScrollTop()}getCurrentScrollLeft(){return this._context.viewLayout.getCurrentScrollLeft()}}class vH{constructor(e,t,i,n){this.editorPos=t,this.pos=i,this.relativePos=n,this.mouseVerticalOffset=Math.max(0,e.getCurrentScrollTop()+this.relativePos.y),this.mouseContentHorizontalOffset=e.getCurrentScrollLeft()+this.relativePos.x-e.layoutInfo.contentLeft,this.isInMarginArea=this.relativePos.x<e.layoutInfo.contentLeft&&this.relativePos.x>=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,v$._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class vz extends vH{get target(){return this._useHitTestTarget?this.hitTestResult.value.hitTarget:this._eventTarget}get targetPath(){return this._targetPathCacheElement!==this.target&&(this._targetPathCacheElement=this.target,this._targetPathCacheValue=vf.collect(this.target,this._ctx.viewDomNode)),this._targetPathCacheValue}constructor(e,t,i,n,s){super(e,t,i,n),this.hitTestResult=new rS(()=>
6v$.doHitTest(this._ctx,this)),this._targetPathCacheElement=null,this._targetPathCacheValue=new Uint8Array(0),this._ctx=e,this._eventTarget=s;let r=!!this._eventTarget;this._useHitTestTarget=!r}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset}
7	target: ${this.target?this.target.outerHTML:null}`}get wouldBenefitFromHitTestTargetSwitch(){return!this._useHitTestTarget&&null!==this.hitTestResult.value.hitTarget&&this.target!==this.hitTestResult.value.hitTarget}switchToHitTestTarget(){this._useHitTestTarget=!0}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?vR.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return vB.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return vB.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return vB.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return vB.createViewZone(e,this.target,this._getMouseColumn(),t,i)}fulfillContentText(e,t,i){return vB.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return vB.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return vB.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return vB.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return vB.createOverlayWidget(this.target,this._getMouseColumn(),e)}}let vU={isAfterLines:!0};function vK(e){return{isAfterLines:!1,horizontalDistanceToText:e}}class v${constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){let t=e.target,i=vf.collect(t,this._viewHelper.viewDomNode);return!!(vV.isChildOfContentWidgets(i)||vV.isChildOfOverflowingContentWidgets(i)||vV.isChildOfOverlayWidgets(i)||vV.isChildOfOverflowingOverlayWidgets(i))}createMouseTarget(e,t,i,n,s){let r=new vW(this._context,this._viewHelper,e),o=new vz(r,t,i,n,s);try{let e=v$._createMouseTarget(r,o);if(6===e.type&&r.stickyTabStops&&null!==e.position){let t=v$._snapToSoftTabBoundary(e.position,r.viewModel),i=s9.fromPositions(t,t).plusRange(e.range);return o.fulfillContentText(t,i,e.detail)}return e}catch(e){return o.fulfillUnknown()}}static _createMouseTarget(e,t){if(null===t.target)return t.fulfillUnknown();let i=null;return vV.isChildOfOverflowGuard(t.targetPath)||vV.isChildOfOverflowingContentWidgets(t.targetPath)||vV.isChildOfOverflowingOverlayWidgets(t.targetPath)||(i=i||t.fulfillUnknown()),(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=i||v$._hitTestContentWidget(e,t))||v$._hitTestOverlayWidget(e,t))||v$._hitTestMinimap(e,t))||v$._hitTestScrollbarSlider(e,t))||v$._hitTestViewZone(e,t))||v$._hitTestMargin(e,t))||v$._hitTestViewCursor(e,t))||v$._hitTestTextArea(e,t))||v$._hitTestViewLines(e,t))||v$._hitTestScrollbar(e,t))||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(vV.isChildOfContentWidgets(t.targetPath)||vV.isChildOfOverflowingContentWidgets(t.targetPath)){let i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(vV.isChildOfOverlayWidgets(t.targetPath)||vV.isChildOfOverflowingOverlayWidgets(t.targetPath)){let i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){for(let i of e.lastRenderData.lastViewCursorsRenderData)if(t.target===i.domNode)return t.fulfillContentText(i.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){let i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,s=t.mouseVerticalOffset;for(let r of i){if(n<r.contentLeft||n>r.contentLeft+r.width)continue;let i=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(i<=s&&s<=i+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){let i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){let e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return vV.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){let i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition(),s=Math.abs(t.relativePos.x),r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:s};if((s-=e.layoutInfo.glyphMarginLeft)<=e.layoutInfo.glyphMarginWidth){let o=e.viewM
7odel.coordinatesConverter.convertViewPositionToModelPosition(i.range.getStartPosition()),a=e.viewModel.glyphLanes.getLanesAtLine(o.lineNumber);return r.glyphMarginLane=a[Math.floor(s/e.lineHeight)],t.fulfillMargin(2,n,i.range,r)}return(s-=e.layoutInfo.glyphMarginWidth)<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,r):(s-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,r))}return null}static _hitTestViewLines(e,t){if(!vV.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new s3(1,1),vU);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){let i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new s3(i,n),vU)}if(vV.isStrictChildOfViewLines(t.targetPath)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineLength(i),s=e.getLineWidth(i);if(0===n){let e=vK(t.mouseContentHorizontalOffset-s);return t.fulfillContentEmpty(new s3(i,1),e)}if(e.isRtl(i)){if(t.mouseContentHorizontalOffset+s<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){let n=vK(t.mouseContentHorizontalOffset-s),r=new s3(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(r,n)}}else if(t.mouseContentHorizontalOffset>=s){let n=vK(t.mouseContentHorizontalOffset-s),r=new s3(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(r,n)}}else if(e.viewLinesGpu){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){let n=e.getLineWidth(i),s=vK(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new s3(i,1),s)}let n=e.getLineWidth(i);if(e.isRtl(i)){if(t.mouseContentHorizontalOffset+n<=e.layoutInfo.contentWidth-e.layoutInfo.verticalScrollbarWidth){let s=vK(t.mouseContentHorizontalOffset-n),r=new s3(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(r,s)}}else if(t.mouseContentHorizontalOffset>=n){let s=vK(t.mouseContentHorizontalOffset-n),r=new s3(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(r,s)}let s=e.viewLinesGpu.getPositionAtCoordinate(i,t.mouseContentHorizontalOffset);if(s)return t.fulfillContentText(s,s9.fromPositions(s,s),{injectedText:null,mightBeForeignElement:!1})}let i=t.hitTestResult.value;return 1===i.type?v$.createMouseTargetFromHitTestPosition(e,t,i.spanNode,i.position,i.injectedText):t.wouldBenefitFromHitTestTargetSwitch?(t.switchToHitTestTarget(),this._createMouseTarget(e,t)):t.fulfillUnknown()}static _hitTestMinimap(e,t){if(vV.isChildOfMinimap(t.targetPath)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new s3(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(vV.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){let i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new s3(i,n))}}return null}static _hitTestScrollbar(e,t){if(vV.isChildOfScrollableElement(t.targetPath)){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new s3(i,n))}return null}getMouseColumn(e){let t=this._context.configuration.options,i=t.get(165),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return v$._getMouseColumn(n,t.get(59).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,s){let r=n.lineNumber,o=n.column,a=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>a){let e=vK(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}let l=e.visibleRangeForPosition(r,o);if(!l)return t.fulfillUnknown(n);let h=l.left;if(1>Math.abs(t.mouseContentHorizontalOffset-h))return t.fulfillContentText(n,null,{mightBeForeignElement:!!s,injectedText:s});let d=[];if(d.push({offset:l.left,column:o}),o>1){let t=e.visibleRangeForPosition(r,o-1);t&&d.push({offset:t.left,column:o-1})}
7if(o<e.viewModel.getLineMaxColumn(r)){let t=e.visibleRangeForPosition(r,o+1);t&&d.push({offset:t.left,column:o+1})}d.sort((e,t)=>e.offset-t.offset);let u=t.pos.toClientCoordinates(aG(e.viewDomNode)),c=i.getBoundingClientRect(),g=c.left<=u.clientX&&u.clientX<=c.right,f=null;for(let e=1;e<d.length;e++){let i=d[e-1],s=d[e];if(i.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=s.offset){f=new s9(r,i.column,r,s.column),n=Math.abs(i.offset-t.mouseContentHorizontalOffset)<Math.abs(s.offset-t.mouseContentHorizontalOffset)?new s3(r,i.column):new s3(r,s.column);break}}return t.fulfillContentText(n,f,{mightBeForeignElement:!g||!!s,injectedText:s})}static _doHitTestWithCaretRangeFromPoint(e,t){let i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.getVerticalOffsetForLineNumber(i),s=n+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>s)){let i=t.pos.y+(Math.floor((n+s)/2)-t.mouseVerticalOffset);i<=t.editorPos.y&&(i=t.editorPos.y+1),i>=t.editorPos.y+t.editorPos.height&&(i=t.editorPos.y+t.editorPos.height-1);let r=new ve(t.pos.x,i),o=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates(aG(e.viewDomNode)));if(1===o.type)return o}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates(aG(e.viewDomNode)))}static _actualDoHitTestWithCaretRangeFromPoint(e,t){let i;let n=lc(e.viewDomNode);if(!(i=n?void 0===n.caretRangeFromPoint?function(e,t,i){let n=document.createRange(),s=e.elementFromPoint(t,i);if(s?.hasChildNodes()){let e;for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;let i=s.getBoundingClientRect(),r=aG(s),o=r.getComputedStyle(s,null).getPropertyValue("font-style"),a=r.getComputedStyle(s,null).getPropertyValue("font-variant"),l=r.getComputedStyle(s,null).getPropertyValue("font-weight"),h=r.getComputedStyle(s,null).getPropertyValue("font-size"),d=r.getComputedStyle(s,null).getPropertyValue("line-height"),u=r.getComputedStyle(s,null).getPropertyValue("font-family"),c=`${o} ${a} ${l} ${h}/${d} ${u}`,g=s.innerText,f=i.left,m=0;if(t>i.left+i.width)m=g.length;else{let i=vj.getInstance();for(let n=0;n<g.length+1;n++){if(t<(f+=e=i.getCharWidth(g.charAt(n),c)/2)){m=n;break}f+=e}}n.setStart(s.firstChild,m),n.setEnd(s.firstChild,m)}return n}(n,t.clientX,t.clientY):n.caretRangeFromPoint(t.clientX,t.clientY):e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY))||!i.startContainer)return new vO;let s=i.startContainer;if(s.nodeType===s.TEXT_NODE){let t=s.parentNode,n=t?t.parentNode:null,r=n?n.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===vN.CLASS_NAME?i4.createFromDOMInfo(e,t,i.startOffset):new vO(s.parentNode)}if(s.nodeType===s.ELEMENT_NODE){let t=s.parentNode,i=t?t.parentNode:null;return(i&&i.nodeType===i.ELEMENT_NODE?i.className:null)===vN.CLASS_NAME?i4.createFromDOMInfo(e,s,s.textContent.length):new vO(s)}return new vO}static _doHitTestWithCaretPositionFromPoint(e,t){let i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){let t=i.offsetNode.parentNode,n=t?t.parentNode:null,s=n?n.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===vN.CLASS_NAME?i4.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new vO(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){let t=i.offsetNode.parentNode,n=t&&t.nodeType===t.ELEMENT_NODE?t.className:null,s=t?t.parentNode:null,r=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(n===vN.CLASS_NAME){let t=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(t)return i4.createFromDOMInfo(e,t,0)}else if(r===vN.CLASS_NAME)return i4.createFromDOMInfo(e,i.offsetNode,0)}return new vO(i.offsetNode)}static _snapToSoftTabBoundary(e,t){let i=t.getLineContent(e.lineNumber),{tabSize:n}=t.model.getOptions(),s=vA.atomicPosition(i,e.column-1,n,2);return -1!==s?new s3(e.lineNumber,s+1):e}static doHitTest(e,t){let i=new vO;if("function"==typeof e.viewDomNode.ownerDocument.caretRangeFromPoint?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates(aG(e.viewDomNode)))),1===i.type){let t=e.viewModel.getInjectedTextAt(i.position),n=e.viewM
7odel.normalizePosition(i.position,2);(t||!n.equals(i.position))&&(i=new vP(n,i.spanNode,t))}return i}}class vj{static{this._INSTANCE=null}static getInstance(){return vj._INSTANCE||(vj._INSTANCE=new vj),vj._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,t){let i=e+t;if(this._cache[i])return this._cache[i];let n=this._canvas.getContext("2d");n.font=t;let s=n.measureText(e).width;return this._cache[i]=s,s}}function vq(e,t,i){let n=null,s=null;if("function"==typeof i.value?(n="value",0!==(s=i.value).length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof i.get&&(n="get",s=i.get),!s)throw Error("not supported");let r=`$memoize$${t}`;i[n]=function(...e){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,e)}),this[r]}}(eX=i6||(i6={})).Tap="-monaco-gesturetap",eX.Change="-monaco-gesturechange",eX.Start="-monaco-gesturestart",eX.End="-monaco-gesturesend",eX.Contextmenu="-monaco-gesturecontextmenu";class vG extends ro.JT{static{this.SCROLL_FRICTION=-.005}static{this.HOLD_DELAY=700}static{this.CLEAR_TAP_COUNT_TIME=400}constructor(){super(),this.dispatched=!1,this.targets=new hu.S,this.ignoreTargets=new hu.S,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(sd.ju.runAndSubscribe(a1,({window:e,disposables:t})=>{t.add(a6(e.document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),t.add(a6(e.document,"touchend",t=>this.onTouchEnd(e,t))),t.add(a6(e.document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))},{window:rb,disposables:this._store}))}static addTarget(e){if(!vG.isTouchDevice())return ro.JT.None;vG.INSTANCE||(vG.INSTANCE=(0,ro.dk)(new vG));let t=vG.INSTANCE.targets.push(e);return(0,ro.OF)(t)}static ignoreTarget(e){if(!vG.isTouchDevice())return ro.JT.None;vG.INSTANCE||(vG.INSTANCE=(0,ro.dk)(new vG));let t=vG.INSTANCE.ignoreTargets.push(e);return(0,ro.OF)(t)}static isTouchDevice(){return"ontouchstart"in rb||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,n=e.targetTouches.length;i<n;i++){let n=e.targetTouches.item(i);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:t,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[t],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};let s=this.newGestureEvent(i6.Start,n.target);s.pageX=n.pageX,s.pageY=n.pageY,this.dispatchEvent(s)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,t){let i=Date.now(),n=Object.keys(this.activeTouches).length;for(let s=0,r=t.changedTouches.length;s<r;s++){let r=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn("move of an UNKNOWN touch",r);continue}let o=this.activeTouches[r.identifier],a=Date.now()-o.initialTimeStamp;if(a<vG.HOLD_DELAY&&30>Math.abs(o.initialPageX-o.rollingPageX.at(-1))&&30>Math.abs(o.initialPageY-o.rollingPageY.at(-1))){let e=this.newGestureEvent(i6.Tap,o.initialTarget);e.pageX=o.rollingPageX.at(-1),e.pageY=o.rollingPageY.at(-1),this.dispatchEvent(e)}else if(a>=vG.HOLD_DELAY&&30>Math.abs(o.initialPageX-o.rollingPageX.at(-1))&&30>Math.abs(o.initialPageY-o.rollingPageY.at(-1))){let e=this.newGestureEvent(i6.Contextmenu,o.initialTarget);e.pageX=o.rollingPageX.at(-1),e.pageY=o.rollingPageY.at(-1),this.dispatchEvent(e)}else if(1===n){let t=o.rollingPageX.at(-1),n=o.rollingPageY.at(-1),s=o.rollingTimestamps.at(-1)-o.rollingTimestamps[0],r=t-o.rollingPageX[0],a=n-o.rollingPageY[0],l=[...this.targets].filter(e=>o.initialTarget instanceof Node&&e.contains(o.initialTarget));this.inertia(e,l,i,Math.abs(r)/s,r>0?1:-1,t,Math.abs(a)/s,a>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(i6.End,o.initialTarget)),delete this.activeTouches[r.identifier]}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){let i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===i6.Tap){let t=new Date().getTime(),i=0;i=t-this._lastSetTapCountTime>vG.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===i6.Change||e.type===i6.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let t of this.ignoreTargets)if(t.contains(e.initialTarget))return;let t=[];for(let i of this.targets)if(i.contains(e.initialTarget)){let n=0,s=e.initialTarget;for(;s&&s!==i;)n++,s=s.parentElement;t.push([n,i])}for(let[i,n]of(t.sort((e,t)=>
7e[0]-t[0]),t))n.dispatchEvent(e),this.dispatched=!0}}inertia(e,t,i,n,s,r,o,a,l){this.handle=u(e,()=>{let h=Date.now(),d=h-i,u=0,c=0,g=!0;n+=vG.SCROLL_FRICTION*d,o+=vG.SCROLL_FRICTION*d,n>0&&(g=!1,u=s*n*d),o>0&&(g=!1,c=a*o*d);let f=this.newGestureEvent(i6.Change);f.translationX=u,f.translationY=c,t.forEach(e=>e.dispatchEvent(f)),g||this.inertia(e,t,h,n,s,r+u,o,a,l+c)})}onTouchMove(e){let t=Date.now();for(let i=0,n=e.changedTouches.length;i<n;i++){let n=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}let s=this.activeTouches[n.identifier],r=this.newGestureEvent(i6.Change,s.initialTarget);r.translationX=n.pageX-s.rollingPageX.at(-1),r.translationY=n.pageY-s.rollingPageY.at(-1),r.pageX=n.pageX,r.pageY=n.pageY,this.dispatchEvent(r),s.rollingPageX.length>3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(n.pageX),s.rollingPageY.push(n.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}!function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);r>3&&o&&Object.defineProperty(t,i,o)}([vq],vG,"isTouchDevice",null);class vQ extends ro.JT{onclick(e,t){this._register(a6(e,ly.CLICK,i=>t(new oE(aG(e),i))))}onmousedown(e,t){this._register(a6(e,ly.MOUSE_DOWN,i=>t(new oE(aG(e),i))))}onmouseover(e,t){this._register(a6(e,ly.MOUSE_OVER,i=>t(new oE(aG(e),i))))}onmouseleave(e,t){this._register(a6(e,ly.MOUSE_LEAVE,i=>t(new oE(aG(e),i))))}onkeydown(e,t){this._register(a6(e,ly.KEY_DOWN,e=>t(new ok(e))))}onkeyup(e,t){this._register(a6(e,ly.KEY_UP,e=>t(new ok(e))))}oninput(e,t){this._register(a6(e,ly.INPUT,t))}onblur(e,t){this._register(a6(e,ly.BLUR,t))}onfocus(e,t){this._register(a6(e,ly.FOCUS,t))}ignoreGesture(e){return vG.ignoreTarget(e)}}class vY extends vQ{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...iH.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new mk),this._register(a7(this.bgDomNode,ly.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(a7(this.domNode,ly.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new a9),this._pointerdownScheduleRepeatTimer=this._register(new oz)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,aG(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}}class vJ extends ro.JT{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new oz)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||this._rawShouldBeVisible)}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}
7setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}}class vZ extends vQ{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new vJ(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new mk),this._shouldRender=!0,this.domNode=l2(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(a6(this.domNode.domNode,ly.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new vY(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=l2(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(a6(this.slider.domNode,ly.POINTER_DOWN,e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);i<=s&&s<=n?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)t=e.offsetX,i=e.offsetY;else{let n=ls(this.domNode.domNode);t=e.pageX-n.left,i=e.pageY-n.top}let n="mouse"===e.pointerType,s=0===e.button;if(s||!n){let e=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(e):this._scrollbarState.getDesiredScrollPositionFromOffset(e))}s&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let s=this._sliderOrthogonalPointerPosition(e);if(sS.ED&&Math.abs(s-i)>140){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let r=this._sliderPointerPosition(e);this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(r-t))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}class vX{constructor(e,t,i,n,s,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=s,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new vX(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,s){let r=Math.max(0,i-e),o=Math.max(0,r-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(r),computedIsNeeded:a,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let l=Math.round(Math.max(20,Math.floor(i*o/n))),h=(o-l)/(n-i);return{computedAvailableSize:Math.round(r),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:h,computedSliderPosition:Math.round(s*h)}}_refreshComputedValues(){let e=vX._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){return this._computedIsNeeded?Math.round((e-this._arrowSize-this._computedSliderSize/2)/this._computedSliderRatio):0}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){return this._computedIsNeeded?Math.round((this._computedSliderPosition+e)/this._computedSliderRatio):0}}class v1 extends vZ{constructor(e,t,i){let n=e.getScrollDimensions();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new vX(t.horizontalHasArrows?t.arrowSize:0,2===t.horizontal?0:t.horizontalScrollbarSize,2===t.vertical?0:t.verticalScrollbarSize,n.width,n.scrollWidth,e.getCurrentScrollPosition().scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){let e=(t.arrowSize-11)/2,i=(t.horizontalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:rr.scrollbarButtonLeft,top:i,left:e,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new oT(null,1,0))}),this._createArrow({className:"scra",icon:rr.scrollbarButtonRight,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new oT(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class v0 extends vZ{constructor(e,t,i){let n=e.getScrollDimensions();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new vX(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,e.getCurrentScrollPosition().scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){let e=(t.arrowSize-11)/2,i=(t.verticalScrollbarSize-11)/2;this._createArrow({className:"scra",icon:rr.scrollbarButtonUp,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new oT(null,0,1))}),this._createArrow({className:"scra",icon:rr.scrollbarButtonDown,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new oT(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class v2{constructor(e,t,i,n,s,r,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,n|=0,s|=0,r|=0,o|=0),this.rawScrollLeft=n,this.rawScrollTop=o,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),s<0&&(s=0),o+s>r&&(o=r-s),o<0&&(o=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=s,this.scrollHeight=r,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new v2(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new v2(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,s=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:s,heightChanged:r,scrollHeightChanged:o,scrollTopChanged:a}}}class v5 extends ro.JT{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new sd.Q5),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new v2(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){let i;e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;i=t?new v7(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=i}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=v7.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class v4{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function v6(e,t){let i=t-e;return function(t){return e+i*(1-Math.pow(1-t,3))}}class v7{constructor(e,t,
7i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){var n,s;let r,o;return e<t?(r=e+.75*i,o=t-.75*i):(r=e-.75*i,o=t+.75*i),n=v6(e,r),s=v6(o,t),function(e){return e<.33?n(e/.33):s((e-.33)/(1-.33))}}return v6(e,t)}dispose(){null!==this.animationFrameDisposable&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new v4(this.scrollLeft(t),this.scrollTop(t),!1):new v4(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return v7.start(e,t,i)}static start(e,t,i){return i+=10,new v7(e,t,Date.now()-10,i)}}i(9778);class v3{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class v9{static{this.INSTANCE=new v9}constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(-1===this._front&&-1===this._rear)return!1;let e=1,t=0,i=1,n=this._rear;for(;;){let s=n===this._front?e:Math.pow(2,-i);if(e-=s,t+=this._memory[n].score*s,n===this._front)break;n=(this._capacity+n-1)%this._capacity,i++}return t<=.5}acceptStandardWheelEvent(e){if(od){let t=oo(aG(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){let n=null,s=new v3(e,t,i);-1===this._front&&-1===this._rear?(this._memory[0]=s,this._front=0,this._rear=0):(n=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=s),s.score=this._computeScore(s,n)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let i=.5;if(this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(i+=.25),t){let n=Math.abs(e.deltaX),s=Math.abs(e.deltaY),r=Math.abs(t.deltaX),o=Math.abs(t.deltaY);Math.max(n,r)%Math.max(Math.min(n,r),1)==0&&Math.max(s,o)%Math.max(Math.min(s,o),1)==0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01+100*Number.EPSILON}}class v8 extends vQ{get onScroll(){return this._onScroll.event}get options(){return this._options}constructor(e,t,i){super(),this._inertialTimeout=null,this._inertialSpeed={X:0,Y:0},this._onScroll=this._register(new sd.Q5),this._onWillScroll=this._register(new sd.Q5),e.style.overflow="hidden",this._options=function(e){let t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,inertialScroll:void 0!==e.inertialScroll&&e.inertialScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};return t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,sS.dz&&(t.className+=" mac"),t}(t),this._scrollable=i,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}
7));let n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new v0(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new v1(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=l2(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=l2(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=l2(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new oz),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=(0,ro.B9)(this._mouseWheelToDispose),this._inertialTimeout&&(this._inertialTimeout.dispose(),this._inertialTimeout=null),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,sS.dz&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new oT(e))}async _periodicSync(){let e=!1;(0!==this._inertialSpeed.X||0!==this._inertialSpeed.Y)&&(this._scrollable.setScrollPositionNow({scrollTop:this._scrollable.getCurrentScrollPosition().scrollTop-100*this._inertialSpeed.Y,scrollLeft:this._scrollable.getCurrentScrollPosition().scrollLeft-100*this._inertialSpeed.X}),this._inertialSpeed.X*=.9,this._inertialSpeed.Y*=.9,.01>Math.abs(this._inertialSpeed.X)&&(this._inertialSpeed.X=0),.01>Math.abs(this._inertialSpeed.Y)&&(this._inertialSpeed.Y=0),e=0!==this._inertialSpeed.X||0!==this._inertialSpeed.Y),e?(this._inertialTimeout||(this._inertialTimeout=new oz),this._inertialTimeout.cancelAndSet(()=>this._periodicSync(),1e3/60)):(this._inertialTimeout?.dispose(),this._inertialTimeout=null)}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=(0,ro.B9)(this._mouseWheelToDispose),e&&this._mouseWheelToDispose.push(a6(this._listenOnDomNode,ly.MOUSE_WHEEL,e=>{this._onMouseWheel(new oT(e))},{passive:!1})))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=v9.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let n=e.deltaY*this._options.mouseWheelScrollSensitivity,s=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&s+n===0?s=n=0:Math.abs(n)>=Math.abs(s)?s=0:n=0),this._options.flipAxes&&([n,s]=[s,n]);let r=!sS.dz&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||r)&&!s&&(s=n,n=0),e.browserEvent&&e.browserEvent.altKey&&
7(s*=this._options.fastScrollSensitivity,n*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),a={};if(n){let e=50*n,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,t)}if(s){let e=50*s,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}if(a=this._scrollable.validateScrollPosition(a),this._options.inertialScroll&&(s||n)&&!t.isPhysicalMouseWheel()){let e=!1;0===this._inertialSpeed.X&&0===this._inertialSpeed.Y&&(e=!0),this._inertialSpeed.Y=(n<0?-1:1)*Math.abs(n)**1.02,this._inertialSpeed.X=(s<0?-1:1)*Math.abs(s)**1.02,e&&this._periodicSync()}(o.scrollLeft!==a.scrollLeft||o.scrollTop!==a.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",s=t?" top":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${i||t?" top-left-corner":""}${s}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){this._mouseIsOver||this._isDragging||(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){this._mouseIsOver||this._isDragging||this._hideTimeout.cancelAndSet(()=>this._hide(),500)}}class be extends v8{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;let i=new v5({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>u(aG(e),t)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class bt extends v8{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class bi extends v8{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;let i=new v5({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>u(aG(e),t)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}class bn extends ro.JT{constructor(e,t,i,n){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=this._createDragScrollingOperation(e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class bs extends ro.JT{constructor(e,t,i,n,s,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=s,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=u(aG(r.browserEvent),()=>this._execute())}dispose(){this._animationFrameDisposable.dispose(),super.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){let e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}}class br extends bn{_createDragScrollingOperation(e,t){return new bo(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}}class bo extends bs{_getScrollSpeed(){let e=this._context.configuration.options.get(75),t=this._context.configuration.options.get(165).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){let e;let t=this._context.configuration.options.get(75),i=this._getScrollSpeed(),n=this._tick()/1e3*i*t,s="above"===this._position.outsidePosition?-n:n;this._context.viewModel.viewLayout.deltaScrollNow(0,s),this._viewHelper.renderNow();let r=this._context.viewLayout.getLinesViewportData(),o="above"===this._position.outsidePosition?r.startLineNumber:r.endLineNumber;{let t=vs(this._viewHelper.viewDomNode),i=this._context.configuration.options.get(165).horizontalScrollbarHeight,n=new ve(this._mouseEvent.pos.x,t.y+t.height-i-.1),s=vr(this._viewHelper.viewDomNode,t,n);e=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),t,n,s,null)}e.position&&e.position.lineNumber===o||(e="above"===this._position.outsidePosition?vB.createOutsideEditor(this._position.mouseColumn,new s3(o,1),"above",this._position.outsideDistance):vB.createOutsideEditor(this._position.mouseColumn,new s3(o,this._context.viewModel.getLineMaxColumn(o)),"below",this._position.outsideDistance)),this._dispatchMouse(e,!0,2),this._animationFrameDisposable=u(aG(e.element),()=>this._execute())}}class ba extends bn{_createDragScrollingOperation(e,t){return new bl(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}}class bl extends bs{_getScrollSpeed(){let e=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,t=this._context.configuration.options.get(165).contentWidth/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){let e;let t=this._context.configuration.options.get(59).typicalFullwidthCharacterWidth,i=this._getScrollSpeed(),n=this._tick()/1e3*i*t*.5,s="left"===this._position.outsidePosition?-n:n;if(this._context.viewModel.viewLayout.deltaScrollNow(s,0),this._viewHelper.renderNow(),!this._position.position)return;let r=this._position.position.lineNumber;{let t=vs(this._viewHelper.viewDomNode),i=this._context.configuration.options.get(165).horizontalScrollbarHeight,n=new ve(this._mouseEvent.pos.x,t.y+t.height-i-.1),s=vr(this._viewHelper.viewDomNode,t,n);e=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),t,n,s,null)}e="left"===this._position.outsidePosition?vB.createOutsideEditor(e.mouseColumn,new s3(r,e.mouseColumn),"left",this._position.outsideDistance):vB.createOutsideEditor(e.mouseColumn,new s3(r,e.mouseColumn),"right",this._position.outsideDistance),this._dispatchMouse(e,!0,2),this._animationFrameDisposable=u(aG(e.element),()=>this._execute())}}class bh extends vc{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new v$(this._context,i),this._mouseDownOperation=this._register(new bd(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(e,t)=>this._createMouseTarget(e,t),e=>this._getMouseColumn(e))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(165).height;let n=new va(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,e=>this._onContextMenu(e,!0))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=a6(this.viewHelper.viewDomNode.ownerDocument,"mousemove",e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new vo(e,!1,this.viewHelper.viewDomNode))}))})),this._register(n.onMouseUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e)));let s=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>{s=t})),this._register(a6(this.viewHelper.viewDomNode,ly.POINTER_UP,e=>{this._mouseDownOperation.onPointerUp()})),this._register(n.onMouseDown(this.viewHelper.viewDomNode,e=>this._onMouseDown(e,s))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){let e=v9.INSTANCE,t=0,i=fv.C.getZoomLevel(),n=!1,s=0;function r(e){return sS.dz?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}this._register(a6(this.viewHelper.viewDomNode,ly.MOUSE_WHEEL,o=>{if(this.viewController.emitMouseWheel(o),!this._context.configuration.options.get(84))return;
7let a=new oT(o);if(e.acceptStandardWheelEvent(a),e.isPhysicalMouseWheel()){if(r(o)){let e=fv.C.getZoomLevel(),t=a.deltaY>0?1:-1;fv.C.setZoomLevel(e+t),a.preventDefault(),a.stopPropagation()}}else Date.now()-t>50&&(i=fv.C.getZoomLevel(),n=r(o),s=0),t=Date.now(),s+=a.deltaY,n&&(fv.C.setZoomLevel(i+s/5),a.preventDefault(),a.stopPropagation())},{capture:!0,passive:!1}))}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(165)){let e=this._context.configuration.options.get(165).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){let i=new vt(e,t).toPageCoordinates(aG(this.viewHelper.viewDomNode)),n=vs(this.viewHelper.viewDomNode);if(i.y<n.y||i.y>n.y+n.height||i.x<n.x||i.x>n.x+n.width)return null;let s=vr(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,s,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){let t=lc(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find(e=>this.viewHelper.viewDomNode.contains(e))??null)}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime||this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),this.lastMouseLeaveTime=new Date().getTime(),this.viewController.emitMouseLeave({event:e,target:null})}_onMouseUp(e){this.viewController.emitMouseUp({event:e,target:this._createMouseTarget(e,!0)})}_onMouseDown(e,t){let i=this._createMouseTarget(e,!0),n=6===i.type||7===i.type,s=2===i.type||3===i.type||4===i.type,r=3===i.type,o=this._context.configuration.options.get(125),a=8===i.type||5===i.type,l=9===i.type,h=e.leftButton||e.middleButton;sS.dz&&e.leftButton&&e.ctrlKey&&(h=!1);let d=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(h&&(n||r&&o))d(),this._mouseDownOperation.start(i.type,e,t);else if(s)e.preventDefault();else if(a){let n=i.detail;h&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(d(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class bd extends ro.JT{constructor(e,t,i,n,s,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=s,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new vh(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new br(this._context,this._viewHelper,this._mouseTargetFactory,(e,t,i)=>this._dispatchMouse(e,t,i))),this._leftRightDragScrolling=this._register(new ba(this._context,this._viewHelper,this._mouseTargetFactory,(e,t,i)=>this._dispatchMouse(e,t,i))),this._mouseState=new bu,this._currentSelection=new s8(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);let t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):13===t.type?"above"===t.outsidePosition||"below"===t.outsidePosition?(this._topBottomDragScrolling.start(t,e),this._leftRightDragScrolling.stop()):(this._leftRightDragScrolling.start(t,e),this._topBottomDragScrolling.stop()):(this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);let n=this._findMousePosition(t,!0);if(!n||!n.position)return;this._mouseState.trySetCount(t.detail,n.position),t.detail=this._mouseState.count;let s=this._context.configuration.options;if(!s.get(104)&&s.get(42)&&!s.get(28)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,e=>this._onMouseDownThenMove(e),e=>{let t=this._findMousePosition(this._lastMouseEvent,!1);lw(e)?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,e=>this._onMouseDownThenMove(e),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop(),this._leftRightDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){let t=e.editorPos,i=this._context.viewModel,n=this._context.viewLayout,s=this._getMouseColumn(e);if(e.posy<t.y){let i=t.y-e.posy,r=Math.max(n.getCurrentScrollTop()-i,0),o=vW.getZoneAtCoord(this._context,r);if(o){let e=this._helpPositionJumpOverViewZone(o);if(e)return vB.createOutsideEditor(s,e,"above",i)}let a=n.getLineNumberAtVerticalOffset(r);return vB.createOutsideEditor(s,new s3(a,1),"above",i)}if(e.posy>t.y+t.height){let r=e.posy-t.y-t.height,o=n.getCurrentScrollTop()+e.relativePos.y,a=vW.getZoneAtCoord(this._context,o);if(a){let e=this._helpPositionJumpOverViewZone(a);if(e)return vB.createOutsideEditor(s,e,"below",r)}let l=n.getLineNumberAtVerticalOffset(o);return vB.createOutsideEditor(s,new s3(l,i.getLineMaxColumn(l)),"below",r)}let r=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y),o=this._context.configuration.options.get(165),a=o.contentLeft;if(e.relativePos.x<=a){let t=a-e.relativePos.x;return vB.createOutsideEditor(s,new s3(r,1),"left",t)}let l=0===o.minimap.minimapLeft?o.width-o.verticalScrollbarWidth:o.minimap.minimapLeft;if(e.relativePos.x>=l){let t=e.relativePos.x-l;return vB.createOutsideEditor(s,new s3(r,i.getLineMaxColumn(r)),"right",t)}return null}_findMousePosition(e,t){let i=this._getPositionOutsideEditor(e);
7if(i)return i;let n=this._createMouseTarget(e,t);if(!n.position)return null;if(8===n.type||5===n.type){let e=this._helpPositionJumpOverViewZone(n.detail);if(e)return vB.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){let t=new s3(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,n=e.positionAfter;return i&&n?i.isBefore(t)?i:n:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:6===e.type&&null!==e.detail.injectedText})}}class bu{static{this.CLEAR_MOUSE_DOWN_COUNT_TIME=400}get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){let i=new Date().getTime();i-this._lastSetMouseDownCountTime>bu.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}class bc{get event(){return this.emitter.event}constructor(e,t,i){let n=e=>this.emitter.fire(e);this.emitter=new sd.Q5({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}function bg(e,t,i,n){let s;let r=e.getPlainTextToCopy(t,i,sS.ED),o=e.model.getEOL(),a=i&&1===t.length&&t[0].isEmpty(),l=Array.isArray(r)?r:null,h=Array.isArray(r)?r.join(o):r,d=null;if(bm.forceCopyWithSyntaxHighlighting||n&&h.length<65536){let n=e.getRichTextToCopy(t,i);n&&(s=n.html,d=n.mode)}return{isFromEmptySelection:a,multicursorText:l,text:h,html:s,mode:d}}class bf{static{this.INSTANCE=new bf}constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}let bm={forceCopyWithSyntaxHighlighting:!1},bp={getTextData(e){let t=e.getData(uF.text),i=null,n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(e){}return 0===t.length&&null===i&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map(e=>e.name).join("\n"),null]:[t,i]},setTextData(e,t,i,n){e.setData(uF.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}};class b_{static{this.EMPTY=new b_("",0,0,null,void 0)}constructor(e,t,i,n,s){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=s}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){let i;let n=e.getValue(),s=e.getSelectionStart(),r=e.getSelectionEnd();return t&&n.substring(0,s)===t.value.substring(0,t.selectionStart)&&(i=t.newlineCountBeforeSelection),new b_(n,s,r,null,i)}collapseSelection(){return this.selectionStart===this.value.length?this:new b_(this.value,this.value.length,this.value.length,null,void 0)}isWrittenToTextArea(e,t){let i=this.value===e.getValue();return t?this.selectionStart===e.getSelectionStart()&&this.selectionEnd===e.getSelectionEnd()&&i:i}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){if(e<=this.selectionStart){let t=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,-1)}if(e>=this.selectionEnd){let t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,t,1)}let t=this.value.substring(this.selectionStart,e);if(-1===t.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(this.selection?.getStartPosition()??null,t,1);let i=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(this.selection?.getEndPosition()??null,i,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,s=-1;for(;-1!==(s=t.indexOf("\n",s+1));)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};let n=Math.min(r$(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(rj(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-s);let r=t.value.substring(n,t.value.length-s),o=e.selectionStart-n,a=e.selectionEnd-n;return t.selectionStart-n==t.selectionEnd-n?{text:r,replacePrevCharCnt:e.selectionStart-n,replaceNextCharCnt:0,positionDelta:0}:{text:r,replacePrevCharCnt:a-o,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};let i=Math.min(r$(e.value,t.value),e.selectionEnd),n=Math.min(rj(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart;let o=e.selectionEnd-i;t.selectionStart;let a=t.selectionEnd-i;return{text:r,replacePrevCharCnt:o,replaceNextCharCnt:s.length-o,positionDelta:a-r.length}}static fromScreenReaderContentState(e){return new b_(e.value,e.selectionStart,e.selectionEnd,e.selection,e.newlineCountBeforeSelection)}}let bv=function(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID.bind(crypto);let e=new Uint8Array(16),t=[];for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(e),e[6]=15&e[6]|64,e[8]=63&e[8]|128;let i=0;return t[e[i++]]+t[e[i++]]+t[e[i++]]+t[e[i++]]+"-"+t[e[i++]]+t[e[i++]]+"-"+t[e[i++]]+t[e[i++]]+"-"+t[e[i++]]+t[e[i++]]+"-"+t[e[i++]]+t[e[i++]]+t[e[i++]]+t[e[i++]]+t[e[i++]]+t[e[i++]]}}();var bb=function(e,t){return function(i,n){t(i,n,e)}};(i7||(i7={})).Tap="-monaco-textarea-synthetic-tap";class bC{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){let t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}let bw=class extends ro.JT{get textAreaState(){return this._textAreaState}constructor(e,t,i,n,s,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._accessibilityService=s,this._logService=r,this._onFocus=this._register(new sd.Q5),this.onFocus=this._onFocus.event,this._onBlur=this._register(new sd.Q5),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new sd.Q5),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new sd.Q5),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new sd.Q5),this.onCut=this._onCut.event,this._onPaste=this._register(new sd.Q5),this.onPaste=this._onPaste.event,this._onType=this._register(new sd.Q5),this.onType=this._onType.event,this._onCompositionStart=this._register(new sd.Q5),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new sd.Q5),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new sd.Q5),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new sd.Q5),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncFocusGainWriteScreenReaderContent=this._register(new ro.XK),this._asyncTriggerCut=this._register(new oK(()=>this._onCut.fire(),0)),this._textAreaState=b_.EMPTY,this._selectionChangeListener=null,this._accessibilityService.isScreenReaderOptimized()&&this.writeNativeTextAreaContent("ctor"),this._register(sd.ju.runAndSubscribe(this._accessibilityService.onDidChangeScreenReaderOptimized,()=>{this._accessibilityService.isScreenReaderOptimized()&&!this._asyncFocusGainWriteScreenReaderContent.value?this._asyncFocusGainWriteScreenReaderContent.value=this._register(new oK(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)):this._asyncFocusGainWriteScreenReaderContent.clear()}
7)),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(e=>{let t=new ok(e);(114===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),o=t,this._onKeyDown.fire(t)})),this._register(this._textArea.onKeyUp(e=>{let t=new ok(e);this._onKeyUp.fire(t)})),this._register(this._textArea.onCompositionStart(e=>{let t=new bC;if(this._currentComposition){this._currentComposition=t;return}if(this._currentComposition=t,2===this._OS&&o&&o.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===o.code||"ArrowLeft"===o.code)){t.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:e.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:e.data});return}this._onCompositionStart.fire({data:e.data})})),this._register(this._textArea.onCompositionUpdate(e=>{let t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){let t=b_.readFromTextArea(this._textArea,this._textAreaState),i=b_.deduceAndroidCompositionInput(this._textAreaState,t);this._textAreaState=t,this._onType.fire(i),this._onCompositionUpdate.fire(e);return}let i=t.handleCompositionUpdate(e.data);this._textAreaState=b_.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionUpdate.fire(e)})),this._register(this._textArea.onCompositionEnd(e=>{let t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){let e=b_.readFromTextArea(this._textArea,this._textAreaState),t=b_.deduceAndroidCompositionInput(this._textAreaState,e);this._textAreaState=e,this._onType.fire(t),this._onCompositionEnd.fire();return}let i=t.handleCompositionUpdate(e.data);this._textAreaState=b_.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;let t=b_.readFromTextArea(this._textArea,this._textAreaState),i=b_.deduceInput(this._textAreaState,t,2===this._OS);0===i.replacePrevCharCnt&&1===i.text.length&&(rq(i.text.charCodeAt(0))||127===i.text.charCodeAt(0))||(this._textAreaState=t,(""!==i.text||0!==i.replacePrevCharCnt||0!==i.replaceNextCharCnt||0!==i.positionDelta)&&("insertFromPaste"===e.inputType?this._onPaste.fire({text:i.text,metadata:bf.INSTANCE.get(i.text)}):this._onType.fire(i)))})),this._register(this._textArea.onCut(e=>{this._logService.trace("TextAreaInput#onCut",e),this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(e=>{this._logService.trace("TextAreaInput#onCopy",e),this._ensureClipboardGetsEditorSelection(e)})),this._register(this._textArea.onPaste(e=>{if(this._logService.trace("TextAreaInput#onPaste",e),this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=bp.getTextData(e.clipboardData);this._logService.trace("TextAreaInput#onPaste with id : ",i?.id," with text.length: ",t.length),t&&(i=i||bf.INSTANCE.get(t),this._logService.trace("TextAreaInput#onPaste (before onPaste)"),this._onPaste.fire({text:t,metadata:i}))})),this._register(this._textArea.onFocus(()=>{let e=this._hasFocus;this._setHasFocus(!0),this._accessibilityService.isScreenReaderOptimized()&&this._browser.isSafari&&!e&&this._hasFocus&&(this._asyncFocusGainWriteScreenReaderContent.value||(this._asyncFocusGainWriteScreenReaderContent.value=new oK(()=>this.writeNativeTextAreaContent("asyncFocusGain"),0)),this._asyncFocusGainWriteScreenReaderContent.value.schedule())})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}
7)),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeNativeTextAreaContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return a6(this._textArea.ownerDocument,"selectionchange",t=>{if(i0.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;let i=Date.now(),n=i-e;if(e=i,n<5)return;let s=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),s<100||!this._textAreaState.selection)return;let r=this._textArea.getValue();if(this._textAreaState.value!==r)return;let o=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===o&&this._textAreaState.selectionEnd===a)return;let l=this._textAreaState.deduceEditorPosition(o),h=this._host.deduceModelPosition(l[0],l[1],l[2]),d=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(d[0],d[1],d[2]),c=new s8(h.lineNumber,h.column,u.lineNumber,u.column);this._onSelectionChangeRequest.fire(c)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeNativeTextAreaContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.isWrittenToTextArea(this._textArea,this._hasFocus)||this._logService.trace(`writeTextAreaState(reason: ${e})`),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeNativeTextAreaContent(e){(this._accessibilityService.isScreenReaderOptimized()||"render"!==e)&&!this._currentComposition&&this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){let t;let i=this._host.getDataToCopy();this._logService.getLevel()===iq.Trace&&(t=bv());let n={version:1,id:t,isFromEmptySelection:i.isFromEmptySelection,multicursorText:i.multicursorText,mode:i.mode};bf.INSTANCE.set(this._browser.isFirefox?i.text.replace(/\r\n/g,"\n"):i.text,n),e.preventDefault(),e.clipboardData&&bp.setTextData(e.clipboardData,i.text,i.html,n),this._logService.trace("TextAreaEditContextInput#_ensureClipboardGetsEditorSelection with id : ",t," with text.length: ",i.text.length)}};bw=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([bb(4,mg),bb(5,dM)],bw);class by extends ro.JT{get ownerDocument(){return this._actual.ownerDocument}
7constructor(e){super(),this._actual=e,this._onSyntheticTap=this._register(new sd.Q5),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this.onKeyDown=this._register(new bc(this._actual,"keydown")).event,this.onKeyPress=this._register(new bc(this._actual,"keypress")).event,this.onKeyUp=this._register(new bc(this._actual,"keyup")).event,this.onCompositionStart=this._register(new bc(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new bc(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new bc(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new bc(this._actual,"beforeinput")).event,this.onInput=this._register(new bc(this._actual,"input")).event,this.onCut=this._register(new bc(this._actual,"cut")).event,this.onCopy=this._register(new bc(this._actual,"copy")).event,this.onPaste=this._register(new bc(this._actual,"paste")).event,this.onFocus=this._register(new bc(this._actual,"focus")).event,this.onBlur=this._register(new bc(this._actual,"blur")).event,this._register(this.onKeyDown(()=>i0.onKeyDown())),this._register(this.onBeforeInput(()=>i0.onBeforeInput())),this._register(this.onInput(()=>i0.onInput())),this._register(this.onKeyUp(()=>i0.onKeyUp())),this._register(a6(this._actual,i7.Tap,()=>
7this._onSyntheticTap.fire()))}hasFocus(){let e=lc(this._actual);return e?e.activeElement===this._actual:!!this._actual.isConnected&&lg()===this._actual}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){let i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){let n=this._actual,s=null,r=lc(n),o=aG(s=r?r.activeElement:lg()),a=s===n,l=n.selectionStart,h=n.selectionEnd;if(a&&l===t&&h===i){ol&&o.parent!==o&&n.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),ol&&o.parent!==o&&n.focus();return}try{let e=function(e){let t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}(n,e)}catch(e){}}}class bS extends bh{constructor(e,t,i){super(e,t,i),this._register(vG.addTarget(this.viewHelper.linesContentDomNode)),this._register(a6(this.viewHelper.linesContentDomNode,i6.Tap,e=>this.onTap(e))),this._register(a6(this.viewHelper.linesContentDomNode,i6.Change,e=>this.onChange(e))),this._register(a6(this.viewHelper.linesContentDomNode,i6.Contextmenu,e=>this._onContextMenu(new vo(e,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(a6(this.viewHelper.linesContentDomNode,"pointerdown",e=>{let t=e.pointerType;if("mouse"===t){this._lastPointerType="mouse";return}"touch"===t?this._lastPointerType="touch":this._lastPointerType="pen"}));let n=new vl(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,e=>this._onMouseMove(e))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,e=>this._onMouseUp(e))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,e=>this._onMouseLeave(e))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(e,t)=>this._onMouseDown(e,t)))}onTap(e){e.initialTarget&&this.viewHelper.linesContentDomNode.contains(e.initialTarget)&&(e.preventDefault(),this.viewHelper.focusTextArea(),this._dispatchGesture(e,!1))}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY),"pen"===this._lastPointerType&&this._dispatchGesture(e,!0)}_dispatchGesture(e,t){let i=this._createMouseTarget(new vo(e,!1,this.viewHelper.viewDomNode),!1);i.position&&this.viewController.dispatchMouse({position:i.position,mouseColumn:i.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:t,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===i.type&&null!==i.detail.injectedText})}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}}class bL extends bh{constructor(e,t,i){super(e,t,i),this._register(vG.addTarget(this.viewHelper.linesContentDomNode)),this._register(a6(this.viewHelper.linesContentDomNode,i6.Tap,e=>this.onTap(e))),this._register(a6(this.viewHelper.linesContentDomNode,i6.Change,e=>this.onChange(e))),this._register(a6(this.viewHelper.linesContentDomNode,i6.Contextmenu,e=>this._onContextMenu(new vo(e,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();let t=this._createMouseTarget(new vo(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){let e=document.createEvent("CustomEvent");e.initEvent(i7.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class bx extends ro.JT{constructor(e,t,i){super(),(sS.gn||sS.Dt&&sS.tq)&&op.pointerEvents?this.handler=this._register(new bS(e,t,i)):rb.TouchEvent?this.handler=this._register(new bL(e,t,i)):this.handler=this._register(new bh(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}function bk(e,t,i){let n=rM(e);return -1===n&&(n=e.length),function(e,t,i){let n=0;for(let i=0;i<e.length;i++)"	"===e.charAt(i)?n=vR.nextIndentTabStop(n,t):n++;let s="";if(!i){let e=Math.floor(n/t);n%=t;for(let t=0;t<e;t++)s+="	"}for(let e=0;e<n;e++)s+=" ";return s}(e.substring(0,n),t,i)+e.substring(n)}let bN=()=>!0,bD=()=>!1,bE=e=>" "===e||"	"===e;class bT{static shouldRecreate(e){return e.hasChanged(165)||e.hasChanged(148)||e.hasChanged(45)||e.hasChanged(85)||e.hasChanged(88)||e.hasChanged(89)||e.hasChanged(10)||e.hasChanged(11)||e.hasChanged(15)||e.hasChanged(13)||e.hasChanged(14)||e.hasChanged(20)||e.hasChanged(145)||e.hasChanged(141)||e.hasChanged(59)||e.hasChanged(104)||e.hasChanged(147)||e.hasChanged(93)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;let s=i.options,r=s.get(165),o=s.get(59);this.readOnly=s.get(104),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(132),this.lineHeight=o.lineHeight,this.typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=s.get(145),this.trimWhitespaceOnDelete=s.get(141),this.wordSeparators=s.get(148),this.emptySelectionClipboard=s.get(45),this.copyWithSyntaxHighlighting=s.get(31),this.multiCursorMergeOverlapping=s.get(85),this.multiCursorPaste=s.get(88),this.multiCursorLimit=s.get(89),this.autoClosingBrackets=s.get(10),this.autoClosingComments=s.get(11),this.autoClosingQuotes=s.get(15),this.autoClosingDelete=s.get(13),this.autoClosingOvertype=s.get(14),this.autoSurround=s.get(20),this.autoIndent=s.get(16),this.wordSegmenterLocales=s.get(147),this.overtypeOnPaste=s.get(93),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();let a=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(a)for(let e of a)this.surroundingPairs[e.open]=e.close;let l=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=l?.blockCommentStartToken??null}get electricChars(){if(!this._electricChars){this._electricChars={};let e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter?.getElectricCharacters();if(e)for(let t of e)this._electricChars[t]=!0}return this._electricChars}get inputMode(){return mp.getInputMode()}onElectricCharacter(e,t,i){let n=ud(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return s?s.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return bk(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return bE;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return bN;case"never":return bD}}_getLanguageDefinedShouldAutoClose(e,t){let i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>-1!==i.indexOf(e)}visibleColumnFromColumn(e,t){return vR.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){let n=vR.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),s=e.getLineMinColumn(t);if(n<s)return s;let r=e.getLineMaxColumn(t);return n>r?r:n}}class bI{static fromModelState(e){return new bM(e)}static fromViewState(e){return new bR(e)}
7static fromModelSelection(e){let t=s8.liftSelection(e),i=new bA(s9.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return bI.fromModelState(i)}static fromModelSelections(e){let t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this.fromModelSelection(e[i]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}}class bM{constructor(e){this.modelState=e,this.viewState=null}}class bR{constructor(e){this.modelState=null,this.viewState=e}}class bA{constructor(e,t,i,n,s){this.selectionStart=e,this.selectionStartKind=t,this.selectionStartLeftoverVisibleColumns=i,this.position=n,this.leftoverVisibleColumns=s,this._singleCursorStateBrand=void 0,this.selection=bA._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,n){return e?new bA(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new s3(t,i),n):new bA(new s9(t,i,t,i),0,n,new s3(t,i),n)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?s8.fromPositions(e.getStartPosition(),t):s8.fromPositions(e.getEndPosition(),t)}}class bO{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function bP(e){return"'"===e||'"'===e||"`"===e}class bF{static columnSelect(e,t,i,n,s,r){let o=Math.abs(s-i)+1,a=i>s,l=n>r,h=n<r,d=[];for(let s=0;s<o;s++){let o=i+(a?-s:s),u=e.columnFromVisibleColumn(t,o,n),c=e.columnFromVisibleColumn(t,o,r),g=e.visibleColumnFromColumn(t,new s3(o,u)),f=e.visibleColumnFromColumn(t,new s3(o,c));h&&(g>r||f<n)||l&&(f>n||g<r)||d.push(new bA(new s9(o,u,o,u),0,0,new s3(o,c),0))}if(0===d.length)for(let e=0;e<o;e++){let n=i+(a?-e:e),s=t.getLineMaxColumn(n);d.push(new bA(new s9(n,s,n,s),0,0,new s3(n,s),0))}return{viewStates:d,reversed:a,fromLineNumber:i,fromVisualColumn:n,toLineNumber:s,toVisualColumn:r}}static columnSelectLeft(e,t,i){let n=i.toViewVisualColumn;return n>0&&n--,bF.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0,s=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let i=s;i<=r;i++){let s=t.getLineMaxColumn(i);n=Math.max(n,e.visibleColumnFromColumn(t,new s3(i,s)))}let o=i.toViewVisualColumn;return o<n&&o++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,o)}static columnSelectUp(e,t,i,n){let s=n?e.pageSize:1,r=Math.max(1,i.toViewLineNumber-s);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,r,i.toViewVisualColumn)}static columnSelectDown(e,t,i,n){let s=n?e.pageSize:1,r=Math.min(t.getLineCount(),i.toViewLineNumber+s);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,r,i.toViewVisualColumn)}}class bB{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return s8.fromPositions(i.getEndPosition())}}class bV{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){let i=this._range.getStartPosition(),n=this._range.getEndPosition(),s=n.lineNumber,r=bK(e,n,this._text.length+(this._range.isEmpty()?0:-1));r.lineNumber>s&&(r=new s3(s,e.getLineMaxColumn(s)));let o=s9.fromPositions(i,r);t.addTrackedEditOperation(o,this._text)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return s8.fromPositions(i.getEndPosition())}}class bW{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return s8.fromPositions(i.getStartPosition())}}class bH{constructor(e,t,i,n,s=!1){this._range=e,this._text=t,this._columnDeltaOffset=n,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=s}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return s8.fromPositions(i.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class bz{constructor(e){this._range=e}getEditOperations(e,t){let i=e.getValueInRange(this._range),n=this._range.getEndPosition(),s=n.lineNumber,r=bK(e,n,i.length);r.lineNumber>s&&(r=new s3(s,e.getLineMaxColumn(s)));let o=s9.fromPositions(n,r);t.addTrackedEditOperation(o,"")}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return s8.fromPositions(i.getEndPosition())}}class bU{constructor(e,t,i,n=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=n,this._selectionId=null}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text,this._forceMoveMarkers),this._selectionId=t.trackSelection(this._initialSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function bK(e,t,i){if(i<0)throw Error("Unexpected negative delta");let n=e.getLineCount(),s=new s3(n,e.getLineMaxColumn(n));for(let r=t.lineNumber;r<=n;r++)if(r===t.lineNumber){let n=i-e.getLineMaxColumn(t.lineNumber)+t.column;if(n<=0){s=new s3(t.lineNumber,t.column+i);break}i=n}else{let t=i-e.getLineMaxColumn(r);if(t<=0){s=new s3(r,i);break}i=t}return s}class b${constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class bj{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-r1(e.getLineContent(t.lineNumber),t.column-1));if(!(t.lineNumber>1))return t;{let i=t.lineNumber-1;return new s3(i,e.getLineMaxColumn(i))}}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){let n=e.getLineMinColumn(t.lineNumber),s=e.getLineContent(t.lineNumber),r=vA.atomicPosition(s,t.column-1,i,0);if(-1!==r&&r+1>=n)return new s3(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){let n=e.stickyTabStops?bj.leftPositionAtomicSoftTabs(t,i,e.tabSize):bj.leftPosition(t,i);return new b$(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,s){let r,o;
7if(i.hasSelection()&&!n)r=i.selection.startLineNumber,o=i.selection.startColumn;else{let n=i.position.delta(void 0,-(s-1)),a=t.normalizePosition(bj.clipPositionColumn(n,t),0),l=bj.left(e,t,a);r=l.lineNumber,o=l.column}return i.move(n,r,o,0)}static clipPositionColumn(e,t){return new s3(e.lineNumber,bj.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i+=rX(e.getLineContent(t),i-1):t<e.getLineCount()&&(t+=1,i=e.getLineMinColumn(t)),new s3(t,i)}static rightPositionAtomicSoftTabs(e,t,i,n,s){if(i<e.getLineIndentColumn(t)){let s=e.getLineContent(t),r=vA.atomicPosition(s,i-1,n,1);if(-1!==r)return new s3(t,r+1)}return this.rightPosition(e,t,i)}static right(e,t,i){let n=e.stickyTabStops?bj.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):bj.rightPosition(t,i.lineNumber,i.column);return new b$(n.lineNumber,n.column,0)}static moveRight(e,t,i,n,s){let r,o;if(i.hasSelection()&&!n)r=i.selection.endLineNumber,o=i.selection.endColumn;else{let n=i.position.delta(void 0,s-1),a=t.normalizePosition(bj.clipPositionColumn(n,t),1),l=bj.right(e,t,a);r=l.lineNumber,o=l.column}return i.move(n,r,o,0)}static vertical(e,t,i,n,s,r,o,a){let l=vR.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize)+s,h=t.getLineCount(),d=1===i&&1===n,u=i===h&&n===t.getLineMaxColumn(i),c=r<i?d:u;if((i=r)<1?(i=1,n=o?t.getLineMinColumn(i):Math.min(t.getLineMaxColumn(i),n)):i>h?(i=h,n=o?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),s=c?0:l-vR.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){let e=new s3(i,n),r=t.normalizePosition(e,a);s+=n-r.column,i=r.lineNumber,n=r.column}return new b$(i,n,s)}static down(e,t,i,n,s,r,o){return this.vertical(e,t,i,n,s,i+r,o,4)}static moveDown(e,t,i,n,s){let r,o,a;i.hasSelection()&&!n?(r=i.selection.endLineNumber,o=i.selection.endColumn):(r=i.position.lineNumber,o=i.position.column);let l=0;do if(a=bj.down(e,t,r+l,o,i.leftoverVisibleColumns,s,!0),t.normalizePosition(new s3(a.lineNumber,a.column),2).lineNumber>r)break;while(l++<10&&r+l<t.getLineCount());return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateDown(e,t,i){let n=i.selection,s=bj.down(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),r=bj.down(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new bA(new s9(s.lineNumber,s.column,s.lineNumber,s.column),0,s.leftoverVisibleColumns,new s3(r.lineNumber,r.column),r.leftoverVisibleColumns)}static up(e,t,i,n,s,r,o){return this.vertical(e,t,i,n,s,i-r,o,3)}static moveUp(e,t,i,n,s){let r,o;i.hasSelection()&&!n?(r=i.selection.startLineNumber,o=i.selection.startColumn):(r=i.position.lineNumber,o=i.position.column);let a=bj.up(e,t,r,o,i.leftoverVisibleColumns,s,!0);return i.move(n,a.lineNumber,a.column,a.leftoverVisibleColumns)}static translateUp(e,t,i){let n=i.selection,s=bj.up(e,t,n.selectionStartLineNumber,n.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),r=bj.up(e,t,n.positionLineNumber,n.positionColumn,i.leftoverVisibleColumns,1,!1);return new bA(new s9(s.lineNumber,s.column,s.lineNumber,s.column),0,s.leftoverVisibleColumns,new s3(r.lineNumber,r.column),r.leftoverVisibleColumns)}static _isBlankLine(e,t){return 0===e.getLineFirstNonWhitespaceColumn(t)}static moveToPrevBlankLine(e,t,i,n){let s=i.position.lineNumber;for(;s>1&&this._isBlankLine(t,s);)s--;for(;s>1&&!this._isBlankLine(t,s);)s--;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToNextBlankLine(e,t,i,n){let s=t.getLineCount(),r=i.position.lineNumber;for(;r<s&&this._isBlankLine(t,r);)r++;for(;r<s&&!this._isBlankLine(t,r);)r++;return i.move(n,r,t.getLineMinColumn(r),0)}static moveToBeginningOfLine(e,t,i,n){let s;let r=i.position.lineNumber,o=t.getLineMinColumn(r),a=t.getLineFirstNonWhitespaceColumn(r)||o;return s=i.position.column===a?o:a,i.move(n,r,s,0)}static moveToEndOfLine(e,t,i,n,s){let r=i.position.lineNumber,o=t.getLineMaxColumn(r);return i.move(n,r,o,s?1073741824-o:0)}static moveToBeginningOfBuffer(e,t,i,n){return i.move(n,1,1,0)}static moveToEndOfBuffer(e,t,i,n){let s=t.getLineCount(),r=t.getLineMaxColumn(s);return i.move(n,s,r,0)}}class bq{static deleteRight(e,t,i,n){let s=[],r=3!==e;for(let e=0,o=n.length;e<o;e++){let o=n[e],a=this.getDeleteRightRange(o,i,t);
7if(a.isEmpty()){s[e]=null;continue}a.startLineNumber!==a.endLineNumber&&(r=!0),s[e]=new bB(a,"")}return[r,s]}static getDeleteRightRange(e,t,i){if(!e.isEmpty())return e;let n=e.getPosition(),s=bj.right(i,t,n);if(i.trimWhitespaceOnDelete&&s.lineNumber!==n.lineNumber){let e=t.getLineFirstNonWhitespaceColumn(n.lineNumber)>0,i=t.getLineFirstNonWhitespaceColumn(s.lineNumber);if(e&&i>0)return new s9(s.lineNumber,i,n.lineNumber,n.column)}return new s9(s.lineNumber,s.column,n.lineNumber,n.column)}static isAutoClosingPairDelete(e,t,i,n,s,r,o){if("never"===t&&"never"===i||"never"===e)return!1;for(let a=0,l=r.length;a<l;a++){let l=r[a],h=l.getPosition();if(!l.isEmpty())return!1;let d=s.getLineContent(h.lineNumber);if(h.column<2||h.column>=d.length+1)return!1;let u=d.charAt(h.column-2),c=n.get(u);if(!c)return!1;if(bP(u)){if("never"===i)return!1}else if("never"===t)return!1;let g=d.charAt(h.column-1),f=!1;for(let e of c)e.open===u&&e.close===g&&(f=!0);if(!f)return!1;if("auto"===e){let e=!1;for(let t=0,i=o.length;t<i;t++){let i=o[t];if(h.lineNumber===i.startLineNumber&&h.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){let n=[];for(let e=0,t=i.length;e<t;e++){let t=i[e].getPosition(),s=new s9(t.lineNumber,t.column-1,t.lineNumber,t.column+1);n[e]=new bB(s,"")}return[!0,n]}static deleteLeft(e,t,i,n,s){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,n,s))return this._runAutoClosingPairDelete(t,i,n);let r=[],o=2!==e;for(let e=0,s=n.length;e<s;e++){let s=bq.getDeleteLeftRange(n[e],i,t);if(s.isEmpty()){r[e]=null;continue}s.startLineNumber!==s.endLineNumber&&(o=!0),r[e]=new bB(s,"")}return[o,r]}static getDeleteLeftRange(e,t,i){if(!e.isEmpty())return e;let n=e.getPosition();if(i.useTabStops&&n.column>1){let e=t.getLineContent(n.lineNumber),s=rM(e),r=-1===s?e.length+1:s+1;if(n.column<=r){let e=i.visibleColumnFromColumn(t,n),s=vR.prevIndentTabStop(e,i.indentSize),r=i.columnFromVisibleColumn(t,n.lineNumber,s);return new s9(n.lineNumber,r,n.lineNumber,n.column)}}return s9.fromPositions(bq.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){let i=function(e,t){if(0===e)return 0;let i=function(e,t){var i;let n=new rJ(t,e),s=n.prevCodePoint();for(;127995<=(i=s)&&i<=127999||65039===s||8419===s;){if(0===n.offset)return;s=n.prevCodePoint()}if(!r7(s))return;let r=n.offset;return r>0&&8205===n.prevCodePoint()&&(r=n.offset),r}(e,t);if(void 0!==i)return i;let n=new rJ(t,e);return n.prevCodePoint(),n.offset}(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(!(e.lineNumber>1))return e;{let i=e.lineNumber-1;return new s3(i,t.getLineMaxColumn(i))}}static cut(e,t,i){let n=[],s=null;i.sort((e,t)=>s3.compare(e.getStartPosition(),t.getEndPosition()));for(let r=0,o=i.length;r<o;r++){let o=i[r];if(o.isEmpty()){if(e.emptySelectionClipboard){let e,i,a,l;let h=o.getPosition();h.lineNumber<t.getLineCount()?(e=h.lineNumber,i=1,a=h.lineNumber+1,l=1):(h.lineNumber>1&&s?.endLineNumber!==h.lineNumber?(e=h.lineNumber-1,i=t.getLineMaxColumn(h.lineNumber-1)):(e=h.lineNumber,i=1),a=h.lineNumber,l=t.getLineMaxColumn(h.lineNumber));let d=new s9(e,i,a,l);s=d,d.isEmpty()?n[r]=null:n[r]=new bB(d,"")}else n[r]=null}else n[r]=new bB(o,"")}return new bO(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class bG{static _createWord(e,t,i,n,s){return{start:n,end:s,wordType:t,nextCharClass:i}}static _createIntlWord(e,t){return{start:e.index,end:e.index+e.segment.length,wordType:1,nextCharClass:t}}static _findPreviousWordOnLine(e,t,i){let n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0,s=t.findPrevIntlWordBeforeOrAtOffset(e,i.column-2);for(let r=i.column-2;r>=0;r--){let i=e.charCodeAt(r),o=t.get(i);if(s&&r===s.index)return this._createIntlWord(s,o);if(0===o){if(2===n)return this._createWord(e,n,o,r+1,this._findEndOfWord(e,t,n,r+1));n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,r+1,this._findEndOfWord(e,t,n,r+1));n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,r+1,this._findEndOfWord(e,t,n,r+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){let s=t.findNextIntlWordAtOrAfterOffset(e,n),r=e.length;for(let o=n;o<r;o++){let n=e.charCodeAt(o),r=t.get(n);if(s&&o===s.index+s.segment.length||1===r||1===i&&2===r||2===i&&0===r)return o}return r}static _findNextWordOnLine(e,t,i){let n=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(n,e,i)}static _doFindNextWordOnLine(e,t,i){let n=0,s=e.length,r=t.findNextIntlWordAtOrAfterOffset(e,i.column-1);for(let o=i.column-1;o<s;o++){let i=e.charCodeAt(o),s=t.get(i);if(r&&o===r.index)return this._createIntlWord(r,s);
7if(0===s){if(2===n)return this._createWord(e,n,s,this._findStartOfWord(e,t,n,o-1),o);n=1}else if(2===s){if(1===n)return this._createWord(e,n,s,this._findStartOfWord(e,t,n,o-1),o);n=2}else if(1===s&&0!==n)return this._createWord(e,n,s,this._findStartOfWord(e,t,n,o-1),o)}return 0!==n?this._createWord(e,n,1,this._findStartOfWord(e,t,n,s-1),s):null}static _findStartOfWord(e,t,i,n){let s=t.findPrevIntlWordBeforeOrAtOffset(e,n);for(let r=n;r>=0;r--){let n=e.charCodeAt(r),o=t.get(n);if(s&&r===s.index)return r;if(1===o||1===i&&2===o||2===i&&0===o)return r+1}return 0}static moveWordLeft(e,t,i,n,s){let r=i.lineNumber,o=i.column;1===o&&r>1&&(r-=1,o=t.getLineMaxColumn(r));let a=bG._findPreviousWordOnLine(e,t,new s3(r,o));if(0===n)return new s3(r,a?a.start+1:1);if(1===n)return!s&&a&&2===a.wordType&&a.end-a.start==1&&0===a.nextCharClass&&(a=bG._findPreviousWordOnLine(e,t,new s3(r,a.start+1))),new s3(r,a?a.start+1:1);if(3===n){for(;a&&2===a.wordType;)a=bG._findPreviousWordOnLine(e,t,new s3(r,a.start+1));return new s3(r,a?a.start+1:1)}return a&&o<=a.end+1&&(a=bG._findPreviousWordOnLine(e,t,new s3(r,a.start+1))),new s3(r,a?a.end+1:1)}static _moveWordPartLeft(e,t){let i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new s3(i-1,e.getLineMaxColumn(i-1)):t;let s=e.getLineContent(i);for(let e=t.column-1;e>1;e--){let t=s.charCodeAt(e-2),r=s.charCodeAt(e-1);if(95===t&&95!==r||45===t&&45!==r||(rW(t)||rV(t))&&rH(r))return new s3(i,e);if(rH(t)&&rH(r)&&e+1<n){let t=s.charCodeAt(e);if(rW(t)||rV(t))return new s3(i,e)}}return new s3(i,1)}static moveWordRight(e,t,i,n){let s=i.lineNumber,r=i.column,o=!1;r===t.getLineMaxColumn(s)&&s<t.getLineCount()&&(o=!0,s+=1,r=1);let a=bG._findNextWordOnLine(e,t,new s3(s,r));if(2===n)a&&2===a.wordType&&a.end-a.start==1&&0===a.nextCharClass&&(a=bG._findNextWordOnLine(e,t,new s3(s,a.end+1))),r=a?a.end+1:t.getLineMaxColumn(s);else if(3===n){for(o&&(r=0);a&&(2===a.wordType||a.start+1<=r);)a=bG._findNextWordOnLine(e,t,new s3(s,a.end+1));r=a?a.start+1:t.getLineMaxColumn(s)}else a&&!o&&r>=a.start+1&&(a=bG._findNextWordOnLine(e,t,new s3(s,a.end+1))),r=a?a.start+1:t.getLineMaxColumn(s);return new s3(s,r)}static _moveWordPartRight(e,t){let i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i<e.getLineCount()?new s3(i+1,1):t;let s=e.getLineContent(i);for(let e=t.column+1;e<n;e++){let t=s.charCodeAt(e-2),r=s.charCodeAt(e-1);if(95!==t&&95===r||45!==t&&45===r||(rW(t)||rV(t))&&rH(r))return new s3(i,e);if(rH(t)&&rH(r)&&e+1<n){let t=s.charCodeAt(e);if(rW(t)||rV(t))return new s3(i,e)}}return new s3(i,n)}static _deleteWordLeftWhitespace(e,t){let i=e.getLineContent(t.lineNumber),n=t.column-2,s=rA(i,n);return s+1<n?new s9(t.lineNumber,s+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){let i=e.wordSeparators,n=e.model,s=e.selection,r=e.whitespaceHeuristics;if(!s.isEmpty())return s;if(bq.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){let t=e.selection.getPosition();return new s9(t.lineNumber,t.column-1,t.lineNumber,t.column+1)}let o=new s3(s.positionLineNumber,s.positionColumn),a=o.lineNumber,l=o.column;if(1===a&&1===l)return null;if(r){let e=this._deleteWordLeftWhitespace(n,o);if(e)return e}let h=bG._findPreviousWordOnLine(i,n,o);return 0===t?h?l=h.start+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a)):(h&&l<=h.end+1&&(h=bG._findPreviousWordOnLine(i,n,new s3(a,h.start+1))),h?l=h.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new s9(a,l,o.lineNumber,o.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;let n=new s3(i.positionLineNumber,i.positionColumn);return this._deleteInsideWordWhitespace(t,n)||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){let i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){let i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let s=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,s))return null;let r=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,r))return null;for(;s>0&&this._charAtIsWhitespace(i,s-1);)s--;for(;r+1<n&&this._charAtIsWhitespace(i,r+1);)r++;return new s9(t.lineNumber,s+1,t.lineNumber,r+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){let n,s;let r=t.getLineContent(i.lineNumber),o=r.length;if(0===o)return i.lineNumber>1?new s9(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new s9(i.lineNumber,1,i.lineNumber+1,1):new s9(i.lineNumber,1,i.lineNumber,1);let a=(e,t)=>
7(e=Math.min(e,i.column),t=Math.max(t,i.column),new s9(i.lineNumber,e,i.lineNumber,t)),l=e=>{let t=e.start+1,i=e.end+1,n=!1;for(;i-1<o&&this._charAtIsWhitespace(r,i-1);)n=!0,i++;if(!n)for(;t>1&&this._charAtIsWhitespace(r,t-2);)t--;return a(t,i)},h=bG._findPreviousWordOnLine(e,t,i);if(h&&(n=h).start+1<=i.column&&i.column<=n.end+1)return l(h);let d=bG._findNextWordOnLine(e,t,i);return d&&(s=d).start+1<=i.column&&i.column<=s.end+1?l(d):h&&d?a(h.end+1,d.start+1):h?a(h.start+1,h.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;let i=t.getPosition(),n=bG._moveWordPartLeft(e,i);return new s9(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){let i=e.length;for(let n=t;n<i;n++){let t=e.charAt(n);if(" "!==t&&"	"!==t)return n}return i}static _deleteWordRightWhitespace(e,t){let i=e.getLineContent(t.lineNumber),n=t.column-1,s=this._findFirstNonWhitespaceChar(i,n);return n+1<s?new s9(t.lineNumber,t.column,t.lineNumber,s+1):null}static deleteWordRight(e,t){let i=e.wordSeparators,n=e.model,s=e.selection,r=e.whitespaceHeuristics;if(!s.isEmpty())return s;let o=new s3(s.positionLineNumber,s.positionColumn),a=o.lineNumber,l=o.column,h=n.getLineCount(),d=n.getLineMaxColumn(a);if(a===h&&l===d)return null;if(r){let e=this._deleteWordRightWhitespace(n,o);if(e)return e}let u=bG._findNextWordOnLine(i,n,o);return 2===t?u?l=u.end+1:l<d||a===h?l=d:(a++,l=(u=bG._findNextWordOnLine(i,n,new s3(a,1)))?u.start+1:n.getLineMaxColumn(a)):(u&&l>=u.start+1&&(u=bG._findNextWordOnLine(i,n,new s3(a,u.end+1))),u?l=u.start+1:l<d||a===h?l=d:(a++,l=(u=bG._findNextWordOnLine(i,n,new s3(a,1)))?u.start+1:n.getLineMaxColumn(a))),new s9(a,l,o.lineNumber,o.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;let i=t.getPosition(),n=bG._moveWordPartRight(e,i);return new s9(i.lineNumber,i.column,n.lineNumber,n.column)}static _createWordAtPosition(e,t,i){let n=new s9(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(n),startColumn:n.startColumn,endColumn:n.endColumn}}static getWordAtPosition(e,t,i,n){let s=cT(t,i),r=bG._findPreviousWordOnLine(s,e,n);if(r&&1===r.wordType&&r.start<=n.column-1&&n.column-1<=r.end)return bG._createWordAtPosition(e,n.lineNumber,r);let o=bG._findNextWordOnLine(s,e,n);return o&&1===o.wordType&&o.start<=n.column-1&&n.column-1<=o.end?bG._createWordAtPosition(e,n.lineNumber,o):null}static word(e,t,i,n,s){let r,o,a;let l=cT(e.wordSeparators,e.wordSegmenterLocales),h=bG._findPreviousWordOnLine(l,t,s),d=bG._findNextWordOnLine(l,t,s);if(!n){let e,i;return h&&1===h.wordType&&h.start<=s.column-1&&s.column-1<=h.end?(e=h.start+1,i=h.end+1):h&&2===h.wordType&&h.start<=s.column-1&&s.column-1<h.end?(e=h.start+1,i=h.end+1):d&&1===d.wordType&&d.start<=s.column-1&&s.column-1<=d.end?(e=d.start+1,i=d.end+1):d&&2===d.wordType&&d.start<=s.column-1&&s.column-1<d.end?(e=d.start+1,i=d.end+1):(e=h?h.end+1:1,i=d?d.start+1:t.getLineMaxColumn(s.lineNumber)),new bA(new s9(s.lineNumber,e,s.lineNumber,i),1,0,new s3(s.lineNumber,i),0)}h&&1===h.wordType&&h.start<s.column-1&&s.column-1<h.end?(r=h.start+1,o=h.end+1):d&&1===d.wordType&&d.start<s.column-1&&s.column-1<d.end?(r=d.start+1,o=d.end+1):(r=s.column,o=s.column);let u=s.lineNumber;if(i.selectionStart.containsPosition(s))a=i.selectionStart.endColumn;else if(s.isBeforeOrEqual(i.selectionStart.getStartPosition())){let e=new s3(u,a=r);i.selectionStart.containsPosition(e)&&(a=i.selectionStart.endColumn)}else{let e=new s3(u,a=o);i.selectionStart.containsPosition(e)&&(a=i.selectionStart.startColumn)}return i.move(!0,u,a,0)}}class bQ{static addCursorDown(e,t,i){let n=[],s=0;for(let r=0,o=t.length;r<o;r++){let o=t[r];n[s++]=new bI(o.modelState,o.viewState),i?n[s++]=bI.fromModelState(bj.translateDown(e.cursorConfig,e.model,o.modelState)):n[s++]=bI.fromViewState(bj.translateDown(e.cursorConfig,e,o.viewState))}return n}static addCursorUp(e,t,i){let n=[],s=0;for(let r=0,o=t.length;r<o;r++){let o=t[r];n[s++]=new bI(o.modelState,o.viewState),i?n[s++]=bI.fromModelState(bj.translateUp(e.cursorConfig,e.model,o.modelState)):n[s++]=bI.fromViewState(bj.translateUp(e.curs
7orConfig,e,o.viewState))}return n}static moveToBeginningOfLine(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s];n[s]=this._moveToLineStart(e,r,i)}return n}static _moveToLineStart(e,t,i){let n=t.viewState.position.column,s=t.modelState.position.column,r=t.viewState.position.lineNumber,o=e.getLineFirstNonWhitespaceColumn(r);return n!==s&&n!==o?this._moveToLineStartByView(e,t,i):this._moveToLineStartByModel(e,t,i)}static _moveToLineStartByView(e,t,i){return bI.fromViewState(bj.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return bI.fromModelState(bj.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,n){let s=[];for(let r=0,o=t.length;r<o;r++){let o=t[r];s[r]=this._moveToLineEnd(e,o,i,n)}return s}static _moveToLineEnd(e,t,i,n){let s=t.viewState.position,r=e.getLineMaxColumn(s.lineNumber),o=s.column===r,a=t.modelState.position,l=e.model.getLineMaxColumn(a.lineNumber),h=r-s.column==l-a.column;return o||h?this._moveToLineEndByModel(e,t,i,n):this._moveToLineEndByView(e,t,i,n)}static _moveToLineEndByView(e,t,i,n){return bI.fromViewState(bj.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,n))}static _moveToLineEndByModel(e,t,i,n){return bI.fromModelState(bj.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,n))}static expandLineSelection(e,t){let i=[];for(let n=0,s=t.length;n<s;n++){let s;let r=t[n],o=r.modelState.selection.startLineNumber,a=e.model.getLineCount(),l=r.modelState.selection.endLineNumber;l===a?s=e.model.getLineMaxColumn(a):(l++,s=1),i[n]=bI.fromModelState(new bA(new s9(o,1,o,1),0,0,new s3(l,s),0))}return i}static moveToBeginningOfBuffer(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s];n[s]=bI.fromModelState(bj.moveToBeginningOfBuffer(e.cursorConfig,e.model,r.modelState,i))}return n}static moveToEndOfBuffer(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s];n[s]=bI.fromModelState(bj.moveToEndOfBuffer(e.cursorConfig,e.model,r.modelState,i))}return n}static selectAll(e,t){let i=e.model.getLineCount(),n=e.model.getLineMaxColumn(i);return bI.fromModelState(new bA(new s9(1,1,1,1),0,0,new s3(i,n),0))}static line(e,t,i,n,s){let r=e.model.validatePosition(n),o=s?e.coordinatesConverter.validateViewPosition(new s3(s.lineNumber,s.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);if(!i){let t=e.model.getLineCount(),i=r.lineNumber+1,n=1;return i>t&&(i=t,n=e.model.getLineMaxColumn(i)),bI.fromModelState(new bA(new s9(r.lineNumber,1,i,n),2,0,new s3(i,n),0))}let a=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumber<a)return bI.fromViewState(t.viewState.move(!0,o.lineNumber,1,0));if(r.lineNumber>a){let i=e.getLineCount(),n=o.lineNumber+1,s=1;return n>i&&(n=i,s=e.getLineMaxColumn(n)),bI.fromViewState(t.viewState.move(!0,n,s,0))}{let e=t.modelState.selectionStart.getEndPosition();return bI.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,i,n){let s=e.model.validatePosition(n);return bI.fromModelState(bG.word(e.cursorConfig,e.model,t.modelState,i,s))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new bI(t.modelState,t.viewState);let i=t.viewState.position.lineNumber,n=t.viewState.position.column;return bI.fromViewState(new bA(new s9(i,n,i,n),0,0,new s3(i,n),0))}static moveTo(e,t,i,n,s){if(i){if(1===t.modelState.selectionStartKind)return this.word(e,t,i,n);if(2===t.modelState.selectionStartKind)return this.line(e,t,i,n,s)}let r=e.model.validatePosition(n),o=s?e.coordinatesConverter.validateViewPosition(new s3(s.lineNumber,s.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return bI.fromViewState(t.viewState.move(i,o.lineNumber,o.column,0))}static simpleMove(e,t,i,n,s,r){switch(i){case 0:if(4===r)return this._moveHalfLineLeft(e,t,n);return this._moveLeft(e,t,n,s);case 1:if(4===r)return this._moveHalfLineRight(e,t,n);return this._moveRight(e,t,n,s);case 2:if(2===r)return this._moveUpByViewLines(e,t,n,s);return this._moveUpByModelLines(e,t,n,s);case 3:if(2===r)return this._moveDownByViewLines(e,t,n,s);return this._moveDownByModelLines(e,t,n,s);case 4:if(2===r)return t.map(t=>bI.fromViewState(bj.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n)));return t.map(t=>bI.fromModelState(bj.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n)));case 5:if(2===r)return t.map(t=>bI.fromViewState(bj.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n)));return t.map(t=>bI.fromModelState(bj.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n)));
7case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,s){let r=e.getCompletelyVisibleViewRange(),o=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{let i=this._firstLineNumberInRange(e.model,o,s),r=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,r)]}case 13:{let i=this._lastLineNumberInRange(e.model,o,s),r=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,r)]}case 12:{let i=Math.round((o.startLineNumber+o.endLineNumber)/2),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 14:{let i=[];for(let s=0,o=t.length;s<o;s++){let o=t[s];i[s]=this.findPositionInViewportIfOutside(e,o,r,n)}return i}default:return null}}static findPositionInViewportIfOutside(e,t,i,n){let s=t.viewState.position.lineNumber;if(i.startLineNumber<=s&&s<=i.endLineNumber-1)return new bI(t.modelState,t.viewState);{let r;r=s>i.endLineNumber-1?i.endLineNumber-1:s<i.startLineNumber?i.startLineNumber:s;let o=bj.vertical(e.cursorConfig,e,s,t.viewState.position.column,t.viewState.leftoverVisibleColumns,r,!1);return bI.fromViewState(t.viewState.move(n,o.lineNumber,o.column,o.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.min(t.endLineNumber,n+i-1)}static _lastLineNumberInRange(e,t,i){let n=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(n)&&n++,Math.max(n,t.endLineNumber-i+1)}static _moveLeft(e,t,i,n){return t.map(t=>{let s=e.getTextDirection(t.viewState.position.lineNumber)===iZ.RTL;return bI.fromViewState(s?bj.moveRight(e.cursorConfig,e,t.viewState,i,n):bj.moveLeft(e.cursorConfig,e,t.viewState,i,n))})}static _moveHalfLineLeft(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s],o=r.viewState.position.lineNumber,a=Math.round(e.getLineLength(o)/2);n[s]=bI.fromViewState(bj.moveLeft(e.cursorConfig,e,r.viewState,i,a))}return n}static _moveRight(e,t,i,n){return t.map(t=>{let s=e.getTextDirection(t.viewState.position.lineNumber)===iZ.RTL;return bI.fromViewState(s?bj.moveLeft(e.cursorConfig,e,t.viewState,i,n):bj.moveRight(e.cursorConfig,e,t.viewState,i,n))})}static _moveHalfLineRight(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s],o=r.viewState.position.lineNumber,a=Math.round(e.getLineLength(o)/2);n[s]=bI.fromViewState(bj.moveRight(e.cursorConfig,e,r.viewState,i,a))}return n}static _moveDownByViewLines(e,t,i,n){let s=[];for(let r=0,o=t.length;r<o;r++){let o=t[r];s[r]=bI.fromViewState(bj.moveDown(e.cursorConfig,e,o.viewState,i,n))}return s}static _moveDownByModelLines(e,t,i,n){let s=[];for(let r=0,o=t.length;r<o;r++){let o=t[r];s[r]=bI.fromModelState(bj.moveDown(e.cursorConfig,e.model,o.modelState,i,n))}return s}static _moveUpByViewLines(e,t,i,n){let s=[];for(let r=0,o=t.length;r<o;r++){let o=t[r];s[r]=bI.fromViewState(bj.moveUp(e.cursorConfig,e,o.viewState,i,n))}return s}static _moveUpByModelLines(e,t,i,n){let s=[];for(let r=0,o=t.length;r<o;r++){let o=t[r];s[r]=bI.fromModelState(bj.moveUp(e.cursorConfig,e.model,o.modelState,i,n))}return s}static _moveToViewPosition(e,t,i,n,s){return bI.fromViewState(t.viewState.move(i,n,s,0))}static _moveToModelPosition(e,t,i,n,s){return bI.fromModelState(t.modelState.move(i,n,s,0))}static _moveToViewMinColumn(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s],o=r.viewState.position.lineNumber,a=e.getLineMinColumn(o);n[s]=this._moveToViewPosition(e,r,i,o,a)}return n}static _moveToViewFirstNonWhitespaceColumn(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s],o=r.viewState.position.lineNumber,a=e.getLineFirstNonWhitespaceColumn(o);n[s]=this._moveToViewPosition(e,r,i,o,a)}return n}static _moveToViewCenterColumn(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s],o=r.viewState.position.lineNumber,a=Math.round((e.getLineMaxColumn(o)+e.getLineMinColumn(o))/2);n[s]=this._moveToViewPosition(e,r,i,o,a)}return n}static _moveToViewMaxColumn(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s],o=r.viewState.position.lineNumber,a=e.getLineMaxColumn(o);n[s]=this._moveToViewPosition(e,r,i,o,a)}return n}static _moveToViewLastNonWhitespaceColumn(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s],o=r.viewState.position.lineNumber,a=e.getLineLastNonWhitespaceColumn(o);n[s]=this._moveToViewPosition(e,r,i,o,a)}return n}}(e1=i3||(i3={})).metadata={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:`Property-value pairs that can be passed through this argument:
8					* 'to': A mandatory logical position value providing where to move the cursor.
9						\`\`\`
10						'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
11						'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
12						'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
13						'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
14						\`\`\`
15					* 'by': Unit to move. Default is computed based on 'to' value.
16						\`\`\`
17						'line', 'wrappedLine', 'character', 'halfLine'
18						\`\`\`
19					* 'value': Number of units to move. Default is '1'.
20					* 'select': If 'true' makes the selection. Default is 'false'.
21					* 'noHistory': If 'true' does not add the movement to navigation history. Default is 'false'.
22				`,constraint:function(e){return!!(0,re.Kn)(e)&&!!((0,re.HD)(e.to)&&((0,re.o8)(e.select)||(0,re.jn)(e.select))&&((0,re.o8)(e.by)||(0,re.HD)(e.by))&&((0,re.o8)(e.value)||(0,re.hj)(e.value))&&((0,re.o8)(e.noHistory)||(0,re.jn)(e.noHistory)
22))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1},noHistory:{type:"boolean",default:!1}}}}]},e1.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},e1.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},e1.parse=function(e){let t;if(!e.to)return null;switch(e.to){case e1.RawDirection.Left:t=0;break;case e1.RawDirection.Right:t=1;break;case e1.RawDirection.Up:t=2;break;case e1.RawDirection.Down:t=3;break;case e1.RawDirection.PrevBlankLine:t=4;break;case e1.RawDirection.NextBlankLine:t=5;break;case e1.RawDirection.WrappedLineStart:t=6;break;case e1.RawDirection.WrappedLineFirstNonWhitespaceCharacter:t=7;break;case e1.RawDirection.WrappedLineColumnCenter:t=8;break;case e1.RawDirection.WrappedLineEnd:t=9;break;case e1.RawDirection.WrappedLineLastNonWhitespaceCharacter:t=10;break;case e1.RawDirection.ViewPortTop:t=11;break;case e1.RawDirection.ViewPortBottom:t=13;break;case e1.RawDirection.ViewPortCenter:t=12;break;case e1.RawDirection.ViewPortIfOutside:t=14;break;default:return null}let i=0;switch(e.by){case e1.RawUnit.Line:i=1;break;case e1.RawUnit.WrappedLine:i=2;break;case e1.RawUnit.Character:i=3;break;case e1.RawUnit.HalfLine:i=4}return{direction:t,unit:i,select:!!e.select,value:e.value||1,noHistory:!!e.noHistory}};class bY{constructor(e,t,i){this._indentRulesSupport=t,this._indentationLineProcessor=new bZ(e,i)}shouldIncrease(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIncrease(i)}shouldDecrease(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldDecrease(i)}shouldIgnore(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIgnore(i)}shouldIndentNextLine(e,t){let i=this._indentationLineProcessor.getProcessedLine(e,t);return this._indentRulesSupport.shouldIndentNextLine(i)}}class bJ{constructor(e,t){this.model=e,this.indentationLineProcessor=new bZ(e,t)}getProcessedTokenContextAroundRange(e){return{beforeRangeProcessedTokens:this._getProcessedTokensBeforeRange(e),afterRangeProcessedTokens:this._getProcessedTokensAfterRange(e),previousLineProcessedTokens:this._getProcessedPreviousLineTokens(e)}}_getProcessedTokensBeforeRange(e){let t;this.model.tokenization.forceTokenization(e.startLineNumber);let i=this.model.tokenization.getLineTokens(e.startLineNumber),n=ud(i,e.startColumn-1);if(bX(this.model,e.getStartPosition())){let s=e.startColumn-1-n.firstCharOffset,r=n.firstCharOffset;t=i.sliceAndInflate(r,r+s,0)}else{let n=e.startColumn-1;t=i.sliceAndInflate(0,n,0)}return this.indentationLineProcessor.getProcessedTokens(t)}_getProcessedTokensAfterRange(e){let t=e.isEmpty()?e.getStartPosition():e.getEndPosition();this.model.tokenization.forceTokenization(t.lineNumber);let i=this.model.tokenization.getLineTokens(t.lineNumber),n=ud(i,t.column-1),s=t.column-1-n.firstCharOffset,r=n.firstCharOffset+s,o=n.firstCharOffset+n.getLineLength(),a=i.sliceAndInflate(r,o,0);return this.indentationLineProcessor.getProcessedTokens(a)}_getProcessedPreviousLineTokens(e){let t;this.model.tokenization.forceTokenization(e.startLineNumber);let i=ud(this.model.tokenization.getLineTokens(e.startLineNumber),e.startColumn-1),n=fL.createEmpty("",i.languageIdCodec),s=e.startLineNumber-1;
22if(0===s||0!==i.firstCharOffset)return n;let r=(t=s,this.model.tokenization.forceTokenization(t),ud(this.model.tokenization.getLineTokens(t),this.model.getLineMaxColumn(t)-1));if(i.languageId!==r.languageId)return n;let o=r.toIViewLineTokens();return this.indentationLineProcessor.getProcessedTokens(o)}}class bZ{constructor(e,t){this.model=e,this.languageConfigurationService=t}getProcessedLine(e,t){this.model.tokenization.forceTokenization?.(e);let i=this.model.tokenization.getLineTokens(e),n=this.getProcessedTokens(i).getLineContent();return void 0!==t&&(n=((e,t)=>{let i=rR(e);return t+e.substring(i.length)})(n,t)),n}getProcessedTokens(e){let t=e=>2===e||3===e||1===e,i=e.getLanguageId(0),n=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew.getBracketRegExp({global:!0}),s=[];return e.forEach(i=>{let r=e.getStandardTokenType(i),o=e.getTokenText(i);t(r)&&(o=o.replace(n,""));let a=e.getMetadata(i);s.push({text:o,metadata:a})}),fL.createFromTextAndMetadata(s,e.languageIdCodec)}}function bX(e,t){e.tokenization.forceTokenization(t.lineNumber);let i=e.tokenization.getLineTokens(t.lineNumber),n=ud(i,t.column-1),s=0===n.firstCharOffset,r=i.getLanguageId(0)===n.languageId;return!s&&!r}function b1(e,t,i,n){t.tokenization.forceTokenization(i.startLineNumber);let s=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),r=n.getLanguageConfiguration(s);if(!r)return null;let o=new bJ(t,n).getProcessedTokenContextAroundRange(i),a=o.previousLineProcessedTokens.getLineContent(),l=o.beforeRangeProcessedTokens.getLineContent(),h=o.afterRangeProcessedTokens.getLineContent(),d=r.onEnter(e,a,l,h);if(!d)return null;let u=d.indentAction,c=d.appendText,g=d.removeText||0;c?u===iQ.Indent&&(c="	"+c):c=u===iQ.Indent||u===iQ.IndentOutdent?"	":"";let f=cn(t,i.startLineNumber,i.startColumn);return g&&(f=f.substring(0,f.length-g)),{indentAction:u,appendText:c,removeText:g,indentation:f}}let b0=Object.create(null);function b2(e,t){if(t<=0)return"";b0[e]||(b0[e]=["",e]);let i=b0[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}let b5=i9=class{static unshiftIndent(e,t,i,n,s){let r=vR.visibleColumnFromColumn(e,t,i);if(s){let e=b2(" ",n);return b2(e,vR.prevIndentTabStop(r,n)/n)}return b2("	",vR.prevRenderTabStop(r,i)/i)}static shiftIndent(e,t,i,n,s){let r=vR.visibleColumnFromColumn(e,t,i);if(s){let e=b2(" ",n);return b2(e,vR.nextIndentTabStop(r,n)/n)}return b2("	",vR.nextRenderTabStop(r,i)/i)}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){let i=this._selection.startLineNumber,n=this._selection.endLineNumber;1===this._selection.endColumn&&i!==n&&(n-=1);let{tabSize:s,indentSize:r,insertSpaces:o}=this._opts,a=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,h=0;for(let d=i;d<=n;d++,l=h){let n;h=0;let u=e.getLineContent(d),c=rM(u);if((!this._opts.isUnshift||0!==u.length&&0!==c)&&(a||this._opts.isUnshift||0!==u.length)){if(-1===c&&(c=u.length),d>1&&vR.visibleColumnFromColumn(u,c+1,s)%r!=0&&e.tokenization.isCheapToTokenize(d-1)){let t=b1(this._opts.autoIndent,e,new s9(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(t){if(h=l,t.appendText)for(let e=0,i=t.appendText.length;e<i&&h<r;e++)if(32===t.appendText.charCodeAt(e))h++;else break;t.removeText&&(h=Math.max(0,h-t.removeText));for(let e=0;e<h&&0!==c&&32===u.charCodeAt(c-1);e++)c--}}(!this._opts.isUnshift||0!==c)&&(n=this._opts.isUnshift?i9.unshiftIndent(u,c+1,s,r,o):i9.shiftIndent(u,c+1,s,r,o),this._addEditOperation(t,new s9(d,1,d,c+1),n),d!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=this._selection.startColumn<=c+1))}}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&0===e.getLineLength(i)&&(this._useLastEditRangeForCursorEndPosition=!0);let s=o?b2(" ",r):"	";for(let o=i;o<=n;o++){let n=e.getLineContent(o),l=rM(n);if((!this._opts.isUnshift||0!==n.length&&0!==l)&&(a||this._opts.isUnshift||0!==n.length)&&(-1===l&&(l=n.length),!this._opts.isUnshift||0!==l)){if(this._opts.isUnshift){l=Math.min(l,r);for(let e=0;e<l;e++)if(9===n.charCodeAt(e)){l=e+1;break}this._addEditOperation(t,new s9(o,1,o,l+1),"")}else this._addEditOperation(t,new s9(o,1,o,1),s),o!==i||this._selection.isEmpty()||(this._selectionStartColumnStaysPut=1===this._selection.startColumn)}}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){let e=t.getInverseEditOperations()[0];return new s8(e.range.endLineNumber,e.range.endColumn,e.range.endLineNumber,e.range.endColumn)}let i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){let e=this._selection.startColumn;return i.startColumn<=e?i:0===i.getDirection()?new s8(i.startLineNumber,e,i.endLineNumber,i.endColumn):new s8(i.endLineNumber,i.endColumn,i.startLineNumber,e)}return i}};b5=i9=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){u8(e,t,2)}],b5);class b4{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new s9(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new s9(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection||null)}computeCursorState(e,t){let i=t.getInverseEditOperations(),n=i[0].range,s=i[1].range;return new s8(n.endLineNumber,n.endColumn,s.endLineNumber,s.endColumn-this._charAfterSelection.length)}}class b6{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new s9(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return new s8(i.endLineNumber,i.startColumn,i.endLineNumber,i.endColumn-this._charAfter.length)}}
22function b7(e,t,i,n=!0,s){if(e<4)return null;let r=s.getLanguageConfiguration(t.tokenization.getLanguageId()).indentRulesSupport;if(!r)return null;let o=new bY(t,r,s);if(i<=1)return{indentation:"",action:null};for(let e=i-1;e>0&&""===t.getLineContent(e);e--)if(1===e)return{indentation:"",action:null};let a=function(e,t,i){let n=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let s;let r=-1;for(s=t-1;s>=1;s--){if(e.tokenization.getLanguageIdAtPosition(s,0)!==n)return r;let t=e.getLineContent(s);if(i.shouldIgnore(s)||/^\s+$/.test(t)||""===t){r=s;continue}return s}}return -1}(t,i,o);if(a<0)return null;if(a<1)return{indentation:"",action:null};if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:rR(t.getLineContent(a)),action:iQ.Indent,line:a};if(o.shouldDecrease(a))return{indentation:rR(t.getLineContent(a)),action:null,line:a};{if(1===a)return{indentation:rR(t.getLineContent(a)),action:null,line:a};let e=a-1,i=r.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let t=e-1;t>0;t--)if(!o.shouldIndentNextLine(t)){i=t;break}return{indentation:rR(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:rR(t.getLineContent(a)),action:null,line:a};for(let e=a;e>0;e--){if(o.shouldIncrease(e))return{indentation:rR(t.getLineContent(e)),action:iQ.Indent,line:e};if(o.shouldIndentNextLine(e)){let i=0;for(let t=e-1;t>0;t--)if(!o.shouldIndentNextLine(e)){i=t;break}return{indentation:rR(t.getLineContent(i+1)),action:null,line:i+1}}if(o.shouldDecrease(e))return{indentation:rR(t.getLineContent(e)),action:null,line:e}}return{indentation:rR(t.getLineContent(1)),action:null,line:1}}}class b3{static getEdits(e,t,i,n,s){if(!s&&this._isAutoIndentType(e,t,i)){let s=[];for(let r of i){let i=this._findActualIndentationForSelection(e,t,r,n);if(null===i)return;s.push({selection:r,indentation:i})}let r=Ce.getAutoClosingPairClose(e,t,i,n,!1);return this._getIndentationAndAutoClosingPairEdits(e,t,s,n,r)}}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let e=0,n=i.length;e<n;e++)if(!t.tokenization.isCheapToTokenize(i[e].getEndPosition().lineNumber))return!1;return!0}static _findActualIndentationForSelection(e,t,i,n){let s=function(e,t,i,n,s,r){let o=e.autoIndent;if(o<4||bX(t,i.getStartPosition()))return null;let a=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),l=r.getLanguageConfiguration(a).indentRulesSupport;if(!l)return null;let h=new bJ(t,r).getProcessedTokenContextAroundRange(i),d=h.beforeRangeProcessedTokens.getLineContent(),u=h.afterRangeProcessedTokens.getLineContent(),c=d+u,g=d+n+u;if(!l.shouldDecrease(c)&&l.shouldDecrease(g)){let e=b7(o,t,i.startLineNumber,!1,r);if(!e)return null;let n=e.indentation;return e.action!==iQ.Indent&&(n=s.unshiftIndent(n)),n}let f=i.startLineNumber-1;if(f>0){let a=t.getLineContent(f);if(l.shouldIndentNextLine(a)&&l.shouldIncrease(g)){let a=b7(o,t,i.startLineNumber,!1,r),l=a?.indentation;if(void 0!==l){let r=rR(t.getLineContent(i.startLineNumber)),o=s.shiftIndent(l),a=/^\s*$/.test(c),h=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n),d=h&&h.length>0;if(o===r&&d&&a)return l}}}return null}(e,t,i,n,{shiftIndent:t=>Cb(e,t),unshiftIndent:t=>CC(e,t)},e.languageConfigurationService);if(null===s)return null;let r=cn(t,i.startLineNumber,i.startColumn);return s===e.normalizeIndentation(r)?null:s}static _getIndentationAndAutoClosingPairEdits(e,t,i,n,s){return new bO(4,i.map(({selection:i,indentation:r})=>{if(null!==s)return new Cc(this._getEditFromIndentationAndSelection(e,t,r,i,n,!1),i,n,s);{let s=this._getEditFromIndentationAndSelection(e,t,r,i,n,!0);return Cv(s.range,s.text,!1)}}),{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _getEditFromIndentationAndSelection(e,t,i,n,s,r=!0){let o=n.startLineNumber,a=t.getLineFirstNonWhitespaceColumn(o),l=e.normalizeIndentation(i);return 0!==a&&(l+=t.getLineContent(o).substring(a-1,n.startColumn-1)),l+=r?s:"",{range:new s9(o,1,n.endLineNumber,n.endColumn),text:l}}}class b9{static getEdits(e,t,i,n,s,r){if(C_(t,i,n,s,r))return this._runAutoClosingOvertype(e,n,r)}static _runAutoClosingOvertype(e,t,i){let n=[];for(let e=0,s=t.length;e<s;e++){let s=t[e].getPosition(),r=new s9(s.lineNumber,s.column,s.lineNumber,s.column+1);n[e]=new bB(r,i)}return new bO(4,n,{shouldPushStackElementBefore:Cf(e,4),shouldPushStackElementAfter:!1})}}class b8{static getEdits(e,t,i,n,s){if(C_(e,t,i,n,s))return new bO(4,i.map(e=>new bB(new s9(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)),{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}class Ce{static getEdits(e,t,i,n,s,r){if(!r){let r=this.getAutoClosingPairClose(e,t,i,n,s);if(null!==r)return this._runAutoClosingOpenCharType(i,n,s,r)}}static _runAutoClosingOpenCharType(e,t,i,n){let s=[];for(let r=0,o=e.length;r<o;r++){let o=e[r];s[r]=new Cu(o,t,!i,n)}return new bO(4,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static getAutoClosingPairClose(e,t,i,n,s){let r,o;for(let e of i)if(!e.isEmpty())return null;let a=i.map(e=>{let t=e.getPosition();return s?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}}),l=this._findAutoClosingPairOpen(e,t,a.map(e=>new s3(e.lineNumber,e.beforeColumn)),n);if(!l||(bP(n)?(r=e.autoClosingQuotes,o=e.shouldAutoCloseBefore.quote):e.blockCommentStartToken&&l.open.includes(e.blockCommentStartToken)?(r=e.autoClosingComments,o=e.shouldAutoCloseBefore.comment):(r=e.autoClosingBrackets,o=e.shouldAutoCloseBefore.bracket),"never"===r))return null;let h=this._findContainedAutoClosingPair(e,l),d=h?h.close:"",u=!0;for(let i of a){let{lineNumber:s,beforeColumn:a,afterColumn:h}=i,c=t.getLineContent(s),g=c.substring(0,a-1),f=c.substring(h-1);
22if(f.startsWith(d)||(u=!1),f.length>0){let t=f.charAt(0);if(!this._isBeforeClosingBrace(e,f)&&!o(t))return null}if(1===l.open.length&&("'"===n||'"'===n)&&"always"!==r){let t=cT(e.wordSeparators,[]);if(g.length>0){let e=g.charCodeAt(g.length-1);if(0===t.get(e))return null}}if(!t.tokenization.isCheapToTokenize(s))return null;t.tokenization.forceTokenization(s);let m=ud(t.tokenization.getLineTokens(s),a-1);if(!l.shouldAutoClose(m,a-m.firstCharOffset))return null;let p=l.findNeutralCharacter();if(p){let e=t.tokenization.getTokenTypeIfInsertingCharacter(s,a,p);if(!l.isOK(e))return null}}return u?l.close.substring(0,l.close.length-d.length):l.close}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;let i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[],s=null;for(let e of n)e.open!==t.open&&t.open.includes(e.open)&&t.close.endsWith(e.close)&&(!s||e.open.length>s.open.length)&&(s=e);return s}static _findAutoClosingPairOpen(e,t,i,n){let s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!s)return null;let r=null;for(let e of s)if(null===r||e.open.length>r.open.length){let s=!0;for(let r of i)if(t.getValueInRange(new s9(r.lineNumber,r.column-e.open.length+1,r.lineNumber,r.column))+n!==e.open){s=!1;break}s&&(r=e)}return r}static _isBeforeClosingBrace(e,t){let i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],s=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(e=>
22t.startsWith(e.open)),o=s.some(e=>t.startsWith(e.close));return!r&&o}}class Ct{static getEdits(e,t){return"overtype"!==e.inputMode?null:new bO(4,t.map(e=>new bz(e.insertedTextRange)),{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}class Ci{static getEdits(e,t,i,n,s){if(!s&&this._isSurroundSelectionType(e,t,i,n))return this._runSurroundSelectionType(e,i,n)}static _runSurroundSelectionType(e,t,i){let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s],o=e.surroundingPairs[i];n[s]=new b4(r,i,o)}return new bO(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isSurroundSelectionType(e,t,i,n){if(!Cw(e,n)||!e.surroundingPairs.hasOwnProperty(n))return!1;let s=bP(n);for(let e of i){if(e.isEmpty())return!1;let i=!0;for(let n=e.startLineNumber;n<=e.endLineNumber;n++){let s=t.getLineContent(n),r=n===e.startLineNumber?e.startColumn-1:0,o=n===e.endLineNumber?e.endColumn-1:s.length,a=s.substring(r,o);if(/[^ \t]/.test(a)){i=!1;break}}if(i||s&&e.startLineNumber===e.endLineNumber&&e.startColumn+1===e.endColumn&&bP(t.getValueInRange(e)))return!1}return!0}}class Cn{static getEdits(e,t,i,n,s,r){if(!r&&this._isTypeInterceptorElectricChar(t,i,n)){let r=this._typeInterceptorElectricChar(e,t,i,n[0],s);if(r)return r}}static _isTypeInterceptorElectricChar(e,t,i){return!!(1===i.length&&t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,n,s){let r;if(!t.electricChars.hasOwnProperty(s)||!n.isEmpty())return null;let o=n.getPosition();i.tokenization.forceTokenization(o.lineNumber);let a=i.tokenization.getLineTokens(o.lineNumber);try{r=t.onElectricCharacter(s,a,o.column)}catch(e){return(0,o_.dL)(e),null}if(!r)return null;if(r.matchOpenBracket){let n=(a.getLineContent()+s).lastIndexOf(r.matchOpenBracket)+1,l=i.bracketPairs.findMatchingBracketUp(r.matchOpenBracket,{lineNumber:o.lineNumber,column:n},500);if(l){if(l.startLineNumber===o.lineNumber)return null;let n=rR(i.getLineContent(l.startLineNumber)),r=t.normalizeIndentation(n),a=i.getLineContent(o.lineNumber),h=i.getLineFirstNonWhitespaceColumn(o.lineNumber)||o.column,d=r+a.substring(h-1,o.column-1)+s,u=new bB(new s9(o.lineNumber,1,o.lineNumber,o.column),d);return new bO(Cg(d,e),[u],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}}class Cs{static getEdits(e,t,i,n,s){let r=[];for(let t=0,o=i.length;t<o;t++){let o="overtype"!==e.inputMode||s?bB:bV;r[t]=new o(i[t],n)}let o=Cg(n,t);return new bO(o,r,{shouldPushStackElementBefore:Cf(t,o),shouldPushStackElementAfter:!1})}}class Cr{static getEdits(e,t,i,n,s){if(!s&&"\n"===n){let n=[];for(let s=0,r=i.length;s<r;s++)n[s]=this._enter(e,t,!1,i[s]);return new bO(4,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}}static _enter(e,t,i,n){if(0===e.autoIndent)return Cv(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){let s=rR(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);return Cv(n,"\n"+e.normalizeIndentation(s),i)}let s=b1(e.autoIndent,t,n,e.languageConfigurationService);if(s){if(s.indentAction===iQ.None||s.indentAction===iQ.Indent)return Cv(n,"\n"+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===iQ.IndentOutdent){let t=e.normalizeIndentation(s.indentation),r=e.normalizeIndentation(s.indentation+s.appendText),o="\n"+r+"\n"+t;return i?new bW(n,o,!0):new bH(n,o,-1,r.length-t.length,!0)}if(s.indentAction===iQ.Outdent){let t=CC(e,s.indentation);return Cv(n,"\n"+e.normalizeIndentation(t+s.appendText),i)}}let r=rR(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);if(e.autoIndent>=4){let s=function(e,t,i,n,s){var r;if(e<4)return null;let o=t.getLanguageIdAtPosition(i.startLineNumber,i.startColumn),a=s.getLanguageConfiguration(o).indentRulesSupport;if(!a)return null;t.tokenization.forceTokenization(i.startLineNumber);let l=new bJ(t,s).getProcessedTokenContextAroundRange(i),h=l.afterRangeProcessedTokens,d=l.beforeRangeProcessedTokens,u=rR(d.getLineContent()),c=(r=i.startLineNumber,{tokenization:{getLineTokens:e=>e===r?d:t.tokenization.getLineTokens(e),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i)},getLineContent:e=>e===r?d.getLineContent():t.getLineContent(e)}),g=bX(t,i.getStartPosition()),f=rR(t.getLineContent(i.startLineNumber)),m=b7(e,c,i.startLineNumber+1,void 0,s);if(!m){let e=g?f:u;return{beforeEnter:e,afterEnter:e}}let p=g?f:m.indentation;return m.action===iQ.Indent&&(p=n.shiftIndent(p)),a.shouldDecrease(h.getLineContent())&&(p=n.unshiftIndent(p)),{beforeEnter:g?f:u,afterEnter:p}}(e.autoIndent,t,n,{unshiftIndent:t=>CC(e,t),shiftIndent:t=>Cb(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(s){let r=e.visibleColumnFromColumn(t,n.getEndPosition()),o=n.endColumn,a=rM(t.getLineContent(n.endLineNumber));if(n=a>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,a+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new bW(n,"\n"+e.normalizeIndentation(s.after
22Enter),!0);{let t=0;return o<=a+1&&(e.insertSpaces||(r=Math.ceil(r/e.indentSize)),t=Math.min(r+1-e.normalizeIndentation(s.afterEnter).length-1,0)),new bH(n,"\n"+e.normalizeIndentation(s.afterEnter),0,t,!0)}}}return Cv(n,"\n"+e.normalizeIndentation(r),i)}static lineInsertBefore(e,t,i){if(null===t||null===i)return[];let n=[];for(let s=0,r=i.length;s<r;s++){let r=i[s].positionLineNumber;if(1===r)n[s]=new bW(new s9(1,1,1,1),"\n");else{r--;let i=t.getLineMaxColumn(r);n[s]=this._enter(e,t,!1,new s9(r,i,r,i))}}return n}static lineInsertAfter(e,t,i){if(null===t||null===i)return[];let n=[];for(let s=0,r=i.length;s<r;s++){let r=i[s].positionLineNumber,o=t.getLineMaxColumn(r);n[s]=this._enter(e,t,!1,new s9(r,o,r,o))}return n}static lineBreakInsert(e,t,i){let n=[];for(let s=0,r=i.length;s<r;s++)n[s]=this._enter(e,t,!0,i[s]);return n}}class Co{static getEdits(e,t,i,n,s,r){let o=this._distributePasteToCursors(e,i,n,s,r);return o?(i=i.sort(s9.compareRangesUsingStarts),this._distributedPaste(e,t,i,o)):this._simplePaste(e,t,i,n,s)}static _distributePasteToCursors(e,t,i,n,s){if(n||1===t.length)return null;if(s&&s.length===t.length)return s;if("spread"===e.multiCursorPaste){10===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1)),13===i.charCodeAt(i.length-1)&&(i=i.substring(0,i.length-1));let e=rI(i);if(e.length===t.length)return e}return null}static _distributedPaste(e,t,i,n){let s=[];for(let t=0,r=i.length;t<r;t++){let r=e.overtypeOnPaste&&"overtype"===e.inputMode?bV:bB;s[t]=new r(i[t],n[t])}return new bO(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,n,s){let r=[];for(let t=0,o=i.length;t<o;t++){let o=i[t],a=o.getPosition();if(s&&!o.isEmpty()&&(s=!1),s&&n.indexOf("\n")!==n.length-1&&(s=!1),s){let e=new s9(a.lineNumber,1,a.lineNumber,1);r[t]=new bU(e,n,o,!0)}else{let i=e.overtypeOnPaste&&"overtype"===e.inputMode?bV:bB;r[t]=new i(o,n)}}return new bO(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Ca{static getEdits(e,t,i,n,s,r,o,a){return new bO(4,n.map(e=>this._compositionType(i,e,s,r,o,a)),{shouldPushStackElementBefore:Cf(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,r){if(!t.isEmpty())return null;let o=t.getPosition(),a=Math.max(1,o.column-n),l=Math.min(e.getLineMaxColumn(o.lineNumber),o.column+s);return new bH(new s9(o.lineNumber,a,o.lineNumber,l),i,0,r)}}class Cl{static getEdits(e,t,i){let n=[];for(let e=0,s=t.length;e<s;e++)n[e]=new bB(t[e],i);let s=Cg(i,e);return new bO(s,n,{shouldPushStackElementBefore:Cf(e,s),shouldPushStackElementAfter:!1})}}class Ch{static getCommands(e,t,i){let n=[];for(let s=0,r=i.length;s<r;s++){let r=i[s];if(r.isEmpty()){let i=t.getLineContent(r.startLineNumber);if(/^\s*$/.test(i)&&t.tokenization.isCheapToTokenize(r.startLineNumber)){let o=this._goodIndentForLine(e,t,r.startLineNumber);o=o||"	";let a=e.normalizeIndentation(o);if(!i.startsWith(a)){n[s]=new bB(new s9(r.startLineNumber,1,r.startLineNumber,i.length+1),a,!0);continue}}n[s]=this._replaceJumpToNextIndent(e,t,r,!0)}else{if(r.startLineNumber===r.endLineNumber){let i=t.getLineMaxColumn(r.startLineNumber);if(1!==r.startColumn||r.endColumn!==i){n[s]=this._replaceJumpToNextIndent(e,t,r,!1);continue}}n[s]=new b5(r,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static _goodIndentForLine(e,t,i){let n=null,s="",r=b7(e.autoIndent,t,i,!1,e.languageConfigurationService);if(r)n=r.action,s=r.indentation;else if(i>1){let n;for(n=i-1;n>=1&&!(rA(t.getLineContent(n))>=0);n--);if(n<1)return null;let r=t.getLineMaxColumn(n),o=b1(e.autoIndent,t,new s9(n,r,n,r),e.languageConfigurationService);o&&(s=o.indentation+o.appendText)}return(n&&(n===iQ.Indent&&(s=Cb(e,s)),n===iQ.Outdent&&(s=CC(e,s)),s=e.normalizeIndentation(s)),s)?s:null}static _replaceJumpToNextIndent(e,t,i,n){let s="",r=i.getStartPosition();if(e.insertSpaces){let i=e.visibleColumnFromColumn(t,r),n=e.indentSize,o=n-i%n;for(let e=0;e<o;e++)s+=" "}else s="	";return new bB(i,s,n)}}class Cd extends bH{constructor(e,t,i,n,s,r){super(e,t,i,n),this._openCharacter=s,this._closeCharacter=r,this.closeCharacterRange=null,this.enclosingRange=null}_computeCursorStateWithRange(e,t,i){return this.closeCharacterRange=new s9(t.startLineNumber,t.endColumn-this._closeCharacter.length,t.endLineNumber,t.endColumn),this.enclosingRange=new s9(t.startLineNumber,t.endColumn-this._openCharacter.length-this._closeCharacter.length,t.endLineNumber,t.endColumn),super.computeCursorState(e,i)}}class Cu extends Cd{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length,t,n)}computeCursorState(e,t){let i=t.getInverseEditOperations()[0].range;return this._computeCursorStateWithRange(e,i,t)}}class Cc extends Cd{constructor(e,t,i,n){let s=i+n;super(t,s,0,i.length,i,n),this._autoIndentationEdit=e,this._autoClosingEdit={range:t,text:s}}getEditOperations(e,t){t.addTrackedEditOperation(this._autoIndentationEdit.range,this._autoIndentationEdit.text),t.addTrackedEditOperation(this._autoClosingEdit.range,this._autoClosingEdit.text)}computeCursorState(e,t){let i=t.getInverseEditOperations();if(2!==i.length)throw Error("There should be two inverse edit operations!");let n=i[0].range,s=i[1].range,r=n.plusRange(s);return this._computeCursorStateWithRange(e,r,t)}}function Cg(e,t){return" "===e?5===t||6===t?6:5:4}function Cf(e,t){return!!Cp(e)&&!Cp(t)||5!==e&&Cm(e)!==Cm(t)}function Cm(e){return 6===e||5===e?"space":e}function Cp(e){return 4===e||5===e||6===e}function C_(e,t,i,n,s){if("never"===e.autoClosingOvertype||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(s))return!1;for(let r=0,o=i.length;r<o;r++){let o=i[r];if(!o.isEmpty())return!1;let a=o.getPosition(),l=t.getLineContent(a.lineNumber);if(l.charAt(a.column-1)!==s)return!1;let h=bP(s);if(92===(a.column>2?l.charCodeAt(a.column-2):0)&&h)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;t<i;t++){let i=n[t];if(a.lineNumber===i.startLineNumber&&a.column===i.startColumn){e=!0;break}}if(!e)return!1}}return!0}function Cv(e,t,i){return i?new bW(e,t,!0):new bB(e,t,!0)}function Cb(e,t,i){return i=i||1,b5.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}function CC(e,t,i){return i=i||1,b5.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}function Cw(e,t){return bP(t)?"quotes"===e.autoSurround||"languageDefined"===e.autoSurround:"brackets"===e.autoSurround||"languageDefined"===e.autoSurround}class Cy{static indent(e,t,i){if(null===t||null===i)return[];let n=[];for(let t=0,s=i.length;t<s;t++)n[t]=new b5(i[t],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static outdent(e,t,i){let n=[];for(let t=0,s=i.length;t<s;t++)n[t]=new b5(i[t],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return n}static paste(e,t,i,n,s,r){return Co.getEdits(e,t,i,n,s,r)}static tab(e,t,i){return Ch.getCommands(e,t,i)}static compositionType(e,t,i,n,s,r,o,a){return Ca.getEdits(e,t,i,n,s,r,o,a)}static compositionEndWithInterceptors(e,t,i,n,s,r){if(!n)return null;let o=null;for(let e of n)if(null===o)o=e.insertedText;else if(o!==e.insertedText)return null;if(!o||1!==o.length)return Ct.getEdits(t,n);let a=o,l=!1;for(let e of n)if(0!==e.deletedText.length){l=!0;break}if(l){if(!Cw(t,a)||!t.surroundingPairs.hasOwnProperty(a))return null;let e=bP(a);for(let t of n)if(0!==t.deletedSelectionStart||t.deletedSelectionEnd!==t.deletedText.length||/^[ \t]+$/.test(t.deletedText)||e&&bP(t.deletedText))return null;let i=[];for(let e of s){if(!e.isEmpty())return null;i.push(e.getPosition())}if(i.length!==n.length)return null;let r=[];for(let e=0,s=i.length;e<s;e++)r.push(new b6(i[e],n[e].deletedText,t.surroundingPairs[a]));return new bO(4,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}let h=b8.getEdits(t,i,s,r,a);if(void 0!==h)return h;let d=Ce.getEdits(t,i,s,a,!0,!1);return void 0!==d?d:Ct.getEdits(t,n)}static typeWithInterceptors(e,t,i,n,s,r,o){let a=Cr.getEdits(i,n,s,o,e);if(void 0!==a)return a;let l=b3.getEdits(i,n,s,o,e);if(void 0!==l)return l;let h=b9.getEdits(t,i,n,s,r,o);if(void 0!==h)return h;let d=Ce.getEdits(i,n,s,o,!1,e);if(void 0!==d)return d;let u=Ci.getEdits(i,n,s,o,e);if(void 0!==u)return u;let c=Cn.getEdits(t,i,n,s,o,e);return void 0!==c?c:Cs.getEdits(i,t,s,o,e)}static typeWithoutInterceptors(e,t,i,n,s){return Cl.getEdits(e,n,s)}}class CS{constructor(e,t,i,n,s,r,o){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=s,this.insertedSelectionEnd=r,this.insertedTextRange=o}}(e0=i8||(i8={})).editorSimpleInput=new hJ("editorSimpleInput",!1,!0),e0.editorTextFocus=new hJ("editorTextFocus",!1,(0,rh.NC)(681,"Whether the editor text has focus (cursor is blinking)")),e0.focus=new hJ("editorFocus",!1,(0,rh.NC)(682,"Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),e0.textInputFocus=new hJ("textInputFocus",!1,(0,rh.NC)(683,"Whether an editor or a rich text input has focus (cursor is blinking)")),e0.readOnly=new hJ("editorReadonly",!1,(0,rh.NC)(684,"Whether the editor is read-only")),e0.inDiffEditor=new hJ("inDiffEditor",!1,(0,rh.NC)(685,"Whether the context is a diff editor")),e0.isEmbeddedDiffEditor=new hJ("isEmbeddedDiffEditor",!1,(0,rh.NC)(686,"Whether the context is an embedded diff editor")),e0.inMultiDiffEditor=new hJ("inMultiDiffEditor",!1,(0,rh.NC)(687,"Whether the context is a multi diff editor")),e0.multiDiffEditorAllCollapsed=new hJ("multiDiffEditorAllCollapsed",void 0,(0,rh.NC)(688,"Whether all files in multi diff editor are collapsed")),e0.hasChanges=new hJ("diffEditorHasChanges",!1,(0,rh.NC)(689,"Whether the diff editor has changes")),e0.comparingMovedCode=new hJ("comparingMovedCode",!1,(0,rh.NC)(690,"Whether a moved code block is selected for comparison")),e0.accessibleDiffViewerVisible=new hJ("accessibleDiffViewerVisible",!1,(0,rh.NC)(691,"Whether the accessible diff viewer is visible")),e0.diffEditorRenderSideBySideInlineBreakpointReached=new hJ("diffEditorRenderSideBySideInlineBreakpointReached",!1,
22(0,rh.NC)(692,"Whether the diff editor render side by side inline breakpoint is reached")),e0.diffEditorInlineMode=new hJ("diffEditorInlineMode",!1,(0,rh.NC)(693,"Whether inline mode is active")),e0.diffEditorOriginalWritable=new hJ("diffEditorOriginalWritable",!1,(0,rh.NC)(694,"Whether modified is writable in the diff editor")),e0.diffEditorModifiedWritable=new hJ("diffEditorModifiedWritable",!1,(0,rh.NC)(695,"Whether modified is writable in the diff editor")),e0.diffEditorOriginalUri=new hJ("diffEditorOriginalUri","",(0,rh.NC)(696,"The uri of the original document")),e0.diffEditorModifiedUri=new hJ("diffEditorModifiedUri","",(0,rh.NC)(697,"The uri of the modified document")),e0.columnSelection=new hJ("editorColumnSelection",!1,(0,rh.NC)(698,"Whether `editor.columnSelection` is enabled")),e0.writable=e0.readOnly.toNegated(),e0.hasNonEmptySelection=new hJ("editorHasSelection",!1,(0,rh.NC)(699,"Whether the editor has text selected")),e0.hasOnlyEmptySelection=e0.hasNonEmptySelection.toNegated(),e0.hasMultipleSelections=new hJ("editorHasMultipleSelections",!1,(0,rh.NC)(700,"Whether the editor has multiple selections")),e0.hasSingleSelection=e0.hasMultipleSelections.toNegated(),e0.tabMovesFocus=new hJ("editorTabMovesFocus",!1,(0,rh.NC)(701,"Whether `Tab` will move focus out of the editor")),e0.tabDoesNotMoveFocus=e0.tabMovesFocus.toNegated(),e0.isInEmbeddedEditor=new hJ("isInEmbeddedEditor",!1,!0),e0.canUndo=new hJ("canUndo",!1,!0),e0.canRedo=new hJ("canRedo",!1,!0),e0.hoverVisible=new hJ("editorHoverVisible",!1,(0,rh.NC)(702,"Whether the editor hover is visible")),e0.hoverFocused=new hJ("editorHoverFocused",!1,(0,rh.NC)(703,"Whether the editor hover is focused")),e0.stickyScrollFocused=new hJ("stickyScrollFocused",!1,(0,rh.NC)(704,"Whether the sticky scroll is focused")),e0.stickyScrollVisible=new hJ("stickyScrollVisible",!1,(0,rh.NC)(705,"Whether the sticky scroll is visible")),e0.standaloneColorPickerVisible=new hJ("standaloneColorPickerVisible",!1,(0,rh.NC)(706,"Whether the standalone color picker is visible")),e0.standaloneColorPickerFocused=new hJ("standaloneColorPickerFocused",!1,(0,rh.NC)(707,"Whether the standalone color picker is focused")),e0.inCompositeEditor=new hJ("inCompositeEditor",void 0,(0,rh.NC)(708,"Whether the editor is part of a larger editor (e.g. notebooks)")),e0.notInCompositeEditor=e0.inCompositeEditor.toNegated(),e0.languageId=new hJ("editorLangId","",(0,rh.NC)(709,"The language identifier of the editor")),e0.hasCompletionItemProvider=new hJ("editorHasCompletionItemProvider",!1,(0,rh.NC)(710,"Whether the editor has a completion item provider")),e0.hasCodeActionsProvider=new hJ("editorHasCodeActionsProvider",!1,(0,rh.NC)(711,"Whether the editor has a code actions provider")),e0.hasCodeLensProvider=new hJ("editorHasCodeLensProvider",!1,(0,rh.NC)(712,"Whether the editor has a code lens provider")),e0.hasDefinitionProvider=new hJ("editorHasDefinitionProvider",!1,(0,rh.NC)(713,"Whether the editor has a definition provider")),e0.hasDeclarationProvider=new hJ("editorHasDeclarationProvider",!1,(0,rh.NC)(714,"Whether the editor has a declaration provider")),e0.hasImplementationProvider=new hJ("editorHasImplementationProvider",!1,(0,rh.NC)(715,"Whether the editor has an implementation provider")),e0.hasTypeDefinitionProvider=new hJ("editorHasTypeDefinitionProvider",!1,(0,rh.NC)(716,"Whether the editor has a type definition provider")),e0.hasHoverProvider=new hJ("editorHasHoverProvider",!1,(0,rh.NC)(717,"Whether the editor has a hover provider")),e0.hasDocumentHighlightProvider=new hJ("editorHasDocumentHighlightProvider",!1,(0,rh.NC)(718,"Whether the editor has a document highlight provider")),e0.hasDocumentSymbolProvider=new hJ("editorHasDocumentSymbolProvider",!1,(0,rh.NC)(719,"Whether the editor has a document symbol provider")),e0.hasReferenceProvider=new hJ("editorHasReferenceProvider",!1,(0,rh.NC)(720,"Whether the editor has a reference provider")),e0.hasRenameProvider=new hJ("editorHasRenameProvider",!1,(0,rh.NC)(721,"Whether the editor has a rename provider")),e0.hasSignatureHelpProvider=new hJ("editorHasSignatureHelpProvider",!1,(0,rh.NC)(722,"Whether the editor has a signature help provider")),e0.hasInlayHintsProvi
22der=new hJ("editorHasInlayHintsProvider",!1,(0,rh.NC)(723,"Whether the editor has an inline hints provider")),e0.hasDocumentFormattingProvider=new hJ("editorHasDocumentFormattingProvider",!1,(0,rh.NC)(724,"Whether the editor has a document formatting provider")),e0.hasDocumentSelectionFormattingProvider=new hJ("editorHasDocumentSelectionFormattingProvider",!1,(0,rh.NC)(725,"Whether the editor has a document selection formatting provider")),e0.hasMultipleDocumentFormattingProvider=new hJ("editorHasMultipleDocumentFormattingProvider",!1,(0,rh.NC)(726,"Whether the editor has multiple document formatting providers")),e0.hasMultipleDocumentSelectionFormattingProvider=new hJ("editorHasMultipleDocumentSelectionFormattingProvider",!1,(0,rh.NC)(727,"Whether the editor has multiple document selection formatting providers"));class CL extends d${runEditorCommand(e,t,i){let n=t._getViewModel();n&&this.runCoreEditorCommand(n,i||{})}}(e2=ne||(ne={})).metadata={description:"Scroll editor in the given direction",args:[{name:"Editor scroll argument object",description:`Property-value pairs that can be passed through this argument:
23					* 'to': A mandatory direction value.
24						\`\`\`
25						'up', 'down'
26						\`\`\`
27					* 'by': Unit to move. Default is computed based on 'to' value.
28						\`\`\`
29						'line', 'wrappedLine', 'page', 'halfPage', 'editor'
30						\`\`\`
31					* 'value': Number of units to move. Default is '1'.
32					* 'revealCursor': If 'true' reveals the cursor if it is outside view port.
33				`,constraint:function(e){return!!(0,re.Kn)(e)&&!!((0,re.HD)(e.to)&&((0,re.o8)(e.by)||(0,re.HD)(e.by))&&((0,re.o8)(e.value)||(0,re.hj)(e.value))&&((0,re.o8)(e.revealCursor)||(0,re.jn)(e.revealCursor)))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},e2.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},e2.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"},e2.parse=function(e){let t,i;switch(e.to){case e2.RawDirection.Up:t=1;break;case e2.RawDirection.Right:t=2;break;case e2.RawDirection.Down:t=3;break;case e2.RawDirection.Left:t=4;break;default:return null}switch(e.by){case e2.RawUnit.Line:i=1;break;case e2.RawUnit.WrappedLine:i=2;break;case e2.RawUnit.Page:i=3;break;case e2.RawUnit.HalfPage:i=4;break;case e2.RawUnit.Editor:i=5;break;case e2.RawUnit.Column:i=6;break;default:i=2}return{direction:t,unit:i,value:Math.floor(e.value||1),revealCursor:!!e.revealCursor,select:!!e.select}},(e5=nt||(nt={})).metadata={description:"Reveal the given line at the given logical position",args:[{name:"Reveal line argument object",description:`Property-value pairs that can be passed through this argument:
34					* 'lineNumber': A mandatory line number value.
35					* 'at': Logical position at which line has to be revealed.
36						\`\`\`
37						'top', 'center', 'bottom'
38						\`\`\`
39				`,constraint:function(e){return!!(0,re.Kn)(e)&&!!(((0,re.hj)(e.lineNumber)||(0,re.HD)(e.lineNumber))&&((0,re.o8)(e.at)||(0,re.HD)(e.at)))},schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},e5.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"};class Cx{constructor(e){e.addImplementation(1e4,"code-editor",(e,t)=>{let i=e.get(hi).getFocusedCodeEditor();return!!(i&&i.hasTextFocus())&&this._runEditorCommand(e,i,t)}),e.addImplementation(1e3,"generic-dom-input-textarea",(e,t)=>{let i=lg();return!!(i&&lH(i))&&(this.runDOMCommand(i),!0)}),e.addImplementation(0,"generic-dom",(e,t)=>{let i=e.get(hi).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))})}_runEditorCommand(e,t,i){let n=this.runEditorCommand(e,t,i);return!n||n}}!function(e){class t extends CL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[bQ.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&2!==t.revealType&&e.revealAllCursors(t.source,!0,!0))}}e.MoveTo=dj(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=dj(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends CL{runCoreEditorCommand(e,t){e.model.pushStackElement();let i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);null!==i&&(e.setCursorStates(t.source,3,i.viewStates.map(e=>bI.fromViewState(e))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=dj(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){if(void 0===n.position||void 0===n.viewPosition||void 0===n.mouseColumn)return null;let s=e.model.validatePosition(n.position),r=e.coordinatesConverter.validateViewPosition(new s3(n.viewPosition.lineNumber,n.viewPosition.column),s),o=n.doColumnSelect?i.fromViewLineNumber:r.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mou
39seColumn-1;return bF.columnSelect(e.cursorConfig,e,o,a,r.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=dj(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return bF.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=dj(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return bF.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return bF.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=dj(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=dj(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return bF.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=dj(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=dj(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:3596,linux:{primary:0}}}));class r extends CL{constructor(){super({id:"cursorMove",precondition:void 0,metadata:i3.metadata})}runCoreEditorCommand(e,t){let i=i3.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){let n=i.noHistory?"api":t;e.model.pushStackElement(),e.setCursorStates(n,3,r._move(e,e.getCursorStates(),i)),e.revealAllCursors(n,!0)}static _move(e,t,i){let n=i.select,s=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return bQ.simpleMove(e,t,i.direction,n,s,i.unit);case 11:case 13:case 12:case 14:return bQ.viewportMove(e,t,i.direction,n,s);default:return null}}}e.CursorMoveImpl=r,e.CursorMove=dj(new r);class o extends CL{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,bQ.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealAllCursors(t.source,!0)}}e.CursorLeft=dj(new o({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=dj(new o({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:1039}})),e.CursorRight=dj(new o({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=dj(new o({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:1041}})),e.CursorUp=dj(new o({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=dj(new o({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=dj(new o({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:11}})),e.CursorPageUpSelect=dj(new o({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:1035}})),e.CursorDown=dj(new o({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=dj(new o({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=dj(new o({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:12}})),e.CursorPageDownSelect=dj(new o({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:1036}})),e.CreateCursor=dj(new class extends CL{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){let i;if(!t.position)return;i=t.wholeLine?bQ.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):bQ.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);let n=e.getCursorStates();if(n.length>1){let s=i.modelState?i.modelState.position:null,r=i.viewState?i.viewState.position:null;for(let i=0,o=n.length;i<o;i++){let o=n[i];if((!s||o.modelState.selection.containsPosition(s))&&(!r||o.viewState.selection.containsPosition(r))){n.splice(i,1),e.model.pushStackElement(),e.setCursorStates(t.source,3,n);return}}}n.push(i),e.model.pushStackElement(),e.setCursorStates(t.source,3,n)}}),e.LastCursorMoveToSelect=dj(new class extends CL{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),s=n.slice(0);s[i]=bQ.moveTo(e,n[i],!0,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,s)}});class a extends CL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,bQ.moveToBeginningOfLine(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorHome=dj(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),e.CursorHomeSelect=dj(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends CL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e){let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i],s=n.modelState.position.lineNumber;t[i]=bI.fromModelState(n.modelState.move(this._inSelectionMode,s,1,0))}return t}}e.CursorLineStart=dj(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:0,mac:{primary:287}}})),e.CursorLineStartSelect=dj(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:0,mac:{primary:1311}}}));class h extends CL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,bQ.moveToEndOfLine(e,e.getCursorStates(),this._inSelectionMode,t.sticky||!1)),e.revealAllCursors(t.source,!0)}}e.CursorEnd=dj(new h({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:i8.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},metadata:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:(0,rh.NC)(66,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),e.CursorEndSelect=dj(new h({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:0,kbExpr:i8.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},metadata:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:(0,rh.NC)(67,"Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class d extends CL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,this._exec(e,e.getCursorStates())),e.revealAllCursors(t.source,!0)}_exec(e,t){let i=[];for(let n=0,s=t.length;n<s;n++){let s=t[n],r=s.modelState.position.lineNumber,o=e.model.getLineMaxColumn(r);i[n]=bI.fromModelState(s.modelState.move(this._inSelectionMode,r,o,0))}return i}}e.CursorLineEnd=dj(new d({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:0,mac:{primary:291}}})),e.CursorLineEndSelect=dj(new d({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:0,mac:{primary:1315}}}));class u extends CL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,bQ.moveToBeginningOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}e.CursorTop=dj(new u({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:2062,mac:{primary:2064}}})),e.CursorTopSelect=dj(new u({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:3086,mac:{primary:3088}}}));class c extends CL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,bQ.moveToEndOfBuffer(e,e.getCursorStates(),this._inSelectionMode)),e.revealAllCursors(t.source,!0)}}
39e.CursorBottom=dj(new c({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:2061,mac:{primary:2066}}})),e.CursorBottomSelect=dj(new c({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:3085,mac:{primary:3090}}}));class g extends CL{constructor(){super({id:"editorScroll",precondition:void 0,metadata:ne.metadata})}determineScrollMethod(e){return[6].includes(e.unit)&&[4,2].includes(e.direction)?this._runHorizontalEditorScroll.bind(this):[1,2,3,4,5,6].includes(e.unit)&&[1,3].includes(e.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(e,t){let i=ne.parse(t);if(!i)return;let n=this.determineScrollMethod(i);n&&n(e,t.source,i)}_runVerticalEditorScroll(e,t,i){let n=this._computeDesiredScrollTop(e,i);if(i.revealCursor){let s=e.getCompletelyVisibleViewRangeAtScrollTop(n);e.setCursorStates(t,3,[bQ.findPositionInViewportIfOutside(e,e.getPrimaryCursorState(),s,i.select)])}e.viewLayout.setScrollPosition({scrollTop:n},0)}_computeDesiredScrollTop(e,t){let i;if(1===t.unit){let i;let n=e.viewLayout.getFutureViewport(),s=e.getCompletelyVisibleViewRangeAtScrollTop(n.top),r=e.coordinatesConverter.convertViewRangeToModelRange(s);i=1===t.direction?Math.max(1,r.startLineNumber-t.value):Math.min(e.model.getLineCount(),r.startLineNumber+t.value);let o=e.coordinatesConverter.convertModelPositionToViewPosition(new s3(i,1));return e.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber)}if(5===t.unit){let i=0;return 3===t.direction&&(i=e.model.getLineCount()-e.cursorConfig.pageSize),e.viewLayout.getVerticalOffsetForLineNumber(i)}i=3===t.unit?e.cursorConfig.pageSize*t.value:4===t.unit?Math.round(e.cursorConfig.pageSize/2)*t.value:t.value;let n=(1===t.direction?-1:1)*i;return e.viewLayout.getCurrentScrollTop()+n*e.cursorConfig.lineHeight}_runHorizontalEditorScroll(e,t,i){let n=this._computeDesiredScrollLeft(e,i);e.viewLayout.setScrollPosition({scrollLeft:n},0)}_computeDesiredScrollLeft(e,t){let i=(4===t.direction?-1:1)*t.value;return e.viewLayout.getCurrentScrollLeft()+i*e.cursorConfig.typicalHalfwidthCharacterWidth}}e.EditorScrollImpl=g,e.EditorScroll=dj(new g),e.ScrollLineUp=dj(new class extends CL{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ne.RawDirection.Up,by:ne.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageUp=dj(new class extends CL{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ne.RawDirection.Up,by:ne.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorTop=dj(new class extends CL{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ne.RawDirection.Up,by:ne.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLineDown=dj(new class extends CL{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ne.RawDirection.Down,by:ne.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollPageDown=dj(new class extends CL{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ne.RawDirection.Down,by:ne.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollEditorBottom=dj(new class extends CL{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ne.RawDirection.Down,by:ne.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollLeft=dj(new class extends CL{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ne.RawDirection.Left,by:ne.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}}),e.ScrollRight=dj(new class extends CL{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus}})}runCoreEditorCommand(t,i){e.EditorScroll.runCoreEditorCommand(t,{to:ne.RawDirection.Right,by:ne.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:i.source})}});class f extends CL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[bQ.word(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position)]),2!==t.revealType&&e.revealAllCursors(t.source,!0,!0))}}e.WordSelect=dj(new f({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),e.WordSelectDrag=dj(new f({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),e.LastCursorWordSelect=dj(new class extends CL{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),s=n.slice(0),r=n[i];s[i]=bQ.word(e,r,r.modelState.hasSelection(),t.position),e.model.pushStackElement(),e.setCursorStates(t.source,3,s)}});class m extends CL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){t.position&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[bQ.line(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)]),2!==t.revealType&&e.revealAllCursors(t.source,!1,!0))}}e.LineSelect=dj(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),e.LineSelectDrag=dj(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class p extends CL{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;let i=e.getLastAddedCursorIndex(),n=e.getCursorStates(),s=n.slice(0);s[i]=bQ.line(e,n[i],this._inSelectionMode,t.position,t.viewPosition),e.model.pushStackElement(),e.setCursorStates(t.source,3,s)}}e.LastCursorLineSelect=dj(new p({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),e.LastCursorLineSelectDrag=dj(new p({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),e.CancelSelection=dj(new class extends CL{constructor(){super({id:"cancelSelection",precondition:i8.hasNonEmptySelection,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[bQ.cancelSelection(e,e.getPrimaryCursorState())]),e.revealAllCursors(t.source,!0)}}),e.RemoveSecondaryCursors=dj(new class extends CL{constructor(){super({id:"removeSecondaryCursors",precondition:i8.hasMultipleSelections,kbOpts:{weight:1,kbExpr:i8.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates(t.source,3,[e.getPrimaryCursorState()]),e.revealAllCursors(t.source,!0),mi((0,rh.NC)(68,"Removed secondary cursors"))}}),e.RevealLine=dj(new class extends CL{constructor(){super({id:"revealLine",precondition:void 0,metadata:nt.metadata})}runCoreEditorCommand(e,t){let i=t.lineNumber||0,n="number"==typeof i?i+1:parseInt(i)+1;n<1&&(n=1);let s=e.model.getLineCount();n>s&&(n=s);let r=new s9(n,1,n,e.model.getLineMaxColumn(n)),o=0;if(t.at)switch(t.at){case nt.RawAtArgument.Top:o=3;break;case nt.RawAtArgument.Center:o=1;break;case nt.RawAtArgument.Bottom:o=4}let a=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,a,o,0)}}),e.SelectAll=new class extends Cx{constructor(){super(dZ)}runDOMCommand(e){ol&&(e.focus(),e.select()),e.ownerDocument.execCommand("selectAll")}runEditorCommand(e,t,i){let n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[bQ.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=dj(new class extends CL{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[bI.fromModelSelection(t.selection)]))}})}(ni||(ni={}));let Ck=hI.and(i8.textInputFocus,i8.columnSelection);function CN(e,t){h6.registerKeybindingRule({id:e,primary:t,when:Ck,weight:1})}function CD(e){return e.register(),e}CN(ni.CursorColumnSelectLeft.id,1039),CN(ni.CursorColumnSelectRight.id,1041),CN(ni.CursorColumnSelectUp.id,1040),CN(ni.CursorColumnSelectPageUp.id,1035),CN(ni.CursorColumnSelectDown.id,1042),CN(ni.CursorColumnSelectPageDown.id,1036),function(e){class t extends d${runEditorCommand(e,t,i){let n=t._getViewModel();
39n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=dj(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:i8.writable,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Cr.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection)))}}),e.Outdent=dj(new class extends t{constructor(){super({id:"outdent",precondition:i8.writable,kbOpts:{weight:0,kbExpr:hI.and(i8.editorTextFocus,i8.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Cy.outdent(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.Tab=dj(new class extends t{constructor(){super({id:"tab",precondition:i8.writable,kbOpts:{weight:0,kbExpr:hI.and(i8.editorTextFocus,i8.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Cy.tab(t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection))),e.pushUndoStop()}}),e.DeleteLeft=dj(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){let[n,s]=bq.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,s),t.setPrevEditOperationType(2)}}),e.DeleteRight=dj(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:0,kbExpr:i8.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){let[n,s]=bq.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map(e=>e.modelState.selection));n&&e.pushUndoStop(),e.executeCommands(this.id,s),t.setPrevEditOperationType(3)}}),e.Undo=new class extends Cx{constructor(){super(dY)}runDOMCommand(e){e.ownerDocument.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(104))return t.getModel().undo()}},e.Redo=new class extends Cx{constructor(){super(dJ)}runDOMCommand(e){e.ownerDocument.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(104))return t.getModel().redo()}}}(nn||(nn={}));class CE extends dz{constructor(e,t,i){super({id:e,precondition:void 0,metadata:i}),this._handlerId=t}runCommand(e,t){let i=e.get(hi).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function CT(e,t){CD(new CE("default:"+e,e)),CD(new CE(e,e,t))}CT("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),CT("replacePreviousChar"),CT("compositionType"),CT("compositionStart"),CT("compositionEnd"),CT("paste"),CT("cut");class CI{constructor(e,t,i,n){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=n}paste(e,t,i,n){this.commandDelegate.paste(e,t,i,n)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,n){this.commandDelegate.compositionType(e,t,i,n)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){ni.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){let t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new s3(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(86)){case"altKey":return e.altKey;case"ctrlKey":return e.ctrlKey;case"metaKey":return e.metaKey;default:return!1}}_hasNonMulticursorModifier(e){switch(this.configuration.options.get(86)){case"altKey":return e.ctrlKey||e.metaKey;case"ctrlKey":return e.altKey||e.metaKey;case"metaKey":return e.ctrlKey||e.altKey;default:return!1}}dispatchMouse(e){let t=this.configuration.options,i=sS.IJ&&t.get(121),n=t.get(28),s=t.get(171);e.middleButton&&!i?s||this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():3===e.mouseDownCount?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):2===e.mouseDownCount?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):n?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}
39_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){ni.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){ni.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),ni.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),ni.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){ni.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){ni.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){ni.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){ni.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){ni.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){ni.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){ni.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){ni.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){ni.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class CM{constructor(e){this._lineFactory=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){let t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new o_.he("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;let i=this.getStartLineNumber(),n=this.getEndLineNumber();if(t<i)return this._rendLineNumberStart-=t-e+1,null;if(e>n)return null;let s=0,r=0;for(let o=i;o<=n;o++){let i=o-this._rendLineNumberStart;e<=o&&o<=t&&(0===r?(s=i,r=1):r++)}if(e<i){let n=0;n=t<i?t-e+1:i-e,this._rendLineNumberStart-=n}return this._lines.splice(s,r)}onLinesChanged(e,t){let i=e+t-1;if(0===this.getCount())return!1;let n=this.getStartLineNumber(),s=this.getEndLineNumber(),r=!1;for(let t=e;t<=i;t++)t>=n&&t<=s&&(this._lines[t-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(0===this.getCount())return null;let i=t-e+1,n=this.getStartLineNumber(),s=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>s)return null;if(i+e>s)return this._lines.splice(e-this._rendLineNumberStart,s-e+1);let r=[];for(let e=0;e<i;e++)r[e]=this._lineFactory.createLine();let o=e-this._rendLineNumberStart,a=this._lines.slice(0,o),l=this._lines.slice(o,this._lines.length-i),h=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=a.concat(r).concat(l),h}onTokensChanged(e){if(0===this.getCount())return!1;let t=this.getStartLineNumber(),i=this.getEndLineNumber(),n=!1;for(let s=0,r=e.length;s<r;
39s++){let r=e[s];if(r.toLineNumber<t||r.fromLineNumber>i)continue;let o=Math.max(t,r.fromLineNumber),a=Math.min(i,r.toLineNumber);for(let e=o;e<=a;e++){let t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class CR{constructor(e,t){this._viewContext=e,this._lineFactory=t,this.domNode=this._createDomNode(),this._linesCollection=new CM(this._lineFactory)}_createDomNode(){let e=l2(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(165)}onFlushed(e,t){if(t){let e=this._linesCollection.getStartLineNumber(),t=this._linesCollection.getEndLineNumber();for(let i=e;i<=t;i++)this._linesCollection.getLine(i).getDomNode()?.remove()}return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){let t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){let i=t[e].getDomNode();i?.remove()}return!0}onLinesInserted(e){let t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let e=0,i=t.length;e<i;e++){let i=t[e].getDomNode();i?.remove()}return!0}onScrollChanged(e){return e.scrollTopChanged}onTokensChanged(e){return this._linesCollection.onTokensChanged(e.ranges)}onZonesChanged(e){return!0}getStartLineNumber(){return this._linesCollection.getStartLineNumber()}getEndLineNumber(){return this._linesCollection.getEndLineNumber()}getVisibleLine(e){return this._linesCollection.getLine(e)}renderLines(e){let t=this._linesCollection._get(),i=new CA(this.domNode.domNode,this._lineFactory,e,this._viewContext),n={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},s=i.render(n,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(s.rendLineNumberStart,s.lines)}}class CA{static{this._ttPolicy=ut("editorViewLayer",{createHTML:e=>e})}constructor(e,t,i,n){this._domNode=e,this._lineFactory=t,this._viewportData=i,this._viewContext=n}render(e,t,i,n){let s={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(s.rendLineNumberStart+s.linesLength-1<t||i<s.rendLineNumberStart){s.rendLineNumberStart=t,s.linesLength=i-t+1,s.lines=[];for(let e=t;e<=i;e++)s.lines[e-t]=this._lineFactory.createLine();return this._finishRendering(s,!0,n),s}if(this._renderUntouchedLines(s,Math.max(t-s.rendLineNumberStart,0),Math.min(i-s.rendLineNumberStart,s.linesLength-1),n,t),s.rendLineNumberStart>t){let e=Math.min(i,s.rendLineNumberStart-1);t<=e&&(this._insertLinesBefore(s,t,e,n,t),s.linesLength+=e-t+1)}else if(s.rendLineNumberStart<t){let e=Math.min(s.linesLength,t-s.rendLineNumberStart);e>0&&(this._removeLinesBefore(s,e),s.linesLength-=e)}if(s.rendLineNumberStart=t,s.rendLineNumberStart+s.linesLength-1<i){let e=s.rendLineNumberStart+s.linesLength;e<=i&&(this._insertLinesAfter(s,e,i,n,t),s.linesLength+=i-e+1)}else if(s.rendLineNumberStart+s.linesLength-1>i){let e=Math.max(0,i-s.rendLineNumberStart+1),t=s.linesLength-1-e+1;t>0&&(this._removeLinesAfter(s,t),s.linesLength-=t)}return this._finishRendering(s,!1,n),s}_renderUntouchedLines(e,t,i,n,s){let r=e.rendLineNumberStart,o=e.lines;for(let e=t;e<=i;e++){let t=r+e;o[e].layoutLine(t,n[t-s],this._lineHeightForLineNumber(t))}}_insertLinesBefore(e,t,i,n,s){let r=[],o=0;for(let e=t;e<=i;e++)r[o++]=this._lineFactory.createLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){let t=e.lines[i].getDomNode();t?.remove()}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,n,s){let r=[],o=0;for(let e=t;e<=i;e++)r[o++]=this._lineFactory.createLine();e.lines=e.lines.concat(r)}_removeLinesAfter(e,t){let i=e.linesLength-t;for(let n=0;n<t;n++){let t=e.lines[i+n].getDomNode();t?.remove()}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,n){CA._ttPolicy&&(i=CA._ttPolicy.createHTML(i));
39let s=this._domNode.lastChild;t||!s?this._domNode.innerHTML=i:s.insertAdjacentHTML("afterend",i);let r=this._domNode.lastChild;for(let t=e.linesLength-1;t>=0;t--){let i=e.lines[t];n[t]&&(i.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){let n=document.createElement("div");CA._ttPolicy&&(t=CA._ttPolicy.createHTML(t)),n.innerHTML=t;for(let t=0;t<e.linesLength;t++){let s=e.lines[t];if(i[t]){let e=n.firstChild;s.getDomNode().replaceWith(e),s.setDomNode(e)}}}static{this._sb=new um(1e5)}_finishRendering(e,t,i){let n=CA._sb,s=e.linesLength,r=e.lines,o=e.rendLineNumberStart,a=[];{n.reset();let l=!1;for(let e=0;e<s;e++){let t=r[e];if(a[e]=!1,t.getDomNode())continue;let s=e+o;t.renderLine(s,i[e],this._lineHeightForLineNumber(s),this._viewportData,n)&&(a[e]=!0,l=!0)}l&&this._finishRenderingNewLines(e,t,n.build(),a)}{n.reset();let t=!1,l=[];for(let e=0;e<s;e++){let s=r[e];if(l[e]=!1,a[e])continue;let h=e+o;s.renderLine(h,i[e],this._lineHeightForLineNumber(h),this._viewportData,n)&&(l[e]=!0,t=!0)}t&&this._finishRenderingInvalidLines(e,n.build(),l)}}_lineHeightForLineNumber(e){return this._viewContext.viewLayout.getLineHeightForLineNumber(e)}}class CO extends vg{constructor(e){super(e),this._dynamicOverlays=[],this._isFocused=!1,this._visibleLines=new CR(this._context,{createLine:()=>new CP(this._dynamicOverlays)}),this.domNode=this._visibleLines.domNode;let t=this._context.configuration.options.get(59);l5(this.domNode,t),this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;e<t;e++)if(this._dynamicOverlays[e].shouldRender())return!0;return!1}dispose(){super.dispose();for(let e=0,t=this._dynamicOverlays.length;e<t;e++)this._dynamicOverlays[e].dispose();this._dynamicOverlays=[]}getDomNode(){return this.domNode}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);let t=this._context.configuration.options.get(59);return l5(this.domNode,t),!0}onFlushed(e){return this._visibleLines.onFlushed(e)}onFocusChanged(e){return this._isFocused=e.isFocused,!0}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onScrollChanged(e){return this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._visibleLines.onZonesChanged(e)}prepareRender(e){let t=this._dynamicOverlays.filter(e=>e.shouldRender());for(let i=0,n=t.length;i<n;i++){let n=t[i];n.prepareRender(e),n.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class CP{constructor(e){this._dynamicOverlays=e,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=l2(e)}onContentChanged(){}onTokensChanged(){}renderLine(e,t,i,n,s){let r="";for(let t=0,i=this._dynamicOverlays.length;t<i;t++)r+=this._dynamicOverlays[t].render(n.startLineNumber,e);return this._renderedContent!==r&&(this._renderedContent=r,s.appendString('
39<div style="top:'),s.appendString(String(t)),s.appendString("px;height:"),s.appendString(String(i)),s.appendString("px;line-height:"),s.appendString(String(i)),s.appendString('px;">'),s.appendString(r),s.appendString("</div>"),!0)}layoutLine(e,t,i){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(i),this._domNode.setLineHeight(i))}}class CF extends CO{constructor(e){super(e);let t=this._context.configuration.options.get(165);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){let t=this._context.configuration.options.get(165);return this._contentWidth=t.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class CB extends CO{constructor(e){super(e);let t=this._context.configuration.options,i=t.get(165);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),l5(this.domNode,t.get(59))}onConfigurationChanged(e){let t=this._context.configuration.options;l5(this.domNode,t.get(59));let i=t.get(165);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);let t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class CV{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){this.onKeyDown?.(e)}emitKeyUp(e){this.onKeyUp?.(e)}emitContextMenu(e){this.onContextMenu?.(this._convertViewToModelMouseEvent(e))}emitMouseMove(e){this.onMouseMove?.(this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){this.onMouseLeave?.(this._convertViewToModelMouseEvent(e))}emitMouseDown(e){this.onMouseDown?.(this._convertViewToModelMouseEvent(e))}emitMouseUp(e){this.onMouseUp?.(this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){this.onMouseDrag?.(this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){this.onMouseDrop?.(this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){this.onMouseDropCanceled?.()}emitMouseWheel(e){this.onMouseWheel?.(e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return CV.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){let i={...e};return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(5===i.type||8===i.type)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new s3(e.afterLineNumber,1)).lineNumber}}}i(57153);class CW extends vg{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=l2(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1,t=this._context.configuration.options.get(165),i=t.contentWidth-t.verticalScrollbarWidth;this.contentWidth!==i&&(this.contentWidth=i,e=!0);let n=t.contentLeft;return this.contentLeft!==n&&(this.contentLeft=n,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){let t=0;for(let i of e.getDecorationsInViewport()){let n,s;if(!i.options.blockClassName)continue;let r=this.blocks[t];
39r||(r=this.blocks[t]=l2(document.createElement("div")),this.domNode.appendChild(r)),i.options.blockIsAfterEnd?(n=e.getVerticalOffsetAfterLineNumber(i.range.endLineNumber,!1),s=e.getVerticalOffsetAfterLineNumber(i.range.endLineNumber,!0)):(n=e.getVerticalOffsetForLineNumber(i.range.startLineNumber,!0),s=i.range.isEmpty()&&!i.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(i.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(i.range.endLineNumber,!0));let[o,a,l,h]=i.options.blockPadding??[0,0,0,0];r.setClassName("blockDecorations-block "+i.options.blockClassName),r.setLeft(this.contentLeft-h),r.setWidth(this.contentWidth+h+a),r.setTop(n-e.scrollTop-o),r.setHeight(s-n+o+l),t++}for(let e=t;e<this.blocks.length;e++)this.blocks[e].domNode.remove();this.blocks.length=t}}class CH extends vg{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=l2(document.createElement("div")),vf.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=l2(document.createElement("div")),vf.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){for(let t of Object.keys(this._widgets))this._widgets[t].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){for(let e of Object.keys(this._widgets))this._widgets[e].updateAnchorViewPosition()}addWidget(e){let t=new Cz(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n,s){this._widgets[e.getId()].setPosition(t,i,n,s),this.setShouldRender()}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let e=this._widgets[t];delete this._widgets[t];let i=e.domNode.domNode;i.remove(),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){for(let t of Object.keys(this._widgets))this._widgets[t].onBeforeRender(e)}prepareRender(e){for(let t of Object.keys(this._widgets))this._widgets[t].prepareRender(e)}render(e){for(let t of Object.keys(this._widgets))this._widgets[t].render(e)}}class Cz{constructor(e,t,i){this._primaryAnchor=new CU(null,null),this._secondaryAnchor=new CU(null,null),this._context=e,this._viewDomNode=t,this._actual=i;let n=this._context.configuration.options,s=n.get(165),r=n.get(4);this.domNode=l2(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=(this._actual.allowEditorOverflow||!1)&&r,this.suppressMouseDown=this._actual.suppressMouseDown||!1,this._fixedOverflowWidgets=n.get(51),this._contentWidth=s.contentWidth,this._contentLeft=s.contentLeft,this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){let t=this._context.configuration.options;if(e.hasChanged(165)){let e=t.get(165);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){function n(e,t,i){if(!e)return new CU(null,null);let n=t.model.validatePosition(e);return t.coordinatesConverter.modelPositionIsVisible(n)?new CU(e,t.coordinatesConverter.convertModelPositionToViewPosition(n,i??void 0)):new CU(e,null)}this._affinity=e,this._primaryAnchor=n(t,this._context.viewModel,this._affinity),this._secondaryAnchor=n(i,this._context.viewModel,this._affinity)}_getMaxWidth(){let e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?t?.innerWidth||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,n){this._setPosition(n,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){let s=e.top,r=e.top+e.height,o=n.viewportHe
39ight-r,a=e.left;return a+t>n.scrollLeft+n.viewportWidth&&(a=n.scrollLeft+n.viewportWidth-t),a<n.scrollLeft&&(a=n.scrollLeft),{fitsAbove:s>=i,aboveTop:s-i,fitsBelow:o>=i,belowTop:r,left:a}}_layoutHorizontalSegmentInPage(e,t,i,n){let s=Math.max(15,t.left-n),r=Math.min(t.left+t.width+n,e.width-15),o=this._viewDomNode.domNode.ownerDocument.defaultView,a=t.left+i-(o?.scrollX??0);if(a+n>r){let e=a-(r-n);a-=e,i-=e}if(a<s){let e=a-s;a-=e,i-=e}return[i,a]}_layoutBoxInPage(e,t,i,n){let s=e.top-i,r=e.top+e.height,o=ls(this._viewDomNode.domNode),a=this._viewDomNode.domNode.ownerDocument,l=a.defaultView,h=o.top+s-(l?.scrollY??0),d=o.top+r-(l?.scrollY??0),u=lt(a.body),[c,g]=this._layoutHorizontalSegmentInPage(u,o,e.left-n.scrollLeft+this._contentLeft,t),f=h>=22,m=d+i<=u.height-22;return this._fixedOverflowWidgets?{fitsAbove:f,aboveTop:Math.max(h,22),fitsBelow:m,belowTop:d,left:g}:{fitsAbove:f,aboveTop:s,fitsBelow:m,belowTop:r,left:c}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new CK(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){return{primary:t(this._primaryAnchor.viewPosition,this._affinity),secondary:t(this._secondaryAnchor.viewPosition?.lineNumber===this._primaryAnchor.viewPosition?.lineNumber?this._secondaryAnchor.viewPosition:null,this._affinity)};function t(t,i){if(!t)return null;let n=e.visibleRangeForPosition(t);if(!n)return null;let s=1===t.column&&3===i?0:n.left;return new C$(e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop,s,e.getLineHeightForLineNumber(t.lineNumber))}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;let n=this._context.configuration.options.get(59),s=t.left;return s=s<e.left?Math.max(s,e.left-i+n.typicalFullwidthCharacterWidth):Math.min(s,e.left+i-n.typicalFullwidthCharacterWidth),new C$(e.top,s,e.height)}_prepareRenderWidget(e){let t;if(!this._preference||0===this._preference.length)return null;let{primary:i,secondary:n}=this._getAnchorsCoordinates(e);if(!i)return{kind:"offViewport",preserveFocus:this.domNode.domNode.contains(this.domNode.domNode.ownerDocument.activeElement)};if(-1===this._cachedDomNodeOffsetWidth||-1===this._cachedDomNodeOffsetHeight){let e=null;if("function"==typeof this._actual.beforeRender&&(e=Cj(this._actual.beforeRender,this._actual)),e)this._cachedDomNodeOffsetWidth=e.width,this._cachedDomNodeOffsetHeight=e.height;else{let e=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(e.width),this._cachedDomNodeOffsetHeight=Math.round(e.height)}}let s=this._reduceAnchorCoordinates(i,n,this._cachedDomNodeOffsetWidth);t=this.allowEditorOverflow?this._layoutBoxInPage(s,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):this._layoutBoxInViewport(s,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let e=1;e<=2;e++)for(let i of this._preference)if(1===i){if(!t)return null;if(2===e||t.fitsAbove)return{kind:"inViewport",coordinate:new CK(t.aboveTop,t.left),position:1}}else if(2===i){if(!t)return null;if(2===e||t.fitsBelow)return{kind:"inViewport",coordinate:new CK(t.belowTop,t.left),position:2}}else{if(this.allowEditorOverflow)return{kind:"inViewport",coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new CK(s.top,s.left)),position:0};return{kind:"inViewport",coordinate:new CK(s.top,s.left),position:0}}return null}onBeforeRender(e){this._primaryAnchor.viewPosition&&this._preference&&!(this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber)&&!(this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber)&&this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData||"offViewport"===this._renderData.kind){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this._renderData?.kind==="offViewport"&&this._renderData.preserveFocus?this.domNode.setTop(-1e3):this.domNode.setVisibility("hidden")),"function"==typeof this._actual.afterRender&&Cj(this._actual.afterRender,this._actual,null,null);return}this.allowEditorOverflow?this.domNode.setTop(this._renderData.coordinate.top):this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.b
39igNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),"function"==typeof this._actual.afterRender&&Cj(this._actual.afterRender,this._actual,this._renderData.position,this._renderData.coordinate)}}class CU{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class CK{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class C${constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function Cj(e,t,...i){try{return e.call(t,...i)}catch{return null}}i(12445);class Cq extends vc{}let CG=ht("themeService");function CQ(e){switch(e){case i2.DARK:return i5.VS_DARK;case i2.HIGH_CONTRAST_DARK:return i5.HC_BLACK;case i2.HIGH_CONTRAST_LIGHT:return i5.HC_LIGHT;default:return i5.VS}}let CY="base.contributions.theming";class CJ extends ro.JT{constructor(){super(),this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=this._register(new sd.Q5)}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),(0,ro.OF)(()=>{let t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}let CZ=new CJ;function CX(e){return CZ.onColorThemeChange(e)}h5.add(CY,CZ);class C1 extends ro.JT{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(e=>this.onThemeChange(e)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}
39let C0=mM("editor.lineHighlightBackground",null,(0,rh.NC)(610,"Background color for the highlight of line at the cursor position.")),C2=mM("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:mK},(0,rh.NC)(611,"Background color for the border around the line at the cursor position."));mM("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},(0,rh.NC)(612,"Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0),mM("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:m$,hcLight:m$},(0,rh.NC)(613,"Background color of the border around highlighted ranges.")),mM("editor.symbolHighlightBackground",{dark:po,light:po,hcDark:null,hcLight:null},(0,rh.NC)(614,"Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0),mM("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:m$,hcLight:m$},(0,rh.NC)(615,"Background color of the border around highlighted symbols."));let C5=mM("editorCursor.foreground",{dark:"#AEAFAD",light:gX.black,hcDark:gX.white,hcLight:"#0F4A85"},(0,rh.NC)(616,"Color of the editor cursor.")),C4=mM("editorCursor.background",null,(0,rh.NC)(617,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),C6=mM("editorMultiCursor.primary.foreground",C5,(0,rh.NC)(618,"Color of the primary editor cursor when multiple cursors are present.")),C7=mM("editorMultiCursor.primary.background",C4,(0,rh.NC)(619,"The background color of the primary editor cursor when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),C3=mM("editorMultiCursor.secondary.foreground",C5,(0,rh.NC)(620,"Color of secondary editor cursors when multiple cursors are present.")),C9=mM("editorMultiCursor.secondary.background",C4,(0,rh.NC)(621,"The background color of secondary editor cursors when multiple cursors are present. Allows customizing the color of a character overlapped by a block cursor.")),C8=mM("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},(0,rh.NC)(622,"Color of whitespace characters in the editor.")),we=mM("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:gX.white,hcLight:"#292929"},(0,rh.NC)(623,"Color of editor line numbers.")),wt=mM("editorIndentGuide.background",C8,(0,rh.NC)(624,"Color of the editor indentation guides."),!1,(0,rh.NC)(625,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),wi=mM("editorIndentGuide.activeBackground",C8,(0,rh.NC)(626,"Color of the active editor indentation guides."),!1,(0,rh.NC)(627,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),wn=mM("editorIndentGuide.background1",wt,(0,rh.NC)(628,"Color of the editor indentation guides (1).")),ws=mM("editorIndentGuide.background2","#00000000",(0,rh.NC)(629,"Color of the editor indentation guides (2).")),wr=mM("editorIndentGuide.background3","#00000000",(0,rh.NC)(630,"Color of the editor indentation guides (3).")),wo=mM("editorIndentGuide.background4","#00000000",(0,rh.NC)(631,"Color of the editor indentation guides (4).")),wa=mM("editorIndentGuide.background5","#00000000",(0,rh.NC)(632,"Color of the editor indentation guides (5).")),wl=mM("editorIndentGuide.background6","#00000000",(0,rh.NC)(633,"Color of the editor indentation guides (6).")),wh=mM("editorIndentGuide.activeBackground1",wi,(0,rh.NC)(634,"Color of the active editor indentation guides (1).")),wd=mM("editorIndentGuide.activeBackground2","#00000000",(0,rh.NC)(635,"Color of the active editor indentation guides (2).")),wu=mM("editorIndentGuide.activeBackground3","#00000000",(0,rh.NC)(636,"Color of the active editor indentation guides (3).")),wc=mM("editorIndentGuide.activeBackground4","#00000000",(0,rh.NC)(637,"Color of the active editor indentation guides (4).")),wg=mM("editorIndentGuide.activeBackgroun
39d5","#00000000",(0,rh.NC)(638,"Color of the active editor indentation guides (5).")),wf=mM("editorIndentGuide.activeBackground6","#00000000",(0,rh.NC)(639,"Color of the active editor indentation guides (6).")),wm=mM("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:m$,hcLight:m$},(0,rh.NC)(640,"Color of editor active line number"),!1,(0,rh.NC)(641,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));mM("editorLineNumber.activeForeground",wm,(0,rh.NC)(642,"Color of editor active line number"));let wp=mM("editorLineNumber.dimmedForeground",null,(0,rh.NC)(643,"Color of the final editor line when editor.renderFinalNewline is set to dimmed.")),w_=mM("editorRuler.foreground",{dark:"#5A5A5A",light:gX.lightgrey,hcDark:gX.white,hcLight:"#292929"},(0,rh.NC)(644,"Color of the editor rulers."));mM("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},(0,rh.NC)(645,"Foreground color of editor CodeLens")),mM("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},(0,rh.NC)(646,"Background color behind matching brackets")),mM("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:mK,hcLight:mK},(0,rh.NC)(647,"Color for matching brackets boxes"));let wv=mM("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},(0,rh.NC)(648,"Color of the overview ruler border.")),wb=mM("editorOverviewRuler.background",null,(0,rh.NC)(649,"Background color of the editor overview ruler."));mM("editorGutter.background",m1,(0,rh.NC)(650,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),mM("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:gX.fromHex("#fff").transparent(.8),hcLight:mK},(0,rh.NC)(651,"Border color of unnecessary (unused) source code in the editor."));let wC=mM("editorUnnecessaryCode.opacity",{dark:gX.fromHex("#000a"),light:gX.fromHex("#0007"),hcDark:null,hcLight:null},(0,rh.NC)(652,"Opacity of unnecessary (unused) source code in the editor. For example, \"#000000c0\" will render the code with 75% opacity. For high contrast themes, use the  'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out."));mM("editorGhostText.border",{dark:null,light:null,hcDark:gX.fromHex("#fff").transparent(.8),hcLight:gX.fromHex("#292929").transparent(.8)},(0,rh.NC)(653,"Border color of ghost text in the editor.")),mM("editorGhostText.foreground",{dark:gX.fromHex("#ffffff56"),light:gX.fromHex("#0007"),hcDark:null,hcLight:null},(0,rh.NC)(654,"Foreground color of the ghost text in the editor.")),mM("editorGhostText.background",null,(0,rh.NC)(655,"Background color of the ghost text in the editor.")),mM("editorOverviewRuler.rangeHighlightForeground",new gX(new gY(0,122,204,.6)),(0,rh.NC)(656,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0);let ww=mM("editorOverviewRuler.errorForeground",{dark:new gX(new gY(255,18,18,.7)),light:new gX(new gY(255,18,18,.7)),hcDark:new gX(new gY(255,50,50,1)),hcLight:"#B5200D"},(0,rh.NC)(657,"Overview ruler marker color for errors.")),wy=mM("editorOverviewRuler.warningForeground",{dark:m3,light:m3,hcDark:m9,hcLight:m9},(0,rh.NC)(658,"Overview ruler marker color for warnings.")),wS=mM("editorOverviewRuler.infoForeground",{dark:m8,light:m8,hcDark:pe,hcLight:pe},(0,rh.NC)(659,"Overview ruler marker color for infos.")),wL=mM("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},(0,rh.NC)(660,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),wx=mM("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},(0,rh.NC)(661,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),wk=mM("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},(0,rh.NC)(662,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),wN=mM("editorBracketHighlight.foreground4","#00000000",(0,rh.NC)(663,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),wD=mM("editorBracketHighlight.foreground5","#00000000",(0,rh.NC)(664,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),wE=mM("editorBracketHighlight.foreground6","#00000000",(0,rh.NC)(665,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),wT=mM("editorBracketHighlight.unexpectedBracket.foreground",{dark:new gX(new gY(255,18,18,.8)),light:new gX(new gY(255,18,18,.8)),hcDark:new gX(new gY(255,50,50,
391)),hcLight:"#B5200D"},(0,rh.NC)(666,"Foreground color of unexpected brackets.")),wI=mM("editorBracketPairGuide.background1","#00000000",(0,rh.NC)(667,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),wM=mM("editorBracketPairGuide.background2","#00000000",(0,rh.NC)(668,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),wR=mM("editorBracketPairGuide.background3","#00000000",(0,rh.NC)(669,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),wA=mM("editorBracketPairGuide.background4","#00000000",(0,rh.NC)(670,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),wO=mM("editorBracketPairGuide.background5","#00000000",(0,rh.NC)(671,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),wP=mM("editorBracketPairGuide.background6","#00000000",(0,rh.NC)(672,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),wF=mM("editorBracketPairGuide.activeBackground1","#00000000",(0,rh.NC)(673,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),wB=mM("editorBracketPairGuide.activeBackground2","#00000000",(0,rh.NC)(674,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),wV=mM("editorBracketPairGuide.activeBackground3","#00000000",(0,rh.NC)(675,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),wW=mM("editorBracketPairGuide.activeBackground4","#00000000",(0,rh.NC)(676,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),wH=mM("editorBracketPairGuide.activeBackground5","#00000000",(0,rh.NC)(677,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),wz=mM("editorBracketPairGuide.activeBackground6","#00000000",(0,rh.NC)(678,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));mM("editorUnicodeHighlight.border",m3,(0,rh.NC)(679,"Border color used to highlight unicode characters.")),mM("editorUnicodeHighlight.background",m7,(0,rh.NC)(680,"Background color used to highlight unicode characters.")),CX((e,t)=>{let i=e.getColor(m1),n=e.getColor(C0),s=n&&!n.isTransparent()?n:i;s&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});class wU extends Cq{constructor(e){super(),this._context=e;let t=this._context.configuration.options,i=t.get(165);this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new s8(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1,t=new Set;for(let e of this._selections)t.add(e.positionLineNumber);let i=Array.from(t);i.sort((e,t)=>e-t),(0,as.fS)(this._cursorLineNumbers,i)||(this._cursorLineNumbers=i,e=!0);let n=this._selections.every(e=>e.isEmpty());return this._selectionIsEmpty!==n&&(this._selectionIsEmpty=n,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(165);return this._renderLineHighlight=t.get(110),this._renderLineHighlightOnlyWhenFocus=t.get(111),this._wordWrap=i.isViewportWrapping,this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return!!this._renderLineHighlightOnlyWhenFocus&&(this._focused=e.isFocused,!0)}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=[];for(let e=t;e<=i;e++)n[e-t]="";if(this._wordWrap){let s=this._renderOne(e,!1);for(let e of this._cursorLineNumbers){let r=this._context.viewModel.coordinatesConverter,o=r.convertViewPositionToModelPosition(new s3(e,1)).lineNumber,a=r.convertModelPositionToViewPosition(new s3(o,1)).lineNumber,l=r.convertModelPositionToViewPosition(new s3(o,this._context.viewModel.model.getLineMaxColumn(o))).lineNumber,h=Math.max(a,t),d=Math.min(l,i);for(let e=h;e<=d;e++)n[e-t]=s}}let s=this._renderOne(e,!0);for(let e of this._cursorLineNumbers)e<t||e>i||(n[e-t]=s);this._renderData=n}render(e,t){if(!this._renderData)return"";let i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class wK extends wU{_renderOne(e,t){let i="current-line"+(this._shouldRenderInMargin()?" current-line-both":"")+(t?" current-line-exact":"");return`<div class="${i}" style="width:${Math.max(e.scrollWidth,this._contentWidth)}px;"></div>`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class w$ extends wU{_renderOne(e,t){let i="current-line"+(this._shouldRenderInMargin()?" current-line-margin":"")+(this._shouldRenderOther()?" current-line-margin-both":"")+(this._shouldRenderInMargin()&&t?" current-line-exact-margin":"");return`<div class="${i}" style="width:${this._contentLeft}px"></div>`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}CX((e,t)=>{let i=e.getColor(C0);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }
39`)),!i||i.isTransparent()||e.defines(C2)){let i=e.getColor(C2);i&&(t.addRule(`.monaco-editor .view-overlays .current-line-exact { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-exact-margin { border: 2px solid ${i}; }`),vS(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line-exact { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-exact-margin { border-width: 1px; }")))}}),i(39194);class wj extends Cq{constructor(e){super(),this._context=e;let t=this._context.configuration.options;this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){let t=e.getDecorationsInViewport(),i=[],n=0;for(let e=0,s=t.length;e<s;e++){let s=t[e];s.options.className&&(i[n++]=s)}i=i.sort((e,t)=>{if(e.options.zIndex<t.options.zIndex)return -1;if(e.options.zIndex>t.options.zIndex)return 1;let i=e.options.className,n=t.options.className;return i<n?-1:i>n?1:s9.compareRangesUsingStarts(e.range,t.range)});let s=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,o=[];for(let e=s;e<=r;e++)o[e-s]="";this._renderWholeLineDecorations(e,i,o),this._renderNormalDecorations(e,i,o),this._renderResult=o}_renderWholeLineDecorations(e,t,i){let n=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!r.options.isWholeLine)continue;let o='<div class="cdr '+r.options.className+'" style="left:0;width:100%;"></div>',a=Math.max(r.range.startLineNumber,n),l=Math.min(r.range.endLineNumber,s);for(let e=a;e<=l;e++){let t=e-n;i[t]+=o}}}_renderNormalDecorations(e,t,i){let n=e.visibleRange.startLineNumber,s=null,r=!1,o=null,a=!1;for(let l=0,h=t.length;l<h;l++){let h=t[l];if(h.options.isWholeLine)continue;let d=h.options.className,u=!!h.options.showIfCollapsed,c=h.range;if(u&&1===c.endColumn&&c.endLineNumber!==c.startLineNumber&&(c=new s9(c.startLineNumber,c.startColumn,c.endLineNumber-1,this._context.viewModel.getLineMaxColumn(c.endLineNumber-1))),s===d&&r===u&&s9.areIntersectingOrTouching(o,c)){o=s9.plusRange(o,c);continue}null!==s&&this._renderNormalDecoration(e,o,s,a,r,n,i),s=d,r=u,o=c,a=h.options.shouldFillLineOnLineBreak??!1}null!==s&&this._renderNormalDecoration(e,o,s,a,r,n,i)}_renderNormalDecoration(e,t,i,n,s,r,o){let a=e.linesVisibleRangesForRange(t,"findMatch"===i);if(a)for(let e=0,t=a.length;e<t;e++){let t=a[e];if(t.outsideRenderedLine)continue;let l=t.lineNumber-r;if(s&&1===t.ranges.length){let e=t.ranges[0];if(e.width<this._typicalHalfwidthCharacterWidth){let i=Math.max(0,Math.round(Math.round(e.left+e.width/2)-this._typicalHalfwidthCharacterWidth/2));t.ranges[0]=new vv(i,this._typicalHalfwidthCharacterWidth)}}for(let e=0,s=t.ranges.length;e<s;e++){let r=n&&t.continuesOnNextLine&&1===s,a=t.ranges[e],h='<div class="cdr '+i+'" style="left:'+String(a.left)+"px;width:"+(r?"100%;":String(a.width)+"px;")+'"></div>';o[l]+=h}}}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class wq extends vg{constructor(e,t,i,n){super(e);let s=this._context.configuration.options,r=s.get(117),o=s.get(83),a=s.get(49),l=s.get(120),h=s.get(158),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+CQ(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:o,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:r.scrollByPage,inertialScroll:h};this.scrollbar=this._register(new bt(t.domNode,d,this._context.viewLayout.getScrollable())),vf.write(this.scrollbar.getDomNode(),6),this.scrollbarDomNode=l2(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();let u=(e,t,i)=>{let n={};{let t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){let t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(a6(i.domNode,"scroll",e=>u(i.domNode,!0,!0))),this._register(a6(t.domNode,"scroll",e=>u(t.domNode,!0,!1))),this._register(a6(n.domNode,"scroll",e=>u(n.domNode,!0,!1))),this._register(a6(this.scrollbarDomNode.domNode,"scroll",e=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){let e=this._context.configuration.options,t=e.get(165);this.scrollbarDomNode.setLeft(t.contentLeft),"right"===e.get(81).side?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(117)||e.hasChanged(83)||e.hasChanged(49)){let e=this._context.configuration.options,t=e.get(117),i=e.get(83),n=e.get(49),s=e.get(120),r={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:s};this.scrollbar.updateOptions(r)}return e.hasChanged(165)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+CQ(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}i(1240);class wG{constructor(e,t,i,n,s){this.startLineNumber=e,this.endLineNumber=t,this.className=i,this.tooltip=n,this._decorationToRenderBrand=void 0,this.zIndex=s??0}}class wQ{constructor(e,t,i){this.className=e,this.zIndex=t,this.tooltip=i}}class wY{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class wJ extends Cq{_render(e,t,i){let n=[];for(let i=e;i<=t;i++)n[i-e]=new wY;if(0===i.length)return n;i.sort((e,t)=>
39e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.className<t.className?-1:1);let s=null,r=0;for(let o=0,a=i.length;o<a;o++){let a=i[o],l=a.className,h=a.zIndex,d=Math.max(a.startLineNumber,e)-e,u=Math.min(a.endLineNumber,t)-e;s===l?(d=Math.max(r+1,d),r=Math.max(r,u)):(s=l,r=u);for(let e=d;e<=r;e++)n[e].add(new wQ(l,h,a.tooltip))}return n}}class wZ extends vg{constructor(e){super(e),this._widgets={},this._context=e;let t=this._context.configuration.options,i=t.get(165);this.domNode=l2(document.createElement("div")),this.domNode.setClassName("glyph-margin-widgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this._lineHeight=t.get(75),this._glyphMargin=t.get(66),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(165);return this._lineHeight=t.get(75),this._glyphMargin=t.get(66),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}addWidget(e){let t=l2(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:e.getPosition(),domNode:t,renderInfo:null},t.setPosition("absolute"),t.setDisplay("none"),t.setAttribute("widgetId",e.getId()),this.domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){let i=this._widgets[e.getId()];return!(i.preference.lane===t.lane&&i.preference.zIndex===t.zIndex&&s9.equalsRange(i.preference.range,t.range))&&(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){let t=e.getId();if(this._widgets[t]){let e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){let i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let s of e.getDecorationsInViewport()){let e=s.options.glyphMarginClassName;if(!e)continue;let r=Math.max(s.range.startLineNumber,i),o=Math.min(s.range.endLineNumber,n),a=s.options.glyphMargin?.position??iJ.Center,l=s.options.zIndex??0;for(let i=r;i<=o;i++){let n=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new s3(i,0)),s=this._context.viewModel.glyphLanes.getLanesAtLine(n.lineNumber).indexOf(a);t.push(new wX(i,s,l,e))}}}_collectWidgetBasedGlyphRenderRequest(e,t){let i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let e of Object.values(this._widgets)){let s=e.preference.range,{startLineNumber:r,endLineNumber:o}=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(s9.lift(s));if(!r||!o||o<i||r>n)continue;let a=Math.max(r,i),l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new s3(a,0)),h=this._context.viewModel.glyphLanes.getLanesAtLine(l.lineNumber).indexOf(e.preference.lane);t.push(new w1(a,h,e.preference.zIndex,e))}}_collectSortedGlyphRenderRequests(e){let t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((e,t)=>{if(e.lineNumber===t.lineNumber){if(e.laneIndex===t.laneIndex)return e.zIndex===t.zIndex?t.type===e.type?0===e.type&&0===t.type?e.className<t.className?-1:1:0:t.type-e.type:t.zIndex-e.zIndex;return e.laneIndex-t.laneIndex}return e.lineNumber-t.lineNumber}),t}prepareRender(e){if(!this._glyphMargin){this._decorationGlyphsToRender=[];return}for(let e of Object.values(this._widgets))e.renderInfo=null;let t=new as.H9(this._collectSortedGlyphRenderRequests(e)),i=[];for(;t.length>0;){let e=t.peek();if(!e)break;let n=t.takeWhile(t=>t.lineNumber===e.lineNumber&&t.laneIndex===e.laneIndex);
39if(!n||0===n.length)break;let s=n[0];if(0===s.type){let e=[];for(let t of n){if(t.zIndex!==s.zIndex||t.type!==s.type)break;(0===e.length||e[e.length-1]!==t.className)&&e.push(t.className)}i.push(s.accept(e.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,laneIndex:s.laneIndex}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(let e of Object.values(this._widgets))e.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){let e=this._managedDomNodes.pop();e?.domNode.remove()}return}let t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(let i of Object.values(this._widgets))if(i.renderInfo){let n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],s=this._glyphMarginLeft+i.renderInfo.laneIndex*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(s),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}else i.domNode.setDisplay("none");for(let i=0;i<this._decorationGlyphsToRender.length;i++){let n;let s=this._decorationGlyphsToRender[i],r=s.lineNumber,o=e.viewportData.relativeVerticalOffset[r-e.viewportData.startLineNumber],a=this._glyphMarginLeft+s.laneIndex*this._lineHeight;i<this._managedDomNodes.length?n=this._managedDomNodes[i]:(n=l2(document.createElement("div")),this._managedDomNodes.push(n),this.domNode.appendChild(n));let l=this._context.viewLayout.getLineHeightForLineNumber(r);n.setClassName("cgmr codicon "+s.combinedClassName),n.setPosition("absolute"),n.setTop(o),n.setLeft(a),n.setWidth(t),n.setHeight(l)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;){let e=this._managedDomNodes.pop();e?.domNode.remove()}}}class wX{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new w0(this.lineNumber,this.laneIndex,e)}}class w1{constructor(e,t,i,n){this.lineNumber=e,this.laneIndex=t,this.zIndex=i,this.widget=n,this.type=1}}class w0{constructor(e,t,i){this.lineNumber=e,this.laneIndex=t,this.combinedClassName=i}}i(11937);class w2 extends ro.JT{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw Error("TextModelPart is disposed!")}}(e4=ns||(ns={}))[e4.Disabled=0]="Disabled",e4[e4.EnabledForActive=1]="EnabledForActive",e4[e4.Enabled=2]="Enabled";class w5{constructor(e,t,i,n,s,r){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=s,this.forWrappedLinesBeforeOrAtColumn=r,-1!==e==(-1!==t))throw Error()}}class w4{constructor(e,t){this.top=e,this.endColumn=t}}class w6 extends w2{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return function(e,t){let i=0,n=0,s=e.length;for(;n<s;){let s=e.charCodeAt(n);if(32===s)i++;else if(9===s)i=i-i%t+t;else break;n++}return n===s?-1:i}(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();let n=this.textModel.getLineCount();if(e<1||e>n)throw new o_.he("Illegal value for lineNumber");let s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide),o=-2,a=-1,l=-2,h=-1,d=e=>{if(-1!==o&&(-2===o||o>e-1)){o=-1,a=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){o=t,a=e;break}}}if(-2===l){l=-1,h=-1;for(let t=e;t<n;t++){let e=this._computeIndentLevel(t);if(e>=0){l=t,h=e;break}}}},u=-2,c=-1,g=-2,f=-1,m=e=>{if(-2===u){u=-1,c=-1;for(let t=e-2;t>=0;t--){let e=this._computeIndentLevel(t);if(e>=0){u=t,c=e;break}}}if(-1!==g&&(-2===g||g<e-1)){g=-1,f=-1;for(let t=e;t<n;t++){let e=this._computeIndentLevel(t);if(e>=0){g=t,f=e;break}}}},p=0,_=!0,v=0,b=!0,C=0,w=0;for(let s=0;_||b;s++){let o=e-s,g=e+s;s>1&&(o<1||o<t)&&(_=!1),s>1&&(g>n||g>i)&&(b=!1),s>5e4&&(_=!1,b=!1);let y=-1;if(_&&o>=1){let e=this._computeIndentLevel(o-1);e>=0?(l=o-1,h=e,y=Math.ceil(e/this.textModel.getOptions().indentSize)):(d(o),y=this._getIndentLevelForWhitespaceLine(r,a,h))}let S=-1;if(b&&g<=n){let e=this._computeIndentLevel(g-1);e>=0?(u=g-1,c=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(m(g),S=this._getIndentLevelForWhitespaceLine(r,c,f))}if(0===s){w=y;continue}
39if(1===s){if(g<=n&&S>=0&&w+1===S){_=!1,p=g,v=g,C=S;continue}if(o>=1&&y>=0&&y-1===w){b=!1,p=o,v=o,C=y;continue}if(p=e,v=e,0===(C=w))break}_&&(y>=C?p=o:_=!1),b&&(S>=C?v=g:b=!1)}return{startLineNumber:p,endLineNumber:v,indent:C}}getLinesBracketGuides(e,t,i,n){let s;let r=[];for(let i=e;i<=t;i++)r.push([]);let o=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new s9(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();if(i&&o.length>0){let n=(e<=i.lineNumber&&i.lineNumber<=t?o:this.textModel.bracketPairs.getBracketPairsInRange(s9.fromPositions(i)).toArray()).filter(e=>s9.strictContainsPosition(e.range,i));s=cJ(n,e=>!0)?.range}let a=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,l=new w7;for(let i of o){if(!i.closingBracketRange)continue;let o=s&&i.range.equalsRange(s);if(!o&&!n.includeInactive)continue;let h=l.getInlineClassName(i.nestingLevel,i.nestingLevelOfEqualBracketType,a)+(n.highlightActive&&o?" "+l.activeClassName:""),d=i.openingBracketRange.getStartPosition(),u=i.closingBracketRange.getStartPosition(),c=n.horizontalGuides===ns.Enabled||n.horizontalGuides===ns.EnabledForActive&&o;if(i.range.startLineNumber===i.range.endLineNumber){c&&r[i.range.startLineNumber-e].push(new w5(-1,i.openingBracketRange.getEndPosition().column,h,new w4(!1,u.column),-1,-1));continue}let g=this.getVisibleColumnFromPosition(u),f=this.getVisibleColumnFromPosition(i.openingBracketRange.getStartPosition()),m=Math.min(f,g,i.minVisibleColumnIndentation+1),p=!1;rM(this.textModel.getLineContent(i.closingBracketRange.startLineNumber))<i.closingBracketRange.startColumn-1&&(p=!0);let _=Math.max(d.lineNumber,e),v=Math.min(u.lineNumber,t),b=p?1:0;for(let t=_;t<v+b;t++)r[t-e].push(new w5(m,-1,h,null,t===d.lineNumber?d.column:-1,t===u.lineNumber?u.column:-1));c&&(d.lineNumber>=e&&f>m&&r[d.lineNumber-e].push(new w5(m,-1,h,new w4(!1,d.column),-1,-1)),u.lineNumber<=t&&g>m&&r[u.lineNumber-e].push(new w5(m,-1,h,new w4(!p,u.column),-1,-1)))}for(let e of r)e.sort((e,t)=>e.visibleColumn-t.visibleColumn);return r}getVisibleColumnFromPosition(e){return vR.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();let i=this.textModel.getLineCount();if(e<1||e>i)throw Error("Illegal value for startLineNumber");if(t<1||t>i)throw Error("Illegal value for endLineNumber");let n=this.textModel.getOptions(),s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(s&&s.offSide),o=Array(t-e+1),a=-2,l=-1,h=-2,d=-1;for(let s=e;s<=t;s++){let t=s-e,u=this._computeIndentLevel(s-1);if(u>=0){a=s-1,l=u,o[t]=Math.ceil(u/n.indentSize);continue}if(-2===a){a=-1,l=-1;for(let e=s-2;e>=0;e--){let t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==h&&(-2===h||h<s-1)){h=-1,d=-1;for(let e=s;e<i;e++){let t=this._computeIndentLevel(e);if(t>=0){h=e,d=t;break}}}o[t]=this._getIndentLevelForWhitespaceLine(r,l,d)}return o}_getIndentLevelForWhitespaceLine(e,t,i){let n=this.textModel.getOptions();return -1===t||-1===i?0:t<i?1+Math.floor(t/n.indentSize):t===i?Math.ceil(i/n.indentSize):e?Math.ceil(i/n.indentSize):1+Math.floor(i/n.indentSize)}}class w7{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,t,i){return this.getInlineClassNameOfLevel(i?t:e)}getInlineClassNameOfLevel(e){return`bracket-indent-guide lvl-${e%30}`}}class w3 extends Cq{constructor(e){super(),this._context=e,this._primaryPosition=null;let t=this._context.configuration.options,i=t.get(166),n=t.get(59);this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(22),this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(166),n=t.get(59);return this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(22),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();return!this._primaryPosition?.equals(t)&&(this._primaryPosition=t,!0)}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onLanguageConfigurationChanged(e){return!0}prepareRender(e){if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs){this._renderResult=null;return}let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=e.scrollWidth,s=this._primaryPosition,r=this.getGuidesByLine(t,Math.min(i+1,this._context.viewModel.getLineCount()),s),o=[];for(let s=t;s<=i;s++){let i=s-t,a=r[i],l="",h=e.visibleRangeForPosition(new s3(s,1))?.left??0;for(let t of a){let i=-1===t.column?h+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new s3(s,t.column)).left;if(i>n||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;let r=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",o=t.horizontalLine?(e.visibleRangeForPosition(new s3(s,t.horizontalLine.endColumn))?.left??i+this._spaceWidth)-i:this._spaceWidth;l+=`<div class="core-guide ${t.className} ${r}" style="left:${i}px;width:${o}px"></div>`}o[i]=l}this._renderResult=o}getGuidesByLine(e,t,i){let n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?ns.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?ns.EnabledForActive:ns.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}
39):null,s=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null,r=0,o=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){let n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=n.startLineNumber,o=n.endLineNumber,a=n.indent}let{indentSize:l}=this._context.viewModel.model.getOptions(),h=[];for(let i=e;i<=t;i++){let t=[];h.push(t);let d=n?n[i-e]:[],u=new as.H9(d),c=s?s[i-e]:0;for(let e=1;e<=c;e++){let n=(e-1)*l+1,s=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===d.length)&&r<=i&&i<=o&&e===a;t.push(...u.takeWhile(e=>e.visibleColumn<n)||[]);let h=u.peek();(!h||h.visibleColumn!==n||h.horizontalLine)&&t.push(new w5(n,-1,`core-guide-indent lvl-${(e-1)%30}`+(s?" indent-active":""),null,-1,-1))}t.push(...u.takeWhile(e=>!0)||[])}return h}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function w9(e){if(!(e&&e.isTransparent()))return e}CX((e,t)=>{let i=new w7,n=[{bracketColor:wL,guideColor:wI,guideColorActive:wF},{bracketColor:wx,guideColor:wM,guideColorActive:wB},{bracketColor:wk,guideColor:wR,guideColorActive:wV},{bracketColor:wN,guideColor:wA,guideColorActive:wW},{bracketColor:wD,guideColor:wO,guideColorActive:wH},{bracketColor:wE,guideColor:wP,guideColorActive:wz}].map(t=>{let i=e.getColor(t.bracketColor),n=e.getColor(t.guideColor),s=e.getColor(t.guideColorActive),r=w9(w9(n)??i?.transparent(.3)),o=w9(w9(s)??i);if(r&&o)return{guideColor:r,guideColorActive:o}}).filter(re.$K),s=[{indentColor:wn,indentColorActive:wh},{indentColor:ws,indentColorActive:wd},{indentColor:wr,indentColorActive:wu},{indentColor:wo,indentColorActive:wc},{indentColor:wa,indentColorActive:wg},{indentColor:wl,indentColorActive:wf}].map(t=>{let i=e.getColor(t.indentColor),n=e.getColor(t.indentColorActive),s=w9(i),r=w9(n);if(s&&r)return{indentColor:s,indentColorActive:r}}).filter(re.$K);if(n.length>0){for(let e=0;e<30;e++){let s=n[e%n.length];t.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${s.guideColor}; --guide-color-active: ${s.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let e=0;e<30;e++){let i=s[e%s.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${i.indentColor}; --indent-color-active: ${i.indentColorActive}; }`)}t.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),t.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}}),i(91699);class w8 extends Cq{static{this.CLASS_NAME="line-numbers"}constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new s3(1,1),this._renderResult=null,this._activeModelLineNumber=1,this._context.addEventHandler(this)}_readConfig(){let e=this._context.configuration.options;this._lineHeight=e.get(75);let t=e.get(76);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(109);let i=e.get(165);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){let t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeModelLineNumber!==this._lastCursorModelPosition.lineNumber&&(this._activeModelLineNumber=this._lastCursorModelPosition.lineNumber,i=!0),(2===this._renderLineNumbers||3===this._renderLineNumbers)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return e.affectsLineNumber}_getLineRenderLineNumber(e){let t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new s3(e,1));if(1!==t.column)return"";let i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){let e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?'<span class="relative-current-line-number">'+i+"</span>":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0||i===this._context.viewModel.getLineCount()?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers){this._renderResult=null;return}let t=sS.IJ?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,s=this._context.viewModel.getDecorationsInViewport(e.visibleRange).filter(e=>!!e.options.lineNumberClassName);s.sort((e,t)=>
39s9.compareRangesUsingEnds(e.range,t.range));let r=0,o=this._context.viewModel.getLineCount(),a=[];for(let e=i;e<=n;e++){let n=e-i,l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new s3(e,1)).lineNumber,h=this._getLineRenderLineNumber(e),d="";for(;r<s.length&&s[r].range.endLineNumber<e;)r++;for(let t=r;t<s.length;t++){let{range:i,options:n}=s[t];i.startLineNumber<=e&&(d+=" "+n.lineNumberClassName)}if(!h&&!d){a[n]="";continue}e===o&&0===this._context.viewModel.getLineLength(e)&&("off"===this._renderFinalNewline&&(h=""),"dimmed"===this._renderFinalNewline&&(d+=" dimmed-line-number")),l===this._activeModelLineNumber&&(d+=" active-line-number"),a[n]=`<div class="${w8.CLASS_NAME}${t}${d}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${h}</div>`}this._renderResult=a}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}CX((e,t)=>{let i=e.getColor(we),n=e.getColor(wp);n?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):i&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i.transparent(.4)}; }`)}),i(69781);let ye="monaco-mouse-cursor-text";i(8741);class yt{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;let e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class yi{constructor(e,t){this.themeType=t;let i=e.options,n=i.get(59);this.renderWhitespace=i.get(113),this.experimentalWhitespaceRendering=i.get(47),this.renderControlCharacters=i.get(108),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(40),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(75),this.stopRenderingLineAfter=i.get(133),this.fontLigatures=i.get(60),this.verticalScrollbarSize=i.get(117).verticalScrollbarSize,this.useGpu="on"===i.get(46)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.experimentalWhitespaceRendering===e.experimentalWhitespaceRendering&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures&&this.verticalScrollbarSize===e.verticalScrollbarSize&&this.useGpu===e.useGpu}}class yn{constructor(){this._currentVisibleRange=new s9(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class ys{constructor(e,t,i,n,s,r,o){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=s,this.stopScrollTop=r,this.scrollType=o,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class yr{constructor(e,t,i,n,s){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=s,this.type="selections";let r=t[0].startLineNumber,o=t[0].endLineNumber;for(let e=1,i=t.length;e<i;e++){let i=t[e];r=Math.min(r,i.startLineNumber),o=Math.max(o,i.endLineNumber)}this.minLineNumber=r,this.maxLineNumber=o}}class yo extends vg{static{this.HORIZONTAL_EXTRA_PX=30}constructor(e,t,i){super(e);let n=this._context.configuration,s=this._context.configuration.options,r=s.get(59),o=s.get(166);this._lineHeight=s.get(75),this._typicalHalfwidthCharacterWidth=r.typicalHalfwidthCharacterWidth,this._isViewportWrapping=o.isViewportWrapping,this._revealHorizontalRightPadding=s.get(114),this._cursorSurroundingLines=s.get(35),this._cursorSurroundingLinesStyle=s.get(36),this._canUseLayerHinting=!s.get(39),this._viewLineOptions=new yi(n,this._context.theme.type),this._linesContent=i,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new CR(this._context,{createLine:()=>new vN(t,this._viewLineOptions)}),this.domNode=this._visibleLines.domNode,vf.write(this.domNode,8),this.domNode.setClassName(`view-lines ${ye}`),l5(this.domNode,r),this._maxLineWidth=0,this._asyncUpdateLineWidths=new oK(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new oK(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new yn,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(131).enabled,this._maxNumberStickyLines=s.get(131).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(166)&&(this._maxLineWidth=0);let t=this._context.configuration.options,i=t.get(59),n=t.get(166);return this._lineHeight=t.get(75),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(114),this._cursorSurroundingLines=t.get(35),this._cursorSurroundingLinesStyle=t.get(36),this._canUseLayerHinting=!t.get(39),this._stickyScrollEnabled=t.get(131).enabled,this._maxNumberStickyLines=t.get(131).maxLineCount,l5(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(165)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){let e=new yi(this._context.configuration,this._context.theme.type);if(!this._viewLineOptions.equals(e)){this._viewLineOptions=e;let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let e=t;e<=i;e++)this._visibleLines.getVisibleLine(e).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber(),n=!1;for(let e=t;e<=i;e++)n=this._visibleLines.getVisibleLine(e).onSelectionChanged()||n;return n}onDecorationsChanged(e){{let e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).onDecorationsChanged()}return!0}onFlushed(e){let t=this._visibleLines.onFlushed(e,this._viewLineOptions.useGpu);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}
39onRevealRangeRequest(e){let t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(-1===t)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new ys(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new yr(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;let n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){let t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){let i=this._getViewLineDomNode(e);if(null===i)return null;let n=this._getLineNumberFor(i);if(-1===n||n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new s3(n,1);let s=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(n<s||n>r)return null;let o=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t),a=this._context.viewModel.getLineMinColumn(n);return o<a&&(o=a),new s3(n,o)}_getViewLineDomNode(e){for(;e&&1===e.nodeType;){if(e.className===vN.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let n=t;n<=i;n++)if(e===this._visibleLines.getVisibleLine(n).getDomNode())return n;return -1}getLineWidth(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();if(e<t||e>i)return -1;let n=new yt(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;let i=e.endLineNumber,n=s9.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;let s=[],r=0,o=new yt(this.domNode.domNode,this._textRangeRestingSpot),a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new s3(n.startLineNumber,1)).lineNumber);let l=this._visibleLines.getStartLineNumber(),h=this._visibleLines.getEndLineNumber();for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(e<l||e>h)continue;let d=e===n.startLineNumber?n.startColumn:1,u=e!==i,c=u?this._context.viewModel.getLineMaxColumn(e):n.endColumn,g=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,d,c,o);if(g){if(t&&e<i){let t=a;if(t!==(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new s3(e+1,1)).lineNumber)){let e=g.ranges[g.ranges.length-1];e.width+=this._typicalHalfwidthCharacterWidth,this._context.viewModel.getTextDirection(t)===iZ.RTL&&(e.left-=this._typicalHalfwidthCharacterWidth)}}s[r++]=new v_(g.outsideRenderedLine,e,vv.from(g.ranges),u)}}return(this._updateLineWidthsSlowIfDomDidLayout(o),0===r)?null:s}_visibleRangesForLineRange(e,t,i){if(this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;let n=new yt(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}_lineIsRenderedRTL(e){return!(e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())&&this._visibleLines.getVisibleLine(e).isRenderedRTL()}visibleRangeForPosition(e){let t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new vC(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){!e.didDomLayout||this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow())}_updateLineWidths(e){let t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber(),n=1,s=!0;for(let r=t;r<=i;r++){let t=this._visibleLines.getVisibleLine(r);
39if(e&&!t.getWidthIsFast()){s=!1;continue}n=Math.max(n,t.getWidth(null))}return s&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),s}_checkMonospaceFontAssumptions(){let e=-1,t=-1,i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let s=i;s<=n;s++){let i=this._visibleLines.getVisibleLine(s);if(i.needsMonospaceFontCheck()){let n=i.getWidth(null);n>t&&(t=n,e=s)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let e=i;e<=n;e++)this._visibleLines.getVisibleLine(e).onMonospaceAssumptionsInvalidated()}prepareRender(){throw Error("Not supported")}render(){throw Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){let t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();let e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||e.hasRTL||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),sS.IJ&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){let e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)if(this._visibleLines.getVisibleLine(i).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");let t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){let t=Math.ceil(e);this._maxLineWidth<t&&(this._maxLineWidth=t,this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth))}_computeScrollTopToRevealRange(e,t,i,n,s,r){let o,a,l,h;let d=e.top,u=e.height,c=d+u;if(s&&s.length>0){let e=s[0].startLineNumber,t=s[0].endLineNumber;for(let i=1,n=s.length;i<n;i++){let n=s[i];e=Math.min(e,n.startLineNumber),t=Math.max(t,n.endLineNumber)}o=!1,a=this._context.viewLayout.getVerticalOffsetForLineNumber(e),l=this._context.viewLayout.getVerticalOffsetForLineNumber(t)+this._lineHeight}else{if(!n)return -1;o=!0,a=this._context.viewLayout.getVerticalOffsetForLineNumber(n.startLineNumber),l=this._context.viewLayout.getVerticalOffsetForLineNumber(n.endLineNumber)+this._lineHeight}let g=("mouse"===t||i)&&"default"===this._cursorSurroundingLinesStyle,f=0,m=0;if(g)i||(f=this._lineHeight);else{let e=Math.min(u/this._lineHeight/2,Math.max(this._cursorSurroundingLines,this._stickyScrollEnabled?this._maxNumberStickyLines:0));f=e*this._lineHeight,m=Math.max(0,e-1)*this._lineHeight}if(i||0!==r&&4!==r||(m+=this._lineHeight),a-=f,(l+=m)-a>u){if(!o)return -1;h=a}else if(5===r||6===r){if(6===r&&d<=a&&l<=c)h=d;else{let e=a-Math.max(5*this._lineHeight,.2*u);h=Math.max(l-u,e)}}else h=1===r||2===r?2===r&&d<=a&&l<=c?d:Math.max(0,(a+l)/2-u/2):this._computeMinimumScrolling(d,c,a,l,3===r,4===r);return h}_computeScrollLeftToReveal(e){let t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(165),n=t.left,s=n+t.width-i.verticalScrollbarWidth,r=1073741824,o=0,a=!1;if("range"===e.type){a=this._lineIsRenderedRTL(e.lineNumber);let t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(let e of t.ranges)r=Math.min(r,Math.round(e.left)),o=Math.max(o,Math.round(e.left+e.width))}else for(let t of e.selections){if(t.startLineNumber!==t.endLineNumber)return null;let e=this._visibleRangesForLineRange(t.startLineNumber,t.startColumn,t.endColumn);if(a||=this._lineIsRenderedRTL(t.startLineNumber),!e)return null;for(let t of e.ranges)r=Math.min(r,Math.round(t.left)),o=Math.max(o,Math.round(t.left+t.width))}
39return(e.minimalReveal||(r=Math.max(0,r-yo.HORIZONTAL_EXTRA_PX),o+=this._revealHorizontalRightPadding),"selections"===e.type&&o-r>t.width)?null:{scrollLeft:this._computeMinimumScrolling(n,s,r,o),maxHorizontalOffset:o,hasRTL:a}}_computeMinimumScrolling(e,t,i,n,s,r){e|=0,t|=0,i|=0,n|=0,s=!!s,r=!!r;let o=t-e;return!(n-i<o)||s?i:r?Math.max(0,n-o):i<e?i:n>t?Math.max(0,n-o):e}}i(34083);class ya extends wJ{constructor(e){super(),this._context=e;let t=this._context.configuration.options.get(165);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options.get(165);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){let t=e.getDecorationsInViewport(),i=[],n=0;for(let e=0,s=t.length;e<s;e++){let s=t[e],r=s.options.linesDecorationsClassName,o=s.options.zIndex;r&&(i[n++]=new wG(s.range.startLineNumber,s.range.endLineNumber,r,s.options.linesDecorationsTooltip??null,o));let a=s.options.firstLineDecorationClassName;a&&(i[n++]=new wG(s.range.startLineNumber,s.range.startLineNumber,a,s.options.linesDecorationsTooltip??null,o))}return i}prepareRender(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),s='" style="left:'+this._decorationsLeft.toString()+"px;width:"+this._decorationsWidth.toString()+'px;"></div>',r=[];for(let e=t;e<=i;e++){let i=e-t,o=n[i].getDecorations(),a="";for(let e of o){let t='<div class="cldr '+e.className;null!==e.tooltip&&(t+='" title="'+e.tooltip),t+=s,a+=t}r[i]=a}this._renderResult=r}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}i(99225);class yl extends vg{static{this.CLASS_NAME="glyph-margin"}static{this.OUTER_CLASS_NAME="margin"}constructor(e){super(e);let t=this._context.configuration.options,i=t.get(165);this._canUseLayerHinting=!t.get(39),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=l2(document.createElement("div")),this._domNode.setClassName(yl.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=l2(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(yl.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(165);return this._canUseLayerHinting=!t.get(39),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");let t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);let i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}i(52509);class yh extends wJ{constructor(e){super(),this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){let t=e.getDecorationsInViewport(),i=[],n=0;for(let e=0,s=t.length;e<s;e++){let s=t[e],r=s.options.marginClassName,o=s.options.zIndex;r&&(i[n++]=new wG(s.range.startLineNumber,s.range.endLineNumber,r,null,o))}return i}prepareRender(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),s=[];for(let e=t;e<=i;e++){let i=e-t,r=n[i].getDecorations(),o="";for(let e of r)o+='<div class="cmdr '+e.className+'" style=""></div>';s[i]=o}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}i(85799);class yd{static{this.Empty=new yd(0,0,0,0)}constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=yd._clamp(e),this.g=yd._clamp(t),this.b=yd._clamp(i),this.a=yd._clamp(n)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:0|e}}class yu extends ro.JT{static{this._INSTANCE=null}static getInstance(){return this._INSTANCE||(this._INSTANCE=(0,ro.dk)(new yu)),this._INSTANCE}constructor(){super(),this._onDidChange=new sd.Q5,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(rp.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){let e=rp.getColorMap();if(!e){this._colors=[yd.Empty],this._backgroundIsLight=!0;return}this._colors=[yd.Empty];for(let t=1;t<e.length;t++){let i=e[t].rgba;this._colors[t]=new yd(i.r,i.g,i.b,Math.round(255*i.a))}let t=e[2].getRelativeLuminance();this._backgroundIsLight=t>=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}let yc=(()=>{let e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})(),yg=(e,t)=>
39(e-=32)<0||e>96?t<=2?(e+96)%96:95:e;class yf{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=yf.soften(e,.8),this.charDataLight=yf.soften(e,50/60)}static soften(e,t){let i=new Uint8ClampedArray(e.length);for(let n=0,s=e.length;n<s;n++)i[n]=cp(e[n]*t);return i}renderChar(e,t,i,n,s,r,o,a,l,h,d){let u=1*this.scale,c=2*this.scale,g=d?1:c;if(t+u>e.width||i+g>e.height){console.warn("bad render request outside image data");return}let f=h?this.charDataLight:this.charDataNormal,m=yg(n,l),p=4*e.width,_=o.r,v=o.g,b=o.b,C=s.r-_,w=s.g-v,y=s.b-b,S=Math.max(r,a),L=e.data,x=m*u*c,k=i*p+4*t;for(let e=0;e<g;e++){let e=k;for(let t=0;t<u;t++){let t=f[x++]/255*(r/255);L[e++]=_+C*t,L[e++]=v+w*t,L[e++]=b+y*t,L[e++]=S}k+=p}}blockRenderChar(e,t,i,n,s,r,o,a){let l=1*this.scale,h=2*this.scale,d=a?1:h;if(t+l>e.width||i+d>e.height){console.warn("bad render request outside image data");return}let u=4*e.width,c=s/255*.5,g=r.r,f=r.g,m=r.b,p=n.r-g,_=n.g-f,v=n.b-m,b=g+p*c,C=f+_*c,w=m+v*c,y=Math.max(s,o),S=e.data,L=i*u+4*t;for(let e=0;e<d;e++){let e=L;for(let t=0;t<l;t++)S[e++]=b,S[e++]=C,S[e++]=w,S[e++]=y;L+=u}}}var ym=i(76519);let yp={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15},y_=e=>{let t=new Uint8ClampedArray(e.length/2);for(let i=0;i<e.length;i+=2)t[i>>1]=yp[e[i]]<<4|15&yp[e[i+1]];return t},yv={1:(0,ym.M)(()=>y_("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:(0,ym.M)(()=>y_("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class yb{static create(e,t){let i;return this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily?this.lastCreated:(i=yv[e]?new yf(yv[e](),e):yb.createFromSampleData(yb.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i)}static createSampleData(e){let t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(let e of yc)i.fillText(String.fromCharCode(e),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw Error("Unexpected source in MinimapCharRenderer");return new yf(yb._downsample(e,t),t)}static _downsampleChar(e,t,i,n,s){let r=1*s,o=2*s,a=n,l=0;for(let n=0;n<o;n++){let s=n/o*16,h=(n+1)/o*16;for(let n=0;n<r;n++){let o=n/r*10,d=(n+1)/r*10,u=0,c=0;for(let i=s;i<h;i++){let n=t+3840*Math.floor(i),s=1-(i-Math.floor(i));for(let t=o;t<d;t++){let i=1-(t-Math.floor(t)),r=n+4*Math.floor(t),o=i*s;c+=o,u+=e[r]*e[r+3]/255*o}}let g=u/c;l=Math.max(l,g),i[a++]=cp(g)}}return l}static _downsample(e,t){let i=2*t*1*t,n=96*i,s=new Uint8ClampedArray(n),r=0,o=0,a=0;for(let n=0;n<96;n++)a=Math.max(a,this._downsampleChar(e,o,s,r,t)),r+=i,o+=40;if(a>0){let e=255/a;for(let t=0;t<n;t++)s[t]*=e}return s}}let yC=sS.ED?'"Segoe WPC", "Segoe UI", sans-serif':sS.dz?"-apple-system, BlinkMacSystemFont, sans-serif":'system-ui, "Ubuntu", "Droid Sans", sans-serif';class yw{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}function yy(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){let s=e.tokenization.getLineTokens(n),r=n===t.startLineNumber,o=n===t.endLineNumber,a=r?s.findTokenIndexAtOffset(t.startColumn-1):0;for(;a<s.getCount()&&!(o&&s.getStartOffset(a)>t.endColumn-1);){if(!i(s.getStandardTokenType(a)))return!1;a++}}return!0}class yS{constructor(e,t,i){let n=e.options,s=n.get(163),r=n.get(165),o=r.minimap,a=n.get(59),l=n.get(81);this.renderMinimap=o.renderMinimap,this.size=l.size,this.minimapHeightIsEditorHeight=o.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=n.get(119),this.paddingTop=n.get(96).top,this.paddingBottom=n.get(96).bottom,this.showSlider=l.showSlider,this.autohide=l.autohide,this.pixelRatio=s,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.lineHeight=n.get(75),this.minimapLeft=o.minimapLeft,this.minimapWidth=o.minimapWidth,this.minimapHeight=r.height,this.canvasInnerWidth=o.minimapCanvasInnerWidth,this.canvasInnerHeight=o.minimapCanvasInnerHeight,this.canvasOuterWidth=o.minimapCanvasOuterWidth,this.canvasOuterHeight=o.minimapCanvasOuterHeight,this.isSampling=o.minimapIsSampling,this.editorHeight=r.height,this.fontScale=o.minimapScale,this.minimapLineHeight=o.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.sectionHeaderFontFamily=yC,this.sectionHeaderFontSize=l.sectionHeaderFontSize*s,this.sectionHeaderLetterSpacing=l.sectionHeaderLetterSpacing,this.sectionHeaderFontColor=yS._getSectionHeaderColor(t,i.getColor(1)),this.charRenderer=(0,ym.M)(()=>
39yb.create(this.fontScale,a.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=yS._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=yS._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){let i=e.getColor(pH);return i?new yd(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){let t=e.getColor(pz);return t?yd._clamp(Math.round(255*t.rgba.a)):255}static _getSectionHeaderColor(e,t){let i=e.getColor(m0);return i?new yd(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.sectionHeaderFontSize===e.sectionHeaderFontSize&&this.sectionHeaderLetterSpacing===e.sectionHeaderLetterSpacing&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class yL{constructor(e,t,i,n,s,r,o,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=s,this.sliderHeight=r,this.topPaddingLineCount=o,this.startLineNumber=a,this.endLineNumber=l}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){let t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,n,s,r,o,a,l,h,d){let u,c;let g=e.pixelRatio,f=e.minimapLineHeight,m=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let t=a*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(t+=Math.max(0,s-e.lineHeight-e.paddingBottom));let i=Math.max(1,Math.floor(s*s/t)),n=Math.max(0,e.minimapHeight-i),r=n/(h-s),d=Math.floor(e.canvasInnerHeight/e.minimapLineHeight);return new yL(l,h,n>0,r,l*r,i,Math.floor(e.paddingTop/e.lineHeight),1,Math.min(o,d))}u=r&&i!==o?Math.floor((i-t+1)*f/g):Math.floor(s/p*f/g);let _=Math.floor(e.paddingTop/p),v=Math.floor(e.paddingBottom/p);e.scrollBeyondLastLine&&(v=Math.max(v,s/p-1)),c=v>0?(_+o+v-s/p-1)*f/g:Math.max(0,(_+o)*f/g-u);let b=(c=Math.min(e.minimapHeight-u,c))/(h-s),C=l*b;if(m>=_+o+v)return new yL(l,h,c>0,b,C,u,_,1,o);{let i,s;let r=Math.max(1,Math.floor((t>1?t+_:Math.max(1,l/p))-C*g/f));r<_?(i=_-r+1,r=1):(i=0,r=Math.max(1,r-_)),d&&d.scrollHeight===h&&(d.scrollTop>l&&(r=Math.min(r,d.startLineNumber),i=Math.max(i,d.topPaddingLineCount)),d.scrollTop<l&&(r=Math.max(r,d.startLineNumber),i=Math.min(i,d.topPaddingLineCount)));let a=Math.min(o,r-i+m-1),c=(l-n)/p;return s=l>=e.paddingTop?(t-r+i+c)*f/g:l/e.paddingTop*(i+c)*f/g,new yL(l,h,!0,b,s,u,i,r,a)}}}class yx{static{this.INVALID=new yx(-1)}constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}class yk{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLine
39s=new CM({createLine:()=>yx.INVALID}),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;let t=this._renderedLines._get().lines;for(let e=0,i=t.length;e<i;e++)if(-1===t[e].dy)return!1;return!0}scrollEquals(e){return this.renderedLayout.startLineNumber===e.startLineNumber&&this.renderedLayout.endLineNumber===e.endLineNumber}_get(){let e=this._renderedLines._get();return{imageData:this._imageData,rendLineNumberStart:e.rendLineNumberStart,lines:e.lines}}onLinesChanged(e,t){return this._renderedLines.onLinesChanged(e,t)}onLinesDeleted(e,t){this._renderedLines.onLinesDeleted(e,t)}onLinesInserted(e,t){this._renderedLines.onLinesInserted(e,t)}onTokensChanged(e){return this._renderedLines.onTokensChanged(e)}}class yN{constructor(e,t,i,n){this._backgroundFillData=yN._createBackgroundFillData(t,i,n),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],this._lastUsedBuffer=0}getBuffer(){this._lastUsedBuffer=1-this._lastUsedBuffer;let e=this._buffers[this._lastUsedBuffer];return e.data.set(this._backgroundFillData),e}static _createBackgroundFillData(e,t,i){let n=i.r,s=i.g,r=i.b,o=i.a,a=new Uint8ClampedArray(e*t*4),l=0;for(let i=0;i<t;i++)for(let t=0;t<e;t++)a[l]=n,a[l+1]=s,a[l+2]=r,a[l+3]=o,l+=4;return a}}class yD{static compute(e,t,i){if(0===e.renderMinimap||!e.isSampling)return[null,[]];let{minimapLineCount:n}=sh.gk.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),s=t/n,r=s/2;if(!i||0===i.minimapLines.length){let e=[];
39if(e[0]=1,n>1){for(let t=0,i=n-1;t<i;t++)e[t]=Math.round(t*s+r);e[n-1]=t}return[new yD(s,e),[]]}let o=i.minimapLines,a=o.length,l=[],h=0,d=0,u=1,c=[],g=null;for(let e=0;e<n;e++){let i;let f=Math.max(u,Math.round(e*s)),m=Math.max(f,Math.round((e+1)*s));for(;h<a&&o[h]<f;){if(c.length<10){let e=h+1+d;g&&"deleted"===g.type&&g._oldIndex===h-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:h,deleteFromLineNumber:e,deleteToLineNumber:e},c.push(g)),d--}h++}if(h<a&&o[h]<=m)i=o[h],h++;else if(i=0===e?1:e+1===n?t:Math.round(e*s+r),c.length<10){let t=h+1+d;g&&"inserted"===g.type&&g._i===e-1?g.insertToLineNumber++:(g={type:"inserted",_i:e,insertFromLineNumber:t,insertToLineNumber:t},c.push(g)),d++}l[e]=i,u=i}if(c.length<10)for(;h<a;){let e=h+1+d;g&&"deleted"===g.type&&g._oldIndex===h-1?g.deleteToLineNumber++:(g={type:"deleted",_oldIndex:h,deleteFromLineNumber:e,deleteToLineNumber:e},c.push(g)),d--,h++}else c=[{type:"flush"}];return[new yD(s,l),c]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let n=this.modelLineToMinimapLine(t)-1;for(;n+1<this.minimapLines.length&&this.minimapLines[n+1]<=t;)n++;if(i===n){let n=this.minimapLines[i];if(n<e||n>t)return null}return[i+1,n+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),n=this.modelLineToMinimapLine(t);return e!==t&&n===i&&(n===this.minimapLines.length?i>1&&i--:n++),[i,n]}onLinesDeleted(e){let t=e.toLineNumber-e.fromLineNumber+1,i=this.minimapLines.length,n=0;for(let s=this.minimapLines.length-1;s>=0&&!(this.minimapLines[s]<e.fromLineNumber);s--)this.minimapLines[s]<=e.toLineNumber?(this.minimapLines[s]=Math.max(1,e.fromLineNumber-1),i=Math.min(i,s),n=Math.max(n,s)):this.minimapLines[s]-=t;return[i,n]}onLinesInserted(e){let t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class yE extends vg{constructor(e){super(e),this._sectionHeaderCache=new dg(10,1.5),this.tokensColorTracker=yu.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new yS(this._context.configuration,this._context.theme,this.tokensColorTracker);let[t]=yD.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new yT(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){let e=new yS(this._context.configuration,this._context.theme,this.tokensColorTracker);return!this.options.equals(e)&&(this.options=e,this._recreateLineSampling(),this._actual.onDidChangeOptions(),!0)}onConfigurationChanged(e){return this._onOptionsMaybeChanged()}onCursorStateChanged(e){return this._selections=e.selections,this._minimapSelections=null,this._actual.onSelectionChanged()}onDecorationsChanged(e){return!!e.affectsMinimap&&this._actual.onDecorationsChanged()}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(!this._samplingState)return this._actual.onLinesChanged(e.fromLineNumber,e.count);{let t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return!!t&&this._actual.onLinesChanged(t[0],t[1]-t[0]+1)}}onLinesDeleted(e){if(!this._samplingState)return this._actual.onLinesDeleted(e.fromLineNumber,e.toLineNumber);{let[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}}onLinesInserted(e){return this._samplingState?(this._samplingState.onLinesInserted(e),this._shouldCheckSampling=!0,!0):this._actual.onLinesInserted(e.fromLineNumber,e.toLineNumber)}onScrollChanged(e){return this._actual.onScrollChanged(e)}onThemeChanged(e){return this._actual.onThemeChanged(),this._onOptionsMaybeChanged(),!0}onTokensChanged(e){if(!this._samplingState)return this._actual.onTokensChanged(e.ranges);{let t=[];for(let i of e.ranges){let e=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);e&&t.push({fromLineNumber:e[0],toLineNumber:e[1]})}return!!t.length&&this._actual.onTokensChanged(t)}}onTokensColorsChanged(e){return this._onOptionsMaybeChanged(),this._actual.onTokensColorsChanged()}onZonesChanged(e){return this._actual.onZonesChanged()}prepareRender(e){this._shouldCheckSampling&&(this._shouldCheckSampling=!1,this._recreateLineSampling())}render(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));
39let n={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(n)}_recreateLineSampling(){this._minimapSelections=null;let e=!!this._samplingState,[t,i]=yD.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(let e of i)switch(e.type){case"deleted":this._actual.onLinesDeleted(e.deleteFromLineNumber,e.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(e.insertFromLineNumber,e.insertToLineNumber);break;case"flush":this._actual.onFlushed()}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){let n=[];for(let s=0,r=t-e+1;s<r;s++)i[s]?n[s]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+s-1]):n[s]=null;return n}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(null===this._minimapSelections){if(this._samplingState)for(let e of(this._minimapSelections=[],this._selections)){let[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new s8(t,e.startColumn,i,e.endColumn))}else this._minimapSelections=this._selections}return this._minimapSelections}getMinimapDecorationsInViewport(e,t){return this._getMinimapDecorationsInViewport(e,t).filter(e=>!e.options.minimap?.sectionHeaderStyle)}getSectionHeaderDecorationsInViewport(e,t){let i=this.options.sectionHeaderFontSize/this.options.minimapLineHeight;return e=Math.floor(Math.max(1,e-i)),this._getMinimapDecorationsInViewport(e,t).filter(e=>!!e.options.minimap?.sectionHeaderStyle)}_getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){let n=this._samplingState.minimapLines[e-1],s=this._samplingState.minimapLines[t-1];i=new s9(n,1,s,this._context.viewModel.getLineMaxColumn(s))}else i=new s9(e,1,t,this._context.viewModel.getLineMaxColumn(t));let n=this._context.viewModel.getMinimapDecorationsInRange(i);if(this._samplingState){let e=[];for(let t of n){if(!t.options.minimap)continue;let i=t.range,n=this._samplingState.modelLineToMinimapLine(i.startLineNumber),s=this._samplingState.modelLineToMinimapLine(i.endLineNumber);e.push(new yw(new s9(n,i.startColumn,s,i.endColumn),t.options))}return e}return n}getSectionHeaderText(e,t){let i=e.options.minimap?.sectionHeaderText;if(!i)return null;let n=this._sectionHeaderCache.get(i);if(n)return n;let s=t(i);return this._sectionHeaderCache.set(i,s),s}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new s9(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class yT extends ro.JT{constructor(e,t){super(),this._renderDecorations=!1,this._gestureInProgress=!1,this._isMouseOverMinimap=!1,this._theme=e,this._model=t,this._lastRenderData=null,this._buffers=null,this._selectionColor=this._theme.getColor(pF),this._domNode=l2(document.createElement("div")),vf.write(this._domNode,9),this._domNode.setClassName(this._getMinimapDomNodeClassName()),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._shadow=l2(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNo
39de.appendChild(this._shadow),this._canvas=l2(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=l2(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=l2(document.createElement("div")),this._slider.setPosition("absolute"),this._slider.setClassName("minimap-slider"),this._slider.setLayerHinting(!0),this._slider.setContain("strict"),this._domNode.appendChild(this._slider),this._sliderHorizontal=l2(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._hideDelayedScheduler=this._register(new oK(()=>this._hideImmediatelyIfMouseIsOutside(),500)),this._register(a7(this._domNo
39de.domNode,ly.MOUSE_OVER,()=>{this._isMouseOverMinimap=!0})),this._register(a7(this._domNode.domNode,ly.MOUSE_LEAVE,()=>{this._isMouseOverMinimap=!1})),this._pointerDownListener=a7(this._domNode.domNode,ly.POINTER_DOWN,e=>{e.preventDefault();let t="mouse"===e.pointerType,i=0===e.button;if(0!==this._model.options.renderMinimap&&this._lastRenderData){if("proportional"!==this._model.options.size){if(i&&this._lastRenderData){let t=ls(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}return}if(i||!t){let t=this._model.options.minimapLineHeight,i=Math.floor(this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;i=Math.min(i,this._model.getLineCount()),this._model.revealLineNumber(i)}}}),this._sliderPointerMoveMonitor=new mk,this._sliderPointerDownListener=a7(this._slider.domNode,ly.POINTER_DOWN,e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=vG.addTarget(this._domNode.domNode),this._sliderTouchStartListener=a6(this._domNo
39de.domNode,i6.Start,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))},{passive:!1}),this._sliderTouchMoveListener=a6(this._domNode.domNode,i6.Change,e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)},{passive:!1}),this._sliderTouchEndListener=a7(this._domNode.domNode,i6.End,e=>{e.preventDefault(),e.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_hideSoon(){this._hideDelayedScheduler.cancel(),this._hideDelayedScheduler.schedule()}_hideImmediatelyIfMouseIsOutside(){if(this._isMouseOverMinimap){this._hideSoon();return}this._domNode.toggleClassName("active",!1)}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;let n=e.pageX;this._slider.toggleClassName("active",!0);let s=(e,s)=>{let r=ls(this._domNode.domNode),o=Math.min(Math.abs(s-n),Math.abs(s-r.left),Math.abs(s-r.left-r.width));if(sS.ED&&o>140){this._model.setScrollTop(i.scrollTop);return}this._model.setScrollTop(i.getDesiredScrollTopFromDelta(e-t))};e.pageY!==t&&s(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>s(e.pageY,e.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){let t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){let e=["minimap"];return"always"===this._model.options.showSlider?e.push("slider-always"):e.push("slider-mouseover"),"mouseover"===this._model.options.autohide?e.push("minimap-autohide-mouseover"):"scroll"===this._model.options.autohide&&e.push("minimap-autohide-scroll"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return!this._buffers&&this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new yN(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return!!this._lastRenderData&&this._lastRenderData.onLinesChanged(e,t)}onLinesDeleted(e,t){return this._lastRenderData?.onLinesDeleted(e,t),!0}onLinesInserted(e,t){return this._lastRenderData?.onLinesInserted(e,t),!0}onScrollChanged(e){return"scroll"===this._model.options.autohide&&(e.scrollTopChanged||e.scrollHeightChanged)&&(this._domNode.toggleClassName("active",!0),this._hideSoon()),this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(pF),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");let t=yL.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHe
39ight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;let t=this._model.getSelections();t.sort(s9.compareRangesUsingStarts);let i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0));let{canvasInnerWidth:n,canvasInnerHeight:s}=this._model.options,r=this._model.options.minimapLineHeight,o=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,s);let h=new yI(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,h,e,r),this._renderDecorationsLineHighlights(l,i,h,e,r);let d=new yI(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,d,e,r,a,o,n),this._renderDecorationsHighlights(l,i,d,e,r,a,o,n),this._renderSectionHeaders(e)}}_renderSelectionLineHighlights(e,t,i,n,s){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,o=0;for(let a of t){let t=n.intersectWithViewport(a);if(!t)continue;let[l,h]=t;for(let e=l;e<=h;e++)i.set(e,!0);let d=n.getYForLineNumber(l,s),u=n.getYForLineNumber(h,s);o>=d||(o>r&&e.fillRect(sh.y0,r,e.canvas.width,o-r),r=d),o=u}o>r&&e.fillRect(sh.y0,r,e.canvas.width,o-r)}_renderDecorationsLineHighlights(e,t,i,n,s){let r=new Map;for(let o=t.length-1;o>=0;o--){let a=t[o],l=a.options.minimap;if(!l||1!==l.position)continue;let h=n.intersectWithViewport(a.range);if(!h)continue;let[d,u]=h,c=l.getColor(this._theme.value);if(!c||c.isTransparent())continue;let g=r.get(c.toString());g||(g=c.transparent(.5).toString(),r.set(c.toString(),g)),e.fillStyle=g;for(let t=d;t<=u;t++){if(i.has(t))continue;i.set(t,!0);let r=n.getYForLineNumber(d,s);e.fillRect(sh.y0,r,e.canvas.width,s)}}}_renderSelectionsHighlights(e,t,i,n,s,r,o,a){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(let l of t){let t=n.intersectWithViewport(l);if(!t)continue;let[h,d]=t;for(let t=h;t<=d;t++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,t,s,s,r,o,a)}}_renderDecorationsHighlights(e,t,i,n,s,r,o,a){for(let l of t){let t=l.options.minimap;if(!t)continue;let h=n.intersectWithViewport(l.range);if(!h)continue;let[d,u]=h,c=t.getColor(this._theme.value);if(!(!c||c.isTransparent()))for(let h=d;h<=u;h++)switch(t.position){case 1:this.renderDecorationOnLine(e,i,l.range,c,n,h,s,s,r,o,a);continue;case 2:{let t=n.getYForLineNumber(h,s);this.renderDecoration(e,c,2,t,2,s);continue}}}}renderDecorationOnLine(e,t,i,n,s,r,o,a,l,h,d){let u=s.getYForLineNumber(r,a);if(u+o<0||u>this._model.options.canvasInnerHeight)return;let{startLineNumber:c,endLineNumber:g}=i,f=c===r?i.startColumn:1,m=g===r?i.endColumn:this._model.getLineMaxColumn(r),p=this.getXOffsetForPosition(t,r,f,l,h,d),_=this.getXOffsetForPosition(t,r,m,l,h,d);this.renderDecoration(e,n,p,u,_-p,o)}getXOffsetForPosition(e,t,i,n,s,r){if(1===i)return sh.y0;if((i-1)*s>=r)return r;let o=e.get(t);if(!o){let i=this._model.getLineContent(t);o=[sh.y0];let a=sh.y0;for(let e=1;e<i.length+1;e++){let t=i.charCodeAt(e-1),l=a+(9===t?n*s:r6(t)?2*s:s);if(l>=r){o[e]=r;break}o[e]=l,a=l}e.set(t,o)}return i-1<o.length?o[i-1]:r}renderDecoration(e,t,i,n,s,r){e.fillStyle=t&&t.toString()||"",e.fillRect(i,n,s,r)}_renderSectionHeaders(e){let t=this._model.options.minimapLineHeight,i=this._model.options.sectionHeaderFontSize,n=this._model.options.sectionHeaderLetterSpacing,s=1.5*i,{canvasInnerWidth:r}=this._model.options,o=this._model.options.backgroundColor,a=`rgb(${o.r} ${o.g} ${o.b} / .7)`,l=this._model.options.sectionHeaderFontColor,h=`rgb(${l.r} ${l.g} ${l.b})`,d=this._decorationsCanvas.domNode.getContext("2d");d.letterSpacing=n+"px",d.font="500 "+i+"px "+this._model.options.sectionHeaderFontFamily,d.strokeStyle=h,d.lineWidth=.4;let u=this._model.getSectionHeaderDecorationsInViewport(e.startLineNumber,e.endLineNumber);u.sort((e,t)=>
39e.range.startLineNumber-t.range.startLineNumber);let c=yT._fitSectionHeader.bind(null,d,r-sh.y0);for(let n of u){let o=e.getYForLineNumber(n.range.startLineNumber,t)+i,l=o-i,u=l+2,g=this._model.getSectionHeaderText(n,c);yT._renderSectionLabel(d,g,n.options.minimap?.sectionHeaderStyle===2,a,h,r,l,s,o,u)}}static _fitSectionHeader(e,t,i){if(!i)return i;let n=e.measureText(i).width,s=e.measureText("…").width;if(n<=t||n<=s)return i;let r=i.length,o=Math.floor((t-s)/(n/i.length))-1,a=Math.ceil(o/2);for(;a>0&&/\s/.test(i[a-1]);)--a;return i.substring(0,a)+"…"+i.substring(r-(o-a))}static _renderSectionLabel(e,t,i,n,s,r,o,a,l,h){t&&(e.fillStyle=n,e.fillRect(0,o,r,a),e.fillStyle=s,e.fillText(t,sh.y0,l)),i&&(e.beginPath(),e.moveTo(0,h),e.lineTo(r,h),e.closePath(),e.stroke())}renderLines(e){let t=e.startLineNumber,i=e.endLineNumber,n=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){let t=this._lastRenderData._get();return new yk(e,t.imageData,t.lines)}let s=this._getBuffer();if(!s)return null;let[r,o,a]=yT._renderUntouchedLines(s,e.topPaddingLineCount,t,i,n,this._lastRenderData),l=this._model.getMinimapLinesRenderingData(t,i,a),h=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,u=this._model.options.backgroundColor,c=this._model.options.foregroundAlpha,g=this._model.tokensColorTracker,f=g.backgroundIsLight(),m=this._model.options.renderMinimap,p=this._model.options.charRenderer(),_=this._model.options.fontScale,v=this._model.options.minimapCharWidth,b=(1===m?2:3)*_,C=n>b?Math.floor((n-b)/2):0,w=u.a/255,y=new yd(Math.round((u.r-d.r)*w+d.r),Math.round((u.g-d.g)*w+d.g),Math.round((u.b-d.b)*w+d.b),255),S=e.topPaddingLineCount*n,L=[];for(let e=0,r=i-t+1;e<r;e++)a[e]&&yT._renderLine(s,y,u.a,f,m,v,g,c,p,S,C,h,l[e],_,n),L[e]=new yx(S),S+=n;let x=-1===r?0:r,k=-1===o?s.height:o;return this._canvas.domNode.getContext("2d").putImageData(s,0,0,0,x,s.width,k-x),new yk(e,s,L)}static _renderUntouchedLines(e,t,i,n,s,r){let o=[];if(!r){for(let e=0,t=n-i+1;e<t;e++)o[e]=!0;return[-1,-1,o]}let a=r._get(),l=a.imageData.data,h=a.rendLineNumberStart,d=a.lines,u=d.length,c=e.width,g=e.data,f=(n-i+1)*s*c*4,m=-1,p=-1,_=-1,v=-1,b=-1,C=-1,w=t*s;for(let e=i;e<=n;e++){let t=e-i,n=e-h,r=n>=0&&n<u?d[n].dy:-1;if(-1===r){o[t]=!0,w+=s;continue}let a=r*c*4,y=(r+s)*c*4,S=w*c*4,L=(w+s)*c*4;v===a&&C===S?v=y:(-1!==_&&(g.set(l.subarray(_,v),b),-1===m&&0===_&&_===b&&(m=v),-1===p&&v===f&&_===b&&(p=_)),_=a,v=y,b=S),C=L,o[t]=!1,w+=s}return -1!==_&&(g.set(l.subarray(_,v),b),-1===m&&0===_&&_===b&&(m=v),-1===p&&v===f&&_===b&&(p=_)),[-1===m?-1:m/(4*c),-1===p?-1:p/(4*c),o]}static _renderLine(e,t,i,n,s,r,o,a,l,h,d,u,c,g,f){let m=c.content,p=c.tokens,_=e.width-r,v=1===f,b=sh.y0,C=0,w=0;for(let c=0,f=p.getCount();c<f;c++){let f=p.getEndOffset(c),y=p.getForeground(c),S=o.getColor(y);for(;C<f;C++){if(b>_)return;let o=m.charCodeAt(C);if(9===o){let e=u-(C+w)%u;w+=e-1,b+=e*r}else if(32===o)b+=r;else{let u=r6(o)?2:1;for(let c=0;c<u;c++)if(2===s?l.blockRenderChar(e,b,h+d,S,a,t,i,v):l.renderChar(e,b,h+d,o,S,a,t,i,g,n,v),(b+=r)>_)return}}}}}class yI{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let e=0,t=this._endLineNumber-this._startLineNumber+1;e<t;e++)this._values[e]=i}has(e){return this.get(e)!==this._defaultValue}set(e,t){e<this._startLineNumber||e>this._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return e<this._startLineNumber||e>this._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}i(78326);class yM extends vg{constructor(e,t){super(e),this._viewDomNode=t;let i=this._context.configuration.options.get(165);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._viewDomNodeRect={top:0,left:0,width:0,height:0},this._domNode=l2(document.createElement("div")),vf.write(this._domNode,4),this._domNode.setClassName("overlayWidgets"),this.overflowingOverlayWidgetsDomNode=l2(document.createElement("div")),vf.write(this.overflowingOverlayWidgetsDomNode,5),this.overflowingOverlayWidgetsDomNode.setClassName("overflowingOverlayWidgets")}dispose(){super.dispose(),this._widgets={}}
39getDomNode(){return this._domNode}onConfigurationChanged(e){let t=this._context.configuration.options.get(165);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}_widgetCanOverflow(e){let t=this._context.configuration.options.get(4);return(e.allowEditorOverflow||!1)&&t}addWidget(e){let t=l2(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._widgetCanOverflow(e)?this.overflowingOverlayWidgetsDomNode.appendChild(t):this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){let i=this._widgets[e.getId()],n=t?t.preference:null,s=t?.stackOridinal;return i.preference===n&&i.stack===s?(this._updateMaxMinWidth(),!1):(i.preference=n,i.stack=s,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){let t=e.getId();if(this._widgets.hasOwnProperty(t)){let e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.remove(),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){let e=0,t=Object.keys(this._widgets);for(let i=0,n=t.length;i<n;i++){let n=t[i],s=this._widgets[n],r=s.widget.getMinContentWidthInPx?.();void 0!==r&&(e=Math.max(e,r))}this._context.viewLayout.setOverlayWidgetsMinWidth(e)}_renderWidget(e,t){let i=e.domNode;if(null===e.preference){i.setTop("");return}let n=2*this._verticalScrollbarWidth+this._minimapWidth;if(0===e.preference||1===e.preference){if(1===e.preference){let e=i.domNode.clientHeight;i.setTop(this._editorHeight-e-2*this._horizontalScrollbarHeight)}else i.setTop(0);void 0!==e.stack?(i.setTop(t[e.preference]),t[e.preference]+=i.domNode.clientWidth):i.setRight(n)}else if(2===e.preference)i.domNode.style.right="50%",void 0!==e.stack?(i.setTop(t[2]),t[2]+=i.domNode.clientHeight):i.setTop(0);else{let{top:t,left:n}=e.preference;if(this._context.configuration.options.get(51)&&this._widgetCanOverflow(e.widget)){let e=this._viewDomNodeRect;i.setTop(t+e.top),i.setLeft(n+e.left),i.setPosition("fixed")}else i.setTop(t),i.setLeft(n),i.setPosition("absolute")}}prepareRender(e){this._viewDomNodeRect=ls(this._viewDomNode.domNode)}render(e){this._domNode.setWidth(this._editorWidth);let t=Object.keys(this._widgets),i=Array.from({length:3},()=>0);t.sort((e,t)=>(this._widgets[e].stack||0)-(this._widgets[t].stack||0));for(let e=0,n=t.length;e<n;e++){let n=t[e];this._renderWidget(this._widgets[n],i)}}}class yR{constructor(e,t){let i=e.options;this.lineHeight=i.get(75),this.pixelRatio=i.get(163),this.overviewRulerLanes=i.get(95),this.renderBorder=i.get(94);let n=t.getColor(wv);this.borderColor=n?n.toString():null,this.hideCursor=i.get(68);let s=t.getColor(C5);this.cursorColorSingle=s?s.transparent(.7).toString():null;let r=t.getColor(C6);this.cursorColorPrimary=r?r.transparent(.7).toString():null;let o=t.getColor(C3);this.cursorColorSecondary=o?o.transparent(.7).toString():null,this.themeType=t.type;let a=i.get(81),l=a.enabled,h=a.side,d=t.getColor(wb),u=rp.getDefaultBackground();d?this.backgroundColor=d:l&&"right"===h?this.backgroundColor=u:this.backgroundColor=null;let c=i.get(165).overviewRuler;this.top=c.top,this.right=c.right,this.domWidth=c.width,this.domHeight=c.height,0===this.overviewRulerLanes?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);let[g,f]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=g,this.w=f}_initLanes(e,t,i){let n=t-e;if(i>=3){let t=Math.floor(n/3),i=Math.floor(n/3),s=n-t-i,r=e+t;return[[0,e,r,e,e+t+s,e,r,e],[0,t,s,t+s,i,t+s+i,s+i,t+s+i]]}if(2!==i)return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]];{let t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColorSingle===e.curs
39orColorSingle&&this.cursorColorPrimary===e.cursorColorPrimary&&this.cursorColorSecondary===e.cursorColorSecondary&&this.themeType===e.themeType&&gX.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class yA extends vg{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=l2(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=rp.onDidChange(e=>{e.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[{position:new s3(1,1),color:this._settings.cursorColorSingle}]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){let t=new yR(this._context.configuration,this._context.theme);return!(this._settings&&this._settings.equals(t))&&(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++){let n=this._settings.cursorColorSingle;i>1&&(n=0===t?this._settings.cursorColorPrimary:this._settings.cursorColorSecondary),this._cursorPositions.push({position:e.selections[t].getPosition(),color:n})}return this._cursorPositions.sort((e,t)=>s3.compare(e.position,t.position)),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return!!e.affectsOverviewRuler&&this._markRenderingIsMaybeNeeded()}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return!!e.scrollHeightChanged&&this._markRenderingIsNeeded()}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){let e=this._settings.backgroundColor;if(0===this._settings.overviewRulerLanes){this._domNode.setBackgroundColor(e?gX.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}let t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(fq.compareByRenderingProps),1!==this._actualShouldRender||fq.equalsArr(this._renderedDecorations,t)||(this._actualShouldRender=2),1!==this._actualShouldRender||(0,as.fS)(this._renderedCursorPositions,this._cursorPositions,(e,t)=>e.position.lineNumber===t.position.lineNumber&&e.color===t.color)||(this._actualShouldRender=2),1===this._actualShouldRender)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");let i=this._settings.canvasWidth,n=this._settings.canvasHeight,s=this._settings.lineHeight,r=this._context.viewLayout,o=n/this._context.viewLayout.getScrollHeight(),a=6*this._settings.pixelRatio|0,l=a/2|0,h=this._domNo
39de.domNode.getContext("2d");e?(e.isOpaque()||h.clearRect(0,0,i,n),h.fillStyle=gX.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):h.clearRect(0,0,i,n);let d=this._settings.x,u=this._settings.w;for(let e of t){let t=e.color,i=e.data;h.fillStyle=t;let c=0,g=0,f=0;for(let e=0,t=i.length/3;e<t;e++){let t=i[3*e],m=i[3*e+1],p=i[3*e+2],_=r.getVerticalOffsetForLineNumber(m)*o|0,v=(r.getVerticalOffsetForLineNumber(p)+s)*o|0;if(v-_<a){let e=(_+v)/2|0;e<l?e=l:e+l>n&&(e=n-l),_=e-l,v=e+l}_>f+1||t!==c?(0!==e&&h.fillRect(d[c],g,u[c],f-g),c=t,g=_,f=v):v>f&&(f=v)}h.fillRect(d[c],g,u[c],f-g)}if(!this._settings.hideCursor){let e=2*this._settings.pixelRatio|0,t=e/2|0,i=this._settings.x[7],s=this._settings.w[7],a=-100,l=-100,d=null;for(let u=0,c=this._cursorPositions.length;u<c;u++){let c=this._cursorPositions[u].color;if(!c)continue;let g=this._cursorPositions[u].position,f=r.getVerticalOffsetForLineNumber(g.lineNumber)*o|0;f<t?f=t:f+t>n&&(f=n-t);let m=f-t,p=m+e;m>l+1||c!==d?(0!==u&&d&&h.fillRect(i,a,s,l-a),a=m,l=p):p>l&&(l=p),d=c,h.fillStyle=c}d&&h.fillRect(i,a,s,l-a)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(h.beginPath(),h.lineWidth=1,h.strokeStyle=this._settings.borderColor,h.moveTo(0,0),h.lineTo(0,n),h.moveTo(1,0),h.lineTo(i,0),h.stroke())}}class yO{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class yP{constructor(e,t,i,n){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=n,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.color<t.color?-1:1}setColorZone(e){this._colorZone=e}getColorZones(){return this._colorZone}}class yF{constructor(e){this._getVerticalOffsetForLine=e,this._zones=[],this._colorZonesInvalid=!1,this._lineHeight=0,this._domWidth=0,this._domHeight=0,this._outerHeight=0,this._pixelRatio=1,this._lastAssignedId=0,this._color2Id=Object.create(null),this._id2Color=[]}getId2Color(){return this._id2Color}setZones(e){this._zones=e,this._zones.sort(yP.compare)}setLineHeight(e){return this._lineHeight!==e&&(this._lineHeight=e,this._colorZonesInvalid=!0,!0)}setPixelRatio(e){this._pixelRatio=e,this._colorZonesInvalid=!0}getDOMWidth(){return this._domWidth}getCanvasWidth(){return this._domWidth*this._pixelRatio}setDOMWidth(e){return this._domWidth!==e&&(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight!==e&&(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight!==e&&(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){let e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),n=i/Math.floor(this._outerHeight),s=Math.floor(4*this._pixelRatio/2),r=[];for(let o=0,a=this._zones.length;o<a;o++){let a=this._zones[o];if(!e){let e=a.getColorZones();if(e){r.push(e);continue}}let l=this._getVerticalOffsetForLine(a.startLineNumber),h=0===a.heightInLines?this._getVerticalOffsetForLine(a.endLineNumber)+t:l+a.heightInLines*t,d=Math.floor(n*l),u=Math.floor(n*h),c=Math.floor((d+u)/2),g=u-c;g<s&&(g=s),c-g<0&&(c=g),c+g>i&&(c=i-g);let f=a.color,m=this._color2Id[f];m||(m=++this._lastAssignedId,this._color2Id[f]=m,this._id2Color[m]=f);let p=new yO(c-g,c+g,m);a.setColorZone(p),r.push(p)}return this._colorZonesInvalid=!1,r.sort(yO.compare),r}}class yB extends vc{constructor(e,t){super(),this._context=e;let i=this._context.configuration.options;this._domNode=l2(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new yF(e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(75)),this._zoneManager.setPixelRatio(i.get(163)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return e.hasChanged(75)&&(this._zoneManager.setLineHeight(t.get(75)),this._render()),e.hasChanged(163)&&(this._zoneManager.setPixelRatio(t.get(163)),this._domNo
39de.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,(t=this._zoneManager.setDOMHeight(e.height)||t)&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(0===this._zoneManager.getOuterHeight())return!1;let e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),s=this._domNo
39de.domNode.getContext("2d");return s.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(s,i,n,e),!0}_renderOneLane(e,t,i,n){let s=0,r=0,o=0;for(let a of t){let t=a.colorId,l=a.from,h=a.to;t!==s?(e.fillRect(0,r,n,o-r),s=t,e.fillStyle=i[s],r=l,o=h):o>=l?o=Math.max(o,h):(e.fillRect(0,r,n,o-r),r=l,o=h)}e.fillRect(0,r,n,o-r)}}i(40500);class yV extends vg{constructor(e){super(e),this.domNode=l2(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];let t=this._context.configuration.options;this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._rulers=t.get(116),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){let e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e<t){let{tabSize:i}=this._context.viewModel.model.getOptions(),n=t-e;for(;n>0;){let e=l2(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(i),this.domNode.appendChild(e),this._renderedRulers.push(e),n--}return}let i=e-t;for(;i>0;){let e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){let i=this._renderedRulers[t],n=this._rulers[t];i.setBoxShadow(n.color?`1px 0 0 0 ${n.color} inset`:""),i.setHeight(Math.min(e.scrollHeight,1e6)),i.setLeft(n.column*this._typicalHalfwidthCharacterWidth)}}}i(81174);class yW extends vg{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;let t=this._context.configuration.options.get(117);this._useShadows=t.useShadows,this._domNode=l2(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true")}dispose(){super.dispose()}_updateShouldShow(){let e=this._useShadows&&this._scrollTop>0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){let e=this._context.configuration.options.get(165);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){let t=this._context.configuration.options.get(117);return this._useShadows=t.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}i(38342);class yH{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class yz{constructor(e,t){this.lineNumber=e,this.ranges=t}}function yU(e){return new yH(e)}function yK(e){return new yz(e.lineNumber,e.ranges.map(yU))}class y$ extends Cq{static{this.SELECTION_CLASS_NAME="selected-text"}static{this.SELECTION_TOP_LEFT="top-left-radius"}static{this.SELECTION_BOTTOM_LEFT="bottom-left-radius"}static{this.SELECTION_TOP_RIGHT="top-right-radius"}static{this.SELECTION_BOTTOM_RIGHT="bottom-right-radius"}static{this.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background"}static{this.ROUNDED_PIECE_WIDTH=10}constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;let t=this._context.configuration.options;this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=this._context.configuration.options;return this._roundedSelection=t.get(115),this._typicalHalfwidthCharacterWidth=t.get(59).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){let n=this._typicalHalfwidthCharacterWidth/4,s=null,r=null;if(i&&i.length>0&&t.length>0){let n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!s&&e<i.length;e++)i[e].lineNumber===n&&(s=i[e].ranges[0]);let o=t[t.length-1].lineNumber;if(o===e.endLineNumber)for(let e=i.length-1;!r&&e>=0;e--)i[e].lineNumber===o&&(r=i[e].ranges[0]);s&&!s.startStyle&&(s=null),r&&!r.startStyle&&(r=null)}for(let e=0,i=t.length;e<i;e++){let o=t[e].ranges[0],a=o.left,l=o.left+o.width,h={top:0,bottom:0},d={top:0,bottom:0};if(e>0){let i=t[e-1].ranges[0].left,s=t[e-1].ranges[0].left+t[e-1].ranges[0].width;yj(a-i)<n?h.top=2:a>i&&(h.top=1),yj(l-s)<n?d.top=2:i<l&&l<s&&(d.top=1)}else s&&(h.top=s.startStyle.top,d.top=s.endStyle.top);if(e+1<i){let i=t[e+1].ranges[0].left,s=t[e+1].ranges[0].left+t[e+1].ranges[0].width;yj(a-i)<n?h.bottom=2:i<a&&a<s&&(h.bottom=1),yj(l-s)<n?d.bottom=2:l<s&&(
39d.bottom=1)}else r&&(h.bottom=r.startStyle.bottom,d.bottom=r.endStyle.bottom);o.startStyle=h,o.endStyle=d}}_getVisibleRangesWithStyle(e,t,i){let n=(t.linesVisibleRangesForRange(e,!0)||[]).map(yK);return!this._visibleRangesHaveGaps(n)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,n,i),n}_createSelectionPiece(e,t,i,n,s){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;bottom:"+t.toString()+"px;left:"+n.toString()+"px;width:"+s.toString()+'px;"></div>'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;let s=!!n[0].ranges[0].startStyle,r=n[0].lineNumber,o=n[n.length-1].lineNumber;for(let a=0,l=n.length;a<l;a++){let l=n[a],h=l.lineNumber,d=h-t,u=i&&h===r?1:0,c=i&&h!==r&&h===o?1:0,g="",f="";for(let e=0,t=l.ranges.length;e<t;e++){let t=l.ranges[e];if(s){let e=t.startStyle,i=t.endStyle;if(1===e.top||1===e.bottom){g+=this._createSelectionPiece(u,c,y$.SELECTION_CLASS_NAME,t.left-y$.ROUNDED_PIECE_WIDTH,y$.ROUNDED_PIECE_WIDTH);let i=y$.EDITOR_BACKGROUND_CLASS_NAME;1===e.top&&(i+=" "+y$.SELECTION_TOP_RIGHT),1===e.bottom&&(i+=" "+y$.SELECTION_BOTTOM_RIGHT),g+=this._createSelectionPiece(u,c,i,t.left-y$.ROUNDED_PIECE_WIDTH,y$.ROUNDED_PIECE_WIDTH)}if(1===i.top||1===i.bottom){g+=this._createSelectionPiece(u,c,y$.SELECTION_CLASS_NAME,t.left+t.width,y$.ROUNDED_PIECE_WIDTH);let e=y$.EDITOR_BACKGROUND_CLASS_NAME;1===i.top&&(e+=" "+y$.SELECTION_TOP_LEFT),1===i.bottom&&(e+=" "+y$.SELECTION_BOTTOM_LEFT),g+=this._createSelectionPiece(u,c,e,t.left+t.width,y$.ROUNDED_PIECE_WIDTH)}}let i=y$.SELECTION_CLASS_NAME;if(s){let e=t.startStyle,n=t.endStyle;0===e.top&&(i+=" "+y$.SELECTION_TOP_LEFT),0===e.bottom&&(i+=" "+y$.SELECTION_BOTTOM_LEFT),0===n.top&&(i+=" "+y$.SELECTION_TOP_RIGHT),0===n.bottom&&(i+=" "+y$.SELECTION_BOTTOM_RIGHT)}f+=this._createSelectionPiece(u,c,i,t.left,t.width)}e[d][0]+=g,e[d][1]+=f}}prepareRender(e){let t=[],i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber;for(let e=i;e<=n;e++)t[e-i]=["",""];let s=[];for(let n=0,r=this._selections.length;n<r;n++){let r=this._selections[n];if(r.isEmpty()){s[n]=null;continue}let o=this._getVisibleRangesWithStyle(r,e,this._previousFrameVisibleRangesWithStyle[n]);s[n]=o,this._actualRenderOneSelection(t,i,this._selections.length>1,o)}this._previousFrameVisibleRangesWithStyle=s,this._renderResult=t.map(([e,t])=>e+t)}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function yj(e){return e<0?-e:e}CX((e,t)=>{let i=e.getColor(pn);i&&!i.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${i}; }`)}),i(23068);class yq{constructor(e,t,i,n,s,r,o){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=s,this.textContent=r,this.textContentClassName=o}}(e6=nr||(nr={}))[e6.Single=0]="Single",e6[e6.MultiPrimary=1]="MultiPrimary",e6[e6.MultiSecondary=2]="MultiSecondary";class yG{constructor(e,t){this._context=e;let i=this._context.configuration.options,n=i.get(59);this._cursorStyle=i.get(161),this._typicalHalfwidthCharacterWidth=n.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(i.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=i.get(38),this._isVisible=!0,this._domNode=l2(document.createElement("div")),this._domNode.setClassName(`cursor ${ye}`),this._domNode.setHeight(this._context.viewLayout.getLineHeightForLineNumber(1)),this._domNode.setTop(0),this._domNode.setLeft(0),l5(this._domNo
39de,n),this._domNode.setDisplay("none"),this._position=new s3(1,1),this._pluralityClass="",this.setPlurality(t),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}setPlurality(e){switch(e){default:case nr.Single:this._pluralityClass="";break;case nr.MultiPrimary:this._pluralityClass="cursor-primary";break;case nr.MultiSecondary:this._pluralityClass="cursor-secondary"}}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(59);return this._cursorStyle=t.get(161),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(37),this._typicalHalfwidthCharacterWidth),this._lineCursorHeight=t.get(38),l5(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){let{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,s]=function(e,t){t>0&&rG(e.charCodeAt(t))&&t--;let i=t+rX(e,t);return[i-r1(e,i),i]}(i,t-1);return[new s3(e,n+1),i.substring(n,s)]}_prepareRender(e){let t="",i="",[n,s]=this._getGraphemeAwarePosition(),r=this._context.viewLayout.getLineHeightForLineNumber(n.lineNumber),o=0===this._lineCursorHeight?r:Math.min(r,this._lineCursorHeight),a=(r-o)/2;if(this._cursorStyle===sh.d2.Line||this._cursorStyle===sh.d2.LineThin){let r;let l=e.visibleRangeForPosition(n);if(!l||l.outsideRenderedLine)return null;let h=aG(this._domNode.domNode);this._cursorStyle===sh.d2.Line?(r=lA(h,this._lineCursorWidth>0?this._lineCursorWidth:2))>2&&(t=s,i=this._getTokenClassName(n)):r=lA(h,1);let d=l.left,u=0;return r>=2&&d>=1&&(d-=u=1),new yq(e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta+a,d,u,r,o,t,i)}let l=e.linesVisibleRangesForRange(new s9(n.lineNumber,n.column,n.lineNumber,n.column+s.length),!1);if(!l||0===l.length)return null;let h=l[0];if(h.outsideRenderedLine||0===h.ranges.length)return null;let d=h.ranges[0],u="	"===s?this._typicalHalfwidthCharacterWidth:d.width<1?this._typicalHalfwidthCharacterWidth:d.width;this._cursorStyle===sh.d2.Block&&(t=s,i=this._getTokenClassName(n));let c=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,g=r;return(this._cursorStyle===sh.d2.Underline||this._cursorStyle===sh.d2.UnderlineThin)&&(c+=r-2,g=2),new yq(c,d.left,0,u,g,t,i)}_getTokenClassName(e){let t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${this._pluralityClass} ${ye} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}
39):(this._domNode.setDisplay("none"),null)}}class yQ extends vg{static{this.BLINK_INTERVAL=500}constructor(e){super(e);let t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new yG(this._context,nr.Single),this._secondaryCursors=[],this._renderData=[],this._domNode=l2(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new oz,this._cursorFlatBlinkInterval=new a9,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){let t=this._context.configuration.options;this._readOnly=t.get(104),this._cursorBlinking=t.get(32),this._cursorStyle=t.get(161),this._cursorSmoothCaretAnimation=t.get(33),this._editContextEnabled=t.get(170),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,i){let n=this._secondaryCursors.length!==t.length||"explicit"===this._cursorSmoothCaretAnimation&&3!==i;if(this._primaryCursor.setPlurality(t.length?nr.MultiPrimary:nr.Single),this._primaryCursor.onCursorPositionChanged(e,n),this._updateBlinking(),this._secondaryCursors.length<t.length){let e=t.length-this._secondaryCursors.length;for(let t=0;t<e;t++){let e=new yG(this._context,nr.MultiSecondary);this._domNode.domNode.insertBefore(e.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(e)}}else if(this._secondaryCursors.length>t.length){let e=this._secondaryCursors.length-t.length;for(let t=0;t<e;t++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let e=0;e<t.length;e++)this._secondaryCursors[e].onCursorPositionChanged(t[e],n)}onCursorStateChanged(e){let t=[];for(let i=0,n=e.selections.length;i<n;i++)t[i]=e.selections[i].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);let i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,this._updateDomClassName()),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onFocusChanged(e){return this._editorHasFocus=e.isFocused,this._updateBlinking(),!1}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return!0}onTokensChanged(e){let t=t=>{for(let i=0,n=e.ranges.length;i<n;i++)if(e.ranges[i].fromLineNumber<=t.lineNumber&&t.lineNumber<=e.ranges[i].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(let e of this._secondaryCursors)if(t(e.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return(!this._isComposingInput||this._editContextEnabled)&&this._editorHasFocus?this._readOnly?5:this._cursorBlinking:0}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();let e=this._getCursorBlinking(),t=0===e;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),t||5===e||(1===e?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},yQ.BLINK_INTERVAL,aG(this._domNode.domNode)):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},yQ.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case sh.d2.Line:e+=" cursor-line-style";break;case sh.d2.Block:e+=" cursor-block-style";break;case sh.d2.Underline:e+=" cursor-underline-style";break;case sh.d2.LineThin:e+=" cursor-line-thin-style";break;case sh.d2.BlockOutline:e+=" cursor-block-outline-style";break;case sh.d2.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return("on"===this._cursorSmoothCaretAnimation||"explicit"===this._cursorSmoothCaretAnimation)&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].show();this._isVisible=!0}_hide(){this._primaryCursor.hide();for(let e=0,t=this._secondaryCursors.length;e<t;e++)this._secondaryCursors[e].hide();this._isVisible=!1}prepareRender(e){this._primaryCursor.prepareRender(e);for(let t=0,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){let t=[],i=0,n=this._primaryCursor.render(e);n&&(t[i++]=n);for(let n=0,s=this._secondaryCursors.length;n<s;n++){let s=this._secondaryCursors[n].render(e);s&&(t[i++]=s)}this._renderData=t}getLastRenderData(){return this._renderData}}CX((e,t)=>{for(let i of[{class:".cursor",foreground:C5,background:C4},{class:".cursor-primary",foreground:C6,background:C7},{class:".cursor-secondary",foreground:C3,background:C9}]){let n=e.getColor(i.foreground);if(n){let s=e.getColor(i.background);s||(s=n.opposite()),t.addRule(`.monaco-editor .cursors-layer ${i.class} { background-color: ${n}; border-color: ${n}; color: ${s}; }`),vS(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection ${i.class} { border-left: 1px solid ${s}; border-right: 1px solid ${s}; }`)}}});let yY=()=>{throw Error("Invalid change accessor")};class yJ extends vg{constructor(e){super(e);let t=this._context.configuration.options,i=t.get(165);this._lineHeight=t.get(75),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=l2(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=l2(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}
39_recomputeWhitespacesProps(){let e=this._context.viewLayout.getWhitespaces(),t=new Map;for(let i of e)t.set(i.id,i);let i=!1;return this._context.viewModel.changeWhitespace(e=>{let n=Object.keys(this._zones);for(let s=0,r=n.length;s<r;s++){let r=n[s],o=this._zones[r],a=this._computeWhitespaceProps(o.delegate);o.isInHiddenArea=a.isInHiddenArea;let l=t.get(r);l&&(l.afterLineNumber!==a.afterViewLineNumber||l.height!==a.heightInPx)&&(e.changeOneWhitespace(r,a.afterViewLineNumber,a.heightInPx),this._safeCallOnComputedHeight(o.delegate,a.heightInPx),i=!0)}}),i}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(165);return this._lineHeight=t.get(75),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(75)&&this._recomputeWhitespacesProps(),!0}onLineMappingChanged(e){return this._recomputeWhitespacesProps()}onLinesDeleted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}onLinesInserted(e){return!0}_getZoneOrdinal(e){return e.ordinal??e.afterColumn??1e4}_computeWhitespaceProps(e){let t,i;if(0===e.afterLineNumber)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};if(void 0!==e.afterColumn)t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{let i=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new s3(i,this._context.viewModel.model.getLineMaxColumn(i))}i=t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});let n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),s=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!s,afterViewLineNumber:n.lineNumber,heightInPx:s?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(i=>{let n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};(function(e,t){try{e(t)}catch(e){(0,o_.dL)(e);return}})(e,n),n.addZone=yY,n.removeZone=yY,n.layoutZone=yY}),t}_addZone(e,t){let i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:l2(t.domNode),marginDomNode:t.marginDomNode?l2(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){let i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.remove(),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.remove()),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){let i=this._zones[t],n=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=n.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,n.afterViewLineNumber,n.heightInPx),this._safeCallOnComputedHeight(i.delegate,n.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return!!this._zones.hasOwnProperty(e)&&!!this._zones[e].delegate.suppressMouseDown}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(e){(0,o_.dL)(e)}}
39_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(e){(0,o_.dL)(e)}}prepareRender(e){}render(e){let t=e.viewportData.whitespaceViewportData,i={},n=!1;for(let e of t)this._zones[e.id].isInHiddenArea||(i[e.id]=e,n=!0);let s=Object.keys(this._zones);for(let t=0,n=s.length;t<n;t++){let n=s[t],r=this._zones[n],o=0,a=0,l="none";i.hasOwnProperty(n)?(o=i[n].verticalOffset-e.bigNumbersDelta,a=i[n].height,l="block",r.isVisible||(r.domNode.setAttribute("monaco-visible-view-zone","true"),r.isVisible=!0),this._safeCallOnDomNodeTop(r.delegate,e.getScrolledTopFromAbsoluteTop(i[n].verticalOffset))):(r.isVisible&&(r.domNode.removeAttribute("monaco-visible-view-zone"),r.isVisible=!1),this._safeCallOnDomNodeTop(r.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),r.domNode.setTop(o),r.domNode.setHeight(a),r.domNode.setDisplay(l),r.marginDomNode&&(r.marginDomNode.setTop(o),r.marginDomNode.setHeight(a),r.marginDomNode.setDisplay(l))}n&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}i(25296);class yZ extends Cq{constructor(e){super(),this._context=e,this._options=new yX(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){let t=new yX(this._context.configuration);return this._options.equals(t)?e.hasChanged(165):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,"selection"===this._options.renderWhitespace}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}prepareRender(e){if("none"===this._options.renderWhitespace){this._renderResult=null;return}let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber-t+1,n=Array(i);for(let e=0;e<i;e++)n[e]=!0;this._renderResult=[];for(let t=e.viewportData.startLineNumber;t<=e.viewportData.endLineNumber;t++){let i=t-e.viewportData.startLineNumber,n=this._context.viewModel.getViewLineRenderingData(t),s=null;if("selection"===this._options.renderWhitespace)for(let e of this._selection){if(e.endLineNumber<t||e.startLineNumber>t)continue;let i=e.startLineNumber===t?e.startColumn:n.minColumn,r=e.endLineNumber===t?e.endColumn:n.maxColumn;i<r&&(s||(s=[]),s.push(new cQ(i-1,r-1)))}this._renderResult[i]=this._applyRenderWhitespace(e,t,s,n)}}_applyRenderWhitespace(e,t,i,n){let s;if(n.hasVariableFonts||"selection"===this._options.renderWhitespace&&!i||"trailing"===this._options.renderWhitespace&&n.continuesWithWrappedLine)return"";let r=this._context.theme.getColor(C8),o=this._options.renderWithSVG,a=n.content,l=-1===this._options.stopRenderingLineAfter?a.length:Math.min(this._options.stopRenderingLineAfter,a.length),h=n.continuesWithWrappedLine,d=n.minColumn-1,u="boundary"===this._options.renderWhitespace,c="trailing"===this._options.renderWhitespace,g=e.getLineHeightForLineNumber(t),f=this._options.middotWidth,m=this._options.wsmiddotWidth,p=this._options.spaceWidth,_=Math.abs(m-p)<Math.abs(f-p)?11825:183,v=this._options.canUseHalfwidthRightwardsArrow,b="",C=!1,w=rM(a);-1===w?(C=!0,w=l,s=l):s=rA(a);let y=0,S=i&&i[y],L=0;for(let n=d;n<l;
39n++){let r=a.charCodeAt(n);if(S&&S.endExclusive<=n&&(y++,S=i&&i[y]),9!==r&&32!==r||c&&!C&&n<=s)continue;if(u&&n>=w&&n<=s&&32===r){let e=n-1>=0?a.charCodeAt(n-1):0,t=n+1<l?a.charCodeAt(n+1):0;if(32!==e&&32!==t)continue}if(u&&h&&n===l-1){let e=n-1>=0?a.charCodeAt(n-1):0;if(32===r&&32!==e&&9!==e)continue}if(i&&!(S&&S.start<=n&&n<S.endExclusive))continue;let d=e.visibleRangeForPosition(new s3(t,n+1));d&&(o?(L=Math.max(L,d.left),9===r?b+=this._renderArrow(g,p,d.left):b+=`<circle cx="${(d.left+p/2).toFixed(2)}" cy="${(g/2).toFixed(2)}" r="${(p/7).toFixed(2)}" />`):9===r?b+=`<div class="mwh" style="left:${d.left}px;height:${g}px;">${v?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:b+=`<div class="mwh" style="left:${d.left}px;height:${g}px;">${String.fromCharCode(_)}</div>`)}return o?(L=Math.round(L+p),`<svg style="bottom:0;position:absolute;width:${L}px;height:${g}px" viewBox="0 0 ${L} ${g}" xmlns="http://www.w3.org/2000/svg" fill="${r}">`+b+"</svg>"):b}_renderArrow(e,t,i){let n=e/2,s={x:0,y:t/7/2},r={x:.8*t,y:s.y},o={x:r.x-.2*r.x,y:r.y+.2*r.x},a={x:o.x+.1*r.x,y:o.y+.1*r.x},l={x:a.x+.35*r.x,y:a.y-.35*r.x},h={x:l.x,y:-l.y},d={x:a.x,y:-a.y},u={x:o.x,y:-o.y},c={x:r.x,y:-r.y},g={x:s.x,y:-s.y},f=[s,r,o,a,l,h,d,u,c,g].map(e=>`${(i+e.x).toFixed(2)} ${(n+e.y).toFixed(2)}`).join(" L ");return`<path d="M ${f}" />`}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class yX{constructor(e){let t=e.options,i=t.get(59),n=t.get(47);"off"===n?(this.renderWhitespace="none",this.renderWithSVG=!1):"svg"===n?(this.renderWhitespace=t.get(113),this.renderWithSVG=!0):(this.renderWhitespace=t.get(113),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(75),this.stopRenderingLineAfter=t.get(133)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}class y1{constructor(e,t,i,n){this.selections=e,this.startLineNumber=0|t.startLineNumber,this.endLineNumber=0|t.endLineNumber,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=0|t.bigNumbersDelta,this.lineHeight=0|t.lineHeight,this.whitespaceViewportData=i,this._model=n,this.visibleRange=new s9(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class y0{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class y2{constructor(e,t,i){this.configuration=e,this.theme=new y0(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}let y5=new Float32Array([1,0,1,1,0,1,0,0,0,1,1,0]);function y4(e){if(!e)throw Error(`Value "${e}" cannot be null`);return e}function y6(e,t,i){let n=new t.ResizeObserver(t=>{let s=t.find(t=>t.target===e);if(!s)return;if(!("devicePixelContentBoxSize"in s)){n?.disconnect(),n=void 0;return}let r=s.devicePixelContentBoxSize[0].inlineSize,o=s.devicePixelContentBoxSize[0].blockSize;r>0&&o>0&&i(r,o)});try{n.observe(e,{box:["device-pixel-content-box"]})}catch{throw n.disconnect(),n=void 0,new o_.he("Could not observe device pixel dimensions")}return(0,ro.OF)(()=>n?.disconnect())}let y7=0;class y3 extends ro.JT{get cacheKey(){return`${this.fontFamily}_${this.fontSize}px`}constructor(e,t,i,n){super(),this.fontSize=e,this.fontFamily=t,this.devicePixelRatio=i,this._decorationStyleCache=n,this.id=y7++,this._workGlyph={source:null,boundingBox:{left:0,bottom:0,right:0,top:0},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0},this._workGlyphConfig={chars:void 0,tokenMetadata:0,decorationStyleSetId:0},this._antiAliasing=sS.dz?"greyscale":"subpixel";let s=Math.ceil(this.fontSize*i);this._canvas=new OffscreenCanvas(3*s,3*s),this._ctx=y4(this._canvas.getContext("2d",{willReadFrequently:!0,alpha:"greyscale"===this._antiAliasing})),this._ctx.textBaseline="top",this._ctx.fillStyle="#FFFFFF",this._ctx.font=`${s}px ${this.fontFamily}`,this._textMetrics=this._ctx.measureText("A")}rasterizeGlyph(e,t,i,n){return""===e?{source:this._canvas,boundingBox:{top:0,left:0,bottom:-1,right:-1},originOffset:{x:0,y:0},fontBoundingBoxAscent:0,fontBoundingBoxDescent:0}:this._workGlyphConfig.chars===e&&this._workGlyphConfig.tokenMetadata===t&&this._workGlyphConfig.decorationStyleSetId===i?this._workGlyph:(this._workGlyphConfig.chars=e,this._workGlyphConfig.tokenMetadata=t,this._workGlyphConfig.decorationStyleSetId=i,this._rasterizeGlyph(e,t,i,n))}_rasterizeGlyph(e,t,i,n){let s=Math.ceil(this.fontSize*this.devicePixelRatio),r=3*s;this._canvas.width!==r&&(this._canvas.width=r,this._canvas.height=r),this._ctx.save();
39let o=(15&t)/10,a=n[fS.getBackground(t)],l=this._decorationStyleCache.getStyleSet(i);"subpixel"===this._antiAliasing?(this._ctx.fillStyle=a,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height)):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height);let h=new um(200),d=fS.getFontStyle(t);1&d&&h.appendString("italic "),l?.bold!==void 0?l.bold&&h.appendString("bold "):2&d&&h.appendString("bold "),h.appendString(`${s}px ${this.fontFamily}`),this._ctx.font=h.build(),l?.color!==void 0?this._ctx.fillStyle=`#${l.color.toString(16).padStart(8,"0")}`:this._ctx.fillStyle=n[fS.getForeground(t)],this._ctx.textBaseline="top",l?.opacity!==void 0&&(this._ctx.globalAlpha=l.opacity),this._ctx.fillText(e,s+o,s),this._ctx.restore();let u=this._ctx.getImageData(0,0,this._canvas.width,this._canvas.height);if("subpixel"===this._antiAliasing){let e=parseInt(a.substring(1,3),16),t=parseInt(a.substring(3,5),16),i=parseInt(a.substring(5,7),16);this._clearColor(u,e,t,i),this._ctx.putImageData(u,0,0)}return this._findGlyphBoundingBox(u,this._workGlyph.boundingBox),this._workGlyph.source=this._canvas,this._workGlyph.originOffset.x=this._workGlyph.boundingBox.left-s,this._workGlyph.originOffset.y=this._workGlyph.boundingBox.top-s,this._workGlyph.fontBoundingBoxAscent=this._textMetrics.fontBoundingBoxAscent,this._workGlyph.fontBoundingBoxDescent=this._textMetrics.fontBoundingBoxDescent,this._workGlyph}_clearColor(e,t,i,n){for(let s=0;s<e.data.length;s+=4)e.data[s]===t&&e.data[s+1]===i&&e.data[s+2]===n&&(e.data[s+3]=0)}_findGlyphBoundingBox(e,t){let i=this._canvas.height,n=this._canvas.width,s=!1;for(let r=0;r<i;r++){for(let i=0;i<n;i++){let o=r*n*4+4*i+3;if(0!==e.data[o]){t.top=r,s=!0;break}}if(s)break}t.left=0,s=!1;for(let r=0;r<n;r++){for(let o=0;o<i;o++){let i=o*n*4+4*r+3;if(0!==e.data[i]){t.left=r,s=!0;break}}if(s)break}t.right=n,s=!1;for(let r=n-1;r>=t.left;r--){for(let o=0;o<i;o++){let i=o*n*4+4*r+3;if(0!==e.data[i]){t.right=r,s=!0;break}}if(s)break}t.bottom=t.top,s=!1;for(let r=i-1;r>=0;r--){for(let i=0;i<n;i++){let o=r*n*4+4*i+3;if(0!==e.data[o]){t.bottom=r,s=!0;break}}if(s)break}}getTextMetrics(e){return this._ctx.measureText(e)}}!function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);r>3&&o&&Object.defineProperty(t,i,o)}([vq],y3.prototype,"cacheKey",null);let y9=class extends ro.JT{constructor(e){super(),this._logService=e,this._tasks=[],this._i=0,this._register((0,ro.OF)(()=>this.clear()))}enqueue(e){this._tasks.push(e),this._start()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,n=e.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(t=Date.now(),!this._tasks[this._i]()&&this._i++,1.5*(i=Math.max(t=Math.max(1,Date.now()-t),i))>(s=e.timeRemaining())){n-t<-20&&this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=s}this.clear()}};y9=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){dM(e,t,0)}],y9);class y8 extends y9{_requestCallback(e){return lm().setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){lm().clearTimeout(e)}_createDeadline(e){let t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}class Se extends y9{_requestCallback(e){return lm().requestIdleCallback(e)}_cancelCallback(e){lm().cancelIdleCallback(e)}}let St="requestIdleCallback"in lm()?Se:y8;class Si{constructor(e,t){this._canvas=e,this._textureIndex=t,this._currentRow={x:0,y:0,h:0},this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=y4(this._canvas.getContext("2d",{willReadFrequently:!0}))}allocate(e){let t=e.boundingBox.right-e.boundingBox.left+1,i=e.boundingBox.bottom-e.boundingBox.top+1;if(t>this._canvas.width||i>this._canvas.height)throw new o_.he("Glyph is too large for the atlas page");if(e.boundingBox.right-e.boundingBox.left+1>this._canvas.width-this._currentRow.x&&(this._currentRow.x=0,this._currentRow.y+=this._currentRow.h,this._currentRow.h=1),this._currentRow.y+e.boundingBox.bottom-e.boundingBox.top+1>this._canvas.height)return;
39this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,t,i,this._currentRow.x,this._currentRow.y,t,i);let n={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:this._currentRow.x,y:this._currentRow.y,w:t,h:i,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._currentRow.x+=t,this._currentRow.h=Math.max(this._currentRow.h,i),this._allocatedGlyphs.add(n),n}getUsagePreview(){let e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=y4(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);let s=new Map,r=new Map;for(let e of this._allocatedGlyphs)s.set(e.y,Math.max(s.get(e.y)??0,e.h)),r.set(e.y,Math.max(r.get(e.y)??0,e.x+e.w));for(let e of this._allocatedGlyphs)n.fillStyle="#4040FF",n.fillRect(e.x,e.y,e.w,e.h),n.fillStyle="#FF0000",n.fillRect(e.x,e.y+e.h,e.w,s.get(e.y)-e.h);for(let[t,i]of r.entries())t!==this._currentRow.y&&(n.fillStyle="#FF0000",n.fillRect(i,t,e-i,s.get(t)));return i.convertToBlob()}getStats(){let e=this._canvas.width,t=this._canvas.height,i=0,n=0,s=e*t,r=new Map,o=new Map;for(let e of this._allocatedGlyphs)r.set(e.y,Math.max(r.get(e.y)??0,e.h)),o.set(e.y,Math.max(o.get(e.y)??0,e.x+e.w));for(let e of this._allocatedGlyphs)i+=e.w*e.h,n+=e.w*(r.get(e.y)-e.h);for(let[t,i]of o.entries())t!==this._currentRow.y&&(n+=(e-i)*r.get(t));return`page${this._textureIndex}:
40     Total: ${s} (${e}x${t})
41      Used: ${i} (${(i/s*100).toPrecision(2)}%)
42    Wasted: ${n} (${(n/s*100).toPrecision(2)}%)
43Efficiency: ${(i/(i+n)*100).toPrecision(2)}%`}}class Sn{constructor(e,t,i){this._canvas=e,this._textureIndex=t,this._slabs=[],this._activeSlabsByDims=new dp,this._unusedRects=[],this._openRegionsByHeight=new Map,this._openRegionsByWidth=new Map,this._allocatedGlyphs=new Set,this._nextIndex=0,this._ctx=y4(this._canvas.getContext("2d",{willReadFrequently:!0})),this._slabW=Math.min(i?.slabW??64<<Math.max(Math.floor(lm().devicePixelRatio)-1,0),this._canvas.width),this._slabH=Math.min(i?.slabH??this._slabW,this._canvas.height),this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}allocate(e){let t,i;let n=e.boundingBox.right-e.boundingBox.left+1,s=e.boundingBox.bottom-e.boundingBox.top+1;if(n>this._canvas.width||s>this._canvas.height)throw new o_.he("Glyph is too large for the atlas page");if(n>this._slabW||s>this._slabH){if(this._allocatedGlyphs.size>0)return;let e=this._canvas.width;for(;n<e/2&&s<e/2;)e/=2;this._slabW=e,this._slabH=e,this._slabsPerRow=Math.floor(this._canvas.width/this._slabW),this._slabsPerColumn=Math.floor(this._canvas.height/this._slabH)}let r={w:n,h:s},o=this._activeSlabsByDims.get(r.w,r.h);if(o){let e=Math.floor(this._slabW/o.entryW)*Math.floor(this._slabH/o.entryH);o.count>=e&&(o=void 0)}if(!o){if(n<s){let e=this._openRegionsByWidth.get(n);if(e?.length)for(let r=e.length-1;r>=0;r--){let o=e[r];if(o.w>=n&&o.h>=s){t=o.x,i=o.y,n<o.w&&this._unusedRects.push({x:o.x+n,y:o.y,w:o.w-n,h:s}),o.y+=s,o.h-=s,0===o.h&&(r===e.length-1?e.pop():this._unusedRects.splice(r,1));break}}}else{let e=this._openRegionsByHeight.get(s);if(e?.length)for(let r=e.length-1;r>=0;r--){let o=e[r];if(o.w>=n&&o.h>=s){t=o.x,i=o.y,s<o.h&&this._unusedRects.push({x:o.x,y:o.y+s,w:n,h:o.h-s}),o.x+=n,o.w-=n,0===o.h&&(r===e.length-1?e.pop():this._unusedRects.splice(r,1));break}}}}if(void 0===t||void 0===i){if(!o){if(this._slabs.length>=this._slabsPerRow*this._slabsPerColumn)return;o={x:Math.floor(this._slabs.length%this._slabsPerRow)*this._slabW,y:Math.floor(this._slabs.length/this._slabsPerRow)*this._slabH,entryW:r.w,entryH:r.h,count:0};let e=this._slabW%o.entryW,t=this._slabH%o.entryH;e&&Ss(this._openRegionsByWidth,e,{x:o.x+this._slabW-e,w:e,y:o.y,h:this._slabH-(t??0)}),t&&Ss(this._openRegionsByHeight,t,{x:o.x,w:this._slabW,y:o.y+this._slabH-t,h:t}),this._slabs.push(o),this._activeSlabsByDims.set(o,r.w,r.h)}let e=Math.floor(this._slabW/o.entryW);t=o.x+Math.floor(o.count%e)*o.entryW,i=o.y+Math.floor(o.count/e)*o.entryH,o.count++}
43this._ctx.drawImage(e.source,e.boundingBox.left,e.boundingBox.top,n,s,t,i,n,s);let a={pageIndex:this._textureIndex,glyphIndex:this._nextIndex++,x:t,y:i,w:n,h:s,originOffsetX:e.originOffset.x,originOffsetY:e.originOffset.y,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent};return this._allocatedGlyphs.add(a),a}getUsagePreview(){let e=this._canvas.width,t=this._canvas.height,i=new OffscreenCanvas(e,t),n=y4(i.getContext("2d"));n.fillStyle="#808080",n.fillRect(0,0,e,t);let s=64<<Math.floor(lm().devicePixelRatio)-1;for(let e of this._slabs){let t=0,i=0;for(let r=0;r<e.count;r++)t+e.entryW>s&&(t=0,i+=e.entryH),n.fillStyle="#FF0000",n.fillRect(e.x+t,e.y+i,e.entryW,e.entryH),e.entryW,e.entryH,t+=e.entryW;e.entryW,e.entryH,e.entryW,e.entryH}for(let e of this._allocatedGlyphs)e.w,e.h,n.fillStyle="#4040FF",n.fillRect(e.x,e.y,e.w,e.h);for(let e of Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat()))n.fillStyle="#FF000088",n.fillRect(e.x,e.y,e.w,e.h),e.w,e.h;return n.globalAlpha=.5,n.drawImage(this._canvas,0,0),n.globalAlpha=1,i.convertToBlob()}getStats(){let e=this._canvas.width,t=this._canvas.height,i=0,n=0,s=0,r=0,o=0,a=e*t,l=64<<Math.floor(lm().devicePixelRatio)-1;for(let e of this._slabs){let t=0;for(let n=0;n<e.count;n++)t+e.entryW>l&&(t=0,e.entryH),i+=e.entryW*e.entryH,t+=e.entryW;let n=Math.floor(l/e.entryW),r=Math.floor(l/e.entryH);s+=l*l-e.entryW*n*e.entryH*r}for(let e of this._allocatedGlyphs)n+=e.w*e.h;for(let e of Array.from(this._openRegionsByWidth.values()).flat().concat(Array.from(this._openRegionsByHeight.values()).flat()))o+=e.w*e.h;r=i-(n-(s-o));let h=n/(n+r+o);return`page[${this._textureIndex}]:
44     Total: ${a}px (${e}x${t})
45      Used: ${n}px (${(n/a*100).toFixed(2)}%)
46    Wasted: ${r}px (${(r/a*100).toFixed(2)}%)
47Restricted: ${o}px (${(o/a*100).toFixed(2)}%) (hard to allocate)
48Efficiency: ${1===h?"100":(100*h).toFixed(2)}%
49     Slabs: ${this._slabs.length} of ${Math.floor(this._canvas.width/l)*Math.floor(this._canvas.height/l)}`}}function Ss(e,t,i){let n=e.get(t);n||(n=[],e.set(t,n)),n.push(i)}var Sr=function(e,t){return function(i,n){t(i,n,e)}};let So=class extends ro.JT{static{no=this}get version(){return this._version}static{this.maximumGlyphCount=5e3}get usedArea(){return this._usedArea}get source(){return this._canvas}get glyphs(){return this._glyphInOrderSet.values()}constructor(e,t,i,n,s){switch(super(),this._logService=n,this._version=0,this._usedArea={left:0,top:0,right:0,bottom:0},this._glyphMap=new dp,this._glyphInOrderSet=new Set,this._canvas=new OffscreenCanvas(t,t),this._colorMap=s.getColorTheme().tokenColorMap,i){case"shelf":this._allocator=new Si(this._canvas,e);break;case"slab":this._allocator=new Sn(this._canvas,e);break;default:this._allocator=i(this._canvas,e)}this._register((0,ro.OF)(()=>{this._canvas.width=1,this._canvas.height=1}))}getGlyph(e,t,i,n){return this._glyphMap.get(t,i,n,e.cacheKey)??this._createGlyph(e,t,i,n)}_createGlyph(e,t,i,n){if(this._glyphInOrderSet.size>=no.maximumGlyphCount)return;let s=e.rasterizeGlyph(t,i,n,this._colorMap),r=this._allocator.allocate(s);if(void 0!==r)return this._glyphMap.set(r,t,i,n,e.cacheKey),this._glyphInOrderSet.add(r),this._version++,this._usedArea.right=Math.max(this._usedArea.right,r.x+r.w-1),this._usedArea.bottom=Math.max(this._usedArea.bottom,r.y+r.h-1),this._logService.getLevel()===iq.Trace&&this._logService.trace("New glyph",{chars:t,tokenMetadata:i,decorationStyleSetId:n,rasterizedGlyph:s,glyph:r}),r}getUsagePreview(){return this._allocator.getUsagePreview()}getStats(){return this._allocator.getStats()}};So=no=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Sr(3,dM),Sr(4,CG)],So);var Sa=function(e,t){return function(i,n){t(i,n,e)}};let Sl=class extends ro.JT{static{na=this}static{this.maximumPageCount=16}get pages(){return this._pages}constructor(e,t,i,n,s){super(),this._maxTextureSize=e,this._decorationStyleCache=i,this._themeService=n,this._instantiationService=s,this._warmUpTask=this._register(new ro.XK),this._warmedUpRasterizers=new Set,this._pages=[],this._glyphPageIndex=new dp,this._onDidDeleteGlyphs=this._register(new sd.Q5),this.onDidDeleteGlyphs=this._onDidDeleteGlyphs.event,this._allocatorType=t?.allocatorType??"slab",this._register(sd.ju.runAndSubscribe(this._themeService.onDidColorThemeChange,()=>{this._colorMap&&this.clear(),this._colorMap=this._themeService.getColorTheme(
49).tokenColorMap}));let r=Math.max(1,Math.floor(lm().devicePixelRatio));this.pageSize=Math.min(1024*r,this._maxTextureSize),this._initFirstPage(),this._register((0,ro.OF)(()=>(0,ro.B9)(this._pages)))}_initFirstPage(){let e=this._instantiationService.createInstance(So,0,this.pageSize,this._allocatorType);this._pages.push(e);let t=new y3(1,"",1,this._decorationStyleCache);e.getGlyph(t,"",0,0),t.dispose()}clear(){for(let e of this._pages)e.dispose();this._pages.length=0,this._glyphPageIndex.clear(),this._warmedUpRasterizers.clear(),this._warmUpTask.clear(),this._initFirstPage(),this._onDidDeleteGlyphs.fire()}getGlyph(e,t,i,n,s){return i&=-2048,i|=Math.floor(s%1*10),this._warmedUpRasterizers.has(e.id)||(this._warmUpAtlas(e),this._warmedUpRasterizers.add(e.id)),this._tryGetGlyph(this._glyphPageIndex.get(t,i,n,e.cacheKey)??0,e,t,i,n)}_tryGetGlyph(e,t,i,n,s){return this._glyphPageIndex.set(e,i,n,s,t.cacheKey),this._pages[e].getGlyph(t,i,n,s)??(e+1<this._pages.length?this._tryGetGlyph(e+1,t,i,n,s):void 0)??this._getGlyphFromNewPage(t,i,n,s)}_getGlyphFromNewPage(e,t,i,n){if(this._pages.length>=na.maximumPageCount)throw Error(`Attempt to create a texture atlas page past the limit ${na.maximumPageCount}`);return this._pages.push(this._instantiationService.createInstance(So,this._pages.length,this.pageSize,this._allocatorType)),this._glyphPageIndex.set(this._pages.length-1,t,i,n,e.cacheKey),this._pages[this._pages.length-1].getGlyph(e,t,i,n)}getStats(){return this._pages.map(e=>e.getStats())}_warmUpAtlas(e){let t=this._colorMap;if(!t)throw new o_.he("Cannot warm atlas without color map");this._warmUpTask.value?.clear();let i=this._warmUpTask.value=this._instantiationService.createInstance(St);for(let n=65;n<=90;n++)for(let s of t.keys())i.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),s<<15&16744448,0,t)});for(let n=97;n<=122;n++)for(let s of t.keys())i.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),s<<15&16744448,0,t)});for(let n=33;n<=126;n++)for(let s of t.keys())i.enqueue(()=>{for(let t=0;t<1;t+=.1)this.getGlyph(e,String.fromCharCode(n),s<<15&16744448,0,t)})}};Sl=na=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Sa(3,CG),Sa(4,he)],Sl),(e7=nl||(nl={}))[e7.Ignore=0]="Ignore",e7[e7.Info=1]="Info",e7[e7.Warning=2]="Warning",e7[e7.Error=3]="Error",function(e){let t="error",i="warning",n="info";e.fromValue=function(s){return s?rz(t,s)?e.Error:rz(i,s)||rz("warn",s)?e.Warning:rz(n,s)?e.Info:e.Ignore:e.Ignore},e.toString=function(s){switch(s){case e.Error:return t;case e.Warning:return i;case e.Info:return n;default:return"ignore"}}}(nl||(nl={}));var Sh=nl;let Sd=ht("notificationService");class Su{}function Sc(e){return{object:e,dispose:()=>e.destroy()}}!function(e){async function t(e){try{if(!navigator.gpu)throw Error("This browser does not support WebGPU");let e=await navigator.gpu.requestAdapter();if(!e)throw Error("This browser supports WebGPU but it appears to be disabled");return Sc(await e.requestDevice())}catch(t){throw e&&e(t.message),t}}e.requestDevice=t,e.createBuffer=function(e,t,i){let n=e.createBuffer(t);return i&&e.queue.writeBuffer(n,0,(0,re.mf)(i)?i():i),Sc(n)},e.createTexture=function(e,t){return Sc(e.createTexture(t))}}(nh||(nh={}));class Sg{get dataOffset(){return this._startIndex}get dirtySize(){if(void 0!==this._startIndex&&void 0!==this._endIndex)return this._endIndex-this._startIndex+1}get isDirty(){return void 0!==this._startIndex}flag(e,t=1){return this._flag(e),t>1&&this._flag(e+t-1),e}_flag(e){(void 0===this._startIndex||e<this._startIndex)&&(this._startIndex=e),(void 0===this._endIndex||e>this._endIndex)&&(this._endIndex=e)}clear(){this._startIndex=void 0,this._endIndex=void 0}}class Sf extends ro.JT{get entryCount(){return this._entries.size}get dirtyTracker(){return this._dirtyTracker}constructor(e,t){super(),this.propertySpecs=e,this.capacity=t,this._dirtyTracker=new Sg,this._propertySpecsMap=new Map,this._entries=new hu.S,this._onDidChange=this._register(new sd.Q5),this._onDidChangeBuffer=this._register(new sd.Q5),this.onDidChangeBuffer=this._onDidChangeBuffer.event,this.view=new Float32Array(t*e.length),this.buffer=this.view.buffer,this._entrySize=e.length;for(let t=0;t<e.length;t++){let i={offset:t,...e[t]};this._propertySpecsMap.set(i.name,i)}this._register((0,ro.OF)(()=>(0,ro.B9)(this._entries)))}createEntry(e){this._entries.size===this.capacity&&(this._expandBuffer(),this._onDidChangeBuffer.fire());let t=new Sm(this.view,this._propertySpecsMap,this._dirtyTracker,this._entries.size,e),i=this._entries.push(t),n=[];return n.push(sd.ju.forward(t.onDidChange,this._onDidChange)),n.push(t.onWillDispose(()=>{let e=t.i;for(let t of(i(),this.view.set(this.view.subarray(e*this._entrySize
49+2,this._entries.size*this._entrySize+2),e*this._entrySize),this._entries))t.i>e&&t.i--;this._dirtyTracker.flag(e,(this._entries.size-e)*this._entrySize),(0,ro.B9)(n)})),t}_expandBuffer(){this.capacity*=2;let e=new Float32Array(this.capacity*this._entrySize);e.set(this.view),this.view=e,this.buffer=this.view.buffer}}class Sm extends ro.JT{constructor(e,t,i,n,s){for(let r of(super(),this._view=e,this._propertySpecsMap=t,this._dirtyTracker=i,this.i=n,this._onDidChange=this._register(new sd.Q5),this.onDidChange=this._onDidChange.event,this._onWillDispose=this._register(new sd.Q5),this.onWillDispose=this._onWillDispose.event,this._propertySpecsMap.values()))this._view[this.i*this._propertySpecsMap.size+r.offset]=s[r.name];this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}dispose(){this._onWillDispose.fire(),super.dispose()}setRaw(e){if(e.length!==this._propertySpecsMap.size)throw Error(`Data length ${e.length} does not match the number of properties in the collection (${this._propertySpecsMap.size})`);this._view.set(e,this.i*this._propertySpecsMap.size),this._dirtyTracker.flag(this.i*this._propertySpecsMap.size,this._propertySpecsMap.size)}}let Sp=`
50
51struct Vertex {
52	@location(0) position: vec2f,
53};
54
55struct LayoutInfo {
56	canvasDims: vec2f,
57	viewportOffset: vec2f,
58	viewportDims: vec2f,
59}
60
61struct ScrollOffset {
62	offset: vec2f,
63}
64
65struct Shape {
66	position: vec2f,
67	size: vec2f,
68	color: vec4f,
69};
70
71struct VSOutput {
72	@builtin(position) position: vec4f,
73	@location(1)       color:    vec4f,
74};
75
76// Uniforms
77@group(0) @binding(1) var<uniform>       layoutInfo:      LayoutInfo;
78
79// Storage buffers
80@group(0) @binding(0)            var<storage, read> shapes:          array<Shape>;
81@group(0) @binding(2)      var<uniform>       scrollOffset:    ScrollOffset;
82
83@vertex fn vs(
84	vert: Vertex,
85	@builtin(instance_index) instanceIndex: u32,
86	@builtin(vertex_index) vertexIndex : u32
87) -> VSOutput {
88	let shape = shapes[instanceIndex];
89
90	var vsOut: VSOutput;
91	vsOut.position = vec4f(
92		(
93			// Top left corner
94			vec2f(-1,  1) +
95			// Convert pixel position to clipspace
96			vec2f( 2, -2) / layoutInfo.canvasDims *
97			// Shape position and size
98			(layoutInfo.viewportOffset - scrollOffset.offset + shape.position + vert.position * shape.size)
99		),
100		0.0,
101		1.0
102	);
103	vsOut.color = shape.color;
104	return vsOut;
105}
106
107@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {
108	return vsOut.color;
109}
110`;class S_ extends vc{constructor(e,t,i,n,s,r){super(),this._context=e,this._contentLeft=t,this._devicePixelRatio=i,this._canvas=n,this._ctx=s,this._shapeBindBuffer=this._register(new ro.XK),this._initialized=!1,this._shapeCollection=this._register(new Sf([{name:"x"},{name:"y"},{name:"width"},{name:"height"},{name:"red"},{name:"green"},{name:"blue"},{name:"alpha"}],32)),this._context.addEventHandler(this),this._initWebgpu(r)}async _initWebgpu(e){let t;if(this._device=await e,this._store.isDisposed)return;let i=navigator.gpu.getPreferredCanvasFormat();this._ctx.configure({device:this._device,format:i,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco rectangle renderer render pass",colorAttachments:[this._renderPassColorAttachment]};{let e=new Float32Array(6),i=(t=this._canvas.width,i=this._canvas.height)=>(e[0]=t,e[1]=i,e[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*lm().devicePixelRatio),e[3]=0,e[4]=e[0]-e[2],e[5]=e[1]-e[3],e);t=this._register(nh.createBuffer(this._device,{label:"Monaco rectangle renderer uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>i())).object,this._register(y6(this._canvas,lm(),(e,n)=>{this._device.queue.writeBuffer(t,0,i(e,n))}))}this._scrollOffsetBindBuffer=this._register(nh.createBuffer(this._device,{label:"Monaco rectangle renderer scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2);let n=()=>nh.createBuffer(this._device,{label:"Monaco rectangle renderer shape buffer",size:this._shapeCollection.buffer.byteLength,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST});this._shapeBindBuffer.value=n(),this._register(sd.ju.runAndSubscribe(this._shapeCollection.onDidChangeBuffer,()=>{this._shapeBindBuffer.value=n(),this._pipeline&&this._updateBindGroup(this._pipeline,t)})),this._vertexBuffer=this._register(nh.createBuffer(this._device,{label:"Monaco rectangle renderer vertex buffer",size:y5.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},y5)).object;let s=this._device.createShaderModule({label:"Monaco rectangle renderer shader module",code:Sp});this._pipeline=this._device.createRenderPipeline({label:"Monaco rectangle renderer render pipeline",layout:"auto",vertex:{module:s,buffers:[{arrayStri
110de:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:s,targets:[{format:i,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._updateBindGroup(this._pipeline,t),this._initialized=!0}_updateBindGroup(e,t){this._bindGroup=this._device.createBindGroup({label:"Monaco rectangle renderer bind group",layout:e.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._shapeBindBuffer.value.object}},{binding:1,resource:{buffer:t}},{binding:2,resource:{buffer:this._scrollOffsetBindBuffer}}]})}register(e,t,i,n,s,r,o,a){return this._shapeCollection.createEntry({x:e,y:t,width:i,height:n,red:s,green:r,blue:o,alpha:a})}onScrollChanged(e){if(this._device){let e=lm().devicePixelRatio;this._scrollOffsetValueBuffer[0]=this._context.viewLayout.getCurrentScrollLeft()*e,this._scrollOffsetValueBuffer[1]=this._context.viewLayout.getCurrentScrollTop()*e,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer)}return!0}_update(){if(!this._device)return;let e=this._shapeCollection;e.dirtyTracker.isDirty&&(this._device.queue.writeBuffer(this._shapeBindBuffer.value.object,0,e.buffer,e.dirtyTracker.dataOffset,e.dirtyTracker.dirtySize*e.view.BYTES_PER_ELEMENT),e.dirtyTracker.clear())}draw(e){if(!this._initialized)return;this._update();let t=this._device.createCommandEncoder({label:"Monaco rectangle renderer command encoder"});this._renderPassColorAttachment.view=this._ctx.getCurrentTexture().createView();let i=t.beginRenderPass(this._renderPassDescriptor);i.setPipeline(this._pipeline),i.setVertexBuffer(0,this._vertexBuffer),i.setBindGroup(0,this._bindGroup);let n=Math.ceil(this._contentLeft.get()*this._devicePixelRatio.get());i.setScissorRect(n,0,this._canvas.width-n,this._canvas.height),i.draw(y5.length/2,this._shapeCollection.entryCount),i.end();let s=t.finish();this._device.queue.submit([s])}}i(95462);class Sv extends ro.JT{constructor(){super(),this._ruleCache=new Map,this._container=lI("div.monaco-decoration-css-rule-extractor"),this._dummyElement=lI("span"),this._container.appendChild(this._dummyElement),this._register((0,ro.OF)(()=>this._container.remove()))}getStyleRules(e,t){let i=this._ruleCache.get(t);if(i)return i;this._dummyElement.className=t,e.appendChild(this._container);let n=this._getStyleRules(t);return this._ruleCache.set(t,n),e.removeChild(this._container),n}_getStyleRules(e){let t=[],i=[...lf().styleSheets];for(let n=0;n<i.length;n++)for(let s of i[n].cssRules)if(s instanceof CSSImportRule)s.styleSheet&&i.push(s.styleSheet);else if(s instanceof CSSStyleRule){let i=`.${e}`,n=s.selectorText.indexOf(i);if(-1!==n){let e=n+i.length;(s.selectorText.length===e||s.selectorText.substring(e,e+1).match(/[ :]/))&&t.pu
110sh(s)}}return t}}class Sb{constructor(){this._nextId=1,this._cacheById=new Map,this._cacheByStyle=new dp}getOrCreateEntry(e,t,i){if(void 0===e&&void 0===t&&void 0===i)return 0;let n=this._cacheByStyle.get(e??0,t?1:0,void 0===i?"":i.toFixed(2));if(n)return n.id;let s=this._nextId++,r={id:s,color:e,bold:t,opacity:i};return this._cacheById.set(s,r),this._cacheByStyle.set(r,e??0,t?1:0,void 0===i?"":i.toFixed(2)),s}getStyleSet(e){if(0!==e)return this._cacheById.get(e)}}function SC(e,t){let i;let n=!0;return function(e,t){let i=new ro.SL,n=aE({owner:e.owner,debugName:e.debugName,debugReferenceFn:e.debugReferenceFn??t,changeTracker:e.changeTracker},(e,n)=>{i.clear(),t(e,n,i)});return(0,ro.OF)(()=>{n.dispose(),i.dispose()})}({changeTracker:{createChangeSummary:()=>({deltas:[],didChange:!1}),handleChange:(t,i)=>{if(t.didChange(e)){let e=t.change;void 0!==e&&i.deltas.push(e),i.didChange=!0}return!0}}},(s,r)=>{let o=e.read(s),a=i;r.didChange&&(i=o,t(o,a,r.deltas)),n&&(n=!1,i=o)})}var Sw=function(e,t){return function(i,n){t(i,n,e)}};let Sy=class extends ro.JT{static{nd=this}static{this._decorationCssRuleExtractor=new Sv}static get decorationCssRuleExtractor(){return nd._decorationCssRuleExtractor}static{this._decorationStyleCache=new Sb}static get decorationStyleCache(){return nd._decorationStyleCache}static get atlas(){if(!nd._atlas)throw new o_.he("Cannot call ViewGpuContext.textureAtlas before device is resolved");return nd._atlas}get atlas(){return nd.atlas}constructor(e,t,i,n){super(),this._instantiationService=t,this._notificationService=i,this.configurationService=n,this.maxGpuCols=2e3,this.canvas=l2(document.createElement("canvas")),this.canvas.setClassName("editorCanvas"),this._register(sd.ju.runAndSubscribe(n.onDidChangeConfiguration,e=>{if(!e||e.affectsConfiguration("editor.scrollbar.verticalScrollbarSize")){let e=n.getValue("editor").scrollbar?.verticalScrollbarSize??14;this.canvas.domNode.style.boxSizing="border-box",this.canvas.domNode.style.paddingRight=`${e}px`}})),this.ctx=y4(this.canvas.domNode.getContext("webgpu")),nd.device||(nd.device=nh.requestDevice(e=>{let t=[{label:(0,rh.NC)(78,"Use DOM-based rendering"),run:()=>this.configurationService.updateValue("editor.experimentalGpuAcceleration","off")}];this._notificationService.prompt(Sh.Warning,e,t)}).then(e=>(nd.deviceSync=e.object,nd._atlas||(nd._atlas=this._instantiationService.createInstance(Sl,e.object.limits.maxTextureDimension2D,void 0,nd.decorationStyleCache)),e.object)));let s=aU(this,lm().devicePixelRatio);this._register(a6(lm(),"resize",()=>{s.set(lm().devicePixelRatio,void 0)})),this.devicePixelRatio=s,this._register(SC(this.devicePixelRatio,()=>nd.atlas?.clear()));let r=aU(this,{width:this.canvas.domNode.width,height:this.canvas.domNode.height});this._register(y6(this.canvas.domNode,lm(),(e,t)=>{this.canvas.domNode.width=e,this.canvas.domNode.height=t,r.set({width:e,height:t},void 0)})),this.canvasDevicePixelDimensions=r;let o=aU(this,0);this._register(this.configurationService.onDidChangeConfiguration(t=>{o.set(e.configuration.options.get(165).contentLeft,void 0)})),this.contentLeft=o,this.rectangleRenderer=this._instantiationService.createInstance(S_,e,this.contentLeft,this.devicePixelRatio,this.canvas.domNode,this.ctx,nd.device)}canRender(e,t,i){let n=t.getViewLineRenderingData(i);if(n.containsRTL||n.maxColumn>this.maxGpuCols)return!1;if(n.inlineDecorations.length>0){let e=!0;for(let t of n.inlineDecorations){if(0!==t.type){e=!1;break}let i=nd._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,t.inlineClassName);if(!(e&&=i.every(e=>{if(e.selectorText.includes(":"))return!1;for(let t of e.style)if(!SL(t,e.style))return!1;return!0})))break}return e}return!0}canRenderDetailed(e,t,i){let n=t.getViewLineRenderingData(i),s=[];if(n.containsRTL&&s.push("containsRTL"),n.maxColumn>this.maxGpuCols&&s.push("maxColumn > maxGpuCols"),n.inlineDecorations.length>0){let e=!0,t=[],i=[],r=[];for(let s of n.inlineDecorations){if(0!==s.type){t.push(s.type),e=!1;continue}let n=nd._decorationCssRuleExtractor.getStyleRules(this.canvas.domNode,s.inlineClassName);if(!(e&&=n.every(e=>{if(e.selectorText.includes(":"))return i.push(e.selectorText),!1;for(let t of e.style)if(!SL(t,e.style))return r.push(`${t}: ${e.style[t]}`),!1;return!0})))continue}t.length>0&&s.push(`inlineDecorations with unsupported types (${t.map(e=>`\`${e}\``).join(", ")})`),r.length>0&&s.push(`inlineDecorations with unsupported CSS rules (${r.map(e=>`\`${e}\``).join(", ")})`),i.length>0&&s.push(`inlineDecorations with unsupported CSS selectors (${i.map(e=>`\`${e}\``).join(", ")})`)}return s}};Sy=nd=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Sw(1,he),Sw(2,Sd),Sw(3,uE)],Sy);
110let SS=["color","font-weight","opacity"];function SL(e,t){return!!SS.includes(e)}function Sx(e,t){return e.isBasicASCII&&t.useMonospaceOptimizations?new Sk(e):new SN(e)}class Sk{constructor(e){this._content=e.content}getSegmentAtIndex(e){return this._content[e]}}class SN{constructor(e){this._segments=[];let t=e.content,i=Array.from(cN.Segmenter(void 0,{granularity:"grapheme"}).value.segment(t)),n=0;for(let e=0;e<t.length;e++){let t=i[n];if(!t)break;if(t.index!==e){this._segments.push(void 0);continue}n++,this._segments.push(t)}}getSegmentAtIndex(e){return this._segments[e]?.segment}}class SD extends vc{get glyphRasterizer(){return this._glyphRasterizer.value}constructor(e,t,i,n){super(),this._context=e,this._viewGpuContext=t,this._device=i,this._glyphRasterizer=n,this._context.addEventHandler(this)}}let SE=`
111struct GlyphInfo {
112	position: vec2f,
113	size: vec2f,
114	origin: vec2f,
115};
116
117struct Vertex {
118	@location(0) position: vec2f,
119};
120
121struct Cell {
122	position: vec2f,
123	unused1: vec2f,
124	glyphIndex: f32,
125	textureIndex: f32
126};
127
128struct LayoutInfo {
129	canvasDims: vec2f,
130	viewportOffset: vec2f,
131	viewportDims: vec2f,
132}
133
134struct ScrollOffset {
135	offset: vec2f
136}
137
138struct VSOutput {
139	@builtin(position) position:   vec4f,
140	@location(1)       layerIndex: f32,
141	@location(0)       texcoord:   vec2f,
142};
143
144// Uniforms
145@group(0) @binding(4)       var<uniform>       layoutInfo:      LayoutInfo;
146@group(0) @binding(5)  var<uniform>       atlasDims:       vec2f;
147@group(0) @binding(6)            var<uniform>       scrollOffset:    ScrollOffset;
148
149// Storage buffers
150@group(0) @binding(0)               var<storage, read> glyphInfo:       array<array<GlyphInfo, ${So.maximumGlyphCount}>, ${Sl.maximumPageCount}>;
151@group(0) @binding(1)                   var<storage, read> cells:           array<Cell>;
152
153@vertex fn vs(
154	vert: Vertex,
155	@builtin(instance_index) instanceIndex: u32,
156	@builtin(vertex_index) vertexIndex : u32
157) -> VSOutput {
158	let cell = cells[instanceIndex];
159	var glyph = glyphInfo[u32(cell.textureIndex)][u32(cell.glyphIndex)];
160
161	var vsOut: VSOutput;
162	// Multiple vert.position by 2,-2 to get it into clipspace which ranged from -1 to 1
163	vsOut.position = vec4f(
164		// Make everything relative to top left instead of center
165		vec2f(-1, 1) +
166		((vert.position * vec2f(2, -2)) / layoutInfo.canvasDims) * glyph.size +
167		((cell.position * vec2f(2, -2)) / layoutInfo.canvasDims) +
168		((glyph.origin * vec2f(2, -2)) / layoutInfo.canvasDims) +
169		(((layoutInfo.viewportOffset - scrollOffset.offset * vec2(1, -1)) * 2) / layoutInfo.canvasDims),
170		0.0,
171		1.0
172	);
173
174	vsOut.layerIndex = cell.textureIndex;
175	// Textures are flipped from natural direction on the y-axis, so flip it back
176	vsOut.texcoord = vert.position;
177	vsOut.texcoord = (
178		// Glyph offset (0-1)
179		(glyph.position / atlasDims) +
180		// Glyph coordinate (0-1)
181		(vsOut.texcoord * (glyph.size / atlasDims))
182	);
183
184	return vsOut;
185}
186
187@group(0) @binding(2) var ourSampler: sampler;
188@group(0) @binding(3)        var ourTexture: texture_2d_array<f32>;
189
190@fragment fn fs(vsOut: VSOutput) -> @location(0) vec4f {
191	return textureSample(ourTexture, ourSampler, vsOut.texcoord, u32(vsOut.layerIndex));
192}
193`;class ST extends SD{static{this.maxSupportedColumns=2e3}get bindGroupEntries(){return[{binding:1,resource:{buffer:this._cellBindBuffer}},{binding:6,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="viewport",this.wgsl=SE,this._cellBindBufferLineCapacity=63,this._activeDoubleBufferIndex=0,this._visibleObjectCount=0,this._scrollInitialized=!1,this._onDidChangeBindGroupEntries=this._register(new sd.Q5),this.onDidChangeBindGroupEntries=this._onDidChangeBindGroupEntries.event,this._rebuildCellBuffer(this._cellBindBufferLineCapacity),this._scrollOffsetBindBuffer=this._register(nh.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2)}_rebuildCellBuffer(e){this._cellBindBuffer?.destroy();let t=(Math.floor(e/32)+1)*32,i=t*ST.maxSupportedColumns*6*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(nh.createBuffer(this._device,{label:"Monaco full file cell buffer",size:i,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(i),new ArrayBuffer(i)],this._cellBindBufferLineCapacity=t,this._onDidChangeBindGroupEntries.fire()}onConfigurationChanged(e){return!0}onDecorationsChanged(e){return!0}onTokensChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLinesChanged(e){return!0}onScrollChanged(e){let t=lm().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return!0}onLineMappingChanged(e){return!0}onZonesChanged(e){return!0}reset(){for(let e of[0,1]){let t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}}update(e,t){let i,n,s,r,o,a,l,h,d,u="",c=0,g=0,f=0,m=0,p=0,_=0,v=0,b=0,C=0,w=0,y=0,S=0,L=lm().devicePixelRatio;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0),this._cellBindBufferLineCapacity<e.endLineNumber-e.startLineNumber+1&&this._rebuildCellBuffer(e.endLineNumber-e.startLineNumber+1);let x=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]);x.fill(0);let k=6*ST.maxSupportedColumns;for(g=e.startLineNumber;g<=e.endLineNumber;g++)if(this._viewGpuContext.canRender(t,e,g)){a=e.getViewLineRenderingData(g),_=0,d=Sx(a,t),c=t.spaceWi
193dth*L,m=0,h=a.tokens,b=a.minColumn-1,C=0;for(let y=0,S=h.getCount();y<S;y++)if(!((C=h.getEndOffset(y))<=b)){for(w=h.getMetadata(y),f=b;f<C&&!(f>ST.maxSupportedColumns);f++){if(void 0===(i=d.getSegmentAtIndex(f)))continue;for(l of(u=i,a.isBasicASCII&&t.useMonospaceOptimizations||(c=this.glyphRasterizer.getTextMetrics(u).width),r=void 0,s=void 0,o=void 0,a.inlineDecorations))if(!(g<l.range.startLineNumber)&&!(g>l.range.endLineNumber)&&(g!==l.range.startLineNumber||!(f<l.range.startColumn-1))&&(g!==l.range.endLineNumber||!(f>=l.range.endColumn-1)))for(let e of Sy.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,l.inlineClassName))for(let t of e.style){let i=e.styleMap.get(t)?.toString()??"";switch(t){case"color":{let e=gX.Format.CSS.parse(i);if(!e)throw new o_.he("Invalid color format "+i);r=e.toNumber32Bit();break}case"font-weight":s=function(e){switch(e){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(e)}(i)>=400;break;case"opacity":o=i.endsWith("%")?parseFloat(i.substring(0,i.length-1))/100:i.match(/^\d+(?:\.\d*)/)?parseFloat(i):1;break;default:throw new o_.he("Unexpected inline decoration style")}}if(" "===u||"	"===u){if(v=((g-1)*ST.maxSupportedColumns+f)*6,x.fill(0,v,v+6),"	"===u){let e=f+_;m+=c*((_=vR.nextRenderTabStop(f+_,a.tabSize))-e),_-=f+1}else m+=c;continue}let h=Sy.decorationStyleCache.getOrCreateEntry(r,s,o);n=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,u,w,h,m),p=Math.round(e.relativeVerticalOffset[g-e.startLineNumber]*L+Math.floor((e.lineHeight*L-(n.fontBoundingBoxAscent+n.fontBoundingBoxDescent))/2)+n.fontBoundingBoxAscent),x[(v=((g-e.startLineNumber)*ST.maxSupportedColumns+f)*6)+0]=Math.floor(m),x[v+1]=p,x[v+4]=n.glyphIndex,x[v+5]=n.pageIndex,m+=c}b=C}y=((g-e.startLineNumber)*ST.maxSupportedColumns+C)*6,S=(g-e.startLineNumber)*ST.maxSupportedColumns*6,x.fill(0,y,S)}let N=(e.endLineNumber-e.startLineNumber+1)*k;return this._device.queue.writeBuffer(this._cellBindBuffer,0,x.buffer,0,(e.endLineNumber-e.startLineNumber)*k*Float32Array.BYTES_PER_ELEMENT),this._activeDoubleBufferIndex=this._activeDoubleBufferIndex?0:1,this._visibleObjectCount=N,N}draw(e,t){if(this._visibleObjectCount<=0)throw new o_.he("Attempt to draw 0 objects");e.draw(y5.length/2,this._visibleObjectCount)}}class SI extends SD{static{this.maxSupportedLines=3e3}static{this.maxSupportedColumns=200}get bindGroupEntries(){return[{binding:1,resource:{buffer:this._cellBindBuffer}},{binding:6,resource:{buffer:this._scrollOffsetBindBuffer}}]}constructor(e,t,i,n){super(e,t,i,n),this.type="fullfile",this.wgsl=SE,this._activeDoubleBufferIndex=0,this._upToDateLines=[new Set,new Set],this._visibleObjectCount=0,this._finalRenderedLine=0,this._scrollInitialized=!1,this._queuedBufferUpdates=[[],[]];let s=SI.maxSupportedLines*SI.maxSupportedColumns*6*Float32Array.BYTES_PER_ELEMENT;this._cellBindBuffer=this._register(nh.createBuffer(this._device,{label:"Monaco full file cell buffer",size:s,usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._cellValueBuffers=[new ArrayBuffer(s),new ArrayBuffer(s)],this._scrollOffsetBindBuffer=this._register(nh.createBuffer(this._device,{label:"Monaco scroll offset buffer",size:2*Float32Array.BYTES_PER_ELEMENT,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST})).object,this._scrollOffsetValueBuffer=new Float32Array(2)}onConfigurationChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onDecorationsChanged(e){return this._invalidateAllLines(),!0}onTokensChanged(e){for(let t of e.ranges)this._invalidateLineRange(t.fromLineNumber,t.toLineNumber);return!0}onLinesDeleted(e){return this._invalidateLinesFrom(e.fromLineNumber),this._queueBufferUpdate(e),!0}onLinesInserted(e){return this._invalidateLinesFrom(e.fromLineNumber),!0}onLinesChanged(e){return this._invalidateLineRange(e.fromLineNumber,e.fromLineNumber+e.count),!0}onScrollChanged(e){let t=lm().devicePixelRatio;return this._scrollOffsetValueBuffer[0]=(e?.scrollLeft??this._context.viewLayout.getCurrentScrollLeft())*t,this._scrollOffsetValueBuffer[1]=(e?.scrollTop??this._context.viewLayout.getCurrentScrollTop())*t,this._device.queue.writeBuffer(this._scrollOffsetBindBuffer,0,this._scrollOffsetValueBuffer),!0}onThemeChanged(e){return this._invalidateAllLines(),!0}
193onLineMappingChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}onZonesChanged(e){return this._invalidateAllLines(),this._queueBufferUpdate(e),!0}_invalidateAllLines(){this._upToDateLines[0].clear(),this._upToDateLines[1].clear()}_invalidateLinesFrom(e){for(let t of[0,1]){let i=this._upToDateLines[t];for(let t of i)t>=e&&i.delete(t)}}_invalidateLineRange(e,t){for(let i=e;i<=t;i++)this._upToDateLines[0].delete(i),this._upToDateLines[1].delete(i)}reset(){for(let e of(this._invalidateAllLines(),[0,1])){let t=new Float32Array(this._cellValueBuffers[e]);t.fill(0,0,t.length),this._device.queue.writeBuffer(this._cellBindBuffer,0,t.buffer,0,t.byteLength)}this._finalRenderedLine=0}update(e,t){let i,n,s,r,o,a,l,h,d,u="",c=0,g=0,f=0,m=0,p=0,_=0,v=0,b=0,C=0,w=0,y=0,S=0,L=lm().devicePixelRatio;this._scrollInitialized||(this.onScrollChanged(),this._scrollInitialized=!0);let x=new Float32Array(this._cellValueBuffers[this._activeDoubleBufferIndex]),k=6*SI.maxSupportedColumns,N=this._upToDateLines[this._activeDoubleBufferIndex],D=3e3,E=0,T=this._queuedBufferUpdates[this._activeDoubleBufferIndex];for(;T.length;){let e=T.shift();switch(e.type){case 2:case 8:case 17:x.fill(0),D=1,E=Math.max(E,this._finalRenderedLine),this._finalRenderedLine=0;break;case 10:{let t=(e.fromLineNumber-1)*SI.maxSupportedColumns*6,i=e.toLineNumber*SI.maxSupportedColumns*6,n=(this._finalRenderedLine-(e.toLineNumber-e.fromLineNumber+1))*SI.maxSupportedColumns*6;x.set(x.subarray(i),t),x.fill(0,n),D=Math.min(D,e.fromLineNumber),E=Math.max(E,this._finalRenderedLine),this._finalRenderedLine-=e.toLineNumber-e.fromLineNumber+1}}}for(g=e.startLineNumber;g<=e.endLineNumber;g++){if(!this._viewGpuContext.canRender(t,e,g)){y=(g-1)*SI.maxSupportedColumns*6,S=g*SI.maxSupportedColumns*6,x.fill(0,y,S),D=Math.min(D,g),E=Math.max(E,g);continue}if(!N.has(g)){D=Math.min(D,g),E=Math.max(E,g),a=e.getViewLineRenderingData(g),_=0,d=Sx(a,t),c=t.spaceWidth*L,m=0,h=a.tokens,b=a.minColumn-1,C=0;for(let y=0,S=h.getCount();y<S;y++)if(!((C=h.getEndOffset(y))<=b)){for(w=h.getMetadata(y),f=b;f<C&&!(f>SI.maxSupportedColumns);f++){if(void 0===(i=d.getSegmentAtIndex(f)))continue;for(l of(u=i,a.isBasicASCII&&t.useMonospaceOptimizations||(c=this.glyphRasterizer.getTextMetrics(u).width),r=void 0,s=void 0,o=void 0,a.inlineDecorations))if(!(g<l.range.startLineNumber)&&!(g>l.range.endLineNumber)&&(g!==l.range.startLineNumber||!(f<l.range.startColumn-1))&&(g!==l.range.endLineNumber||!(f>=l.range.endColumn-1)))for(let e of Sy.decorationCssRuleExtractor.getStyleRules(this._viewGpuContext.canvas.domNode,l.inlineClassName))for(let t of e.style){let i=e.styleMap.get(t)?.toString()??"";switch(t){case"color":{let e=gX.Format.CSS.parse(i);if(!e)throw new o_.he("Invalid color format "+i);r=e.toNumber32Bit();break}case"font-weight":s=function(e){switch(e){case"lighter":case"normal":return 400;case"bolder":case"bold":return 700}return parseInt(e)}(i)>=400;break;case"opacity":o=i.endsWith("%")?parseFloat(i.substring(0,i.length-1))/100:i.match(/^\d+(?:\.\d*)/)?parseFloat(i):1;break;default:throw new o_.he("Unexpected inline decoration style")}}if(" "===u||"	"===u){if(v=((g-1)*SI.maxSupportedColumns+f)*6,x.fill(0,v,v+6),"	"===u){let e=f+_;m+=c*((_=vR.nextRenderTabStop(f+_,a.tabSize))-e),_-=f+1}else m+=c;continue}let h=Sy.decorationStyleCache.getOrCreateEntry(r,s,o);n=this._viewGpuContext.atlas.getGlyph(this.glyphRasterizer,u,w,h,m),p=Math.round(e.relativeVerticalOffset[g-e.startLineNumber]*L+Math.floor((e.lineHeight*L-(n.fontBoundingBoxAscent+n.fontBoundingBoxDescent))/2)+n.fontBoundingBoxAscent),x[(v=((g-1)*SI.maxSupportedColumns+f)*6)+0]=Math.floor(m),x[v+1]=p,x[v+4]=n.glyphIndex,x[v+5]=n.pageIndex,m+=c}b=C}y=((g-1)*SI.maxSupportedColumns+C)*6,S=g*SI.maxSupportedColumns*6,x.fill(0,y,S),N.add(g)}}let I=(e.endLineNumber-e.startLineNumber+1)*k;return(D=Math.min(D,SI.maxSupportedLines))<=(E=Math.min(E,SI.maxSupportedLines))&&this._device.queue.writeBuffer(this._cellBindBuffer,(D-1)*k*Float32Array.BYTES_PER_ELEMENT,x.buffer,(D-1)*k*Float32Array.BYTES_PER_ELEMENT,(E-D+1)*k*Float32Array.BYTES_PER_ELEMENT),this._finalRenderedLine=Math.max(this._finalRenderedLine,E),this._activeDoubleBufferIndex=this._activeDoubleBufferIndex?0:1,this._visibleObjectCount=I,I}draw(e,t){if(this._visibleObjectCount<=0)throw new o_.he("Attempt to draw 0 objects");e.draw(y5.length/2,this._visibleObjectCount,void 0,(t.startLineNumber-1)*SI.maxSupportedColumns)}_queueBufferUpdate(e){this._queuedBufferUpdates[0].push(e),this._queuedBufferUpdates[1].push(e)}}var SM=function(e,t){return function(i,n){t(i,n,e)}};let SR=class extends vg{constructor(e,t,i,n){super(e),this._viewGpuContext=t,this._instantiationService=i,this._logService=n,this._atlasGpuTextureVersions=[],this._initialized=!1,this._glyphRasterizer=this._register(new ro.XK),this._renderStrategy=this._register(new ro.XK),this.canvas=this._viewGpuContext.canvas.domNode,this._register(aN(e=>{this._viewGpuContext.canvasDevicePixelDimensions.read(e);let t=this._lastViewportData;t&&setTimeout(()=>{t===this._lastViewportData&&this.renderText(t)})})),this.initWebgpu()}async initWebgpu(){let e,t;if(this._device=Sy.deviceSync||await Sy.device,this._store.isDisposed)return;let i=Sy.atlas;this._register(i.onDidDeleteGlyphs(()=>{this._atlasGpuTextureVersions.length=0,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._renderStrategy.value.reset()}));
193let n=navigator.gpu.getPreferredCanvasFormat();this._viewGpuContext.ctx.configure({device:this._device,format:n,alphaMode:"premultiplied"}),this._renderPassColorAttachment={view:null,loadOp:"load",storeOp:"store"},this._renderPassDescriptor={label:"Monaco render pass",colorAttachments:[this._renderPassColorAttachment]};{let t=new Float32Array(6),i=(e=this.canvas.width,i=this.canvas.height)=>(t[0]=e,t[1]=i,t[2]=Math.ceil(this._context.configuration.options.get(165).contentLeft*lm().devicePixelRatio),t[3]=0,t[4]=t[0]-t[2],t[5]=t[1]-t[3],t);e=this._register(nh.createBuffer(this._device,{label:"Monaco uniform buffer",size:24,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>i())).object,this._register(SC(this._viewGpuContext.canvasDevicePixelDimensions,({width:t,height:n})=>{this._device.queue.writeBuffer(e,0,i(t,n))})),this._register(SC(this._viewGpuContext.contentLeft,()=>{this._device.queue.writeBuffer(e,0,i())}))}t=this._register(nh.createBuffer(this._device,{label:"Monaco atlas info uniform buffer",size:8,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST},()=>{let e=new Float32Array(2);return e[0]=i.pageSize,e[1]=i.pageSize,e})).object;let s=this._context.configuration.options.get(58),r=this._context.configuration.options.get(61);this._glyphRasterizer.value=this._register(new y3(r,s,this._viewGpuContext.devicePixelRatio.get(),Sy.decorationStyleCache)),this._register(SC(this._viewGpuContext.devicePixelRatio,()=>{this._refreshGlyphRasterizer()})),this._renderStrategy.value=this._instantiationService.createInstance(SI,this._context,this._viewGpuContext,this._device,this._glyphRasterizer),this._glyphStorageBuffer=this._register(nh.createBuffer(this._device,{label:"Monaco glyph storage buffer",size:Sl.maximumPageCount*(24*So.maximumGlyphCount),usage:GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_DST})).object,this._atlasGpuTextureVersions[0]=0,this._atlasGpuTextureVersions[1]=0,this._atlasGpuTexture=this._register(nh.createTexture(this._device,{label:"Monaco atlas texture",format:"rgba8unorm",size:{width:i.pageSize,height:i.pageSize,depthOrArrayLayers:Sl.maximumPageCount},dimension:"2d",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT})).object,this._updateAtlasStorageBufferAndTexture(),this._vertexBuffer=this._register(nh.createBuffer(this._device,{label:"Monaco vertex buffer",size:y5.byteLength,usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST},y5)).object;let o=this._device.createShaderModule({label:"Monaco shader module",code:this._renderStrategy.value.wgsl});if(this._pipeline=this._device.createRenderPipeline({label:"Monaco render pipeline",layout:"auto",vertex:{module:o,buffers:[{arrayStride:2*Float32Array.BYTES_PER_ELEMENT,attributes:[{shaderLocation:0,offset:0,format:"float32x2"}]}]},fragment:{module:o,targets:[{format:n,blend:{color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"},alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha"}}}]}}),this._rebuildBindGroup=()=>{this._bindGroup=this._device.createBindGroup({label:"Monaco bind group",layout:this._pipeline.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:this._glyphStorageBuffer}},{binding:2,resource:this._device.createSampler({label:"Monaco atlas sampler",magFilter:"nearest",minFilter:"nearest"})},{binding:3,resource:this._atlasGpuTexture.createView()},{binding:4,resource:{buffer:e}},{binding:5,resource:{buffer:t}},...this._renderStrategy.value.bindGroupEntries]})},this._rebuildBindGroup(),this._initialized=!0,this._initViewportData){for(let e of this._initViewportData)this.renderText(e);this._initViewportData=void 0}}_refreshRenderStrategy(e){if(this._renderStrategy.value?.type==="viewport"||e.endLineNumber<SI.maxSupportedLines&&this._viewportMaxColumn(e)<SI.maxSupportedColumns)return;this._logService.trace(`File is larger than ${SI.maxSupportedLines} lines or ${SI.maxSupportedColumns} columns, switching to viewport render strategy`);let t=this._instantiationService.createInstance(ST,this._context,this._viewGpuContext,this._device,this._glyphRasterizer);this._renderStrategy.value=t,this._register(t.onDidChangeBindGroupEntries(()=>this._rebuildBindGroup?.())),this._rebuildBindGroup?.()}_viewportMaxColumn(e){let t=0;for(let i=e.startLineNumber;i<=e.endLineNumber;i++)t=Math.max(t,e.getViewLineRenderingData(i).maxColumn);return t}_updateAtlasStorageBufferAndTexture(){for(let[e,t]of Sy.atlas.pages.entries()){if(e>=Sl.maximumPageCount){console.log(`Attempt to upload atlas page [${e}
193], only ${Sl.maximumPageCount} are supported currently`);continue}if(t.version===this._atlasGpuTextureVersions[e])continue;this._logService.trace("Updating atlas page[",e,"] from version ",this._atlasGpuTextureVersions[e]," to version ",t.version);let i=new Float32Array(6*So.maximumGlyphCount),n=0;for(let e of t.glyphs)i[n+0]=e.x,i[n+0+1]=e.y,i[n+2]=e.w,i[n+2+1]=e.h,i[n+4]=e.originOffsetX,i[n+4+1]=e.originOffsetY,n+=6;if(n/6>So.maximumGlyphCount)throw Error(`Attempting to write more glyphs (${n/6}) than the GPUBuffer can hold (${So.maximumGlyphCount})`);this._device.queue.writeBuffer(this._glyphStorageBuffer,6*e*So.maximumGlyphCount*Float32Array.BYTES_PER_ELEMENT,i,0,6*So.maximumGlyphCount),t.usedArea.right-t.usedArea.left>0&&t.usedArea.bottom-t.usedArea.top>0&&this._device.queue.copyExternalImageToTexture({source:t.source},{texture:this._atlasGpuTexture,origin:{x:t.usedArea.left,y:t.usedArea.top,z:e}},{width:t.usedArea.right-t.usedArea.left+1,height:t.usedArea.bottom-t.usedArea.top+1}),this._atlasGpuTextureVersions[e]=t.version}}prepareRender(e){throw new o_.he("Should not be called")}render(e){throw new o_.he("Should not be called")}onConfigurationChanged(e){return this._refreshGlyphRasterizer(),!0}onCursorStateChanged(e){return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onLineMappingChanged(e){return!0}onRevealRangeRequest(e){return!0}onScrollChanged(e){return!0}onThemeChanged(e){return!0}onZonesChanged(e){return!0}_refreshGlyphRasterizer(){let e=this._glyphRasterizer.value;if(!e)return;let t=this._context.configuration.options.get(58),i=this._context.configuration.options.get(61),n=this._viewGpuContext.devicePixelRatio.get();(e.fontFamily!==t||e.fontSize!==i||e.devicePixelRatio!==n)&&(this._glyphRasterizer.value=new y3(i,t,n,Sy.decorationStyleCache))}renderText(e){if(this._initialized)return this._refreshRenderStrategy(e),this._renderText(e);this._initViewportData=this._initViewportData??[],this._initViewportData.push(e)}_renderText(e){this._viewGpuContext.rectangleRenderer.draw(e);let t=new yi(this._context.configuration,this._context.theme.type);this._renderStrategy.value.update(e,t),this._updateAtlasStorageBufferAndTexture();let i=this._device.createCommandEncoder({label:"Monaco command encoder"});this._renderPassColorAttachment.view=this._viewGpuContext.ctx.getCurrentTexture().createView({label:"Monaco canvas texture view"});let n=i.beginRenderPass(this._renderPassDescriptor);n.setPipeline(this._pipeline),n.setVertexBuffer(0,this._vertexBuffer);let s=Math.ceil(this._viewGpuContext.contentLeft.get()*this._viewGpuContext.devicePixelRatio.get());n.setScissorRect(s,0,this.canvas.width-s,this.canvas.height),n.setBindGroup(0,this._bindGroup),this._renderStrategy.value.draw(n,e),n.end();let r=i.finish();this._device.queue.submit([r]),this._lastViewportData=e,this._lastViewLineOptions=t}linesVisibleRangesForRange(e,t){if(!this._lastViewportData)return null;let i=e.endLineNumber,n=s9.intersectRanges(e,this._lastViewportData.visibleRange);if(!n)return null;let s=this._lastViewportData.startLineNumber,r=this._lastViewportData.endLineNumber,o=this._lastViewportData,a=this._lastViewLineOptions;if(!o||!a)return null;let l=[],h=0;t&&(h=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new s3(n.startLineNumber,1)).lineNumber);for(let e=n.startLineNumber;e<=n.endLineNumber;e++){if(e<s||e>r)continue;let o=e===n.startLineNumber?n.startColumn:1,d=e!==i,u=d?this._context.viewModel.getLineMaxColumn(e):n.endColumn,c=this._visibleRangesForLineRange(e,o,u);c&&(t&&e<i&&h!==(h=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new s3(e+1,1)).lineNumber)&&(c.ranges[c.ranges.length-1].width+=a.spaceWidth),l.push(new v_(c.outsideRenderedLine,e,vv.from(c.ranges),d)))}return 0===l.length?null:l}_visibleRangesForLineRange(e,t,i){let n;if(this.shouldRender())return null;let s=this._lastViewportData,r=this._lastViewLineOptions;if(!s||!r||e<s.startLineNumber||e>s.endLineNumber)return null;let o=s.getViewLineRenderingData(e),a=o.content;o.isBasicASCII&&r.useMonospaceOptimizations||(n=Sx(o,r));let l="",h=0,d=0;for(let e=0;e<t-1;e++){if(o.isBasicASCII&&r.useMonospaceOptimizations)l=a.charAt(e);else{if(void 0===(l=n.getSegmentAtIndex(e)))continue;d+=this._renderStrategy.value.glyphRasterizer.getTextMetrics(l).width/lm().devicePixelRatio-r.spaceWi
193dth}"	"===l?h=vR.nextRenderTabStop(h,o.tabSize):h++}let u=h,c=0;for(let e=t-1;e<i-1;e++){if(o.isBasicASCII&&r.useMonospaceOptimizations)l=a.charAt(e);else{if(void 0===(l=n.getSegmentAtIndex(e)))continue;c+=this._renderStrategy.value.glyphRasterizer.getTextMetrics(l).width/lm().devicePixelRatio-r.spaceWidth}"	"===l?u=vR.nextRenderTabStop(u,o.tabSize):u++}return new vw(!1,[new vb(h*r.spaceWidth+d,(u-h)*r.spaceWidth+c)])}visibleRangeForPosition(e){let t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new vC(t.outsideRenderedLine,t.ranges[0].left):null}getLineWidth(e){if(!this._lastViewportData||!this._lastViewLineOptions||!this._viewGpuContext.canRender(this._lastViewLineOptions,this._lastViewportData,e))return;let t=this._lastViewportData.getViewLineRenderingData(e),i=this._visibleRangesForLineRange(e,1,t.maxColumn),n=i?.ranges.at(-1);if(n)return n.width}getPositionAtCoordinate(e,t){if(!this._lastViewportData||!this._lastViewLineOptions||!this._viewGpuContext.canRender(this._lastViewLineOptions,this._lastViewportData,e))return;let i=this._lastViewportData.getViewLineRenderingData(e),n=i.content,s=lm().devicePixelRatio,r=t*s,o=this._lastViewLineOptions.spaceWidth*s,a=Sx(i,this._lastViewLineOptions),l=0,h=0,d=0,u=0;for(let e=0;e<n.length;e++){let t=a.getSegmentAtIndex(e);if(void 0===t){u++;continue}if("	"===t){let t=e+d;h=o*((d=vR.nextRenderTabStop(e+d,i.tabSize))-t),d-=e+1}else h=i.isBasicASCII&&this._lastViewLineOptions.useMonospaceOptimizations?o:this._renderStrategy.value.glyphRasterizer.getTextMetrics(t).width;if(r<l+h/2)break;l+=h,u++}return new s3(e,u+1)}};SR=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([SM(2,he),SM(3,dM)],SR),i(36660);class SA{constructor(){this._onDidChange=new sd.Q5,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}let SO=new SA,SP=ht("keybindingService");class SF extends vg{}class SB{_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t){let i=e*t;return new s9(i+1,1,i+t+1,1)}fromEditorSelection(e,t,i,n){let s,r,o;let a=this._getPageOfLine(t.startLineNumber,i),l=this._getRangeForPage(a,i),h=this._getPageOfLine(t.endLineNumber,i),d=this._getRangeForPage(h,i),u=l.intersectRanges(new s9(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(u,1)>500){let t=e.modifyPosition(u.getEndPosition(),-500);u=s9.fromPositions(t,u.getEndPosition())}let c=e.getValueInRange(u,1),g=e.getLineCount(),f=e.getLineMaxColumn(g),m=d.intersectRanges(new s9(t.endLineNumber,t.endColumn,g,f));if(n&&e.getValueLengthInRange(m,1)>500){let t=e.modifyPosition(m.getStartPosition(),500);m=s9.fromPositions(m.getStartPosition(),t)}let p=e.getValueInRange(m,1);if(a===h||a+1===h)s=e.getValueInRange(t,1);else{let i=l.intersectRanges(t),n=d.intersectRanges(t);s=e.getValueInRange(i,1)+String.fromCharCode(8230)+e.getValueInRange(n,1)}return n&&s.length>1e3&&(s=s.substring(0,500)+String.fromCharCode(8230)+s.substring(s.length-500,s.length)),0===t.getDirection()?(r=c.length,o=c.length+s.length):(o=c.length,r=c.length+s.length),{value:c+s+p,selection:t,selectionStart:r,selectionEnd:o,startPositionWithinEditor:u.getStartPosition(),newlineCountBeforeSelection:u.endLineNumber-u.startLineNumber}}}function SV(e,t){if(1===e.get(2)){let e=t.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode")?.getAriaLabel(),i=t.lookupKeybinding("workbench.action.showCommands")?.getAriaLabel(),n=t.lookupKeybinding("workbench.action.openGlobalKeybindings")?.getAriaLabel(),s=(0,rh.NC)(61,"The editor is not accessible at this time.");return e?(0,rh.NC)(62,"{0} To enable screen reader optimized mode, use {1}",s,e):i?(0,rh.NC)(63,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",s,i):n?(0,rh.NC)(64,"{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",s,n):s}return e.get(8)}function SW(e){let t=0,i=-1;for(;-1!==(i=e.indexOf("\n",i+1));)t++;return t}var SH=function(e,t){return function(i,n){t(i,n,e)}};class Sz{constructor(e,t,i,n,s){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=s,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){let t=new s3(this.modelLineNumber,this.distanceToModelLineStart+1),i=new s3(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}let SU=class extends SF{constructor(e,t,i,n,s,r){super(e),this._keybindingService=s,this._instantiationService=r,this._primaryCursorPosition=new s3(1,1),this._primaryCursorVisibleRange=null,this._viewController=i,this._visibleRangeProvider=n,this._scrollLeft=0,this._scrollTop=0;let o=this._context.configuration.options,a=o.get(165);this._setAccessibilityOptions(o),this._contentLeft=a.contentLeft,this._contentWidth=a.contentWidth,this._contentHeight=a.height,this._fontInfo=o.get(59),this._emptySelectionClipboard=o.get(45),this._copyWithSyntaxHighlighting=o.get(31),this._visibleTextArea=null,this._selections=[new s8(1,1,1,1)],this._modelSelections=[new s8(1,1,1,1)],this._lastRenderPosition=null,this.textArea=l2(document.createElement("textarea")),vf.write(this.textArea,7),this.textArea.setClassName(`inputarea ${ye}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");let{tabSize:l}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${l*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","fal
193se"),this.textArea.setAttribute("aria-label",SV(o,this._keybindingService)),this.textArea.setAttribute("aria-required",o.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.get(140))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",(0,rh.NC)(65,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(104)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=l2(document.createElement("div")),this.textAreaCover.setPosition("absolute"),t.appendChild(this.textArea),t.appendChild(this.textAreaCover);let h=new SB,d=this._register(new by(this.textArea.domNode));this._textAreaInput=this._register(this._instantiationService.createInstance(bw,{getDataToCopy:()=>bg(this._context.viewModel,this._modelSelections,this._emptySelectionClipboard,this._copyWithSyntaxHighlighting),getScreenReaderContent:()=>{if(1===this._accessibilitySupport){let e=this._selections[0];if(sS.dz&&e.isEmpty()){let t=e.getStartPosition(),i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new b_(i,i.length,i.length,s9.fromPositions(t),0)}if(sS.dz&&!e.isEmpty()&&500>this._context.viewModel.getValueLengthInRange(e,0)){let t=this._context.viewModel.getValueInRange(e,0);return new b_(t,0,t.length,e,0)}if(ou&&!e.isEmpty()){let e="vscode-placeholder";return new b_(e,0,e.length,null,void 0)}return b_.EMPTY}if(og){let e=this._selections[0];if(e.isEmpty()){let t=e.getStartPosition(),[i,n]=this._getAndroidWordAtPosition(t);if(i.length>0)return new b_(i,n,n,s9.fromPositions(t),0)}return b_.EMPTY}let e=h.fromEditorSelection(this._context.viewModel,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport);return b_.fromScreenReaderContentState(e)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},d,sS.OS,{isAndroid:og,isChrome:od,isFirefox:ol,isSafari:ou})),this._register(this._textAreaInput.onKeyDown(e=>{this._viewController.emitKeyDown(e)})),this._register(this._textAreaInput.onKeyUp(e=>{this._viewController.emitKeyUp(e)})),this._register(this._textAreaInput.onPaste(e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(e=>{this._viewController.setSelection(e)})),this._register(this._textAreaInput.onCompositionStart(e=>{let t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:s}=(()=>{let e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),s=e.substring(n+1),r=s.lastIndexOf("	"),o=s.length-r-1,a=i.getStartPosition(),l=Math.min(a.column-1,o),h=a.column-1-l,d=s.substring(0,s.length-l),{tabSize:u}=this._context.viewModel.model.getOptions();return{distanceToModelLineStart:h,widthOfHiddenTextBefore:function(e,t,i,n){if(0===t.length)return 0;let s=e.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";let r=e.createElement("span");l5(r,i),r.style.whiteSpace="pre",r.style.tabSize=`${n*i.spaceWidth}px`,r.append(t),s.appendChild(r),e.body.appendChild(s);let o=r.offsetWidth;return s.remove(),o}(this.textArea.domNode.ownerDocument,d,this._fontInfo,u)}})(),{distanceToModelLineEnd:r}=(()=>{let e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),s=-1===n?e:e.substring(0,n),r=s.indexOf("	"),o=-1===r?s.length:s.length-r-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,o);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,s9.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Sz(this._context,i.startLineNumber,n,s,r),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${ye} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(e=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${ye}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(SO.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}get domNode(){return this.textArea}writeScreenReaderContent(e){this._textAreaInput.writeNativeTextAreaContent(e)}dispose(){super.dispose(),this.textArea.domNode.remove(),this.textAreaCover.domNode.remove()}_getAndroidWordAtPosition(e){let t=this._context.viewModel.getLineContent(e.lineNumber),i=cT('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',[]),n=!0,s=e.column,r=!0,o=e.column,a=0;for(;a<50&&(n||r);){if(n&&s<=1&&(n=!1),n){let e=t.charCodeAt(s-2);0!==i.get(e)?n=!1:s--}if(r&&o>t.length&&(r=!1),r){let e=t.charCodeAt(o-1);0!==i.get(e)?r=!1:o++}a++}return[t.substring(s-1,o-1),e.column-s]}_getWordBeforePosition(e){let t=this._context.viewModel.getLineContent(e.lineNumber),i=cT(this._context.configuration.options.get(148),[]),n=e.column,s=0;for(;n>1;){let r=t.charCodeAt(n-2);if(0!==i.get(r)||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){let t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!rq(t.charCodeAt(0)))return t}return""}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);let t=e.get(3);2===this._accessibilitySupport&&t===sh.BH.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;let i=e.get(165).wrappingColumn;if(-1!==i&&1!==this._accessibilitySupport){let t=e.get(59);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(i*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=ol?0:1}onConfigurationChanged(e){let t=this._context.configuration.options,i=t.get(165);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(59),this._emptySelectionClipboard=t.get(45),this._copyWithSyntaxHighlighting=t.get(31),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");let{tabSize:n}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${n*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",SV(t,this._keybindingService)),this.textArea.setAttribute("aria-required",t.get(9)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(14
1930))),(e.hasChanged(41)||e.hasChanged(104))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeNativeTextAreaContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeNativeTextAreaContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focus(){this._textAreaInput.focusTextArea()}refreshFocusState(){this._textAreaInput.refreshFocusState()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){let e=this._context.configuration.options;!SO.enabled||e.get(41)&&e.get(104)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){this._primaryCursorPosition=new s3(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),this._visibleTextArea?.prepareRender(e)}render(e){this._textAreaInput.writeNativeTextAreaContent("render"),this._render()}_render(){if(this._visibleTextArea){let e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){let s=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,r=SW(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart)),o=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(a<this._contentLeft){let e=this._contentLeft-a;a+=e,o+=e,l-=e}l>this._contentWidth&&(l=this._contentWidth);let h=this._context.viewLayout.getLineHeightForLineNumber(i.lineNumber),d=this._context.viewModel.getFontSizeAtPosition(this._primaryCursorPosition),u=this._context.viewModel.getViewLineData(i.lineNumber),c=u.tokens.findTokenIndexAtOffset(i.column-1),g=c===u.tokens.findTokenIndexAtOffset(n.column-1),f=this._visibleTextArea.definePresentation(g?u.tokens.getPresentation(c):null);this.textArea.domNode.scrollTop=r*h,this.textArea.domNode.scrollLeft=o,this._doRender({lastRenderPosition:null,top:s,left:a,width:l,height:h,useCover:!1,color:(rp.getColorMap()||[])[f.foreground],italic:f.italic,bold:f.bold,underline:f.underline,strikethrough:f.strikethrough,fontSize:d})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}let e=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(e<this._contentLeft||e>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}let t=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(t<0||t>this._contentHeight){this._renderAtTopLeft();return}if(sS.dz||2===this._accessibilitySupport){let i=this._primaryCursorPosition.lineNumber,n=this._context.viewLayout.getLineHeightForLineNumber(i);this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:n,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;let s=this._textAreaInput.textAreaState.newlineCountBeforeSelection??SW(this.textArea.domNode.value.substring(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=s*n;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:t,left:this._textAreaWrapping?this._contentLeft:e,width:this._textAreaWidth,height:ol?0:1,useCover:!1})}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:ol?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;let t=this.textArea,i=this.textAreaCover;l5(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setLineHeight(e.height),t.setFontSize(e.fontSize??this._fontInfo.fontSize),t.setColor(e.color?gX.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWi
193dth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);let n=this._context.configuration.options;n.get(66)?i.setClassName("monaco-editor-background textAreaCover "+yl.OUTER_CLASS_NAME):0!==n.get(76).renderType?i.setClassName("monaco-editor-background textAreaCover "+w8.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};SU=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([SH(4,SP),SH(5,he)],SU),i(22473);let SK=class extends ro.JT{constructor(e,t,i){super(),this._domNode=t,this._onFocusChange=i,this._isFocused=!1,this._isPaused=!1,this._register(a6(this._domNode,"focus",()=>{e.trace("NativeEditContext.focus"),this._isPaused||this.refreshFocusState()})),this._register(a6(this._domNode,"blur",()=>{e.trace("NativeEditContext.blur"),this._isPaused||this._handleFocusedChanged(!1)}))}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this.refreshFocusState()}_handleFocusedChanged(e){this._isFocused!==e&&(this._isFocused=e,this._onFocusChange(this._isFocused))}focus(){this._domNode.focus(),this.refreshFocusState()}
193refreshFocusState(){let e=lc(this._domNode),t=e?e.activeElement:lg(),i=this._domNode===t;this._handleFocusedChanged(i)}get isFocused(){return this._isFocused}};function S$(e,t,i,n){return e.addEventListener(t,i,n),{dispose(){e.removeEventListener(t,i)}}}SK=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){dM(e,t,0)}],SK);let Sj=ut("richScreenReaderContent",{createHTML:e=>e}),Sq="data-line-number",SG=class extends ro.JT{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new ro.XK),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._state=SJ.NULL,this._strategy=new SZ,this._renderedLines=new Map,this._renderedSelection=new s8(1,1,1,1),this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){let t=lm().document.activeElement;
193if(t&&t===this._domNode.domNode){if(this._accessibilityService.isScreenReaderOptimized()){let t=this._getScreenReaderContentLineIntervals(e);this._state.equals(t)||(this._state=t,this._renderedLines=this._renderScreenReaderContent(t)),this._renderedSelection.equalsSelection(e)||(this._renderedSelection=e,this._setSelectionOnScreenReaderContent(this._context,this._renderedLines,e))}else this._state=SJ.NULL,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}}updateScrollTop(e){let t=this._state.intervals;if(!t.length)return;let i=this._context.viewModel.viewLayout,n=t[0].startLine,s=i.getVerticalOffsetForLineNumber(n),r=i.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=r-s}onFocusChange(e){e?this._selectionChangeListener.value=this._setSelectionChangeListener():this._selectionChangeListener.value=void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;
193return a6(this._domNode.domNode.ownerDocument,"selectionchange",()=>{if(lm().document.activeElement!==this._domNode.domNode||!this._accessibilityService.isScreenReaderOptimized()||!SO.enabled)return;let t=Date.now(),i=t-e;if(e=t,i<5)return;let n=t-this._ignoreSelectionChangeTime;if(this._ignoreSelectionChangeTime=0,n<100)return;let s=this._getEditorSelectionFromDomRange();s&&this._viewController.setSelection(s)})}_renderScreenReaderContent(e){let t=[],i=new Map;for(let n of e.intervals)for(let e=n.startLine;e<=n.endLine;e++){let n=this._renderLine(e);i.set(e,n),t.push(n.domNode)}return this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.replaceChildren(...t),i}_renderLine(e){let t;let i=this._context.viewModel,n=i.getViewLineRenderingData(e),s=this._context.configuration.options,r=s.get(59),o=s.get(133),a=s.get(108),l=s.get(60),h=s.get(40),d=fE.filter(n.inlineDecorations,e,n.minColumn,n.maxColumn),u=r.isMonospace&&!h,c=l!==sh.n0.OFF;t="off"===s.get(47)?s.get(113):"none";let g=new fA(u,r.canUseHalfwidthRightwardsArrow,n.content,n.continuesWithWrappedLine,n.isBasicASCII,n.containsRTL,n.minColumn-1,n.tokens,d,n.tabSize,n.startVisibleColumn,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,o,t,a,c,null,null,0,!0),f=new um(1e4),m=fB(g,f),p=f.build(),_=Sj?.createHTML(p)??p,v=i.viewLayout.getLineHeightForLineNumber(e)+"px",b=document.createElement("div");return b.innerHTML=_,b.style.lineHeight=v,b.style.height=v,b.setAttribute(Sq,e.toString()),new SQ(b,m.characterMapping)}_setSelectionOnScreenReaderContent(e,t,i){let n=lm().document.getSelection();if(!n)return;let s=i.startLineNumber,r=i.endLineNumber,o=t.get(s),a=t.get(r);if(!o||!a)return;let l=e.viewModel,h=l.model,d=l.coordinatesConverter,u=new s9(s,1,s,i.selectionStartColumn),c=d.convertViewRangeToModelRange(u),g=h.getCharacterCountInRange(c),f=new s9(r,1,r,i.positionColumn),m=d.convertViewRangeToModelRange(f),p=h.getCharacterCountInRange(m),_=o.characterMapping.getDomPosition(g),v=a.characterMapping.getDomPosition(p),b=o.domNode.firstChild,C=a.domNode.firstChild,w=b.childNodes,y=C.childNodes,S=w.item(_.partIndex),L=y.item(v.partIndex);S.firstChild&&L.firstChild&&(this._setIgnoreSelectionChangeTime("setRange"),n.setBaseAndExtent(S.firstChild,1===i.startColumn?0:_.charIndex+1,L.firstChild,1===i.endColumn?0:v.charIndex+1))}_getScreenReaderContentLineIntervals(e){return this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize)}
193_getEditorSelectionFromDomRange(){if(!this._renderedLines)return;let e=lm().document.getSelection();if(!e||0===e.rangeCount)return;let t=e.getRangeAt(0),i=t.startContainer,n=t.endContainer,s=i.parentElement,r=n.parentElement;if(!s||!l_(s)||!r||!l_(r))return;let o=s.parentElement?.parentElement,a=r.parentElement?.parentElement;if(!o||!a)return;let l=o.getAttribute(Sq),h=a.getAttribute(Sq);if(!l||!h)return;let d=parseInt(l),u=parseInt(h),c=this._renderedLines.get(d)?.characterMapping,g=this._renderedLines.get(u)?.characterMapping;if(!c||!g)return;let f=vM(c,s,t.startOffset),m=vM(g,r,t.endOffset);return"forward"===e.direction?new s8(d,f,u,m):new s8(u,m,d,f)}};SG=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){mg(e,t,3)}],SG);class SQ{constructor(e,t){this.domNode=e,this.characterMapping=t}}class SY{constructor(e,t){this.startLine=e,this.endLine=t}}class SJ{constructor(e,t){this.intervals=t;let i="";for(let n of t)for(let t=n.startLine;t<=n.endLine;t++)i+=e.getLineContent(t)+"\n";this.value=i}equals(e){return this.value===e.value}static get NULL(){return new SJ({getLineContent:()=>"",getLineCount:()=>1,getLineMaxColumn:()=>1,getValueInRange:()=>"",getValueLengthInRange:()=>0,modifyPosition:(e,t)=>e},[])}}class SZ{constructor(){}_getPageOfLine(e,t){return Math.floor((e-1)/t)}_getRangeForPage(e,t,i){let n=t*i,s=Math.min(n+i,e.getLineCount());return new SY(n+1,s)}fromEditorSelection(e,t,i){let n=this._getPageOfLine(t.startLineNumber,i),s=this._getRangeForPage(e,n,i),r=this._getPageOfLine(t.endLineNumber,i),o=this._getRangeForPage(e,r,i),a=[{startLine:s.startLine,endLine:s.endLine}];return n+1<r&&a.push({startLine:o.startLine,endLine:o.endLine}),new SJ(e,a)}}class SX{constructor(e){this.replacements=e;let t=-1;for(let i of e){if(!(i.replaceRange.start>=t))throw new o_.he(`Edits must be disjoint and sorted. Found ${i} after ${t}`);t=i.replaceRange.endExclusive}}toString(){let e=this.replacements.map(e=>e.toString()).join(", ");return`[${e}]`}normalize(){let e;let t=[];for(let i of this.replacements)if(0!==i.getNewLength()||0!==i.replaceRange.length){if(e&&e.replaceRange.endExclusive===i.replaceRange.start){let t=e.tryJoinTouching(i);if(t){e=t;continue}}e&&t.push(e),e=i}return e&&t.push(e),this._createNew(t)}compose(e){let t=this.normalize(),i=e.normalize();if(t.isEmpty())return i;if(i.isEmpty())return t;let n=[...t.replacements],s=[],r=0;for(let e of i.replacements){let t,i;for(;;){let t=n[0];if(!t||t.replaceRange.start+r+t.getNewLength()>=e.replaceRange.start)break;n.shift(),s.push(t),r+=t.getNewLength()-t.replaceRange.length}let o=r;for(;;){let s=n[0];if(!s||s.replaceRange.start+r>e.replaceRange.endExclusive)break;t||(t=s),i=s,n.shift(),r+=s.getNewLength()-s.replaceRange.length}if(t){let a=Math.min(t.replaceRange.start,e.replaceRange.start-o),l=e.replaceRange.start-(t.replaceRange.start+o);if(l>0){let e=t.slice(cQ.emptyAt(a),new cQ(0,l));s.push(e)}if(!i)throw new o_.he("Invariant violation: lastIntersecting is undefined");let h=i.replaceRange.endExclusive+r-e.replaceRange.endExclusive;if(h>0){let e=i.slice(cQ.ofStartAndLength(i.replaceRange.endExclusive,0),new cQ(i.getNewLength()-h,i.getNewLength()));n.unshift(e),r-=e.getNewLength()-e.replaceRange.length}let d=new cQ(a,e.replaceRange.endExclusive-r),u=e.slice(d,new cQ(0,e.getNewLength()));s.push(u)}else s.push(e.delta(-r))}for(;;){let e=n.shift();if(!e)break;s.push(e)}return this._createNew(s).normalize()}getNewRanges(){let e=[],t=0;for(let i of this.replacements)e.push(cQ.ofStartAndLength(i.replaceRange.start+t,i.getNewLength())),t+=i.getLengthDelta();return e}isEmpty(){return 0===this.replacements.length}}class S1{constructor(e){this.replaceRange=e}delta(e){return this.slice(this.replaceRange.delta(e),new cQ(0,this.getNewLength()))}getLengthDelta(){return this.getNewLength()-this.replaceRange.length}toString(){return`{ ${this.replaceRange.toString()} -> ${this.getNewLength()} }`}get isEmpty(){return 0===this.getNewLength()&&0===this.replaceRange.length}getRangeAfterReplace(){return new cQ(this.replaceRange.start,this.replaceRange.start+this.getNewLength())}}class S0 extends SX{apply(e){let t=[],i=0;for(let n of this.replacements)t.push(e.substring(i,n.replaceRange.start)),t.push(n.newText),i=n.replaceRange.endExclusive;return t.push(e.substring(i)),t.join("")}}class S2 extends S1{constructor(e,t){super(e),this.newText=t}getNewLength(){return this.newText.length}toString(){return`${this.replaceRange} -> ${JSON.stringify(this.newText)}`}replace(e){return e.substring(0,this.replaceRange.start)+this.newText+e.substring(this.replaceRange.endExclusive)}
193removeCommonSuffixPrefix(e){let t=e.substring(this.replaceRange.start,this.replaceRange.endExclusive),i=r$(t,this.newText),n=Math.min(t.length-i,this.newText.length-i,rj(t,this.newText));return new S4(new cQ(this.replaceRange.start+i,this.replaceRange.endExclusive-n),this.newText.substring(i,this.newText.length-n))}removeCommonSuffixAndPrefix(e){return this.removeCommonSuffix(e).removeCommonPrefix(e)}removeCommonPrefix(e){let t=r$(this.replaceRange.substring(e),this.newText);return 0===t?this:this.slice(this.replaceRange.deltaStart(t),new cQ(t,this.newText.length))}removeCommonSuffix(e){let t=rj(this.replaceRange.substring(e),this.newText);return 0===t?this:this.slice(this.replaceRange.deltaEnd(-t),new cQ(0,this.newText.length-t))}toJson(){return{txt:this.newText,pos:this.replaceRange.start,len:this.replaceRange.length}}}class S5 extends S0{static{this.empty=new S5([])}static compose(e){if(0===e.length)return S5.empty;let t=e[0];for(let i=1;i<e.length;i++)t=t.compose(e[i]);return t}constructor(e){super(e)}_createNew(e){return new S5(e)}}class S4 extends S2{static insert(e,t){return new S4(cQ.emptyAt(e),t)}static replace(e,t){return new S4(e,t)}equals(e){return this.replaceRange.equals(e.replaceRange)&&this.newText===e.newText}tryJoinTouching(e){return new S4(this.replaceRange.joinRightTouching(e.replaceRange),this.newText+e.newText)}slice(e,t){return new S4(e,t?t.substring(this.newText):this.newText)}}e3={StringEdit:S5,StringReplacement:S4,TextReplacement:gs,TextEdit:gn,TextLength:c6},c3._deps=e3;let S6=class extends ro.JT{constructor(e,t,i,n){super(),this._domNode=e,this._context=t,this._viewController=i,this._accessibilityService=n,this._selectionChangeListener=this._register(new ro.XK),this._accessibilityPageSize=1,this._ignoreSelectionChangeTime=0,this._strategy=new SB,this.onConfigurationChanged(this._context.configuration.options)}updateScreenReaderContent(e){let t=this._domNode.domNode,i=lm().document.activeElement;if(i&&i===t){if(this._accessibilityService.isScreenReaderOptimized()){this._state=this._getScreenReaderContentState(e),t.textContent!==this._state.value&&(this._setIgnoreSelectionChangeTime("setValue"),t.textContent=this._state.value);let i=lm().document.getSelection();if(!i)return;let n=this._getScreenReaderRange(this._state.selectionStart,this._state.selectionEnd);if(!n)return;this._setIgnoreSelectionChangeTime("setRange"),i.setBaseAndExtent(n.anchorNode,n.anchorOffset,n.focusNode,n.focusOffset)}else this._state=void 0,this._setIgnoreSelectionChangeTime("setValue"),this._domNode.domNode.textContent=""}}updateScrollTop(e){if(!this._state)return;let t=this._context.viewModel.viewLayout,i=this._state.startPositionWithinEditor.lineNumber,n=t.getVerticalOffsetForLineNumber(i),s=t.getVerticalOffsetForLineNumber(e.positionLineNumber);this._domNode.domNode.scrollTop=s-n}onFocusChange(e){e?this._selectionChangeListener.value=this._setSelectionChangeListener():this._selectionChangeListener.value=void 0}onConfigurationChanged(e){this._accessibilityPageSize=e.get(3)}onWillCut(){this._setIgnoreSelectionChangeTime("onCut")}onWillPaste(){this._setIgnoreSelectionChangeTime("onWillPaste")}_setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}_setSelectionChangeListener(){let e=0;
193return a6(this._domNode.domNode.ownerDocument,"selectionchange",()=>{let t=this._accessibilityService.isScreenReaderOptimized();if(!this._state||!t||!SO.enabled||lm().document.activeElement!==this._domNode.domNode)return;let i=lm().document.getSelection();if(!i||0===i.rangeCount)return;let n=i.getRangeAt(0),s=Date.now(),r=s-e;if(e=s,r<5)return;let o=s-this._ignoreSelectionChangeTime;this._ignoreSelectionChangeTime=0,o<100||this._viewController.setSelection(this._getEditorSelectionFromDomRange(this._context,this._state,i.direction,n))})}_getScreenReaderContentState(e){let t=this._strategy.fromEditorSelection(this._context.viewModel,e,this._accessibilityPageSize,0===this._accessibilityService.getAccessibilitySupport()),i=this._context.viewModel.model.getPositionAt(1/0),n=t.value;return 1===i.column&&e.getEndPosition().equals(i)&&(n+="\n"),t.value=n,t}_getScreenReaderRange(e,t){let i=this._domNode.domNode.firstChild;if(!i)return;let n=new globalThis.Range;return n.setStart(i,e),n.setEnd(i,t),{anchorNode:i,anchorOffset:e,focusNode:i,focusOffset:t}}_getEditorSelectionFromDomRange(e,t,i,n){let s=e.viewModel,r=s.model,o=s.coordinatesConverter.convertViewPositionToModelPosition(t.startPositionWithinEditor),a=r.getOffsetAt(o),l=n.startOffset+a,h=n.endOffset+a;if(1===r.getEndOfLineSequence()){let e=new c9(t.value),i=e.getPosition(n.startOffset),s=e.getPosition(n.endOffset);l+=i.lineNumber-1,h+=s.lineNumber-1}let d=r.getPositionAt(l),u=r.getPositionAt(h),c="forward"===i?d:u,g="forward"===i?u:d;return s8.fromPositions(c,g)}};S6=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){mg(e,t,3)}],S6);var S7=function(e,t){return function(i,n){t(i,n,e)}};let S3=class extends ro.JT{constructor(e,t,i,n,s){super(),this._domNode=e,this._context=t,this._viewController=i,this._keybindingService=n,this._accessibilityService=s,this._contentLeft=1,this._contentWidth=1,this._contentHeight=1,this._divWidth=1,this._primarySelection=new s8(1,1,1,1),this._primaryCursorVisibleRange=null,this._state=this._register(new ro.XK),this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes()}onWillPaste(){this._state.value?.onWillPaste()}onWillCut(){this._state.value?.onWillCut()}handleFocusChange(e){this._state.value?.onFocusChange(e),this.writeScreenReaderContent()}onConfigurationChanged(e){this._instantiateScreenReaderContent(),this._updateConfigurationSettings(),this._updateDomAttributes(),e.hasChanged(2)&&this.writeScreenReaderContent()}_instantiateScreenReaderContent(){let e=this._context.configuration.options.get(107);this._renderRichContent!==e&&(this._renderRichContent=e,this._state.value=this._createScreenReaderContent(e))}_createScreenReaderContent(e){return e?new SG(this._domNode,this._context,this._viewController,this._accessibilityService):new S6(this._domNo
193de,this._context,this._viewController,this._accessibilityService)}_updateConfigurationSettings(){let e=this._context.configuration.options,t=e.get(165),i=t.wrappingColumn;this._contentLeft=t.contentLeft,this._contentWidth=t.contentWidth,this._contentHeight=t.height,this._fontInfo=e.get(59),this._divWidth=Math.round(i*this._fontInfo.typicalHalfwidthCharacterWidth),this._state.value?.onConfigurationChanged(e)}_updateDomAttributes(){let e=this._context.configuration.options;this._domNode.domNode.setAttribute("role","textbox"),this._domNode.domNode.setAttribute("aria-required",e.get(9)?"true":"false"),this._domNode.domNode.setAttribute("aria-multiline","true"),this._domNode.domNode.setAttribute("aria-autocomplete",e.get(104)?"none":"both"),this._domNode.domNode.setAttribute("aria-roledescription",(0,rh.NC)(60,"editor")),this._domNode.domNode.setAttribute("aria-label",SV(e,this._keybindingService));let t=this._context.viewModel.model.getOptions().tabSize,i=e.get(59).spaceWidth;this._domNode.domNode.style.tabSize=`${t*i}px`;let n=e.get(154),s="inherit"===n?e.get(153):n,r="inherit"===s?e.get(149):s;this._domNode.domNode.style.textWrap="off"===r?"nowrap":"wrap"}onCursorStateChanged(e){this._primarySelection=e.selections[0]??new s8(1,1,1,1)}prepareRender(e){this.writeScreenReaderContent(),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primarySelection.getPosition())}render(e){if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}let t=this._context.viewLayout.getCurrentScrollLeft(),i=this._contentLeft+this._primaryCursorVisibleRange.left-t;if(i<this._contentLeft||i>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}let n=this._context.viewLayout.getCurrentScrollTop(),s=this._primarySelection.positionLineNumber,r=this._context.viewLayout.getVerticalOffsetForLineNumber(s)-n;if(r<0||r>this._contentHeight){this._renderAtTopLeft();return}let o=this._context.viewLayout.getLineHeightForLineNumber(s);this._doRender(r,this._contentLeft,this._divWidth,o),this._state.value?.updateScrollTop(this._primarySelection)}_renderAtTopLeft(){this._doRender(0,0,this._contentWidth,1)}
193_doRender(e,t,i,n){l5(this._domNode,this._fontInfo),this._domNode.setTop(e),this._domNode.setLeft(t),this._domNode.setWidth(i),this._domNode.setHeight(n),this._domNode.setLineHeight(n)}setAriaOptions(e){e.activeDescendant?(this._domNode.setAttribute("aria-haspopup","true"),this._domNode.setAttribute("aria-autocomplete","list"),this._domNode.setAttribute("aria-activedescendant",e.activeDescendant)):(this._domNode.setAttribute("aria-haspopup","false"),this._domNode.setAttribute("aria-autocomplete","both"),this._domNode.removeAttribute("aria-activedescendant")),e.role&&this._domNode.setAttribute("role",e.role)}writeScreenReaderContent(){this._state.value?.updateScreenReaderContent(this._primarySelection)}};S3=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([S7(3,SP),S7(4,mg)],S3),(nu||(nu={})).create=function(e,t){return new e.EditContext(t)};class S9{constructor(){this._nativeEditContextMapping=new Map}register(e,t){return this._nativeEditContextMapping.set(e,t),{dispose:()=>{this._nativeEditContextMapping.delete(e)}}}get(e){return this._nativeEditContextMapping.get(e)}}let S8=new S9;var Le=function(e,t){return function(i,n){t(i,n,e)}};(e9=nc||(nc={})).NONE="edit-context-composition-none",e9.SECONDARY="edit-context-composition-secondary",e9.PRIMARY="edit-context-composition-primary";let Lt=class extends SF{constructor(e,t,i,n,s,r,o){let a;super(t),this._viewController=n,this._visibleRangeProvider=s,this.logService=o,this._previousEditContextSelection=new cQ(0,0),this._editContextPrimarySelection=new s8(1,1,1,1),this._decorations=[],this._primarySelection=new s8(1,1,1,1),this._targetWindowId=-1,this._scrollTop=0,this._scrollLeft=0,this._linesVisibleRanges=null,this.domNode=new l1(document.createElement("div")),this.domNode.setClassName("native-edit-context"),this._imeTextArea=new l1(document.createElement("textarea")),this._imeTextArea.setClassName("ime-text-area"),this._imeTextArea.setAttribute("readonly","true"),this._imeTextArea.setAttribute("tabindex","-1"),this._imeTextArea.setAttribute("aria-hidden","true"),this.domNode.setAttribute("autocorrect","off"),this.domNode.setAttribute("autocapitalize","off"),this.domNode.setAttribute("autocomplete","off"),this.domNode.setAttribute("spellcheck","false"),this._updateDomAttributes(),i.appendChild(this.domNode),i.appendChild(this._imeTextArea),this._parent=i.domNode,this._focusTracker=this._register(new SK(o,this.domNode.domNode,e=>{o.trace("NativeEditContext#handleFocusChange : ",e),this._screenReaderSupport.handleFocusChange(e),this._context.viewModel.setHasFocus(e)}));let l=aG(this.domNode.domNode);this._editContext=nu.create(l),this.setEditContextOnDomNode(),this._screenReaderSupport=this._register(r.createInstance(S3,this.domNode,t,this._viewController)),this._register(a6(this.domNode.domNode,"copy",e=>{this.logService.trace("NativeEditContext#copy"),this._ensureClipboardGetsEditorSelection(e)})),this._register(a6(this.domNode.domNode,"cut",e=>{this.logService.trace("NativeEditContext#cut"),this._screenReaderSupport.onWillCut(),this._ensureClipboardGetsEditorSelection(e),this.logService.trace("NativeEditContext#cut (before viewController.cut)"),this._viewController.cut()})),this._register(a6(this.domNode.domNode,"keyup",e=>this._onKeyUp(e))),this._register(a6(this.domNode.domNode,"keydown",async e=>this._onKeyDown(e))),this._register(a6(this._imeTextArea.domNode,"keyup",e=>this._onKeyUp(e))),this._register(a6(this._imeTextArea.domNode,"keydown",async e=>this._onKeyDown(e))),this._register(a6(this.domNode.domNode,"beforeinput",async e=>{("insertParagraph"===e.inputType||"insertLineBreak"===e.inputType)&&this._onType(this._viewController,{text:"\n",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0})})),this._register(a6(this.domNode.domNode,"paste",e=>{if(this.logService.trace("NativeEditContext#paste"),e.preventDefault(),!e.clipboardData)return;let[t,i]=bp.getTextData(e.clipboardData);if(this.logService.trace("NativeEditContext#paste with id : ",i?.id," with text.length: ",t.length),!t)return;i=i||bf.INSTANCE.get(t);let n=!1,s=null,r=null;i&&(n=this._context.configuration.options.get(45)&&!!i.isFromEmptySelection,s=void 0!==i.multicursorText?i.multicursorText:null,r=i.mode),this.logService.trace("NativeEditContext#paste (before viewController.paste)"),this._viewController.paste(t,n,s,r)})),this._register(S$(this._editContext,"textformatupdate",e=>this._handleTextFormatUpdate(e))),this._register(S$(this._editContext,"characterboun
193dsupdate",e=>this._updateCharacterBounds(e))),this._register(S$(this._editContext,"textupdate",e=>{let t=e.text;if(1===t.length){let i=t.charCodeAt(0);if(rq(i)){a=t;return}if(rG(i)&&a){let i={text:a+t,selectionEnd:e.selectionEnd,selectionStart:e.selectionStart,updateRangeStart:e.updateRangeStart-1,updateRangeEnd:e.updateRangeEnd-1};a=void 0,this._emitTypeEvent(this._viewController,i);return}}this._emitTypeEvent(this._viewController,e)})),this._register(S$(this._editContext,"compositionstart",e=>{this._updateEditContext(),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(S$(this._editContext,"compositionend",e=>{this._updateEditContext(),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()}));let h=!1;this._register(SO.onDidChange(()=>{SO.enabled&&h&&(this._focusTracker.resume(),this.domNode.focus(),h=!1),!SO.enabled&&this.isFocused()&&(this._focusTracker.pause(),this._imeTextArea.focus(),h=!0)})),this._register(S8.register(e,this))}dispose(){this.domNode.domNode.editContext=void 0,this.domNode.domNode.blur(),this.domNode.domNode.remove(),this._imeTextArea.domNode.remove(),super.dispose()}setAriaOptions(e){this._screenReaderSupport.setAriaOptions(e)}getLastRenderData(){return this._primarySelection.getPosition()}prepareRender(e){this._screenReaderSupport.prepareRender(e),this._updateSelectionAndControlBoundsData(e)}onDidRender(){this._updateSelectionAndControlBoundsAfterRender()}render(e){this._screenReaderSupport.render(e)}onCursorStateChanged(e){return this._primarySelection=e.modelSelections[0]??new s8(1,1,1,1),this._screenReaderSupport.onCursorStateChanged(e),this._updateEditContext(),!0}onConfigurationChanged(e){return this._screenReaderSupport.onConfigurationChanged(e),this._updateDomAttributes(),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.fromLineNumber+e.count-1),!0}onLinesDeleted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}onLinesInserted(e){return this._updateEditContextOnLineChange(e.fromLineNumber,e.toLineNumber),!0}_updateEditContextOnLineChange(e,t){this._editContextPrimarySelection.endLineNumber<e||this._editContextPrimarySelection.startLineNumber>t||this._updateEditContext()}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}onWillPaste(){this.logService.trace("NativeEditContext#onWillPaste"),this._onWillPaste()}_onWillPaste(){this._screenReaderSupport.onWillPaste()}onWillCopy(){this.logService.trace("NativeEditContext#onWillCopy"),this.logService.trace("NativeEditContext#isFocused : ",this.domNode.domNode===lg())}writeScreenReaderContent(){this._screenReaderSupport.writeScreenReaderContent()}isFocused(){return this._focusTracker.isFocused}focus(){this._focusTracker.focus(),this.refreshFocusState()}refreshFocusState(){this._focusTracker.refreshFocusState()}setEditContextOnDomNode(){let e=aZ(aG(this.domNode.domNode));this._targetWindowId!==e&&(this.domNode.domNode.editContext=this._editContext,this._targetWindowId=e)}_onKeyUp(e){this._viewController.emitKeyUp(new ok(e))}_onKeyDown(e){let t=new ok(e);114===t.keyCode&&t.stopPropagation(),this._viewController.emitKeyDown(t)}_updateDomAttributes(){let e=this._context.configuration.options;this.domNode.domNode.setAttribute("tabindex",String(e.get(140)))}_updateEditContext(){let e=this._getNewEditContextState();e&&(this._editContext.updateText(0,Number.MAX_SAFE_INTEGER,e.text??" "),this._editContext.updateSelection(e.selectionStartOffset,e.selectionEndOffset),this._editContextPrimarySelection=e.editContextPrimarySelection,this._previousEditContextSelection=new cQ(e.selectionStartOffset,e.selectionEndOffset))}_emitTypeEvent(e,t){if(!this._editContext)return;let i=this._previousEditContextSelection.endExclusive,n=this._previousEditContextSelection.start;this._previousEditContextSelection=new cQ(t.selectionStart,t.selectionEnd);let s=0,r=0;t.updateRangeEnd>i&&(s=t.updateRangeEnd-i),t.updateRangeStart<n&&(r=n-t.updateRangeStart);let o="";n<t.updateRangeStart&&(o+=this._editContext.text.substring(n,t.updateRangeStart)),o+=t.text,i>t.updateRangeEnd&&(o+=this._editContext.text.substring(t.updateRangeEnd,i));let a=0;t.selectionStart===t.selectionEnd&&n===i&&(a=t.selectionStart-(t.updateRangeStart+t.text.length));let l={text:o,replacePrevCharCnt:r,replaceNextCharCnt:s,positionDelta:a};this._onType(e,l)}_onType(e,t){t.replacePrevCharCnt||t.replaceNextCharCnt||t.positionDelta?e.compositionType(t.text,t.replacePrevCharCnt,t.replaceNextCharCnt,t.positionDelta):e.type(t.text)}_getNewEditContextState(){let e=this._primarySelection,t=this._context.viewModel.model;if(!t.isValidRange(e))return;let i=e.startLineNumber,n=e.endLineNumber,s=t.getLineMaxColumn(n),r=new s9(i,1,n,s),o=t.getValueInRange(r,0),a=e.startColumn-1,l=o.length+e.endColumn-s;return{text:o,selectionStartOffset:a,selectionEndOffset:l,editContextPrimarySelection:e}}_editContextStartPosition(){return new s3(this._editContextPrimarySelection.startLineNumber,1)}_handleTextFormatUpdate(e){if(!this._editContext)return;let t=e.getTextFormats(),i=this._editContextStartPosition(),n=[];
193t.forEach(e=>{let t=this._context.viewModel.model,s=t.getOffsetAt(i),r=t.getPositionAt(s+e.rangeStart),o=t.getPositionAt(s+e.rangeEnd),a=s9.fromPositions(r,o),l=e.underlineThickness.toLowerCase(),h=nc.NONE;switch(l){case"thin":h=nc.SECONDARY;break;case"thick":h=nc.PRIMARY}n.push({range:a,options:{description:"textFormatDecoration",inlineClassName:h}})}),this._decorations=this._context.viewModel.model.deltaDecorations(this._decorations,n)}_updateSelectionAndControlBoundsData(e){let t=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection);if(this._primarySelection.isEmpty()){let i=e.visibleRangeForPosition(t.getStartPosition());this._linesVisibleRanges=i}else this._linesVisibleRanges=null}_updateSelectionAndControlBoundsAfterRender(){let e;let t=this._context.configuration.options.get(165).contentLeft,i=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(this._primarySelection),n=this._context.viewLayout.getVerticalOffsetForLineNumber(i.startLineNumber),s=this._context.viewLayout.getVerticalOffsetAfterLineNumber(i.endLineNumber),r=this._parent.getBoundingClientRect(),o=r.top+n-this._scrollTop,a=r.left+t-this._scrollLeft;this._primarySelection.isEmpty()?(this._linesVisibleRanges&&(a+=this._linesVisibleRanges.left),e=0):e=r.width-t;let l=new DOMRect(a,o,e,s-n);this._editContext.updateSelectionBounds(l),this._editContext.updateControlBounds(l)}_updateCharacterBounds(e){let t=this._context.configuration.options,i=t.get(59).typicalHalfwidthCharacterWidth,n=t.get(165).contentLeft,s=this._parent.getBoundingClientRect(),r=[],o=new c9(this._editContext.text);for(let t=e.rangeStart;t<e.rangeEnd;t++){let e=o.getPosition(t),a=new s3(this._editContextPrimarySelection.startLineNumber-1+e.lineNumber,e.column),l=a.delta(0,1),h=s9.fromPositions(a,l),d=this._context.viewModel.coordinatesConverter.convertModelRangeToViewRange(h),u=this._visibleRangeProvider.linesVisibleRangesForRange(d,!0)??[],c=d.startLineNumber,g=this._context.viewLayout.getVerticalOffsetForLineNumber(c),f=s.top+g-this._scrollTop,m=0,p=i;if(u.length>0)for(let e of u[0].ranges){m=e.left,p=e.width;break}let _=this._context.viewLayout.getLineHeightForLineNumber(c);r.push(new DOMRect(s.left+n+m-this._scrollLeft,f,p,_))}this._editContext.updateCharacterBounds(e.rangeStart,r)}_ensureClipboardGetsEditorSelection(e){let t;let i=this._context.configuration.options,n=i.get(45),s=i.get(31),r=this._context.viewModel.getCursorStates().map(e=>e.modelState.selection),o=bg(this._context.viewModel,r,n,s);this.logService.getLevel()===iq.Trace&&(t=bv());let a={version:1,id:t,isFromEmptySelection:o.isFromEmptySelection,multicursorText:o.multicursorText,mode:o.mode};bf.INSTANCE.set(ol?o.text.replace(/\r\n/g,"\n"):o.text,a),e.preventDefault(),e.clipboardData&&bp.setTextData(e.clipboardData,o.text,o.html,a),this.logService.trace("NativeEditContext#_ensureClipboardGetsEditorSelectios with id : ",t," with text.length: ",o.text.length)}};Lt=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Le(5,he),Le(6,dM)],Lt);class Li extends vg{constructor(e,t){super(e),this._viewGpuContext=t,this._gpuShapes=[],this._register(aN(e=>this._updateEntries(e)))}onConfigurationChanged(e){return this._updateEntries(void 0),!0}prepareRender(e){}render(e){}_updateEntries(e){let t=this._context.configuration.options,i=t.get(116),n=t.get(59).typicalHalfwidthCharacterWidth,s=this._viewGpuContext.devicePixelRatio.read(e);for(let e=0,t=i.length;e<t;e++){let t=i[e],r=this._gpuShapes[e],o=t.color?gX.fromHex(t.color):this._context.theme.getColor(w_)??gX.white,a=[t.column*n*s,0,Math.max(1,Math.ceil(s)),Number.MAX_SAFE_INTEGER,o.rgba.r/255,o.rgba.g/255,o.rgba.b/255,o.rgba.a];r?r.setRaw(a):this._gpuShapes[e]=this._viewGpuContext.rectangleRenderer.register(...a)}for(;this._gpuShapes.length>i.length;)this._gpuShapes.splice(-1,1)[0].dispose()}}i(55689);class Ln extends Cq{static{this.CLASS_NAME="gpu-mark"}constructor(e,t){super(),this._viewGpuContext=t,this._context=e,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return!0}onCursorStateChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}onDecorationsChanged(e){return!0}prepareRender(e){let t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=e.viewportData,s=new yi(this._context.configuration,this._context.theme.type),r=[];for(let e=t;e<=i;e++){let i=e-t,o=this._viewGpuContext.canRenderDetailed(s,n,e);r[i]=o.length?`<div class="${Ln.CLASS_NAME}" title="Cannot render on GPU: ${o.join(", ")}"></div>`:""}this._renderResult=r}render(e,t){if(!this._renderResult)return"";let i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}let Ls=class extends vc{constructor(e,t,i,n,s,r,o,a,l){super(),this._instantiationService=l,this._shouldRecomputeGlyphMarginLanes=!1,this._ownerID=t,this._widgetFocusTracker=this._register(new La(e,a)),this._register(this._widgetFocusTracker.onChange(()=>{this._context.viewModel.setHasWidgetFocus(this._widgetFocusTracker.hasFocus())})),this._selections=[new s8(1,1,1,1)],this._renderAnimationFrame=null,this._overflowGuardContainer=l2(document.createElement("div")),vf.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._viewController=new CI(n,r,o,i),this._context=new y2(n,s,r),this._context.addEventHandler(this),this._viewParts=[],this._editContextEnabled=this._context.configuration.options.get(170),this._accessibilitySupport=this._context.configuration.options.get(2),this._editContext=this._instantiateEditContext(),this._viewParts.push(this._editContext),this._linesContent=l2(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=l2(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),"on"===this._context.configuration.options.get(46)&&(this._viewGpuContext=this._instantiationService.createInstance(Sy,this._context)),this._scrollbar=new wq(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new yo(this._context,this._viewGpuContext,this._linesContent),this._viewGpuContext&&(this._viewLinesGpu=this._instantiationService.createInstance(SR,this._context,this._viewGpuContext)),this._viewZones=new yJ(this._context),this._viewParts.push(this._viewZones);let h=new yA(this._context);this._viewParts.push(h);let d=new yW(this._context);this._viewParts.push(d);let u=new CF(this._context);this._viewParts.push(u),u.addDynamicOverlay(new wK(this._context)),u.addDynamicOverlay(new y$(this._context)),u.addDynamicOverlay(new w3(this._context)),u.addDynamicOverlay(new wj(this._context)),u.addDynamicOverlay(new yZ(this._context));let c=new CB(this._context);this._viewParts.push(c),c.addDynamicOverlay(new w$(this._context)),c.addDynamicOverlay(new yh(this._context)),c.addDynamicOverlay(new ya(this._context)),c.addDynamicOverlay(new w8(this._context)),this._viewGpuContext&&c.addDynamicOverlay(new Ln(this._context,this._viewGpuContext)),this._glyphMarginWidgets=new wZ(this._context),this._viewParts.push(this._glyphMarginWidgets);let g=new yl(this._context);g.getDomNode().appendChild(this._viewZones.marginDomNode),g.getDomNode().appendChild(c.getDomNode()),g.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(g),this._contentWidgets=new CH(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new yQ(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new yM(this._context,this.domNode),this._viewParts.push(this._overlayWidgets);let f=this._viewGpuContext?new Li(this._context,this._viewGpuContext):new yV(this._context);this._viewParts.push(f);let m=new CW(this._context);this._viewParts.push(m);let p=new yE(this._context);if(this._viewParts.push(p),h){let e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(h.getDomNode(),e.insertBefore)}this._linesContent.appendChild(u.getDomNode()),"domNode"in f&&this._linesContent.appendChild(f.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(g.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._viewGpuContext&&this._overflowGuardContainer.appendChild(this._viewGpuContext.canvas),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(p.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),a?(a.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode),a.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode)):(this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this.domNode.appendChild(this._overlayWidgets.overflowingOverlayWidgetsDomNode)),this._applyLayout(),this._pointerHandler=this._register(new bx(this._context,this._viewController,this._createPointerHandlerHelper()))}_instantiateEditContext(){return this._context.configuration.options.get(170)?this._instantiationService.createInstance(Lt,this._ownerID,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper()):this._instantiationService.createInstance(SU,this._context,this._overflowGuardContainer,this._viewController,this._createTextAreaHandlerHelper())}_updateEditContext(){let e=this._context.configuration.options.get(170),t=this._context.configuration.options.get(2);if(this._editContextEnabled===e&&this._accessibilitySupport===t)return;this._editContextEnabled=e,this._accessibilitySupport=t;
193let i=this._editContext.isFocused(),n=this._viewParts.indexOf(this._editContext);this._editContext.dispose(),this._editContext=this._instantiateEditContext(),i&&this._editContext.focus(),-1!==n&&this._viewParts.splice(n,1,this._editContext)}_computeGlyphMarginLanes(){let e=this._context.viewModel.model,t=this._context.viewModel.glyphLanes,i=[],n=0;for(let s of((i=(i=i.concat(e.getAllMarginDecorations().map(e=>{let t=e.options.glyphMargin?.position??iJ.Center;return n=Math.max(n,e.range.endLineNumber),{range:e.range,lane:t,persist:e.options.glyphMargin?.persistLane}}))).concat(this._glyphMarginWidgets.getWidgets().map(t=>{let i=e.validateRange(t.preference.range);return n=Math.max(n,i.endLineNumber),{range:i,lane:t.preference.lane}}))).sort((e,t)=>s9.compareRangesUsingStarts(e.range,t.range)),t.reset(n),i))t.push(s.lane,s.range,s.persist);return t}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,viewLinesGpu:this._viewLinesGpu,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._editContext.domNode.domNode.dispatchEvent(e)},getLastRenderData:()=>new vF(this._viewCursors.getLastRenderData()||[],this._editContext.getLastRenderData()),renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>{this._flushAccumulatedAndRenderNow();let i=new s3(e,t);return this._viewLines.visibleRangeForPosition(i)??this._viewLinesGpu?.visibleRangeForPosition(i)??null},getLineWidth:e=>{if(this._flushAccumulatedAndRenderNow(),this._viewLinesGpu){let t=this._viewLinesGpu.getLineWidth(e);if(void 0!==t)return t}return this._viewLines.getLineWidth(e)}}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e)),linesVisibleRangesForRange:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.linesVisibleRangesForRange(e,t))}}_applyLayout(){let e=this._context.configuration.options.get(165);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(16777216),this._linesContent.setHeight(16777216)}_getEditorClassName(){let e=this._editContext.isFocused()?" focused":"";return this._context.configuration.options.get(162)+" "+CQ(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._updateEditContext(),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){for(let e of(null!==this._renderAnimationFrame&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._overlayWidgets.overflowingOverlayWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewGpuContext?.dispose(),this._viewLines.dispose(),this._viewLinesGpu?.dispose(),this._viewParts))e.dispose();super.dispose()}
193_scheduleRender(){if(this._store.isDisposed)throw new o_.he;if(null===this._renderAnimationFrame){this._editContext instanceof Lt&&this._editContext.setEditContextOnDomNode();let e=this._createCoordinatedRendering();this._renderAnimationFrame=Lo.INSTANCE.scheduleCoordinatedRendering({window:aG(this.domNode?.domNode),prepareRenderText:()=>{if(this._store.isDisposed)throw new o_.he;try{return e.prepareRenderText()}finally{this._renderAnimationFrame=null}},renderText:()=>{if(this._store.isDisposed)throw new o_.he;return e.renderText()},prepareRender:(t,i)=>{if(this._store.isDisposed)throw new o_.he;return e.prepareRender(t,i)},render:(t,i)=>{if(this._store.isDisposed)throw new o_.he;return e.render(t,i)}})}}_flushAccumulatedAndRenderNow(){let e=this._createCoordinatedRendering();Lr(()=>e.prepareRenderText());let t=Lr(()=>e.renderText());if(t){let[i,n]=t;Lr(()=>e.prepareRender(i,n)),Lr(()=>e.render(i,n))}}_getViewPartsToRender(){let e=[],t=0;for(let i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_createCoordinatedRendering(){return{prepareRenderText:()=>{if(this._shouldRecomputeGlyphMarginLanes){this._shouldRecomputeGlyphMarginLanes=!1;let e=this._computeGlyphMarginLanes();this._context.configuration.setGlyphMarginDecorationLaneCount(e.requiredLanes)}i0.onRenderStart()},renderText:()=>{if(!this.domNode.domNode.isConnected)return null;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return null;let t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);let i=new y1(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);return this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender()),this._viewLinesGpu?.shouldRender()&&(this._viewLinesGpu.renderText(i),this._viewLinesGpu.onDidRender()),[e,new vp(this._context.viewLayout,i,this._viewLines,this._viewLinesGpu)]},prepareRender:(e,t)=>{for(let i of e)i.prepareRender(t)},render:(e,t)=>{for(let i of e)i.render(t),i.onDidRender()}}}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){let i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),n=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();let s=this._viewLines.visibleRangeForPosition(new s3(n.lineNumber,n.column));return s?s.left:-1}getTargetAtClientPoint(e,t){let i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?CV.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new yB(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t)for(let e of(this._viewLines.forceShouldRender(),this._viewParts))e.forceShouldRender();e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._editContext.writeScreenReaderContent(e)}focus(){this._editContext.focus()}isFocused(){return this._editContext.isFocused()}isWidgetFocused(){return this._widgetFocusTracker.hasFocus()}setAriaOptions(e){this._editContext.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){this._contentWidgets.setWidgetPosition(e.widget,e.position?.position??null,e.position?.secondaryPosition??null,e.position?.preference??null,e.position?.positionAffinity??null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){this._overlayWidgets.setWidgetPosition(e.widget,e.position)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){let t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};function Lr(e){try{return e()}catch(e){return(0,o_.dL)(e),null}}Ls=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){he(e,t,8)}],Ls);class Lo{static{this.INSTANCE=new Lo}constructor(){this._coordinatedRenderings=[],this._animationFrameRunners=new Map}scheduleCoordinatedRendering(e){return this._coordinatedRenderings.push(e),this._scheduleRender(e.window),{dispose:()=>{let t=this._coordinatedRenderings.indexOf(e);if(-1!==t&&(this._coordinatedRenderings.splice(t,1),0===this._coordinatedRenderings.length)){for(let[e,t]of this._animationFrameRunners)t.dispose();this._animationFrameRunners.clear()}}}}
193_scheduleRender(e){this._animationFrameRunners.has(e)||this._animationFrameRunners.set(e,d(e,()=>{this._animationFrameRunners.delete(e),this._onRenderScheduled()},100))}_onRenderScheduled(){let e=this._coordinatedRenderings.slice(0);for(let t of(this._coordinatedRenderings=[],e))Lr(()=>t.prepareRenderText());let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];t[i]=Lr(()=>n.renderText())}for(let i=0,n=e.length;i<n;i++){let n=e[i],s=t[i];if(!s)continue;let[r,o]=s;Lr(()=>n.prepareRender(r,o))}for(let i=0,n=e.length;i<n;i++){let n=e[i],s=t[i];if(!s)continue;let[r,o]=s;Lr(()=>n.render(r,o))}}}class La extends ro.JT{constructor(e,t){super(),this._onChange=this._register(new sd.Q5),this.onChange=this._onChange.event,this._hadFocus=void 0,this._hasDomElementFocus=!1,this._domFocusTracker=this._register(lx(e)),this._overflowWidgetsDomNodeHasFocus=!1,this._register(this._domFocusTracker.onDidFocus(()=>{this._hasDomElementFocus=!0,this._update()})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasDomElementFocus=!1,this._update()})),t&&(this._overflowWidgetsDomNode=this._register(lx(t)),this._register(this._overflowWidgetsDomNode.onDidFocus(()=>{this._overflowWidgetsDomNodeHasFocus=!0,this._update()})),this._register(this._overflowWidgetsDomNode.onDidBlur(()=>{this._overflowWidgetsDomNodeHasFocus=!1,this._update()})))}_update(){let e=this._hasDomElementFocus||this._overflowWidgetsDomNodeHasFocus;this._hadFocus!==e&&(this._hadFocus=e,this._onChange.fire(void 0))}hasFocus(){return this._hadFocus??!1}}class Ll{constructor(e,t,i,n,s){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=n,this.wrappedTextIndentLength=s}getOutputLineCount(){return this.breakOffsets.length}getMinOutputOffset(e){return e>0?this.wrappedTextIndentLength:0}getLineLength(e){let t=e>0?this.breakOffsets[e-1]:0,i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let e=0;e<this.injectionOffsets.length;e++)if(i>this.injectionOffsets[e])i<this.injectionOffsets[e]+this.injectionOptions[e].content.length?i=this.injectionOffsets[e]:i-=this.injectionOptions[e].content.length;else break;return i}translateToOutputPosition(e,t=2){let i=e;if(null!==this.injectionOffsets)for(let n=0;n<this.injectionOffsets.length&&!(e<this.injectionOffsets[n])&&(1===t||e!==this.injectionOffsets[n]);n++)i+=this.injectionOptions[n].content.length;return this.offsetInInputWithInjectionsToOutputPosition(i,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let i=0,n=this.breakOffsets.length-1,s=0,r=0;for(;i<=n;){s=i+(n-i)/2|0;let o=this.breakOffsets[s];if(r=s>0?this.breakOffsets[s-1]:0,0===t){if(e<=r)n=s-1;else if(e>o)i=s+1;else break}else if(e<r)n=s-1;else if(e>=o)i=s+1;else break}let o=e-r;return s>0&&(o+=this.wrappedTextIndentLength),new Lu(s,o)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){let n=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(s!==n)return this.offsetInInputWithInjectionsToOutputPosition(s,i)}if(0===i){if(e>0&&t===this.getMinOutputOffset(e))return new Lu(e-1,this.getMaxOutputOffset(e-1))}else if(1===i&&e<this.getOutputLineCount()-1&&t===this.getMaxOutputOffset(e))return new Lu(e+1,this.getMinOutputOffset(e+1));return new Lu(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){let i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t){if(e===i.offsetInInputWithInjections+i.length&&Lh(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let e=i.offsetInInputWithInjections;if(Ld(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!Lh(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!Ld(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t||4===t){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1<this.injectionOffsets.length&&this.injectionOffsets[t+1]===this.injectionOffsets[t];)e+=this.injectionOptions[t+1].content.length,t++;return e}if(0===t||3===t){let e=i.offsetInInputWithInjections,t=i.injectedTextIndex;for(;t-1>=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];
193)e-=this.injectionOptions[t-1].content.length,t--;return e}(0,ab.vE)()}getInjectedText(e,t){let i=this.outputPositionToOffsetInInputWithInjections(e,t),n=this.getInjectedTextAtOffset(i);return n?{options:this.injectionOptions[n.injectedTextIndex]}:null}getInjectedTextAtOffset(e){let t=this.injectionOffsets,i=this.injectionOptions;if(null!==t){let n=0;for(let s=0;s<t.length;s++){let r=i[s].content.length,o=t[s]+n,a=t[s]+n+r;if(o>e)break;if(e<=a)return{injectedTextIndex:s,offsetInInputWithInjections:o,length:r};n+=r}}}}function Lh(e){return null==e||e===iX.Right||e===iX.Both}function Ld(e){return null==e||e===iX.Left||e===iX.Both}class Lu{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new s3(e+this.outputLineIndex,this.outputOffset+1)}}class Lc{constructor(){this.changeType=1}}class Lg{static applyInjectedText(e,t){if(!t||0===t.length)return e;let i="",n=0;for(let s of t)i+=e.substring(n,s.column-1),n=s.column-1,i+=s.options.content;return i+e.substring(n)}static fromDecorations(e){let t=[];for(let i of e)i.options.before&&i.options.before.content.length>0&&t.push(new Lg(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new Lg(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber),t}constructor(e,t,i,n,s){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=s}}class Lf{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class Lm{constructor(e,t,i,n){this.ownerId=e,this.decorationId=t,this.lineNumber=i,this.lineHeight=n}}class Lp{constructor(e,t){this.ownerId=e,this.lineNumber=t}}class L_{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class Lv{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Lb{constructor(){this.changeType=5}}class LC{constructor(e,t,i,n){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=n,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){let i=[].concat(e.changes).concat(t.changes);return new LC(i,t.versionId,e.isUndoing||t.isUndoing,e.isRedoing||t.isRedoing)}}class Lw{constructor(e){this.changes=e}}class Ly{constructor(e){this.changes=e}}class LS{constructor(e){this.changes=e}}class LL{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){let t=LC.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=LL._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new LL(t,i)}static _mergeChangeEvents(e,t){let i=[].concat(e.changes).concat(t.changes),n=t.eol,s=t.versionId,r=e.isUndoing||t.isUndoing,o=e.isRedoing||t.isRedoing,a=e.isFlush||t.isFlush;return{changes:i,eol:n,isEolChange:e.isEolChange&&t.isEolChange,versionId:s,isUndoing:r,isRedoing:o,isFlush:a,detailedReasons:e.detailedReasons.concat(t.detailedReasons),detailedReasonsChangeLengths:e.detailedReasonsChangeLengths.concat(t.detailedReasonsChangeLengths)}}}let Lx=ut("domLineBreaksComputer",{createHTML:e=>e});class Lk{static create(e){return new Lk(new WeakRef(e))}constructor(e){this.targetWindow=e}createLineBreaksComputer(e,t,i,n,s,r){let o=[],a=[];return{addRequest:(e,t,i)=>{o.push(e),a.push(t)},finalize:()=>(function(e,t,i,n,s,r,o,a){function l(e){let i=a[e];if(!i)return null;{let n=Lg.applyInjectedText(t[e],i),s=i.map(e=>e.options);return new Ll(i.map(e=>e.column-1),s,[n.length],[],0)}}if(-1===s){let e=[];for(let i=0,n=t.length;i<n;i++)e[i]=l(i);return e}let h=Math.round(s*i.typicalHalfwidthCharacterWidth),d=Math.round(n*(3===r?2:2===r?1:0)),u=Math.ceil(i.spaceWidth*d),c=document.createElement("div");l5(c,i);let g=new um(1e4),f=[],m=[],p=[],_=[],v=[];for(let e=0;e<t.length;e++){let s=Lg.applyInjectedText(t[e],a[e]),o=0,l=0,d=h;if(0!==r){if(-1===(o=rM(s)))o=0;else{for(let e=0;e<o;e++){let t=9===s.charCodeAt(e)?n-l%n:1;l+=t}let e=Math.ceil(i.spaceWidth*l);e+i.typicalFullwidthCharacterWidth>h?(o=0,l=0):d=h-e}}let c=s.substr(o),b=function(e,t,i,n,s,r){if(0!==r){let e=String(r);
193s.appendString('<div style="text-indent: -'),s.appendString(e),s.appendString("px; padding-left: "),s.appendString(e),s.appendString("px; box-sizing: border-box; width:")}else s.appendString('<div style="width:');s.appendString(String(n)),s.appendString('px;">');let o=e.length,a=t,l=0,h=[],d=[],u=0<o?e.charCodeAt(0):0;s.appendString("<span>");for(let t=0;t<o;t++){0!==t&&t%16384==0&&s.appendString("</span><span>"),h[t]=l,d[t]=a;let n=u;u=t+1<o?e.charCodeAt(t+1):0;let r=1,c=1;switch(n){case 9:c=r=i-a%i;for(let e=1;e<=r;e++)e<r?s.appendCharCode(160):s.appendASCIICharCode(32);break;case 32:32===u?s.appendCharCode(160):s.appendASCIICharCode(32);break;case 60:s.appendString("&lt;");break;case 62:s.appendString("&gt;");break;case 38:s.appendString("&amp;");break;case 0:s.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:s.appendCharCode(65533);break;default:r6(n)&&c++,n<32?s.appendCharCode(9216+n):s.appendCharCode(n)}l+=r,a+=c}return s.appendString("</span>"),h[e.length]=l,d[e.length]=a,s.appendString("</div>"),[h,d]}(c,l,n,d,g,u);f[e]=o,m[e]=l,p[e]=c,_[e]=b[0],v[e]=b[1]}let b=g.build(),C=Lx?.createHTML(b)??b;c.innerHTML=C,c.style.position="absolute",c.style.top="10000","keepAll"===o?(c.style.wordBreak="keep-all",c.style.overflowWrap="anywhere"):(c.style.wordBreak="inherit",c.style.overflowWrap="break-word"),e.document.body.appendChild(c);let w=document.createRange(),y=Array.prototype.slice.call(c.children,0),S=[];for(let e=0;e<t.length;e++){let t,i;let n=function(e,t,i,n){if(i.length<=1)return null;let s=Array.prototype.slice.call(t.children,0),r=[];try{!function e(t,i,n,s,r,o,a,l){if(s===o||(r=r||LN(t,i,n[s],n[s+1]),a=a||LN(t,i,n[o],n[o+1]),.1>=Math.abs(r[0].top-a[0].top)))return;if(s+1===o){l.push(o);return}let h=s+(o-s)/2|0,d=LN(t,i,n[h],n[h+1]);e(t,i,n,s,r,h,d,l),e(t,i,n,h,d,o,a,l)}(e,s,n,0,null,i.length-1,null,r)}catch(e){return console.log(e),null}return 0===r.length?null:(r.push(i.length),r)}(w,y[e],p[e],_[e]);if(null===n){S[e]=l(e);continue}let s=f[e],r=m[e]+d,o=v[e],h=[];for(let e=0,t=n.length;e<t;e++)h[e]=o[n[e]];if(0!==s)for(let e=0,t=n.length;e<t;e++)n[e]+=s;let u=a[e];u?(t=u.map(e=>e.options),i=u.map(e=>e.column-1)):(t=null,i=null),S[e]=new Ll(i,t,n,h,r)}return c.remove(),S})((0,re.d9)(this.targetWindow.deref()),o,e,t,i,n,s,a)}}}function LN(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}class LD extends ro.JT{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new ro.b2),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){var n,s,o;for(let n of(this._editor=e,this._instantiationService=i,t)){if(this._pending.has(n.id)){(0,o_.dL)(Error(`Cannot have two contributions with the same id ${n.id}`));continue}this._pending.set(n.id,n)}this._instantiateSome(0),this._register((n=aG(this._editor.getDomNode()),r(n,()=>{this._instantiateSome(1)},void 0))),this._register((s=aG(this._editor.getDomNode()),r(s,()=>{this._instantiateSome(2)},void 0))),this._register((o=aG(this._editor.getDomNode()),r(o,()=>{this._instantiateSome(3)},5e3)))}saveViewState(){let e={};for(let[t,i]of this._instances)"function"==typeof i.saveViewState&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(let[t,i]of this._instances)"function"==typeof i.restoreViewState&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){var e;return e=aG(this._editor?.getDomNode()),r(e,()=>{this._instantiateSome(1)},50)}_instantiateSome(e){if(!this._finishedInstantiation[e])for(let t of(this._finishedInstantiation[e]=!0,this._findPendingContributionsByInstantiation(e)))this._instantiateById(t.id)}_findPendingContributionsByInstantiation(e){let t=[];for(let[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){let t=this._pending.get(e);
193if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw Error("Cannot instantiate contributions before being initialized!");try{let e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),"function"==typeof e.restoreViewState&&0!==t.instantiation&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(e){(0,o_.dL)(e)}}}}class LE{constructor(e,t,i,n,s,r,o){this.id=e,this.label=t,this.alias=i,this.metadata=n,this._precondition=s,this._run=r,this._contextKeyService=o}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function LT(e){let t=0,i=0,n=0,s=0;for(let r=0,o=e.length;r<o;r++){let a=e.charCodeAt(r);13===a?(0===t&&(i=r),t++,r+1<o&&10===e.charCodeAt(r+1)?(s|=2,r++):s|=3,n=r+1):10===a&&(s|=1,0===t&&(i=r),t++,n=r+1)}return 0===t&&(i=e.length),[t,i,e.length-n,s]}var LI=i(67677);class LM{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class LR{constructor(e,t,i,n,s,r){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=s,this.bracketPairNode=r}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class LA extends LR{constructor(e,t,i,n,s,r,o){super(e,t,i,n,s,r),this.minVisibleColumnIndentation=o}}function LO(e,t){return 67108864*e+t}function LP(e){let t=Math.floor(e/67108864);return new c6(t,e-67108864*t)}function LF(e,t){let i=e+t;return t>=67108864&&(i-=e%67108864),i}function LB(e,t){if(t-e<=0)return 0;let i=Math.floor(e/67108864),n=Math.floor(t/67108864),s=t-67108864*n;return i===n?LO(0,s-(e-67108864*i)):LO(n-i,s)}function LV(e){return LO(e.lineNumber-1,e.column-1)}function LW(e,t){let i=Math.floor(e/67108864),n=Math.floor(t/67108864);return new s9(i+1,e-67108864*i+1,n+1,t-67108864*n+1)}class LH{static fromModelContentChanges(e){return e.map(e=>{let t=s9.lift(e.range);return new LH(LV(t.getStartPosition()),LV(t.getEndPosition()),function(e){let t=rI(e);return LO(t.length-1,t[t.length-1].length)}(e.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${LP(this.startOffset)}...${LP(this.endOffset)}) -> ${LP(this.newLength)}`}}class Lz{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(e=>LU.from(e))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);let t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return null===i?null:LB(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?LO(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):LO(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){let t=LP(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?LO(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):LO(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){let t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(i<=e){this.nextEditIdx++;let e=LP(i),n=LP(this.translateOldToCur(t.endOffsetBeforeObj)),s=e.lineCount-n.lineCount;this.deltaOldToNewLineCount+=s;let r=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,o=e.columnCount-n.columnCount;this.deltaOldToNewColumnCount=r+o,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class LU{static from(e){return new LU(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=LP(t),this.endOffsetAfterObj=LP(LF(e,i)),this.offsetObj=LP(e)}}let LK=[];class L${static{this.cache=Array(129)}static create(e,t){if(e<=128&&0===t.length){let i=L$.cache[e];
193return i||(i=new L$(e,t),L$.cache[e]=i),i}return new L$(e,t)}static{this.empty=L$.create(0,LK)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){let i=t.getKey(e),n=i>>5;if(0===n){let e=1<<i|this.items;return e===this.items?this:L$.create(e,this.additionalItems)}n--;let s=this.additionalItems.slice(0);for(;s.length<n;)s.push(0);return s[n]|=1<<(31&i),L$.create(this.items,s)}merge(e){let t=this.items|e.items;if(this.additionalItems===LK&&e.additionalItems===LK)return t===this.items?this:t===e.items?e:L$.create(t,LK);let i=[];for(let t=0;t<Math.max(this.additionalItems.length,e.additionalItems.length);t++){let n=this.additionalItems[t]||0,s=e.additionalItems[t]||0;i.push(n|s)}return L$.create(t,i)}intersects(e){if((this.items&e.items)!=0)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if((this.additionalItems[t]&e.additionalItems[t])!=0)return!0;return!1}}let Lj={getKey:e=>e};class Lq{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}}class LG{get length(){return this._length}constructor(e){this._length=e}}class LQ extends LG{static create(e,t,i){let n=e.length;return t&&(n=LF(n,t.length)),i&&(n=LF(n,i.length)),new LQ(n,e,t,i,t?t.missingOpeningBracketIds:L$.getEmpty())}get kind(){return 2}get listHeight(){return 0}get childrenLength(){return 3}getChild(e){switch(e){case 0:return this.openingBracket;case 1:return this.child;case 2:return this.closingBracket}throw Error("Invalid child index")}get children(){let e=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,n,s){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=s}canBeReused(e){return!(null===this.closingBracket||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new LQ(this.length,this.openingBracket.deepClone(),this.child&&this.child.deepClone(),this.closingBracket&&this.closingBracket.deepClone(),this.missingOpeningBracketIds)}computeMinIndentation(e,t){return this.child?this.child.computeMinIndentation(LF(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class LY extends LG{static create23(e,t,i,n=!1){let s=e.length,r=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw Error("Invalid list heights");if(s=LF(s,t.length),r=r.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw Error("Invalid list heights");s=LF(s,i.length),r=r.merge(i.missingOpeningBracketIds)}return n?new LZ(s,e.listHeight+1,e,t,i,r):new LJ(s,e.listHeight+1,e,t,i,r)}static getEmpty(){return new L1(0,0,[],L$.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();let e=this.childrenLength;if(0===e)return;let t=this.getChild(e-1),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),0===this.childrenLength)return;let e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds)||0===this.childrenLength)return!1;let t=this;for(;4===t.kind;){let e=t.childrenLength;if(0===e)throw new o_.he;t=t.getChild(e-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();let e=this.childrenLength,t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n<e;n++){let e=this.getChild(n);t=LF(t,e.length),i=i.merge(e.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(-1!==this.cachedMinIndentation)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,n=e;for(let e=0;e<this.childrenLength;e++){let s=this.getChild(e);s&&(i=Math.min(i,s.computeMinIndentation(n,t)),n=LF(n,s.length))}return this.cachedMinIndentation=i,i}}class LJ extends LY{get childrenLength(){return null!==this._item3?3:2}getChild(e){switch(e){case 0:return this._item1;case 1:return this._item2;case 2:return this._item3}throw Error("Invalid child index")}setChild(e,t){switch(e){case 0:this._item1=t;return;case 1:this._item2=t;return;case 2:this._item3=t;return}throw Error("Invalid child index")}get children(){return this._item3?[this._item1,this._item2,this._item3]:[this._item1,this._item2]}get item1(){return this._item1}get item2(){return this._item2}get item3(){return this._item3}constructor(e,t,i,n,s,r){super(e,t,r),this._item1=i,this._item2=n,this._item3=s}deepClone(){return new LJ(this.length,this.listHeight,this._item1.deepClone(),this._item2.deepClone(),this._item3?this._item3.deepClone():null,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){if(this._item3)throw Error("Cannot append to a full (2,3) tree node");this.throwIfImmutable(),this._item3=e,this.handleChildrenChanged()}
193unappendChild(){if(!this._item3)throw Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();let e=this._item3;return this._item3=null,this.handleChildrenChanged(),e}prependChildOfSameHeight(e){if(this._item3)throw Error("Cannot prepend to a full (2,3) tree node");this.throwIfImmutable(),this._item3=this._item2,this._item2=this._item1,this._item1=e,this.handleChildrenChanged()}unprependChild(){if(!this._item3)throw Error("Cannot remove from a non-full (2,3) tree node");this.throwIfImmutable();let e=this._item1;return this._item1=this._item2,this._item2=this._item3,this._item3=null,this.handleChildrenChanged(),e}toMutable(){return this}}class LZ extends LJ{toMutable(){return new LJ(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw Error("this instance is immutable")}}class LX extends LY{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,n){super(e,t,n),this._children=i}deepClone(){let e=Array(this._children.length);for(let t=0;t<this._children.length;t++)e[t]=this._children[t].deepClone();return new LX(this.length,this.listHeight,e,this.missingOpeningBracketIds)}appendChildOfSameHeight(e){this.throwIfImmutable(),this._children.push(e),this.handleChildrenChanged()}unappendChild(){this.throwIfImmutable();let e=this._children.pop();return this.handleChildrenChanged(),e}prependChildOfSameHeight(e){this.throwIfImmutable(),this._children.unshift(e),this.handleChildrenChanged()}unprependChild(){this.throwIfImmutable();let e=this._children.shift();return this.handleChildrenChanged(),e}toMutable(){return this}}class L1 extends LX{toMutable(){return new LX(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw Error("this instance is immutable")}}let L0=[];class L2 extends LG{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return L0}deepClone(){return this}}class L5 extends L2{get kind(){return 0}get missingOpeningBracketIds(){return L$.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){let i=LP(e),n=(0===i.columnCount?i.lineCount:i.lineCount+1)+1,s=Math.floor(LF(e,this.length)/67108864)+1,r=Number.MAX_SAFE_INTEGER;for(let e=n;e<=s;e++){let i=t.getLineFirstNonWhitespaceColumn(e),n=t.getLineContent(e);0!==i&&(r=Math.min(r,vR.visibleColumnFromColumn(n,i,t.getOptions().tabSize)))}return r}}class L4 extends L2{static create(e,t,i){return new L4(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return L$.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class L6 extends L2{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class L7{constructor(e,t,i,n,s){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=s}}class L3{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new L9(this.textModel,this.bracketTokens),this._offset=0,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return LO(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=LF(this._offset,e);let t=LP(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=LF(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class L9{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,null!==this.line&&(this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){var e,t;if(this.peekedToken){let e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=e.length,e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));let i=this.lineIdx,n=this.lineCharOffset,s=0;for(;;){let e=this.lineTokens,t=e.getCount(),r=null;if(this.lineTokenOffset<t){let o=e.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<t&&o===e.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;let a=0===fS.getTokenType(o),l=fS.containsBalancedBrackets(o),h=e.getEndOffset(this.lineTokenOffset);if(l&&a&&this.lineCharOffset<h){let t=e.getLanguageId(this.lineTokenOffset),i=this.line.substring(this.lineCharOffset,h),n=this.bracketTokens.getSingleLanguageBracketTokens(t),s=n.regExpGlobal;if(s){s.lastIndex=0;let e=s.exec(i);e&&(r=n.getToken(e[0]))&&(this.lineCharOffset+=e.index)}}if(s+=h-this.lineCharOffset,r){if(i!==this.lineIdx||n!==this.lineCharOffset){this.peekedToken=r;break}return this.lineCharOffset+=r.length,r}this.lineTokenOffset++,this.lineCharOffset=h}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,(s+=33)>1e3))break;if(s>1500)break}let r=(e=this.lineIdx,t=this.lineCharOffset,i!==e?LO(e-i,t):LO(0,t-n));return new L7(r,0,-1,L$.getEmpty(),new L5(r))}}class L8{constructor(e,t){let i;this.text=e,this._offset=0,this.idx=0;let n=t.getRegExpStr(),s=n?RegExp(n+"|\n","gi"):null,r=[],o=0,a=0,l=0,h=0,d=[];for(let e=0;e<60;e++)d.push(new L7(LO(0,e),0,-1,L$.getEmpty(),new L5(LO(0,e))));let u=[];for(let e=0;e<60;e++)u.push(new L7(LO(1,e),0,-1,L$.getEmpty(),new L5(LO(1,e))));if(s)for(s.lastIndex=0;null!==(i=s.exec(e));){let e=i.index,n=i[0];if("\n"===n)o++,a=e+1;else{if(l!==e){let t;if(h===o){let i=e-l;if(i<d.length)t=d[i];else{let e=LO(0,i);t=new L7(e,0,-1,L$.getEmpty(),new L5(e))}}else{let i=o-h,n=e-a;if(1===i&&n<u.length)t=u[n];else{let e=LO(i,n);t=new L7(e,0,-1,L$.getEmpty(),new L5(e))}}r.push(t)}r.push(t.getToken(n)),l=e+n.length,h=o}}let c=e.length;if(l!==c){let e=h===o?LO(0,c-l):LO(o-h,c-a);r.push(new L7(e,0,-1,L$.getEmpty(),new L5(e)))}this.length=LO(o,c-a),this.tokens=r}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new o_.B8}}class xe{static createFromLanguage(e,t){function i(e){return t.getKey(`${e.languageId}:::${e.bracketText}`)}let n=new Map;for(let t of e.bracketsNew.openingBrackets){let e=LO(0,t.bracketText.length),s=i(t),r=L$.getEmpty().add(s,Lj);n.set(t.bracketText,new L7(e,1,s,r,L4.create(e,t,r)))}for(let t of e.bracketsNew.closingBrackets){let e=LO(0,t.bracketText.length),s=L$.getEmpty(),r=t.getOpeningBrackets();for(let e of r)s=s.add(i(e),Lj);
193n.set(t.bracketText,new L7(e,2,i(r[0]),s,L4.create(e,t,s)))}return new xe(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{let e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(e=>{let t;return t=rN(e),/^[\w ]+/.test(e)&&(t=`\\b${t}`),/[\w ]+$/.test(e)&&(t=`${t}\\b`),t}).join("|")}}get regExpGlobal(){if(!this.hasRegExp){let e=this.getRegExpStr();this._regExpGlobal=e?RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(let[t,i]of this.map)if(2===i.kind&&i.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}}class xt{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=xe.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function xi(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;for(;i>3;){let n=i>>1;for(let s=0;s<n;s++){let n=s<<1;e[s]=LY.create23(e[n],e[n+1],n+3===i?e[n+2]:null,t)}i=n}return LY.create23(e[0],e[1],i>=3?e[2]:null,t)}function xn(e,t){return Math.abs(e.listHeight-t.listHeight)}function xs(e,t){return e.listHeight===t.listHeight?LY.create23(e,t,null,!1):e.listHeight>t.listHeight?function(e,t){let i;let n=e=e.toMutable(),s=[];for(;;){if(t.listHeight===n.listHeight){i=t;break}if(4!==n.kind)throw Error("unexpected");s.push(n),n=n.makeLastElementMutable()}for(let e=s.length-1;e>=0;e--){let t=s[e];i?t.childrenLength>=3?i=LY.create23(t.unappendChild(),i,null,!1):(t.appendChildOfSameHeight(i),i=void 0):t.handleChildrenChanged()}return i?LY.create23(e,i,null,!1):e}(e,t):function(e,t){let i=e=e.toMutable(),n=[];for(;t.listHeight!==i.listHeight;){if(4!==i.kind)throw Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let s=t;for(let e=n.length-1;e>=0;e--){let t=n[e];s?t.childrenLength>=3?s=LY.create23(s,t.unprependChild(),null,!1):(t.prependChildOfSameHeight(s),s=void 0):t.handleChildrenChanged()}return s?LY.create23(s,e,null,!1):e}(t,e)}class xr{constructor(e){this.lastOffset=0,this.nextNodes=[e],this.offsets=[0],this.idxs=[]}readLongestNodeAt(e,t){if(e<this.lastOffset)throw Error("Invalid offset");for(this.lastOffset=e;;){let i=xa(this.nextNodes);if(!i)return;let n=xa(this.offsets);if(e<n)return;if(n<e){if(LF(n,i.length)<=e)this.nextNodeAfterCurrent();else{let e=xo(i);-1!==e?(this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)):this.nextNodeAfterCurrent()}}else{if(t(i))return this.nextNodeAfterCurrent(),i;{let e=xo(i);if(-1===e){this.nextNodeAfterCurrent();return}this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){let e=xa(this.offsets),t=xa(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;let i=xa(this.nextNodes),n=xo(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push(LF(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}}function xo(e,t=-1){for(;;){if(++t>=e.childrenLength)return -1;if(e.getChild(t))return t}}function xa(e){return e.length>0?e[e.length-1]:void 0}function xl(e,t,i,n){return new xh(e,t,i,n).parseDocument()}class xh{constructor(e,t,i,n){if(this.tokenizer=e,this.createImmutableLists=n,this._itemsConstructed=0,this._itemsFromCache=0,i&&n)throw Error("Not supported");this.oldNodeReader=i?new xr(i):void 0,this.positionMapper=new Lz(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(L$.getEmpty(),0);return e||(e=LY.getEmpty()),e}parseList(e,t){let i=[];for(;;){let n=this.tryReadChildFromCache(e);if(!n){let i=this.tokenizer.peek();if(!i||2===i.kind&&i.bracketIds.intersects(e))break;n=this.parseChild(e,t+1)}(4!==n.kind||0!==n.childrenLength)&&i.push(n)}return this.oldNodeReader?function(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function i(){if(t>=e.length)return null;let i=t,n=e[i].listHeight;for(t++;t<e.length&&e[t].listHeight===n;)t++;return t-i>=2?xi(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),s=i();if(!s)return n;for(let e=i();e;e=i())xn(n,s)<=xn(s,e)?(n=xs(n,s),s=e):s=xs(s,e);return xs(n,s)}(i):xi(i,this.createImmutableLists)}
193tryReadChildFromCache(e){if(this.oldNodeReader){let t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(null===t||0!==t){let i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),i=>(null===t||i.length<t)&&i.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;let i=this.tokenizer.read();switch(i.kind){case 2:return new L6(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new L5(i.length);let n=e.merge(i.bracketIds),s=this.parseList(n,t+1),r=this.tokenizer.peek();if(r&&2===r.kind&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds)))return this.tokenizer.read(),LQ.create(i.astNode,s,r.astNode);return LQ.create(i.astNode,s,null)}default:throw Error("unexpected")}}}function xd(e,t){if(0===e.length)return t;if(0===t.length)return e;let i=new as.H9(xc(e)),n=xc(t);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=i.dequeue(),r=[];function o(e,t,i){if(r.length>0&&r[r.length-1].endOffset===e){let e=r[r.length-1];r[r.length-1]=new LH(e.startOffset,t,LF(e.newLength,i))}else r.push({startOffset:e,endOffset:t,newLength:i})}let a=0;for(let e of n){let t=function(e){if(void 0===e){let e=i.takeWhile(e=>!0)||[];return s&&e.unshift(s),e}let t=[];for(;s&&0!==e;){let[n,r]=s.splitAt(e);t.push(n),e=LB(n.lengthAfter,e),s=r??i.dequeue()}return 0!==e&&t.push(new xu(!1,e,e)),t}(e.lengthBefore);if(e.modified){let i=function(e,t){return e.reduce((e,i)=>LF(e,t(i)),0)}(t,e=>e.lengthBefore),n=LF(a,i);o(a,n,e.lengthAfter),a=n}else for(let e of t){let t=a;a=LF(a,e.lengthBefore),e.modified&&o(t,a,e.lengthAfter)}}return r}class xu{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){let t=LB(e,this.lengthAfter);return 0===t?[this,void 0]:this.modified?[new xu(this.modified,this.lengthBefore,e),new xu(this.modified,0,t)]:[new xu(this.modified,e,e),new xu(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${LP(this.lengthBefore)} -> ${LP(this.lengthAfter)}`}}function xc(e){let t=[],i=0;for(let n of e){let e=LB(i,n.startOffset);0!==e&&t.push(new xu(!1,e,e));let s=LB(n.startOffset,n.endOffset);t.push(new xu(!0,s,n.newLength)),i=n.endOffset}return t}class xg extends ro.JT{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new sd.Q5,this.denseKeyProvider=new Lq,this.brackets=new xt(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)2===e.tokenization.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{let e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new L8(this.textModel.getValue(),e);this.initialAstWithoutTokens=xl(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.tokenization.backgroundTokenizationState){let e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){let t=e.map(e=>new LH(LO(e.fromLineNumber-1,0),LO(e.toLineNumber,0),LO(e.toLineNumber-e.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){let t=LH.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){let i=xd(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=xd(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){return xl(new L3(this.textModel,this.brackets),e,t,i)}getBracketsInRange(e,t){this.flushQueue();let i=LO(e.startLineNumber-1,e.startColumn-1),n=LO(e.endLineNumber-1,e.endColumn-1);return new as.W$(e=>{let s=this.initialAstWithoutTokens||this.astWithTokens;!function e(t,i,n,s,r,o,a,l,h,d,u=!1){if(a>200)return!0;n:for(;;)switch(t.kind){case 4:{let l=t.childrenLength;for(let u=0;u<l;u++){let l=t.getChild(u);if(l){if(n=LF(i,l.length),i<=r&&n>=s){if(n>=r){t=l;continue n}if(!e(l,i,n,s,r,o,a,0,h,d))return!1}i=n}}return!0}case 2:{let u=!d||!t.closingBracket||t.closingBracket.bracketInfo.closesColorized(t.openingBracket.bracketInfo),c=0;if(h){let e=h.get(t.openingBracket.text);void 0===e&&(e=0),c=e,u&&(e++,h.set(t.openingBracket.text,e))}let g=t.childrenLength;for(let f=0;f<g;f++){let g=t.getChild(f);if(g){if(n=LF(i,g.length),i<=r&&n>=s){if(n>=r&&1!==g.kind){t=g,u?(a++,l=c+1):l=c;continue n}if((u||1!==g.kind||!t.closingBracket)&&!e(g,i,n,s,r,o,u?a+1:a,u?c+1:c,h,d,!t.closingBracket))return!1}i=n}}return h?.set(t.openingBracket.text,c),!0}case 3:return o(new LM(LW(i,n),a-1,0,!0));case 1:return o(new LM(LW(i,n),a-1,l-1,u));case 0:return!0}}(s,0,s.length,i,n,e,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();let i=LV(e.getStartPosition()),n=LV(e.getEndPosition());return new as.W$(e=>{let s=this.initialAstWithoutTokens||this.astWithTokens,r=new xf(e,t,this.textModel);!function e(t,i,n,s,r,o,a,l){if(a>200)return!0;let h=!0;if(2===t.kind){let d=0;if(l){let e=l.get(t.openingBracket.text);void 0===e&&(e=0),d=e,e++,l.set(t.openingBracket.text,e)}let u=LF(i,t.openingBracket.length),c=-1;if(o.includeMinIndentation&&(c=t.computeMinIndentation(i,o.textModel)),h=o.push(new LA(LW(i,n),LW(i,u),t.closingBracket?LW(L
193F(u,t.child?.length||0),n):void 0,a,d,t,c)),i=u,h&&t.child){let d=t.child;if(n=LF(i,d.length),i<=r&&n>=s&&!(h=e(d,i,n,s,r,o,a+1,l)))return!1}l?.set(t.openingBracket.text,d)}else{let n=i;for(let i of t.children){let t=n;if(n=LF(n,i.length),t<=r&&s<=n&&!(h=e(i,t,n,s,r,o,a,l)))return!1}}return h}(s,0,s.length,i,n,r,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();let t=this.initialAstWithoutTokens||this.astWithTokens;return function e(t,i,n,s){if(4===t.kind||2===t.kind)for(let r of t.children){if(s<(n=LF(i,r.length))){let t=e(r,i,n,s);if(t)return t}i=n}else if(3===t.kind);else if(1===t.kind){let e=LW(i,n);return{bracketInfo:t.bracketInfo,range:e}}return null}(t,0,t.length,LV(e))}getFirstBracketBefore(e){this.flushQueue();let t=this.initialAstWithoutTokens||this.astWithTokens;return function e(t,i,n,s){if(4===t.kind||2===t.kind){let r=[];for(let e of t.children)n=LF(i,e.length),r.push({nodeOffsetStart:i,nodeOffsetEnd:n}),i=n;for(let i=r.length-1;i>=0;i--){let{nodeOffsetStart:n,nodeOffsetEnd:o}=r[i];if(n<s){let r=e(t.children[i],n,o,s);if(r)return r}}}else if(3===t.kind);else if(1===t.kind){let e=LW(i,n);return{bracketInfo:t.bracketInfo,range:e}}return null}(t,0,t.length,LV(e))}}class xf{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}class xm extends ro.JT{get canBuildAST(){return 5e6>=this.textModel.getValueLength()}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new ro.XK),this.onDidChangeEmitter=new sd.Q5,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1}handleLanguageConfigurationServiceChange(e){(!e.languageId||this.bracketPairsTree.value?.object.didLanguageChange(e.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){this.bracketPairsTree.value?.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){this.bracketPairsTree.value?.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){this.bracketPairsTree.value?.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){let e=new ro.SL;this.bracketPairsTree.value={object:e.add(new xg(this.textModel,e=>this.languageConfigurationService.getLanguageConfiguration(e))),dispose:()=>e?.dispose()},e.add(this.bracketPairsTree.value.object.onDidChange(e=>this.onDidChangeEmitter.fire(e))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!1)||as.W$.empty}getBracketPairsInRangeWithMinIndentation(e){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketPairsInRange(e,!0)||as.W$.empty}getBracketsInRange(e,t=!1){return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getBracketsInRange(e,t)||as.W$.empty}findMatchingBracketUp(e,t,i){let n=this.textModel.validatePosition(t),s=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){let i=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew.getClosingBracketInfo(e);if(!i)return null;let n=this.getBracketPairsInRange(s9.fromPositions(t,t)).findLast(e=>i.closes(e.openingBracketInfo));return n?n.openingBracketRange:null}{let t=e.toLowerCase(),r=this.languageConfigurationService.getLanguageConfiguration(s).brackets;if(!r)return null;let o=r.textIsBracket[t];return o?xv(this._findMatchingBracketUp(o,n,xp(i))):null}}matchBracket(e,t){if(this.canBuildAST){let t=this.getBracketPairsInRange(s9.fromPositions(e,e)).filter(t=>void 0!==t.closingBracketRange&&(t.openingBracketRange.containsPosition(e)||t.closingBracketRange.containsPosition(e))).findLastMaxBy((0,as.tT)(t=>t.openingBracketRange.containsPosition(e)?t.openingBracketRange:t.closingBracketRange,s9.compareRangesUsingStarts));return t?[t.openingBracketRange,t.closingBracketRange]:null}{let i=xp(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){let s=t.getCount(),r=t.getLanguageId(n),o=Math.max(0,e.column-1-i.maxBracketLength);for(let e=n-1;e>=0;e--){let i=t.getEndOffset(e);if(i<=o)break;if(uc(t.getStandardTokenType(e))||t.getLanguageId(e)!==r){o=i;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let e=n+1;e<s;e++){let i=t.getStartOffset(e);if(i>=a)break;if(uc(t.getStandardTokenType(e))||t.getLanguageId(e)!==r){a=i;break}}return{searchStartOffset:o,searchEndOffset:a}}_matchBracket(e,t){let i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),s=this.textModel.getLineContent(i),r=n.findTokenIndexAtOffset(e.column-1);if(r<0)return null;let o=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;
193if(o&&!uc(n.getStandardTokenType(r))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,o,r),h=null;for(;;){let n=uL.findNextBracketInRange(o.forwardRegex,i,s,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){let e=s.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,o.textIsBracket[e],o.textIsOpenBracket[e],t);if(i){if(i instanceof x_)return null;h=i}}a=n.endColumn-1}if(h)return h}if(r>0&&n.getStartOffset(r)===e.column-1){let o=r-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(o)).brackets;if(a&&!uc(n.getStandardTokenType(o))){let{searchStartOffset:r,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,o),h=uL.findPrevBracketInRange(a.reversedRegex,i,s,r,l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){let e=s.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),i=this._matchFoundBracket(h,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof x_?null:i}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;let s=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return s?s instanceof x_?s:[e,s]:null}_findMatchingBracketUp(e,t,i){let n=e.languageId,s=e.reversedRegex,r=-1,o=0,a=(t,n,a,l)=>{for(;;){if(i&&++o%100==0&&!i())return x_.INSTANCE;let h=uL.findPrevBracketInRange(s,t,n,a,l);if(!h)break;let d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?r++:e.isClose(d)&&r--,0===r)return h;l=h.startColumn-1}return null};for(let e=t.lineNumber;e>=1;e--){let i=this.textModel.tokenization.getLineTokens(e),s=i.getCount(),r=this.textModel.getLineContent(e),o=s-1,l=r.length,h=r.length;e===t.lineNumber&&(o=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1);let d=!0;for(;o>=0;o--){let t=i.getLanguageId(o)===n&&!uc(i.getStandardTokenType(o));if(t)d?l=i.getStartOffset(o):(l=i.getStartOffset(o),h=i.getEndOffset(o));else if(d&&l!==h){let t=a(e,r,l,h);if(t)return t}d=t}if(d&&l!==h){let t=a(e,r,l,h);if(t)return t}}return null}_findMatchingBracketDown(e,t,i){let n=e.languageId,s=e.forwardRegex,r=1,o=0,a=(t,n,a,l)=>{for(;;){if(i&&++o%100==0&&!i())return x_.INSTANCE;let h=uL.findNextBracketInRange(s,t,n,a,l);if(!h)break;let d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?r++:e.isClose(d)&&r--,0===r)return h;a=h.endColumn-1}return null},l=this.textModel.getLineCount();for(let e=t.lineNumber;e<=l;e++){let i=this.textModel.tokenization.getLineTokens(e),s=i.getCount(),r=this.textModel.getLineContent(e),o=0,l=0,h=0;e===t.lineNumber&&(o=i.findTokenIndexAtOffset(t.column-1),l=t.column-1,h=t.column-1);let d=!0;for(;o<s;o++){let t=i.getLanguageId(o)===n&&!uc(i.getStandardTokenType(o));if(t)d||(l=i.getStartOffset(o)),h=i.getEndOffset(o);else if(d&&l!==h){let t=a(e,r,l,h);if(t)return t}d=t}if(d&&l!==h){let t=a(e,r,l,h);if(t)return t}}return null}findPrevBracket(e){let t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketBefore(t)||null;let i=null,n=null,s=null;for(let e=t.lineNumber;e>=1;e--){let r=this.textModel.tokenization.getLineTokens(e),o=r.getCount(),a=this.textModel.getLineContent(e),l=o-1,h=a.length,d=a.length;if(e===t.lineNumber){l=r.findTokenIndexAtOffset(t.column-1),h=t.column-1,d=t.column-1;let e=r.getLanguageId(l);i!==e&&(i=e,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew)}let u=!0;for(;l>=0;l--){let t=r.getLanguageId(l);if(i!==t){if(n&&s&&u&&h!==d){let t=uL.findPrevBracketInRange(n.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(s,t);u=!1}i=t,n=this.languageConfigurationService.getLanguageConfiguration(i).brackets,s=this.languageConfigurationService.getLanguageConfiguration(i).bracketsNew}let o=!!n&&!uc(r.getStandardTokenType(l));if(o)u?h=r.getStartOffset(l):(h=r.getStartOffset(l),d=r.getEndOffset(l));else if(s&&n&&u&&h!==d){let t=uL.findPrevBracketInRange(n.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(s,t)}u=o}if(s&&n&&u&&h!==d){let t=uL.findPrevBracketInRange(n.reversedRegex,e,a,h,d);if(t)return this._toFoundBracket(s,t)}}return null}findNextBracket(e){let t=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),this.bracketPairsTree.value?.object.getFirstBracketAfter(t)||null;let i=this.textModel.getLineCount(),n=null,s=null,r=null;for(let e=t.lineNumber;e<=i;e++){let i=this.textModel.tokenization.getLineTokens(e),o=i.getCount(),a=this.textModel.getLineContent(e),l=0,h=0,d=0;if(e===t.lineNumber){l=i.findTokenIndexAtOffset(t.column-1),h=t.column-1,d=t.column-1;let e=i.getLanguageId(l);n!==e&&(n=e,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let u=!0;for(;l<o;l++){let t=i.getLanguageId(l);if(n!==t){if(r&&s&&u&&h!==d){let t=uL.findNextBracketInRange(s.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t);u=!1}n=t,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,r=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}let o=!!s&&!uc(i.getStandardTokenType(l));if(o)u||(h=i.getStartOffset(l)),d=i.getEndOffset(l);else if(r&&s&&u&&h!==d){let t=uL.findNextBracketInRange(s.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t)}
193u=o}if(r&&s&&u&&h!==d){let t=uL.findNextBracketInRange(s.forwardRegex,e,a,h,d);if(t)return this._toFoundBracket(r,t)}}return null}findEnclosingBrackets(e,t){let i=this.textModel.validatePosition(e);if(this.canBuildAST){let e=s9.fromPositions(i),t=this.getBracketPairsInRange(s9.fromPositions(i,i)).findLast(t=>void 0!==t.closingBracketRange&&t.range.strictContainsRange(e));return t?[t.openingBracketRange,t.closingBracketRange]:null}let n=xp(t),s=this.textModel.getLineCount(),r=new Map,o=[],a=(e,t)=>{if(!r.has(e)){let i=[];for(let e=0,n=t?t.brackets.length:0;e<n;e++)i[e]=0;r.set(e,i)}o=r.get(e)},l=0,h=(e,t,i,s,r)=>{for(;;){if(n&&++l%100==0&&!n())return x_.INSTANCE;let a=uL.findNextBracketInRange(e.forwardRegex,t,i,s,r);if(!a)break;let h=i.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),d=e.textIsBracket[h];if(d&&(d.isOpen(h)?o[d.index]++:d.isClose(h)&&o[d.index]--,-1===o[d.index]))return this._matchFoundBracket(a,d,!1,n);s=a.endColumn-1}return null},d=null,u=null;for(let e=i.lineNumber;e<=s;e++){let t=this.textModel.tokenization.getLineTokens(e),n=t.getCount(),s=this.textModel.getLineContent(e),r=0,o=0,l=0;if(e===i.lineNumber){r=t.findTokenIndexAtOffset(i.column-1),o=i.column-1,l=i.column-1;let e=t.getLanguageId(r);d!==e&&(d=e,u=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,u))}let c=!0;for(;r<n;r++){let i=t.getLanguageId(r);if(d!==i){if(u&&c&&o!==l){let t=h(u,e,s,o,l);if(t)return xv(t);c=!1}d=i,u=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,u)}let n=!!u&&!uc(t.getStandardTokenType(r));if(n)c||(o=t.getStartOffset(r)),l=t.getEndOffset(r);else if(u&&c&&o!==l){let t=h(u,e,s,o,l);if(t)return xv(t)}c=n}if(u&&c&&o!==l){let t=h(u,e,s,o,l);if(t)return xv(t)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();let n=e.getBracketInfo(i);return n?{range:t,bracketInfo:n}:null}}function xp(e){if(void 0===e)return()=>!0;{let t=Date.now();return()=>Date.now()-t<=e}}class x_{static{this.INSTANCE=new x_}constructor(){this._searchCanceledBrand=void 0}}function xv(e){return e instanceof x_?null:e}class xb extends ro.JT{constructor(e){super(),this.textModel=e,this.colorProvider=new xC,this.onDidChangeEmitter=new sd.Q5,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(e=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){return n||void 0===t||!this.colorizationOptions.enabled?[]:this.textModel.bracketPairs.getBracketsInRange(e,!0).map(e=>({id:`bracket${e.range.toString()}-${e.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(e,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:e.range})).toArray()}getAllDecorations(e,t){return void 0!==e&&this.colorizationOptions.enabled?this.getDecorationsInRange(new s9(1,1,this.textModel.getLineCount(),1),e,t):[]}}class xC{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}function xw(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}CX((e,t)=>{let i=new xC;t.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${e.getColor(wT)}; }`);let n=[wL,wx,wk,wN,wD,wE].map(t=>e.getColor(t)).filter(e=>!!e).filter(e=>!e.isTransparent());for(let e=0;e<30;e++){let s=n[e%n.length];t.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(e)} { color: ${s}; }`)}});class xy{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,n){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=n}toString(){return 0===this.oldText.length?`(insert@${this.oldPosition} "${xw(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${xw(this.oldText)}")`:`(replace@${this.oldPosition} "${xw(this.oldText)}" with "${xw(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){let n=t.length;o7(e,n,i),i+=4;for(let o=0;o<n;o++){var s,r;s=t.charCodeAt(o),e[(r=i)+0]=255&s,s>>>=8,e[r+1]=255&s,i+=2}return i}static _readString(e,t){let i=o6(e,t);return function(e,t,i){let n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?function(e,t,i){let n=[],s=0;for(let o=0;o<i;o++){var r;let i=e[(r=t)+0]<<0>>>0|e[r+1]<<8>>>0;t+=2,n[s++]=String.fromCharCode(i)}return n.join("")}(e,t,i):ug().decode(n)}(e,t+=4,i)}writeSize(){return 8+xy._writeStringSize(this.oldText)+xy._writeStringSize(this.newText)}write(e,t){return o7(e,this.oldPosition,t),t+=4,o7(e,this.newPosition,t),t+=4,t=xy._writeString(e,this.oldText,t),t=xy._writeString(e,this.newText,t)}static read(e,t,i){let n=o6(e,t),s=o6(e,t+=4);t+=4;let r=xy._readString(e,t);t+=xy._writeStringSize(r);let o=xy._readString(e,t);return t+=xy._writeStringSize(o),i.push(new xy(n,r,s,o)),t}}class xS{constructor(e,t){this._prevEdits=e,this._currEdits=t,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let e=0,t=0,i=this._getPrev(e),n=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){let s,r;if(null===i){this._acceptCurr(n),n=this._getCurr(++t);continue}if(null===n){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldEnd<=i.newPosition){this._acceptCurr(n),n=this._getCurr(++t);continue}if(i.newEnd<=n.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(n.oldPosition<i.newPosition){let[e,t]=xS._splitCurr(n,i.newPosition-n.oldPosition);this._acceptCurr(e),n=t;continue}if(i.newPosition<n.oldPosition){let[e,t]=xS._splitPrev(i,n.oldPosition-i.newPosition);this._acceptPrev(e),i=t;continue}if(n.oldEnd===i.newEnd)s=i,r=n,i=this._getPrev(++e),n=this._getCurr(++t);else if(n.oldEnd<i.newEnd){let[e,o]=xS._splitPrev(i,n.oldLength);s=e,r=n,i=o,n=this._getCurr(++t)}else{let[t,o]=xS._splitCurr(n,i.newLength);s=i,r=t,i=this._getPrev(++e),n=o}this._result[this._resultLen++]=new xy(s.oldPosition,s.oldText,r.newPosition,r.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=r.newLength-r.oldLength}let s=xS._merge(this._result);return xS._removeNoOps(s)}_acceptCurr(e){this._result[this._resultLen++]=xS._rebaseCurr(this._prevDeltaOffset,e),this._currDeltaOffset+=e.newLength-e.oldLength}_getCurr(e){return e<this._currLen?this._currEdits[e]:null}_acceptPrev(e){this._result[this._resultLen++]=xS._rebasePrev(this._currDeltaOffset,e),this._prevDeltaOffset+=e.newLength-e.oldLength}_getPrev(e){return e<this._prevLen?this._prevEdits[e]:null}static _rebaseCurr(e,t){return new xy(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new xy(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){let i=e.newText.substr(0,t),n=e.newText.substr(t);return[new xy(e.oldPosition,e.oldText,e.newPosition,i),new xy(e.oldEnd,"",e.newPosition+t,n)]}static _splitCurr(e,t){let i=e.oldText.substr(0,t),n=e.oldText.substr(t);return[new xy(e.oldPosition,i,e.newPosition,e.newText),new xy(e.oldPosition+t,n,e.newEnd,"")]}static _merge(e){if(0===e.length)return e;let t=[],i=0,n=e[0];for(let s=1;s<e.length;
193s++){let r=e[s];n.oldEnd===r.oldPosition?n=new xy(n.oldPosition,n.oldText+r.oldText,n.newPosition,n.newText+r.newText):(t[i++]=n,n=r)}return t[i++]=n,t}static _removeNoOps(e){if(0===e.length)return e;let t=[],i=0;for(let n=0;n<e.length;n++){let s=e[n];s.oldText!==s.newText&&(t[i++]=s)}return t}}let xL=Symbol("TextModelEditSource");class xx{constructor(e,t){this.metadata=e}toString(){return`${this.metadata.source}`}getType(){let e=this.metadata;switch(e.source){case"cursor":return e.kind;case"inlineCompletionAccept":return e.source+(e.$nes?":nes":"");case"unknown":return e.name||"unknown";default:return e.source}}toKey(e,t={}){return Object.entries(this.metadata).filter(([i,n])=>{let s=t[i];return void 0!==s?s:(i.match(/\$/g)||[]).length<=e&&null!=n&&""!==n}).map(([e,t])=>`${e}:${t}`).join("-")}}function xk(e){return new xx(e,xL)}let xN={unknown:e=>xk({source:"unknown",name:e.name}),cursor:e=>xk({source:"cursor",kind:e.kind,detailedSource:e.detailedSource}),setValue:()=>xk({source:"setValue"}),eolChange:()=>xk({source:"eolChange"}),applyEdits:()=>xk({source:"applyEdits"})};class xD{static fromText(e){return new xD(c6.ofText(e).lineCount,0,e.length,0)}static tryCreate(e,t,i,n){if(void 0!==e&&void 0!==t&&void 0!==i&&void 0!==n)return new xD(e,t,i,n)}constructor(e,t,i,n){this.linesAdded=e,this.linesRemoved=t,this.charsAdded=i,this.charsRemoved=n}}function xE(e){return e.toString()}(ng||(ng={})).newId=function(e){return e?e("sgt"):`sgt-${bv()}`};class xT{static create(e,t){let i=e.getAlternativeVersionId(),n=xR(e);return new xT(i,i,n,n,t,t,[])}constructor(e,t,i,n,s,r,o){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=n,this.beforeCursorState=s,this.afterCurs
193orState=r,this.changes=o}append(e,t,i,n,s){if(t.length>0){var r;this.changes=null===(r=this.changes)||0===r.length?t:new xS(r,t).compress()}this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=s}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(o7(e,t?t.length:0,i),i+=4,t)for(let n of t)o7(e,n.selectionStartLineNumber,i),i+=4,o7(e,n.selectionStartColumn,i),i+=4,o7(e,n.positionLineNumber,i),i+=4,o7(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){let n=o6(e,t);t+=4;for(let s=0;s<n;s++){let n=o6(e,t),s=o6(e,t+=4),r=o6(e,t+=4),o=o6(e,t+=4);t+=4,i.push(new s8(n,s,r,o))}return t}serialize(){var e,t;let i=10+xT._writeSelectionsSize(this.beforeCursorState)+xT._writeSelectionsSize(this.afterCursorState)+4;for(let e of this.changes)i+=e.writeSize();let n=new Uint8Array(i),s=0;for(let i of(o7(n,this.beforeVersionId,s),s+=4,o7(n,this.afterVersionId,s),s+=4,e=this.beforeEOL,n[s]=e,s+=1,t=this.afterEOL,n[s]=t,s+=1,s=xT._writeSelections(n,this.beforeCursorState,s),s=xT._writeSelections(n,this.afterCurs
193orState,s),o7(n,this.changes.length,s),s+=4,this.changes))s=i.write(n,s);return n.buffer}static deserialize(e){let t=new Uint8Array(e),i=0,n=o6(t,0),s=o6(t,i+=4),r=t[i+=4],o=t[i+=1];i+=1;let a=[];i=xT._readSelections(t,i,a);let l=[];i=xT._readSelections(t,i,l);let h=o6(t,i);i+=4;let d=[];for(let e=0;e<h;e++)i=xy.read(t,i,d);return new xT(n,s,r,o,a,l,d)}}class xI{get type(){return 0}get resource(){return sJ.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,n){this.label=e,this.code=t,this.model=i,this._data=xT.create(i,n)}toString(){return(this._data instanceof xT?this._data:xT.deserialize(this._data)).changes.map(e=>e.toString()).join(", ")}matchesResource(e){return(sJ.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof xT}append(e,t,i,n,s){this._data instanceof xT&&this._data.append(e,t,i,n,s)}close(){this._data instanceof xT&&(this._data=this._data.serialize())}open(){this._data instanceof xT||(this._data=xT.deserialize(this._data))}undo(){if(sJ.isUri(this.model))throw Error("Invalid SingleModelEditStackElement");this._data instanceof xT&&(this._data=this._data.serialize());let e=xT.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(sJ.isUri(this.model))throw Error("Invalid SingleModelEditStackElement");this._data instanceof xT&&(this._data=this._data.serialize());let e=xT.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof xT&&(this._data=this._data.serialize()),this._data.byteLength+168}}class xM{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){for(let n of(this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map,this._editStackElementsArr)){let e=xE(n.resource);this._editStackElementsMap.set(e,n)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){let t=xE(e);return this._editStackElementsMap.has(t)}setModel(e){let t=xE(sJ.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;let t=xE(e.uri);return!!this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).canAppend(e)}append(e,t,i,n,s){let r=xE(e.uri);this._editStackElementsMap.get(r).append(e,t,i,n,s)}close(){this._isOpen=!1}open(){}undo(){for(let e of(this._isOpen=!1,this._editStackElementsArr))e.undo()}redo(){for(let e of this._editStackElementsArr)e.redo()}heapSize(e){let t=xE(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){let e=[];for(let t of this._editStackElementsArr)e.push(`${dx(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function xR(e){return"\n"===e.getEOL()?0:1}function xA(e){return!!e&&(e instanceof xI||e instanceof xM)}class xO{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){let e=this._undoRedoService.getLastElement(this._model.uri);xA(e)&&e.close()}popStackElement(){let e=this._undoRedoService.getLastElement(this._model.uri);xA(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){let i=this._undoRedoService.getLastElement(this._model.uri);if(xA(i)&&i.canAppend(this._model))return i;let n=new xI((0,rh.NC)(785,"Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){let t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],xR(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n,s=xN.unknown({name:"pushEditOperation"})){let r=this._getOrCreateEditStackElement(e,n),o=this._model.applyEdits(t,!0,s),a=xO._computeCursorState(i,o),l=o.map((e,t)=>({index:t,textChange:e.textChange}));return l.sort((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition),r.append(this._model,l.map(e=>e.textChange),xR(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(e){return(0,o_.dL)(e),null}}}
193class xP{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function xF(e,t,i){let n=Math.min(e.getLineCount(),1e4),s=0,r=0,o="",a=0,l=[0,0,0,0,0,0,0,0,0],h=new xP;for(let d=1;d<=n;d++){let n=e.getLineLength(d),u=e.getLineContent(d),c=n<=65536,g=!1,f=0,m=0,p=0;for(let t=0;t<n;t++){let i=c?u.charCodeAt(t):e.getLineCharCode(d,t);if(9===i)p++;else if(32===i)m++;else{g=!0,f=t;break}}if(!g||(p>0?s++:m>1&&r++,!function(e,t,i,n,s){let r;for(r=0,s.spacesDiff=0,s.looksLikeAlignment=!1;r<t&&r<n&&e.charCodeAt(r)===i.charCodeAt(r);r++);let o=0,a=0;for(let i=r;i<t;i++)32===e.charCodeAt(i)?o++:a++;let l=0,h=0;for(let e=r;e<n;e++)32===i.charCodeAt(e)?l++:h++;if(o>0&&a>0||l>0&&h>0)return;let d=Math.abs(a-h),u=Math.abs(o-l);if(0===d){s.spacesDiff=u,u>0&&0<=l-1&&l-1<e.length&&l<i.length&&32!==i.charCodeAt(l)&&32===e.charCodeAt(l-1)&&44===e.charCodeAt(e.length-1)&&(s.looksLikeAlignment=!0);return}u%d==0&&(s.spacesDiff=u/d)}(o,a,u,f,h),h.looksLikeAlignment&&!(i&&t===h.spacesDiff)))continue;let _=h.spacesDiff;_<=8&&l[_]++,o=u,a=f}let d=i;s!==r&&(d=s<r);let u=t;if(d){let e=d?0:.1*n;[2,4,6,8,3,5,7].forEach(t=>{let i=l[t];i>e&&(e=i,u=t)}),4===u&&l[4]>0&&l[2]>0&&l[2]>=l[4]/2&&(u=2)}return{insertSpaces:d,tabSize:u}}function xB(e){return(1&e.metadata)>>>0}function xV(e,t){e.metadata=254&e.metadata|t<<0}function xW(e){return(2&e.metadata)>>>1==1}function xH(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function xz(e){return(4&e.metadata)>>>2==1}function xU(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function xK(e){return(64&e.metadata)>>>6==1}function x$(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}function xj(e){return(128&e.metadata)>>>7==1}function xq(e,t){e.metadata=127&e.metadata|(t?1:0)<<7}function xG(e,t){e.metadata=231&e.metadata|t<<3}function xQ(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class xY{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,xV(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,xU(this,!1),x$(this,!1),xG(this,1),xQ(this,!1),xq(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,xH(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;let t=this.options.className;xU(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),x$(this,null!==this.options.glyphMarginClassName),xG(this,this.options.stickiness),xQ(this,this.options.collapseOnReplaceEdit),xq(this,this.options.affectsFont??!1)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}let xJ=new xY(null,0,0);xJ.parent=xJ,xJ.left=xJ,xJ.right=xJ,xV(xJ,0);class xZ{constructor(){this.root=xJ,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,s,r,o){return this.root===xJ?[]:function(e,t,i,n,s,r,o,a){let l=e.root,h=0,d=0,u=0,c=[],g=0;for(;l!==xJ;){if(xW(l)){xH(l.left,!1),xH(l.right,!1),l===l.parent.right&&(h-=l.parent.delta),l=l.parent;continue}if(!xW(l.left)){if(h+l.maxEnd<t){xH(l,!0);continue}if(l.left!==xJ){l=l.left;continue}}if((d=h+l.start)>i){xH(l,!0);continue}if((u=h+l.end)>=t){l.setCachedOffsets(d,u,o);let e=!0;n&&l.ownerId&&l.ownerId!==n&&(e=!1),s&&xz(l)&&(e=!1),r&&xj(l)&&(e=!1),a&&!xK(l)&&(e=!1),e&&(c[g++]=l)}if(xH(l,!0),l.right!==xJ&&!xW(l.right)){h+=l.delta,l=l.right;continue}}return xH(e.root,!1),c}(this,e,t,i,n,s,r,o)}search(e,t,i,n,s){return this.root===xJ?[]:function(e,t,i,n,s,r){let o=e.root,a=0,l=0,h=0,d=[],u=0;for(;o!==xJ;){if(xW(o)){xH(o.left,!1),xH(o.right,!1),o===o.parent.right&&(a-=o.parent.delta),o=o.parent;continue}if(o.left!==xJ&&!xW(o.left)){o=o.left;continue}l=a+o.start,h=a+o.end,o.setCachedOffsets(l,h,s);let e=!0;if(t&&o.ownerId&&o.ownerId!==t&&(e=!1),i&&xz(o)&&(e=!1),n&&xj(o)&&(e=!1),r&&!xK(o)&&(e=!1),e&&(d[u++]=o),xH(o,!0),o.right!==xJ&&!xW(o.right)){a+=o.delta,o=o.right;continue}}return xH(e.root,!1),d}(this,e,t,i,n,s)}collectNodesFromOwner(e){return function(e,t){let i=e.root,n=[],s=0;for(;i!==xJ;){if(xW(i)){xH(i.left,!1),xH(i.right,!1),i=i.parent;continue}if(i.left!==xJ&&!xW(i.left)){i=i.left;continue}
193if(i.ownerId===t&&(n[s++]=i),xH(i,!0),i.right!==xJ&&!xW(i.right)){i=i.right;continue}}return xH(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root,i=[],n=0;for(;t!==xJ;){if(xW(t)){xH(t.left,!1),xH(t.right,!1),t=t.parent;continue}if(t.left!==xJ&&!xW(t.left)){t=t.left;continue}if(t.right!==xJ&&!xW(t.right)){t=t.right;continue}i[n++]=t,xH(t,!0)}return xH(e.root,!1),i}(this)}insert(e){x1(this,e),this._normalizeDeltaIfNecessary()}delete(e){x0(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){let i=e,n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;let s=i.start+n,r=i.end+n;i.setCachedOffsets(s,r,t)}acceptReplace(e,t,i,n){let s=function(e,t,i){let n=e.root,s=0,r=0,o=0,a=[],l=0;for(;n!==xJ;){if(xW(n)){xH(n.left,!1),xH(n.right,!1),n===n.parent.right&&(s-=n.parent.delta),n=n.parent;continue}if(!xW(n.left)){if(s+n.maxEnd<t){xH(n,!0);continue}if(n.left!==xJ){n=n.left;continue}}if((r=s+n.start)>i){xH(n,!0);continue}if((o=s+n.end)>=t&&(n.setCachedOffsets(r,o,0),a[l++]=n),xH(n,!0),n.right!==xJ&&!xW(n.right)){s+=n.delta,n=n.right;continue}}return xH(e.root,!1),a}(this,e,e+t);for(let e=0,t=s.length;e<t;e++)x0(this,s[e]);this._normalizeDeltaIfNecessary(),function(e,t,i,n){let s=e.root,r=0,o=n-(i-t);for(;s!==xJ;){if(xW(s)){xH(s.left,!1),xH(s.right,!1),s===s.parent.right&&(r-=s.parent.delta),x7(s),s=s.parent;continue}if(!xW(s.left)){if(r+s.maxEnd<t){xH(s,!0);continue}if(s.left!==xJ){s=s.left;continue}}if(r+s.start>i){s.start+=o,s.end+=o,s.delta+=o,(s.delta<-1073741824||s.delta>1073741824)&&(e.requestNormalizeDelta=!0),xH(s,!0);continue}if(xH(s,!0),s.right!==xJ&&!xW(s.right)){r+=s.delta,s=s.right;continue}}xH(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let r=0,o=s.length;r<o;r++){let o=s[r];o.start=o.cachedAbsoluteStart,o.end=o.cachedAbsoluteEnd,function(e,t,i,n,s){let r=(24&e.metadata)>>>3,o=0===r||2===r,a=1===r||2===r,l=i-t,h=Math.min(l,n),d=e.start,u=!1,c=e.end,g=!1;t<=d&&c<=i&&(32&e.metadata)>>>5==1&&(e.start=t,u=!0,e.end=t,g=!0);{let e=s?1:l>0?2:0;!u&&xX(d,o,t,e)&&(u=!0),!g&&xX(c,a,t,e)&&(g=!0)}if(h>0&&!s){let e=l>n?2:0;!u&&xX(d,o,t+h,e)&&(u=!0),!g&&xX(c,a,t+h,e)&&(g=!0)}{let r=s?1:0;!u&&xX(d,o,i,r)&&(e.start=t+n,u=!0),!g&&xX(c,a,i,r)&&(e.end=t+n,g=!0)}let f=n-l;u||(e.start=Math.max(0,d+f)),g||(e.end=Math.max(0,c+f)),e.start>e.end&&(e.end=e.start)}(o,e,e+t,i,n),o.maxEnd=o.end,x1(this,o)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,function(e){let t=e.root,i=0;for(;t!==xJ;){if(t.left!==xJ&&!xW(t.left)){t=t.left;continue}if(t.right!==xJ&&!xW(t.right)){i+=t.delta,t=t.right;continue}t.start=i+t.start,t.end=i+t.end,t.delta=0,x7(t),xH(t,!0),xH(t.left,!1),xH(t.right,!1),t===t.parent.right&&(i-=t.parent.delta),t=t.parent}xH(e.root,!1)}(this))}}function xX(e,t,i,n){return e<i||!(e>i)&&1!==n&&(2===n||t)}function x1(e,t){if(e.root===xJ)return t.parent=xJ,t.left=xJ,t.right=xJ,xV(t,0),e.root=t,e.root;(function(e,t){let i=0,n=e.root,s=t.start,r=t.end;for(;;){var o,a;if(0>(o=n.start+i,a=n.end+i,s===o?r-a:s-o)){if(n.left===xJ){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===xJ){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}}t.parent=n,t.left=xJ,t.right=xJ,xV(t,1)})(e,t),x3(t.parent);let i=t;for(;i!==e.root&&1===xB(i.parent);)if(i.parent===i.parent.parent.left){let t=i.parent.parent.right;1===xB(t)?(xV(i.parent,0),xV(t,0),xV(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&x5(e,i=i.parent),xV(i.parent,0),xV(i.parent.parent,1),x4(e,i.parent.parent))}else{let t=i.parent.parent.left;1===xB(t)?(xV(i.parent,0),xV(t,0),xV(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&x4(e,i=i.parent),xV(i.parent,0),xV(i.parent.parent,1),x5(e,i.parent.parent))}return xV(e.root,0),t}function x0(e,t){let i,n,s;if(t.left===xJ?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===xJ?(i=t.left,n=t):(i=(n=function(e){for(;e.left!==xJ;)e=e.left;return e}(t.right)).right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root){e.root=i,xV(i,0),t.detach(),x2(),x7(i),e.root.parent=xJ;return}let r=1===xB(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,xV(n,xB(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==xJ&&(n.left.parent=n),n.right!==xJ&&(n.r
193ight.parent=n)),t.detach(),r){x3(i.parent),n!==t&&(x3(n),x3(n.parent)),x2();return}for(x3(i),x3(i.parent),n!==t&&(x3(n),x3(n.parent));i!==e.root&&0===xB(i);)i===i.parent.left?(1===xB(s=i.parent.right)&&(xV(s,0),xV(i.parent,1),x5(e,i.parent),s=i.parent.right),0===xB(s.left)&&0===xB(s.right)?(xV(s,1),i=i.parent):(0===xB(s.right)&&(xV(s.left,0),xV(s,1),x4(e,s),s=i.parent.right),xV(s,xB(i.parent)),xV(i.parent,0),xV(s.right,0),x5(e,i.parent),i=e.root)):(1===xB(s=i.parent.left)&&(xV(s,0),xV(i.parent,1),x4(e,i.parent),s=i.parent.left),0===xB(s.left)&&0===xB(s.right)?(xV(s,1),i=i.parent):(0===xB(s.left)&&(xV(s.right,0),xV(s,1),x5(e,s),s=i.parent.left),xV(s,xB(i.parent)),xV(i.parent,0),xV(s.left,0),x4(e,i.parent),i=e.root));xV(i,0),x2()}function x2(){xJ.parent=xJ,xJ.delta=0,xJ.start=0,xJ.end=0}function x5(e,t){let i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==xJ&&(i.left.parent=t),i.parent=t.parent,t.parent===xJ?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,x7(t),x7(i)}function x4(e,t){let i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==xJ&&(i.right.parent=t),i.parent=t.parent,t.parent===xJ?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,x7(t),x7(i)}function x6(e){let t=e.end;if(e.left!==xJ){let i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==xJ){let i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function x7(e){e.maxEnd=x6(e)}function x3(e){for(;e!==xJ;){let t=x6(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}class x9{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==x8)return ke(this.right);let e=this;for(;e.parent!==x8&&e.parent.left!==e;)e=e.parent;return e.parent===x8?x8:e.parent}prev(){if(this.left!==x8)return kt(this.left);let e=this;for(;e.parent!==x8&&e.parent.right!==e;)e=e.parent;return e.parent===x8?x8:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}let x8=new x9(null,0);function ke(e){for(;e.left!==x8;)e=e.left;return e}function kt(e){for(;e.right!==x8;)e=e.right;return e}function ki(e){return e===x8?0:e.size_left+e.piece.length+ki(e.right)}function kn(e){return e===x8?0:e.lf_left+e.piece.lineFeedCnt+kn(e.right)}function ks(){x8.parent=x8}function kr(e,t){let i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==x8&&(i.left.parent=t),i.parent=t.parent,t.parent===x8?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function ko(e,t){let i=t.left;t.left=i.right,i.right!==x8&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===x8?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function ka(e,t){let i,n,s;if(i=t.left===x8?(n=t).right:t.right===x8?(n=t).left:(n=ke(t.right)).right,n===e.root){e.root=i,i.color=0,t.detach(),ks(),e.root.parent=x8;return}let r=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,kd(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,kd(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==x8&&(n.left.parent=n),n.right!==x8&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,kd(e,n)),t.detach(),i.parent.left===i){let t=ki(i),n=kn(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){let s=t-i.parent.size_left,r=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,kh(e,i.parent,s,r)}}if(kd(e,i.parent),r){ks();return}for(;i!==e.root&&0===i.color;)i===i.parent.left?(1===(s=i.parent.right).color&&(s.color=0,i.parent.color=1,kr(e,i.parent),s=i.parent.right),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.right.color&&(s.left.color=0,s.color=1,ko(e,s),s=i.parent.right),s.c
193olor=i.parent.color,i.parent.color=0,s.right.color=0,kr(e,i.parent),i=e.root)):(1===(s=i.parent.left).color&&(s.color=0,i.parent.color=1,ko(e,i.parent),s=i.parent.left),0===s.left.color&&0===s.right.color?(s.color=1,i=i.parent):(0===s.left.color&&(s.right.color=0,s.color=1,kr(e,s),s=i.parent.left),s.color=i.parent.color,i.parent.color=0,s.left.color=0,ko(e,i.parent),i=e.root));i.color=0,ks()}function kl(e,t){for(kd(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){let i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&kr(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,ko(e,t.parent.parent))}else{let i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&ko(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,kr(e,t.parent.parent))}e.root.color=0}function kh(e,t,i,n){for(;t!==e.root&&t!==x8;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function kd(e,t){let i=0,n=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(i=ki((t=t.parent).left)-t.size_left,n=kn(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}function ku(e){let t;return(t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length)).set(e,0),t}x8.parent=x8,x8.left=x8,x8.right=x8,x8.color=0;class kc{constructor(e,t,i,n,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=s}}function kg(e,t=!0){let i=[0],n=1;for(let t=0,s=e.length;t<s;t++){let r=e.charCodeAt(t);13===r?t+1<s&&10===e.charCodeAt(t+1)?(i[n++]=t+2,t++):i[n++]=t+1:10===r&&(i[n++]=t+1)}return t?ku(i):i}class kf{constructor(e,t,i,n,s){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=n,this.length=s}}class km{constructor(e,t){this.buffer=e,this.lineStarts=t}}class kp{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==x8&&e.iterate(e.root,e=>(e!==x8&&this._pieces.push(e.piece),!0))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class k_{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,i=this._cache;for(let n=0;n<i.length;n++){let s=i[n];if(null===s.node.parent||s.nodeStartOffset>=e){i[n]=null,t=!0;continue}}if(t){let e=[];for(let t of i)null!==t&&e.push(t);this._cache=e}}}class kv{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new km("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=x8,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let t=0,i=e.length;t<i;t++)if(e[t].buffer.length>0){e[t].lineStarts||(e[t].lineStarts=kg(e[t].buffer));let i=new kf(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),n=this.rbInsertRight(n,i)}this._searchCache=new k_(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){let t=65535-Math.floor(21845),i=2*t,n="",s=0,r=[];if(this.iterate(this.root,o=>{let a=this.getNodeContent(o),l=a.length;if(s<=t||s+l<i)return n+=a,s+=l,!0;let h=n.replace(/\r\n|\r|\n/g,e);return r.push(new km(h,kg(h))),n=a,s=l,!0}),s>0){let t=n.replace(/\r\n|\r|\n/g,e);r.push(new km(t,kg(t)))}this.create(r,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new kp(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==x8;)if(n.left!==x8&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e)return(i+=n.size_left)+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1);e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}return i}getPositionAt(e){e=Math.max(0,e=Math.floor(e));let t=this.root,i=0,n=e;for(;t!==x8;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){let s=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+s.index,0===s.index){let e=n-this.getOffsetAt(i+1,1);return new s3(i+1,e+1)}return new s3(i+1,s.remainder+1)}else{if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===x8){let t=this.getOffsetAt(i+1,1);return new s3(i+1,n-e-t+1)}t=t.right}return new s3(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";let i=this.nodeAt2(e.startLineNumber,e.startColumn),n=this.nodeAt2(e.endLineNumber,e.endColumn),s=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?s:s.replace(/\r\n|\r|\n/g,t):s}getValueInRange2(e,t){if(e.node===t.node){let i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(s+e.remainder,s+t.remainder)}let i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start),r=n.substring(s+e.remainder,s+i.piece.length);for(i=i.next();i!==x8;){let e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=e.substring(n,n+t.remainder);break}r+=e.substr(n,i.piece.length),i=i.next()}return r}getLinesContent(){let e=[],t=0,i="",n=!1;return this.iterate(this.root,s=>{if(s===x8)return!0;let r=s.piece,o=r.length;if(0===o)return!0;let a=this._buffers[r.bufferIndex].buffer,l=this._buffers[r.bufferIndex].lineStarts,h=r.start.line,d=r.end.line,u=l[h]+r.start.column;
193if(n&&(10===a.charCodeAt(u)&&(u++,o--),e[t++]=i,i="",n=!1,0===o))return!0;if(h===d)return this._EOLNormalized||13!==a.charCodeAt(u+o-1)?i+=a.substr(u,o):(n=!0,i+=a.substr(u,o-1)),!0;i+=this._EOLNormalized?a.substring(u,Math.max(u,l[h+1]-this._EOLLength)):a.substring(u,l[h+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=h+1;n<d;n++)i=this._EOLNormalized?a.substring(l[n],l[n+1]-this._EOLLength):a.substring(l[n],l[n+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return this._EOLNormalized||13!==a.charCodeAt(l[d]+r.end.column-1)?i=a.substr(l[d],r.end.column):(n=!0,0===r.end.column?t--:i=a.substr(l[d],r.end.column-1)),!0}),n&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e||(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,"")),this._lastVisitedLine.value}_getCharCode(e){if(e.remainder===e.node.piece.length){let t=e.node.next();if(!t)return 0;let i=this._buffers[t.piece.bufferIndex],n=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(n)}{let t=this._buffers[e.node.piece.bufferIndex],i=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(i)}}getLineCharCode(e,t){let i=this.nodeAt2(e,t+1);return this._getCharCode(i)}getLineLength(e){if(e===this.getLineCount()){let t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}getNearestChunk(e){let t=this.nodeAt(e);if(t.remainder===t.node.piece.length){let e=t.node.next();if(!e||e===x8)return"";let i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start);return i.buffer.substring(n,n+e.piece.length)}{let e=this._buffers[t.node.piece.bufferIndex],i=this.offsetInBuffer(t.node.piece.bufferIndex,t.node.piece.start),n=i+t.remainder,s=i+t.node.piece.length;return e.buffer.substring(n,s)}}findMatchesInNode(e,t,i,n,s,r,o,a,l,h,d){let u,c,g;let f=this._buffers[e.piece.bufferIndex],m=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),p=this.offsetInBuffer(e.piece.bufferIndex,s),_=this.offsetInBuffer(e.piece.bufferIndex,r),v={line:0,column:0};t._wordSeparators?(c=f.buffer.substring(p,_),g=e=>e+p,t.reset(0)):(c=f.buffer,g=e=>e,t.reset(p));do if(u=t.next(c)){if(g(u.index)>=_)return h;this.positionInBuffer(e,g(u.index)-m,v);let t=this.getLineFeedCnt(e.piece.bufferIndex,s,v),r=v.line===s.line?v.column-s.column+n:v.column+1,o=r+u[0].length;if(d[h++]=cV(new s9(i+t,r,i+t,o),u,a),g(u.index)+u[0].length>=_)return h;if(h>=l)break}while(u);return h}findMatchesLineByLine(e,t,i,n){let s=[],r=0,o=new cU(t.wordSeparators,t.regex),a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];let l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let h=this.positionInBuffer(a.node,a.remainder),d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,o,e.startLineNumber,e.startColumn,h,d,t,i,n,r,s),s;let u=e.startLineNumber,c=a.node;for(;c!==l.node;){let l=this.getLineFeedCnt(c.piece.bufferIndex,h,c.piece.end);if(l>=1){let a=this._buffers[c.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(c.piece.bufferIndex,c.piece.start),g=a[h.line+l],f=u===e.startLineNumber?e.startColumn:1;if((r=this.findMatchesInNode(c,o,u,f,h,this.positionInBuffer(c,g-d),t,i,n,r,s))>=n)return s;u+=l}let d=u===e.startLineNumber?e.startColumn-1:0;if(u===e.endLineNumber){let a=this.getLineContent(u).substring(d,e.endColumn-1);return r=this._findMatchesInLine(t,o,a,e.endLineNumber,d,r,s,i,n),s}if((r=this._findMatchesInLine(t,o,this.getLineContent(u).substr(d),u,d,r,s,i,n))>=n)return s;u++,c=(a=this.nodeAt2(u,1)).node,h=this.positionInBuffer(a.node,a.remainder)}if(u===e.endLineNumber){let a=u===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(u).substring(a,e.endColumn-1);return r=this._findMatchesInLine(t,o,l,e.endLineNumber,a,r,s,i,n),s}let g=u===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(l.node,o,u,g,h,d,t,i,n,r,s),s}
193_findMatchesInLine(e,t,i,n,s,r,o,a,l){let h;let d=e.wordSeparators;if(!a&&e.simpleSearch){let t=e.simpleSearch,a=t.length,h=i.length,u=-a;for(;-1!==(u=i.indexOf(t,u+a))&&(!(!d||cz(d,i,h,u,a))||(o[r++]=new cR(new s9(n,u+1+s,n,u+1+a+s),null),!(r>=l))););return r}t.reset(0);do if((h=t.next(i))&&(o[r++]=cV(new s9(n,h.index+1+s,n,h.index+1+h[0].length+s),h,a),r>=l))break;while(h);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==x8){let{node:i,remainder:n,nodeStartOffset:s}=this.nodeAt(e),r=i.piece,o=r.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&r.end.line===this._lastChangeBufferPos.line&&r.end.column===this._lastChangeBufferPos.column&&s+r.length===e&&t.length<65535){this.appendToNode(i,t),this.computeBufferMetadata();return}if(s===e)this.insertContentToNodeLeft(t,i),this._searchCache.validate(e);else if(s+i.piece.length>e){let e=[],s=new kf(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),this.offsetInBuffer(o,r.end)-this.offsetInBuffer(o,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&10===this.nodeCharCodeAt(i,n)){let e={line:s.start.line+1,column:0};s=new kf(s.bufferIndex,e,s.end,this.getLineFeedCnt(s.bufferIndex,e,s.end),s.length-1),t+="\n"}if(this.shouldCheckCRLF()&&this.startWithLF(t)){if(13===this.nodeCharCodeAt(i,n-1)){let s=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,s),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a)}else this.deleteNodeTail(i,a);let l=this.createNewPieces(t);s.length>0&&this.rbInsertRight(i,s);let h=i;for(let e=0;e<l.length;e++)h=this.rbInsertRight(h,l[e]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,i)}else{let e=this.createNewPieces(t),i=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)i=this.rbInsertRight(i,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===x8)return;let i=this.nodeAt(e),n=this.nodeAt(e+t),s=i.node,r=n.node;if(s===r){let r=this.positionInBuffer(s,i.remainder),o=this.positionInBuffer(s,n.remainder);if(i.nodeStartOffset===e){if(t===s.piece.length){let e=s.next();ka(this,s),this.validateCRLFWithPrevNode(e),this.computeBufferMetadata();return}this.deleteNodeHead(s,o),this._searchCache.validate(e),this.validateCRLFWithPrevNode(s),this.computeBufferMetadata();return}if(i.nodeStartOffset+s.piece.length===e+t){this.deleteNodeTail(s,r),this.validateCRLFWithNextNode(s),this.computeBufferMetadata();return}this.shrinkNode(s,r,o),this.computeBufferMetadata();return}let o=[],a=this.positionInBuffer(s,i.remainder);this.deleteNodeTail(s,a),this._searchCache.validate(e),0===s.piece.length&&o.push(s);let l=this.positionInBuffer(r,n.remainder);this.deleteNodeHead(r,l),0===r.piece.length&&o.push(r);let h=s.next();for(let e=h;e!==x8&&e!==r;e=e.next())o.push(e);let d=0===s.piece.length?s.prev():s;this.deleteNodes(o),this.validateCRLFWithNextNode(d),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){let i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){let n=t.piece,s={line:n.start.line+1,column:0},r=new kf(n.bufferIndex,s,n.end,this.getLineFeedCnt(n.bufferIndex,s,n.end),n.length-1);t.piece=r,e+="\n",kh(this,t,-1,-1),0===t.piece.length&&i.push(t)}let n=this.createNewPieces(e),s=this.rbInsertLeft(t,n[n.length-1]);for(let e=n.length-2;e>=0;e--)s=this.rbInsertLeft(s,n[e]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");let i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]),s=n;for(let e=1;e<i.length;e++)s=this.rbInsertRight(s,i[e]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){let n=e.piece,s=e.piece.bufferIndex,r=this._buffers[s].lineStarts,o=r[n.start.line]+n.start.column+t,a=n.start.line,l=n.end.line,h=0,d=0,u=0;for(;a<=l&&(u=r[h=a+(l-a)/2|0],h!==l);)if(d=r[h+1],o<u)l=h-1;else if(o>=d)a=h+1;else break;return i?(i.line=h,i.column=o-u,null):{line:h,column:o-u}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;let n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;let s=n[i.line+1],r=n[i.line]+i.column;return s>r+1?i.line-t.line:13===this._buffers[e].buffer.charCodeAt(r-1)?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)ka(this,e[t])}createNewPieces(e){if(e.length>65535){let t=[];for(;e.length>65535;){let i;let n=e.charCodeAt(65534);13===n||n>=55296&&n<=56319?(i=e.substring(0,65534),e=e.substring(65534)):(i=e.substring(0,65535),e=e.substring(65535));let s=kg(i);t.push(new kf(this._buffers.length,{line:0,column:0},{line:s.length-1,column:i.length-s[s.length-1]},s.length-1,i.length)),this._buffers.push(new km(i,s))}let i=kg(e);return t.push(new kf(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new km(e,i)),t}let t=this._buffers[0].buffer.length,i=kg(e,!1),n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},n=this._lastChangeBufferPos;for(let e=0;e<i.length;e++)i[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(0!==t)for(let e=0;e<i.length;e++)i[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}let s=this._buffers[0].buffer.length,r=this._buffers[0].lineStarts.length-1,o=s-this._buffers[0].lineStarts[r],a={line:r,column:o},l=new kf(0,n,a,this.getLineFeedCnt(0,n,a),s-t);return this._lastChangeBufferPos=a,[l]}
193getLineRawContent(e,t=0){let i=this.root,n="",s=this._searchCache.get2(e);if(s){i=s.node;let r=this.getAccumulatedValue(i,e-s.nodeStartLineNumber-1),o=this._buffers[i.piece.bufferIndex].buffer,a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(s.nodeStartLineNumber+i.piece.lineFeedCnt===e)n=o.substring(a+r,a+i.piece.length);else{let n=this.getAccumulatedValue(i,e-s.nodeStartLineNumber);return o.substring(a+r,a+n-t)}}else{let s=0,r=e;for(;i!==x8;)if(i.left!==x8&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){let n=this.getAccumulatedValue(i,e-i.lf_left-2),o=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:s,nodeStartLineNumber:r-(e-1-i.lf_left)}),a.substring(l+n,l+o-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){let t=this.getAccumulatedValue(i,e-i.lf_left-2),s=this._buffers[i.piece.bufferIndex].buffer,r=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=s.substring(r+t,r+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==x8;){let e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){let s=this.getAccumulatedValue(i,0),r=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substring(r,r+s-t);break}{let t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);
193n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==x8;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){let i=e.piece,n=this.positionInBuffer(e,t),s=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){let t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==s)return{index:t,remainder:0}}return{index:s,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;let i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,s=i.start.line+t+1;return s>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[s]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){let i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.end),r=this.offsetInBuffer(i.bufferIndex,t),o=this.getLineFeedCnt(i.bufferIndex,i.start,t),a=o-n,l=r-s,h=i.length+l;e.piece=new kf(i.bufferIndex,i.start,t,o,h),kh(this,e,l,a)}deleteNodeHead(e,t){let i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.start),r=this.getLineFeedCnt(i.bufferIndex,t,i.end),o=this.offsetInBuffer(i.bufferIndex,t),a=r-n,l=s-o,h=i.length+l;e.piece=new kf(i.bufferIndex,t,i.end,r,h),kh(this,e,l,a)}shrinkNode(e,t,i){let n=e.piece,s=n.start,r=n.end,o=n.length,a=n.lineFeedCnt,l=this.getLineFeedCnt(n.bufferIndex,n.start,t),h=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,s);e.piece=new kf(n.bufferIndex,n.start,t,l,h),kh(this,e,h-o,l-a);let d=new kf(n.bufferIndex,i,r,this.getLineFeedCnt(n.bufferIndex,i,r),this.offsetInBuffer(n.bufferIndex,r)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,d);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");let i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;let s=kg(t,!1);for(let e=0;e<s.length;e++)s[e]+=n;if(i){let e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(s.slice(1));let r=this._buffers[0].lineStarts.length-1,o=this._buffers[0].buffer.length-this._buffers[0].lineStarts[r],a={line:r,column:o},l=e.piece.length+t.length,h=e.piece.lineFeedCnt,d=this.getLineFeedCnt(0,e.piece.start,a),u=d-h;e.piece=new kf(e.piece.bufferIndex,e.piece.start,a,d,l),this._lastChangeBufferPos=a,kh(this,e,t.length,u)}nodeAt(e){let t=this.root,i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==x8;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;let i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}else e-=t.size_left+t.piece.length,n+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,n=0;for(;i!==x8;)if(i.left!==x8&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){let s=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){let s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==x8;){if(i.piece.lineFeedCnt>0){let e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1){let e=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:e}}t-=i.piece.length,i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return -1;let i=this._buffers[e.piece.bufferIndex],n=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(n)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===x8||0===e.piece.lineFeedCnt)return!1;let t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;return n!==i.length-1&&!(i[n+1]>s+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(s)}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==x8&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let i;let n=[],s=this._buffers[e.piece.bufferIndex].lineStarts;i=0===e.piece.end.column?{line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};let r=e.piece.length-1,o=e.piece.lineFeedCnt-1;e.piece=new kf(e.piece.bufferIndex,e.piece.start,i,o,r),kh(this,e,-1,-1),0===e.piece.length&&n.push(e);let a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,h=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new kf(t.piece.bufferIndex,a,t.piece.end,h,l),kh(this,t,-1,-1),0===t.piece.length&&n.push(t);let d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let e=0;e<n.length;e++)ka(this,n[e])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let i=t.next();if(this.startWithLF(i)){if(e+="\n",1===i.piece.length)ka(this,i);else{let e=i.piece,t={line:e.start.line+1,column:0},n=e.length-1,s=this.getLineFeedCnt(e.bufferIndex,t,e.end);i.piece=new kf(e.bufferIndex,t,e.end,s,n),kh(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===x8)return t(x8);let i=this.iterate(e.left,t);return i?t(e)&&this.iterate(e.right,t):i}getNodeContent(e){if(e===x8)return"";let t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),s=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,s)}getPieceContent(e){let t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),n=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,n)}rbInsertRight(e,t){let i=new x9(t,1);
193if(i.left=x8,i.right=x8,i.parent=x8,i.size_left=0,i.lf_left=0,this.root===x8)this.root=i,i.color=0;else if(e.right===x8)e.right=i,i.parent=e;else{let t=ke(e.right);t.left=i,i.parent=t}return kl(this,i),i}rbInsertLeft(e,t){let i=new x9(t,1);if(i.left=x8,i.right=x8,i.parent=x8,i.size_left=0,i.lf_left=0,this.root===x8)this.root=i,i.color=0;else if(e.left===x8)e.left=i,i.parent=e;else{let t=kt(e.left);t.right=i,i.parent=t}return kl(this,i),i}}class kb extends ro.JT{constructor(e,t,i,n,s,r,o){super(),this._onDidChangeContent=this._register(new sd.Q5),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._pieceTree=new kv(e,i,o)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:"")}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){let i=this.getPositionAt(e),n=this.getPositionAt(e+t);return new s9(i.lineNumber,i.column,n.lineNumber,n.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";let i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;let i=this.getOffsetAt(e.startLineNumber,e.startColumn),n=this.getOffsetAt(e.endLineNumber,e.endColumn),s=0,r=this._getEndOfLine(t),o=this.getEOL();return r.length!==o.length&&(s=(r.length-o.length)*(e.endLineNumber-e.startLineNumber)),n-i+s}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0,n=e.startLineNumber,s=e.endLineNumber;for(let t=n;t<=s;t++){let r=this.getLineContent(t),o=t===n?e.startColumn-1:0,a=t===s?e.endColumn-1:r.length;for(let e=o;e<a;e++)rq(r.charCodeAt(e))?(i+=1,e+=1):i+=1}return i+this._getEndOfLine(t).length*(s-n)}return this.getValueLengthInRange(e,t)}getNearestChunk(e){return this._pieceTree.getNearestChunk(e)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineFirstNonWhitespaceColumn(e){let t=rM(this.getLineContent(e));return -1===t?0:t+1}getLineLastNonWhitespaceColumn(e){let t=rA(this.getLineContent(e));return -1===t?0:t+2}_getEndOfLine(e){switch(e){case 1:return"\n";case 2:return"\r\n";case 0:return this.getEOL();default:throw Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,s=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,o=!0,a=[];for(let t=0;t<e.length;t++){let i=e[t];o&&i._isTracked&&(o=!1);let h=i.range;if(i.text){let e=!0;if(r||(r=e=!r5(i.text)),!n&&e&&(n=r0(i.text)),!s&&e){var l;l=i.text,s=r4.test(l)}}let d="",u=0,c=0,g=0;if(i.text){let e;[u,c,g,e]=LT(i.text);let t=this.getEOL(),n="\r\n"===t?2:1;d=0===e||e===n?i.text:i.text.replace(/\r\n|\r|\n/g,t)}a[t]={sortIndex:t,identifier:i.identifier||null,range:h,rangeOffset:this.getOffsetAt(h.startLineNumber,h.startColumn),rangeLength:this.getValueLengthInRange(h),text:d,eolCount:u,firstLineLength:c,lastLineLength:g,forceMoveMarkers:!!i.forceMoveMarkers,isAutoWhitespaceEdit:i.isAutoWhitespaceEdit||!1}}a.sort(kb._sortOpsAscending);let h=!1;for(let e=0,t=a.length-1;e<t;e++){let t=a[e].range.getEndPosition(),i=a[e+1].range.getStartPosition();if(i.isBeforeOrEqual(t)){if(i.isBefore(t))throw Error("Overlapping ranges are not allowed!");h=!0}}o&&(a=this._reduceOperations(a));let d=i||t?kb._getInverseEditRanges(a):[],u=[];if(t)for(let e=0;e<a.length;e++){let t=a[e],i=d[e];if(t.isAutoWhitespaceEdit&&t.range.isEmpty())for(let e=i.startLineNumber;e<=i.endLineNumber;e++){let n="";(e!==i.startLineNumber||-1===rM(n=this.getLineContent(t.range.startLineNumber)))&&u.push({lineNumber:e,oldContent:n})}}let c=null;if(i){let e=0;c=[];for(let t=0;t<a.length;t++){let i=a[t],n=d[t],s=this.getValueInRange(i.range),r=i.rangeOffset+e;e+=i.text.length-s.length,c[t]={sortIndex:i.sortIndex,identifier:i.identifier,range:n,text:s,textChange:new xy(i.rangeOffset,s,r,i.text)}}h||c.sort((e,t)=>
193e.sortIndex-t.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=r;let g=this._doApplyEdits(a),f=null;if(t&&u.length>0){u.sort((e,t)=>t.lineNumber-e.lineNumber),f=[];for(let e=0,t=u.length;e<t;e++){let t=u[e].lineNumber;if(e>0&&u[e-1].lineNumber===t)continue;let i=u[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===rM(n)&&f.push(t)}}return this._onDidChangeContent.fire(),new cP(c,g,f)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1,i=e[0].range,n=e[e.length-1].range,s=new s9(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn),r=i.startLineNumber,o=i.startColumn,a=[];for(let i=0,n=e.length;i<n;i++){let n=e[i],s=n.range;t=t||n.forceMoveMarkers,a.push(this.getValueInRange(new s9(r,o,s.startLineNumber,s.startColumn))),n.text.length>0&&a.push(n.text),r=s.endLineNumber,o=s.endColumn}let l=a.join(""),[h,d,u]=LT(l);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:l,eolCount:h,firstLineLength:d,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(kb._sortOpsDescending);let t=[];for(let i=0;i<e.length;i++){let n=e[i],s=n.range.startLineNumber,r=n.range.startColumn,o=n.range.endLineNumber,a=n.range.endColumn;if(s===o&&r===a&&0===n.text.length)continue;n.text?(this._pieceTree.delete(n.rangeOffset,n.rangeLength),this._pieceTree.insert(n.rangeOffset,n.text,!0)):this._pieceTree.delete(n.rangeOffset,n.rangeLength);let l=new s9(s,r,o,a);t.push({range:l,rangeLength:n.rangeLength,text:n.text,rangeOffset:n.rangeOffset,forceMoveMarkers:n.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,n){return this._pieceTree.findMatchesLineByLine(e,t,i,n)}static _getInverseEditRanges(e){let t=[],i=0,n=0,s=null;for(let r=0,o=e.length;r<o;r++){let o,a,l;let h=e[r];if(s?s.range.endLineNumber===h.range.startLineNumber?(o=i,a=n+(h.range.startColumn-s.range.endColumn)):(o=i+(h.range.startLineNumber-s.range.endLineNumber),a=h.range.startColumn):(o=h.range.startLineNumber,a=h.range.startColumn),h.text.length>0){let e=h.eolCount+1;l=1===e?new s9(o,a,o,a+h.firstLineLength):new s9(o,a,o+e-1,h.lastLineLength+1)}else l=new s9(o,a,o,a);i=l.endLineNumber,n=l.endColumn,t.push(l),s=h}return t}static _sortOpsAscending(e,t){let i=s9.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){let i=s9.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class kC{constructor(e,t,i,n,s,r,o,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=r,this._containsUnusualLineTerminators=o,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){let t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){let t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let e=0,n=i.length;e<n;e++){let n=i[e].buffer.replace(/\r\n|\r|\n/g,t),s=kg(n);i[e]=new km(n,s)}let n=new kb(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class kw{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(0===e.length)return;0===this.chunks.length&&r9(e)&&(this.BOM=r3,e=e.substr(1));let t=e.charCodeAt(e.length-1);13===t||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1),this._previousChar=t}_acceptChunk1(e,t){(t||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){let t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,s=0,r=0,o=!0;for(let a=0,l=t.length;a<l;a++){let h=t.charCodeAt(a);
19313===h?a+1<l&&10===t.charCodeAt(a+1)?(r++,e[i++]=a+2,a++):(n++,e[i++]=a+1):10===h?(s++,e[i++]=a+1):o&&9!==h&&(h<32||h>126)&&(o=!1)}let a=new kc(ku(e),n,s,r,o);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new km(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,!t.isBasicASCII&&(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=r0(e)),!this.containsUnusualLineTerminators)&&(this.containsUnusualLineTerminators=r4.test(e))}finish(e=!0){return this._finish(),new kC(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);let t=kg(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}function ky(e,t=iP.ofCaller()){return"string"==typeof e?new kS(e,void 0,t):new kS(void 0,e,t)}class kS extends av{get debugName(){return new ad(this._owner,this._debugName,void 0).getDebugName(this)??"Observable Signal"}toString(){return this.debugName}constructor(e,t,i){super(i),this._debugName=e,this._owner=t}trigger(e,t){if(!e){aM(e=>{this.trigger(e,t)},()=>`Trigger signal ${this.debugName}`);return}for(let i of this._observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}class kL extends av{get debugName(){return this._debugNameData.getDebugName(this)??"LazyObservableValue"}constructor(e,t,i,n){super(n),this._debugNameData=e,this._equalityComparator=i,this._isUpToDate=!0,this._deltas=[],this._updateCounter=0,this._value=t}get(){return this._update(),this._value}_update(){if(!this._isUpToDate){if(this._isUpToDate=!0,this._deltas.length>0){for(let e of this._deltas)for(let t of(a?.handleObservableUpdated(this,{change:e,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0}),this._observers))t.handleChange(this,e);this._deltas.length=0}else for(let e of(a?.handleObservableUpdated(this,{change:void 0,didChange:!0,oldValue:"(unknown)",newValue:this._value,hadValue:!0}),this._observers))e.handleChange(this,void 0)}}_beginUpdate(){if(this._updateCounter++,1===this._updateCounter)for(let e of this._observers)e.beginUpdate(this)}_endUpdate(){if(this._updateCounter--,0===this._updateCounter)for(let e of(this._update(),[...this._observers]))e.endUpdate(this)}addObserver(e){let t=!this._observers.has(e)&&this._updateCounter>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){let t=this._observers.has(e)&&this._updateCounter>0;super.removeObserver(e),t&&e.endUpdate(this)}set(e,t,i){let n;if(!(void 0===i&&this._equalityComparator(this._value,e))){t||(t=n=new aO(()=>{},()=>`Setting ${this.debugName}`));try{if(this._isUpToDate=!1,this._setValue(e),void 0!==i&&this._deltas.push(i),t.updateObserver({beginUpdate:()=>this._beginUpdate(),endUpdate:()=>this._endUpdate(),handleChange:(e,t)=>
193{},handlePossibleChange:e=>{}},this),this._updateCounter>1)for(let e of this._observers)e.handlePossibleChange(this)}finally{n&&n.finish()}}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function kx(e,t,i=iP.ofCaller()){return e.lazy?new kL(new ad(e.owner,e.debugName,void 0),t,e.equalsFn??aa,i):new aK(new ad(e.owner,e.debugName,void 0),t,e.equalsFn??aa,i)}class kk{constructor(){this._onDidChangeVisibleRanges=new sd.Q5,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set,this._viewsChanged=ky(this),this.visibleLineRanges=aL({owner:this,equalsFn:al((e,t)=>e.equals(t))},e=>(this._viewsChanged.read(e),c5.joinMany([...this._views].map(t=>t.state.read(e)?.visibleLineRanges??[]))))}attachView(){let e=new kD(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),this._viewsChanged.trigger(void 0),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0}),this._viewsChanged.trigger(void 0)}}class kN{constructor(e,t){this.visibleLineRanges=e,this.stabilized=t}equals(e){return this===e||!!(0,as.fS)(this.visibleLineRanges,e.visibleLineRanges,(e,t)=>e.equals(t))&&this.stabilized===e.stabilized}}class kD{get state(){return this._state}constructor(e){this.handleStateChange=e,this._state=kx({owner:this,equalsFn:ah((e,t)=>e.equals(t))},void 0)}setVisibleLines(e,t){let i=new kN(e.map(e=>new c5(e.startLineNumber,e.endLineNumber+1)),t);this._state.set(i,void 0,void 0),this.handleStateChange(i)}}class kE extends ro.JT{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new oK(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){(0,as.fS)(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class kT extends ro.JT{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t){super(),this._languageIdCodec=e,this._textModel=t,this._onDidChangeTokens=this._register(new sd.Q5),this.onDidChangeTokens=this._onDidChangeTokens.event}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}}function kI(e,t){let i=e.gotoParent(),n=t.gotoParent();if(i!==n)throw Error("Trees are out of sync");return i&&n}function kM(e,t){do{if(e.currentNode.nextSibling)return function(e,t){let i=e.gotoNextSibling(),n=t.gotoNextSibling();if(i!==n)throw Error("Trees are out of sync");return i&&n}(e,t);e.currentNode.parent&&kI(e,t)}while(e.currentNode.nextSibling||e.currentNode.parent);return!1}var kR=function(e,t){return function(i,n){t(i,n,e)}};let kA=class extends ro.JT{constructor(e,t,i,n,s,r,o){super(),this.languageId=e,this._ranges=t,this._parser=i,this._parserClass=n,this.textModel=s,this._logService=r,this._telemetryService=o,this._tree=aU(this,void 0),this.tree=this._tree,this._treeLastParsedVersion=aU(this,-1),this.treeLastParsedVersion=this._treeLastParsedVersion,this._onDidChangeContentQueue=new oH,this._tree=aU(this,void 0),this.tree=this._tree,this._register((0,ro.OF)(()=>{this._tree.get()?.delete(),this._lastFullyParsed?.delete(),this._lastFullyParsedWithEdits?.delete(),this._parser.delete()})),this.handleContentChange(void 0,this._ranges)}handleContentChange(e,t){let i=this.textModel.getVersionId(),n=[];t&&(n=this._setRanges(t)),e&&this._applyEdits(e.changes),this._onDidChangeContentQueue.clearPending(),this._onDidChangeContentQueue.schedule(async()=>{let e;if(this._store.isDisposed)return;let t=this._lastFullyParsed;this._lastFullyParsedWithEdits&&this._lastFullyParsed&&(e=this._findChangedNodes(this._lastFullyParsedWithEdits,this._lastFullyParsed));let s=await this._parseAndUpdateTree(i);if(s){let r;e?t&&e&&(r=this._findTreeChanges(s,e,n)):this._ranges&&(r=this._ranges.map(e=>({newRange:new s9(e.startPosition.row+1,e.startPosition.column+1,e.endPosition.row+1,e.endPosition.column+1),oldRangeLength:e.endIndex-e.startIndex,newRangeStartOffset:e.startIndex,newRangeEndOffset:e.endIndex}))),r||(r=[{newRange:this.textModel.getFullModelRange(),newRangeStartOffset:0,newRangeEndOffset:this.textModel.getValueLength()}]);let o=this._tree.get();aM(e=>{this._tree.set(s,e,{ranges:r,versionId:i}),this._treeLastParsedVersion.set(i,e)}),o?.delete()}})}_applyEdits(e){for(let t of e){let e=c6.ofRange(s9.lift(t.range)),i=c6.ofText(t.text),n=0===t.text.length?
193i:e.add(i),s={startIndex:t.rangeOffset,oldEndIndex:t.rangeOffset+t.rangeLength,newEndIndex:t.rangeOffset+t.text.length,startPosition:{row:t.range.startLineNumber-1,column:t.range.startColumn-1},oldEndPosition:{row:t.range.endLineNumber-1,column:t.range.endColumn-1},newEndPosition:{row:t.range.startLineNumber+n.lineCount-1,column:n.lineCount?n.columnCount:t.range.endColumn+n.columnCount}};this._tree.get()?.edit(s),this._lastFullyParsedWithEdits?.edit(s)}}_findChangedNodes(e,t){if(this._ranges&&this._ranges.every(t=>t.startPosition.row!==e.rootNode.startPosition.row)||0!==e.rootNode.startPosition.row)return[];let i=e.walk(),n=t.walk(),s=[],r=!0;do if(i.currentNode.hasChanges){let t=i.currentNode.children,o=[],a=t.filter((e,t)=>(!!e?.hasChanges||n.currentNode.children.length<=t)&&(o.push(t),!0));if(0===a.length||i.currentNode.hasError!==n.currentNode.hasError){for(;i.currentNode.parent&&r&&!i.currentNode.isNamed;)r=kI(i,n);let t=i.currentNode,o=function(e,t){let i=t.walk();i.resetTo(e);let n=e.currentNode;do if(i.currentNode.previousSibling&&i.currentNode.endIndex-i.currentNode.startIndex!=0)i.gotoPreviousSibling();else{for(;!i.currentNode.previousSibling&&i.currentNode.parent;)i.gotoParent();i.gotoPreviousSibling()}while(i.currentNode.endIndex>n.startIndex&&(i.currentNode.parent||i.currentNode.previousSibling)&&i.currentNode.id!==n.id);return i.currentNode.id!==n.id&&i.currentNode.endIndex<=n.startIndex?i.currentNode:void 0}(i,e)??t;s.push({startIndex:o.startIndex,endIndex:t.endIndex,startPosition:o.startPosition,endPosition:t.endPosition}),r=kM(i,n)}else a.length>=1&&(r=function(e,t,i){let n=e.gotoFirstChild(),s=t.gotoFirstChild();if(n!==s)throw Error("Trees are out of sync");if(0===i)return n&&s;for(let n=1;n<=i;n++){let i=e.gotoNextSibling(),n=t.gotoNextSibling();if(i!==n)throw Error("Trees are out of sync");if(!i||!n)return!1}return n&&s}(i,n,o[0]))}else r=kM(i,n);while(r);return i.delete(),n.delete(),s}_findTreeChanges(e,t,i){let n=0,s=[];for(let r=0;r<t.length;r++){let o=t[r];if(s.length>0&&o.startIndex>=s[s.length-1].newRangeStartOffset&&o.endIndex<=s[s.length-1].newRangeEndOffset)continue;let a=e.walk(),l=()=>a.startIndex<o.startIndex&&a.endIndex>o.endIndex;for(;l();){let e=a.gotoFirstChild(),t=!1;for(;e;){if(l()&&a.currentNode.isNamed){t=!0;break}e=a.gotoNextSibling()}if(!t){a.gotoParent();break}if(0===a.currentNode.childCount)break}let h=a.currentNode.startPosition,d=a.currentNode.endPosition,u=a.currentNode.startIndex,c=a.currentNode.endIndex,g={newRange:new s9(h.row+1,h.column+1,d.row+1,d.column+1),newRangeStartOffset:u,newRangeEndOffset:c};n<i.length&&kO(i[n],{startIndex:u,endIndex:c})?(i[n].startIndex<g.newRangeStartOffset&&(g.newRange=g.newRange.setStartPosition(i[n].startPosition.row+1,i[n].startPosition.column+1),g.newRangeStartOffset=i[n].startIndex),i[n].endIndex>g.newRangeEndOffset&&(g.newRange=g.newRange.setEndPosition(i[n].endPosition.row+1,i[n].endPosition.column+1),g.newRangeEndOffset=i[n].endIndex),n++):n<i.length&&i[n].endIndex<g.newRangeStartOffset&&s.push({newRange:new s9(i[n].startPosition.row+1,i[n].startPosition.column+1,i[n].endPosition.row+1,i[n].endPosition.column+1),newRangeStartOffset:i[n].startIndex,newRangeEndOffset:i[n].endIndex}),s.length>0&&s[s.length-1].newRangeEndOffset>=g.newRangeStartOffset?(s[s.length-1].newRange=s9.fromPositions(s[s.length-1].newRange.getStartPosition(),g.newRange.getEndPosition()),s[s.length-1].newRangeEndOffset=g.newRangeEndOffset):s.push(g)}return this._constrainRanges(s)}_constrainRanges(e){if(!this._ranges)return e;let t=[],i=0,n=0;for(;i<e.length&&n<this._ranges.length;){let s=e[i],r=this._ranges[n];if(s.newRangeEndOffset<r.startIndex)i++;else if(s.newRangeStartOffset>r.endIndex)n++;else{let e=Math.max(s.newRangeStartOffset,r.startIndex),n=Math.min(s.newRangeEndOffset,r.endIndex),o=s.newRange.intersectRanges(new s9(r.startPosition.row+1,r.startPosition.column+1,r.endPosition.row+1,r.endPosition.column+1));t.push({newRange:o,newRangeEndOffset:n,newRangeStartOffset:e}),n<s.newRangeEndOffset?(s.newRange=s9.fromPositions(o.getEndPosition(),s.newRange.getEndPosition()),s.newRangeStartOffset=n+1):i++}}return t}async _parseAndUpdateTree(e){let t=await this._parse();if(t)return this._lastFullyParsed?.delete(),this._lastFullyParsed=t.copy(),this._lastFullyParsedWithEdits?.delete(),this._lastFullyParsedWithEdits=t.copy(),t;this._tree.get()||this._parser.reset()}_parse(){let e="fullParse";return this._tree.get()&&(e="incrementalParse"),this._parseAndYield(e)}async _parseAndYield(e){let t,i,n=0,s=0,r=this.textModel.getVersionId(),o=(t=performance.now(),function(e){let i=performance.now();return i-t>50&&(t=i,!0)});do{let e=performance.now();i=this._parser.parse((e,t)=>
193this._parseCallback(e),this._tree.get(),{progressCallback:o,includedRanges:this._ranges}),n+=performance.now()-e,s++,await new Promise(e=>(0,sS.fn)(e))}while(!this._store.isDisposed&&!i&&r===this.textModel.getVersionId());return this._sendParseTimeTelemetry(e,n,s),i&&r===this.textModel.getVersionId()?i:void 0}_parseCallback(e){try{return this.textModel.getTextBuffer().getNearestChunk(e)}catch(e){this._logService.debug("Error getting chunk for tree-sitter parsing",e)}}_setRanges(e){let t=[];if(this._ranges)for(let i of e){let e=!1;for(let t=0;t<this._ranges.length;t++){let n=this._ranges[t];if(n.startPosition.row===i.startPosition.row&&n.startPosition.column===i.startPosition.column&&n.endPosition.row===i.endPosition.row&&n.endPosition.column===i.endPosition.column&&n.startIndex===i.startIndex&&n.endIndex===i.endIndex||kO(n,i)){e=!0;break}}e||t.push(i)}else t.push(...e);return this._ranges=e,t}_sendParseTimeTelemetry(e,t,i){this._logService.debug(`Tree parsing (${e}) took ${t} ms and ${i} passes.`),"fullParse"===e?this._telemetryService.publicLog2("treeSitter.fullParse",{languageId:this.languageId,time:t,passes:i}):this._telemetryService.publicLog2("treeSitter.incrementalParse",{languageId:this.languageId,time:t,passes:i})}createParsedTreeSync(e){let t=new this._parserClass;t.setLanguage(this._parser.language);let i=t.parse(e);return t.delete(),i??void 0}};function kO(e,t){return e.startIndex<=t.startIndex&&e.endIndex>=t.startIndex||t.startIndex<=e.startIndex&&t.endIndex>=e.startIndex}kA=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([kR(5,dM),kR(6,da)],kA);class kP{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(0===t){this.insert(e,i);return}if(0===i){this.delete(e,t);return}let n=this._store.slice(0,e),s=this._store.slice(e+t),r=function(e,t){let i=[];for(let n=0;n<e;n++)i[n]=t;return i}(i,this._default);this._store=n.concat(r,s)}delete(e,t){0===t||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;let i=[];for(let e=0;e<t;e++)i[e]=this._default;this._store=(0,as.Zv)(this._store,e,i)}}class kF{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class kB{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){let i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new kF(e,[t]))}finalize(){return this._tokens}}class kV{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new kz(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class kW extends kV{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){let i=this._textModel.getLanguageId();for(;;){let n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;let s=this._textModel.getLineContent(n.lineNumber),r=k$(this._languageIdCodec,i,this.tokenizationSupport,s,!0,n.startState);e.add(n.lineNumber,r.tokens),this.store.setEndState(n.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){let i=this.getStartState(e.lineNumber);if(!i)return 0;let n=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),r=s.substring(0,e.column-1)+t+s.substring(e.column-1),o=new fL(k$(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i).tokens,r,this._languageIdCodec);if(0===o.getCount())return 0;let a=o.findTokenIndexAtOffset(e.column-1);return o.getStandardTokenType(a)}tokenizeLinesAt(e,t){let i=this.getStartState(e);if(!i)return null;let n=this._textModel.getLanguageId(),s=[],r=i;for(let e of t){let t=k$(this._languageIdCodec,n,this.tokenizationSupport,e,!0,r);s.push(new fL(t.tokens,e,this._languageIdCodec)),r=t.endState}return s}hasAccurateTokensForLine(e){return e<this.store.getFirstInvalidEndStateLineNumberOrMax()}isCheapToTokenize(e){let t=this.store.getFirstInvalidEndStateLineNumberOrMax();return!!(e<t||e===t&&2048>this._textModel.getLineLength(e))}tokenizeHeuristically(e,t,i){if(i<=this.store.getFirstInvalidEndStateLineNumberOrMax())return{heuristicTokens:!1};if(t<=this.store.getFirstInvalidEndStateLineNumberOrMax())return this.updateTokensUntilLine(e,i),{heuristicTokens:!1};let n=this.guessStartState(t),s=this._textModel.getLanguageId();for(let r=t;r<=i;r++){let t=this._textModel.getLineContent(r),i=k$(this._languageIdCodec,s,this.tokenizationSupport,t,!0,n);e.add(r,i.tokens),n=i.endState}return{heuristicTokens:!0}}guessStartState(e){let{likelyRelevantLines:t,initialState:i}=kH(this._textModel,e,this);i||(i=this.tokenizationSupport.getInitialState());let n=this._textModel.getLanguageId(),s=i;for(let e of t)s=k$(this._languageIdCodec,n,this.tokenizationSupport,e,!1,s).endState;return s}}function kH(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t),s=[],r=null;for(let o=t-1;n>1&&o>=1;o--){let t=e.getLineFirstNonWhitespaceColumn(o);if(0!==t&&t<n&&(s.push(e.getLineContent(o)),n=t,r=i?.getStartState(o)))break}return s.reverse(),{likelyRelevantLines:s,initialState:r??void 0}}class kz{constructor(e){this.lineCount=e,this._tokenizationStateStore=new kU,this._invalidEndStatesLineNumbers=new kK,this._invalidEndStatesLineNumbers.addRange(new cQ(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,t){if(!t)throw new o_.he("Cannot set null/undefined state");this._invalidEndStatesLineNumbers.delete(e);let i=this._tokenizationStateStore.setEndState(e,t);return i&&e<this.lineCount&&this._invalidEndStatesLineNumbers.addRange(new cQ(e+1,e+2)),i}acceptChange(e,t){this.lineCount+=t-e.length,this._tokenizationStateStore.acceptChange(e,t),this._invalidEndStatesLineNumbers.addRangeAndResize(new cQ(e.startLineNumber,e.endLineNumberExclusive),t)}acceptChanges(e){for(let t of e){let[e]=LT(t.text);this.acceptChange(new c5(t.range.startLineNumber,t.range.endLineNumber+1),e+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new cQ(e.startLineNumber,e.endLineNumberExclusive))}getFirstInvalidEndStateLineNumber(){return this._invalidEndStatesLineNumbers.min}getFirstInvalidEndStateLineNumberOrMax(){return this.getFirstInvalidEndStateLineNumber()||Number.MAX_SAFE_INTEGER}allStatesValid(){return null===this._invalidEndStatesLineNumbers.min}getStartState(e,t){return 1===e?t:this.getEndState(e-1)}getFirstInvalidLine(e){let t=this.getFirstInvalidEndStateLineNumber();if(null===t)return null;let i=this.getStartState(t,e);if(!i)throw new o_.he("Start state must be defined");return{lineNumber:t,startState:i}}}class kU{constructor(){this._lineEndStates=new kP(null)}getEndState(e){return this._lineEndStates.get(e)}setEndState(e,t){let i=this._lineEndStates.get(e);return!(i&&i.equals(t))&&(this._lineEndStates.set(e,t),!0)}acceptChange(e,t){let i=e.length;t>0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class kK{constructor(){this._ranges=[]}get min(){return 0===this._ranges.length?null:this._ranges[0].start}delete(e){let t=this._ranges.findIndex(t=>t.contains(e));if(-1!==t){let i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new cQ(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new cQ(i.start,e):this._ranges.splice(t,1,new cQ(i.start,e),new cQ(e+1,i.endExclusive))}}addRange(e){cQ.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let n=i;for(;!(n>=this._ranges.length||e.endExclusive<this._ranges[n].start);)n++;let s=t-e.length;for(let e=n;e<this._ranges.length;e++)this._ranges[e]=this._ranges[e].delta(s);if(i===n){let n=new cQ(e.start,e.start+t);n.isEmpty||this._ranges.splice(i,0,n)}else{let t=new cQ(Math.min(e.start,this._ranges[i].start),Math.max(e.endExclusive,this._ranges[n-1].endExclusive)+s);t.isEmpty?this._ranges.splice(i,n-i):this._ranges.splice(i,n-i,t)}}toString(){return this._ranges.map(e=>e.toString()).join(" + ")}}function k$(e,t,i,n,s,r){let o=null;if(i)try{o=i.tokenizeEncoded(n,s,r.clone())}catch(e){(0,o_.dL)(e)}return o||(o=fy(e.encodeLanguageId(t),r)),fL.convertToEndOffset(o.tokens,n.length),o}class kj{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}
193handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){!this._isScheduled&&this._tokenizerWithStateStore._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._isScheduled=!0,s(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){let t=Date.now()+e.timeRemaining(),i=()=>{!this._isDisposed&&this._tokenizerWithStateStore._textModel.isAttachedToEditor()&&this._hasLinesToTokenize()&&(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?(0,sS.fn)(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){let e=this._tokenizerWithStateStore._textModel.getLineCount(),t=new kB,i=ck.G.create(!1);do if(i.elapsed()>1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return!!this._tokenizerWithStateStore&&!this._tokenizerWithStateStore.store.allStatesValid()}_tokenizeOneInvalidLine(e){let t=this._tokenizerWithStateStore?.getFirstInvalidLine();return t?(this._tokenizerWithStateStore.updateTokensUntilLine(e,t.lineNumber),t.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){!this._isDisposed&&this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new c5(e,t))}}class kq{get children(){return this._children}get length(){return this._length}constructor(e){this.height=e,this._children=[],this._length=0}static create(e,t){let i=new kq(e.height+1);return i.appendChild(e),i.appendChild(t),i}canAppendChild(){return this._children.length<3}appendChild(e){if(!this.canAppendChild())throw Error("Cannot insert more than 3 children in a ListNode");this._children.push(e),this._length+=e.length,this._updateParentLength(e.length),kG(e)||(e.parent=this)}_updateParentLength(e){let t=this.parent;for(;t;)t._length+=e,t=t.parent}unappendChild(){let e=this._children.pop();return this._length-=e.length,this._updateParentLength(-e.length),e}prependChild(e){if(this._children.length>=3)throw Error("Cannot prepend more than 3 children in a ListNode");this._children.unshift(e),this._length+=e.length,this._updateParentLength(e.length),kG(e)||(e.parent=this)}unprependChild(){let e=this._children.shift();return this._length-=e.length,this._updateParentLength(-e.length),e}lastChild(){return this._children[this._children.length-1]}dispose(){this._children.splice(0,this._children.length)}}function kG(e){return void 0!==e.token}function kQ(e,t){let i,n=e,s=[];for(;;){if(t.height===n.height){i=t;break}if(kG(n))throw Error("unexpected");s.push(n),n=n.lastChild()}for(let e=s.length-1;e>=0;e--){let t=s[e];i&&(t.children.length>=3?i=kq.create(t.unappendChild(),i):(t.appendChild(i),i=void 0))}if(!i)return e;{let t=new kq(i.height+1);return t.appendChild(e),t.appendChild(i),t}}(e8=nf||(nf={}))[e8.None=0]="None",e8[e8.ViewportGuess=1]="ViewportGuess",e8[e8.EditGuess=2]="EditGuess",e8[e8.Accurate=3]="Accurate";class kY{constructor(e){this._textModel=e,this._root=this.createEmptyRoot()}createEmptyRoot(){return{length:this._textModel.getValueLength(),token:0,height:0,tokenQuality:nf.None}}buildStore(e,t){this._root=this.createFromUpdates(e,t)}createFromUpdates(e,t){if(0===e.length)return this.createEmptyRoot();let i={length:e[0].length,token:e[0].token,height:0,tokenQuality:t};for(let n=1;n<e.length;n++)i=kQ(i,{length:e[n].length,token:e[n].token,height:0,tokenQuality:t});return i}update(e,t,i){0!==t.length&&this.replace(e,t[0].startOffsetInclusive,t,i)}delete(e,t){this.replace(e,t,[],nf.EditGuess)}replace(e,t,i,n){let s;let r=t+e,o=[],a=[],l=[{node:this._root,offset:0}];for(;l.length>0;){let e=l.pop(),i=e.offset;if(i<t&&i+e.node.length<=t){kG(e.node)||(e.node.parent=void 0),o.push(e.node);continue}if(kG(e.node)&&i<t&&o.push({length:t-i,token:e.node.token,height:0,tokenQuality:e.node.tokenQuality}),!(t<=i)||!(i+e.node.length<=r)){if(i>=r){kG(e.node)||(e.node.parent=void 0),a.push(e.node);continue}if(kG(e.node)&&i+e.node.length>r){a.push({length:i+e.node.length-r,token:e.node.token,height:0,tokenQuality:e.node.tokenQuality});continue}if(!kG(e.node)){let t=i+e.node.length;for(let i=e.node.children.length-1;i>=0;i--)t-=e.node.children[i].length,l.push({node:e.node.children[i],offset:t})}}}let h=(s=i.length>0?o.concat(this.createFromUpdates(i,n),a):o.concat(a))[0];for(let e=1;e<s.length;e++){var d,u;
193d=h,u=s[e],h=d.height===u.height?kq.create(d,u):d.height>u.height?kQ(d,u):function(e,t){let i=e,n=[];for(;t.height!==i.height;){if(kG(i))throw Error("unexpected");n.push(i),i=i.children[0]}let s=t;for(let e=n.length-1;e>=0;e--){let t=n[e];s&&(t.children.length>=3?s=kq.create(s,t.unprependChild()):(t.prependChild(s),s=void 0))}return s?kq.create(s,e):e}(u,d)}this._root=h??this.createEmptyRoot()}traverseInOrderInRange(e,t,i){let n=[{node:this._root,offset:0}];for(;n.length>0;){let{node:s,offset:r}=n.pop();if(!(r+s.length<=e)&&!(r>=t)){if(i(s,r))return;if(!kG(s)){let e=r+s.length;for(let t=s.children.length-1;t>=0;t--)e-=s.children[t].length,n.push({node:s.children[t],offset:e})}}}}getTokenAt(e){let t;return this.traverseInOrderInRange(e,this._root.length,(e,i)=>!!kG(e)&&(t={token:e.token,startOffsetInclusive:i,length:e.length},!0)),t}getTokensInRange(e,t){let i=[];return this.traverseInOrderInRange(e,t,(n,s)=>{if(kG(n)){let r=n.length,o=s;s<e&&s+n.length>t?(o=e,r=t-e):s<e?(r-=e-s,o=e):s+n.length>t&&(r-=s+n.length-t),i.push({token:n.token,startOffsetInclusive:o,length:r})}return!1}),i}markForRefresh(e,t){this.traverseInOrderInRange(e,t,e=>(kG(e)&&(e.tokenQuality=nf.None),!1))}rangeHasTokens(e,t,i){let n=!0;return this.traverseInOrderInRange(e,t,e=>(kG(e)&&e.tokenQuality<i&&(n=!1),!1)),n}rangeNeedsRefresh(e,t){let i=!1;return this.traverseInOrderInRange(e,t,e=>(kG(e)&&e.tokenQuality!==nf.Accurate&&(i=!0),!1)),i}getNeedsRefresh(){let e=[];return this.traverseInOrderInRange(0,this._textModel.getValueLength(),(t,i)=>(kG(t)&&t.tokenQuality!==nf.Accurate&&(e.length>0&&e[e.length-1].endOffset===i?e[e.length-1].endOffset+=t.length:e.push({startOffset:i,endOffset:i+t.length})),!1)),e}dispose(){let e=[[this._root,!1]];for(;e.length>0;){let[t,i]=e.pop();if(kG(t));else if(i)t.dispose(),t.parent=void 0;else{e.push([t,!0]);for(let i=t.children.length-1;i>=0;i--)e.push([t.children[i],!1])}}this._root=void 0}}let kJ=ht("treeSitterThemeService"),kZ=class extends ro.JT{get _textModel(){return this._tree.textModel}constructor(e,t,i,n,s){var r;super(),this._tree=e,this._highlightingQueries=t,this._languageIdCodec=i,this._visibleLineRanges=n,this._treeSitterThemeService=s,this._onDidChangeTokens=this._register(new sd.Q5),this.onDidChangeTokens=this._onDidChangeTokens.event,this._onDidCompleteBackgroundTokenization=this._register(new sd.Q5),this.onDidChangeBackgroundTokenization=this._onDidCompleteBackgroundTokenization.event,this._encodedLanguageId=this._languageIdCodec.encodeLanguageId(this._tree.languageId),this._register(SC(this._treeSitterThemeService.onChange,()=>{this._updateTheme()})),this._tokenStore=this._register(new kY(this._textModel)),this._accurateVersion=this._textModel.getVersionId(),this._guessVersion=this._textModel.getVersionId(),this._tokenStore.buildStore(this._createEmptyTokens(),nf.None),this._register(aN(e=>{let t=this._visibleLineRanges.read(e);this._parseAndTokenizeViewPort(t)})),this._register(aE({owner:this,changeTracker:(r={tree:this._tree.tree},{createChangeSummary:e=>({changes:[]}),handleChange(e,t){for(let i in r)e.didChange(r[i])&&t.changes.push({key:i,change:e.change});return!0},beforeUpdate(e,t){for(let i in r){if("changes"===i)throw new o_.he('property name "changes" is reserved for change tracking');t[i]=r[i].read(e)}}})},(e,t)=>{let i=t.changes.at(0)?.change;if(t.changes.length>1)throw new o_.he("The tree changed twice in one transaction. This is currently not supported and should not happen.");if(i){if(this.hasTokens())for(let e of i.ranges)this._markForRefresh(e.newRange);this.hasTokens()?this._handleTreeUpdate(i.ranges,i.versionId):this._firstTreeUpdate(i.versionId)}else t.tree&&this._firstTreeUpdate(this._tree.treeLastParsedVersion.read(e))}))}handleContentChanged(e){for(let t of(this._guessVersion=e.versionId,e.changes))if(t.text.length>t.rangeLength){let e;let i=t.rangeOffset>0?t.rangeOffset-1:t.rangeOffset,n=this._tokenStore.getTokenAt(i);n?(e={startOffsetInclusive:n.startOffsetInclusive,length:n.length+t.text.length-t.rangeLength,token:n.token},this._tokenStore.markForRefresh(i,t.rangeOffset+(t.text.length>t.rangeLength?t.text.length:t.rangeLength))):e={startOffsetInclusive:i,length:t.text.length,token:0}
193,this._tokenStore.update(n?.length??0,[e],nf.EditGuess)}else if(t.text.length<t.rangeLength){let e=t.rangeLength-t.text.length;this._tokenStore.delete(e,t.rangeOffset)}}getLineTokens(e){let t=this._textModel.getLineContent(e);return new fL(this.getTokens(e),t,this._languageIdCodec)}_createEmptyTokens(){let e=this._emptyToken(),t=this._textModel.getValueLength();return[this._emptyTokensForOffsetAndLength(0,t,e)]}_emptyToken(){return this._treeSitterThemeService.findMetadata([],this._encodedLanguageId,!1,void 0)}_emptyTokensForOffsetAndLength(e,t,i){return{token:i,length:e+t,startOffsetInclusive:0}}hasAccurateTokensForLine(e){return this.hasTokens(new s9(e,1,e,this._textModel.getLineMaxColumn(e)))}tokenizeLinesAt(e,t){let i=this._guessTokensForLinesContent(e,t),n=[];if(!i)return null;for(let e=0;e<i.length;e++)n.push(new fL(i[e],t[e],this._languageIdCodec));return n}_rangeHasTokens(e,t){return this._tokenStore.rangeHasTokens(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()),t)}hasTokens(e){return!e||this._guessVersion===this._accurateVersion||!this._tokenStore.rangeNeedsRefresh(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()))}getTokens(e){let t=this._textModel.getOffsetAt({lineNumber:e,column:1}),i=this._textModel.getOffsetAt({lineNumber:e,column:this._textModel.getLineLength(e)+1}),n=this._tokenStore.getTokensInRange(t,i),s=new Uint32Array(2*n.length);for(let e=0;e<n.length;e++)s[2*e]=n[e].startOffsetInclusive-t+n[e].length,s[2*e+1]=n[e].token;return s}getTokensInRange(e,t,i,n){let s=n?this._tokenizeCapturesWithMetadata(n,t,i):this._tokenize(e,t,i);if(s?.endOffsetsAndMetadata)return this._rangeTokensAsUpdates(t,s.endOffsetsAndMetadata)}_updateTokensInStore(e,t,i){for(let n of(this._accurateVersion=e,t)){let t;let s=n.newTokens.length>0?n.newTokens[n.newTokens.length-1]:void 0;t=s&&this._guessVersion>=e?s.startOffsetInclusive+s.length-n.newTokens[0].startOffsetInclusive:n.oldRangeLength?n.oldRangeLength:0,this._tokenStore.update(t,n.newTokens,i)}}_markForRefresh(e){this._tokenStore.markForRefresh(this._textModel.getOffsetAt(e.getStartPosition()),this._textModel.getOffsetAt(e.getEndPosition()))}_getNeedsRefresh(){let e=this._tokenStore.getNeedsRefresh();return e?e.map(e=>({range:s9.fromPositions(this._textModel.getPositionAt(e.startOffset),this._textModel.getPositionAt(e.endOffset)),startOffset:e.startOffset,endOffset:e.endOffset})):[]}_parseAndTokenizeViewPort(e){for(let t of e.map(e=>e.toInclusiveRange()).filter(re.$K)){let e=this._textModel.getOffsetAt(t.getStartPosition()),i=this._textModel.getOffsetAt(t.getEndPosition()),n=this._textModel.getVersionId();if(this._rangeHasTokens(t,nf.ViewportGuess))continue;let s=this._textModel.getValueInRange(t),r=this._forceParseAndTokenizeContent(t,e,i,s,!0);if(!r||this._rangeHasTokens(t,nf.ViewportGuess)||0===r.length)continue;let o=r[r.length-1],a=o.startOffsetInclusive+o.length-r[0].startOffsetInclusive;this._updateTokensInStore(n,[{newTokens:r,oldRangeLength:a}],nf.ViewportGuess),this._onDidChangeTokens.fire({changes:{semanticTokensApplied:!1,ranges:[{fromLineNumber:t.startLineNumber,toLineNumber:t.endLineNumber}]}})}}_guessTokensForLinesContent(e,t){if(0===t.length)return;let i=t.join(this._textModel.getEOL()),n=new s9(1,1,e+t.length,t[t.length-1].length+1),s=this._textModel.getOffsetAt({lineNumber:e,column:1}),r=this._forceParseAndTokenizeContent(n,s,s+i.length,i,!1);if(!r)return;let o=Array(t.length),a=0,l=0,h=0;for(let e=0;e<t.length;e++){let i=[],n=!1;for(let s=a;!n&&s<r.length;s++){let o=r[s],d=o.endOffset-h,u=l-h;if(d<=t[e].length)i.push({endOffset:d,metadata:o.metadata}),a++;else if(u<t[e].length){let s={endOffset:t[e].length,metadata:o.metadata};i.push(s),n=!0}else n=!0;l=o.endOffset}o[e]=this._endOffsetTokensToUint32Array(i),h+=t[e].length+this._textModel.getEOL().length}return o}_forceParseAndTokenizeContent(e,t,i,n,s){let r=kH(this._textModel,e.startLineNumber).likelyRelevantLines,o=r.join(this._textModel.getEOL()),a=this._tree.createParsedTreeSync(`${o}${n}`);if(!a)return;let l=new s9(1,1,e.endLineNumber-e.startLineNumber+1+r.length,e.endColumn),h=this.captureAtRange(l),d=this._tokenizeCapturesWithMetadata(h,o.length,i-t+o.length);return(a.delete(),d)?s?this._rangeTokensAsUpdates(t,d.endOffsetsAndMetadata,o.length):d.endOffsetsAndMetadata:void 0}
193_firstTreeUpdate(e){return this._setViewPortTokens(e)}_setViewPortTokens(e){let t=this._visibleLineRanges.get().map(e=>{let t=e.toInclusiveRange();if(!t)return;let i=this._textModel.getOffsetAt(t.getStartPosition()),n=this._textModel.getOffsetAt(t.getEndPosition());return{newRange:t,newRangeEndOffset:n,newRangeStartOffset:i}}).filter(re.$K);return this._handleTreeUpdate(t,e)}_handleTreeUpdate(e,t){let i=[];for(let t=0;t<e.length;t++)if(e[t].newRange.endLineNumber-e[t].newRange.startLineNumber>1e3){let n=e[t].newRange.endLineNumber,s=e[t].newRange.startLineNumber,r=e[t].newRange.startColumn,o=s+1e3;do{let a=new s3(s,r),l=o===e[t].newRange.endLineNumber?e[t].newRange.endColumn:this._textModel.getLineMaxColumn(o),h=new s3(o,l),d=s9.fromPositions(a,h);i.push({range:d,startOffset:this._textModel.getOffsetAt(d.getStartPosition()),endOffset:this._textModel.getOffsetAt(d.getEndPosition())}),s=o+1,r=1,o<n&&o+1e3>n?o=n:o+=1e3}while(o<=n)}else if(0===t||i[t-1].endOffset<e[t].newRangeStartOffset)i.push({range:e[t].newRange,startOffset:e[t].newRangeStartOffset,endOffset:e[t].newRangeEndOffset});else if(i[t-1].endOffset<e[t].newRangeEndOffset){let n=this._textModel.getPositionAt(i[t-1].endOffset+1),s=new s9(n.lineNumber,n.column,e[t].newRange.endLineNumber,e[t].newRange.endColumn);i.push({range:s,startOffset:i[t-1].endOffset+1,endOffset:e[t].newRangeEndOffset})}let n=i.map(e=>this._getCaptures(e.range));return this._updateTreeForRanges(i,t,n).then(()=>{this._textModel.isDisposed()||this._tree.treeLastParsedVersion.get()!==this._textModel.getVersionId()||this._refreshNeedsRefresh(t)})}async _updateTreeForRanges(e,t,i){let n;for(let s=0;s<e.length&&(this._textModel.isDisposed()||t===this._textModel.getVersionId());s++){let r=i[s],o=e[s],a=this.getTokensInRange(o.range,o.startOffset,o.endOffset,r);n=a?{newTokens:a}:{newTokens:[]},this._updateTokensInStore(t,[n],nf.Accurate),this._onDidChangeTokens.fire({changes:{semanticTokensApplied:!1,ranges:[{fromLineNumber:o.range.getStartPosition().lineNumber,toLineNumber:o.range.getEndPosition().lineNumber}]}}),await new Promise(e=>(0,sS.fn)(e))}this._onDidCompleteBackgroundTokenization.fire()}_refreshNeedsRefresh(e){let t=this._getNeedsRefresh();if(0===t.length)return;let i=Array(t.length);for(let e=0;e<t.length;e++){let n=t[e];i[e]={newRange:n.range,newRangeStartOffset:n.startOffset,newRangeEndOffset:n.endOffset}}this._handleTreeUpdate(i,e)}_rangeTokensAsUpdates(e,t,i){let n=[],s=0;for(let r of t){let t;r.endOffset<=s||i&&r.endOffset<i||(t=i&&s<i?{startOffsetInclusive:e+i,length:r.endOffset-i,token:r.metadata}:{startOffsetInclusive:e+s,length:r.endOffset-s,token:r.metadata},n.push(t),s=r.endOffset)}return n}_updateTheme(){let e=this._textModel.getFullModelRange();this._markForRefresh(e),this._parseAndTokenizeViewPort(this._visibleLineRanges.get())}captureAtRange(e){let t=this._tree.tree.get();return t?this._highlightingQueries.captures(t.rootNode,{startPosition:{row:e.startLineNumber-1,column:e.startColumn-1},endPosition:{row:e.endLineNumber-1,column:e.endColumn-1}}).map(e=>({name:e.name,text:e.node.text,node:{startIndex:e.node.startIndex,endIndex:e.node.endIndex,startPosition:{lineNumber:e.node.startPosition.row+1,column:e.node.startPosition.column+1},endPosition:{lineNumber:e.node.endPosition.row+1,column:e.node.endPosition.column+1}},encodedLanguageId:this._encodedLanguageId})):[]}captureAtRangeWithInjections(e){let t=this.captureAtRange(e);for(let i=0;i<t.length;i++){let n=t[i],s=n.node.startPosition.lineNumber,r=n.node.endPosition.lineNumber,o=n.node.startPosition.column,a=n.node.endPosition.column,l=s>e.startLineNumber&&s<e.endLineNumber?s:e.startLineNumber,h=r>e.startLineNumber&&r<e.endLineNumber?r:e.endLineNumber,d=new s9(l,s===e.startLineNumber?o<e.startColumn?e.startColumn:o:s<e.startLineNumber?e.startColumn:o,h,r===e.endLineNumber?a>e.endColumn?e.endColumn:a:r>e.endLineNumber?e.endColumn:a),u=this._getInjectionCaptures(n,d);u&&u.length>0&&(t.splice(i+1,0,...u),i+=u.length)}return t}tokenizeEncoded(e){let t=this._tokenizeEncoded(e);if(!t)return;let i=this._rangeTokensAsUpdates(this._textModel.getOffsetAt({lineNumber:e,column:1}),t.result);t.versionId===this._textModel.getVersionId()&&this._updateTokensInStore(t.versionId,[{newTokens:i,oldRangeLength:this._textModel.getLineLength(e)}],nf.Accurate)}_getCaptures(e){return this.captureAtRangeWithInjections(e)}_tokenize(e,t,i){let n=this._getCaptures(e),s=this._tokenizeCapturesWithMetadata(n,t,i);if(s)return{...s,versionId:this._tree.treeLastParsedVersion.get()}}_createTokensFromCaptures(e,t,i){let n=this._tree.tree.get(),s=ck.G.create(),r=i-t,o=this._languageIdCodec.encodeLanguageId(this._tree.languageId),a=kX[this._tree.languageId]||"source";if(0===e.length)return n?(s.stop(),{endOffsets:[{endOffset:r,scopes:[],encodedLanguageId:o}],captureTime:s.elapsed()}):void 0;let l=Array(e.length);l.fill({endOffset:0,scopes:[a],encodedLanguageId:o});let h=0,d=()=>{l.push({endOffset:0,scopes:[a],encodedLanguageId:o})},u=(e,t)=>
193e.name.includes("punctuation")&&e.text?Array.from(e.text.matchAll(k1)).map(e=>t+e.index):void 0,c=(e,t,i,n)=>{if(void 0!==n){let s=l[n].scopes,r=l[n].bracket;if((n>0?l[n-1].endOffset:0)!==t){let o;if(r&&r.length>0){o=[];let e=[];for(let n=0;n<r.length;n++){let s=r[n];s<t?o.push(s):s>i&&e.push(s)}0===o.length&&(o=void 0),r=0===e.length?void 0:e}l.splice(n,0,{endOffset:t,scopes:[...s],bracket:o,encodedLanguageId:e.encodedLanguageId}),n++,d(),h++}l.splice(n,0,{endOffset:i,scopes:[...s,e.name],bracket:u(e,t),encodedLanguageId:e.encodedLanguageId}),l[h].bracket=r}else l[h]={endOffset:i,scopes:[a,e.name],bracket:u(e,t),encodedLanguageId:e.encodedLanguageId};h++};for(let n=0;n<e.length;n++){let s;let r=e[n],o=r.node.endIndex<i?r.node.endIndex<t?t:r.node.endIndex:i,g=r.node.startIndex<t?t:r.node.startIndex,f=o-t,m=o-g;s=n>0?l[h-1].endOffset:g-t-1;let p=f-m;if(s>=0&&s<p&&(l[h]={endOffset:p,scopes:[a],encodedLanguageId:this._encodedLanguageId},h++,d()),!(m<0)){if(s>=f){let e=h-1,t=l[e].endOffset,i=e>=2?l[e-1].endOffset:0;do{if(i+m===t){if(i===p){l[e].scopes.push(r.name);let t=l[e].bracket;l[e].bracket=t&&t.length>0?t:u(r,p)}}else if(i<=p){c(r,p,f,e);break}i=--e>=1?l[e-1].endOffset:0,t=e>=0?l[e].endOffset:0}while(t>p)}else c(r,p,f)}}l[h-1].endOffset<r&&r-l[h-1].endOffset>0&&(d(),l[h]={endOffset:r,scopes:l[h].scopes,encodedLanguageId:this._encodedLanguageId},h++);for(let e=0;e<l.length;e++)if(0===l[e].endOffset&&0!==e){l.splice(e,l.length-e);break}return{endOffsets:l,captureTime:s.elapsed()}}_getInjectionCaptures(e,t){return[]}_tokenizeCapturesWithMetadata(e,t,i){let n=ck.G.create(),s=this._createTokensFromCaptures(e,t,i);if(!s)return;let r=s.endOffsets;for(let e=0;e<r.length;e++){let t=r[e];t.metadata=this._treeSitterThemeService.findMetadata(t.scopes,t.encodedLanguageId,!!t.bracket&&t.bracket.length>0,void 0)}let o=n.elapsed();return{endOffsetsAndMetadata:r,captureTime:s.captureTime,metadataTime:o}}_tokenizeEncoded(e){let t=this._textModel.getOffsetAt({lineNumber:e,column:1}),i=e+1<=this._textModel.getLineCount()?this._textModel.getOffsetAt({lineNumber:e+1,column:1}):this._textModel.getValueLength(),n=i-t,s=this._tokenize(new s9(e,1,e,n+1),t,i);if(s)return{result:s.endOffsetsAndMetadata,captureTime:s.captureTime,metadataTime:s.metadataTime,versionId:s.versionId}}_endOffsetTokensToUint32Array(e){let t=new Uint32Array(2*e.length);for(let i=0;i<e.length;i++)t[2*i]=e[i].endOffset,t[2*i+1]=e[i].metadata;return t}};kZ=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){kJ(e,t,4)}],kZ);let kX={css:"source.css",typescript:"source.ts",ini:"source.ini",regex:"source.regex"},k1=/[\{\}\[\]\<\>\(\)]/g,k0=ht("treeSitterLibraryService");class k2{constructor(e){this._value=aU(this,void 0),this.promiseResult=this._value,this.promise=e.then(e=>(aM(t=>{this._value.set(new k5(e,void 0),t)}),e),e=>{throw aM(t=>{this._value.set(new k5(void 0,e),t)}),e})}}class k5{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}var k4=function(e,t){return function(i,n){t(i,n,e)}};let k6=class extends kT{constructor(e,t,i,n,s,r){super(t,i),this._languageIdObs=e,this._treeSitterLibraryService=s,this._instantiationService=r,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new sd.Q5),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event;let o=new k2(this._treeSitterLibraryService.getParserClass()),a=ay(this,e=>o.promiseResult?.read(e)?.getDataOrThrow());this._tree=ay(this,e=>{let t=a.read(e);if(!t)return;let i=this._languageIdObs.read(e),n=this._treeSitterLibraryService.getLanguage(i,!1,e);if(!n)return;let s=new t;if(e.store.add((0,ro.OF)(()=>{s.delete()})),s.setLanguage(n),void 0!==this._treeSitterLibraryService.getInjectionQueries(i,e))return e.store.add(this._instantiationService.createInstance(kA,i,void 0,s,t,this._textModel))}),this._tokenizationImpl=ay(this,e=>{let t=this._tree.read(e);if(!t)return;let i=this._treeSitterLibraryService.getHighlightingQueries(t.languageId,e);if(i)return e.store.add(this._instantiationService.createInstance(kZ,t,i,this._languageIdCodec,n))}),this._register(aN(e=>{let t=this._tokenizationImpl.read(e);t&&(e.store.add(t.onDidChangeTokens(e=>{this._onDidChangeTokens.fire(e.changes)}
193)),e.store.add(t.onDidChangeBackgroundTokenization(e=>{this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire()})))}))}getLineTokens(e){let t=this._tokenizationImpl.get();if(!t){let t=this._textModel.getLineContent(e);return fL.createEmpty(t,this._languageIdCodec)}return t.getLineTokens(e)}todo_resetTokenization(e=!0){e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}handleDidChangeAttached(){}handleDidChangeContent(e){if(e.isFlush)this.todo_resetTokenization(!1);else{let t=this._tokenizationImpl.get();t?.handleContentChanged(e)}let t=this._tree.get();t?.handleContentChange(e)}forceTokenization(e){let t=this._tokenizationImpl.get();t&&(t.hasAccurateTokensForLine(e)||t.tokenizeEncoded(e))}hasAccurateTokensForLine(e){let t=this._tokenizationImpl.get();return!!t&&t.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return!0}getTokenTypeIfInsertingCharacter(e,t,i){return 0}tokenizeLinesAt(e,t){let i=this._tokenizationImpl.get();return i?i.tokenizeLinesAt(e,t):null}get hasTokens(){let e=this._tokenizationImpl.get();return!!e&&e.hasTokens()}};k6=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([k4(4,k0),k4(5,he)],k6);class k7{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t,i){if(this._pieces=e||[],this._isComplete=t,i)for(let e of this._pieces)e.reportIfInvalid(i)}setPartial(e,t){let i=e;if(t.length>0){let n=t[0].getRange(),s=t[t.length-1].getRange();if(!n||!s)return e;i=e.plusRange(n).plusRange(s)}let n=null;for(let e=0,t=this._pieces.length;e<t;e++){let s=this._pieces[e];if(s.endLineNumber<i.startLineNumber)continue;if(s.startLineNumber>i.endLineNumber){n=n||{index:e};break}if(s.removeTokens(i),s.isEmpty()){this._pieces.splice(e,1),e--,t--;continue}if(s.endLineNumber<i.startLineNumber)continue;if(s.startLineNumber>i.endLineNumber){n=n||{index:e};continue}let[r,o]=s.split(i);if(r.isEmpty()){n=n||{index:e};continue}o.isEmpty()||(this._pieces.splice(e,1,r,o),e++,t++,n=n||{index:e})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=(0,as.Zv)(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(0===t.getTextLength())return t;let i=this._pieces;if(0===i.length)return t;let n=k7._findFirstPieceWithLine(i,e),s=i[n].getLineTokens(e);if(!s)return t;let r=t.getCount(),o=s.getCount(),a=0,l=[],h=0,d=0,u=(e,t)=>{e!==d&&(d=e,l[h++]=e,l[h++]=t)};for(let e=0;e<o;e++){let i=Math.min(s.getStartCharacter(e),t.getTextLength()),n=Math.min(s.getEndCharacter(e),t.getTextLength()),o=s.getMetadata(e),l=((1&o?2048:0)|(2&o?4096:0)|(4&o?8192:0)|(8&o?16384:0)|(16&o?16744448:0)|(32&o?4278190080:0))>>>0,h=~l>>>0;for(;a<r&&t.getEndOffset(a)<=i;)u(t.getEndOffset(a),t.getMetadata(a)),a++;for(a<r&&t.getStartOffset(a)<i&&u(i,t.getMetadata(a));a<r&&t.getEndOffset(a)<n;)u(t.getEndOffset(a),t.getMetadata(a)&h|o&l),a++;if(a<r)u(n,t.getMetadata(a)&h|o&l),t.getEndOffset(a)===n&&a++;else{let e=Math.min(Math.max(0,a-1),r-1);u(n,t.getMetadata(e)&h|o&l)}}for(;a<r;)u(t.getEndOffset(a),t.getMetadata(a)),a++;return new fL(new Uint32Array(l),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,n=e.length-1;for(;i<n;){let s=i+Math.floor((n-i)/2);if(e[s].endLineNumber<t)i=s+1;else if(e[s].startLineNumber>t)n=s-1;else{for(;s>i&&e[s-1].startLineNumber<=t&&t<=e[s-1].endLineNumber;)s--;return s}}return i}acceptEdit(e,t,i,n,s){for(let r=0;r<this._pieces.length;r++){let o=this._pieces[r];o.acceptEdit(e,t,i,n,s),o.isEmpty()&&(this._pieces.splice(r,1),r--)}}}let k3=new Uint32Array(0).buffer;class k9{static deleteBeginning(e,t){return null===e||e===k3?e:k9.delete(e,0,t)}static deleteEnding(e,t){if(null===e||e===k3)return e;let i=k8(e),n=i[i.length-2];return k9.delete(e,t,n)}static delete(e,t,i){let n,s;if(null===e||e===k3||t===i)return e;let r=k8(e),o=r.length>>>1;if(0===t&&r[r.length-2]===i)return k3;let a=fL.findIndexInTokensArray(r,t),l=a>0?r[a-1<<1]:0;if(i<r[a<<1]){let n=i-t;for(let e=a;
193e<o;e++)r[e<<1]-=n;return e}l!==t?(r[a<<1]=t,n=a+1<<1,s=t):(n=a<<1,s=l);let h=i-t;for(let e=a+1;e<o;e++){let t=r[e<<1]-h;t>s&&(r[n++]=t,r[n++]=r[(e<<1)+1],s=t)}if(n===r.length)return e;let d=new Uint32Array(n);return d.set(r.subarray(0,n),0),d.buffer}static append(e,t){if(t===k3)return e;if(e===k3)return t;if(null===e)return e;if(null===t)return null;let i=k8(e),n=k8(t),s=n.length>>>1,r=new Uint32Array(i.length+n.length);r.set(i,0);let o=i.length,a=i[i.length-2];for(let e=0;e<s;e++)r[o++]=n[e<<1]+a,r[o++]=n[(e<<1)+1];return r.buffer}static insert(e,t,i){if(null===e||e===k3)return e;let n=k8(e),s=n.length>>>1,r=fL.findIndexInTokensArray(n,t);r>0&&n[r-1<<1]===t&&r--;for(let e=r;e<s;e++)n[e<<1]+=i;return e}}function k8(e){return e instanceof Uint32Array?e:new Uint32Array(e)}class Ne{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let n=null;if(t<this._len&&(n=this._lineTokens[t]),null!==n&&n!==k3)return new fL(k8(n),i,this._languageIdCodec);let s=new Uint32Array(2);return s[0]=i.length,s[1]=Nt(this._languageIdCodec.encodeLanguageId(e)),new fL(s,i,this._languageIdCodec)}static _massageTokens(e,t,i){let n=i?k8(i):null;if(0===t){let t=!1;if(n&&n.length>1&&(t=fS.getLanguageId(n[1])!==e),!t)return k3}if(!n||0===n.length){let i=new Uint32Array(2);return i[0]=t,i[1]=Nt(e),i.buffer}return(n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength)?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;let i=[];for(let e=0;e<t;e++)i[e]=null;this._lineTokens=(0,as.Zv)(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,n,s){let r=Ne._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,n);this._ensureLine(t);let o=this._lineTokens[t];return this._lineTokens[t]=r,!!s&&!Ne._equals(o,r)}static _equals(e,t){if(!e||!t)return!e&&!t;let i=k8(e),n=k8(t);if(i.length!==n.length)return!1;for(let e=0,t=i.length;e<t;e++)if(i[e]!==n[e])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new s3(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){let t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=k9.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=k9.deleteEnding(this._lineTokens[t],e.startColumn-1);let i=e.endLineNumber-1,n=null;i<this._len&&(n=k9.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=k9.append(this._lineTokens[t],n),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(0===t&&0===i)return;let n=e.lineNumber-1;if(!(n>=this._len)){if(0===t){this._lineTokens[n]=k9.insert(this._lineTokens[n],e.column-1,i);return}this._lineTokens[n]=k9.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=k9.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(0===e.length)return{changes:[]};let i=[];for(let n=0,s=e.length;n<s;n++){let s=e[n],r=0,o=0,a=!1;for(let e=s.startLineNumber;e<=s.endLineNumber;e++)a?(this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),s.getLineTokens(e),!1),o=e):this.setTokens(t.getLanguageId(),e-1,t.getLineLength(e),s.getLineTokens(e),!0)&&(a=!0,r=e,o=e);a&&i.push({fromLineNumber:r,toLineNumber:o})}return{changes:i}}}function Nt(e){return(e<<0|33588224)>>>0}class Ni extends kT{constructor(e,t,i,n){super(e,t),this.getLanguageId=i,this._tokenizer=null,this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new sd.Q5),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new ro.XK),this._tokens=new Ne(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new ro.XK),this._attachedViewStates=this._register(new ro.b2),this._register(rp.onDidChange(e=>{let t=this.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&this.todo_resetTokenization()})),this.todo_resetTokenization(),this._register(n.onDidChangeVisibleRanges(({view:e,state:t})=>{if(t){let i=this._attachedViewStates.get(e);i||(i=new kE(()=>
193this.refreshRanges(i.lineRanges)),this._attachedViewStates.set(e,i)),i.handleStateChange(t)}else this._attachedViewStates.deleteAndDispose(e)}))}todo_resetTokenization(e=!0){this._tokens.flush(),this._debugBackgroundTokens?.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new kz(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});let[t,i]=(()=>{let e;if(this._textModel.isTooLargeForTokenization())return[null,null];let t=rp.get(this.getLanguageId());if(!t)return[null,null];try{e=t.getInitialState()}catch(e){return(0,o_.dL)(e),[null,null]}return[t,e]})();if(t&&i?this._tokenizer=new kW(this._textModel.getLineCount(),t,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){let e={setTokens:e=>{this.setTokens(e)},backgroundTokenizationFinished:()=>{2!==this._backgroundTokenizationState&&(this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire())},setEndState:(e,t)=>{if(!this._tokenizer)return;let i=this._tokenizer.store.getFirstInvalidEndStateLineNumber();null!==i&&e>=i&&this._tokenizer?.store.setEndState(e,t)}};t&&t.createBackgroundTokenizer&&!t.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=t.createBackgroundTokenizer(this._textModel,e)),this._backgroundTokenizer.value||this._textModel.isTooLargeForTokenization()||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new kj(this._tokenizer,e),this._defaultBackgroundTokenizer.handleChanges()),t?.backgroundTokenizerShouldOnlyVerifyTokens&&t.createBackgroundTokenizer?(this._debugBackgroundTokens=new Ne(this._languageIdCodec),this._debugBackgroundStates=new kz(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=t.createBackgroundTokenizer(this._textModel,{setTokens:e=>{this._debugBackgroundTokens?.setMultilineTokens(e,this._textModel)},backgroundTokenizationFinished(){},setEndState:(e,t)=>{this._debugBackgroundStates?.setEndState(e,t)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){this._defaultBackgroundTokenizer?.handleChanges()}handleDidChangeContent(e){if(e.isFlush)this.todo_resetTokenization(!1);else if(!e.isEolChange){for(let t of e.changes){let[e,i]=LT(t.text);this._tokens.acceptEdit(t.range,e,i),this._debugBackgroundTokens?.acceptEdit(t.range,e,i)}this._debugBackgroundStates?.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),this._defaultBackgroundTokenizer?.handleChanges()}}setTokens(e){let{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){let e=c5.joinMany([...this._attachedViewStates].map(([e,t])=>t.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(let t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);let i=new kB,{heuristicTokens:n}=this._tokenizer.tokenizeHeuristically(i,e,t),s=this.setTokens(i.finalize());if(n)for(let e of s.changes)this._backgroundTokenizer.value?.requestTokens(e.fromLineNumber,e.toLineNumber+1);this._defaultBackgroundTokenizer?.checkFinished()}forceTokenization(e){let t=new kB;this._tokenizer?.updateTokensUntilLine(t,e),this.setTokens(t.finalize()),this._defaultBackgroundTokenizer?.checkFinished()}hasAccurateTokensForLine(e){return!this._tokenizer||this._tokenizer.hasAccurateTokensForLine(e)}isCheapToTokenize(e){return!this._tokenizer||this._tokenizer.isCheapToTokenize(e)}getLineTokens(e){let t=this._textModel.getLineContent(e),i=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,t);
193if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){let n=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,t);!i.equals(n)&&this._debugBackgroundTokenizer.value?.reportMismatchingTokens&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return i}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;let n=this._textModel.validatePosition(new s3(e,t));return this.forceTokenization(n.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(n,i)}tokenizeLinesAt(e,t){return this._tokenizer?(this.forceTokenization(e),this._tokenizer.tokenizeLinesAt(e,t)):null}get hasTokens(){return this._tokens.hasTokens}}var Nn=function(e,t){return function(i,n){t(i,n,e)}};let Ns=nm=class extends w2{constructor(e,t,i,n,s,r,o,a){super(),this._textModel=e,this._bracketPairsTextModelPart=t,this._languageId=i,this._attachedViews=n,this._languageService=s,this._languageConfigurationService=r,this._instantiationService=o,this._treeSitterLibraryService=a,this._languageIdObs=aU(this,this._languageId),this._useTreeSitter=ay(this,e=>{let t=this._languageIdObs.read(e);return this._treeSitterLibraryService.supportsLanguage(t,e)}),this.tokens=ay(this,e=>{let t;return t=this._useTreeSitter.read(e)?e.store.add(this._instantiationService.createInstance(k6,this._languageIdObs,this._languageService.languageIdCodec,this._textModel,this._attachedViews.visibleLineRanges)):e.store.add(new Ni(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),e.store.add(t.onDidChangeTokens(e=>{this._emitModelTokensChangedEvent(e)})),e.store.add(t.onDidChangeBackgroundTokenizationState(e=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()})),t});let l=!1;this.tokens.recomputeInitiallyAndOnChange(this._store,e=>{l&&e.todo_resetTokenization(),l=!0}),this._semanticTokens=new k7(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new sd.Q5),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new sd.Q5),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new sd.Q5),this.onDidChangeTokens=this._onDidChangeTokens.event}handleLanguageConfigurationServiceChange(e){e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(let t of e.changes){let[e,i,n]=LT(t.text);this._semanticTokens.acceptEdit(t.range,e,i,n,t.text.length>0?t.text.charCodeAt(0):0)}this.tokens.get().handleDidChangeContent(e)}handleDidChangeAttached(){this.tokens.get().handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);let t=this.tokens.get().getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new o_.he("Illegal value for lineNumber")}get hasTokens(){return this.tokens.get().hasTokens}resetTokenization(){this.tokens.get().todo_resetTokenization()}get backgroundTokenizationState(){return this.tokens.get().backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.tokens.get().forceTokenization(e)}hasAccurateTokensForLine(e){return this.validateLineNumber(e),this.tokens.get().hasAccurateTokensForLine(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.tokens.get().isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.tokens.get().tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.tokens.get().getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLinesAt(e,t){return this.tokens.get().tokenizeLinesAt(e,t)}setSemanticTokens(e,t){this._semanticTokens.set(e,t,this._textModel),this._emitModelTokensChangedEvent({semanticTokensApplied:null!==e,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;let i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();let t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),n=this.getLineTokens(t.lineNumber),s=n.findTokenIndexAtOffset(t.column-1),[r,o]=nm._findLanguageBoundaries(n,s),a=(0,ur.t2)(t.column,this.getLanguageConfiguration(n.getLanguageId(s)).getWordDefinition(),i.substring(r,o),r);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;
193if(s>0&&r===t.column-1){let[r,o]=nm._findLanguageBoundaries(n,s-1),a=(0,ur.t2)(t.column,this.getLanguageConfiguration(n.getLanguageId(s-1)).getWordDefinition(),i.substring(r,o),r);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){let i=e.getLanguageId(t),n=0;for(let s=t;s>=0&&e.getLanguageId(s)===i;s--)n=e.getStartOffset(s);let s=e.getLineContent().length;for(let n=t,r=e.getCount();n<r&&e.getLanguageId(n)===i;n++)s=e.getEndOffset(n);return[n,s]}getWordUntilPosition(e){let t=this.getWordAtPosition(e);return t?{word:t.word.substr(0,e.column-t.startColumn),startColumn:t.startColumn,endColumn:e.column}:{word:"",startColumn:e.column,endColumn:e.column}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,t){let i=this._textModel.validatePosition(new s3(e,t)),n=this.getLineTokens(i.lineNumber);return n.getLanguageId(n.findTokenIndexAtOffset(i.column-1))}setLanguageId(e,t="api"){if(this._languageId===e)return;let i={oldLanguage:this._languageId,newLanguage:e,source:t};this._languageId=e,this._languageIdObs.set(e,void 0),this._bracketPairsTextModelPart.handleDidChangeLanguage(i),this._onDidChangeLanguage.fire(i),this._onDidChangeLanguageConfiguration.fire({})}};Ns=nm=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Nn(4,uR),Nn(5,u8),Nn(6,he),Nn(7,k0)],Ns);let Nr=ht("undoRedoService");class No{constructor(e,t){this.resource=e,this.elements=t}}class Na{static{this._ID=0}constructor(){this.id=Na._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}static{this.None=new Na}}class Nl{static{this._ID=0}constructor(){this.id=Nl._ID++,this.order=1}nextOrder(){return 0===this.id?0:this.order++}static{this.None=new Nl}}function Nh(e,t){let i=new Set;for(let n of t)e.has(n)&&i.add(n);return i}class Nd{static{np=Symbol.toStringTag}constructor(e,t){for(let i of(this.toKey=t,this._map=new Map,this[np]="SetWithKey",e))this.add(i)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[Symbol.iterator](){return this.values()}}var Nu=function(e,t){return function(i,n){t(i,n,e)}};function Nc(e,t){let i;return(i="string"==typeof e?function(e){let t=new kw;return t.acceptChunk(e),t.finish()}(e):e&&"function"==typeof e.read?function(e){let t;let i=new kw;for(;"string"==typeof(t=e.read());)i.acceptChunk(t);return i.finish()}(e):e).create(t)}let Ng=0;class Nf{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;let e=[],t=0,i=0;for(;;){let n=this._source.read();if(null===n){if(this._eos=!0,0===t)return null;return e.join("")}if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}let Nm=()=>{throw Error("Invalid change accessor")},Np=class extends ro.JT{static{n_=this}static{this._MODEL_SYNC_LIMIT=52428800}static{this.LARGE_FILE_SIZE_THRESHOLD=20971520}static{this.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5}static{this.LARGE_FILE_HEAP_OPERATION_THRESHOLD=268435456}static{this.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:LI.D.tabSize,indentSize:LI.D.indentSize,insertSpaces:LI.D.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:LI.D.trimAutoWhitespace,largeFileOptimizations:LI.D.largeFileOptimizations,bracketPairColorizationOptions:LI.D.bracketPairColorizationOptions}}static resolveOptions(e,t){if(t.detectIndentation){let i=xF(e,t.tabSize,t.insertSpaces);return new cM({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new cM(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}get onDidChangeOptions(){return this._onDidChangeOptions.event}get onDidChangeAttached(){return this._onDidChangeAttached.event}get onDidChangeLineHeight(){return this._onDidChangeLineHeight.event}get onDidChangeFont(){return this._onDidChangeFont.event}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return(0,ro.F8)(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}
193constructor(e,t,i,n=null,s,r,o,a){super(),this._undoRedoService=s,this._languageService=r,this._languageConfigurationService=o,this.instantiationService=a,this._onWillDispose=this._register(new sd.Q5),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new NI((e,t,i)=>this.handleBeforeFireDecorationsChangedEvent(e,t,i))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new sd.Q5),this._onDidChangeAttached=this._register(new sd.Q5),this._onDidChangeInjectedText=this._register(new sd.Q5),this._onDidChangeLineHeight=this._register(new sd.Q5),this._onDidChangeFont=this._register(new sd.Q5),this._eventEmitter=this._register(new NM),this._languageSelectionListener=this._register(new ro.XK),this._deltaDecorationCallCnt=0,this._attachedViews=new kk,Ng++,this.id="$model"+Ng,this.isForSimpleWidget=i.isForSimpleWidget,null==n?this._associatedResource=sJ.parse("inmemory://model/"+Ng):this._associatedResource=n,this._attachedEditorCount=0;let{textBuffer:l,disposable:h}=Nc(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=h;let d=this._buffer.getLineCount(),u=this._buffer.getValueLengthInRange(new s9(1,1,d,this._buffer.getLineLength(d)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=u>n_.LARGE_FILE_SIZE_THRESHOLD||d>n_.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=u>n_.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._options=n_.resolveOptions(this._buffer,i);let c="string"==typeof t?t:t.languageId;"string"!=typeof t&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new xm(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new w6(this,this._languageConfigurationService)),this._decorationProvider=this._register(new xb(this)),this._tokenizationTextModelPart=this.instantiationService.createInstance(Ns,this,this._bracketPairs,c,this._attachedViews),this._isTooLargeForSyncing=u>n_._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=r8(Ng),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new Nb,this._commandManager=new xO(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(c),this._register(this._languageConfigurationService.onDidChange(e=>{this._bracketPairs.handleLanguageConfigurationServiceChange(e),this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(e)}))}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;let e=new kb([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=ro.JT.None}_assertNotDisposed(){if(this._isDisposed)throw new o_.he("Model is disposed!")}getTextBuffer(){return this._assertNotDisposed(),this._buffer}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.f
193ire(new LL(e,t)))}setValue(e,t=xN.setValue()){if(this._assertNotDisposed(),null==e)throw(0,o_.b1)();let{textBuffer:i,disposable:n}=Nc(e,this._options.defaultEOL);this._setValueFromTextBuffer(i,n,t)}_createContentChanged2(e,t,i,n,s,r,o,a,l,h){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:r,isRedoing:o,isFlush:a,detailedReasons:[h],detailedReasonsChangeLengths:[1]}}_setValueFromTextBuffer(e,t,i){this._assertNotDisposed();let n=this.getFullModelRange(),s=this.getValueLengthInRange(n),r=this.getLineCount(),o=this.getLineMaxColumn(r);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new Nb,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new LC([new Lc],this._versionId,!1,!1),this._createContentChanged2(new s9(1,1,r,o),0,s,new s3(r,o),this.getValue(),!1,!1,!0,!1,i))}setEOL(e){this._assertNotDisposed();let t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;let i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new LC([new Lb],this._versionId,!1,!1),this._createContentChanged2(new s9(1,1,s,r),0,n,new s3(s,r),this.getValue(),!1,!1,!1,!0,xN.eolChange()))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){let e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){let n=t[i],s=n.range,r=n.cachedAbsoluteStart-n.start,o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),a=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);n.cachedAbsoluteStart=o,n.cachedAbsoluteEnd=a,n.cachedVersionId=e,n.start=o-r,n.end=a-r,x7(n)}}onBeforeAttached(){return this._attachedEditorCount++,1===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,0===this._attachedEditorCount&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0,i=this._buffer.getLineCount();for(let n=1;n<=i;n++){let i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();let t=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.originalIndentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,s=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,o=new cM({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:r});if(this._options.equals(o))return;let a=this._options.createChangeEvent(o);this._options=o,this._bracketPairs.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();let i=xF(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),bk(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){let t=this.findMatches(r4.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(e=>({range:e.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();
193let t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();let t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new o_.he("Operation would exceed heap memory limits");let i=this.getFullModelRange(),n=this.getValueInRange(i,e);return t?this._buffer.getBOM()+n:n}createSnapshot(e=!1){return new Nf(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();let i=this.getFullModelRange(),n=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+n:n}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new o_.he("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new o_.he("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new o_.he("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new o_.he("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new o_.he("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new o_.he("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){let t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn,s=Math.floor("number"!=typeof i||isNaN(i)?1:i),r=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(s<1)s=1,r=1;else if(s>t)s=t,r=this.getLineMaxColumn(s);else if(r<=1)r=1;else{let e=this.getLineMaxColumn(s);r>=e&&(r=e)}let o=e.endLineNumber,a=e.endColumn,l=Math.floor("number"!=typeof o||isNaN(o)?1:o),h=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,h=1;else if(l>t)l=t,h=this.getLineMaxColumn(l);else if(h<=1)h=1;else{let e=this.getLineMaxColumn(l);h>=e&&(h=e)}return i===s&&n===r&&o===l&&a===h&&e instanceof s9&&!(e instanceof s8)?e:new s9(s,r,l,h)}_isValidPosition(e,t,i){return!("number"!=typeof e||"number"!=typeof t||isNaN(e)||isNaN(t)||e<1||t<1||(0|e)!==e||(0|t)!==t||e>this._buffer.getLineCount())&&(1===t||!(t>this.getLineMaxColumn(e)||1===i&&rq(this._buffer.getLineCharCode(e,t-2))))}_validatePosition(e,t,i){let n=Math.floor("number"!=typeof e||isNaN(e)?1:e),s=Math.floor("number"!=typeof t||isNaN(t)?1:t),r=this._buffer.getLineCount();if(n<1)return new s3(1,1);if(n>r)return new s3(r,this.getLineMaxColumn(r));if(s<=1)return new s3(n,1);let o=this.getLineMaxColumn(n);return s>=o?new s3(n,o):1===i&&rq(this._buffer.getLineCharCode(n,s-2))?new s3(n,s-1):new s3(n,s)}validatePosition(e){return(this._assertNotDisposed(),e instanceof s3&&this._isValidPosition(e.lineNumber,e.column,1))?e:this._validatePosition(e.lineNumber,e.column,1)}isValidRange(e){return this._isValidRange(e,1)}_isValidRange(e,t){let i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(s,r,0))return!1;if(1===t){let e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=r>1&&r<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,r-2):0,o=rq(e),a=rq(t);return!o&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof s9&&!(e instanceof s8)&&this._isValidRange(e,1))return e;
193let t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,s=t.column,r=i.lineNumber,o=i.column;{let e=s>1?this._buffer.getLineCharCode(n,s-2):0,t=o>1&&o<=this._buffer.getLineLength(r)?this._buffer.getLineCharCode(r,o-2):0,i=rq(e),a=rq(t);return i||a?n===r&&s===o?new s9(n,s-1,r,o-1):i&&a?new s9(n,s-1,r,o+1):i?new s9(n,s-1,r,o):new s9(n,s,r,o+1):new s9(n,s,r,o)}}modifyPosition(e,t){this._assertNotDisposed();let i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();let e=this.getLineCount();return new s9(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,r,o=999){let a;this._assertNotDisposed();let l=null;null!==t&&"boolean"!=typeof t&&(Array.isArray(t)||(t=[t]),t.every(e=>s9.isIRange(e))&&(l=t.map(e=>this.validateRange(e)))),null===l&&(l=[this.getFullModelRange()]),l=l.sort((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn);let h=[];if(h.push(l.reduce((e,t)=>s9.areIntersecting(e,t)?e.plusRange(t):(h.push(e),t))),!i&&0>e.indexOf("\n")){let t=new cF(e,i,n,s).parseSearchRequest();if(!t)return[];a=e=>this.findMatchesLineByLine(e,t,r,o)}else a=t=>cH.findMatches(this,new cF(e,i,n,s),t,r,o);return h.map(a).reduce((e,t)=>e.concat(t),[])}findNextMatch(e,t,i,n,s,r){this._assertNotDisposed();let o=this.validatePosition(t);if(!i&&0>e.indexOf("\n")){let t=new cF(e,i,n,s).parseSearchRequest();if(!t)return null;let a=this.getLineCount(),l=new s9(o.lineNumber,o.column,a,this.getLineMaxColumn(a)),h=this.findMatchesLineByLine(l,t,r,1);return(cH.findNextMatch(this,new cF(e,i,n,s),o,r),h.length>0)?h[0]:(l=new s9(1,1,o.lineNumber,this.getLineMaxColumn(o.lineNumber)),(h=this.findMatchesLineByLine(l,t,r,1)).length>0)?h[0]:null}return cH.findNextMatch(this,new cF(e,i,n,s),o,r)}findPreviousMatch(e,t,i,n,s,r){this._assertNotDisposed();let o=this.validatePosition(t);return cH.findPreviousMatch(this,new cF(e,i,n,s),o,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof cA?e:new cA(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){let t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,n,s){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n,s)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n,s){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){let i=t.map(e=>({range:this.validateRange(e.range),text:e.text})),n=!0;if(e)for(let t=0,s=e.length;t<s;t++){let s=e[t],r=!1;for(let e=0,t=i.length;e<t;e++){let t=i[e].range,n=t.startLineNumber>s.endLineNumber,o=s.startLineNumber>t.endLineNumber;if(!n&&!o){r=!0;break}}if(!r){n=!1;break}}if(n)for(let e=0,n=this._trimAutoWhitespaceLines.length;e<n;e++){let n=this._trimAutoWhitespaceLines[e],s=this.getLineMaxColumn(n),r=!0;for(let e=0,t=i.length;e<t;e++){let t=i[e].range,o=i[e].text;if(!(n<t.startLineNumber||n>t.endLineNumber||n===t.startLineNumber&&t.startColumn===s&&t.isEmpty()&&o&&o.length>0&&"\n"===o.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&o&&o.length>0&&"\n"===o.charAt(o.length-1))){r=!1;break}}if(r){let e=new s9(n,1,n,s);t.push(new cA(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._und
193oRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n,s)}_applyUndo(e,t,i,n){let s=e.map(e=>{let t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new s9(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){let s=e.map(e=>{let t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new s9(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t,i){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();let n=this._validateEditOperations(e);return this._doApplyEdits(n,t??!1,i??xN.applyEdits())}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t,i){let n=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),r=this._buffer.getLineCount(),o=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,0!==o.length){for(let e=0,t=o.length;e<t;e++){let t=o[e];this._decorationsTree.acceptReplace(t.rangeOffset,t.rangeLength,t.text.length,t.forceMoveMarkers)}let e=[];this._increaseVersionId();let t=n;for(let i=0,n=o.length;i<n;i++){let n=o[i],[s]=LT(n.text);this._onDidChangeDecorations.fire();let a=n.range.startLineNumber,l=n.range.endLineNumber,h=l-a,d=Math.min(h,s),u=s-h,c=r-t-u+a,g=c+s,f=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new s3(c,1)),this.getOffsetAt(new s3(g,this.getLineMaxColumn(g))),0),m=Lg.fromDecorations(f),p=new as.H9(m);for(let t=d;t>=0;t--){let i=a+t,n=c+t;p.takeFromEndWhile(e=>e.lineNumber>n);let s=p.takeFromEndWhile(e=>e.lineNumber===n);e.push(new Lf(i,this.getLineContent(n),s))}if(d<h){let t=a+d;e.push(new L_(t+1,l))}if(d<s){let i=new as.H9(m),n=a+d,o=s-d,l=r-t-o+n+1,h=[],u=[];for(let e=0;e<o;e++){let t=l+e;u[e]=this.getLineContent(t),i.takeWhile(e=>e.lineNumber<t),h[e]=i.takeWhile(e=>e.lineNumber===t)}e.push(new Lv(n+1,a+s,u,h))}t+=u}this._emitContentChangedEvent(new LC(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1,detailedReasons:[i],detailedReasonsChangeLengths:[o.length]})}return null===s.reverseEdits?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e,t,i){if(e&&e.size>0){let t=Array.from(e).map(e=>new Lf(e,this.getLineContent(e),this._getInjectedTextInLine(e)));this._onDidChangeInjectedText.fire(new Lw(t))}if(t&&t.size>0){let e=Array.from(t).map(e=>new Lm(e.ownerId,e.decorationId,e.lineNumber,e.lineHeight));this._onDidChangeLineHeight.fire(new Ly(e))}if(i&&i.size>0){let e=Array.from(i).map(e=>new Lp(e.ownerId,e.lineNumber));this._onDidChangeFont.fire(new LS(e))}}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){let i={addDecoration:(t,i)=>this._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(t,i)=>{this._changeDecorationImpl(e,t,i)},changeDecorationOptions:(t,i)=>{this._changeDecorationOptionsImpl(e,t,ND(i))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)},n=null;try{n=t(i)}catch(e){(0,o_.dL)(e)}return i.addDecoration=Nm,i.changeDecoration=Nm,i.changeDecorationOptions=Nm,i.removeDecoration=Nm,i.deltaDecorations=Nm,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),(0,o_.dL)(Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){let n=e?this._decorations[e]:null;if(!n)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:NN[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;
193let s=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),o=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,o,s),n.setOptions(NN[i]),this._decorationsTree.insert(n),n.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;let t=this._decorationsTree.collectNodesFromOwner(e);for(let e=0,i=t.length;e<i;e++){let i=t[e];this._decorationsTree.delete(i),delete this._decorations[i.id]}}getDecorationOptions(e){let t=this._decorations[e];return t?t.options:null}getDecorationRange(e){let t=this._decorations[e];return t?this._decorationsTree.getNodeRange(this,t):null}getLineDecorations(e,t=0,i=!1,n=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i,n)}getLinesDecorations(e,t,i=0,n=!1,s=!1,r=!1){let o=this.getLineCount(),a=Math.min(o,Math.max(1,t)),l=this.getLineMaxColumn(a),h=new s9(Math.min(o,Math.max(1,e)),1,a,l),d=this._getDecorationsInRange(h,i,n,s,r);return(0,as.vA)(d,this._decorationProvider.getDecorationsInRange(h,i,n)),d}getDecorationsInRange(e,t=0,i=!1,n=!1,s=!1,r=!1){let o=this.validateRange(e),a=this._getDecorationsInRange(o,t,i,n,r);return(0,as.vA)(a,this._decorationProvider.getDecorationsInRange(o,t,i,s)),a}getOverviewRulerDecorations(e=0,t=!1,i=!1){return this._decorationsTree.getAll(this,e,t,i,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}getCustomLineHeightsDecorations(e=0){return this._decorationsTree.getAllCustomLineHeights(this,e)}_getInjectedTextInLine(e){let t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),n=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return Lg.fromDecorations(n).filter(t=>t.lineNumber===e)}getFontDecorationsInRange(e,t=0){let i=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),n=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getFontDecorationsInInterval(this,i,n,t)}getAllDecorations(e=0,t=!1,i=!1){return this._decorationsTree.getAll(this,e,t,i,!1,!1).concat(this._decorationProvider.getAllDecorations(e,t))}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!1,!0)}_getDecorationsInRange(e,t,i,n,s){let r=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,r,o,t,i,n,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t,i){let n=this._decorations[t];if(!n)return;if(n.options.after){let e=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(n.options.before){let e=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}if(null!==n.options.lineHeight){let i=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,i.startLineNumber,null)}if(n.options.affectsFont){let i=this.getDecorationRange(t);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,n.id,i.startLineNumber)}let s=this._validateRangeRelaxedNoAllocations(i),r=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),o=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(n),n.reset(this.getVersionId(),r,o,s),this._decorationsTree.insert(n),this._onDidChangeDecorations.checkAffectedAndFire(n.options),n.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),n.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber),null!==n.options.lineHeight&&this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,s.startLineNumber,n.options.lineHeight),n.options.affectsFont&&this._onDidChangeDecorations.recordLineAffectedByFontChange(e,n.id,s.startLineNumber)}_changeDecorationOptionsImpl(e,t,i){let n=this._decorations[t];if(!n)return;let s=!!n.options.overviewRuler&&!!n.options.overviewRuler.color,r=!!i.overviewRuler&&!!i.overviewRuler.color;if(this._onDidChangeDecorations.checkAffectedAndFire(n.options),this._onDidChangeDecorations.checkAffectedAndFire(i),n.options.after||i.after){let e=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(n.options.before||i.before){let e=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}if(null!==n.options.lineHeight||null!==i.lineHeight){let s=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,t,s.startLineNumber,i.lineHeight)}if(n.options.affectsFont||i.affectsFont){let i=this._decorationsTree.getNodeRange(this,n);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,t,i.startLineNumber)}let o=(!!i.after||!!i.before)!==Nv(n);s!==r||o?(this._decorationsTree.delete(n),n.setOptions(i),this._decorationsTree.insert(n)):n.setOptions(i)}_deltaDecorationsImpl(e,t,i,n=!1){let s=this.getVersionId(),r=t.length,o=0,a=i.length,l=0;this._onDidChangeDecorations.beginDeferredEmit();try{let h=Array(a);for(;o<r||l<a;){let d=null;if(o<r){let i;do i=t[o++],d=this._decorations[i];while(!d&&o<r);if(d){if(d.options.after){let e=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(d.options.before){let e=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}if(null!==d.options.lineHeight){let t=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,i,t.startLineNumber,null)}if(d.options.affectsFont){let t=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByFontChange(e,i,t.startLineNumber)}this._decorationsTree.delete(d),n||this._onDidChangeDecorations.checkAffectedAndFire(d.options)}}if(l<a){if(!d){let e=++this._lastDecorationId,t=`${this._instanceId};${e}`;d=new xY(t,0,0),this._decorations[t]=d}
193let t=i[l],r=this._validateRangeRelaxedNoAllocations(t.range),o=ND(t.options),a=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),u=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);d.ownerId=e,d.reset(s,a,u,r),d.setOptions(o),d.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber),d.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber),null!==d.options.lineHeight&&this._onDidChangeDecorations.recordLineAffectedByLineHeightChange(e,d.id,r.startLineNumber,d.options.lineHeight),d.options.affectsFont&&this._onDidChangeDecorations.recordLineAffectedByFontChange(e,d.id,r.startLineNumber),n||this._onDidChangeDecorations.checkAffectedAndFire(o),this._decorationsTree.insert(d),h[l]=d.id,l++}else d&&delete this._decorations[d.id]}return h}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setLanguage(e,t){"string"==typeof e?(this._languageSelectionListener.clear(),this._setLanguage(e,t)):(this._languageSelectionListener.value=e.onDidChange(()=>this._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return function(e){let t=0;for(let i of e)if(" "===i||"	"===i)t++;else break;return t}(this.getLineContent(e))+1}toString(){return`TextModel(${this.uri.toString()})`}};function N_(e){return!!e.options.overviewRuler&&!!e.options.overviewRuler.color}function Nv(e){return!!e.options.after||!!e.options.before}Np=n_=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Nu(4,Nr),Nu(5,uR),Nu(6,u8),Nu(7,he)],Np);class Nb{constructor(){this._decorationsTree0=new xZ,this._decorationsTree1=new xZ,this._injectedTextDecorationsTree=new xZ}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(let i of t)null===i.range&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,s,r,o){let a=e.getVersionId(),l=this._intervalSearch(t,i,n,s,r,a,o);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,n,s,r,o){let a=this._decorationsTree0.intervalSearch(e,t,i,n,s,r,o),l=this._decorationsTree1.intervalSearch(e,t,i,n,s,r,o),h=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,s,r,o);return a.concat(l).concat(h)}getInjectedTextInInterval(e,t,i,n){let s=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,!1,s,!1);return this._ensureNodesHaveRanges(e,r).filter(e=>e.options.showIfCollapsed||!e.range.isEmpty())}getFontDecorationsInInterval(e,t,i,n){let s=e.getVersionId(),r=this._decorationsTree0.intervalSearch(t,i,n,!1,!1,s,!1);return this._ensureNodesHaveRanges(e,r).filter(e=>e.options.affectsFont)}getAllInjectedText(e,t){let i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(e=>e.options.showIfCollapsed||!e.range.isEmpty())}getAllCustomLineHeights(e,t){let i=e.getVersionId(),n=this._search(t,!1,!1,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter(e=>"number"==typeof e.options.lineHeight)}getAll(e,t,i,n,s,r){let o=e.getVersionId(),a=this._search(t,i,n,s,o,r);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,n,s,r){if(n)return this._decorationsTree1.search(e,t,i,s,r);{let n=this._decorationsTree0.search(e,t,i,s,r),o=this._decorationsTree1.search(e,t,i,s,r),a=this._injectedTextDecorationsTree.search(e,t,i,s,r);return n.concat(o).concat(a)}}collectNodesFromOwner(e){let t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),n=this._injectedTextDecorationsTree.collectNodesFromOwner(e);
193return t.concat(i).concat(n)}collectNodesPostOrder(){let e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){Nv(e)?this._injectedTextDecorationsTree.insert(e):N_(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){Nv(e)?this._injectedTextDecorationsTree.delete(e):N_(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){let i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){Nv(e)?this._injectedTextDecorationsTree.resolveNode(e,t):N_(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,n){this._decorationsTree0.acceptReplace(e,t,i,n),this._decorationsTree1.acceptReplace(e,t,i,n),this._injectedTextDecorationsTree.acceptReplace(e,t,i,n)}}function NC(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class Nw{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Ny extends Nw{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:iY.Center}getColor(e){return this._resolvedColor||(vL(e.type)&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if("string"==typeof e)return e;let i=e?t.getColor(e.id):null;return i?i.toString():""}}class NS{constructor(e){this.position=e?.position??iJ.Center,this.persistLane=e?.persistLane}}class NL extends Nw{constructor(e){super(e),this.position=e.position,this.sectionHeaderStyle=e.sectionHeaderStyle??null,this.sectionHeaderText=e.sectionHeaderText??null}getColor(e){return this._resolvedColor||(vL(e.type)&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return"string"==typeof e?gX.fromHex(e):t.getColor(e.id)}}class Nx{static from(e){return e instanceof Nx?e:new Nx(e)}constructor(e){this.content=e.content||"",this.tokens=e.tokens??null,this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Nk{static register(e){return new Nk(e)}static createDynamic(e){return new Nk(e)}constructor(e){this.description=e.description,this.blockClassName=e.blockClassName?NC(e.blockClassName):null,this.blockDoesNotCollapse=e.blockDoesNotCollapse??null,this.blockIsAfterEnd=e.blockIsAfterEnd??null,this.blockPadding=e.blockPadding??null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?NC(e.className):null,this.shouldFillLineOnLineBreak=e.shouldFillLineOnLineBreak??null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.lineNumberHoverMessage=e.lineNumberHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.lineHeight=e.lineHeight?Math.min(e.lineHeight,300):null,this.fontSize=e.fontSize||null,this.affectsFont=!!e.fontSize||!!e.fontFamily||!!e.fontWeight||!!e.fontStyle,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Ny(e.overviewRuler):null,this.minimap=e.minimap?new NL(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new NS(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?NC(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?NC(e.linesDecorationsClassName):null,this.lineNumberClassName=e.lineNumberClassName?NC(e.lineNumberClassName):null,this.linesDecorationsTooltip=e.linesDecorationsTooltip?e.linesDecorationsTooltip.replace(/[<>"'&]/g,e=>{switch(e){case"<":return"&lt;";case">":return"&gt;";
193case'"':return"&quot;";case"'":return"&apos;";case"&":return"&amp;"}return e}):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?NC(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?NC(e.marginClassName):null,this.inlineClassName=e.inlineClassName?NC(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?NC(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?NC(e.afterContentClassName):null,this.after=e.after?Nx.from(e.after):null,this.before=e.before?Nx.from(e.before):null,this.hideInCommentTokens=e.hideInCommentTokens??!1,this.hideInStringTokens=e.hideInStringTokens??!1,this.textDirection=e.textDirection??null}}Nk.EMPTY=Nk.register({description:"empty"});let NN=[Nk.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Nk.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Nk.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Nk.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function ND(e){return e instanceof Nk?e:Nk.createDynamic(e)}class NE{static toKey(e){return`${e.ownerId};${e.decorationId};${e.lineNumber}`}constructor(e,t,i,n){this.ownerId=e,this.decorationId=t,this.lineNumber=i,this.lineHeight=n}}class NT{static toKey(e){return`${e.ownerId};${e.decorationId};${e.lineNumber}`}constructor(e,t,i){this.ownerId=e,this.decorationId=t,this.lineNumber=i}}class NI extends ro.JT{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new sd.Q5),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._affectedLineHeights=null,this._affectedFontLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._affectsLineNumber=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){this._deferredCnt--,0===this._deferredCnt&&(this._shouldFireDeferred&&this.doFire(),this._affectedInjectedTextLines?.clear(),this._affectedInjectedTextLines=null,this._affectedLineHeights?.clear(),this._affectedLineHeights=null,this._affectedFontLines?.clear(),this._affectedFontLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}recordLineAffectedByLineHeightChange(e,t,i,n){this._affectedLineHeights||(this._affectedLineHeights=new Nd([],NE.toKey)),this._affectedLineHeights.add(new NE(e,t,i,n))}recordLineAffectedByFontChange(e,t,i){this._affectedFontLines||(this._affectedFontLines=new Nd([],NT.toKey)),this._affectedFontLines.add(new NT(e,t,i))}checkAffectedAndFire(e){this._affectsMinimap||=!!e.minimap?.position,this._affectsOverviewRuler||=!!e.overviewRuler?.color,this._affectsGlyphMargin||=!!e.glyphMarginClassName,this._affectsLineNumber||=!!e.lineNumberClassName,this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){0===this._deferredCnt?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines,this._affectedLineHeights,this._affectedFontLines);let e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin,affectsLineNumber:this._affectsLineNumber};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class NM extends ro.JT{constructor(){super(),this._fastEmitter=this._register(new sd.Q5),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new sd.Q5),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;let t=this._deferredEvent;
193this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class NR{static create(e){return new NR(e.get(151),e.get(150))}constructor(e,t){this.classifier=new NA(e,t)}createLineBreaksComputer(e,t,i,n,s,r){let o=[],a=[],l=[];return{addRequest:(e,t,i)=>{o.push(e),a.push(t),l.push(i)},finalize:()=>{let h=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let e=0,u=o.length;e<u;e++){let u=a[e],c=l[e],g=o[e],f=r&&g.includes('"')&&g.includes("\\n");!c||c.injectionOptions||u||f?d[e]=function(e,t,i,n,s,r,o,a,l){let h,d;let u=Lg.applyInjectedText(t,i);if(i&&i.length>0?(h=i.map(e=>e.options),d=i.map(e=>e.column-1)):(h=null,d=null),-1===s)return h?new Ll(d,h,[u.length],[],0):null;let c=u.length;if(c<=1)return h?new Ll(d,h,[u.length],[],0):null;let g="keepAll"===a,f=NV(u,n,s,r,o),m=s-f,p=[],_=[],v=0,b=0,C=0,w=s,y=u.charCodeAt(0),S=e.get(y),L=NF(y,0,n,r),x=1;rq(y)&&(L+=1,y=u.charCodeAt(1),S=e.get(y),x++);for(let t=x;t<c;t++){let i,s;let o=t,a=u.charCodeAt(t),h=!1;rq(a)?(t++,i=0,s=2):(i=e.get(a),s=NF(a,L,n,r)),l&&function(e,t){if(t>=2&&"n"===e.charAt(t-1)){let i=0;for(let n=t-2;n>=0;n--){if("\\"!==e.charAt(n))return i%2==1;i++}}return!1}(u,t)?(b=o,C=L,h=!0):NB(y,S,a,i,g)&&(b=o,C=L),((L+=s)>w||h)&&((0===b||L-C>m)&&(b=o,C=L-s),p[v]=b,_[v]=C,v++,w=C+m,b=0),y=a,S=i}return 0!==v||i&&0!==i.length?(p[v]=c,_[v]=L,new Ll(d,h,p,_,f)):null}(this.classifier,g,u,t,i,h,n,s,f):d[e]=function(e,t,i,n,s,r,o,a){if(-1===s)return null;let l=i.length;if(l<=1)return null;let h="keepAll"===a,d=t.breakOffsets,u=t.breakOffsetsVisibleColumn,c=NV(i,n,s,r,o),g=s-c,f=NO,m=NP,p=0,_=0,v=0,b=s,C=d.length,w=0;{let e=Math.abs(u[w]-b);for(;w+1<C;){let t=Math.abs(u[w+1]-b);if(t>=e)break;e=t,w++}}for(;w<C;){let t=w<0?0:d[w],s=w<0?0:u[w];_>t&&(t=_,s=v);let o=0,a=0,c=0,y=0;if(s<=b){let v=s,C=0===t?0:i.charCodeAt(t-1),w=0===t?0:e.get(C),S=!0;for(let s=t;s<l;s++){let t,l;let d=s,u=i.charCodeAt(s);if(rq(u)?(s++,t=0,l=2):(t=e.get(u),l=NF(u,v,n,r)),d>_&&NB(C,w,u,t,h)&&(o=d,a=v),(v+=l)>b){d>_?(c=d,y=v-l):(c=s+1,y=v),v-a>g&&(o=0),S=!1;break}C=u,w=t}if(S){p>0&&(f[p]=d[d.length-1],m[p]=u[d.length-1],p++);break}}if(0===o){let l=s,d=i.charCodeAt(t),u=e.get(d),f=!1;for(let n=t-1;n>=_;n--){let t,s;let m=n+1,p=i.charCodeAt(n);if(9===p){f=!0;break}if(rG(p)?(n--,t=0,s=2):(t=e.get(p),s=r6(p)?r:1),l<=b){if(0===c&&(c=m,y=l),l<=b-g)break;if(NB(p,t,d,u,h)){o=m,a=l;break}}l-=s,d=p,u=t}if(0!==o){let e=g-(y-a);if(e<=n){let t=i.charCodeAt(c);e-(rq(t)?2:NF(t,y,n,r))<0&&(o=0)}}if(f){w--;continue}}if(0===o&&(o=c,a=y),o<=_){let e=i.charCodeAt(_);rq(e)?(o=_+2,a=v+2):(o=_+1,a=v+NF(e,v,n,r))}for(_=o,f[p]=o,v=a,m[p]=a,p++,b=a+g;w<0||w<C&&u[w]<a;)w++;let S=Math.abs(u[w]-b);for(;w+1<C;){let e=Math.abs(u[w+1]-b);if(e>=S)break;S=e,w++}}return 0===p?null:(f.length=p,m.length=p,NO=t.breakOffsets,NP=t.breakOffsetsVisibleColumn,t.breakOffsets=f,t.breakOffsetsVisibleColumn=m,t.wrappedTextIndentLength=c,t)}(this.classifier,c,g,t,i,h,n,s)}return NO.length=0,NP.length=0,d}}}}class NA extends cv{constructor(e,t){super(0);for(let t=0;t<e.length;t++)this.set(e.charCodeAt(t),1);for(let e=0;e<t.length;e++)this.set(t.charCodeAt(e),2)}get(e){return e>=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let NO=[],NP=[];function NF(e,t,i,n){return 9===e?i-t%i:r6(e)||e<32?n:1}function NB(e,t,i,n,s){return 32!==i&&(2===t&&2!==n||1!==t&&1===n||!s&&3===t&&2!==n||!s&&3===n&&1!==t)}function NV(e,t,i,n,s){let r=0;if(0!==s){let o=rM(e);if(-1!==o){for(let i=0;i<o;i++){let n=9===e.charCodeAt(i)?t-r%t:1;r+=n}let a=3===s?2:2===s?1:0;for(let e=0;e<a;e++){let e=t-r%t;r+=e}r+n>i&&(r=0)}}return r}class NW{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new bA(new s9(1,1,1,1),0,0,new s3(1,1),0),new bA(new s9(1,1,1,1),0,0,new s3(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new bI(this.modelState,this.viewState)}readSelectionFromMarkers(e){let t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?s8.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):s8.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,n){return t.equals(i)?n:e.normalizePosition(t,2)}static _validateViewState(e,t){let i=t.position,n=t.selectionStart.getStartPosition(),s=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),o=this._val
193idatePositionWithCache(e,n,i,r),a=this._validatePositionWithCache(e,s,n,o);return i.equals(r)&&n.equals(o)&&s.equals(a)?t:new bA(s9.fromPositions(o,a),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-o.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=NW._validateViewState(e.viewModel,i)),t){let i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),r=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new bA(i,t.selectionStartKind,n,s,r)}else{if(!i)return;let n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),s=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new bA(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,s,i.leftoverVisibleColumns)}if(i){let n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),s=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new bA(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,s,t.leftoverVisibleColumns)}else{let n=e.coordinatesConverter.convertModelPositionToViewPosition(new s3(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),s=e.coordinatesConverter.convertModelPositionToViewPosition(new s3(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new s9(n.lineNumber,n.column,s.lineNumber,s.column),o=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new bA(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class NH{constructor(e){this.context=e,this.cursors=[new NW(e)],this.lastAddedCursorIndex=0}dispose(){for(let e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(let e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(let e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(let e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){var e,t;return(e=this.cursors,t=(0,as.tT)(e=>e.viewState.position,s3.compare),c2(e,(e,i)=>-t(e,i))).viewState.position}getBottomMostViewPosition(){return function(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n<e.length;n++){let s=e[n];t(s,i)>=0&&(i=s)}return i}(this.cursors,(0,as.tT)(e=>e.viewState.position,s3.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(bI.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){let t=this.cursors.length-1,i=e.length;if(t<i){let e=i-t;for(let t=0;t<e;t++)this._addSecondaryCursor()}else if(t>i){let e=t-i;for(let t=0;t<e;t++)this._removeSecondaryCursor(this.cursors.length-2)}for(let t=0;t<i;t++)this.cursors[t+1].setState(this.context,e[t].modelState,e[t].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new NW(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return 1===this.cursors.length||0===this.lastAddedCursorIndex?0:this.lastAddedCursorIndex}_removeSecondaryCursor(e){this.lastAddedCursorIndex>=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;let e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;i<n;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort((0,as.tT)(e=>e.selection,s9.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){let n=t[i],s=t[i+1],r=n.selection,o=s.selection;if(this.context.cursorConfig.multiCursorMergeOverlapping&&(o.isEmpty()||r.isEmpty()?o.getStartPosition().isBeforeOrEqual(r.getEndPosition()):o.getStartPosition().isBefore(r.getEndPosition()))){let r=n.index<s.index?i:i+1,o=n.index<s.index?i+1:i,a=t[o].index,l=t[r].index,h=t[o].selection,d=t[r].selection;if(!h.equalsSelection(d)){let i,n;let s=h.plusRange(d),o=h.selectionStartLineNumber===h.startLineNumber&&h.selectionStartColumn===h.startColumn,u=d.selectionStartLineNumber===d.startLineNumber&&d.selectionStartColumn===d.startColumn;a===this.lastAddedCursorIndex?(i=o,this.lastAddedCursorIndex=l):i=u,n=i?new s8(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn):new s8(s.endLineNumber,s.endColumn,s.startLineNumber,s.startColumn),t[r].selection=n;let c=bI.fromModelSelection(n);e[l].setState(this.context,c.modelState,c.viewState)}for(let e of t)e.index>
193a&&e.index--;e.splice(a,1),t.splice(o,1),this._removeSecondaryCursor(a-1),i--}}}}class Nz{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class NU{constructor(){this.type=0}}class NK{constructor(){this.type=1}}class N${constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class Nj{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class Nq{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin,this.affectsLineNumber=e.affectsLineNumber):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0,this.affectsLineNumber=!0)}}class NG{constructor(){this.type=5}}class NQ{constructor(e){this.type=6,this.isFocused=e}}class NY{constructor(){this.type=7}}class NJ{constructor(){this.type=8}}class NZ{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class NX{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class N1{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class N0{constructor(e,t,i,n,s,r,o){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=s,this.revealHorizontal=r,this.scrollType=o,this.type=12}}class N2{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class N5{constructor(e){this.theme=e,this.type=14}}class N4{constructor(e){this.type=15,this.ranges=e}}class N6{constructor(){this.type=16}}class N7{constructor(){this.type=17}}class N3 extends ro.JT{constructor(){super(),this._onEvent=this._register(new sd.Q5),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t<i;t++){let i=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(i){this._outgoingEvents[t]=i;return}}this._outgoingEvents.push(e)}_emitOutgoingEvents(){for(;this._outgoingEvents.length>0;){if(this._collector||this._isConsumingViewEventQueue)return;let e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);this._eventHandlers.push(e)}removeViewEventHandler(e){for(let t=0;t<this._eventHandlers.length;t++)if(this._eventHandlers[t]===e){this._eventHandlers.splice(t,1);break}}beginEmitViewEvents(){return this._collectorCnt++,1===this._collectorCnt&&(this._collector=new N9),this._collector}endEmitViewEvents(){if(this._collectorCnt--,0===this._collectorCnt){let e=this._collector.outgoingEvents,t=this._collector.viewEvents;for(let t of(this._collector=null,e))this._addOutgoingEvent(t);t.length>0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){let e=this._viewEventQueue;for(let t of(this._viewEventQueue=null,this._eventHandlers.slice(0)))t.handleEvents(e)}}}class N9{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class N8{constructor(e,t,i,n){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=n,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new N8(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}
193class De{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new De(this.oldHasFocus,e.hasFocus)}}class Dt{constructor(e,t){this.kind=2,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new De(this.oldHasFocus,e.hasFocus)}}class Di{constructor(e,t,i,n,s,r,o,a){this.kind=3,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=s,this.scrollLeft=r,this.scrollHeight=o,this.scrollTop=a,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new Di(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class Dn{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Ds{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Dr{constructor(e,t,i,n,s,r,o){this.kind=7,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=s,this.reason=r,this.reachedMaxCursorCount=o}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;let i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!e[n].equalsSelection(t[n]))return!1;return!0}isNoOp(){return Dr._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new Dr(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class Do{constructor(){this.kind=6}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class Da{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class Dl{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class Dh{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class Dd{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class Du{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class Dc{constructor(e){this.event=e,this.kind=13}isNoOp(){return!1}attemptToMerge(e){return null}}class Dg{constructor(e){this.event=e,this.kind=14}isNoOp(){return!1}attemptToMerge(e){return null}}class Df{constructor(e){this.event=e,this.kind=15}isNoOp(){return!1}attemptToMerge(e){return null}}class Dm extends ro.JT{constructor(e,t,i,n){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new Nz(this._model,this._viewModel,this._coordinatesConverter,n),this._cursors=new NH(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=(0,ro.B9)(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new Nz(this._model,this._viewModel,this._coordinatesConverter,e),this._cursors.updateContext(this.context)}onLineMappingChanged(e){this._knownModelVersionId===this._model.getVersionId()&&this.setStates(e,"viewModel",0,this.getCursorStates())}setHasFocus(e){this._hasFocus=e}_validateAutoClosedActions(){if(this._autoClosedActions.length>0){let e=this._cursors.getSelections();for(let t=0;t<this._autoClosedActions.length;t++){let i=this._autoClosedActions[t];!i.isValid(e)&&(i.dispose(),this._autoClosedActions.splice(t,1),t--)}}}getPrimaryCursorState(){return this._cursors.getPrimaryCursor()}getLastAddedCursorIndex(){return this._cursors.getLastAddedCursorIndex()}getCursorStates(){return this._cursors.getAll()}setStates(e,t,i,n){let s=!1,r=this.context.cursorConfig.multiCursorLimit;null!==n&&n.length>r&&(n=n.slice(0,r),s=!0);let o=Dp.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._val
193idateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,o,s)}setCursorColumnSelectData(e){this._columnSelectData=e}revealAll(e,t,i,n,s,r){let o=this._cursors.getViewPositions(),a=null,l=null;o.length>1?l=this._cursors.getViewSelections():a=s9.fromPositions(o[0],o[0]),e.emitViewEvent(new N0(t,i,a,l,n,s,r))}revealPrimary(e,t,i,n,s,r){let o=[this._cursors.getPrimaryCursor().viewState.selection];e.emitViewEvent(new N0(t,i,null,o,n,s,r))}saveState(){let e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i<n;i++){let n=t[i];e.push({inSelectionMode:!n.isEmpty(),selectionStart:{lineNumber:n.selectionStartLineNumber,column:n.selectionStartColumn},position:{lineNumber:n.positionLineNumber,column:n.positionColumn}})}return e}restoreState(e,t){let i=[];for(let e=0,n=t.length;e<n;e++){let n=t[e],s=1,r=1;n.position&&n.position.lineNumber&&(s=n.position.lineNumber),n.position&&n.position.column&&(r=n.position.column);let o=s,a=r;n.selectionStart&&n.selectionStart.lineNumber&&(o=n.selectionStart.lineNumber),n.selectionStart&&n.selectionStart.column&&(a=n.selectionStart.column),i.push({selectionStartLineNumber:o,selectionStartColumn:a,positionLineNumber:s,positionColumn:r})}this.setStates(e,"restoreState",0,bI.fromModelSelections(i)),this.revealAll(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof Lw){if(!this._isHandling){this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}}else{let i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;let n=i.containsEvent(1);if(this._prevEditOperationType=0,n)this._cursors.dispose(),this._cursors=new NH(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){let t=bI.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,t)&&this.revealAll(e,"modelChange",!1,0,!0,0)}else{let t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,bI.fromModelSelections(t))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;let e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,n){this.setStates(e,t,n,bI.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){let i=[],n=[];for(let s=0,r=e.length;s<r;s++)i.push({range:e[s],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),n.push({range:t[s],options:{description:"auto-closed-enclosing",stickiness:1}});let s=this._model.deltaDecorations([],i),r=this._model.deltaDecorations([],n);this._autoClosedActions.push(new D_(this._model,s,r))}_executeEditOperation(e,t){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();let i=Dv.executeCommands(this._model,this._cursors.getSelections(),e.commands,t);if(i){this._interpretCommandResult(i);let t=[],n=[];for(let i=0;i<e.commands.length;i++){let s=e.commands[i];s instanceof Cd&&s.enclosingRange&&s.closeCharacterRange&&(t.push(s.closeCharacterRange),n.push(s.enclosingRange))}t.length>0&&this._pushAutoClosedAction(t,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,s){let r=Dp.from(this._model,this);if(r.equals(n))return!1;let o=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new Nj(a,o,i)),!n||n.cursorState.length!==r.cursorState.length||r.cursorState.some((e,t)=>
193!e.modelState.equals(n.cursorState[t].modelState))){let a=n?n.cursorState.map(e=>e.modelState.selection):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new Dr(a,o,l,r.modelVersionId,t||"keyboard",i,s))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];if(!n.text||n.text.indexOf("\n")>=0)return null;let s=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;let r=s[1],o=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(r);if(!o||1!==o.length)return null;let a=o[0].open,l=n.text.length-s[2].length-1,h=n.text.lastIndexOf(a,l-1);if(-1===h)return null;t.push([h,l])}return t}executeEdits(e,t,i,n,s){let r=null;"snippet"===t&&(r=this._findAutoClosingPairs(i)),r&&(i[0]._isTracked=!0);let o=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,e=>{if(r)for(let t=0,i=r.length;t<i;t++){let[i,n]=r[t],s=e[t],l=s.range.startLineNumber,h=s.range.startColumn-1+i,d=s.range.startColumn-1+n;o.push(new s9(l,d+1,l,d+2)),a.push(new s9(l,h+1,l,d+2))}let t=n(e);return t&&(this._isHandling=!0),t},void 0,s);l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),o.length>0&&this._pushAutoClosedAction(o,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;let s=Dp.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(e){(0,o_.dL)(e)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealAll(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return D_.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new DC(this._model,this.getSelections())}endComposition(e,t){let i=xN.cursor({kind:"compositionEnd",detailedSource:t}),n=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{"keyboard"===t&&this._executeEditOperation(Cy.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,n,this.getSelections(),this.getAutoClosedCharacters()),i)},e,t)}type(e,t,i){let n=xN.cursor({kind:"type",detailedSource:i});this._executeEdit(()=>{if("keyboard"===i){let e=t.length,i=0;for(;i<e;){let e=rX(t,i),s=t.substr(i,e);this._executeEditOperation(Cy.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),s),n),i+=e}}else this._executeEditOperation(Cy.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t),n)},e,i)}compositionType(e,t,i,n,s,r){let o=xN.cursor({kind:"compositionType",detailedSource:r});if(0===t.length&&0===i&&0===n){if(0!==s){let t=this.getSelections().map(e=>{let t=e.getPosition();return new s8(t.lineNumber,t.column+s,t.lineNumber,t.column+s)});this.setSelections(e,r,t,0)}return}this._executeEdit(()=>{this._executeEditOperation(Cy.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s),o)},e,r)}paste(e,t,i,n,s){let r=xN.cursor({kind:"paste",detailedSource:s});this._executeEdit(()=>{this._executeEditOperation(Cy.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]),r)},e,s,4)}cut(e,t){let i=xN.cursor({kind:"cut",detailedSource:t});this._executeEdit(()=>{this._executeEditOperation(bq.cut(this.context.cursorConfig,this._model,this.getSelections()),i)},e,t)}executeCommand(e,t,i){let n=xN.cursor({kind:"executeCommand",detailedSource:i});this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new bO(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}executeCommands(e,t,i){let n=xN.cursor({kind:"executeCommands",detailedSource:i});this._executeEdit(()=>{this._executeEditOperation(new bO(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}),n)},e,i)}}class Dp{static from(e,t){return new Dp(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.curs
193orState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class D_{static getAllAutoClosedCharacters(e){let t=[];for(let i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this._model.deltaDecorations(this._autoClosedEnclosingDecorations,[])}getAutoClosedCharactersRanges(){let e=[];for(let t=0;t<this._autoClosedCharactersDecorations.length;t++){let i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){let t=[];for(let e=0;e<this._autoClosedEnclosingDecorations.length;e++){let i=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[e]);if(i&&(t.push(i),i.startLineNumber!==i.endLineNumber))return!1}t.sort(s9.compareRangesUsingStarts),e.sort(s9.compareRangesUsingStarts);for(let i=0;i<e.length;i++)if(i>=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class Dv{static executeCommands(e,t,i,n=xN.unknown({name:"executeCommands"})){let s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},r=this._innerExecuteCommands(s,i,n);for(let e=0,t=s.trackedRanges.length;e<t;e++)s.model._setTrackedRange(s.trackedRanges[e],null,0);return r}static _innerExecuteCommands(e,t,i){if(this._arrayIsEmpty(t))return null;let n=this._getEditOperations(e,t);if(0===n.operations.length)return null;let s=n.operations,r=this._getLoserCursorMap(s);if(r.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;let o=[];for(let e=0,t=s.length;e<t;e++)r.hasOwnProperty(s[e].identifier.major.toString())||o.push(s[e]);n.hadTrackedEditOperation&&o.length>0&&(o[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,o,i=>{let n=[];for(let t=0;t<e.selectionsBefore.length;t++)n[t]=[];for(let e of i)e.identifier&&n[e.identifier.major].push(e);let s=(e,t)=>e.identifier.minor-t.identifier.minor,r=[];for(let i=0;i<e.selectionsBefore.length;i++)n[i].length>0?(n[i].sort(s),r[i]=t[i].computeCursorState(e.model,{getInverseEditOperations:()=>n[i],getTrackedSelection:t=>{let i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new s8(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new s8(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):r[i]=e.selectionsBefore[i];return r},void 0,i);a||(a=e.selectionsBefore);let l=[];for(let e in r)r.hasOwnProperty(e)&&l.push(parseInt(e,10));for(let e of(l.sort((e,t)=>t-e),l))a.splice(e,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],n=!1;for(let s=0,r=t.length;s<r;s++){let r=t[s];if(r){let t=this._getEditOperationsFromCommand(e,s,r);i=i.concat(t.operations),n=n||t.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:n}}static _getEditOperationsFromCommand(e,t,i){let n=[],s=0,r=(e,r,o=!1)=>{s9.isEmpty(e)&&""===r||n.push({identifier:{major:t,minor:s++},range:e,text:r,forceMoveMarkers:o,isAutoWhitespaceEdit:i.insertsAutoWhitespace})},o=!1;try{i.getEditOperations(e.model,{addEditOperation:r,addTrackedEditOperation:(e,t,i)=>{o=!0,r(e,t,i)},trackSelection:(t,i)=>{let n;let s=s8.liftSelection(t);if(s.isEmpty()){if("boolean"==typeof i)n=i?2:3;else{let t=e.model.getLineMaxColumn(s.startLineNumber);n=s.startColumn===t?2:3}}else n=1;let r=e.trackedRanges.length,o=e.model._setTrackedRange(null,s,n);return e.trackedRanges[r]=o,e.trackedRangesDirection[r]=s.getDirection(),r.toString()}})}catch(e){return(0,o_.dL)(e),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:o}}static _getLoserCursorMap(e){(e=e.slice(0)).sort((e,t)=>-s9.compareRangesUsingEnds(e.range,t.range));let t={};for(let i=1;i<e.length;i++){let n=e[i-1],s=e[i];if(s9.getStartPosition(n.range).isBefore(s9.getEndPosition(s.range))){let r;t[(r=n.identifier.major>s.identifier.major?n.identifier.major:s.identifier.major).toString()]=!0;for(let t=0;t<e.length;t++)e[t].identifier.major===r&&(e.splice(t,1),t<i&&i--,t--);i>0&&i--}}return t}}class Db{constructor(e,t,i,n){this.text=e,this.lineNumber=t,this.startSelectionOffset=i,this.endSelectionOffset=n}}class DC{static _capture(e,t){let i=[];for(let n of t){if(n.startLineNumber!==n.endLineNumber)return null;let t=n.startLineNumber;i.push(new Db(e.getLineContent(t),t,n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=DC._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;let i=DC._capture(e,t);if(!i||this._original.length!==i.length)return null;let n=[];for(let e=0,t=this._original.length;e<t;e++)n.push(DC._deduceOutcome(this._original[e],i[e]));return n}static _deduceOutcome(e,t){let i=Math.min(e.startSelectionOffset,t.startSelectionOffset,r$(e.text,t.text)),n=Math.min(e.text.length-e.endSelectionOffset,t.text.length-t.endSelectionOffset,rj(e.text,t.text)),s=e.text.substring(i,e.text.length-n),r=t.text.length-n,o=t.text.substring(i,r),a=new s9(t.lineNumber,i+1,t.lineNumber,r+1);return new CS(s,e.startSelectionOffset-i,e.endSelectionOffset-i,o,t.startSelectionOffset-i,t.endSelectionOffset-i,a)}}let Dw={getInitialState:()=>fC,tokenizeEncoded:(e,t,i)=>fy(0,i)};async function Dy(e,t,i){if(!i)return DS(t,e.languageIdCodec,Dw);let n=await rp.getOrCreate(i);return DS(t,e.languageIdCodec,n||Dw)}function DS(e,t,i){let n='<div class="monaco-tokenized-source">',s=rI(e),r=i.getInitialState();for(let e=0,o=s.length;e<o;e++){let o=s[e];e>0&&(n+="<br/>");let a=i.tokenizeEncoded(o,!0,r);fL.convertToEndOffset(a.tokens,o.length);let l=new fL(a.tokens,o,t).inflate(),h=0;for(let e=0,t=l.getCount();e<t;e++){let t=l.getClassName(e),i=l.getEndOffset(e);n+=`<span class="${t}">${rk(o.substring(h,i))}</span>`,h=i}r=a.endState}return n+"</div>"}class DL{constructor(e,t,i,n,s){this.decorationId=e,this.index=t,this.lineNumber=i,this.specialHeight=n,this.prefixSum=s,this.maximumSpecialHeight=n,this.deleted=!1}}class Dx{constructor(e,t){if(this._decorationIDToCustomLine=new Dk,this._orderedCustomLines=[],this._pendingSpecialLinesToInsert=[],this._invalidIndex=0,this._hasPending=!1,this._defaultLineHeight=e,t.length>0){for(let e of t)this.insertOrChangeCustomLineHeight(e.decorationId,e.startLineNumber,e.endLineNumber,e.lineHeight);this.commit()}}set defaultLineHeight(e){this._defaultLineHeight=e}get defaultLineHeight(){return this._defaultLineHeight}removeCustomLineHeight(e){let t=this._decorationIDToCustomLine.get(e);if(t){for(let i of(this._decorationIDToCustomLine.delete(e),t))i.deleted=!0,this._invalidIndex=Math.min(this._invalidIndex,i.index);this._hasPending=!0}}insertOrChangeCustomLineHeight(e,t,i,n){this.removeCustomLineHeight(e);for(let s=t;s<=i;s++){let t=new DL(e,-1,s,n,0);this._pendingSpecialLinesToInsert.push(t)}this._hasPending=!0}heightForLineNumber(e){let t=this._binarySearchOverOrderedCustomLinesArray(e);return t>=0?this._orderedCustomLines[t].maximumSpecialHeight:this._defaultLineHeight}getAccumulatedLineHeightsIncludingLineNumber(e){let t=this._binarySearchOverOrderedCustomLinesArray(e);if(t>=0)return this._orderedCustomLines[t].prefixSum+this._orderedCustomLines[t].maximumSpecialHeight;if(-1===t)return this._defaultLineHeight*e;let i=this._orderedCustomLines[-(t+1)-1];return i.prefixSum+i.maximumSpecialHeight+this._defaultLineHeight*(e-i.lineNumber)}onLinesDeleted(e,t){let i,n;let s=t-e+1,r=this._orderedCustomLines.length,o=this._binarySearchOverOrderedCustomLinesArray(e);if(o>=0){i=o;for(let t=o-1;t>=0;t--)if(this._orderedCustomLines[t].lineNumber===e)i--;else break}else i=o===-(r+1)&&-1!==o?r-1:-(o+1);let a=this._binarySearchOverOrderedCustomLinesArray(t);if(a>=0){n=a;for(let e=a+1;e<r;e++)if(this._orderedCustomLines[e].lineNumber===t)n++;else break}else n=a===-(r+1)&&-1!==a?r-1:-(a+1);let l=n>i,h=n===i&&this._orderedCustomLines[i]&&this._orderedCustomLines[i].lineNumber>=e&&this._orderedCustomLines[i].lineNumber<=t;if(l||h){let r=0;for(let e=i;e<=n;e++)r=Math.max(r,this._orderedCustomLines[e].maximumSpecialHeight);let o=0;if(i>0){let t=this._orderedCustomLines[i-1];o=t.prefixSum+t.maximumSpecialHeight+this._defaultLineHeight*(e-t.lineNumber-1)}else o=e>0?(e-1)*this._defaultLineHeight:0;let a=this._orderedCustomLines[i],l=this._orderedCustomLines[n],h=this._orderedCustomLines[n+1],d=h&&h.lineNumber===t+1?h.maximumSpecialHeight:this._defaultLineHeight,u=l.prefixSum+l.maximumSpecialHeight-a.prefixSum+this._defaultLineHeight*(t-l.lineNumber)+this._defaultLineHeight*(a.lineNumber-e)+d-r,c=new Set,g=[],f=new Dk,m=0;for(let t=0;t<this._orderedCustomLines.length;t++){let a=this._orderedCustomLines[t];if(t<i)g.push(a),f.add(a.decorationId,a);else if(t>=i&&t<=n){let t=a.decorationId;c.has(t)?m++:(a.index-=m,a.lineNumber=e,a.prefixSum=o,a.maximumSpecialHeight=r,g.push(a),f.add(a.decorationId,a))}else t>n&&(a.index-=m,a.lineNumber-=s,a.prefixSum-=u,g.push(a),f.add(a.decorationId,a));c.add(a.decorationId)}this._orderedCustomLines=g,this._decorationIDToCustomLine=f}else{let e=s*this._defaultLineHeight;for(let i=n;i<this._orderedCustomLines.length;i++){let n=this._orderedCustomLines[i];n.lineNumber>t&&(n.lineNumber-=s,n.prefixSum-=e)}}}
193onLinesInserted(e,t){let i;let n=t-e+1,s=this._binarySearchOverOrderedCustomLinesArray(e);if(s>=0){i=s;for(let t=s-1;t>=0;t--)if(this._orderedCustomLines[t].lineNumber===e)i--;else break}else i=-(s+1);let r=[],o=new Set;for(let t=i;t<this._orderedCustomLines.length;t++)this._orderedCustomLines[t].lineNumber===e&&o.add(this._orderedCustomLines[t].decorationId);let a=new Set;for(let t=i-1;t>=0;t--)this._orderedCustomLines[t].lineNumber===e-1&&a.add(this._orderedCustomLines[t].decorationId);let l=Nh(a,o);for(let e=i;e<this._orderedCustomLines.length;e++)this._orderedCustomLines[e].lineNumber+=n,this._orderedCustomLines[e].prefixSum+=this._defaultLineHeight*n;if(l.size>0){for(let t of l){let i=this._decorationIDToCustomLine.get(t);if(i){let n=i.reduce((e,t)=>Math.min(e,t.lineNumber),e),s=i.reduce((e,t)=>Math.max(e,t.lineNumber),e),o=i.reduce((e,t)=>Math.max(e,t.specialHeight),0);r.push({decorationId:t,startLineNumber:n,endLineNumber:s,lineHeight:o})}}for(let e of r)this.insertOrChangeCustomLineHeight(e.decorationId,e.startLineNumber,e.endLineNumber,e.lineHeight);this.commit()}}commit(){if(!this._hasPending)return;for(let e of this._pendingSpecialLinesToInsert){let t=this._binarySearchOverOrderedCustomLinesArray(e.lineNumber),i=t>=0?t:-(t+1);this._orderedCustomLines.splice(i,0,e),this._invalidIndex=Math.min(this._invalidIndex,i)}this._pendingSpecialLinesToInsert=[];let e=new Dk,t=[];for(let i=0;i<this._invalidIndex;i++){let n=this._orderedCustomLines[i];t.push(n),e.add(n.decorationId,n)}let i=0,n=this._invalidIndex>0?t[this._invalidIndex-1]:void 0;for(let s=this._invalidIndex;s<this._orderedCustomLines.length;s++){let r=this._orderedCustomLines[s];if(r.deleted){i++;continue}if(r.index=s-i,n&&n.lineNumber===r.lineNumber)r.maximumSpecialHeight=n.maximumSpecialHeight,r.prefixSum=n.prefixSum;else{let e,t=r.specialHeight;for(let e=s;e<this._orderedCustomLines.length;e++){let i=this._orderedCustomLines[e];if(!i.deleted){if(i.lineNumber!==r.lineNumber)break;t=Math.max(t,i.specialHeight)}}r.maximumSpecialHeight=t,e=n?n.prefixSum+n.maximumSpecialHeight+this._defaultLineHeight*(r.lineNumber-n.lineNumber-1):this._defaultLineHeight*(r.lineNumber-1),r.prefixSum=e}n=r,t.push(r),e.add(r.decorationId,r)}this._orderedCustomLines=t,this._decorationIDToCustomLine=e,this._invalidIndex=1/0,this._hasPending=!1}_binarySearchOverOrderedCustomLinesArray(e){return(0,as.em)(this._orderedCustomLines.length,t=>{let i=this._orderedCustomLines[t];return i.lineNumber===e?0:i.lineNumber<e?-1:1})}}class Dk{constructor(){this._map=new Map}add(e,t){let i=this._map.get(e);i?i.push(t):this._map.set(e,[t])}get(e){return this._map.get(e)}delete(e){this._map.delete(e)}}class DN{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}commit(e){if(!this._hasPending)return;let t=this._inserts,i=this._changes,n=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,n)}}class DD{constructor(e,t,i,n,s){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=n,this.minWidth=s,this.prefixSum=0}}class DE{static{this.INSTANCE_COUNT=0}constructor(e,t,i,n,s){this._instanceId=r8(++DE.INSTANCE_COUNT),this._pendingChanges=new DN,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._paddingTop=i,this._paddingBottom=n,this._lineHeightsManager=new Dx(t,s)}static findInsertionIndex(e,t,i){let n=0,s=e.length;for(;n<s;){let r=n+s>>>1;t===e[r].afterLineNumber?i<e[r].ordinal?s=r:n=r+1:t<e[r].afterLineNumber?s=r:n=r+1}return n}setDefaultLineHeight(e){this._lineHeightsManager.defaultLineHeight=e}setPadding(e,t){this._paddingTop=e,this._paddingBottom=t}onFlushed(e,t){this._lineCount=e,this._lineHeightsManager=new Dx(this._lineHeightsManager.defaultLineHeight,t)}changeLineHeights(e){let t=!1;try{e({insertOrChangeCustomLineHeight:(e,i,n,s)=>{t=!0,this._lineHeightsManager.insertOrChangeCustomLineHeight(e,i,n,s)},removeCustomLineHeight:e=>{t=!0,this._lineHeightsManager.removeCustomLineHeight(e)}})}finally{this._lineHeightsManager.commit()}return t}changeWhitespace(e){let t=!1;try{let i={insertWhitespace:(e,i,n,s)=>{t=!0,e|=0,i|=0,n|=0,s|=0;let r=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new DD(r,e,i,n,s)),r},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>
193{t=!0,this._pendingChanges.remove({id:e})}};e(i)}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(let t of e)this._insertWhitespace(t);for(let e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(let e of i){let t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}let n=new Set;for(let e of i)n.add(e.id);let s=new Map;for(let e of t)s.set(e.id,e);let r=e=>{let t=[];for(let i of e)if(!n.has(i.id)){if(s.has(i.id)){let e=s.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},o=r(this._arr).concat(r(e));o.sort((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber),this._arr=o,this._prefixSumValidIndex=-1}_insertWhitespace(e){let t=DE.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){let t=this._arr;for(let i=0,n=t.length;i<n;i++)if(t[i].id===e)return i;return -1}_changeOneWhitespace(e,t,i){let n=this._findWhitespaceIndex(e);if(-1!==n&&(this._arr[n].height!==i&&(this._arr[n].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,n-1)),this._arr[n].afterLineNumber!==t)){let e=this._arr[n];this._removeWhitespace(n),e.afterLineNumber=t,this._insertWhitespace(e)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){e|=0,t|=0,this._lineCount-=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){let n=this._arr[i].afterLineNumber;e<=n&&n<=t?this._arr[i].afterLineNumber=e-1:n>t&&(this._arr[i].afterLineNumber-=t-e+1)}this._lineHeightsManager.onLinesDeleted(e,t)}onLinesInserted(e,t){e|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i<n;i++){let n=this._arr[i].afterLineNumber;e<=n&&(this._arr[i].afterLineNumber+=t-e+1)}this._lineHeightsManager.onLinesInserted(e,t)}getWhitespacesTotalHeight(){return 0===this._arr.length?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){e|=0;let t=Math.max(0,this._prefixSumValidIndex+1);0===t&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){return this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(this._lineCount)+this.getWhitespacesTotalHeight()+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){e|=0;let t=this._findLastWhitespaceBeforeLineNumber(e);return -1===t?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e|=0;let t=this._arr,i=0,n=t.length-1;for(;i<=n;){let s=(n-i|0)/2|0,r=i+s|0;if(t[r].afterLineNumber<e){if(r+1>=t.length||t[r+1].afterLineNumber>=e)return r;i=r+1|0}else n=r-1|0}return -1}_findFirstWhitespaceAfterLineNumber(e){e|=0;let t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t<this._arr.length?t:-1}getFirstWhitespaceIndexAfterLineNumber(e){return e|=0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){return((e|=0)>1?this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e-1):0)+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0))+this._paddingTop}getLineHeightForLineNumber(e){return this._lineHeightsManager.heightForLineNumber(e)}getVerticalOffsetAfterLineNumber(e,t=!1){return e|=0,this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(e)+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0))+this._paddingTop}getWhitespaceMinWidth(){if(-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){return e>this.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&e<this._paddingTop}isInBottomPadding(e){return 0!==this._paddingBottom&&e>=this.getLinesTotalHeight()-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if((e|=0)<0)return 1;let t=0|this._lineCount,i=1,n=t;for(;i<n;){let t=(i+n)/2|0,s=this.getLineHeightForLineNumber(t),r=0|this.getVerticalOffsetForLineNumber(t);if(e>=r+s)i=t+1;else{if(e>=r)return t;n=t}}return i>t?t:i}getLinesViewportData(e,t){let i,n;e|=0,t|=0;let s=0|this.getLineNumberAtOrAfterVerticalOffset(e),r=0|this.getVerticalOffsetForLineNumber(s),o=0|this._lineCount,a=0|this.getFirstWhitespaceIndexAfterLineNumber(s),l=0|this.getWhitespace
193sCount();-1===a?(a=l,n=o+1,i=0):(n=0|this.getAfterLineNumberForWhitespaceIndex(a),i=0|this.getHeightForWhitespaceIndex(a));let h=r,d=h,u=0;r>=5e5&&(d-=u=Math.floor((u=5e5*Math.floor(r/5e5))/this._lineHeightsManager.defaultLineHeight)*this._lineHeightsManager.defaultLineHeight);let c=[],g=e+(t-e)/2,f=-1;for(let e=s;e<=o;e++){let r=this.getLineHeightForLineNumber(e);if(-1===f){let t=h,i=h+r;(t<=g&&g<i||t>g)&&(f=e)}for(h+=r,c[e-s]=d,d+=r;n===e;)d+=i,h+=i,++a>=l?n=o+1:(n=0|this.getAfterLineNumberForWhitespaceIndex(a),i=0|this.getHeightForWhitespaceIndex(a));if(h>=t){o=e;break}}-1===f&&(f=o);let m=0|this.getVerticalOffsetForLineNumber(o),p=s,_=o;return p<_&&r<e&&p++,p<_&&m+this.getLineHeightForLineNumber(o)>t&&_--,{bigNumbersDelta:u,startLineNumber:s,endLineNumber:o,relativeVerticalOffset:c,centeredLineNumber:f,completelyVisibleStartLineNumber:p,completelyVisibleEndLineNumber:_,lineHeight:this._lineHeightsManager.defaultLineHeight}}getVerticalOffsetForWhitespaceIndex(e){e|=0;let t=this.getAfterLineNumberForWhitespaceIndex(e);return(t>=1?this._lineHeightsManager.getAccumulatedLineHeightsIncludingLineNumber(t):0)+(e>0?this.getWhitespacesAccumulatedHeight(e-1):0)+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return -1;let n=this.getVerticalOffsetForWhitespaceIndex(i),s=this.getHeightForWhitespaceIndex(i);if(e>=n+s)return -1;for(;t<i;){let n=Math.floor((t+i)/2),s=this.getVerticalOffsetForWhitespaceIndex(n),r=this.getHeightForWhitespaceIndex(n);if(e>=s+r)t=n+1;else{if(e>=s)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){e|=0;let t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;let i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;let n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){e|=0,t|=0;let i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];let s=[];for(let e=i;e<=n;e++){let i=this.getVerticalOffsetForWhitespaceIndex(e),n=this.getHeightForWhitespaceIndex(e);if(i>=t)break;s.push({id:this.getIdForWhitespaceIndex(e),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(e),verticalOffset:i,height:n})}return s}getWhitespaces(){return this._arr.slice(0)}getWhitespacesCount(){return this._arr.length}getIdForWhitespaceIndex(e){return e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return e|=0,this._arr[e].height}}class DT{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<0&&(n=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=n,this.scrollHeight=Math.max(i,n)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class DI extends ro.JT{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new sd.Q5),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new DT(0,0,0,0),this._scrollable=this._register(new v5({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;let t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);let i=t.contentWidth!==e.contentWidth,n=t.contentHeight!==e.contentHeight;(i||n)&&this._onDidContentSizeChange.fire(new N8(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class DM extends ro.JT{constructor(e,t,i,n){super(),this._configuration=e;let s=this._configuration.options,r=s.get(165),o=s.get(96);this._linesLayout=new DE(t,s.get(75),o.top,o.bottom,i),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new DI(0,n)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new DT(r.contentWidth,0,r.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(130)?125:0)}onConfigurationChanged(e){let t=this._configuration.options;if(e.hasChanged(75)&&this._linesLayout.setDefaultLineHeight(t.get(75)),e.hasChanged(96)){let e=t.get(96);this._linesLayout.setPadding(e.top,e.bottom)}
193if(e.hasChanged(165)){let e=t.get(165),i=e.contentWidth,n=e.height,s=this._scrollable.getScrollDimensions(),r=s.contentWidth;this._scrollable.setScrollDimensions(new DT(i,s.contentWidth,n,this._getContentHeight(i,n,r)))}else this._updateHeight();e.hasChanged(130)&&this._configureSmoothScrollDuration()}onFlushed(e,t){this._linesLayout.onFlushed(e,t)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){let i=this._configuration.options.get(117);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){let n=this._configuration.options,s=this._linesLayout.getLinesTotalHeight();return n.get(119)?s+=Math.max(0,t-n.get(75)-n.get(96).bottom):n.get(117).ignoreHorizontalScrollbarInContentHeight||(s+=this._getHorizontalScrollbarHeight(e,i)),s}_updateHeight(){let e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new DT(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){let e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new fU(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){let e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new fU(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){let e=this._configuration.options,t=this._maxLineWidth,i=e.get(166),n=e.get(59),s=e.get(165);if(i.isViewportWrapping){let i=e.get(81);return t>s.contentWidth+n.typicalHalfwidthCharacterWidth&&i.enabled&&"right"===i.side?t+s.verticalScrollbarWidth:t}{let i=e.get(118)*n.typicalHalfwidthCharacterWidth,r=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+i+s.verticalScrollbarWidth,r,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){let e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new DT(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){let e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),scrollLeft:e.scrollLeft}}changeWhitespace(e){let t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}changeSpecialLineHeights(e){let t=this._linesLayout.changeLineHeights(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}getLineHeightForLineNumber(e){return this._linesLayout.getLineHeightForLineNumber(e)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){let e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){let t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){let e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){1===t?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){let i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class DR{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class DA{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new DR(new s9(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class DO{constructor(e,t,i,n,s){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=s,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){let t=e.id,i=this._decorationsCache[t];if(!i){let n;let s=e.range,r=e.options;if(r.isWholeLine){let e=this._coordinatesConverter.convertModelPositionToViewPosition(new s3(s.startLineNumber,1),0,!1,!0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new s3(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),1);n=new s9(e.lineNumber,e.column,t.lineNumber,t.column)}else n=this._coordinatesConverter.convertModelRangeToViewRange(s,1);i=new yw(n,r),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;return(t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange))||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getDecorationsOnLine(e,t=!1,i=!1){let n=new s9(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(n,t,i)}_getDecorationsInRange(e,t,i){let n=this._linesCollection.getDecorationsInRange(e,this.editorId,(0,sh.$J)(this.configuration.options),(0,sh.PZ)(this.configuration.options),t,i),s=e.startLineNumber,r=e.endLineNumber,o=[],a=0,l=[];for(let e=s;e<=r;e++)l[e-s]=[];let h=!1;for(let e=0,t=n.length;e<t;e++){var d;let t=n[e],i=t.options;if(d=this.model,t.options.hideInCommentTokens&&yy(d,t.range,e=>1===e)||t.options.hideInStringTokens&&yy(d,t.range,e=>2===e))continue;let u=this._getOrCreateViewModelDecoration(t),c=u.range;if(o[a++]=u,i.inlineClassName){let e=new DR(c,i.inlineClassName,i.inlineClassNameAffectsLetterSpacing?3:0),t=Math.max(s,c.startLineNumber),n=Math.min(r,c.endLineNumber);for(let i=t;i<=n;i++)l[i-s].push(e)}if(i.beforeContentClassName&&s<=c.startLineNumber&&c.startLineNumber<=r){let e=new DR(new s9(c.startLineNumber,c.startColumn,c.startLineNumber,c.startColumn),i.beforeContentClassName,1);l[c.startLineNumber-s].push(e)}if(i.afterContentClassName&&s<=c.endLineNumber&&c.endLineNumber<=r){let e=new DR(new s9(c.endLineNumber,c.endColumn,c.endLineNumber,c.endColumn),i.afterContentClassName,2);l[c.endLineNumber-s].push(e)}i.affectsFont&&(h=!0)}return{decorations:o,inlineDecorations:l,hasVariableFonts:h}}}function DP(e,t){return null!==e?new DF(e,t):t?DB.INSTANCE:DV.INSTANCE}class DF{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){let n;this._assertVisible();let s=i>0?this._projectionData.breakOffsets[i-1]:0,r=this._projectionData.breakOffsets[i];if(null!==this._projectionData.injectionOffsets){let i=this._projectionData.injectionOffsets.map((e,t)=>new Lg(0,0,e+1,this._projectionData.injectionOptions[t],0));n=Lg.applyInjectedText(e.getLineContent(t),i).substring(s,r)}else n=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:r+1});return i>0&&(n=DH(this._projectionData.wrappedTextIndentLength)+n),n}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){let n=[];return this.getViewLinesData(e,t,i,1,0,[!0],n),n[0]}getViewLinesData(e,t,i,n,s,r,o){let a;this._assertVisible();let l=this._projectionData,h=l.injectionOffsets,d=l.injectionOptions,u=null;if(h){u=[];let e=0,t=0;for(let i=0;i<l.getOutputLineCount();i++){let n=[];u[i]=n;let s=i>0?l.breakOffsets[i-1]:0,r=l.breakOffsets[i];for(;t<h.length;){let o=d[t].content.length,a=h[t]+e,u=a+o;if(a>r)break;
193if(s<u){let e=d[t];if(e.inlineClassName){let t=i>0?l.wrappedTextIndentLength:0,o=t+Math.max(a-s,0),h=t+Math.min(u-s,r-s);o!==h&&n.push(new DA(o,h,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(u<=r)e+=o,t++;else break}}}if(h){let i=[];for(let e=0;e<h.length;e++){let t=h[e],n=d[e].tokens;n?n.forEach((n,s)=>{i.push({offset:t,text:n.substring(d[e].content),tokenMetadata:s.metadata})}):i.push({offset:t,text:d[e].content,tokenMetadata:fL.defaultTokenMetadata})}a=e.tokenization.getLineTokens(t).withInserted(i)}else a=e.tokenization.getLineTokens(t);for(let e=i;e<i+n;e++){let t=s+e-i;if(!r[t]){o[t]=null;continue}o[t]=this._getViewLineData(a,u?u[e]:null,e)}}_getViewLineData(e,t,i){this._assertVisible();let n=this._projectionData,s=i>0?n.wrappedTextIndentLength:0,r=i>0?n.breakOffsets[i-1]:0,o=n.breakOffsets[i],a=e.sliceAndInflate(r,o,s),l=a.getLineContent();i>0&&(l=DH(n.wrappedTextIndentLength)+l);let h=this._projectionData.getMinOutputOffset(i)+1,d=l.length+1;return new f$(l,i+1<this.getViewLineCount(),h,d,0===i?0:n.breakOffsetsVisibleColumn[i-1],a,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,i=2){return this._assertVisible(),this._projectionData.translateToOutputPosition(t-1,i).toPosition(e)}getViewLineNumberOfModelPosition(e,t){return this._assertVisible(),e+this._projectionData.translateToOutputPosition(t-1).outputLineIndex}normalizePosition(e,t,i){let n=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,i).toPosition(n)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw Error("Not supported")}}class DB{static{this.INSTANCE=new DB}constructor(){}isVisible(){return!0}setVisible(e){return e?this:DV.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){let n=e.tokenization.getLineTokens(t),s=n.getLineContent();return new f$(s,!1,1,s.length+1,0,n.inflate(),null)}getViewLinesData(e,t,i,n,s,r,o){if(!r[s]){o[s]=null;return}o[s]=this.getViewLineData(e,t,0)}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new s3(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}class DV{static{this.INSTANCE=new DV}constructor(){}isVisible(){return!1}setVisible(e){return e?DB.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw Error("Not supported")}getViewLineLength(e,t,i){throw Error("Not supported")}getViewLineMinColumn(e,t,i){throw Error("Not supported")}getViewLineMaxColumn(e,t,i){throw Error("Not supported")}getViewLineData(e,t,i){throw Error("Not supported")}getViewLinesData(e,t,i,n,s,r,o){throw Error("Not supported")}getModelColumnOfViewPosition(e,t){throw Error("Not supported")}getViewPositionOfModelPosition(e,t){throw Error("Not supported")}getViewLineNumberOfModelPosition(e,t){throw Error("Not supported")}normalizePosition(e,t,i){throw Error("Not supported")}getInjectedTextAt(e,t){throw Error("Not supported")}}let DW=[""];function DH(e){if(e>=DW.length)for(let t=1;t<=e;t++)DW[t]=Array(t+1).join(" ");return DW[e]}class Dz{constructor(e){this._model=e}_validPosition(e){return this._model.validatePosition(e)}_validRange(e){return this._model.validateRange(e)}convertViewPositionToModelPosition(e){return this._validPosition(e)}convertViewRangeToModelRange(e){return this._validRange(e)}validateViewPosition(e,t){return this._validPosition(t)}validateViewRange(e,t){return this._validRange(t)}convertModelPositionToViewPosition(e){return this._validPosition(e)}convertModelRangeToViewRange(e){return this._validRange(e)}modelPositionIsVisible(e){let t=this._model.getLineCount();return!(e.lineNumber<1)&&!(e.lineNumber>t)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class DU{constructor(e,t,i,n,s,r,o,a,l,h,d){this._editorId=e,this.model=t,this._val
193idModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=s,this.tabSize=r,this.wrappingStrategy=o,this.wrappingColumn=a,this.wrappingIndent=l,this.wordBreak=h,this.wrapOnEscapedLineFeeds=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new Dj(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));let i=this.model.getLinesContent(),n=this.model.getInjectedTextDecorations(this._editorId),s=i.length,r=this.createLineBreaksComputer(),o=new as.H9(Lg.fromDecorations(n));for(let e=0;e<s;e++){let n=o.takeWhile(t=>t.lineNumber===e+1);r.addRequest(i[e],n,t?t[e]:null)}let a=r.finalize(),l=[],h=this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e)).sort(s9.compareRangesUsingStarts),d=1,u=0,c=-1,g=0<h.length?u+1:s+2;for(let e=0;e<s;e++){let t=e+1;t===g&&(d=h[++c].startLineNumber,u=h[c].endLineNumber,g=c+1<h.length?u+1:s+2);let i=t>=d&&t<=u,n=DP(a[e],!i);l[e]=n.getViewLineCount(),this.modelLineProjections[e]=n}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new g9(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){let t=function(e){if(0===e.length)return[];let t=e.slice();t.sort(s9.compareRangesUsingStarts);let i=[],n=t[0].startLineNumber,s=t[0].endLineNumber;for(let e=1,r=t.length;e<r;e++){let r=t[e];r.startLineNumber>s+1?(i.push(new s9(n,1,s,1)),n=r.startLineNumber,s=r.endLineNumber):r.endLineNumber>s&&(s=r.endLineNumber)}return i.push(new s9(n,1,s,1)),i}(e.map(e=>this.model.validateRange(e))),i=this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e)).sort(s9.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n<t.length;n++)if(!t[n].equalsRange(i[n])){e=!0;break}if(!e)return!1}let n=t.map(e=>({range:e,options:Nk.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,n);let s=1,r=0,o=-1,a=0<t.length?r+1:this.modelLineProjections.length+2,l=!1;for(let e=0;e<this.modelLineProjections.length;e++){let i=e+1;i===a&&(s=t[++o].startLineNumber,r=t[o].endLineNumber,a=o+1<t.length?r+1:this.modelLineProjections.length+2);let n=!1;if(i>=s&&i<=r?this.modelLineProjections[e].isVisible()&&(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!1),n=!0):(l=!0,this.modelLineProjections[e].isVisible()||(this.modelLineProjections[e]=this.modelLineProjections[e].setVisible(!0),n=!0)),n){let t=this.modelLineProjections[e].getViewLineCount();this.projectedModelLineLineCounts.setValue(e,t)}}return l||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1)&&!(e>this.modelLineProjections.length)&&this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize!==e&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,s){let r=this.fontInfo.equals(e),o=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n,h=this.wordBreak===s;if(r&&o&&a&&l&&h)return!1;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=s;let d=null;if(r&&o&&!a&&l&&h){d=[];for(let e=0,t=this.modelLineProjections.length;e<t;e++)d[e]=this.modelLineProjections[e].getProjectionData()}return this._constructLines(!1,d),!0}createLineBreaksComputer(){return("advanced"===this.wrappingStrategy?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak,this.wrapOnEscapedLineFeeds)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;let n=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,s=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new NX(n,s)}
193onModelLinesInserted(e,t,i,n){if(!e||e<=this._validModelVersionId)return null;let s=t>2&&!this.modelLineProjections[t-2].isVisible(),r=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=0,a=[],l=[];for(let e=0,t=n.length;e<t;e++){let t=DP(n[e],!s);a.push(t);let i=t.getViewLineCount();o+=i,l[e]=i}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(a).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,l),new N1(r,r+o-1)}onModelLineChanged(e,t,i){if(null!==e&&e<=this._validModelVersionId)return[!1,null,null,null];let n=t-1,s=this.modelLineProjections[n].getViewLineCount(),r=DP(i,this.modelLineProjections[n].isVisible());this.modelLineProjections[n]=r;let o=this.modelLineProjections[n].getViewLineCount(),a=!1,l=0,h=-1,d=0,u=-1,c=0,g=-1;return s>o?(g=(c=(h=(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1)+o-1)+1)+(s-o)-1,a=!0):s<o?(u=(d=(h=(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1)+s-1)+1)+(o-s)-1,a=!0):h=(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1)+o-1,this.projectedModelLineLineCounts.setValue(n,o),[a,l<=h?new NZ(l,h-l+1):null,d<=u?new N1(d,u):null,c<=g?new NX(c,g):null]}acceptVersionId(e){this._validModelVersionId=e,1!==this.modelLineProjections.length||this.modelLineProjections[0].isVisible()||this.setHiddenAreas([])}getViewLineCount(){return this.projectedModelLineLineCounts.getTotalSum()}_toValidViewLineNumber(e){if(e<1)return 1;let t=this.getViewLineCount();return e>t?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);let n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),o=this.model.guides.getActiveIndentGuide(n.lineNumber,s.lineNumber,r.lineNumber),a=this.convertModelPositionToViewPosition(o.startLineNumber,1),l=this.convertModelPositionToViewPosition(o.endLineNumber,this.model.getLineMaxColumn(o.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:o.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);let t=this.projectedModelLineLineCounts.getIndexOf(e-1);return new DK(t.index+1,t.remainder)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){let t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new s3(e.modelLineNumber,n)}getModelEndPositionOfViewLine(e){let t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),n=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new s3(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){let i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),s=[],r=this.getModelStartPositionOfViewLine(i),o=[];for(let e=i.modelLineNumber;e<=n.modelLineNumber;e++){let t=this.modelLineProjections[e-1];if(t.isVisible()){let s=e===i.modelLineNumber?i.modelLineWrappedLineIdx:0,r=e===n.modelLineNumber?n.modelLineWrappedLineIdx+1:t.getViewLineCount();for(let t=s;t<r;t++)o.push(new DK(e,t))}if(!t.isVisible()&&r){let t=new s3(e-1,this.model.getLineMaxColumn(e-1)+1),i=s9.fromPositions(r,t);s.push(new D$(i,o)),o=[],r=null}else t.isVisible()&&!r&&(r=new s3(e,1))}if(r){let e=s9.fromPositions(r,this.getModelEndPositionOfViewLine(n));s.push(new D$(e,o))}return s}getViewLinesBracketGuides(e,t,i,n){let s=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,r=[];for(let i of this.getViewLineInfosGroupedByModelRanges(e,t)){let e=i.modelRange.startLineNumber,t=this.model.guides.getLinesBracketGuides(e,i.modelRange.endLineNumber,s,n);for(let n of i.viewLines){let i=t[n.modelLineNumber-e].map(e=>{if(-1!==e.forWrappedLinesAfterColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=n.modelLineWrappedLineIdx||-1!==e.forWrappedLinesBeforeOrAtColumn&&this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumber<n.modelLineWrappedLineIdx)return;if(!e.horizontalLine)return e;let t=-1;if(-1!==e.column){let i=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.column);if(i.lineNumber===n.modelLineWrappedLineIdx)t=i.column;else if(i.lineNumber<n.modelLineWrappedLineIdx)t=this.getMinColumnOfViewLine(n);else if(i.lineNumber>n.modelLineWrappedLineIdx)return}let i=this.convertModelPositionToViewPosition(n.modelLineNumber,e.horizontalLine.endColumn),s=this.modelLineProjections[n.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return s.lineNumber===n.modelLineWrappedLineIdx?new w5(e.visibleColumn,t,e.className,new w4(e.horizontalLine.top,i.column),-1,-1):s.lineNumber<n.modelLineWrappedLineIdx?void 0:-1===e.visibleColumn?new w5(e.visibleColumn,t,e.className,new w4(e.horizontalLine.top,this.getMaxColumnOfViewLine(n)),-1,-1):void 0});r.push(i.filter(e=>!!e))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);let i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),n=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t)),s=[],r=[],o=[],a=i.lineNumber-1,l=n.lineNumber-1,h=null;for(let e=a;
193e<=l;e++){let t=this.modelLineProjections[e];if(t.isVisible()){let n=t.getViewLineNumberOfModelPosition(0,e===a?i.column:1),s=t.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(e+1)),l=s-n+1,d=0;l>1&&1===t.getViewLineMinColumn(this.model,e+1,s)&&(d=0===n?1:2),r.push(l),o.push(d),null===h&&(h=new s3(e+1,0))}else null!==h&&(s=s.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,e)),h=null)}null!==h&&(s=s.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,n.lineNumber)),h=null);let d=t-e+1,u=Array(d),c=0;for(let e=0,t=s.length;e<t;e++){let t,i=s[e],n=Math.min(d-c,r[e]),a=o[e];t=2===a?0:1===a?1:n;for(let e=0;e<n;e++)e===t&&(i=0),u[c++]=i}return u}getViewLineContent(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineContent(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineLength(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineLength(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMinColumn(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMinColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineMaxColumn(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineMaxColumn(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLineData(e){let t=this.getViewLineInfo(e);return this.modelLineProjections[t.modelLineNumber-1].getViewLineData(this.model,t.modelLineNumber,t.modelLineWrappedLineIdx)}getViewLinesData(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);let n=this.projectedModelLineLineCounts.getIndexOf(e-1),s=e,r=n.index,o=n.remainder,a=[];for(let n=r,l=this.model.getLineCount();n<l;n++){let l=this.modelLineProjections[n];if(!l.isVisible())continue;let h=n===r?o:0,d=l.getViewLineCount()-h,u=!1;if(s+d>t&&(u=!0,d=t-s+1),l.getViewLinesData(this.model,n+1,h,d,s-e,i,a),s+=d,u)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);let n=this.projectedModelLineLineCounts.getIndexOf(e-1),s=n.index,r=n.remainder,o=this.modelLineProjections[s],a=o.getViewLineMinColumn(this.model,s+1,r),l=o.getViewLineMaxColumn(this.model,s+1,r);t<a&&(t=a),t>l&&(t=l);let h=o.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new s3(s+1,h)).equals(i)?new s3(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){let i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),n=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new s9(i.lineNumber,i.column,n.lineNumber,n.column)}convertViewPositionToModelPosition(e,t){let i=this.getViewLineInfo(e),n=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new s3(i.modelLineNumber,n))}convertViewRangeToModelRange(e){let t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new s9(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,n=!1,s=!1){let r=this.model.validatePosition(new s3(e,t)),o=r.lineNumber,a=r.column,l=o-1,h=!1;if(s)for(;l<this.modelLineProjections.length&&!this.modelLineProjections[l].isVisible();)l++,h=!0;else for(;l>0&&!this.modelLineProjections[l].isVisible();)l--,h=!0;if(0===l&&!this.modelLineProjections[l].isVisible())return new s3(n?0:1,1);let d=1+this.projectedModelLineLineCounts.getPrefixSum(l);return h?s?this.modelLineProjections[l].getViewPositionOfModelPosition(d,1,i):this.modelLineProjections[l].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(l+1),i):this.modelLineProjections[o-1].getViewPositionOfModelPosition(d,a,i)}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){let i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return s9.fromPositions(i)}{let t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new s9(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){let e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!this.modelLineProjections[i].isVisible())return 1;let n=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(n,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,n,s,r){let o=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-o.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new s9(o.lineNumber,1,a.lineNumber,a.column),t,i,n,s,r);let l=[],h=o.lineNumber-1,d=a.lineNumber-1,u=null;for(let e=h;e<=d;e++)if(this.modelLineProjections[e].isVisible())null===u&&(u=new s3(e+1,e===h?o.column:1));else if(null!==u){let r=this.model.getLineMaxColumn(e);l=l.concat(this.model.getDecorationsInRange(new s9(u.lineNumber,u.column,e,r),t,i,n,s)),u=null}null!==u&&(l=l.concat(this.model.getDecorationsInRange(new s9(u.lineNumber,u.column,a.lineNumber,a.column),t,i,n,s)),u=null),l.sort((e,t)=>
193{let i=s9.compareRangesUsingStarts(e.range,t.range);return 0===i?e.id<t.id?-1:e.id>t.id?1:0:i});let c=[],g=0,f=null;for(let e of l){let t=e.id;f!==t&&(f=t,c[g++]=e)}return c}getInjectedTextAt(e){let t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){let i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){let t=this.getViewLineInfo(e);return 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}class DK{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class D${constructor(e,t){this.modelRange=e,this.viewLines=t}}class Dj{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,n){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,n)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class Dq{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Dz(this.model)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,n){return!1}createLineBreaksComputer(){let e=[];return{addRequest:(t,i,n)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new NX(t,i)}onModelLinesInserted(e,t,i,n){return new N1(t,i)}onModelLineChanged(e,t,i){return[!1,new NZ(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){let i=t-e+1,n=Array(i);for(let e=0;e<i;e++)n[e]=0;return n}getViewLineContent(e){return this.model.getLineContent(e)}getViewLineLength(e){return this.model.getLineLength(e)}getViewLineMinColumn(e){return this.model.getLineMinColumn(e)}getViewLineMaxColumn(e){return this.model.getLineMaxColumn(e)}getViewLineData(e){let t=this.model.tokenization.getLineTokens(e),i=t.getLineContent();return new f$(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){let n=this.model.getLineCount();e=Math.min(Math.max(1,e),n),t=Math.min(Math.max(1,t),n);let s=[];for(let n=e;n<=t;n++){let t=n-e;s[t]=i[t]?this.getViewLineData(n):null}return s}getDecorationsInRange(e,t,i,n,s,r){return this.model.getDecorationsInRange(e,t,i,n,s,r)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}let DG=iJ.Right;class DQ{constructor(e){this.persist=0,this._requiredLanes=1,this.lanes=new Uint8Array(Math.ceil((e+1)*DG/8))}reset(e){let t=Math.ceil((e+1)*DG/8);this.lanes.length<t?this.lanes=new Uint8Array(t):this.lanes.fill(0),this._requiredLanes=1}get requiredLanes(){return this._requiredLanes}push(e,t,i){i&&(this.persist|=1<<e-1);for(let i=t.startLineNumber;i<=t.endLineNumber;i++){let t=DG*i+(e-1);this.lanes[t>>>3]|=1<<t%8,this._requiredLanes=Math.max(this._requiredLanes,this.countAtLine(i))}}getLanesAtLine(e){let t=[],i=DG*e;for(let e=0;e<DG;e++)(this.persist&1<<e||this.lanes[i>>>3]&1<<i%8)&&t.push(e+1),i++;return t.length?t:[iJ.Center]}countAtLine(e){let t=DG*e,i=0;for(let e=0;e<DG;e++)(this.persist&1<<e||this.lanes[t>>>3]&1<<t%8)&&i++,t++;return i}}class DY extends ro.JT{constructor(e,t,i,n,s,r,o,a,l,h){if(super(),this.languageConfigurationService=o,this._themeService=a,this._attachedView=l,this._transactionalTarget=h,this.hiddenAreasModel=new DX,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new N3,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new bT(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new oK(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=DJ.create(this.model),this.glyphLanes=new DQ(0),this.model.isTooLargeForTokenization())this._lines=new Dq(this.model);else{let e=this._configuration.options,t=e.get(59),i=e.get(156),r=e.get(166),o=e.get(155),a=e.get(146),l=e.get(160);this._lines=new DU(this._editorId,this.model,n,s,t,this.model.getOptions().tabSize,i,r.wrappingColumn,o,a,l)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new Dm(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new DM(this._configuration,this.getLineCount(),this._getCustomLineHeights(),r)),this._register(this.viewLayout.onDidScroll(e=>{e.scrollTopChanged&&this._handleVisibleLinesChanged(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new N2(e)),this._eventDispatcher.emitOutgoingEvent(new Di(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(e=>{this._eventDispatcher.emitOutgoingEvent(e)})),this._decorations=new DO(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(e=>{try{let t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(yu.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new N6)})),this._register(this._themeService.onDidColorThemeChange(e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new N5(e))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_getCustomLineHeights(){return this._configuration.options.get(5)?this.model.getCustomLineHeightsDecorations(this._editorId).map(e=>{let t=e.range.startLineNumber,i=this.coordinatesConverter.convertModelRangeToViewRange(new s9(t,1,t,this.model.getLineMaxColumn(t)));return{decorationId:e.id,startLineNumber:i.startLineNumber,endLineNumber:i.endLineNumber,lineHeight:e.options.lineHeight||0}}):[]}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){let e=this.viewLayout.getLinesViewportData(),t=new s9(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){let e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){let e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new NQ(e)),this._eventDispatcher.emitOutgoingEvent(new De(!e,e))}setHasWidgetFocus(e){this._eventDispatcher.emitOutgoingEvent(new Dt(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new NU)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new NK)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){let e=new s3(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber));return new D0(this.coordinatesConverter.convertViewPositionToModelPosition(e),this._viewportStart.startLineDelta)}return new D0(null,0)}_onConfigurationChanged(e,t){let i=this._captureStableViewport(),n=this._configuration.options,s=n.get(59),r=n.get(156),o=n.get(166),a=n.get(155),l=n.get(146);this._lines.setWrappingSettings(s,r,o.wrappingColumn,a,l)&&(e.emitViewEvent(new NG),e.emitViewEvent(new NJ),e.emitViewEvent(new Nq(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(104)&&(this._decorations.reset(),e.emitViewEvent(new Nq(null))),t.hasChanged(112)&&(this._decorations.reset(),e.emitViewEvent(new Nq(null))),e.emitViewEvent(new N$(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),bT.shouldRecreate(t)&&(this.cursorConfig=new bT(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{let t=this._eventDispatcher.beginEmitViewEvents(),i=!1,n=!1,s=e instanceof LL?e.rawContentChangedEvent.changes:e.changes,r=e instanceof LL?e.rawContentChangedEvent.versionId:null,o=this._lines.createLineBreaksComputer();for(let e of s)switch(e.changeType){case 4:for(let t=0;t<e.detail.length;t++){let i=e.detail[t],n=e.injectedTexts[t];
193n&&(n=n.filter(e=>!e.ownerId||e.ownerId===this._editorId)),o.addRequest(i,n,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter(e=>!e.ownerId||e.ownerId===this._editorId)),o.addRequest(e.detail,t,null)}}let a=o.finalize(),l=new as.H9(a);for(let e of s)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new NG),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),i=!0;break;case 3:{let n=this._lines.onModelLinesDeleted(r,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{let n=l.takeCount(e.detail.length),s=this._lines.onModelLinesInserted(r,e.fromLineNumber,e.toLineNumber,n);null!==s&&(t.emitViewEvent(s),this.viewLayout.onLinesInserted(s.fromLineNumber,s.toLineNumber)),i=!0;break}case 2:{let i=l.dequeue(),[s,o,a,h]=this._lines.onModelLineChanged(r,e.lineNumber,i);n=s,o&&t.emitViewEvent(o),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),h&&(t.emit
193ViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber))}}null!==r&&this._lines.acceptVersionId(r),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new NJ),t.emitViewEvent(new Nq(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}let t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){let e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){let t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStart.startLineDelta},1)}}try{let t=this._eventDispatcher.beginEmitViewEvents();e instanceof LL&&t.emitOutgoingEvent(new Dd(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._configuration.options.get(5)&&this._register(this.model.onDidChangeLineHeight(e=>{let t=e.changes.filter(e=>e.ownerId===this._editorId||0===e.ownerId);if(this.viewLayout.changeSpecialLineHeights(e=>{for(let i of t){let{decorationId:t,lineNumber:n,lineHeight:s}=i,r=this.coordinatesConverter.convertModelRangeToViewRange(new s9(n,1,n,this.model.getLineMaxColumn(n)));null!==s?e.insertOrChangeCustomLineHeight(t,r.startLineNumber,r.endLineNumber,s):e.removeCustomLineHeight(t)}}),t.length>0){let e=new Ly(t);this._eventDispatcher.emitOutgoingEvent(new Dg(e))}})),this._configuration.options.get(172)&&this._register(this.model.onDidChangeFont(e=>{let t=e.changes.filter(e=>e.ownerId===this._editorId||0===e.ownerId);if(t.length>0){let e=new LS(t);this._eventDispatcher.emitOutgoingEvent(new Df(e))}})),this._register(this.model.onDidChangeTokens(e=>{let t=[];for(let i=0,n=e.ranges.length;i<n;i++){let n=e.ranges[i],s=this.coordinatesConverter.convertModelPositionToViewPosition(new s3(n.fromLineNumber,1)).lineNumber,r=this.coordinatesConverter.convertModelPositionToViewPosition(new s3(n.toLineNumber,this.model.getLineMaxColumn(n.toLineNumber))).lineNumber;t[i]={fromLineNumber:s,toLineNumber:r}}this._eventDispatcher.emitSingleViewEvent(new N4(t)),this._eventDispatcher.emitOutgoingEvent(new Dc(e))})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new NY),this.cursorConfig=new bT(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Dh(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new bT(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Dl(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{let e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new NG),e.emitViewEvent(new NJ),e.emitViewEvent(new Nq(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new bT(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new Du(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new Nq(e)),this._eventDispatcher.emitOutgoingEvent(new Da(e))}))}getFontSizeAtPosition(e){if(!this._configuration.options.get(172))return null;let t=this.model.getFontDecorationsInRange(s9.fromPositions(e),this._editorId),i=this._configuration.options.get(59).fontSize+"px";for(let e of t)if(e.options.fontSize){i=e.options.fontSize;break}return i}setHiddenAreas(e,t,i){this.hiddenAreasModel.setHiddenAreas(t,e);let n=this.hiddenAreasModel.getMergedRanges();if(n===this.previousHiddenAreas&&!i)return;this.previousHiddenAreas=n;let s=this._captureStableViewport(),r=!1;try{let e=this._eventDispatcher.beginEmitViewEvents();(r=this._lines.setHiddenAreas(n))&&(e.emitViewEvent(new NG),e.emitViewEvent(new NJ),e.emitViewEvent(new Nq(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount(),this._getCustomLineHeights()),this.viewLayout.onHeightMaybeChanged());let t=s.viewportStartModelPosition?.lineNumber;t&&n.some(e=>e.startLineNumber<=t&&t<=e.endLineNumber)||s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),r&&this._eventDispatcher.emitOutgoingEvent(new Ds)}getVisibleRangesPlusViewportAboveBelow(){let e=this._configuration.options.get(165),t=this._configuration.options.get(75),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),s=Math.max(1,n.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new s9(s,this.getLineMinColumn(s),r,this.getLineMaxColumn(r)))}getVisibleRanges(){let e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){let t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(0===i.length)return[t];let n=[],s=0,r=t.startLineNumber,o=t.startColumn,a=t.endLineNumber,l=t.endColumn;for(let e=0,t=i.length;e<t;e++){let t=i[e].startLineNumber,l=i[e].endLineNumber;l<r||t>a||(r<t&&(n[s++]=new s9(r,o,t-1,this.model.getLineMaxColumn(t-1))),r=l+1,o=1)}return(r<a||r===a&&o<l)&&(n[s++]=new s9(r,o,a,l)),n}getCompletelyVisibleViewRange(){let e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new s9(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){let t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,n=t.completelyVisibleEndLineNumber;return new s9(i,this.getLineMinColumn(i),n,this.getLineMaxColumn(n))}saveState(){let e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),n=this.coordinatesConverter.convertViewPositionToModelPosition(new s3(i,this.getLineMinColumn(i))),s=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:n,firstPositionDeltaTop:s}}reduceRestoreState(e){if(void 0===e.firstPosition)return this._reduceRestoreStateCompatibility(e);let t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),n=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:n}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,n){return this._lines.getViewLinesBracketGuides(e,t,i,n)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){let t=rM(this.getLineContent(e));return -1===t?0:t+1}getLineLastNonWhitespaceColumn(e){let t=rA(this.getLineContent(e));return -1===t?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}_getTextDirection(e,t){let i=0;for(let n of t){let t=n.range;if(t.startLineNumber>e||t.endLineNumber<e)continue;let s=n.options.textDirection;s===iZ.RTL?i++:s===iZ.LTR&&i--}return i>0?iZ.RTL:iZ.LTR}getTextDirection(e){let t=this._decorations.getDecorationsOnLine(e);return this._getTextDirection(e,t.decorations)}getViewportViewLineRenderingData(e,t){let i=this._decorations.getDecorationsViewportData(e),n=i.inlineDecorations[t
193-e.startLineNumber];return this._getViewLineRenderingData(t,n,i.hasVariableFonts,i.decorations)}getViewLineRenderingData(e){let t=this._decorations.getDecorationsOnLine(e);return this._getViewLineRenderingData(e,t.inlineDecorations[0],t.hasVariableFonts,t.decorations)}_getViewLineRenderingData(e,t,i,n){let s=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),a=this._lines.getViewLineData(e);return a.inlineDecorations&&(t=[...t,...a.inlineDecorations.map(t=>t.toInlineDecoration(e))]),new fj(a.minColumn,a.maxColumn,a.content,a.continuesWithWrappedLine,s,r,a.tokens,t,o,a.startVisibleColumn,this._getTextDirection(e,n),i)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){let n=this._lines.getViewLinesData(e,t,i);return new fK(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){let t=this.model.getOverviewRulerDecorations(this._editorId,(0,sh.$J)(this._configuration.options),(0,sh.PZ)(this._configuration.options)),i=new DZ;for(let n of t){let t=n.options,s=t.overviewRuler;if(!s)continue;let r=s.position;if(0===r)continue;let o=s.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(o,t.zIndex,a,l,r)}return i.asArray}_invalidateDecorationsColorCache(){for(let e of this.model.getOverviewRulerDecorations()){let t=e.options.overviewRuler;t?.invalidateCachedColor();let i=e.options.minimap;i?.invalidateCachedColor()}}getValueInRange(e,t){let i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){let i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){let i=this.coordinatesConverter.convertViewPositionToModelPosition(e),n=this.model.modifyPosition(i,t);return this.coordinatesConverter.convertModelPositionToViewPosition(n)}deduceModelPositionRelativeToViewPosition(e,t,i){let n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);let s=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,i){let n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(s9.compareRangesUsingStarts);let s=!1,r=!1;for(let t of e)t.isEmpty()?s=!0:r=!0;if(!r){if(!t)return"";let i=e.map(e=>e.startLineNumber),s="";for(let e=0;e<i.length;e++)e>0&&i[e-1]===i[e]||(s+=this.model.getLineContent(i[e])+n);return s}if(s&&t){let t=[],n=0;for(let s of e){let e=s.startLineNumber;s.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(s,i?2:0)),n=e}return 1===t.length?t[0]:t}let o=[];for(let t of e)t.isEmpty()||o.push(this.model.getValueInRange(t,i?2:0));return 1===o.length?o[0]:o}getRichTextToCopy(e,t){let i;let n=this.model.getLanguageId();if(n===u0||1!==e.length)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;let e=s.startLineNumber;s=new s9(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}let r=this._configuration.options.get(59),o=this._getColorMap();return/[:;\\\/<>]/.test(r.fontFamily)||r.fontFamily===l7.hL.fontFamily?i=l7.hL.fontFamily:(i=(i=r.fontFamily).replace(/"/g,"'"),!/[,']/.test(i)&&/[+ ]/.test(i)&&(i=`'${i}'`),i=`${i}, ${l7.hL.fontFamily}`),{mode:n,html:`<div style="color: ${o[1]};background-color: ${o[2]};font-family: ${i};font-weight: ${r.fontWeight};font-size: ${r.fontSize}px;line-height: ${r.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(s,o)+"</div>"}}_getHTMLToCopy(e,t){let i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn,o=this.getTabSize(),a="";for(let e=i;e<=s;e++){let l=this.model.tokenization.getLineTokens(e),h=l.getLineContent(),d=e===i?n-1:0,u=e===s?r-1:h.length;""===h?a+="<br>":a+=function(e,t,i,n,s,r,o){let a="<div>",l=0,h=0,d=!0;for(let u=0,c=t.getCount();u<c;u++){let c=t.getEndOffset(u),g="";for(;l<c&&l<s;l++){let t=e.charCodeAt(l),i=9===t;if(h+=r6(t)?2:i?0:1,l<n){if(i){let e=h%r;h+=0===e?r:r-e}continue}switch(t){case 9:{let e=h%r,t=0===e?r:r-e;h+=t;let i=t;for(;i>0;)o&&d?(g+="&#160;",d=!1):(g+=" ",d=!0),i--;break}case 60:g+="&lt;",d=!1;break;case 62:g+="&gt;",d=!1;break;case 38:g+="&amp;",d=!1;break;case 0:g+="&#00;",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",d=!1;break;case 13:g+="&#8203",d=!1;break;case 32:o&&d?(g+="&#160;",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(t),d=!1}}if(!(c<=n)&&(a+=`<span style="${t.getInlineStyle(u,i)}">${g}</span>`,c>s||l>=s||n>=s))break}return a+"</div>"}(h,l.inflate(),t,d,u,o,sS.ED)}return a}_getColorMap(){let e=rp.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=gX.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(n=>this._cursor.setStates(n,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(n=>this._cursor.setSelections(n,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new Do);return}this._withViewEventsCollector(e)}executeEdits(e,t,i,n){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i,n))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,n,s){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,s))}paste(e,t,i,n){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealAllCursors(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealAll(n,e,i,0,t,0))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){let t=this._cursor.getTopMostViewPosition(),i=new s9(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new N0(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){let t=this._cursor.getBottomMostViewPosition(),i=new s9(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(t=>t.emitViewEvent(new N0(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,n,s){this._withViewEventsCollector(r=>r.emitViewEvent(new N0(e,!1,i,null,n,t,s)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new N7),this._eventDispatcher.emitOutgoingEvent(new Dn))}_withViewEventsCollector(e){return this._transactionalTarget.batchChanges(()=>{try{let t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}})}batchEvents(e){this._withViewEventsCollector(()=>{e()})}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class DJ{static create(e){let t=e._setTrackedRange(null,new s9(1,1,1,1),1);return new DJ(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,n,s){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=s}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){let i=e.coordinatesConverter.convertViewPositionToModelPosition(new s3(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new s9(i.lineNumber,i.column,i.lineNumber,i.column),1),s=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=r-s}invalidate(){this._isValid=!1}}class DZ{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,s){let r=this._asMap[e];if(r){let e=r.data,t=e[e.length-3],o=e[e.length-1];if(t===s&&o+1>=i){n>o&&(e[e.length-1]=n);return}e.push(s,i,n)}else{let r=new fq(e,t,[s,i,n]);this._asMap[e]=r,this.asArray.push(r)}}}class DX{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){let i=this.hiddenAreas.get(e);i&&D1(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;let e=Array.from(this.hiddenAreas.values()).reduce((e,t)=>
193(function(e,t){let i=[],n=0,s=0;for(;n<e.length&&s<t.length;){let r=e[n],o=t[s];if(r.endLineNumber<o.startLineNumber-1)i.push(e[n++]);else if(o.endLineNumber<r.startLineNumber-1)i.push(t[s++]);else{let e=Math.min(r.startLineNumber,o.startLineNumber),t=Math.max(r.endLineNumber,o.endLineNumber);i.push(new s9(e,1,t,1)),n++,s++}}for(;n<e.length;)i.push(e[n++]);for(;s<t.length;)i.push(t[s++]);return i})(e,t),[]);return D1(this.ranges,e)||(this.ranges=e),this.ranges}}function D1(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].equalsRange(t[i]))return!1;return!0}class D0{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;let i=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),n=t.getVerticalOffsetForLineNumber(i.lineNumber);t.setScrollPosition({scrollTop:n+this.startLineDelta},1)}}class D2{constructor(...e){for(let[t,i]of(this._entries=new Map,e))this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}var D5=function(e,t){return function(i,n){t(i,n,e)}};let D4=class extends ro.JT{static{nv=this}static{this.dropIntoEditorDecorationOptions=Nk.register({description:"workbench-dnd-target",className:"dnd-target"})}get isSimpleWidget(){return this._configuration.isSimpleWidget}get contextMenuId(){return this._configuration.contextMenuId}get contextKeyService(){return this._contextKeyService}constructor(e,t,i,n,s,r,o,a,l,h,d,u){let c;super(),this.languageConfigurationService=d,this._deliveryQueue=(0,sd.Sp)(),this._contributions=this._register(new LD),this._onDidDispose=this._register(new sd.Q5),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeLineHeight=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeLineHeight=this._onDidChangeLineHeight.event,this._onDidChangeFont=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeFont=this._onDidChangeFont.event,this._onDidChangeModelTokens=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onWillChangeModel=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onWillChangeModel=this._onWillChangeModel.event,this._onDidChangeModel=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new D9(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new D3({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new D3({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new D9(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new D9(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new D9(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new D9(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new D9(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new D9(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new D9(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new D9(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new D9(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new D9(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new D9(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new D9(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new D9(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new D9(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new D9(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new D9(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new D9(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new sd.Q5({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._updateCounter=0,this._onWillTriggerEditorOperationEvent=this._register(new sd.Q5),this._onBeginU
193pdate=this._register(new sd.Q5),this.onBeginUpdate=this._onBeginUpdate.event,this._onEndUpdate=this._register(new sd.Q5),this.onEndUpdate=this._onEndUpdate.event,this._onBeforeExecuteEdit=this._register(new sd.Q5),this.onBeforeExecuteEdit=this._onBeforeExecuteEdit.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),this.inComposition=!1,s.willCreateCodeEditor();let g={...t};if(this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++D6,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,i.contextMenuId??(i.isSimpleWidget?h8.SimpleEditorContext:h8.EditorContext),g,h)),this._register(this._configuration.onDidChange(e=>{this._onDidChangeConfiguration.fire(e);let t=this._configuration.options;if(e.hasChanged(165)){let e=t.get(165);this._onDidLayoutChange.fire(e)}})),this._contextKeyService=this._register(o.createScoped(this._domElement)),i.contextKeyValues)for(let[e,t]of Object.entries(i.contextKeyValues))this._contextKeyService.createKey(e,t);for(let e of(this._notificationService=l,this._codeEditorService=s,this._commandService=r,this._themeService=a,this._register(new D8(this,this._contextKeyService)),this._register(new Ee(this,this._contextKeyService,u)),this._instantiationService=this._register(n.createChild(new D2([hZ,this._contextKeyService]))),this._modelData=null,this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={},c=Array.isArray(i.contributions)?i.contributions:iG.getEditorContributions(),this._contributions.initialize(this,c,this._instantiationService),iG.getEditorActions())){if(this._actions.has(e.id)){(0,o_.dL)(Error(`Cannot have two actions with the same id ${e.id}`));continue}let t=new LE(e.id,e.label,e.alias,e.metadata,e.precondition??void 0,t=>this._instantiationService.invokeFunction(i=>Promise.resolve(e.runEditorCommand(i,this,t))),this._contextKeyService);this._actions.set(t.id,t)}let f=()=>!this._configuration.options.get(104)&&this._configuration.options.get(43).enabled;this._register(new lF(this._domElement,{onDragOver:e=>{if(!f())return;let t=this.getTargetAtClientPoint(e.clientX,e.clientY);t?.position&&this.showDropIndicatorAt(t.position)},onDrop:async e=>{if(!f()||(this.removeDropIndicator(),!e.dataTransfer))return;let t=this.getTargetAtClientPoint(e.clientX,e.clientY);t?.position&&this._onDropIntoEditor.fire({position:t.position,event:e})},onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){this._modelData?.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i,n){return new m_(e,t,i,this._domElement,n)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return fb.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?bG.getWordAtPosition(this._modelData.model,this._configuration.options.get(148),this._configuration.options.get(147),e):null}getValue(e=null){if(!this._modelData)return"";let t=!!e&&!!e.preserveBOM,i=0;return e&&e.lineEnding&&"\n"===e.lineEnding?i=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){try{if(this._beginUpdate(),!this._modelData)return;this._modelData.model.setValue(e)}finally{this._endUpdate()}}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){try{if(this._beginUpdate(),null===this._modelData&&null===e||this._modelData&&this._modelData.model===e)return;let t={oldModelUrl:this._modelData?.model.uri||null,newModelUrl:e?.uri||null};this._onWillChangeModel.fire(t);let i=this.hasTextFocus(),n=this._detachModel();this._attachModel(e),this.hasModel()?i&&this.focus():(this._editorTextFocus.setValue(!1),this._editorWidgetFocus.setValue(!1)),this._removeDecorationTypes(),this._onDidChangeModel.fire(t),this._postDetachModelCleanup(n),this._contributionsDisposable=this._contributions.onAfterModelAttached()}finally{this._endUpdate()}}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(let e in this._decorationTypeSubtypes){let t=this._decorationTypeSubtypes[e];for(let i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}
193getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){let s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?nv._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?nv._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){let s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){if(!this._modelData)return -1;let i=this._modelData.model.getLineMaxColumn(e);return nv._getVerticalOffsetAfterPosition(this._modelData,e,i,t)}getLineHeightForPosition(e){if(!this._modelData)return -1;let t=this._modelData.viewModel,i=t.coordinatesConverter,n=s3.lift(e);if(i.modelPositionIsVisible(n)){let e=i.convertModelPositionToViewPosition(n);return t.viewLayout.getLineHeightForLineNumber(e.lineNumber)}return 0}setHiddenAreas(e,t,i){this._modelData?.viewModel.setHiddenAreas(e.map(e=>s9.lift(e)),t,i)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;let t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return vR.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!s3.isIPosition(e))throw Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,n){if(!this._modelData)return;if(!s9.isIRange(e))throw Error("Invalid arguments");let s=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,r,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw Error("Invalid arguments");this._sendRevealRange(new s9(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!s3.isIPosition(e))throw Error("Invalid arguments");this._sendRevealRange(new s9(e.lineNumber,e.column,e.lineNumber,e.column),t,i,n)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){let i=s8.isISelection(e),n=s9.isIRange(e);if(!i&&!n)throw Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){let i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;let i=new s8(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw Error("Invalid arguments");this._sendRevealRange(new s9(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!s9.isIRange(e))throw Error("Invalid arguments");this._sendRevealRange(s9.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw Error("Invalid arguments");for(let t=0,i=e.length;t<i;t++)if(!s8.isISelection(e[t]))throw Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}getContentWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getContentWidth():-1}getScrollWidth(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollWidth():-1}getScrollLeft(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollLeft():-1}getContentHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getContentHeight():-1}getScrollHeight(){return this._modelData?this._modelData.viewModel.viewLayout.getScrollHeight():-1}getScrollTop(){return this._modelData?this._modelData.viewModel.viewLayout.getCurrentScrollTop():-1}setScrollLeft(e,t=1){if(this._modelData){if("number"!=typeof e)throw Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if("number"!=typeof e)throw Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollTop:e},t)}}setScrollPosition(e,t=1){this._modelData&&this._modelData.viewModel.viewLayout.setScrollPosition(e,t)}hasPendingScrollAnimation(){return!!this._modelData&&this._modelData.viewModel.viewLayout.hasPendingScrollAnimation()}saveViewState(){if(!this._modelData)return null;let e=this._contributions.saveViewState();return{cursorState:this._modelData.viewModel.saveCursorState(),viewState:this._modelData.viewModel.saveState(),contributionsState:e}}restoreViewState(e){if(this._modelData&&this._modelData.hasRealView&&e&&e.cursorState&&e.viewState){let t=e.cursorState;Array.isArray(t)?t.length>0&&this._modelData.viewModel.restoreCursorState(t):this._modelData.viewModel.restoreCursorState([t]),this._contributions.restoreViewState(e.contributionsState||{});let i=this._modelData.viewModel.reduceRestoreState(e.viewState);this._modelData.view.restoreState(i)}}handleInitialized(){this._getViewModel()?.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){return this.getActions().filter(e=>e.isSupported())}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){i=i||{};try{switch(this._onWillTriggerEditorOperationEvent.fire({source:e,handlerId:t,payload:i}),this._beginUpdate(),t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{let t=i;this._type(e,t.text||"");return}case"replacePreviousChar":{let t=i;this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0);return}case"compositionType":{let t=i;this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0);return}case"paste":{let t=i;this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null,t.clipboardEvent);return}case"cut":this._cut(e);return}let n=this.getAction(t);
193if(n){Promise.resolve(n.run(i)).then(void 0,o_.dL);return}if(!this._modelData||this._triggerEditorCommand(e,t,i))return;this._triggerCommand(t,i)}finally{this._endUpdate()}}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this.inComposition=!0,this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this.inComposition=!1,this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){this._modelData&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,s){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,s,e)}_paste(e,t,i,n,s,r){if(!this._modelData)return;let o=this._modelData.viewModel,a=o.getSelection().getStartPosition();o.paste(t,i,n,e);let l=o.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({clipboardEvent:r,range:new s9(a.lineNumber,a.column,l.lineNumber,l.column),languageId:s})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){let n=iG.getEditorCommand(t);return!!n&&(i=i||{},(0,re.Kn)(i)&&(i.source=e),this._instantiationService.invokeFunction(e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,o_.dL)}),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!(!this._modelData||this._configuration.options.get(104))&&(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!(!this._modelData||this._configuration.options.get(104))&&(this._modelData.model.popStackElement(),!0)}edit(e,t){return this.executeEdits(t,e.replacements.map(e=>({range:e.range,text:e.text})),void 0)}executeEdits(e,t,i){let n,s,r;return!(!this._modelData||this._configuration.options.get(104))&&(n=i?Array.isArray(i)?()=>i:i:()=>null,e instanceof xx?(r=e,s=e.metadata.source):(r=xN.unknown({name:s}),s=e),this._onBeforeExecuteEdit.fire({source:s??void 0}),this._modelData.viewModel.executeEdits(s,t,n,r),!0)}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new Et(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){if(!this._modelData)return null;let t=this._configuration.options;return this._modelData.model.getLineDecorations(e,this._id,(0,sh.$J)(t),(0,sh.PZ)(t))}getDecorationsInRange(e){if(!this._modelData)return null;let t=this._configuration.options;return this._modelData.model.getDecorationsInRange(e,this._id,(0,sh.$J)(t),(0,sh.PZ)(t))}getFontSizeAtPosition(e){return this._modelData?this._modelData.viewModel.getFontSizeAtPosition(e):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){let t=this._decorationTypeKeysToIds[e];t&&this.changeDecorations(e=>e.deltaDecorations(t,[])),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(165)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}delegateVerticalScrollbarPointerDown(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e,t=!1){this._configuration.observeContainer(e),t||this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!!this._modelData&&!!this._modelData.hasRealView&&this._modelData.view.isFocused()}hasWidgetFocus(){return!!this._modelData&&!!this._modelData.hasRealView&&this._modelData.view.isWidgetFocused()}
193addContentWidget(e){let t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id:"+e.getId()),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){let t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){let i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){let t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){let e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}addOverlayWidget(e){let t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){let t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){let i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){let t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){let e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}addGlyphMarginWidget(e){let t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){let t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){let i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){let t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){let e=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;let t=this._modelData.model.validatePosition(e),i=this._configuration.options.get(165);return{top:nv._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+i.glyphMarginWidth+i.lineNumbersWidth+i.decorationsWidth-this.getScrollLeft(),height:this.getLineHeightForPosition(t)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.viewModel.batchEvents(()=>{this._modelData.view.render(!0,e)})}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){l5(e,this._configuration.options.get(59))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}let t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());let i=e.onBeforeAttached(),n=new DY(this._id,this._configuration,e,Lk.create(aG(this._domElement)),NR.create(this._configuration.options),e=>u(aG(this._domElement),e),this.languageConfigurationService,this._themeService,i,{batchChanges:e=>{try{return this._beginUpdate(),e()}finally{this._endUpdate()}}});t.push(e.onWillDispose(()=>this.setModel(null))),t.push(n.onEvent(t=>{switch(t.kind){case 0:this._onDidContentSizeChange.fire(t);break;case 1:this._editorTextFocus.setValue(t.hasFocus);break;case 2:this._editorWidgetFocus.setValue(t.hasFocus);break;case 3:this._onDidScrollChange.fire(t);break;case 4:this._onDidChangeViewZones.fire();break;case 5:this._onDidChangeHiddenAreas.fire();break;case 6:this._onDidAttemptReadOnlyEdit.fire();break;case 7:{if(t.reachedMaxCursorCount){let e=this.getOption(89),t=(0,rh.NC)(83,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",e);this._notificationService.prompt(Sh.Warning,t,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:(0,rh.NC)(84,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}let e=[];for(let i=0,n=t.selections.length;i<n;i++)e[i]=t.selections[i].getPosition();let i={position:e[0],secondaryPositions:e.slice(1),reason:t.reason,source:t.source};this._onDidChangeCursorPosition.fire(i);let n={selection:t.selections[0],secondarySelections:t.selections.slice(1),modelVersionId:t.modelVersionId,oldSelections:t.oldSelections,oldModelVersionId:t.oldModelVersionId,source:t.source,reason:t.reason};this._onDidChangeCursorSelection.fire(n);break}case 8:this._onDidChangeModelDecorations.fire(t.event);break;case 9:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(t.event);break;case 10:this._onDidChangeModelLanguageConfiguration.fire(t.event);break;case 11:this._onDidChangeModelContent.fire(t.event);break;case 12:this._onDidChangeModelOptions.fire(t.event);break;case 13:this._onDidChangeModelTokens.fire(t.event);break;case 14:this._onDidChangeLineHeight.fire(t.event);break;case 15:this._onDidChangeFont.fire(t.event)}}));let[s,r]=this._createView(n);if(r){this._domElement.appendChild(s.domNode.domNode);let t=Object.keys(this._contentWidgets);for(let e=0,i=t.length;e<i;e++){let i=t[e];s.addContentWidget(this._contentWidgets[i])}t=Object.keys(this._overlayWidgets);for(let e=0,i=t.length;e<i;e++){let i=t[e];s.addOverlayWidget(this._overlayWidgets[i])}t=Object.keys(this._glyphMarginWidgets);for(let e=0,i=t.length;e<i;e++){let i=t[e];s.addGlyphMarginWidget(this._glyphMarginWidgets[i])}
193s.render(!1,!0),s.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new D7(e,n,s,r,t,i)}_createView(e){let t;t=this.isSimpleWidget?{paste:(e,t,i,n)=>{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{this._commandService.executeCommand("paste",{text:e,pasteOnNewLine:t,multicursorText:i,mode:n})},type:e=>{this._commandService.executeCommand("type",{text:e})},compositionType:(e,t,i,n)=>{i||n?this._commandService.executeCommand("compositionType",{text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n}):this._commandService.executeCommand("replacePreviousChar",{text:e,replaceCharCnt:t})},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};let i=new CV(e.coordinatesConverter);return i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e),[new Ls(this._domElement,this.getId(),t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e?.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(this._contributionsDisposable?.dispose(),this._contributionsDisposable=void 0,!this._modelData)return null;let e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&t.remove(),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._bannerDomNode.remove(),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}showDropIndicatorAt(e){let t=[{range:new s9(e.lineNumber,e.column,e.lineNumber,e.column),options:nv.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}_beginUpdate(){this._updateCounter++,1===this._updateCounter&&this._onBeginU
193pdate.fire()}_endUpdate(){this._updateCounter--,0===this._updateCounter&&this._onEndUpdate.fire()}};D4=nv=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([D5(3,he),D5(4,hi),D5(5,hg),D5(6,hZ),D5(7,CG),D5(8,Sd),D5(9,mg),D5(10,u8),D5(11,fa)],D4);let D6=0;class D7{constructor(e,t,i,n,s,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=s,this.attachedView=r}dispose(){(0,ro.B9)(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}class D3 extends ro.JT{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new sd.Q5(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new sd.Q5(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){let t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class D9 extends sd.Q5{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class D8 extends ro.JT{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=i8.editorSimpleInput.bindTo(t),this._editorFocus=i8.focus.bindTo(t),this._textInputFocus=i8.textInputFocus.bindTo(t),this._editorTextFocus=i8.editorTextFocus.bindTo(t),this._tabMovesFocus=i8.tabMovesFocus.bindTo(t),this._editorReadonly=i8.readOnly.bindTo(t),this._inDiffEditor=i8.inDiffEditor.bindTo(t),this._editorColumnSelection=i8.columnSelection.bindTo(t),this._hasMultipleSelections=i8.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=i8.hasNonEmptySelection.bindTo(t),this._canUndo=i8.canUndo.bindTo(t),this._canRedo=i8.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(mc.onDidChangeTabFocus(e=>this._tabMovesFocus.set(e))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){let e=this._editor.getOptions();this._tabMovesFocus.set(e.get(164)||mc.getTabFocusMode()),this._editorReadonly.set(e.get(104)),this._inDiffEditor.set(e.get(70)),this._editorColumnSelection.set(e.get(28))}_updateFromSelection(){let e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(e=>!e.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){let e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class Ee extends ro.JT{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=i8.languageId.bindTo(t),this._hasCompletionItemProvider=i8.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=i8.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=i8.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=i8.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=i8.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=i8.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=i8.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=i8.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=i8.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=i8.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=i8.hasReferenceProvider.bindTo(t),this._hasRenameProvider=i8.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=i8.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvi
193der=i8.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=i8.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=i8.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=i8.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=i8.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInEmbeddedEditor=i8.isInEmbeddedEditor.bindTo(t);let n=()=>this._update();this._register(e.onDidChangeModel(n)),this._register(e.onDidChangeModelLanguage(n)),this._register(i.completionProvider.onDidChange(n)),this._register(i.codeActionProvider.onDidChange(n)),this._register(i.codeLensProvider.onDidChange(n)),this._register(i.definitionProvider.onDidChange(n)),this._register(i.declarationProvider.onDidChange(n)),this._register(i.implementationProvider.onDidChange(n)),this._register(i.typeDefinitionProvider.onDidChange(n)),this._register(i.hoverProvider.onDidChange(n)),this._register(i.documentHighlightProvider.onDidChange(n)),this._register(i.documentSymbolProvider.onDidChange(n)),this._register(i.referenceProvider.onDidChange(n)),this._register(i.renameProvider.onDidChange(n)),this._register(i.documentFormattingEditProvider.onDidChange(n)),this._register(i.documentRangeFormattingEditProvider.onDidChange(n)),this._register(i.signatureHelpProvider.onDidChange(n)),this._register(i.inlayHintsProvider.onDidChange(n)),n()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInEmbeddedEditor.reset()})}_update(){let e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInEmbeddedEditor.set(e.uri.scheme===iA.walkThroughSnippet||e.uri.scheme===iA.vscodeChatCodeBlock)})}}class Et{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(i=>{this._isChangingDecorations||e.call(t,i)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];let e=this._editor.getModel(),t=[];for(let i of this._decorationIds){let n=e.getDecorationRange(i);
193n&&t.push(n)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){0!==this._decorationIds.length&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}append(e){let t=[];try{this._isChangingDecorations=!0,this._editor.changeDecorations(i=>{t=i.deltaDecorations([],e),this._decorationIds=this._decorationIds.concat(t)})}finally{this._isChangingDecorations=!1}return t}}let Ei=encodeURIComponent("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 3' enable-background='new 0 0 6 3' height='3' width='6'><g fill='"),En=encodeURIComponent("'><polygon points='5.5,0 2.5,3 1.1,3 4.1,0'/><polygon points='4,0 6,2 6,0.6 5.4,0'/><polygon points='0,2 1,3 2.4,3 0,0.6'/></g></svg>");function Es(e){return Ei+encodeURIComponent(e.toString())+En}let Er=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),Eo=encodeURIComponent('"><circle cx="1" cy="1" r="1"/><circle cx="5" cy="1" r="1"/><circle cx="9" cy="1" r="1"/></g></svg>');function Ea(e){return Er+encodeURIComponent(e.toString())+Eo}CX((e,t)=>{let i=e.getColor(m6);i&&(t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${Es(i)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-error-decoration: url("data:image/svg+xml,${Es(i)}"); }`));let n=e.getColor(m3);n&&(t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${Es(n)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-warning-decoration: url("data:image/svg+xml,${Es(n)}"); }`));let s=e.getColor(m8);s&&(t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${Es(s)}") repeat-x bottom left; }`),t.addRule(`:root { --monaco-editor-info-decoration: url("data:image/svg+xml,${Es(s)}"); }`));let r=e.getColor(pt);r&&(t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Ea(r)}") no-repeat bottom left; }`),t.addRule(`:root { --monaco-editor-hint-decoration: url("data:image/svg+xml,${Ea(r)}"); }`));let o=e.getColor(wC);o&&(t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${o.rgba.a}; }`),t.addRule(`:root { --monaco-editor-unnecessary-decoration-opacity: ${o.rgba.a}; }`))});let El=class extends ro.JT{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new sd.Q5),this._onCodeEditorAdd=this._register(new sd.Q5),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new sd.Q5),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new sd.Q5),this._onDiffEditorAdd=this._register(new sd.Q5),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new sd.Q5),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new hu.S,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){(delete this._codeEditors[e.getId()])&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){(delete this._diffEditors[e.getId()])&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;for(let t of this.listCodeEditors()){if(t.hasTextFocus())return t;t.hasWidgetFocus()&&(e=t)}return e}removeDecorationType(e){let t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEac
193h(t=>t.removeDecorationsByType(e))))}setModelProperty(e,t,i){let n;let s=e.toString();this._modelProperties.has(s)?n=this._modelProperties.get(s):(n=new Map,this._modelProperties.set(s,n)),n.set(t,i)}getModelProperty(e,t){let i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}async openCodeEditor(e,t,i){for(let n of this._codeEditorOpenHandlers){let s=await n(e,t,i);if(null!==s)return s}return null}registerCodeEditorOpenHandler(e){let t=this._codeEditorOpenHandlers.unshift(e);return(0,ro.OF)(t)}};El=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){CG(e,t,0)}],El);var Eh=function(e,t){return function(i,n){t(i,n,e)}};let Ed=class extends El{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler(async(e,t,i)=>t?this.doOpenEditor(t,e):null))}_checkContextKey(){let e=!1;for(let t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){let i=t.resource.scheme;if(i===iA.http||i===iA.https)return lO(t.resource.toString()),e}return null}let i=t.options?t.options.selection:null;if(i){if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{let t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}}return e}findModel(e,t){let i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};uP(hi,Ed=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Eh(0,hZ),Eh(1,CG)],Ed),0);let Eu=ht("layoutService");var Ec=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Eg=function(e,t){return function(i,n){t(i,n,e)}};let Ef=class{get mainContainer(){return this._codeEditorService.listCodeEditors().at(0)?.getContainerDomNode()??rb.document.body}get activeContainer(){let e=this._codeEditorService.getFocusedCodeEditor()??this._codeEditorService.getActiveCodeEditor();return e?.getContainerDomNode()??this.mainContainer}get mainContainerDimension(){return lt(this.mainContainer)}get activeContainerDimension(){return lt(this.activeContainer)}get containers(){return(0,as.kX)(this._codeEditorService.listCodeEditors().map(e=>e.getContainerDomNode()))}getContainer(){return this.activeContainer}whenContainerStylesLoaded(){}focus(){this._codeEditorService.getFocusedCodeEditor()?.focus()}constructor(e){this._codeEditorService=e,this.onDidLayoutMainContainer=sd.ju.None,this.onDidLayoutActiveContainer=sd.ju.None,this.onDidLayoutContainer=sd.ju.None,this.onDidChangeActiveContainer=sd.ju.None,this.onDidAddContainer=sd.ju.None,this.mainContainerOffset={top:0,quickPickTop:0},this.activeContainerOffset={top:0,quickPickTop:0}}};Ef=Ec([Eg(0,hi)],Ef);let Em=class extends Ef{get mainContainer(){return this._container}constructor(e,t){super(t),this._container=e}};Em=Ec([Eg(1,hi)],Em),uP(Eu,Ef,1);let Ep=ht("dialogService");var E_=function(e,t){return function(i,n){t(i,n,e)}};
193function Ev(e){return e.scheme===iA.file?e.fsPath:e.path}let Eb=0;class EC{constructor(e,t,i,n,s,r,o){this.id=++Eb,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=o,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?"  VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Ew{constructor(e,t){this.resourceLabel=e,this.reason=t}}class Ey{constructor(){this.elements=new Map}createMessage(){let e=[],t=[];for(let[,i]of this.elements)(0===i.reason?e:t).push(i.resourceLabel);let i=[];return e.length>0&&i.push((0,rh.NC)(2030,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push((0,rh.NC)(2031,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class ES{constructor(e,t,i,n,s,r,o){this.id=++Eb,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=o,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new Ey),this.removedResources.has(t)||this.removedResources.set(t,new Ew(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new Ey),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new Ew(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":"  VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class EL{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(let e of this._past)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(let e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){let e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(`   * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(`   * [REDO] ${this._future[t]}`);return e.join("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(let i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(let i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(let e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){let t=[];for(let e=0,i=this._past.length;e<i;e++)t.push(this._past[e].id);for(let e=this._future.length-1;e>=0;e--)t.push(this._future[e].id);return new No(e,t)}restoreSnapshot(e){let t=e.elements.length,i=!0,n=0,s=-1;for(let r=0,o=this._past.length;r<o;r++,n++){let o=this._past[r];i&&(n>=t||o.id!==e.elements[n])&&(i=!1,s=0),i||1!==o.type||o.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let s=this._future.length-1;s>=0;s--,n++){let o=this._future[s];i&&(n>=t||o.id!==e.elements[n])&&(i=!1,r=s),i||1!==o.type||o.removeResource(this.resourceLabel,this.strResource,0)}-1!==s&&(this._past=this._past.slice(0,s)),-1!==r&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){let e=[],t=[];for(let t of this._past)e.push(t.actual);for(let e of this._future)t.push(e.actual);return{past:e,future:t}}getClosestPastElement(){return 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}
193splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class Ex{constructor(e){this.editStacks=e,this._versionIds=[];for(let e=0,t=this.editStacks.length;e<t;e++)this._versionIds[e]=this.editStacks[e].versionId}isValid(){for(let e=0,t=this.editStacks.length;e<t;e++)if(this._versionIds[e]!==this.editStacks[e].versionId)return!1;return!0}}let Ek=new EL("","");Ek.locked=!0;let EN=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(let t of this._uriComparisonKeyComputers)if(t[0]===e.scheme)return t[1].getComparisonKey(e);return e.toString()}_print(e){console.log("------------------------------------"),console.log(`AFTER ${e}: `);let t=[];for(let e of this._editStacks)t.push(e[1].toString());console.log(t.join("\n"))}pushElement(e,t=Na.None,i=Nl.None){if(0===e.type){let n=Ev(e.resource),s=this.getUriComparisonKey(e.resource);this._pushElement(new EC(e,n,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{let n=new Set,s=[],r=[];for(let t of e.resources){let e=Ev(t),i=this.getUriComparisonKey(t);n.has(i)||(n.add(i),s.push(e),r.push(i))}1===s.length?this._pushElement(new EC(e,s[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new ES(e,s,r,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){let i;let n=e.resourceLabels[t],s=e.strResources[t];this._editStacks.has(s)?i=this._editStacks.get(s):(i=new EL(n,s),this._editStacks.set(s,i)),i.pushElement(e)}}getLastElement(e){let t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){let e=this._editStacks.get(t);if(e.hasFutureElements())return null;let i=e.getClosestPastElement();return i?i.actual:null}return null}
193_splitPastWorkspaceElement(e,t){let i=e.actual.split(),n=new Map;for(let e of i){let t=Ev(e.resource),i=this.getUriComparisonKey(e.resource),s=new EC(e,t,i,0,0,0,0);n.set(s.strResource,s)}for(let i of e.strResources)t&&t.has(i)||this._editStacks.get(i).splitPastWorkspaceElement(e,n)}_splitFutureWorkspaceElement(e,t){let i=e.actual.split(),n=new Map;for(let e of i){let t=Ev(e.resource),i=this.getUriComparisonKey(e.resource),s=new EC(e,t,i,0,0,0,0);n.set(s.strResource,s)}for(let i of e.strResources)t&&t.has(i)||this._editStacks.get(i).splitFutureWorkspaceElement(e,n)}removeElements(e){let t="string"==typeof e?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){let n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){let t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new No(e,[])}restoreSnapshot(e){let t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){let i=this._editStacks.get(t);i.restoreSnapshot(e),i.hasPastElements()||i.hasFutureElements()||(i.dispose(),this._editStacks.delete(t))}}getElements(e){let t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(let[n,s]of this._editStacks){let r=s.getClosestPastElement();r&&r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof Nl){let[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}let t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasPastElements()}_onError(e,t){for(let i of((0,o_.dL)(e),t.strResources))this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(let t of e.editStacks)if(t.locked)throw Error("Cannot acquire edit stack lock");for(let t of e.editStacks)t.locked=!0;return()=>{for(let t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,s){let r;let o=this._acquireLocks(i);try{r=t()}catch(t){return o(),n.dispose(),this._onError(t,e)}return r?r.then(()=>(o(),n.dispose(),s()),t=>(o(),n.dispose(),this._onError(t,e))):(o(),n.dispose(),s())}async _invokeWorkspacePrepare(e){if(void 0===e.actual.prepareUndoRedo)return ro.JT.None;let t=e.actual.prepareUndoRedo();return void 0===t?ro.JT.None:t}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(ro.JT.None);let i=e.actual.prepareUndoRedo();return i?(0,ro.Wf)(i)?t(i):i.then(e=>t(e)):t(ro.JT.None)}_getAffectedEditStacks(e){let t=[];for(let i of e.strResources)t.push(this._editStacks.get(i)||Ek);return new Ex(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorksp
193aceElement(t,i),this._notificationService.warn(n),new ED(this._undo(e,0,!0));for(let e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new ED}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,(0,rh.NC)(2032,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,(0,rh.NC)(2033,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));let s=[];for(let e of i.editStacks)e.getClosestPastElement()!==t&&s.push(e.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,(0,rh.NC)(2034,"Could not undo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));let r=[];for(let e of i.editStacks)e.locked&&r.push(e.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,(0,rh.NC)(2035,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,(0,rh.NC)(2036,"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){let n=this._getAffectedEditStacks(t),s=this._checkWorkspaceUndo(e,t,n,!1);return s?s.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,n,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(let[,t]of this._editStacks){let i=t.getClosestPastElement();if(i){if(i===e){let i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}async _confirmAndExecuteWorkspaceUndo(e,t,i,n){let s;if(t.canSplit()&&!this._isPartOfUndoGroup(t)){var r;let s;(r=s||(s={}))[r.All=0]="All",r[r.This=1]="This",r[r.Cancel=2]="Cancel";let{result:o}=await this._dialogService.prompt({type:Sh.Info,message:(0,rh.NC)(2037,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:(0,rh.NC)(2038,"&&Undo in {0} Files",i.editStacks.length),run:()=>s.All},{label:(0,rh.NC)(2039,"Undo this &&File"),run:()=>s.This}],cancelButton:{run:()=>s.Cancel}});if(o===s.Cancel)return;
193if(o===s.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);let a=this._checkWorkspaceUndo(e,t,i,!1);if(a)return a.returnValue;n=!0}try{s=await this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}let o=this._checkWorkspaceUndo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(let e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,s,()=>this._continueUndoInGroup(t.groupId,n))}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){let e=(0,rh.NC)(2040,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e);return}return this._invokeResourcePrepare(t,n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new Ex([e]),n,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(let[n,s]of this._editStacks){let r=s.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=n)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;let[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof Nl){let[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;let n=this._editStacks.get(e),s=n.getClosestPastElement();if(s){if(s.groupId){let[e,n]=this._findClosestUndoElementInGroup(s.groupId);if(s!==e&&n)return this._undo(n,t,i)}return(s.sourceId!==t||s.confirmBeforeUndo)&&!i?this._confirmAndContinueUndo(e,t,s):1===s.type?this._workspaceUndo(e,s,i):this._resourceUndo(n,s,i)}}async _confirmAndContinueUndo(e,t,i){if((await this._dialogService.confirm({message:(0,rh.NC)(2041,"Would you like to undo '{0}'?",i.label),primaryButton:(0,rh.NC)(2042,"&&Yes"),cancelButton:(0,rh.NC)(2043,"No")})).confirmed)return this._undo(e,t,!0)}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(let[n,s]of this._editStacks){let r=s.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder<t.sourceOrder)&&(t=r,i=n)}return[t,i]}canRedo(e){if(e instanceof Nl){let[,t]=this._findClosestRedoElementWithSource(e.id);return!!t}let t=this.getUriComparisonKey(e);return!!this._editStacks.has(t)&&this._editStacks.get(t).hasFutureElements()}_tryToSplitAndRedo(e,t,i,n){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(n),new ED(this._redo(e));for(let e of t.strResources)this.removeElements(e);return this._notificationService.warn(n),new ED}_checkWorkspaceRedo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,(0,rh.NC)(2044,"Could not redo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,(0,rh.NC)(2045,"Could not redo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));let s=[];for(let e of i.editStacks)e.getClosestFutureElement()!==t&&s.push(e.resourceLabel);if(s.length>0)return this._tryToSplitAndRedo(e,t,null,(0,rh.NC)(2046,"Could not redo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));let r=[];for(let e of i.editStacks)e.locked&&r.push(e.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,(0,rh.NC)(2047,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,(0,rh.NC)(2048,"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){let i=this._getAffectedEditStacks(t),n=this._checkWorkspaceRedo(e,t,i,!1);return n?n.returnValue:this._executeWorkspaceRedo(e,t,i)}async _executeWorkspaceRedo(e,t,i){let n;try{n=await this._invokeWorkspacePrepare(t)}catch(e){return this._onError(e,t)}let s=this._checkWorkspaceRedo(e,t,i,!0);if(s)return n.dispose(),s.returnValue;for(let e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,n,()=>this._continueRedoInGroup(t.groupId))}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){let e=(0,rh.NC)(2049,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new Ex([e]),i,()=>this._continueRedoInGroup(t.groupId))))}
193_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(let[n,s]of this._editStacks){let r=s.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrder<t.groupOrder)&&(t=r,i=n)}return[t,i]}_continueRedoInGroup(e){if(!e)return;let[,t]=this._findClosestRedoElementInGroup(e);if(t)return this._redo(t)}redo(e){if(e instanceof Nl){let[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return"string"==typeof e?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;let t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){let[e,t]=this._findClosestRedoElementInGroup(i.groupId);if(i!==e&&t)return this._redo(t)}return 1===i.type?this._workspaceRedo(e,i):this._resourceRedo(t,i)}}};EN=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([E_(0,Ep),E_(1,Sd)],EN);class ED{constructor(e){this.returnValue=e}}function EE(e,t,i){return Math.min(Math.max(e,t),i)}uP(Nr,EN,1);class ET{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class EI{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=Array(e),this._values.fill(0,0,e)}update(e){let t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}let EM=ht("environmentService");var ER=function(e,t){return function(i,n){t(i,n,e)}};let EA=ht("ILanguageFeatureDebounceService");!function(e){let t=new WeakMap,i=0;e.of=function(e){let n=t.get(e);return void 0===n&&(n=++i,t.set(e,n)),n}}(nb||(nb={}));class EO{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class EP{constructor(e,t,i,n,s,r){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=s,this._max=r,this._cache=new dg(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((e,t)=>o9(nb.of(t),e),0)}get(e){let t=this._key(e),i=this._cache.get(t);return i?EE(i.value,this._min,this._max):this.default()}update(e,t){let i=this._key(e),n=this._cache.get(i);n||(n=new EI(6),this._cache.set(i,n));let s=EE(n.update(t),this._min,this._max);return oY(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${s}ms`),s}_overall(){let e=new ET;for(let[,t]of this._cache)e.update(t.value);return e.value}default(){return EE(0|this._overall()||this._default,this._min,this._max)}}let EF=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){let n=i?.min??50,s=i?.max??n**2,r=i?.key??void 0,o=`${nb.of(e)},${n}${r?","+r:""}`,a=this._data.get(o);return a||(this._isDev?(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),a=new EO(1.5*n)):a=new EP(this._logService,t,e,0|this._overallAverage()||1.5*n,n,s),this._data.set(o,a)),a}_overallAverage(){let e=new ET;for(let t of this._data.values())e.update(t.default());return e.value}};uP(EA,EF=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([ER(0,dM),ER(1,EM)],EF),1);class EB{constructor(e=5){this.timesPerSecond=e,this._lastRun=0,this._minimumTimeBetweenRuns=1e3/e}runIfNotLimited(e){let t=Date.now();t-this._lastRun>=this._minimumTimeBetweenRuns&&(this._lastRun=t,e())}}class EV{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){let t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}
193-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){let e=this._getTokenCount();return 0===e?-1:this._getDeltaLine(e-1)}getRange(){let e=this._getTokenCount();return 0===e?null:new s9(0,this._getStartCharacter(0)+1,this._getDeltaLine(e-1),this._getEndCharacter(e-1)+1)}_getTokenCount(){return this._tokenCount}_getDeltaLine(e){return this._tokens[4*e]}_getStartCharacter(e){return this._tokens[4*e+1]}_getEndCharacter(e){return this._tokens[4*e+2]}isEmpty(){return 0===this._getTokenCount()}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){let n=t+Math.floor((i-t)/2),s=this._getDeltaLine(n);if(s<e)t=n+1;else if(s>e)i=n-1;else{let s=n;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let r=n;for(;r<i&&this._getDeltaLine(r+1)===e;)r++;return new EW(this._tokens.subarray(4*s,4*r+4))}}return this._getDeltaLine(t)===e?new EW(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,n){let s=this._tokens,r=this._tokenCount,o=0,a=!1,l=0;for(let h=0;h<r;h++){let r=4*h,d=s[r],u=s[r+1],c=s[r+2],g=s[r+3];if((d>e||d===e&&c>=t)&&(d<i||d===i&&u<=n))a=!0;else{if(0===o&&(l=d),a){let e=4*o;s[e]=d-l,s[e+1]=u,s[e+2]=c,s[e+3]=g}else 0!==l&&(s[r]=d-l);o++}}return this._tokenCount=o,l}split(e,t,i,n){let s=this._tokens,r=this._tokenCount,o=[],a=[],l=o,h=0,d=0;for(let o=0;o<r;o++){let r=4*o,u=s[r],c=s[r+1],g=s[r+2],f=s[r+3];if(u>e||u===e&&g>=t){if(u<i||u===i&&c<=n)continue;l!==a&&(l=a,h=0,d=u)}l[h++]=u-d,l[h++]=c,l[h++]=g,l[h++]=f}return[new EV(new Uint32Array(o)),new EV(new Uint32Array(a)),d]}acceptDeleteRange(e,t,i,n,s){let r=this._tokens,o=this._tokenCount,a=n-t,l=0,h=!1;for(let d=0;d<o;d++){let u=4*d,c=r[u],g=r[u+1],f=r[u+2],m=r[u+3];if(c<t||c===t&&f<=i){l++;continue}if(c===t&&g<i)c===n&&f>s?f-=s-i:f=i;else if(c===t&&g===i){if(c===n&&f>s)f-=s-i;else{h=!0;continue}}else if(c<n||c===n&&g<s){if(c===n&&f>s)c=t,f=(g=i)+(f-s);else{h=!0;continue}}else if(c>n){if(0===a&&!h){l=o;break}c-=a}else if(c===n&&g>=s)e&&0===c&&(g+=e,f+=e),c-=a,g-=s-i,f-=s-i;else throw Error("Not possible!");let p=4*l;r[p]=c,r[p+1]=g,r[p+2]=f,r[p+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,s,r){let o=0===i&&1===n&&(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122),a=this._tokens,l=this._tokenCount;for(let r=0;r<l;r++){let l=4*r,h=a[l],d=a[l+1],u=a[l+2];if(!(h<e)&&(h!==e||!(u<t))){if(h===e&&u===t){if(!o)continue;u+=1}else if(h===e&&d<t&&t<u)0===i?u+=n:u=t;else{if(h===e&&d===t&&o)continue;if(h===e){if(h+=i,0===i)d+=n,u+=n;else{let e=u-d;u=(d=s+(d-t))+e}}else h+=i}a[l]=h,a[l+1]=d,a[l+2]=u}}}static{this._rateLimiter=new EB(10/60)}reportIfInvalid(e,t){for(let i=0;i<this._tokenCount;i++){let n=this._getDeltaLine(i)+t;n<1?EV._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: lineNumber < 1")}):n>e.getLineCount()?EV._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: lineNumber > model.getLineCount()")}):this._getEndCharacter(i)>e.getLineLength(n)&&EV._rateLimiter.runIfNotLimited(()=>{console.error("Invalid Semantic Tokens Data From Extension: end character > model.getLineLength(lineNumber)")})}}}class EW{constructor(e){this._tokens=e}getCount(){return this._tokens.length/4}getStartCharacter(e){return this._tokens[4*e+1]}getEndCharacter(e){return this._tokens[4*e+2]}getMetadata(e){return this._tokens[4*e+3]}}var EH=function(e,t){return function(i,n){t(i,n,e)}};let Ez=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new EK}getMetadata(e,t,i){let n;let s=this._languageService.languageIdCodec.encodeLanguageId(i),r=this._hashTable.get(e,t,s);if(r)n=r.metadata;else{let r=this._legend.tokenTypes[e],o=[];if(r){let e=t;for(let t=0;e>0&&t<this._legend.tokenModifiers.length;t++)1&e&&o.push(this._legend.tokenModifiers[t]),e>>=1;let s=this._themeService.getColorTheme().getTokenStyleMetadata(r,o,i);void 0===s?n=2147483647:(n=0,void 0!==s.italic&&(n|=1|(s.italic?1:0)<<11),void 0!==s.bold&&(n|=2|(s.bold?2:0)<<11),void 0!==s.underline&&(n|=4|(s.underline?4:0)<<11),void 0!==s.strikethrough&&(n|=8|(s.strikethrough?8:0)<<11),s.foreground&&(n|=16|s.foreground<<15),0===n&&(n=2147483647))}else n=2147483647,r="not-in-legend";this._hashTable.add(e,t,s,n)}return n}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,this._logService.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}
193warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,this._logService.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,s){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,this._logService.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${s}).`))}};Ez=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([EH(1,CG),EH(2,uR),EH(3,dM)],Ez);class EU{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class EK{static{this._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143]}constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=EK._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<EK._SIZES.length?2/3*this._currentLength:0),this._elements=[],EK._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){let n=this._hashFunc(e,t,i),s=this._elements[n];for(;s;){if(s.tokenTypeIndex===e&&s.tokenModifierSet===t&&s.languageId===i)return s;s=s.next}return null}add(e,t,i,n){if(this._elementsCount++,0!==this._growCount&&this._elementsCount>=this._growCount){let e=this._elements;for(let t of(this._currentLengthIndex++,this._currentLength=EK._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<EK._SIZES.length?2/3*this._currentLength:0),this._elements=[],EK._nullOutEntries(this._elements,this._currentLength),e)){let e=t;for(;e;){let t=e.next;e.next=null,this._add(e),e=t}}}this._add(new EU(e,t,i,n))}_add(e){let t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}let E$=ht("semanticTokensStylingService");var Ej=function(e,t){return function(i,n){t(i,n,e)}};let Eq=class extends ro.JT{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new Ez(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};uP(E$,Eq=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Ej(0,CG),Ej(1,dM),Ej(2,uR)],Eq),1);let EG="[/\\\\]",EQ="[^/\\\\]",EY=/\//g;function EJ(e,t){switch(e){case 0:return"";case 1:return`${EQ}*?`;default:return`(?:${EG}|${EQ}+${EG}${t?`|${EG}${EQ}+`:""})*?`}}function EZ(e,t){if(!e)return[];let i=[],n=!1,s=!1,r="";for(let o of e){switch(o){case t:if(!n&&!s){i.push(r),r="";
193continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":s=!0;break;case"]":s=!1}r+=o}return r&&i.push(r),i}let EX=/^\*\*\/\*\.[\w\.-]+$/,E1=/^\*\*\/([\w\.-]+)\/?$/,E0=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,E2=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,E5=/^\*\*((\/[\w\.-]+)+)\/?$/,E4=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,E6=new dg(1e4),E7=function(){return!1},E3=function(){return null};function E9(e,t){var i,n;let s,r;if(!e)return E3;s=(s="string"!=typeof e?e.pattern:e).trim();let o=t.ignoreCase??!1,a={...t,equals:o?rz:(e,t)=>e===t,endsWith:o?rK:(e,t)=>e.endsWith(t),isEqualOrParent:(e,t)=>dC(e,t,!sS.IJ||o)},l=`${o?s.toLowerCase():s}_${!!t.trimForExclusions}_${o}`,h=E6.get(l);return h||(h=EX.test(s)?(i=s.substring(4),n=s,function(e,t){return"string"==typeof e&&a.endsWith(e,i)?n:null}):(r=E1.exec(E8(s,a)))?function(e,t,i){let n=`/${e}`,s=`\\${e}`,r=function(r,o){return"string"!=typeof r?null:o?i.equals(o,e)?t:null:i.equals(r,e)||i.endsWith(r,n)||i.endsWith(r,s)?t:null},o=[e];return r.basenames=o,r.patterns=[t],r.allBasenames=o,r}(r[1],s,a):(t.trimForExclusions?E2:E0).test(s)?function(e,t){let i=Ti(e.slice(1,-1).split(",").map(e=>E9(e,t)).filter(e=>e!==E3),e),n=i.length;if(!n)return E3;if(1===n)return i[0];let s=function(t,n){for(let s=0,r=i.length;s<r;s++)if(i[s](t,n))return e;return null},r=i.find(e=>!!e.allBasenames);r&&(s.allBasenames=r.allBasenames);let o=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return o.length&&(s.allPaths=o),s}(s,a):(r=E5.exec(E8(s,a)))?Te(r[1].substring(1),s,!0,a):(r=E4.exec(E8(s,a)))?Te(r[1],s,!1,a):function(e,t){try{let i=RegExp(`^${function e(t){if(!t)return"";let i="",n=EZ(t,"/");if(n.every(e=>"**"===e))i=".*";else{let t=!1;n.forEach((s,r)=>{if("**"===s){if(t)return;i+=EJ(2,r===n.length-1)}else{let t=!1,o="",a=!1,l="";for(let n of s){if("}"!==n&&t){o+=n;continue}if(a&&("]"!==n||!l)){let e;e="-"===n?n:"^"!==n&&"!"!==n||l?"/"===n?"":rN(n):"^",l+=e;continue}switch(n){case"{":t=!0;continue;case"[":a=!0;continue;case"}":{let n=EZ(o,","),s=`(?:${n.map(t=>e(t)).join("|")})`;i+=s,t=!1,o="";break}case"]":i+="["+l+"]",a=!1,l="";break;case"?":i+=EQ;continue;case"*":i+=EJ(1);continue;default:i+=rN(n)}}r<n.length-1&&("**"!==n[r+1]||r+2<n.length)&&(i+=EG)}t="**"===s})}return i}(e)}$`,t.ignoreCase?"i":void 0);return function(t){return i.lastIndex=0,"string"==typeof t&&i.test(t)?e:null}}catch{return E3}}(s,a),E6.set(l,h)),function(e,t,i){if("string"==typeof t)return e;let n=function(n,s){return i.isEqualOrParent(n,t.base)?e(rD(n.substring(t.base.length),sj),s):null};return n.allBasenames=e.allBasenames,n.allPaths=e.allPaths,n.basenames=e.basenames,n.patterns=e.patterns,n}(h,e,a)}function E8(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substring(0,e.length-2):e}function Te(e,t,i,n){let s;let r=sj===sV.sep,o=r?e:e.replace(EY,sj),a=sj+o,l=sV.sep+e;return(s=i?function(i,s){return"string"==typeof i&&(n.equals(i,o)||n.endsWith(i,a)||!r&&(n.equals(i,e)||n.endsWith(i,l)))?t:null}:function(i,s){return"string"==typeof i&&(n.equals(i,o)||!r&&n.equals(i,e))?t:null}).allPaths=[(i?"*/":"./")+e],s}function Tt(e,t={}){if(!e)return E7;if("string"==typeof e||e&&"string"==typeof e.base&&"string"==typeof e.pattern){let i=E9(e,t);if(i===E3)return E7;let n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){let i=Ti(Object.getOwnPropertyNames(e).map(i=>(function(e,t,i){if(!1===t)return E3;let n=E9(e,i);if(n===E3)return E3;if("boolean"==typeof t)return n;if(t){let i=t.when;if("string"==typeof i){let t=(t,s,r,o)=>{if(!o||!n(t,s))return null;let a=o(i.replace("$(basename)",()=>r));return oM(a)?a.then(t=>t?e:null):a?e:null};return t.requiresSiblings=!0,t}}return n})(i,e[i],t)).filter(e=>e!==E3)),n=i.length;if(!n)return E3;if(!i.some(e=>!!e.requiresSiblings)){if(1===n)return i[0];let e=function(e,t){let n;for(let s=0,r=i.length;s<r;s++){let r=i[s](e,t);if("string"==typeof r)return r;oM(r)&&(n||(n=[]),n.push(r))}return n?(async()=>{for(let e of n){let t=await e;if("string"==typeof t)return t}return null})():null},t=i.find(e=>!!e.allBasenames);t&&(e.allBasenames=t.allBasenames);let s=i.reduce((e,t)=>
193t.allPaths?e.concat(t.allPaths):e,[]);return s.length&&(e.allPaths=s),e}let s=function(e,t,n){let s,r;for(let o=0,a=i.length;o<a;o++){let a=i[o];a.requiresSiblings&&n&&(t||(t=sK(e)),s||(s=t.substring(0,t.length-s$(e).length)));let l=a(e,t,s,n);if("string"==typeof l)return l;oM(l)&&(r||(r=[]),r.push(l))}return r?(async()=>{for(let e of r){let t=await e;if("string"==typeof t)return t}return null})():null},r=i.find(e=>!!e.allBasenames);r&&(s.allBasenames=r.allBasenames);let o=i.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return o.length&&(s.allPaths=o),s}(e,t)}function Ti(e,t){let i;let n=e.filter(e=>!!e.basenames);if(n.length<2)return e;let s=n.reduce((e,t)=>{let i=t.basenames;return i?e.concat(i):e},[]);if(t){i=[];for(let e=0,n=s.length;e<n;e++)i.push(t)}else i=n.reduce((e,t)=>{let i=t.patterns;return i?e.concat(i):e},[]);let r=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){let t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substring(i)}let n=s.indexOf(t);return -1!==n?i[n]:null};r.basenames=s,r.patterns=i,r.allBasenames=s;let o=e.filter(e=>!e.basenames);return o.push(r),o}class Tn{constructor(e,t,i,n,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n,this.recursive=s}equals(e){return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&this.notebookUri?.toString()===e.notebookUri?.toString()&&this.recursive===e.recursive}}class Ts{get onDidChange(){return this._onDidChange.event}constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new sd.Q5}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),(0,ro.OF)(()=>{if(i){let e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e,!1);let t=[];for(let e of this._entries)e._score>0&&t.push(e.provider);return t}ordered(e,t=!1){let i=[];return this._orderedForEach(e,t,e=>i.push(e.provider)),i}orderedGroups(e){let t,i;let n=[];return this._orderedForEach(e,!1,e=>{t&&i===e._score?t.push(e.provider):(i=e._score,t=[e.provider],n.push(t))}),n}_orderedForEach(e,t,i){for(let n of(this._updateScores(e,t),this._entries))n._score>0&&i(n)}_updateScores(e,t){let i=this._notebookInfoResolver?.(e.uri),n=i?new Tn(e.uri,e.getLanguageId(),i.uri,i.type,t):new Tn(e.uri,e.getLanguageId(),void 0,void 0,t);if(!this._lastCandidate?.equals(n)){for(let i of(this._lastCandidate=n,this._entries))if(i._score=function e(t,i,n,s,r,o){if(Array.isArray(t)){let a=0;for(let l of t){let t=e(l,i,n,s,r,o);if(10===t)return t;t>a&&(a=t)}return a}if("string"==typeof t)return s?"*"===t?5:t===n?10:0:0;if(!t)return 0;{let{language:e,pattern:l,scheme:h,hasAccessToAllModels:d,notebookType:u}=t;if(!s&&!d)return 0;u&&r&&(i=r);let c=0;if(h){if(h===i.scheme)c=10;else{if("*"!==h)return 0;c=5}}if(e){if(e===n)c=10;else{if("*"!==e)return 0;c=Math.max(c,5)}}if(u){if(u===o)c=10;else{if("*"!==u||void 0===o)return 0;c=Math.max(c,5)}}if(l){var a;let e;if(!((e="string"==typeof l?l:{...l,base:sW(l.base)})===i.fsPath||(a=i.fsPath,e&&"string"==typeof a&&Tt(e,void 0)(a))))return 0;c=10}return c}}(i.selector,n.uri,n.languageId,!e.isTooLargeForSyncing()&&!e.isForSimpleWidget,n.notebookUri,n.notebookType),function e(t){return"string"!=typeof t&&(Array.isArray(t)?t.every(e):!!t.exclusive)}(i.selector)&&i._score>0){if(t)i._score=0;else{for(let e of this._entries)e._score=0;i._score=1e3;break}}this._entries.sort(Ts._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:Tr(e.selector)&&!Tr(t.selector)?1:!Tr(e.selector)&&Tr(t.selector)?-1:e._time<t._time?1:e._time>t._time?-1:0}}function Tr(e){return"string"!=typeof e&&(Array.isArray(e)?e.some(Tr):!!e.isBuiltin)}class To{constructor(){this.referenceProvider=new Ts(this._score.bind(this)),this.renameProvider=new Ts(this._score.bind(this)),this.newSymbolNamesProvider=new Ts(this._score.bind(this)),this.codeActionProvider=new Ts(this._score.bind(this)),this.definitionProvider=new Ts(this._score.bind(this)),this.typeDefinitionProvider=new Ts(this._score.bind(this)),this.declarationProvider=new Ts(this._score.bind(this)),this.implementationProvider=new Ts(this._score.bind(this)),this.documentSymbolProvider=new Ts(this._score.bind(this)),this.inlayHintsProvi
193der=new Ts(this._score.bind(this)),this.colorProvider=new Ts(this._score.bind(this)),this.codeLensProvider=new Ts(this._score.bind(this)),this.documentFormattingEditProvider=new Ts(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Ts(this._score.bind(this)),this.onTypeFormattingEditProvider=new Ts(this._score.bind(this)),this.signatureHelpProvider=new Ts(this._score.bind(this)),this.hoverProvider=new Ts(this._score.bind(this)),this.documentHighlightProvider=new Ts(this._score.bind(this)),this.multiDocumentHighlightProvider=new Ts(this._score.bind(this)),this.selectionRangeProvider=new Ts(this._score.bind(this)),this.foldingRangeProvider=new Ts(this._score.bind(this)),this.linkProvider=new Ts(this._score.bind(this)),this.inlineCompletionsProvider=new Ts(this._score.bind(this)),this.completionProvider=new Ts(this._score.bind(this)),this.linkedEditingRangeProvider=new Ts(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Ts(this._score.bind(this)),this.documentSemanticTokensProvider=new Ts(this._score.bind(this)),this.documentDropEditProvider=new Ts(this._score.bind(this)),this.documentPasteEditProvider=new Ts(this._score.bind(this))}_score(e){return this._notebookTypeResolver?.(e)}}uP(fa,To,1);var Ta=function(e,t){return function(i,n){t(i,n,e)}};let Tl=ht("hoverService"),Th=class extends ro.JT{get delay(){return this.isInstantlyHovering()?0:this.hoverOptions?.dynamicDelay?e=>this.hoverOptions?.dynamicDelay?.(e)??this._delay:this._delay}constructor(e,t,i={},n,s){super(),this.placement=e,this.hoverOptions=t,this.overrideOptions=i,this.configurationService=n,this.hoverService=s,this.lastHoverHideTime=0,this.timeLimit=200,this.hoverDisposables=this._register(new ro.SL),this._delay=this.configurationService.getValue("workbench.hover.delay"),this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("workbench.hover.delay")&&(this._delay=this.configurationService.getValue("workbench.hover.delay"))}))}showHover(e,t){let i="function"==typeof this.overrideOptions?this.overrideOptions(e,t):this.overrideOptions;for(let t of(this.hoverDisposables.clear(),l_(e.target)?[e.target]:e.target.targetElements))this.hoverDisposables.add(a7(t,"keydown",e=>{e.equals(9)&&this.hoverService.hideHover()}));let n=l_(e.content)?void 0:"string"==typeof e.content?e.content.toString():e.content.value;return this.hoverService.showInstantHover({...e,...i,persistence:{hideOnKeyDown:!0,...i.persistence},id:n,appearance:{...e.appearance,compact:!0,skipFadeInAnimation:this.isInstantlyHovering(),...i.appearance}},t)}isInstantlyHovering(){return!!this.hoverOptions?.instantHover&&Date.now()-this.lastHoverHideTime<this.timeLimit}onDidHideHover(){this.hoverDisposables.clear(),this.hoverOptions?.instantHover&&(this.lastHoverHideTime=Date.now())}};Th=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Ta(3,uE),Ta(4,Tl)],Th);let Td=ht("contextViewService"),Tu=ht("contextMenuService");i(7606),i(46793);class Tc extends ro.JT{constructor(e){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.classList.toggle("fade-in",!!e),this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new bi(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class Tg extends ro.JT{static render(e,t,i){return new Tg(e,t,i)}constructor(e,t,i){super(),this.actionLabel=t.label,this.actionKeybindingLabel=i,this.actionContainer=lk(e,lI("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=lk(this.actionContainer,lI("a.action")),this.action.setAttribute("role","button"),t.iconClass&&lk(this.action,lI("span.icon")).classList.add(...t.iconClass.split(" ")),this.actionRenderedLabel=i?`${t.label} (${i})`:t.label,lk(this.action,lI("span")).textContent=this.actionRenderedLabel,this._store.add(new Tf(this.actionContainer,t.run)),this._store.add(new Tm(this.actionContainer,t.run,[3,10])),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}class Tf extends ro.JT{constructor(e,t){super(),this._register(a6(e,ly.CLICK,i=>{i.stopPropagation(),i.preventDefault(),t(e)}))}}class Tm extends ro.JT{constructor(e,t,i){super(),this._register(a6(e,ly.KEY_DOWN,n=>{let s=new ok(n);i.some(e=>s.equals(e))&&(n.stopPropagation(),n.preventDefault(),t(e))}))}}function Tp(...e){return function(t,i){for(let n=0,s=e.length;n<s;n++){let s=e[n](t,i);if(s)return s}return null}}new Uint32Array(10),new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),Tv.bind(void 0,!1);let T_=Tv.bind(void 0,!0);function Tv(e,t,i){return i&&!(i.length<t.length)&&(e?rU(i,t):0===i.indexOf(t))?t.length>0?[{start:0,end:t.length}]:[]:null}function Tb(e){return 97<=e&&e<=122}function TC(e){return 65<=e&&e<=90}function Tw(e){return 48<=e&&e<=57}let Ty=new Set;function TS(e){return Tb(e)||TC(e)||Tw(e)}function TL(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function Tx(e,t){for(let i=t;i<e.length;i++){let t=e.charCodeAt(i);if(TC(t)||Tw(t)||i>0&&!TS(e.charCodeAt(i-1)))return i}return e.length}function Tk(e,t){if(!t||0===(t=t.trim()).length||!function(e){let t=0,i=0,n=0,s=0;for(let o=0;o<e.length;o++){var r;TC(n=e.charCodeAt(o))&&t++,Tb(n)&&i++,(32===(r=n)||9===r||10===r||13===r)&&s++}return(0===t||0===i)&&0===s?e.length<=30:t<=5}(e))return null;t.length>
19360&&(t=t.substring(0,60));let i=function(e){let t=0,i=0,n=0,s=0,r=0;for(let o=0;o<e.length;o++)TC(r=e.charCodeAt(o))&&t++,Tb(r)&&i++,TS(r)&&n++,Tw(r)&&s++;let o=t/e.length;return{upperPercent:o,lowerPercent:i/e.length,alphaPercent:n/e.length,numericPercent:s/e.length}}(t);if(!function(e){let{upperPercent:t,lowerPercent:i,alphaPercent:n,numericPercent:s}=e;return i>.2&&t<.8&&n>.6&&s<.2}(i)){if(!function(e){let{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,s=0;for(e=e.toLowerCase();s<t.length&&null===(n=function e(t,i,n,s){if(n===t.length)return[];if(s===i.length||t[n]!==i[s].toLowerCase())return null;{let r=null,o=s+1;for(r=e(t,i,n+1,s+1);!r&&(o=Tx(i,o))<i.length;)r=e(t,i,n+1,o),o++;return null===r?null:TL({start:s,end:s+1},r)}}(e,t,0,s));)s=Tx(t,s+1);return n}"()[]{}<>`'\"-/;:,.?!".split("").forEach(e=>Ty.add(e.charCodeAt(0)));let TN=Tp(T_,Tk,function(e,t){let i=t.toLowerCase().indexOf(e.toLowerCase());return -1===i?null:[{start:i,end:i+e.length}]}),TD=Tp(T_,Tk,function(e,t){return function e(t,i,n,s){if(n===t.length)return[];if(s===i.length)return null;if(t[n]===i[s]){let r=null;return(r=e(t,i,n+1,s+1))?TL({start:s,end:s+1},r):null}return e(t,i,n,s+1)}(e.toLowerCase(),t.toLowerCase(),0,0)}),TE=new dg(1e4);function TT(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=TE.get(e);n||(n=RegExp(e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*"),"i"),TE.set(e,n));let s=n.exec(t);return s?[{start:s.index,end:s.index+s[0].length}]:i?TD(e,t):TN(e,t)}function TI(){let e=[],t=[];for(let e=0;e<=128;e++)t[e]=0;for(let i=0;i<=128;i++)e.push(t.slice(0));return e}function TM(e){let t=[];for(let i=0;i<=e;i++)t[i]=0;return t}let TR=TM(256),TA=TM(256),TO=TI(),TP=TI(),TF=TI();function TB(e,t){if(t<0||t>=e.length)return!1;let i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:if(r7(i))return!0;return!1}}function TV(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}(te=nC||(nC={})).Default=[-100,0],te.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]};class TW{static{this.default={boostFullMatch:!0,firstMatchCanBeWeak:!1}}constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}function TH(e,t,i,n,s,r,o=TW.default){let a=e.length>128?128:e.length,l=n.length>128?128:n.length;if(i>=a||r>=l||a-i>l-r||!function(e,t,i,n,s,r,o=!1){for(;t<i&&s<r;)e[t]===n[s]&&(o&&(TR[t]=s),t+=1),s+=1;return t===i}(t,i,a,s,r,l,!0))return;!function(e,t,i,n,s,r){let o=e-1,a=t-1;for(;o>=i&&a>=n;)s[o]===r[a]&&(TA[o]=a,o--),a--}(a,l,i,r,t,s);let h=1,d=1,u=i,c=r,g=[!1];for(h=1,u=i;u<a;h++,u++){let o=TR[u],f=TA[u],m=u+1<a?TA[u+1]:l;for(d=o-r+1,c=o;c<m;d++,c++){let a=Number.MIN_SAFE_INTEGER,m=!1;c<=f&&(a=function(e,t,i,n,s,r,o,a,l,h,d){var u;if(t[i]!==r[o])return Number.MIN_SAFE_INTEGER;let c=1,g=!1;return o===i-n?c=e[i]===s[o]?7:5:s[o]===r[o]||0!==o&&s[u=o-1]!==r[u]?TB(r,o)&&(0===o||!TB(r,o-1))?c=5:(TB(r,o-1)||TV(r,o-1))&&(c=5,g=!0):(c=e[i]===s[o]?7:5,g=!0),c>1&&i===n&&(d[0]=!0),g||(g=s[o]!==r[o]||TB(r,o-1)||TV(r,o-1)),i===n?o>l&&(c-=g?3:5):h?c+=g?2:0:c+=g?0:1,o+1===a&&(c-=g?3:5),c}(e,t,u,i,n,s,c,l,r,0===TO[h-1][d-1],g));let p=0;a!==Number.MIN_SAFE_INTEGER&&(m=!0,p=a+TP[h-1][d-1]);let _=c>o,v=_?TP[h][d-1]+(TO[h][d-1]>0?-5:0):0,b=c>o+1&&TO[h][d-1]>0,C=b?TP[h][d-2]+(TO[h][d-2]>0?-5:0):0;if(b&&(!_||C>=v)&&(!m||C>=p))TP[h][d]=C,TF[h][d]=3,TO[h][d]=0;else if(_&&(!m||v>=p))TP[h][d]=v,TF[h][d]=2,TO[h][d]=0;else if(m)TP[h][d]=p,TF[h][d]=1,TO[h][d]=TO[h-1][d-1]+1;else throw Error("not possible")}}if(!g[0]&&!o.firstMatchCanBeWeak)return;h--,d--;let f=[TP[h][d],r],m=0,p=0;for(;h>=1;){var _;let e=d;do{let t=TF[h][e];if(3===t)e-=2;else if(2===t)e-=1;else break}while(e>=1);m>1&&t[i+h-1]===s[r+d-1]&&n[_=e+r-1]===s[_]&&m+1>TO[h][e]&&(e=d),e===d?m++:m=1,p||(p=e),h--,d=e-1,f.push(d)}l-r===a&&o.boostFullMatch&&(f[0]+=2);let v=p-a;return f[0]-=v,f}let Tz=RegExp(`\\$\\(${iH.iconNameExpression}(?:${iH.iconModifierExpression})?\\)`,"g"),TU=RegExp(`(\\\\)?${Tz.source}`,"g"),TK=RegExp(`\\\\${Tz.source}`,"g"),T$=RegExp(`(\\s)?(\\\\)?${Tz.source}(\\s)?`,"g");function Tj(e){return -1===e.indexOf("$(")?e:e.replace(T$,(e,t,i,n)=>i?e:t||n||"")}function Tq(e){return e?e.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}let TG=RegExp(`\\$\\(${iH.iconNameCharacter}+\\)`,"g");function TQ(e){TG.lastIndex=0;let t="",i=[],n=0;for(;;){let s=TG.lastIndex,r=TG.exec(e),o=e.substring(s,r?.index);if(o.length>0){t+=o;for(let e=0;e<o.length;e++)i.push(n)}if(!r)break;n+=r[0].length}return{text:t,iconOffsets:i}}function TY(e,t,i=!1){let{text:n,iconOffsets:s}=t;
193if(!s||0===s.length)return TT(e,n,i);let r=rD(n," "),o=n.length-r.length,a=TT(e,r,i);if(a)for(let e of a){let t=s[e.start+o]+o;e.start+=t,e.end+=t}return a}class TJ{constructor(e="",t=!1){if(this.value=e,"string"!=typeof this.value)throw(0,o_.b1)("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1,this.supportAlertSyntax=t.supportAlertSyntax??!1)}appendText(e,t=0){return this.value+=(this.supportThemeIcons?e.replace(TU,(e,t)=>t?e:`\\${e}`):e).replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&").replace(/([ \t]+)/g,(e,t)=>"&nbsp;".repeat(t.length)).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`
194${function(e,t){let i=e.match(/^`+/gm)?.reduce((e,t)=>e.length>t.length?e:t).length??0,n=i>=3?i+1:3;return[`${"`".repeat(n)}${t}`,e,`${"`".repeat(n)}`].join("\n")}(t,e)}
195`,this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){let i=RegExp(rN(t),"g");return e.replace(i,(t,i)=>"\\"!==e.charAt(i-1)?`\\${t}`:t)}}function TZ(e){return e instanceof TJ||!!e&&"object"==typeof e&&"string"==typeof e.value&&("boolean"==typeof e.isTrusted||"object"==typeof e.isTrusted||void 0===e.isTrusted)&&("boolean"==typeof e.supportThemeIcons||void 0===e.supportThemeIcons)&&("boolean"==typeof e.supportAlertSyntax||void 0===e.supportAlertSyntax)}function TX(e){return e.replace(/"/g,"&quot;")}function T1(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1"):e}class T0{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}let T2=new T0("id#");function T5(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let T4=T5(),T6=/[&<>"']/,T7=RegExp(T6.source,"g"),T3=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,T9=RegExp(T3.source,"g"),T8={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ie=e=>T8[e];function It(e,t){if(t){if(T6.test(e))return e.replace(T7,Ie)}else if(T3.test(e))return e.replace(T9,Ie);return e}let Ii=/(^|[^\[])\^/g;function In(e,t){let i="string"==typeof e?e:e.source;t=t||"";let n={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(Ii,"$1"),i=i.replace(e,s),n},getRegex:()=>new RegExp(i,t)};return n}function Is(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}let Ir={exec:()=>null};function Io(e,t){let i=e.replace(/\|/g,(e,t,i)=>{let n=!1,s=t;for(;--s>=0&&"\\"===i[s];)n=!n;return n?"|":" |"}).split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),t){if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("")}for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function Ia(e,t,i){let n=e.length;if(0===n)return"";let s=0;for(;s<n;)if(e.charAt(n-s-1)===t)s++;else break;return e.slice(0,n-s)}function Il(e,t,i,n){let s=t.href,r=t.title?It(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;let e={type:"link",raw:i,href:s,title:r,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,e}return{type:"image",raw:i,href:s,title:r,text:It(o)}}class Ih{options;rules;lexer;constructor(e){this.options=e||T4}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Ia(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],i=function(e,t){let i=e.match(/^(\s+)(?:```)/);if(null===i)return t;let n=i[1];return t.split("\n").map(e=>{let t=e.match(/^\s+/);if(null===t)return e;let[i]=t;return i.length>=n.length?e.slice(n.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=Ia(e,"#");this.options.pedantic?e=t.trim():(!t||/ $/.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ia(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Ia(t[0],"\n").split("\n"),i="",n="",s=[];for(;e.length>0;){let t,r=!1,o=[];for(t=0;t<e.length;t++)if(/^ {0,3}>/.test(e[t]))o.push(e[t]),r=!0;else if(r)break;else o.push(e[t]);e=e.slice(t);let a=o.join("\n"),l=a.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n    $1").replace(/^ {0,3}>[ \t]?/gm,"");i=i?`${i}
196${a}`:a,n=n?`${n}
197${l}`:l;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,s,!0),this.lexer.state.top=h,0===e.length)break;let d=s[s.length-1];if(d?.type==="code")break;if(d?.type==="blockquote"){let t=d.raw+"\n"+e.join("\n"),r=this.blockquote(t);s[s.length-1]=r,i=i.substring(0,i.length-d.raw.length)+r.raw,n=n.substring(0,n.length-d.text.length)+r.text;break}if(d?.type==="list"){let t=d.raw+"\n"+e.join("\n"),r=this.list(t);s[s.length-1]=r,i=i.substring(0,i.length-d.raw.length)+r.raw,n=n.substring(0,n.length-d.raw.length)+r.raw,e=t.substring(s[s.length-1].raw.length).split("\n");continue}}return{type:"blockquote",raw:i,tokens:s,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim(),n=i.length>1,s={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");let r=RegExp(`^( {0,3}${i})((?:[	 ][^\\n]*)?(?:\\n|$))`),o=!1;for(;e;){let i,n=!1,a="",l="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let h=t[2].split("\n",1)[0].replace(/^\t+/,e=>" ".repeat(3*e.length)),d=e.split("\n",1)[0],u=!h.trim(),c=0;if(this.options.pedantic?(c=2,l=h.trimStart()):u?c=t[1].length+1:(c=(c=t[2].search(/[^ ]/))>4?1:c,l=h.slice(c),c+=t[1].length),u&&/^ *$/.test(d)&&(a+=d+"\n",e=e.substring(d.length+1),n=!0),!n){let t=Reg
197Exp(`^ {0,${Math.min(3,c-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),i=RegExp(`^ {0,${Math.min(3,c-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),n=RegExp(`^ {0,${Math.min(3,c-1)}}(?:\`\`\`|~~~)`),s=RegExp(`^ {0,${Math.min(3,c-1)}}#`);for(;e;){let r=e.split("\n",1)[0];if(d=r,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g,"  ")),n.test(d)||s.test(d)||t.test(d)||i.test(e))break;if(d.search(/[^ ]/)>=c||!d.trim())l+="\n"+d.slice(c);else{if(u||h.search(/[^ ]/)>=4||n.test(h)||s.test(h)||i.test(h))break;l+="\n"+d}u||d.trim()||(u=!0),a+=r+"\n",e=e.substring(r.length+1),h=d.slice(c)}}!s.loose&&(o?s.loose=!0:/\n *\n *$/.test(a)&&(o=!0));let g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(l))&&(i="[ ] "!==g[0],l=l.replace(/^\[[ xX]\] +/,"")),s.items.push({type:"list_item",raw:a,task:!!g,checked:i,loose:!1,text:l,tokens:[]}),s.raw+=a}s.items[s.items.length-1].raw=s.items[s.items.length-1].raw.trimEnd(),s.items[s.items.length-1].text=s.items[s.items.length-1].text.trimEnd(),s.raw=s.raw.trimEnd();for(let e=0;e<s.items.length;e++)if(this.lexer.state.top=!1,s.items[e].tokens=this.lexer.blockTokens(s.items[e].text,[]),!s.loose){let t=s.items[e].tokens.filter(e=>"space"===e.type),i=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw));s.loose=i}if(s.loose)for(let e=0;e<s.items.length;e++)s.items[e].loose=!0;return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let i=Io(t[1]),n=t[2].replace(/^\||\| *$/g,"").split("|"),s=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(i.length===n.length){for(let e of n)/^ *-+: *$/.test(e)?r.align.push("right"):/^ *:-+: *$/.test(e)?r.align.push("center"):/^ *:-+ *$/.test(e)?r.align.push("left"):r.align.push(null);for(let e=0;e<i.length;e++)r.header.push({text:i[e],tokens:this.lexer.inline(i[e]),header:!0,align:r.align[e]});for(let e of s)r.rows.push(Io(e,r.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:r.align[t]})));return r}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:It(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let t=Ia(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(")"))return -1;let i=0;for(let t=0;t<e.length;t++)if("\\"===e[t])t++;else if("("===e[t])i++;else if(")"===e[t]&&--i<0)return t;return -1}(t[2],"()");if(e>-1){let i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],n="";if(this.options.pedantic){let e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e&&(i=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(i=this.options.pedantic&&!/>$/.test(e)?i.slice(1):i.slice(1,-1)),Il(t,{href:i?i.replace(this.rules.inline.anyPunctuation,"$1"):i,title:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let e=t[(i[2]||i[1]).replace(/\s+/g," ").toLowerCase()];if(!e){let e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return Il(i,e,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&i.match(/[\p{L}\p{N}]/u))&&(!(n[1]||n[2])||!i||this.rules.inline.punctuation.exec(i))){let i=[...n[0]].length-1,s,r,o=i,a=0,l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);null!=(n=l.exec(t));){if(!(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6]))continue;if(r=[...s].length,n[3]||n[4]){o+=r;continue}if((n[5]||n[6])&&i%3&&!((i+r)%3)){a+=r;continue}if((o-=r)>0)continue;r=Math.min(r,r+o+a);let t=[...n[0]][0].length,l=e.slice(0,i+n.index+t+r);if(Math.min(i,r)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let h=l.slice(2,-2);return{type:"strong",raw:l,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," "),i=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return i&&n&&(e=e.substring(1,e.length-1)),e=It(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,i;return i="@"===t[2]?"mailto:"+(e=It(t[1])):e=It(t[1]),{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,i;if("@"===t[2])i="mailto:"+(e=It(t[0]));else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);e=It(t[0]),i="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:It(t[0]),{type:"text",raw:t[0],text:e}}}}let Id=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,}
vendor: 8,448 bytes, line 197
197)(?:\n+|$)/,Iu=/(?:[*+-]|\d{1,9}[.)])/,Ic=In(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Iu).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Ig=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,If=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Im=In(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",If).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ip=In(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Iu).getRegex(),I_="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Iv=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ib=In("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Iv).replace("tag",I_).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),IC=In(Ig).replace("hr",Id).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",I_).getRegex(),Iw={blockquote:In(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",IC).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:Im,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Id,html:Ib,lheading:Ic,list:Ip,newline:/^(?: *(?:\n|$))+/,paragraph:IC,table:Ir,text:/^[^\n]+/},Iy=In("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Id).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",I_).getRegex(),IS={...Iw,table:Iy,paragraph:In(Ig).replace("hr",Id).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Iy).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",I_).getRegex()},IL={...Iw,html:In("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Iv).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ir,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:In(Ig).replace("hr",Id).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ic).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ix=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ik=/^( {2,}|\\)\n(?!\s*$)/,IN="\\p{P}\\p{S}",ID=In(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,IN).getRegex(),IE=In(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,IN).getRegex(),IT=In("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,IN).getRegex(),II=In("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,IN).getRegex(),IM=In(/\\([punct])/,"gu").replace(/punct/g,IN).getRegex(),IR=In(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),IA=In(Iv).replace("(?:-->|$)","-->").getRegex(),IO=In("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",IA).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),IP=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,IF=In(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",IP).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),IB=In(/^!?\[(label)\]\[(ref)\]/).replace("label",IP).replace("ref",If).getRegex(),IV=In(/^!?\[(ref)\](?:\[\])?/).replace("ref",If).getRegex(),IW=In("reflink|nolink(?!\\()","g").replace("reflink",IB).replace("nolink",IV).getRegex(),IH={_backpedal:Ir,anyPunctuation:IM,autolink:IR,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Ik,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Ir,emStrongLDelim:IE,emStrongRDelimAst:IT,emStrongRDelimUnd:II,escape:Ix,link:IF,nolink:IV,punctuation:ID,reflink:IB,reflinkSearch:IW,tag:IO,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Ir},Iz={...IH,link:In(/^!?\[(label)\]\((.*?)\)/).replace("label",IP).getRegex(),reflink:In(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",IP).getRegex()},IU={...IH,escape:In(Ix).replace("])","~|])").getRegex(),url:In(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},IK={...IU,br:In(Ik).replace("{2,}","*").getRegex(),text:In(IU.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},I$={normal:Iw,gfm:IS,pedantic:IL},Ij={normal:IH,gfm:IU,breaks:IK,pedantic:Iz};class Iq{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T4,this.options.tokenizer=this.options.tokenizer||new Ih,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:I$.normal,inline:Ij.normal};this.options.pedantic?(t.block=I$.pedantic,t.inline=Ij.pedantic):this.options.gfm&&(t.block=I$.gfm,this.options.breaks?t.inline=Ij.breaks:t.inline=Ij.gfm),this.tokenizer.rules=t}static get rules(){return{block:I$,inline:Ij}}static lex(e,t){return new Iq(t).lex(e)}static lexInline(e,t){return new Iq(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let e=0;
197e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],i=!1){let n,s,r;for(e=this.options.pedantic?e.replace(/\t/g,"    ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,(e,t,i)=>t+"    ".repeat(i.length));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(i=>!!(n=i.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),(s=t[t.length-1])&&("paragraph"===s.type||"text"===s.type)?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if((n=this.tokenizer.fences(e))||(n=this.tokenizer.heading(e))||(n=this.tokenizer.hr(e))||(n=this.tokenizer.blockquote(e))||(n=this.tokenizer.list(e))||(n=this.tokenizer.html(e))){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),(s=t[t.length-1])&&("paragraph"===s.type||"text"===s.type)?(s.raw+="\n"+n.raw,s.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if((n=this.tokenizer.table(e))||(n=this.tokenizer.lheading(e))){e=e.substring(n.raw.length),t.push(n);continue}if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t,i=1/0,n=e.slice(1);this.options.extensions.startBlock.forEach(e=>{"number"==typeof(t=e.call({lexer:this},n))&&t>=0&&(i=Math.min(i,t))}),i<1/0&&i>=0&&(r=e.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r))){s=t[t.length-1],i&&s?.type==="paragraph"?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),(s=t[t.length-1])&&"text"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let i,n,s,r,o,a;let l=e;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,r.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if((i=this.tokenizer.emStrong(e,l,a))||(i=this.tokenizer.codespan(e))||(i=this.tokenizer.br(e))||(i=this.tokenizer.del(e))||(i=this.tokenizer.autolink(e))||!this.state.inLink&&(i=this.tokenizer.url(e))){e=e.substring(i.raw.length),t.push(i);continue}if(s=e,this.options.extensions&&this.options.extensions.startInline){let t,i=1/0,n=e.slice(1);
197this.options.extensions.startInline.forEach(e=>{"number"==typeof(t=e.call({lexer:this},n))&&t>=0&&(i=Math.min(i,t))}),i<1/0&&i>=0&&(s=e.substring(0,i+1))}if(i=this.tokenizer.inlineText(s)){e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(a=i.raw.slice(-1)),o=!0,(n=t[t.length-1])&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}}class IG{options;parser;constructor(e){this.options=e||T4}space(e){return""}code({text:e,lang:t,escaped:i}){let n=(t||"").match(/^\S*/)?.[0],s=e.replace(/\n$/,"")+"\n";return n?'<pre><code class="language-'+It(n)+'">'+(i?s:It(s,!0))+"</code></pre>\n":"<pre><code>"+(i?s:It(s,!0))+"</code></pre>\n"}blockquote({tokens:e}){let t=this.parser.parse(e);return`<blockquote>
198${t}</blockquote>
199`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
200`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,i=e.start,n="";for(let t=0;t<e.items.length;t++){let i=e.items[t];n+=this.listitem(i)}let s=t?"ol":"ul";return"<"+s+(t&&1!==i?' start="'+i+'"':"")+">\n"+n+"</"+s+">\n"}listitem(e){let t="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=i+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" "}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
201`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
202`}table(e){let t="",i="";for(let t=0;t<e.header.length;t++)i+=this.tablecell(e.header[t]);t+=this.tablerow({text:i});let n="";for(let t=0;t<e.rows.length;t++){let s=e.rows[t];i="";for(let e=0;e<s.length;e++)i+=this.tablecell(s[e]);n+=this.tablerow({text:i})}return n&&(n=`<tbody>${n}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+n+"</table>\n"}tablerow({text:e}){return`<tr>
203${e}</tr>
204`}tablecell(e){let t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
205`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:i}){let n=this.parser.parseInline(i),s=Is(e);if(null===s)return n;let r='<a href="'+(e=s)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"}image({href:e,title:t,text:i}){let n=Is(e);if(null===n)return i;e=n;let s=`<img src="${e}" alt="${i}"`;return t&&(s+=` title="${t}"`),s+=">"}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class IQ{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class IY{options;renderer;textRenderer;constructor(e){this.options=e||T4,this.options.renderer=this.options.renderer||new IG,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new IQ}static parse(e,t){return new IY(t).parse(e)}static parseInline(e,t){return new IY(t).parseInline(e)}parse(e,t=!0){let i="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){i+=e||"";continue}}switch(s.type){case"space":i+=this.renderer.space(s);continue;case"hr":i+=this.renderer.hr(s);continue;case"heading":i+=this.renderer.heading(s);continue;case"code":i+=this.renderer.code(s);continue;case"table":i+=this.renderer.table(s);continue;case"blockquote":i+=this.renderer.blockquote(s);continue;case"list":i+=this.renderer.list(s);continue;case"html":i+=this.renderer.html(s);continue;case"paragraph":i+=this.renderer.paragraph(s);continue;case"text":{let r=s,o=this.renderer.text(r);for(;n+1<e.length&&"text"===e[n+1].type;)r=e[++n],o+="\n"+this.renderer.text(r);t?i+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o}]}):i+=o;continue}default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return i}parseInline(e,t){t=t||this.renderer;let i="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=e||"";continue}}switch(s.type){case"escape":case"text":i+=t.text(s);break;case"html":i+=t.html(s);break;case"link":i+=t.link(s);break;case"image":i+=t.image(s);break;case"strong":i+=t.strong(s);break;case"em":i+=t.em(s);break;case"codespan":i+=t.codespan(s);break;case"br":i+=t.br(s);break;case"del":i+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return i}}class IJ{options;constructor(e){this.options=e||T4}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}class IZ{defaults=T5();options=this.setOptions;parse=this.parseMarkdown(Iq.lex,IY.parse);parseInline=this.parseMarkdown(Iq.lexInline,IY.parseInline);Parser=IY;Renderer=IG;TextRenderer=IQ;Lexer=Iq;Tokenizer=Ih;Hooks=IJ;constructor(...e){this.use(...e)}walkTokens(e,t){let i=[];for(let n of e)switch(i=i.concat(t.call(this,n)),n.type){case"table":for(let e of n.header)i=i.concat(this.walkTokens(e.tokens,t));for(let e of n.rows)for(let n of e)i=i.concat(this.walkTokens(n.tokens,t));break;case"list":i=i.concat(this.walkTokens(n.items,t));break;default:{let e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{let s=e[n].flat(1/0);i=i.concat(this.walkTokens(s,t))}):e.tokens&&(i=i.concat(this.walkTokens(e.tokens,t)))}}return i}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};
205return e.forEach(e=>{let i={...e};if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let i=t.renderers[e.name];i?t.renderers[e.name]=function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=i.apply(this,t)),n}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let i=t[e.level];i?i.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),i.extensions=t),e.renderer){let t=this.defaults.renderer||new IG(this.defaults);for(let i in e.renderer){if(!(i in t))throw Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let n=e.renderer[i],s=t[i];t[i]=(...e)=>{let i=n.apply(t,e);return!1===i&&(i=s.apply(t,e)),i||""}}i.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Ih(this.defaults);for(let i in e.tokenizer){if(!(i in t))throw Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let n=e.tokenizer[i],s=t[i];t[i]=(...e)=>{let i=n.apply(t,e);return!1===i&&(i=s.apply(t,e)),i}}i.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new IJ;for(let i in e.hooks){if(!(i in t))throw Error(`hook '${i}' does not exist`);if("options"===i)continue;let n=e.hooks[i],s=t[i];IJ.passThroughHooks.has(i)?t[i]=e=>{if(this.defaults.async)return Promise.resolve(n.call(t,e)).then(e=>s.call(t,e));let i=n.call(t,e);return s.call(t,i)}:t[i]=(...e)=>{let i=n.apply(t,e);return!1===i&&(i=s.apply(t,e)),i}}i.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,n=e.walkTokens;i.walkTokens=function(e){let i=[];return i.push(n.call(this,e)),t&&(i=i.concat(t.call(this,e))),i}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Iq.lex(e,t??this.defaults)}parser(e,t){return IY.parse(e,t??this.defaults)}parseMarkdown(e,t){return(i,n)=>{let s={...n},r={...this.defaults,...s},o=this.onError(!!r.silent,!!r.async);if(!0===this.defaults.async&&!1===s.async)return o(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==i)return o(Error("marked(): input parameter is undefined or null"));if("string"!=typeof i)return o(Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(r.hooks&&(r.hooks.options=r),r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(i):i).then(t=>e(t,r)).then(e=>r.hooks?r.hooks.processAllTokens(e):e).then(e=>r.walkTokens?Promise.all(this.walkTokens(e,r.walkTokens)).then(()=>e):e).then(e=>t(e,r)).then(e=>r.hooks?r.hooks.postprocess(e):e).catch(o);try{r.hooks&&(i=r.hooks.preprocess(i));let n=e(i,r);r.hooks&&(n=r.hooks.processAllTokens(n)),r.walkTokens&&this.walkTokens(n,r.walkTokens);let s=t(n,r);return r.hooks&&(s=r.hooks.postprocess(s)),s}catch(e){return o(e)}}}onError(e,t){return i=>{if(i.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+It(i.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(i);throw i}}}let IX=new IZ;function I1(e,t){return IX.parse(e,t)}I1.options=I1.setOptions=function(e){return IX.setOptions(e),I1.defaults=IX.defaults,T4=I1.defaults,I1},I1.getDefaults=T5,I1.defaults=T4,I1.use=function(...e){return IX.use(...e),I1.defaults=IX.defaults,T4=I1.defaults,I1},I1.walkTokens=function(e,t){return IX.walkTokens(e,t)},I1.parseInline=IX.parseInline,I1.Parser=IY,I1.parser=IY.parse,I1.Renderer=IG,I1.TextRenderer=IQ,I1.Lexer=Iq,I1.lexer=Iq.lex,I1.Tokenizer=Ih,I1.Hooks=IJ,I1.parse=I1,I1.options,I1.setOptions,I1.use,I1.walkTokens,I1.parseInline,IY.parse;let I0=Iq.lex;function I2(e){return function e(t,i=0){if(!t||i>200)return t;if("object"==typeof t){switch(t.$mid){case 1:return sJ.revive(t);case 2:return new RegExp(t.source,t.flags);case 17:return new Date(t.source)}if(t instanceof o4||t instanceof Uint8Array)return t;if(Array.isArray(t))for(let n=0;n<t.length;++n)t[n]=e(t[n],i+1);else for(let n in t)Object.hasOwnProperty.call(t,n)&&(t[n]=e(t[n],i+1))}return t}(JSON.parse(e))}function I5(e,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}
205let{entries:I4,setPrototypeOf:I6,isFrozen:I7,getPrototypeOf:I3,getOwnPropertyDescriptor:I9}=Object,{freeze:I8,seal:Me,create:Mt}=Object,{apply:Mi,construct:Mn}="undefined"!=typeof Reflect&&Reflect;I8||(I8=function(e){return e}),Me||(Me=function(e){return e}),Mi||(Mi=function(e,t){for(var i=arguments.length,n=Array(i>2?i-2:0),s=2;s<i;s++)n[s-2]=arguments[s];return e.apply(t,n)}),Mn||(Mn=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return new e(...i)});let Ms=Mv(Array.prototype.forEach),Mr=Mv(Array.prototype.lastIndexOf),Mo=Mv(Array.prototype.pop),Ma=Mv(Array.prototype.push),Ml=Mv(Array.prototype.splice),Mh=Mv(String.prototype.toLowerCase),Md=Mv(String.prototype.toString),Mu=Mv(String.prototype.match),Mc=Mv(String.prototype.replace),Mg=Mv(String.prototype.indexOf),Mf=Mv(String.prototype.trim),Mm=Mv(Object.prototype.hasOwnProperty),Mp=Mv(RegExp.prototype.test),M_=(N=TypeError,function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return Mn(N,t)});function Mv(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var i=arguments.length,n=Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];return Mi(e,t,n)}}function Mb(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mh;I6&&I6(e,null);let n=t.length;for(;n--;){let s=t[n];if("string"==typeof s){let e=i(s);e!==s&&(I7(t)||(t[n]=e),s=e)}e[s]=!0}return e}function MC(e){let t=Mt(null);
vendor: 6,731 bytes, line 205
205for(let[i,n]of I4(e))Mm(e,i)&&(Array.isArray(n)?t[i]=function(e){for(let t=0;t<e.length;t++)Mm(e,t)||(e[t]=null);return e}(n):n&&"object"==typeof n&&n.constructor===Object?t[i]=MC(n):t[i]=n);return t}function Mw(e,t){for(;null!==e;){let i=I9(e,t);if(i){if(i.get)return Mv(i.get);if("function"==typeof i.value)return Mv(i.value)}e=I3(e)}return function(){return null}}let My=I8(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),MS=I8(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ML=I8(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Mx=I8(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Mk=I8(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),MN=I8(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),MD=I8(["#text"]),ME=I8(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),MT=I8(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),MI=I8(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","
205subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),MM=I8(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MR=Me(/\{\{[\w\W]*|[\w\W]*\}\}/gm),MA=Me(/<%[\w\W]*|[\w\W]*%>/gm),MO=Me(/\$\{[\w\W]*/gm),MP=Me(/^data-[\-\w.\u00B7-\uFFFF]+$/),MF=Me(/^aria-[\-\w]+$/),MB=Me(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),MV=Me(/^(?:\w+script|data):/i),MW=Me(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),MH=Me(/^html$/i);var Mz=Object.freeze({__proto__:null,ARIA_ATTR:MF,ATTR_WHITESPACE:MW,CUSTOM_ELEMENT:Me(/^[a-z][.\w]*(-[.\w]+)+$/i),DATA_ATTR:MP,DOCTYPE_NAME:MH,ERB_EXPR:MA,IS_ALLOWED_URI:MB,IS_SCRIPT_OR_DATA:MV,MUSTACHE_EXPR:MR,TMPLIT_EXPR:MO});let MU={element:1,text:3,progressingInstruction:7,comment:8,document:9},MK=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));let s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+s+" could not be created."),null}},M$=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};var Mj=function e(){let t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"undefined"==typeof window?null:window,n=t=>e(t);if(n.version="3.2.7",n.removed=[],!i||!i.document||i.document.nodeType!==MU.document||!i.Element)return n.isSupported=!1,n;let{document:s}=i,r=s,o=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:l,Node:h,Element:d,NodeFilter:u,NamedNodeMap:c=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:g,DOMParser:f,trustedTypes:m}=i,p=d.prototype,_=Mw(p,"cloneNode"),v=Mw(p,"remove"),b=Mw(p,"nextSibling"),C=Mw(p,"childNodes"),w=Mw(p,"parentNode");if("function"==typeof l){let e=s.createElement("template");e.content&&e.content.ownerDocument&&(s=e.content.ownerDocument)}let y="",{implementation:S,createNodeIterator:L,createDocumentFragment:x,getElementsByTagName:k}=s,{importNode:N}=r,D=M$();n.isSupported="function"==typeof I4&&"function"==typeof w&&S&&void 0!==S.createHTMLDocument;let{MUSTACHE_EXPR:E,ERB_EXPR:T,TMPLIT_EXPR:I,DATA_ATTR:M,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:A,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:P}=Mz,{IS_ALLOWED_URI:F}=Mz,B=null,V=Mb({},[...My,...MS,...ML,...Mk,...MD]),W=null,H=Mb({},[...ME,...MT,...MI,...MM]),z=Object.seal(Mt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),U=null,K=null,$=!0,j=!0,q=!1,G=!0,Q=!1,Y=!0,J=!1,Z=!1,X=!1,ee=!1,et=!1,ei=!1,en=!0,es=!1,er=!0,eo=!1,ea={},el=null,eh=Mb({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ed=null,eu=Mb({},["audio","video","img","source","image","track"]),ec=null,eg=Mb({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ef="http://www.w3.org/1998/Math/MathML",em="http://www.w3.org/2000/svg",ep="http://www.w3.org/1999/xhtml",e_=ep,ev=!1,eb=null,eC=Mb({},[ef,em,ep],Md),ew=Mb({},["mi","mo","mn","ms","mtext"]),ey=Mb({},["annotation-xml"]),eS=Mb({},["title","style","font","a","script"]),eL=null,ex=["application/xhtml+xml","text/html"],ek=null,eN=null,eD=s.createElement("form"),eE=function(e){return e instanceof RegExp||e instanceof Function},eT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!eN||eN!==e){if(e&&"object"==typeof e||(e={}),e=MC(e),ek="application/xhtml+xml"===(eL=-1===ex.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?Md:Mh,B=Mm(e,"ALLOWED_TAGS")?Mb({},e.ALLOWED_TAGS,ek):V,W=Mm(e,"ALLOWED_ATTR")?Mb({},e.ALLOWED_ATTR,ek):H,eb=Mm(e,"ALLOWED_NAMESPACES")?Mb({},e.ALLOWED_NAMESPACES,Md):eC,ec=Mm(e,"ADD_URI_SAFE_ATTR")?Mb(MC(eg),e.ADD_URI_SAFE_ATTR,ek):eg,ed=Mm(e,"ADD_DATA_URI_TAGS")?Mb(MC(eu),e.ADD_DATA_URI_TAGS,ek):eu,el=Mm(e,"FORBID_CONTENTS")?Mb({},e.FORBID_CONTENTS,ek):eh,U=Mm(e,"FORBID_TAGS")?Mb({},e.FORBID_TAGS,ek):MC({}),K=Mm(e,"FORBID_ATTR")?Mb({},e.FORBID_ATTR,ek):MC({}),ea=!!Mm(e,"USE_PROFILES")&&e.USE_PROFILES,$=!1!==e.ALLOW_ARIA_ATTR,j=!1!==e.ALLOW_DATA_ATTR,q=e.ALLOW_UNKNOWN_PROTOCOLS||!1,G=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Q=e.SAFE_FOR_TEMPLATES||!1,Y=!1!==e.SAFE_FOR_XML,J=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,et=e.RETURN_DOM_FRAGMENT||!1,ei=e.RETURN_TRUSTED_TYPE||!1,X=e.FORCE_BODY||!1,en=!1!==e.
205SANITIZE_DOM,es=e.SANITIZE_NAMED_PROPS||!1,er=!1!==e.KEEP_CONTENT,eo=e.IN_PLACE||!1,F=e.ALLOWED_URI_REGEXP||MB,e_=e.NAMESPACE||ep,ew=e.MATHML_TEXT_INTEGRATION_POINTS||ew,ey=e.HTML_INTEGRATION_POINTS||ey,z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&eE(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&eE(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Q&&(j=!1),et&&(ee=!0),ea&&(B=Mb({},MD),W=[],!0===ea.html&&(Mb(B,My),Mb(W,ME)),!0===ea.svg&&(Mb(B,MS),Mb(W,MT),Mb(W,MM)),!0===ea.svgFilters&&(Mb(B,ML),Mb(W,MT),Mb(W,MM)),!0===ea.mathMl&&(Mb(B,Mk),Mb(W,MI),Mb(W,MM))),e.ADD_TAGS&&(B===V&&(B=MC(B)),Mb(B,e.ADD_TAGS,ek)),e.ADD_ATTR&&(W===H&&(W=MC(W)),Mb(W,e.ADD_ATTR,ek)),e.ADD_URI_SAFE_ATTR&&Mb(ec,e.ADD_URI_SAFE_ATTR,ek),e.FORBID_CONTENTS&&(el===eh&&(el=MC(el)),Mb(el,e.FORBID_CONTENTS,ek)),er&&(B["#text"]=!0),J&&Mb(B,["html","head","body"]),B.table&&(Mb(B,["tbody"]),delete U.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw M_('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw M_('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=(t=e.TRUSTED_TYPES_POLICY).createHTML("")}else void 0===t&&(t=MK(m,o)),null!==t&&"string"==typeof y&&(y=t.createHTML(""));I8&&I8(e),eN=e}},eI=Mb({},[...MS,...ML,...Mx]),eM=Mb({},[...Mk,...MN]),eR=function(e){let t=w(e);t&&t.tagName||(t={namespaceURI:e_,tagName:"template"});let i=Mh(e.tagName),n=Mh(t.tagName);return!!eb[e.namespaceURI]&&(e.namespaceURI===em?t.namespaceURI===ep?"svg"===i:t.namespaceURI===ef?"svg"===i&&("annotation-xml"===n||ew[n]):!!eI[i]:e.namespaceURI===ef?t.namespaceURI===ep?"math"===i:t.namespaceURI===em?"math"===i&&ey[n]:!!eM[i]:e.namespaceURI===ep?(t.namespaceURI!==em||!!ey[n])&&(t.namespaceURI!==ef||!!ew[n])&&!eM[i]&&(eS[i]||!eI[i]):"application/xhtml+xml"===eL&&!!eb[e.namespaceURI])},eA=function(e){Ma(n.removed,{element:e});try{w(e).removeChild(e)}catch(t){v(e)}},eO=function(e,t){try{Ma(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ma(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e){if(ee||et)try{eA(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}}},eP=function(e){let i=null,n=null;if(X)e="<remove></remove>"+e;else{let t=Mu(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===eL&&e_===ep&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let r=t?t.createHTML(e):e;if(e_===ep)try{i=new f().parseFromString(r,eL)}catch(e){}if(!i||!i.documentElement){i=S.createDocument(e_,"template",null);try{i.documentElement.innerHTML=ev?y:r}catch(e){}}let o=i.body||i.documentElement;return(e&&n&&o.insertBefore(s.createTextNode(n),o.childNodes[0]||null),e_===ep)?k.call(i,J?"html":"body")[0]:J?i.documentElement:o},eF=function(e){return L.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},eB=function(e){return e instanceof g&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof c)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},eV=function(e){return"function"==typeof h&&e instanceof h};function eW(e,t,i){Ms(e,e=>{e.call(n,t,i,eN)})}let eH=function(e){let t=null;if(eW(D.beforeSanitizeElements,e,null),eB(e))return eA(e),!0;let i=ek(e.nodeName);if(eW(D.uponSanitizeElement,e,{tagName:i,allowedTags:B}),Y&&e.hasChildNodes()&&!eV(e.firstElementChild)&&Mp(/<[/\w!]/g,e.innerHTML)&&Mp(/<[/\w!]/g,e.textContent)||e.nodeType===MU.progressingInstruction||Y&&e.nodeType===MU.comment&&Mp(/<[/\w]/g,e.data))return eA(e),!0;if(!B[i]||U[i]){if(!U[i]&&eU(i)&&(z.tagNameCheck instanceof RegExp&&Mp(z.tagNameCheck,i)||z.tagNameCheck instanceof Function&&z.tagNameCheck(i)))return!1;if(er&&!el[i]){let t=w(e)||e.parentNode,i=C(e)||e.childNodes;if(i&&t){let n=i.length;for(let s=n-1;s>=0;--s){let n=_(i[s],!0);n.__removalCount=(e.__removalCount||0)+1,t.insertBefore(n,b(e))}}}return eA(e),!0}return e instanceof d&&!eR(e)||("noscript"===i||"noembed"===i||"noframes"===i)&&Mp(/<\/no(script|embed|frames)/i,e.innerHTML)?(eA(e),!0):(Q&&e.nodeType===MU.text&&(t=e.textContent,Ms([E,T,I],e=>{t=Mc(t,e," ")}),e.textContent!==t&&(Ma(n.removed,{element:e.cloneNode()}),e.textContent=t)),eW(D.afterSanitizeElements,e,null),!1)},ez=function(e,t,i){if(en&&("id"===t||"name"===t)&&(i in s||i in eD))return!1;if(j&&!K[t]&&Mp(M,t));else if($&&Mp(R,t));else if(!W[t]||K[t]){if(!(eU(e)&&(z.tagNameCheck instanceof RegExp&&Mp(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&Mp(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t,e))||"is"===t&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Mp(z.tagNameCheck,i)||z.tagNameCheck instanceof Function&&z.tagNameCheck(i))))return!1}else if(ec[t]);else if(Mp(F,Mc(i,O,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===Mg(i,"data:")&&ed[e]);else if(q&&!Mp(A,Mc(i,O,"")));else if(i)return!1;return!0},eU=function(e){return"annotation-xml"!==e&&Mu(e,P)},eK=function(e){eW(D.beforeSanitizeAttributes,e,null);let{attributes:i}=e;if(!i||eB(e))return;let s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0},r=i.length;for(;r--;){let{name:o,namespaceURI:a,value:l}=i[r],h=ek(o),d="value"===o?l:Mf(l);
205if(s.attrName=h,s.attrValue=d,s.keepAttr=!0,s.forceKeepAttr=void 0,eW(D.uponSanitizeAttribute,e,s),d=s.attrValue,es&&("id"===h||"name"===h)&&(eO(o,e),d="user-content-"+d),Y&&Mp(/((--!?|])>)|<\/(style|title|textarea)/i,d)||"attributename"===h&&Mu(d,"href")){eO(o,e);continue}if(s.forceKeepAttr)continue;if(!s.keepAttr||!G&&Mp(/\/>/i,d)){eO(o,e);continue}Q&&Ms([E,T,I],e=>{d=Mc(d,e," ")});let u=ek(e.nodeName);if(!ez(u,h,d)){eO(o,e);continue}if(t&&"object"==typeof m&&"function"==typeof m.getAttributeType){if(a);else switch(m.getAttributeType(u,h)){case"TrustedHTML":d=t.createHTML(d);break;case"TrustedScriptURL":d=t.createScriptURL(d)}}if(d!==l)try{a?e.setAttributeNS(a,o,d):e.setAttribute(o,d),eB(e)?eA(e):Mo(n.removed)}catch(t){eO(o,e)}}eW(D.afterSanitizeAttributes,e,null)},e$=function e(t){let i=null,n=eF(t);for(eW(D.beforeSanitizeShadowDOM,t,null);i=n.nextNode();)eW(D.uponSanitizeShadowNode,i,null),eH(i),eK(i),i.content instanceof a&&e(i.content);eW(D.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=null,o=null,l=null,d=null;if((ev=!e)&&(e="<!-->"),"string"!=typeof e&&!eV(e)){if("function"==typeof e.toString){if("string"!=typeof(e=e.toString()))throw M_("dirty is not a string, aborting")}else throw M_("toString is not a function")}if(!n.isSupported)return e;if(Z||eT(i),n.removed=[],"string"==typeof e&&(eo=!1),eo){if(e.nodeName){let t=ek(e.nodeName);if(!B[t]||U[t])throw M_("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof h)(o=(s=eP("<!---->")).ownerDocument.importNode(e,!0)).nodeType===MU.element&&"BODY"===o.nodeName?s=o:"HTML"===o.nodeName?s=o:s.appendChild(o);else{if(!ee&&!Q&&!J&&-1===e.indexOf("<"))return t&&ei?t.createHTML(e):e;if(!(s=eP(e)))return ee?null:ei?y:""}s&&X&&eA(s.firstChild);let u=eF(eo?e:s);for(;l=u.nextNode();)eH(l),eK(l),l.content instanceof a&&e$(l.content);if(eo)return e;if(ee){if(et)for(d=x.call(s.ownerDocument);s.firstChild;)d.appendChild(s.firstChild);else d=s;return(W.shadowroot||W.shadowrootmode)&&(d=N.call(r,d,!0)),d}let c=J?s.outerHTML:s.innerHTML;return J&&B["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&Mp(MH,s.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+s.ownerDocument.doctype.name+">\n"+c),Q&&Ms([E,T,I],e=>{c=Mc(c,e," ")}),t&&ei?t.createHTML(c):c},n.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eT(e),Z=!0},n.clearConfig=function(){eN=null,Z=!1},n.isValidAttribute=function(e,t,i){return eN||eT({}),ez(ek(e),ek(t),i)},n.addHook=function(e,t){"function"==typeof t&&Ma(D[e],t)},n.removeHook=function(e,t){if(void 0!==t){let i=Mr(D[e],t);return -1===i?void 0:Ml(D[e],i,1)[0]}return Mo(D[e])},n.removeHooks=function(e){D[e]=[]},n.removeAllHooks=function(){D=M$()},n}();let Mq=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","s","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]),MG=Object.freeze(["href","target","src","alt","title","for","name","role","tabindex","x-dispatch","required","checked","placeholder","type","start","width","height","align"]),MQ="vscode-relative-path";function MY(e,t){if("*"===t.override)return!0;try{let i=new URL(e,MQ+"://");if(t.override.includes(i.protocol.replace(/:$/,""))||t.allowRelativePaths&&i.protocol===MQ+":"&&!e.trim().toLowerCase().startsWith(MQ))return!0;return!1}catch(e){return!1}}let MJ=Object.freeze({ALLOWED_TAGS:[...Mq],ALLOWED_ATTR:[...MG],ALLOW_UNKNOWN_PROTOCOLS:!0});function MZ(e,t,i){try{var n,s;let r={...MJ};t?.allowedTags&&(t.allowedTags.override&&(r.ALLOWED_TAGS=[...t.allowedTags.override]),t.allowedTags.augment&&(r.ALLOWED_TAGS=[...r.ALLOWED_TAGS??[],...t.allowedTags.augment]));let o=[...MG];t?.allowedAttributes&&(t.allowedAttributes.override&&(o=[...t.allowedAttributes.override]),t.allowedAttributes.augment&&(o=[...o,...t.allowedAttributes.augment])),o=o.map(e=>"string"==typeof e?e.toLowerCase():{attributeName:e.attributeName.toLowerCase(),shouldKeep:e.shouldKeep});let a=new Set(o.map(e=>"string"==typeof e?e:e.attributeName)),l=new Map;for(let e of o)"string"==typeof e?l.delete(e):l.set(e.attributeName,e);if(r.ALLOWED_ATTR=Array.from(a),n={override:t?.allowedLinkProtocols?.override??[iA.http,iA.https],allowRelativePaths:t?.allowRelativeLinkPaths??!1},s={override:t?.allowedMediaProtocols?.override??[iA.http,iA.https],allowRelativePaths:t?.allowRelativeMediaPaths??!1},Mj.addHook("afterSanitizeAttributes",e=>{for(let t of["href","src"])if(e.hasAttribute(t)){let i=e.getAttribute(t);"href"===t?i.startsWith("#")||MY(i,n)||e.removeAttribute(t):MY(i,s)||e.removeAttribute(t)}}),t?.replaceWithPlaintext&&Mj.addHook("uponSanitizeElement",M1),l.size&&Mj.addHook("uponSanitizeAttribute",(e,t)=>{let i=l.get(t.attrName);if(i){let n=i.shouldKeep(e,t);"string"==typeof n?(t.keepAttr=!0,t.attrValue=n):t.keepAttr=n}else t.keepAttr=a.has(t.attrName)}),"dom"===i)return Mj.sanitize(e,{...r,RETURN_DOM_FRAGMENT:!0});return Mj.sanitize(e,{...r,RETURN_TRUSTED_TYPE:!0})}finally{Mj.removeAllHooks()}}let MX=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M1=(e,t,i)=>{if(!t.allowedTags[t.tagName]&&"body"!==t.tagName){let t=M0(e);t&&(e.nodeType===Node.COMMENT_NODE?e.parentElement?.insertBefore(t,e):e.parentElement?.replaceChild(t,e))}};function M0(e){let t,i;if(!e.ownerDocument)return;if(e.nodeType===Node.COMMENT_NODE)t=`<!--${e.textContent}-->`;else{if(!(e instanceof Element))return;let n=e.tagName.toLowerCase(),s=MX.includes(n),r=e.attributes.length?" "+Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "):"";t=`<${n}${r}>`,s||(i=`</${n}>`)}let n=document.createDocumentFragment(),s=e.ownerDocument.createTextNode(t);for(n.appendChild(s);e.firstChild;)n.appendChild(e.firstChild);let r=i?e.ownerDocument.createTextNode(i):void 0;return r&&n.appendChild(r),n}function M2(e,t,i){lD(e,MZ(t,i,"dom"))}let M5=RegExp(`(\\\\)?\\$\\((${iH.iconNameExpression}(?:${iH.iconModifierExpression})?)\\)`,"g");function M4(e){let t;let i=[],n=0,s=0;for(;null!==(t=M5.exec(e));){n<(s=t.index||0)&&i.push(e.substring(n,s)),n=(t.index||0)+t[0].length;let[,r,o]=t;i.push(r?`$(${o})`:M6({id:o}))}return n<e.length&&i.push(e.substring(n)),i}function M6(e){let t=lI("span");return t.classList.add(...iH.asClassNameArray(e)),t}let M7=Object.freeze({image:({href:e,title:t,text:i})=>{let n=[],s=[];return e&&({href:e,dimensions:n}=function(e){let t=[],i=e.split("|").map(e=>e.trim());e=i[0];let n=i[1];if(n){let e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),s=e?e[1]:"",r=i?i[1]:"",o=isFinite(parseInt(r)),a=isFinite(parseInt(s));o&&t.push(`width="${r}"`),a&&t.push(`height="${s}"`)}return{href:e,dimensions:t}}(e),s.push(`src="${TX(e)}"`)),i&&s.push(`alt="${TX(i)}"`),t&&s.push(`title="${TX(t)}"`),n.length&&(s=s.concat(n)),"<img "+s.join(" ")+">"},paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>`},link({href:e,title:t,tokens:i}){let n=this.parser.parseInline(i);return"string"!=typeof e?"":(e===n&&(n=T1(n)),t="string"==typeof t?TX(T1(t)):"",e=(e=T1(e)).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),`<a href="${e}" title="${t||e}" draggable="false">${n}</a>`)}});function M3(e,t={},i){let n,s,r;let o=new ro.SL,a=!1,l=new IZ(...t.markedExtensions??[]),{renderer:h,codeBlocks:d,syncCodeBlocks:u}=function(e,t,i){let n=new e.Renderer(t.markedOptions);if(n.image=M7.image,n.link=M7.link,n.paragraph=M7.paragraph,i.supportAlertSyntax){var s;n.blockquote=(s=n.blockquote,function(e){let{tokens:t}=e,i=t[0];if(i?.type!=="paragraph")return s.call(this,e);let n=i.tokens;
205if(!n||0===n.length)return s.call(this,e);let r=n[0];if(r?.type!=="text")return s.call(this,e);let o=/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*?\n*/i,a=r.raw.match(o);if(!a)return s.call(this,e);r.raw=r.raw.replace(o,""),r.text=r.text.replace(o,"");let l=a[1],h=l.charAt(0).toUpperCase()+l.slice(1).toLowerCase(),d=l.toLowerCase(),u=M6({id:{note:"info",tip:"light-bulb",important:"comment",warning:"alert",caution:"stop"}[d]}).outerHTML,c=this.parser.parse(t);return`<blockquote data-severity="${d}"><p><span>${u}${h}</span>${c.substring(3)}</blockquote>
206`})}let r=[],o=[];return t.codeBlockRendererSync?n.code=({text:e,lang:i,raw:n})=>{let s=T2.nextId(),r=t.codeBlockRendererSync(Re(i),e,n);return o.push([s,r]),`<div class="code" data-code="${s}">${rk(e)}</div>`}:t.codeBlockRenderer&&(n.code=({text:e,lang:i})=>{let n=T2.nextId(),s=t.codeBlockRenderer(Re(i),e);return r.push(s.then(e=>[n,e])),`<div class="code" data-code="${n}">${rk(e)}</div>`}),i.supportHtml||(n.html=({text:e})=>t.sanitizerConfig?.replaceWithPlaintext?rk(e):(i.isTrusted?e.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?e:""),{renderer:n,codeBlocks:r,syncCodeBlocks:o}}(l,t,e),c=((r=e.value).length>1e5&&(r=`${r.substr(0,1e5)}…`),e.supportThemeIcons&&(r=r.replace(TK,e=>`\\${e}`)),r);if(t.fillInIncompleteTokens){let e={...l.defaults,...t.markedOptions,renderer:h},i=function(e){for(let t=0;t<3;t++){let t=function(e){let t,i;for(t=0;t<e.length;t++){let n=e[t];if("paragraph"===n.type&&n.raw.match(/(\n|^)\|/)){i=function(e){let t;let i=Rl(e),n=i.split("\n"),s=!1;for(let e=0;e<n.length;e++){let i=n[e].trim();if(void 0===t&&i.match(/^\s*\|/)){let e=i.match(/(\|[^\|]+)(?=\||$)/g);e&&(t=e.length)}else if("number"==typeof t){if(!i.match(/^\s*\|/)||e!==n.length-1)return;s=!0}}if("number"==typeof t&&t>0){let e=s?n.slice(0,-1).join("\n"):i,r=!!e.match(/\|\s*$/);return I0(e+(r?"":"|")+`
207|${" --- |".repeat(t)}`)}}(e.slice(t));break}}let n=e.at(-1);if(!i&&n?.type==="list"){let s=function(e){let t;let i=e.items[e.items.length-1],n=i.tokens?i.tokens[i.tokens.length-1]:void 0,s=e=>{let t=e.items.at(-1),i=t?.tokens.at(-1);return i?.type==="heading"||i?.type==="list"&&s(i)};if(n?.type!=="text"||"inRawBlock"in i){if(s(e)){let t=I0(e.raw.trim()+" &nbsp;")[0];if("list"!==t.type)return;return t}}else t=Rh(n);if(!t||"paragraph"!==t.type)return;let r=Rl(e.items.slice(0,-1)),o=i.raw.match(/^(\s*(-|\d+\.|\*) +)/)?.[0];if(!o)return;let a=I0(r+(o+Rl(i.tokens.slice(0,-1))+t.raw))[0];if("list"===a.type)return a}(n);s&&(i=[s],t=e.length-1)}if(!i&&n?.type==="paragraph"){let s=Rh(n);s&&(i=[s],t=e.length-1)}if(i){let n=[...e.slice(0,t),...i];return n.links=e.links,n}if(n?.type==="heading"){let t=function(e,t){if(e.raw.match(/-\s*$/))return I0(t+" &nbsp;")}(n,Rl(e));if(t)return t}return null}(e);if(t)e=t;else break}return e}(l.lexer(c,e));n=l.parser(i,e)}else n=l.parse(c,{...t?.markedOptions,renderer:h,async:!1});e.supportThemeIcons&&(n=M4(n).map(e=>"string"==typeof e?e:e.outerHTML).join(""));let g=document.createElement("div");if(M2(g,n,Rs(e,t.sanitizerConfig??{})),function(e,t,i){for(let n of i.querySelectorAll("img, audio, video, source")){let i=n.getAttribute("src");if(i){let s=i;try{e.baseUri&&(s=Rt(sJ.from(e.baseUri),s))}catch(e){}if(n.setAttribute("src",M8(e,s,!0)),t.sanitizerConfig?.remoteImageIsAllowed){let e=sJ.parse(s);e.scheme===iA.file||e.scheme===iA.data||t.sanitizerConfig.remoteImageIsAllowed(e)||n.replaceWith(lI("",void 0,n.outerHTML))}}}for(let t of i.querySelectorAll("a")){let i=t.getAttribute("href");if(t.setAttribute("href",""),!i||/^data:|javascript:/i.test(i)||/^command:/i.test(i)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(i))t.replaceWith(...t.childNodes);else{let n=M8(e,i,!1);e.baseUri&&(n=Rt(sJ.from(e.baseUri),i)),t.dataset.href=n}}}(e,t,g),i?(s=i,lD(i,...g.children)):s=g,d.length>0)Promise.all(d).then(e=>{if(a)return;let i=new Map(e);for(let e of s.querySelectorAll("div[data-code]")){let t=i.get(e.dataset.code??"");t&&lD(e,t)}t.asyncRenderCallback?.()});else if(u.length>0){let e=new Map(u);for(let t of s.querySelectorAll("div[data-code]")){let i=e.get(t.dataset.code??"");i&&lD(t,i)}}if(t.asyncRenderCallback)for(let e of s.getElementsByTagName("img")){let i=o.add(a6(e,"load",()=>{i.dispose(),t.asyncRenderCallback()}))}if(t.actionHandler){let i=i=>{let n=new oE(aG(s),i);(n.leftButton||n.middleButton)&&M9(e,t,n)};o.add(a6(s,"click",i)),o.add(a6(s,"auxclick",i)),o.add(a6(s,"keydown",i=>{let n=new ok(i);(n.equals(10)||n.equals(3))&&M9(e,t,n)}))}for(let e of[...s.getElementsByTagName("input")])if(e.attributes.getNamedItem("type")?.value==="checkbox")e.setAttribute("disabled","");else if(t.sanitizerConfig?.replaceWithPlaintext){let t=M0(e);t?e.parentElement?.replaceChild(t,e):e.remove()}else e.remove();return{element:s,dispose:()=>{a=!0,o.dispose()}}}function M9(e,t,i){let n=i.target.closest("a[data-href]");if(l_(n))try{let i=n.dataset.href;i&&(e.baseUri&&(i=Rt(sJ.from(e.baseUri),i)),t.actionHandler?.(i,e))}catch(e){(0,o_.dL)(e)}finally{i.preventDefault()}}function M8(e,t,i){let n=e.uris&&e.uris[t],s=sJ.revive(n);return i?t.startsWith(iA.data+":")?t:(s||(s=sJ.parse(t)),o0.uriToBrowserUri(s).toString(!0)):s&&sJ.parse(t).toString()!==s.toString()?(s.query&&(s=s.with({query:function(e,t){let i;try{i=I2(decodeURIComponent(t))}catch(e){}return i?encodeURIComponent(JSON.stringify(i=(0,cI.rs)(i,t=>e.uris&&e.uris[t]?sJ.revive(e.uris[t]):void 0))):t}
207(e,s.query)})),s.toString()):t}function Re(e){if(!e)return"";let t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}function Rt(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?dE(e,t).toString():dE(dk(e),t).toString()}let Ri=Object.freeze([...Mq,"input"]),Rn=Object.freeze(["align","autoplay","alt","colspan","controls","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","target","title","type","width","start","checked","disabled","value","data-code","data-href","data-severity",{attributeName:"style",shouldKeep:(e,t)=>"SPAN"===e.tagName&&"style"===t.attrName&&/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(t.attrValue)},{attributeName:"class",shouldKeep:(e,t)=>"SPAN"===e.tagName&&"class"===t.attrName&&/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue)}]);function Rs(e,t){let i=e.isTrusted??!1,n=[iA.http,iA.https,iA.mailto,iA.file,iA.vscodeFileResource,iA.vscodeRemote,iA.vscodeRemoteResource,iA.vscodeNotebookCell];return i&&n.push(iA.command),t.allowedLinkSchemes?.augment&&n.push(...t.allowedLinkSchemes.augment),{allowedTags:{override:t.allowedTags?.override??Ri},allowedAttributes:{override:t.allowedAttributes?.override??Rn},allowedLinkProtocols:{override:n},allowRelativeLinkPaths:!!e.baseUri,allowedMediaProtocols:{override:[iA.http,iA.https,iA.data,iA.file,iA.vscodeFileResource,iA.vscodeRemote,iA.vscodeRemoteResource]},allowRelativeMediaPaths:!!e.baseUri,replaceWithPlaintext:t.replaceWithPlaintext}}let Rr=new Map([["&quot;",'"'],["&nbsp;"," "],["&amp;","&"],["&#39;","'"],["&lt;","<"],["&gt;",">"]]);function Ro(){let e=new IG;return e.code=({text:e})=>rk(e),e.blockquote=({text:e})=>e+"\n",e.html=e=>"",e.heading=function({tokens:e}){return this.parser.parseInline(e)+"\n"},e.hr=()=>"",e.list=function({items:e}){return e.map(e=>this.listitem(e)).join("\n")+"\n"},e.listitem=({text:e})=>e+"\n",e.paragraph=function({tokens:e}){return this.parser.parseInline(e)+"\n"},e.table=function({header:e,rows:t}){return e.map(e=>this.tablecell(e)).join(" ")+"\n"+t.map(e=>e.map(e=>this.tablecell(e)).join(" ")).join("\n")+"\n"},e.tablerow=({text:e})=>e,e.tablecell=function({tokens:e}){return this.parser.parseInline(e)},e.strong=({text:e})=>e,e.em=({text:e})=>e,e.codespan=({text:e})=>rk(e),e.br=e=>"\n",e.del=({text:e})=>e,e.image=e=>"",e.text=({text:e})=>e,e.link=({text:e})=>e,e}let Ra=new rS(Ro);function Rl(e){let t="";return e.forEach(e=>{t+=e.raw}),t}function Rh(e){if(e.tokens)for(let t=e.tokens.length-1;t>=0;t--){let i=e.tokens[t];if("text"===i.type){let n=i.raw.split("\n"),s=n[n.length-1];if(s.includes("`"))return Rd(e,"`");if(s.includes("**"))return Rd(e,"**");if(s.match(/\*\w/))return Rd(e,"*");if(s.match(/(^|\s)__\w/))return Rd(e,"__");if(s.match(/(^|\s)_\w/))return Rd(e,"_");if(s.match(/(^|\s)\[.*\]\(\w*/)||s.match(/^[^\[]*\]\([^\)]*$/)&&e.tokens.slice(0,t).some(e=>"text"===e.type&&e.raw.match(/\[[^\]]*$/))){let i=e.tokens.slice(t+1);if(i[0]?.type==="link"&&i[1]?.type==="text"&&i[1].raw.match(/^ *"[^"]*$/)||s.match(/^[^"]* +"[^"]*$/))return Rd(e,'")',!1);return Rd(e,")",!1)}if(s.match(/(^|\s)\[\w*[^\]]*$/))return Rd(e,"](https://microsoft.com)",!1)}}}function Rd(e,t,i=!0){let n=Rl(Array.isArray(e)?e:[e]);return I0((i?n.trimEnd():n)+t)[0]}new rS(()=>{let e=Ro();return e.code=({text:e})=>`
208\`\`\`
209${rk(e)}
210\`\`\`
211`,e});let Ru=ht("openerService"),Rc=ht("markdownRendererService"),Rg=class{constructor(e){this._openerService=e}render(e,t,i){let n={...t};n.actionHandler||(n.actionHandler=(e,t)=>Rf(this._openerService,e,t.isTrusted)),n.codeBlockRenderer||(n.codeBlockRenderer=(e,t)=>this._defaultCodeBlockRenderer?.renderCodeBlock(e,t,n??{})??Promise.resolve(document.createElement("span")));let s=M3(e,n,i);return s.element.classList.add("rendered-markdown"),s}setDefaultCodeBlockRenderer(e){this._defaultCodeBlockRenderer=e}};async function Rf(e,t,i,n){try{return await e.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:!0===i||!!(i&&Array.isArray(i.enabledCommands))&&i.enabledCommands,skipValidation:n})}catch(e){return(0,o_.dL)(e),!1}}uP(Rc,Rg=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){Ru(e,t,0)}],Rg),1);var Rm=function(e,t){return function(i,n){t(i,n,e)}};let Rp=class extends vQ{get _targetWindow(){return aG(this._target.targetElements[0])}get _targetDocumentElement(){return aG(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return 2===this._hoverPosition?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,n,s){let r;if(super(),this._keybindingService=t,this._configurationService=i,this._markdownRenderer=n,this._accessibilityService=s,this._messageListeners=new ro.SL,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._maxHeightRatioRelativeToWindow=.5,this._onDispose=this._register(new sd.Q5),this._onRequestLayout=this._register(new sd.Q5),this._linkHandler=e.linkH
211andler,this._target="targetElements"in e.target?e.target:new Rv(e.target),e.style)switch(e.style){case 1:e.appearance??={},e.appearance.compact??=!0,e.appearance.showPointer??=!0;break;case 2:e.appearance??={},e.appearance.compact??=!0}this._hoverPointer=e.appearance?.showPointer?lI("div.workbench-hover-pointer"):void 0,this._hover=this._register(new Tc(!e.appearance?.skipFadeInAnimation)),this._hover.containerDomNode.classList.add("workbench-hover"),e.appearance?.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),e.position?.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0);let o=e.appearance?.maxHeightRatio;void 0!==o&&o>0&&o<=1&&(this._maxHeightRatioRelativeToWindow=o),this._hoverPosition=e.position?.hoverPosition===void 0?3:(0,re.hj)(e.position.hoverPosition)?e.position.hoverPosition:2,this.onmousedown(this._hover.containerDomNode,e=>e.stopPropagation()),this.onkeydown(this._hover.containerDomNode,e=>{e.equals(9)&&this.dispose()}),this._register(a6(this._targetWindow,"blur",()=>this.dispose()));let a=lI("div.hover-row.markdown-hover"),l=lI("div.hover-contents");if("string"==typeof e.content)l.textContent=e.content,l.style.whiteSpace="pre-wrap";else if(l_(e.content))l.appendChild(e.content),l.classList.add("html-hover-contents");else{let t=e.content,{element:i}=this._register(this._markdownRenderer.render(t,{actionHandler:this._linkHandler,asyncRenderCallback:()=>{l.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}}));l.appendChild(i)}if(a.appendChild(l),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){let t=lI("div.hover-row.status-bar"),i=lI("div.actions");e.actions.forEach(e=>{let t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;this._register(Tg.render(i,{label:e.label,commandId:e.commandId,run:t=>{e.run(t),this.dispose()},iconClass:e.iconClass},n))}),t.appendChild(i),this._hover.containerDomNode.appendChild(t)}if(this._hoverContainer=lI("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode),r=(!e.actions||!(e.actions.length>0))&&(e.persistence?.hideOnHover===void 0?"string"==typeof e.content||TZ(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes("</a>"):e.persistence.hideOnHover),e.appearance?.showHoverHint){let e=lI("div.hover-row.status-bar"),t=lI("div.info");t.textContent=(0,rh.NC)(1699,"Hold {0} key to mouse over",sS.dz?"Option":"Alt"),e.appendChild(t),this._hover.containerDomNode.appendChild(e)}let h=[...this._target.targetElements];r||h.push(this._hoverContainer);let d=this._register(new R_(h));if(this._register(d.onMouseOut(()=>{this._isLocked||this.dispose()})),r){let e=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new R_(e)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=d}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;let e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){let i=lN(this._hoverContainer,lI("div")),n=lk(this._hoverContainer,lI("div"));i.tabIndex=0,n.tabIndex=0,this._register(a6(n,"focus",t=>{e.focus(),t.preventDefault()})),this._register(a6(i,"focus",e=>{t.focus(),e.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t<e.childNodes.length;t++){let i=e.childNodes.item(e.childNodes.length-t-1);if(i.nodeType===i.ELEMENT_NODE&&"number"==typeof i.tabIndex&&i.tabIndex>=0)return i;let n=this.findLastFocusableChild(i);if(n)return n}}render(e){var t,i;e.appendChild(this._hoverContainer);let n=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&(t=!0===this._configurationService.getValue("accessibility.verbosity.hover")&&this._accessibilityService.isScreenReaderOptimized(),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView")?.getAr
211iaLabel(),t&&i?(0,rh.NC)(7,"Inspect this in the accessible view with {0}.",i):t?(0,rh.NC)(8,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):"");n&&mi(n),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";let e=e=>{let t=lr(e),i=e.getBoundingClientRect();return{top:i.top*t,bottom:i.bottom*t,right:i.right*t,left:i.left*t}},{top:t,right:i,bottom:n,left:s}=this._target.targetElements.map(t=>e(t))[0],r=i-s,o=n-t,a={top:t,right:i,bottom:n,left:s,width:r,height:o,center:{x:s+r/2,y:t+o/2}};if(this.adjustHorizontalHoverPosition(a),this.adjustVerticalHoverPosition(a),this.adjustHoverMaxHeight(a),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:a.left+=3,a.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:a.left-=3,a.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:a.top+=3,a.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:a.top-=3,a.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px"}a.center.x=a.left+r/2,a.center.y=a.top+o/2}this.computeXCordinate(a),this.computeYCordinate(a),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(a)),this._hover.onContentsChanged()}computeXCordinate(e){let t=this._hover.containerDomNode.clientWidth+2;void 0!==this._target.x?this._x=this._target.x:1===this._hoverPosition?this._x=e.right:0===this._hoverPosition?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._x<this._targetDocumentElement.clientLeft&&(this._x=e.left+2)}computeYCordinate(e){void 0!==this._target.y?this._y=this._target.y:3===this._hoverPosition?this._y=e.top:2===this._hoverPosition?this._y=e.bottom-2:this._hoverPointer?this._y=e.center.y+this._hover.containerDomNode.clientHeight/2:this._y=e.bottom,this._y>this._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(void 0!==this._target.x)return;let t=this._hoverPointer?3:0;if(this._forcePosition){let i=t+2;1===this._hoverPosition?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:0===this._hoverPosition&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}1===this._hoverPosition?this._targetDocumentElement.clientWidth-e.right<this._hover.containerDomNode.clientWidth+t&&(e.left>=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):0===this._hoverPosition&&(e.left<this._hover.containerDomNode.clientWidth+t&&(this._targetDocumentElement.clientWidth-e.right>=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(void 0!==this._target.y||this._forcePosition)return;let t=this._hoverPointer?3:0;3===this._hoverPosition?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):2===this._hoverPosition&&e.bottom+this._hover.containerDomNode.offsetHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight*this._maxHeightRatioRelativeToWindow;if(this._forcePosition){let i=(this._hoverPointer?3:0)+2;3===this._hoverPosition?t=Math.min(t,e.top-i):2===this._hoverPosition&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeight<this._hover.contentsDomNode.scrollHeight){let e=`${this._hover.scrollbar.options.verticalScrollbarSize}px`;this._hover.contentsDomNode.style.paddingRight!==e&&(this._hover.contentsDomNode.style.paddingRight=e)}}setHoverPointerPosition(e){if(this._hoverPointer)switch(this._hoverPosition){case 0:case 1:{this._hoverPointer.classList.add(0===this._hoverPosition?"right":"left");let t=this._hover.containerDomNode.clientHeight;t>
211e.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(3===this._hoverPosition?"bottom":"top");let t=Math.round(this._hover.containerDomNode.clientWidth/2)-3,i=this._x+t;(i<e.left||i>e.right)&&(t=e.center.x-this._x-3),this._hoverPointer.style.left=`${t}px`}}}focus(){this._hover.containerDomNode.focus()}dispose(){this._isDisposed||(this._onDispose.fire(),this._target.dispose?.(),this._hoverContainer.remove(),this._messageListeners.dispose(),super.dispose()),this._isDisposed=!0}};Rp=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Rm(1,SP),Rm(2,uE),Rm(3,Rc),Rm(4,mg)],Rp);class R_ extends vQ{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e,t=200){for(let i of(super(),this._elements=e,this._eventDebounceDelay=t,this._isMouseIn=!0,this._mouseTimer=this._register(new ro.XK),this._onMouseOut=this._register(new sd.Q5),this._elements))this.onmouseover(i,()=>this._onTargetMouseOver()),this.onmouseleave(i,()=>this._onTargetMouseLeave())}_onTargetMouseOver(){this._isMouseIn=!0,this._mouseTimer.clear()}_onTargetMouseLeave(){this._isMouseIn=!1,this._mouseTimer.value=new oz(()=>this._fireIfMouseOutside(),this._eventDebounceDelay)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class Rv{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}function Rb(e,t,i){let n=i.mode===ny.ALIGN?i.offset:i.offset+i.size,s=i.mode===ny.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=s?s-t:Math.max(e-t,0):t<=s?s-t:t<=e-n?n:0}!function(e){function t(e,t){if(e.start>=t.end||t.start>=e.end)return{start:0,end:0};let i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){let n=[],s={start:e.start,end:Math.min(t.start,e.end)},r={start:Math.max(t.end,e.start),end:e.end};return i(s)||n.push(s),i(r)||n.push(r),n}}(nw||(nw={})),i(35204),(tt=ny||(ny={}))[tt.AVOID=0]="AVOID",tt[tt.ALIGN=1]="ALIGN";class RC extends ro.JT{static{this.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"]}static{this.BUBBLE_DOWN_EVENTS=["click"]}constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=ro.JT.None,this.toDisposeOnSetContainer=ro.JT.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=lI(".context-view"),lR(this.view),this.setContainer(e,t),this._register((0,ro.OF)(()=>this.setContainer(null,1)))}setContainer(e,t){this.useFixedPosition=1!==t;let i=this.useShadowDOM;if(this.useShadowDOM=3===t,(e!==this.container||i!==this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,this.shadowRootHostElement?.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=lI(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});let e=document.createElement("style");e.textContent=Rw,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(lI("slot"))}else this.container.appendChild(this.view);let t=new ro.SL;RC.BUBBLE_UP_EVENTS.forEach(e=>{t.add(a7(this.container,e,e=>{this.onDOMEvent(e,!1)}))}),RC.BUBBLE_DOWN_EVENTS.forEach(e=>{t.add(a7(this.container,e,e=>{this.onDOMEvent(e,!0)},!0))}),this.toDisposeOnSetContainer=t}}show(e){this.isVisible()&&this.hide(),a5(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",lM(this.view),this.toDisposeOnClean=e.render(this.view)||ro.JT.None,this.delegate=e,this.doLayout(),this.delegate.focus?.()}getViewElement(){return this.view}layout(){if(this.isVisible()){if(!1===this.delegate.canRelayout&&!(sS.gn&&op.pointerEvents)){this.hide();return}this.delegate?.layout?.(),this.doLayout()}}doLayout(){let e,t,i;if(!this.isVisible())return;let n=this.delegate.getAnchor();if(l_(n)){let t=ls(n),i=lr(n);
211e={top:t.top*i,left:t.left*i,width:t.width*i,height:t.height*i}}else e=n&&"number"==typeof n.x&&"number"==typeof n.y?{top:n.y,left:n.x,width:n.width||1,height:n.height||2}:{top:n.posy,left:n.posx,width:2,height:2};let s=lo(this.view),r=ll(this.view),o=this.delegate.anchorPosition??0,a=this.delegate.anchorAlignment??0,l=this.delegate.anchorAxisAlignment??0,h=lm();if(0===l){let n={offset:e.top-h.pageYOffset,size:e.height,position:0===o?0:1},l={offset:e.left,size:e.width,position:0===a?0:1,mode:ny.ALIGN};t=Rb(h.innerHeight,r,n)+h.pageYOffset,nw.intersects({start:t,end:t+r},{start:n.offset,end:n.offset+n.size})&&(l.mode=ny.AVOID),i=Rb(h.innerWidth,s,l)}else{let n={offset:e.left,size:e.width,position:0===a?0:1},l={offset:e.top,size:e.height,position:0===o?0:1,mode:ny.ALIGN};i=Rb(h.innerWidth,s,n),nw.intersects({start:i,end:i+s},{start:n.offset,end:n.offset+n.size})&&(l.mode=ny.AVOID),t=Rb(h.innerHeight,r,l)+h.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===o?"bottom":"top"),this.view.classList.add(0===a?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);let d=ls(this.container),u=this.container.scrollTop||0,c=this.container.scrollLeft||0;this.view.style.top=`${t-(this.useFixedPosition?ls(this.view).top:d.top)+u}px`,this.view.style.left=`${i-(this.useFixedPosition?ls(this.view).left:d.left)+c}px`,this.view.style.width="initial"}hide(e){let t=this.delegate;this.delegate=null,t?.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),lR(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,aG(e).document.activeElement):t&&!lh(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}let Rw=`
212	:host {
213		all: initial; /* 1st rule so subsequent properties are reset. */
214	}
215
216	.codicon[class*='codicon-'] {
217		font: normal normal normal 16px/1 codicon;
218		display: inline-block;
219		text-decoration: none;
220		text-rendering: auto;
221		text-align: center;
222		-webkit-font-smoothing: antialiased;
223		-moz-osx-font-smoothing: grayscale;
224		user-select: none;
225		-webkit-user-select: none;
226		-ms-user-select: none;
227	}
228
229	:host {
230		font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
231	}
232
233	:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
234	:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
235	:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
236	:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
237	:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Nanum Gothic", "AppleGothic", sans-serif; }
238
239	:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
240	:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
241	:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
242	:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
243	:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
244
245	:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
246	:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
247	:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
248	:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
249	:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
250`,Ry=class extends ro.JT{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new RC(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let n;n=t?t===this.layoutService.getContainer(aG(t))?1:i?3:2:1,this.contextView.setContainer(t??this.layoutService.activeContainer,n),this.contextView.show(e);let s={close:()=>{this.openContextView===s&&this.hideContextView()}};return this.openContextView=s,s}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};Ry=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){Eu(e,t,0)}],Ry);class RS extends Ry{getContextViewElement(){return this.contextView.getViewElement()}}function RL(e){return"object"==typeof e&&"markdown"in e&&"markdownNotSupportedFallback"in e}class Rx{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){let n;if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),!this.isDisposed){if((0,re.HD)(e)||l_(e)||void 0===e)n=e;else{let s;this._cancellationTokenSource=new sg;let r=this._cancellationTokenSource.token;if((s=RL(e)?(0,re.mf)(e.markdown)?e.markdown(r).then(t=>t??e.markdownNotSupportedFallback):e.markdown??e.markdownNotSupportedFallback:e.element(r))instanceof Promise?(this._hoverWidget||this.show((0,rh.NC)(1700,"Loading..."),t,i),n=await s):n=s,this.isDisposed||r.isCancellationRequested)return}this.show(n,t,i)}}show(e,t,i){let n=this._hoverWidget;if(this.hasContent(e)){let s={content:e,target:this.target,actions:i?.actions,linkHandler:i?.linkHandler,trapFocus:i?.trapFocus,appearance:{showPointer:"element"===this.hoverDelegate.placement,skipFadeInAnimation:!this.fadeInAnimation||!!n,showHoverHint:i?.appearance?.showH
250overHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(s,t)}n?.dispose()}hasContent(e){return!!e&&(!TZ(e)||!!e.value)}get isDisposed(){return this._hoverWidget?.isDisposed}dispose(){this._hoverWidget?.dispose(),this._cancellationTokenSource?.dispose(!0),this._cancellationTokenSource=void 0}}var Rk=function(e,t){return function(i,n){t(i,n,e)}};let RN=class extends ro.JT{constructor(e,t,i,n,s,r){super(),this._instantiationService=e,this._configurationService=t,this._keybindingService=n,this._layoutService=s,this._accessibilityService=r,this._currentDelayedHoverWasShown=!1,this._delayedHovers=new Map,this._managedHovers=new Map,this._register(i.onDidShowContextMenu(()=>this.hideHover())),this._contextViewHandler=this._register(new Ry(this._layoutService)),this._register(h6.registerCommandAndKeybindingRule({id:"workbench.action.showHover",weight:0,primary:sy(2089,2087),handler:()=>{this._showAndFocusHoverForActiveElement()}}))}showInstantHover(e,t,i,n){let s=this._createHover(e,i);if(s)return this._showHover(s,e,t),s}showDelayedHover(e,t){if(void 0===e.id&&(e.id=RE(e.content)),!this._currentDelayedHover||this._currentDelayedHoverWasShown){if(this._currentHover?.isLocked)return;if(RD(this._currentHoverOptions)===RD(e))return this._currentHover;if(this._currentHover&&!this._currentHover.isDisposed&&void 0!==this._currentDelayedHoverGroupId&&this._currentDelayedHoverGroupId===t?.groupId)return this.showInstantHover({...e,appearance:{...e.appearance,skipFadeInAnimation:!0}})}else if(this._currentDelayedHover&&RD(this._currentHoverOptions)===RD(e))return this._currentDelayedHover;let i=this._createHover(e,void 0);if(!i){this._currentDelayedHover=void 0,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=void 0;return}return this._currentDelayedHover=i,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=t?.groupId,oV(this._configurationService.getValue("workbench.hover.delay")).then(()=>{i&&!i.isDisposed&&(this._currentDelayedHoverWasShown=!0,this._showHover(i,e))}),i}setupDelayedHover(e,t,i){return this._setupDelayedHover(e,()=>({..."function"==typeof t?t():t,target:e}),i)}setupDelayedHoverAtMouse(e,t,i){return this._setupDelayedHover(e,i=>({..."function"==typeof t?t():t,target:{targetElements:[e],x:void 0!==i?i.x+10:void 0}}),i)}_setupDelayedHover(e,t,i){let n=new ro.SL;return n.add(a6(e,ly.MOUSE_OVER,e=>{this.showDelayedHover(t(e),{groupId:i?.groupId})})),i?.setupKeyboardEvents&&n.add(a6(e,ly.KEY_DOWN,e=>{let i=new ok(e);(i.equals(10)||i.equals(3))&&this.showInstantHover(t(),!0)})),this._delayedHovers.set(e,{show:e=>{this.showInstantHover(t(),e)}}),n.add((0,ro.OF)(()=>this._delayedHovers.delete(e))),n}_createHover(e,t){if(this._currentDelayedHover=void 0,""===e.content||this._currentHover?.isLocked||(void 0===e.id&&(e.id=RE(e.content)),RD(this._currentHoverOptions)===RD(e)))return;this._currentHoverOptions=e,this._lastHoverOptions=e;let i=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),n=lg();t||(i&&n?n.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=n):this._lastFocusedElementBeforeOpen=void 0);let s=new ro.SL,r=this._instantiationService.createInstance(Rp,e);if(e.persistence?.sticky&&(r.isLocked=!0),e.position?.hoverPosition&&!(0,re.hj)(e.position.hoverPosition)&&(e.target={targetElements:l_(e.target)?[e.target]:e.target.targetElements,x:e.position.hoverPosition.x+10}),r.onDispose(()=>{var t;this._currentHover?.domNode&&(t=this._currentHover.domNode,lh(lg(),t))&&this._lastFocusedElementBeforeOpen?.focus(),RD(this._currentHoverOptions)===RD(e)&&this.doHideHover(),s.dispose()},void 0,s),!e.container){let t=l_(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(aG(t))}if(r.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,s),e.persistence?.sticky)s.add(a6(aG(e.container).document,ly.MOUSE_DOWN,e=>{lh(e.target,r.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(let t of e.target.targetElements)s.add(a6(t,ly.CLICK,()=>this.hideHover()));
250else s.add(a6(e.target,ly.CLICK,()=>this.hideHover()));let t=lg();if(t){let i=aG(t).document;s.add(a6(t,ly.KEY_DOWN,t=>this._keyDown(t,r,!!e.persistence?.hideOnKeyDown))),s.add(a6(i,ly.KEY_DOWN,t=>this._keyDown(t,r,!!e.persistence?.hideOnKeyDown))),s.add(a6(t,ly.KEY_UP,e=>this._keyUp(e,r))),s.add(a6(i,ly.KEY_UP,e=>this._keyUp(e,r)))}}if("IntersectionObserver"in rb){let t=new IntersectionObserver(e=>this._intersectionChange(e,r),{threshold:0}),i="targetElements"in e.target?e.target.targetElements[0]:e.target;t.observe(i),s.add((0,ro.OF)(()=>t.disconnect()))}return this._currentHover=r,r}_showHover(e,t,i){this._contextViewHandler.showContextView(new RI(e,i),t.container)}hideHover(e){!(!e&&this._currentHover?.isLocked)&&this._currentHoverOptions&&this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showInstantHover(this._lastHoverOptions,!0,!0)}_showAndFocusHoverForActiveElement(){let e=lg();for(;e;){let t=this._delayedHovers.get(e)??this._managedHovers.get(e);if(t){t.show(!0);return}e=e.parentElement}}_keyDown(e,t,i){if("Alt"===e.key){t.isLocked=!0;return}let n=new ok(e);this._keybindingService.resolveKeyboardEvent(n).getSingleModifierDispatchChords().some(e=>!!e)||0!==this._keybindingService.softDispatch(n,n.target).kind||!i||this._currentHoverOptions?.trapFocus&&"Tab"===e.key||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus())}_keyUp(e,t){"Alt"!==e.key||(t.isLocked=!1,t.isMouseIn||(this.hideHover(),this._lastFocusedElementBeforeOpen?.focus()))}setupManagedHover(e,t,i,n){let s,r;if(e.showNativeHover)return function(e,t){function i(t){t?e.setAttribute("title",t):e.removeAttribute("title")}return i(RT(t)),{update:e=>i(RT(e)),show:()=>{},hide:()=>{},dispose:()=>i(void 0)}}(t,i);t.setAttribute("custom-hover","true"),""!==t.title&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let o=(t,i)=>{let n=void 0!==r;t&&(r?.dispose(),r=void 0),i&&(s?.dispose(),s=void 0),n&&(e.onDidHideHover?.(),r=void 0)},a=(s,o,a,l)=>new oz(async()=>{(!r||r.isDisposed)&&(r=new Rx(e,a||t,s>0),await r.update("function"==typeof i?i():i,o,{...n,trapFocus:l}))},s),l=new ro.SL,h=!1;l.add(a6(t,ly.MOUSE_DOWN,()=>{h=!0,o(!0,!0)},!0)),l.add(a6(t,ly.MOUSE_UP,()=>{h=!1},!0)),l.add(a6(t,ly.MOUSE_LEAVE,e=>{h=!1,o(!1,e.fromElement===t)},!0)),l.add(a6(t,ly.MOUSE_OVER,n=>{if(s)return;let r=new ro.SL,l={targetElements:[t],dispose:()=>{}};(void 0===e.placement||"mouse"===e.placement)&&r.add(a6(t,ly.MOUSE_MOVE,e=>{l.x=e.x+10,RM(e,t)||o(!0,!0)},!0)),s=r,RM(n,t)&&r.add(a("function"==typeof e.delay?e.delay(i):e.delay,!1,l))},!0)),lH(t)||l.add(a6(t,ly.FOCUS,n=>{if(h||s||!RM(n,t))return;let r=new ro.SL;r.add(a6(t,ly.BLUR,()=>o(!0,!0),!0)),r.add(a("function"==typeof e.delay?e.delay(i):e.delay,!1,{targetElements:[t],dispose:()=>{}})),s=r},!0));let d={show:e=>{o(!1,!0),a(0,e,void 0,e)},hide:()=>{o(!0,!0)},update:async(e,t)=>{i=e,await r?.update(i,void 0,t)},dispose:()=>{this._managedHovers.delete(t),l.dispose(),o(!0,!0)}};return this._managedHovers.set(t,d),d}showManagedHover(e){let t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};function RD(e){if(void 0!==e)return e?.id??e}function RE(e){return l_(e)?void 0:"string"==typeof e?e.toString():e.value}function RT(e){let t="function"==typeof e?e():e;return(0,re.HD)(t)?Tj(t):RL(t)?t.markdownNotSupportedFallback:void 0}RN=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Rk(0,he),Rk(1,uE),Rk(2,Tu),Rk(3,SP),Rk(4,Eu),Rk(5,mg)],RN);class RI{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function RM(e,t){return l_(e.target)&&function(e,t){for(t=t??aG(e).document.body;!e.hasAttribute("custom-hover")&&e!==t;)e=e.parentElement;return e}(e.target,t)===t}uP(Tl,RN,1),CX((e,t)=>{let i=e.getColor(ph);
250i&&(t.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${i.transparent(.5)}; }`))});let RR={ctrlCmd:!1,alt:!1};(ti=nS||(nS={}))[ti.Blur=1]="Blur",ti[ti.Gesture=2]="Gesture",ti[ti.Other=3]="Other",(tn=nL||(nL={}))[tn.NONE=0]="NONE",tn[tn.FIRST=1]="FIRST",tn[tn.SECOND=2]="SECOND",tn[tn.LAST=3]="LAST",(ts=nx||(nx={}))[ts.First=1]="First",ts[ts.Second=2]="Second",ts[ts.Last=3]="Last",ts[ts.Next=4]="Next",ts[ts.Previous=5]="Previous",ts[ts.NextPage=6]="NextPage",ts[ts.PreviousPage=7]="PreviousPage",ts[ts.NextSeparator=8]="NextSeparator",ts[ts.PreviousSeparator=9]="PreviousSeparator",(tr=nk||(nk={}))[tr.Title=1]="Title",tr[tr.Inline=2]="Inline",tr[tr.Input=3]="Input";let RA=ht("quickInputService");(to=nN||(nN={}))[to.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",to[to.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY",(ta=nD||(nD={}))[ta.None=0]="None",ta[ta.Initialized=1]="Initialized",ta[ta.Closed=2]="Closed";class RO extends ro.JT{static{this.DEFAULT_FLUSH_DELAY=100}constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new sd.K3),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=nD.None,this.cache=new Map,this.flushDelayer=this._register(new oB(RO.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((e,t)=>this.acceptExternal(t,e)),e.deleted?.forEach(e=>this.acceptExternal(e,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===nD.Closed)return;let i=!1;(0,re.Jp)(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){let i=this.cache.get(e);return(0,re.Jp)(i)?t:i}getBoolean(e,t){let i=this.get(e);return(0,re.Jp)(i)?t:"true"===i}getNumber(e,t){let i=this.get(e);return(0,re.Jp)(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===nD.Closed)return;if((0,re.Jp)(t))return this.delete(e,i);let n=(0,re.Kn)(t)||Array.isArray(t)?JSON.stringify(t,I5):String(t);if(this.cache.get(e)!==n)return this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(this.state!==nD.Closed&&this.cache.delete(e))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;let e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(this.state!==nD.Closed&&!this.pendingClose)return this.doFlush(e)}async doFlush(e){return this.options.hint===nN.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}}class RP{constructor(){this.onDidChangeItemsExternal=sd.ju.None,this.items=new Map}async updateItems(e){e.insert?.forEach((e,t)=>this.items.set(t,e)),e.delete?.forEach(e=>this.items.delete(e))}}let RF="__$__targetStorageMarker",RB=ht("storageService");(tl=nE||(nE={}))[tl.NONE=0]="NONE",tl[tl.SHUTDOWN=1]="SHUTDOWN";class RV extends ro.JT{static{this.DEFAULT_FLUSH_INTERVAL=6e4}constructor(e={flushInterval:RV.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new sd.K3),this._onDidChangeTarget=this._register(new sd.K3),this._onWillSaveState=this._register(new sd.Q5),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new ro.XK),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler
250=this._register(new oK(()=>this.doFlushWhenIdle(),e.flushInterval))}onDidChangeValue(e,t,i){return sd.ju.filter(this._onDidChangeValue.event,i=>i.scope===e&&(void 0===t||i.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=s(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}emitDidChangeValue(e,t){let{key:i,external:n}=t;if(i===RF){switch(e){case -1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}store(e,t,i,n,s=!1){if((0,re.Jp)(t)){this.remove(e,i,s);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,n),this.getStorage(i)?.set(e,t,s)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,n=!1){let s=this.getKeyTargets(t);"number"==typeof i?s[e]!==i&&(s[e]=i,this.getStorage(t)?.set(RF,JSON.stringify(s),n)):"number"==typeof s[e]&&(delete s[e],this.getStorage(t)?.set(RF,JSON.stringify(s),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case -1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){let t=this.getStorage(e);return t?function(e){let t=e.get(RF);if(t)try{return JSON.parse(t)}catch(e){}return Object.create(null)}(t):Object.create(null)}async flush(e=nE.NONE){this._onWillSaveState.fire({reason:e});let t=this.getStorage(-1),i=this.getStorage(0),n=this.getStorage(1);switch(e){case nE.NONE:await iR.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve()]);break;case nE.SHUTDOWN:await iR.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve()])}}}class RW extends RV{constructor(){super(),this.applicationStorage=this._register(new RO(new RP,{hint:nN.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new RO(new RP,{hint:nN.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new RO(new RP,{hint:nN.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case -1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}shouldFlushWhenIdle(){return!1}}var RH=function(e,t){return function(i,n){t(i,n,e)}};let Rz=ht("IInlineCompletionsService"),RU=new hJ("inlineCompletions.snoozed",!1,(0,rh.NC)(79,"Whether inline completions are currently snoozed")),RK=class extends ro.JT{get snoozeTimeLeft(){return void 0===this._snoozeTimeEnd?0:Math.max(0,this._snoozeTimeEnd-Date.now())}constructor(e,t){super(),this._contextKeyService=e,this._telemetryService=t,this._onDidChangeIsSnoozing=this._register(new sd.Q5),this.onDidChangeIsSnoozing=this._onDidChangeIsSnoozing.event,this._snoozeTimeEnd=void 0,this._recentCompletionIds=[],this._timer=this._register(new oz);let i=RU.bindTo(this._contextKeyService);this._register(this.onDidChangeIsSnoozing(()=>i.set(this.isSnoozing())))}setSnoozeDuration(e){if(e<0)throw new o_.he(`Invalid snooze duration: ${e}. Duration must be non-negative.`);if(0===e){this.cancelSnooze();return}let t=this.isSnoozing(),i=this.snoozeTimeLeft;this._snoozeTimeEnd=Date.now()+e,t||this._onDidChangeIsSnoozing.fire(!0),this._timer.cancelAndSet(()=>{if(this.isSnoozing())throw new o_.he("Snooze timer did not fire as expected");this._onDidChangeIsSnoozing.fire(!1)},this.snoozeTimeLeft+1),this._reportSnooze(e-i,e)}isSnoozing(){return this.snoozeTimeLeft>0}cancelSnooze(){this.isSnoozing()&&(this._reportSnooze(-this.snoozeTimeLeft,0),this._snoozeTimeEnd=void 0,this._timer.cancel(),this._onDidChangeIsSnoozing.fire(!1))}reportNewCompletion(e){this._lastCompletionId=e,this._recentCompletionIds.unshift(e),this._recentCompletionIds.length>5&&this._recentCompletionIds.pop()}_reportSnooze(e,t){this._telemetryService.publicLog2("inlineCompletions.snooze",{deltaSeconds:Math.round(e/1e3),totalSeconds:Math.round(t/1e3),lastCompletionId:this._lastCompletionId,recentCompletionIds:this._recentCompletionIds})}};uP(Rz,RK=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([RH(0,hZ),RH(1,da)],RK),1);let R$="inlineCompletions.lastSnoozeDuration";class Rj extends dr{static{this.ID="editor.action.inlineSuggest.snooze"}constructor(){super({id:Rj.ID,title:(0,rh.vv)(81,"Snooze Inline Suggestions"),precondition:hI.true(),f1:!0})}async run(e,...t){let i;let n=e.get(RA),s=e.get(Rz),r=e.get(RB);t.length>0&&"number"==typeof t[0]&&(i=6e4*t[0]),i||(i=await this.getDurationFromUser(n,r)),i&&s.setSnoozeDuration(i)}async getDurationFromUser(e,t){let i=t.getNumber(R$,0,3e5),n=[{label:"1 minute",id:"1",value:6e4},{label:"5 minutes",id:"5",value:3e5},{label:"10 minutes",id:"10",value:6e5},{label:"15 minutes",id:"15",value:9e5},{label:"30 minutes",id:"30",value:18e5},{label:"60 minutes",id:"60",value:36e5}],s=await e.pick(n,{placeHolder:(0,rh.NC)(80,"Select snooze duration for Inline Suggestions"),activeItem:n.find(e=>e.value===i)});if(s)return t.store(R$,s.value,0,0),s.value}}class Rq extends dr{static{this.ID="editor.action.inlineSuggest.cancelSnooze"}constructor(){super({id:Rq.ID,title:(0,rh.vv)(82,"Cancel Snooze Inline Suggestions"),precondition:RU,f1:!0})}async run(e){e.get(Rz).cancelSnooze()}}let RG=ht("IWorkspaceEditService");class RQ{constructor(e){this.metadata=e}static convert(e){return e.edits.map(e=>{if(RY.is(e))return RY.lift(e);if(RJ.is(e))return RJ.lift(e);throw Error("Unsupported edit")})}}class RY extends RQ{static is(e){return e instanceof RY||(0,re.Kn)(e)&&sJ.isUri(e.resource)&&(0,re.Kn)(e.textEdit)}static lift(e){return e instanceof RY?e:new RY(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i,n){super(n),this.resource=e,this.textEdit=t,this.versionId=i}}class RJ extends RQ{static is(e){return e instanceof RJ||(0,re.Kn)(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof RJ?e:new RJ(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},n){super(n),this.oldResource=e,this.newResource=t,this.options=i}}let RZ={enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1}
250,hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1},RX={...Object.freeze({id:"editor",order:5,type:"object",title:(0,rh.NC)(147,"Editor"),scope:6}),properties:{"editor.tabSize":{type:"number",default:LI.D.tabSize,minimum:1,maximum:100,markdownDescription:(0,rh.NC)(148,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:(0,rh.NC)(149,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:LI.D.insertSpaces,markdownDescription:(0,rh.NC)(150,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:LI.D.detectIndentation,markdownDescription:(0,rh.NC)(151,"Controls whether {0} and {1}
250 will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:LI.D.trimAutoWhitespace,description:(0,rh.NC)(152,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:LI.D.largeFileOptimizations,description:(0,rh.NC)(153,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[(0,rh.NC)(154,"Turn off Word Based Suggestions."),(0,rh.NC)(155,"Only suggest words from the active document."),(0,rh.NC)(156,"Suggest words from all open documents of the same language."),(0,rh.NC)(157,"Suggest words from all open documents.")],description:(0,rh.NC)(158,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[(0,rh.NC)(159,"Semantic highlighting enabled for all color themes."),(0,rh.NC)(160,"Semantic highlighting disabled for all color themes."),(0,rh.NC)(161,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:(0,rh.NC)(162,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:(0,rh.NC)(163,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:(0,rh.NC)(164,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:(0,rh.NC)(165,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:(0,rh.NC)(166,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:(0,rh.NC)(167,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:(0,rh.NC)(168,"Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.css":{type:"boolean",default:!1,markdownDescription:(0,rh.NC)(169,"Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.typescript":{type:"boolean",default:!1,markdownDescription:(0,rh.NC)(170,"Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.ini":{type:"boolean",default:!1,markdownDescription:(0,rh.NC)(171,"Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.regex":{type:"boolean",default:!1,markdownDescription:(0,rh.NC)(172,"Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."),tags:["experimental"],experiment:{mode:"auto"}},"editor.language.brackets":{type:["array","null"],default:null,description:(0,rh.NC)(173,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:(0,rh.NC)(174,"The opening bracket character or string sequence.")},{type:"string",description:(0,rh.NC)(175,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:(0,rh.NC)(176,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:(0,rh.NC)(177,"The opening bracket character or string sequence.")},{type:"string",description:(0,rh.NC)(178,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:RZ.maxComputationTime,description:(0,rh.NC)(179,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:RZ.maxFileSize,de
250scription:(0,rh.NC)(180,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:RZ.renderSideBySide,description:(0,rh.NC)(181,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:RZ.renderSideBySideInlineBreakpoint,description:(0,rh.NC)(182,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:RZ.useInlineViewWhenSpaceIsLimited,description:(0,rh.NC)(183,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:RZ.renderMarginRevertIcon,description:(0,rh.NC)(184,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:RZ.renderGutterMenu,description:(0,rh.NC)(185,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:RZ.ignoreTrimWhitespace,description:(0,rh.NC)(186,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:RZ.renderIndicators,description:(0,rh.NC)(187,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:RZ.diffCodeLens,description:(0,rh.NC)(188,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:RZ.diffWordWrap,markdownEnumDescriptions:[(0,rh.NC)(189,"Lines will never wrap."),(0,rh.NC)(190,"Lines will wrap at the viewport width."),(0,rh.NC)(191,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:RZ.diffAlgorithm,markdownEnumDescriptions:[(0,rh.NC)(192,"Uses the legacy diffing algorithm."),(0,rh.NC)(193,"Uses the advanced diffing algorithm.")]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:RZ.hideUnchangedRegions.enabled,markdownDescription:(0,rh.NC)(194,"Controls whether the diff editor shows unchanged regi
250ons.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:RZ.hideUnchangedRegions.revealLineCount,markdownDescription:(0,rh.NC)(195,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:RZ.hideUnchangedRegions.minimumLineCount,markdownDescription:(0,rh.NC)(196,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:RZ.hideUnchangedRegions.contextLineCount,markdownDescription:(0,rh.NC)(197,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:RZ.experimental.showMoves,markdownDescription:(0,rh.NC)(198,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:RZ.experimental.showEmptyDecorations,description:(0,rh.NC)(199,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:RZ.experimental.useTrueInlineView,description:(0,rh.NC)(200,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};for(let e of sh.Bc){let t=e.schema;if(void 0!==t){if(void 0!==t.type||void 0!==t.anyOf)RX.properties[`editor.${e.name}`]=t;else for(let e in t)Object.hasOwnProperty.call(t,e)&&(RX.properties[e]=t[e])}}let R1=null;function R0(){return null===R1&&(R1=Object.create(null),Object.keys(RX.properties).forEach(e=>{R1[e]=!0})),R1}h5.as(uU).registerConfiguration(RX);class R2{static insert(e,t){return{range:new s9(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function R5(e){return Object.isFrozen(e)?e:(0,cI._A)(e)}class R4{static createEmptyModel(e){return new R4({},[],[],void 0,e)}constructor(e,t,i,n,s){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.logService=s,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration){if(this.raw){let e=(Array.isArray(this.raw)?this.raw:[this.raw]).map(e=>{if(e instanceof R4)return e;let t=new R6("",this.logService);return t.parseRaw(e),t.configurationModel});this._rawConfiguration=e.reduce((e,t)=>t===e?t:e.merge(t),e[0])}else this._rawConfiguration=this}return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?uM(this.contents,e):this.contents}inspect(e,t){let i=this;return{get value(){return R5(i.rawConfiguration.getValue(e))},get override(){return t?R5(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return R5(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){let t=[];for(let{contents:n,identifiers:s,keys:r}of i.rawConfiguration.overrides){let o=new R4(n,r,[],void 0,i.logService).getValue(e);void 0!==o&&t.push({identifiers:s,value:o})}return t.length?R5(t):void 0}}}getOverrideValue(e,t){let i=this.getContentsForOverrideIdentifer(t);return i?e?uM(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){let t=(0,cI.I8)(this.contents),i=(0,cI.I8)(this.overrides),n=[...this.keys],s=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(let r of e)if(s.push(...r.raw?Array.isArray(r.raw)?r.raw:[r.raw]:[r]),!r.isEmpty()){for(let e of(this.mergeContents(t,r.contents),r.overrides)){let[t]=i.filter(t=>(0,as.fS)(t.identifiers,e.identifiers));t?(this.mergeContents(t.contents,e.contents),t.keys.push(...e.keys),t.keys=(0,as.EB)(t.keys)):i.push((0,cI.I8)(e))}for(let e of r.keys)-1===n.indexOf(e)&&n.push(e)}return new R4(t,n,i,!s.length||s.every(e=>e instanceof R4)?void 0:s,this.logService)}createOverrideConfigurationModel(e){let t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;let i={};for(let e of(0,as.EB)([...Object.keys(this.contents),...Object.keys(t)])){let n=this.contents[e],s=t[e];s&&("object"==typeof n&&"object"==typeof s?(n=(0,cI.I8)(n),this.mergeContents(n,s)):n=s),i[e]=n}return new R4(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(let i of Object.keys(t)){if(i in e&&(0,re.Kn)(e[i])&&(0,re.Kn)(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=(0,cI.I8)(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null,n=e=>{e&&(i?this.mergeContents(i,e):i=(0,cI.I8)(e))};for(let i of this.overrides)1===i.identifiers.length&&i.identifiers[0]===e?t=i.contents:i.identifiers.includes(e)&&n(i.contents);return n(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}
250setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){let t=this.keys.indexOf(e);-1!==t&&(this.keys.splice(t,1),function e(t,i){if(!t)return;let n=i.shift();if(0===i.length){delete t[n];return}if(-1!==Object.keys(t).indexOf(n)){let s=t[n];"object"!=typeof s||Array.isArray(s)||(e(s,i),0!==Object.keys(s).length||delete t[n])}}(this.contents,e.split(".")),uQ.test(e)&&this.overrides.splice(this.overrides.findIndex(t=>(0,as.fS)(t.identifiers,uY(e))),1))}updateValue(e,t,i){if(uI(this.contents,e,t,e=>this.logService.error(e)),(i=i||-1===this.keys.indexOf(e))&&this.keys.push(e),uQ.test(e)){let t=uY(e),i={identifiers:t,keys:Object.keys(this.contents[e]),contents:uT(this.contents[e],e=>this.logService.error(e))},n=this.overrides.findIndex(e=>(0,as.fS)(e.identifiers,t));-1!==n?this.overrides[n]=i:this.overrides.push(i)}}}class R6{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||R4.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;let{contents:i,keys:n,overrides:s,restricted:r,hasExcludedProperties:o}=this.doParseRaw(e,t);this._configurationModel=new R4(i,n,s,o?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseRaw(e,t){let i=h5.as(uU),n=i.getConfigurationProperties(),s=i.getExcludedConfigurationProperties(),r=this.filter(e,n,s,!0,t);return{contents:uT(e=r.raw,e=>this.logService.error(`Conflict in settings file ${this._name}: ${e}`)),keys:Object.keys(e),overrides:this.toOverrides(e,e=>this.logService.error(`Conflict in settings file ${this._name}: ${e}`)),restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,i,n,s){let r=!1;if(!s?.scopes&&!s?.skipRestricted&&!s?.skipUnregistered&&!s?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:r};let o={},a=[];for(let l in e)if(uQ.test(l)&&n){let n=this.filter(e[l],t,i,!1,s);o[l]=n.raw,r=r||n.hasExcludedProperties,a.push(...n.restricted)}else{let n=t[l];n?.restricted&&a.push(l),this.shouldInclude(l,n,i,s)?o[l]=e[l]:r=!0}return{raw:o,restricted:a,hasExcludedProperties:r}}shouldInclude(e,t,i,n){if(n.exclude?.includes(e))return!1;if(n.include?.includes(e))return!0;if(n.skipRestricted&&t?.restricted||n.skipUnregistered&&!t)return!1;let s=t??i[e],r=s?void 0!==s.scope?s.scope:4:void 0;return void 0===r||void 0===n.scopes||n.scopes.includes(r)}toOverrides(e,t){let i=[];for(let n of Object.keys(e))if(uQ.test(n)){let s={};for(let t in e[n])s[t]=e[n][t];i.push({identifiers:uY(n),keys:Object.keys(s),contents:uT(s,t)})}return i}}class R7{constructor(e,t,i,n,s,r,o,a,l,h,d,u,c){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=s,this.policyConfiguration=r,this.applicationConfiguration=o,this.userConfiguration=a,this.localUserConfiguration=l,this.remoteUserConfiguration=h,this.workspaceConfiguration=d,this.folderConfigurationModel=u,this.memoryConfigurationModel=c}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class R3{constructor(e,t,i,n,s,r,o,a,l,h){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=s,this._workspaceConfiguration=r,this._folderConfigurations=o,this._memoryConfiguration=a,this._memoryConfigurationByResource=l,this.logService=h,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new dh,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let n;i.resource?(n=this._memoryConfigurationByResource.get(i.resource))||(n=R4.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,n)):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){let n=this.getConsolidatedConfigurationModel(e,t,i),s=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,o=new Set;for(let t of n.overrides)for(let i of t.identifiers)void 0!==n.getOverrideValue(e,i)&&o.add(i);return new R7(e,t,n.getValue(e),o.size?[...o]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,s||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration){if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{let e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new R4(e.contents,e.keys,e.overrides,void 0,this.logService)}}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);if(t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&void 0!==this._policyConfiguration.getValue(e))for(let e of(n=n.merge
250(),this._policyConfiguration.keys))n.setValue(e,this._policyConfiguration.getValue(e));return n}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){let n=t.getFolder(e);n&&(i=this.getFolderConsolidatedConfiguration(n.uri)||i);let s=this._memoryConfigurationByResource.get(e);s&&(i=i.merge(s))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){let i=this.getWorkspaceConsolidatedConfiguration(),n=this._folderConfigurations.get(e);n?(t=i.merge(n),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){let i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{let{contents:i,overrides:n,keys:s}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:s}]),e},[])}}static parse(e,t){let i=this.parseConfigurationModel(e.defaults,t),n=this.parseConfigurationModel(e.policy,t),s=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.userLocal,t);return new R3(i,n,s,r,this.parseConfigurationModel(e.userRemote,t),this.parseConfigurationModel(e.workspace,t),e.folders.reduce((e,i)=>(e.set(sJ.revive(i[0]),this.parseConfigurationModel(i[1],t)),e),new dh),R4.createEmptyModel(t),new dh,t)}static parseConfigurationModel(e,t){return new R4(e.contents,e.keys,e.overrides,e.raw,t)}}class R9{constructor(e,t,i,n,s){for(let r of(this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this.logService=s,this._marker="\n",this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0,e.keys))this.affectedKeys.add(r);for(let[,t]of e.overrides)for(let e of t)this.affectedKeys.add(e);for(let e of(this._affectsConfigStr=this._marker,this.affectedKeys))this._affectsConfigStr+=e+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=R3.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){let i=this._marker+e,n=this._affectsConfigStr.indexOf(i);if(n<0)return!1;let s=n+i.length;if(s>=this._affectsConfigStr.length)return!1;let r=this._affectsConfigStr.charCodeAt(s);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){let i=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,n=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!(0,cI.fS)(i,n)}return!0}}let R8={kind:0},Ae={kind:1};class At{constructor(e,t,i){for(let t of(this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map,e)){let e=t.command;e&&"-"!==e.charAt(0)&&this._defaultBoundCommands.set(e,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=At.handleRemovals([].concat(e).concat(t));for(let e=0,t=this._keybindings.length;e<t;e++){let t=this._keybindings[e];if(0===t.chords.length)continue;let i=t.when?.substituteConstants();i&&0===i.type||this._addKeyPress(t.chords[0],t)}}static _isTargetedForRemoval(e,t,i){if(t){for(let i=0;i<t.length;i++)if(t[i]!==e.chords[i])return!1}return!i||1===i.type||!!e.when&&!!function(e,t){let i=e?e.substituteConstants():void 0,n=t?t.substituteConstants():void 0;return!i&&!n||!!i&&!!n&&i.equals(n)}(i,e.when)}static handleRemovals(e){let t=new Map;for(let i=0,n=e.length;i<n;i++){let n=e[i];if(n.command&&"-"===n.command.charAt(0)){let e=n.command.substring(1);t.has(e)?t.get(e).push(n):t.set(e,[n])}}if(0===t.size)return e;let i=[];for(let n=0,s=e.length;n<s;n++){let s=e[n];if(!s.command||0===s.command.length){i.push(s);continue}if("-"===s.command.charAt(0))continue;let r=t.get(s.command);if(!r||!s.isDefault){i.push(s);continue}let o=!1;for(let e of r){let t=e.when;if(this._isTargetedForRemoval(s,e.chords,t)){o=!0;break}}if(!o){i.push(s);continue}}return i}_addKeyPress(e,t){let i=this._map.get(e);if(void 0===i){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let e=i.length-1;e>=0;e--){let n=i[e];if(n.command===t.command)continue;let s=!0;for(let e=1;e<n.chords.length&&e<t.chords.length;e++)if(n.chords[e]!==t.chords[e]){s=!1;break}s&&At.whenIsEntirelyIncluded(n.when,t.when)&&this._removeFromLookupMap(n)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);void 0===t?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);if(void 0!==t){for(let i=0,n=t.length;i<n;i++)if(t[i]===e){t.splice(i,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||1===t.type||!!e&&1!==e.type&&function e(t,i){if(0===t.type||1===i.type)return!0;
250if(9===t.type)return 9===i.type&&h1(t.expr,i.expr);if(9===i.type){for(let n of i.expr)if(e(t,n))return!0;return!1}if(6===t.type){if(6===i.type)return h1(i.expr,t.expr);for(let n of t.expr)if(e(n,i))return!0;return!1}return t.equals(i)}(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t,i=!1){let n=this._lookupMap.get(e);if(void 0===n||0===n.length)return null;if(1===n.length&&!i)return n[0];for(let e=n.length-1;e>=0;e--){let i=n[e];if(t.contextMatchesRules(i.when))return i}return i?null:n[n.length-1]}resolve(e,t,i){let n=[...t,i];this._log(`| Resolving ${n}`);let s=this._map.get(n[0]);if(void 0===s)return this._log("\\ No keybinding entries."),R8;let r=null;if(n.length<2)r=s;else{r=[];for(let e=0,t=s.length;e<t;e++){let t=s[e];if(n.length>t.chords.length)continue;let i=!0;for(let e=1;e<n.length;e++)if(t.chords[e]!==n[e]){i=!1;break}i&&r.push(t)}}let o=this._findCommand(e,r);return o?n.length<o.chords.length?(this._log(`\\ From ${r.length} keybinding entries, awaiting ${o.chords.length-n.length} more chord(s), when: ${Ai(o.when)}, source: ${An(o)}.`),Ae):(this._log(`\\ From ${r.length} keybinding entries, matched ${o.command}, when: ${Ai(o.when)}, source: ${An(o)}.`),{kind:2,commandId:o.command,commandArgs:o.commandArgs,isBubble:o.bubble}):(this._log(`\\ From ${r.length} keybinding entries, no when clauses matched the context.`),R8)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){let n=t[i];if(At._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}}function Ai(e){return e?`${e.serialize()}`:"no when condition"}function An(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}let As=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class Ar extends ro.JT{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:sd.ju.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,s){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=s,this._onDidUpdateKeybindings=this._register(new sd.Q5),this._currentChords=[],this._currentChordChecker=new oU,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Ao.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new oz,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t,i=!1){let n=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService,i);if(n)return n.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");let i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),R8;let[n]=i.getDispatchChords();if(null===n)return this._log("\\ Keyboard event cannot be dispatched"),R8;let s=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:e})=>e);return this._getResolver().resolve(s,r,n)}_scheduleLeaveChordMode(){let e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw(0,o_.L6)("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status((0,rh.NC)(1701,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{let e=this._currentChords.map(({label:e})=>e).join(", ");this._currentChordStatusMessage=this._notificationService.status((0,rh.NC)(1702,"({0}) was pressed. Waiting for next key of chord...",e))}}this._scheduleLeaveChordMode(),SO.enabled&&SO.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.close(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],SO.enable()}
250_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){let i=this.resolveKeyboardEvent(e),[n]=i.getSingleModifierDispatchChords();if(n)return this._ignoreSingleModifiers.has(n)?(this._log(`+ Ignoring single modifier ${n} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=Ao.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Ao.EMPTY,null===this._currentSingleModifier)?(this._log(`+ Storing single modifier for possible chord ${n}.`),this._currentSingleModifier=n,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):n===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${n} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${n}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1);let[s]=i.getChords();return this._ignoreSingleModifiers=new Ao(s),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let n=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,r=null;if(i){let[t]=e.getSingleModifierDispatchChords();s=t,r=t?[t]:[]}else[s]=e.getDispatchChords(),r=this._currentChords.map(({keypress:e})=>e);if(null===s)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),n;let o=this._contextKeyService.getContext(t),a=e.getLabel(),l=this._getResolver().resolve(o,r,s);switch(l.kind){case 0:if(this._logService.trace("KeybindingService#dispatch",a,"[ No matching keybinding ]"),this.inChordMode){let e=this._currentChords.map(({label:e})=>e).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${e}, ${a}".`),this._notificationService.status((0,rh.NC)(1703,"The key combination ({0}, {1}) is not a command.",e,a),{hideAfter:1e4}),this._leaveChordMode(),n=!0}return n;case 1:return this._logService.trace("KeybindingService#dispatch",a,"[ Several keybindings match - more chords needed ]"),n=!0,this._expectAnotherChord(s,a),this._log(1===this._currentChords.length?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),n;case 2:if(this._logService.trace("KeybindingService#dispatch",a,`[ Will dispatch command ${l.commandId} ]`),null===l.commandId||""===l.commandId){if(this.inChordMode){let e=this._currentChords.map(({label:e})=>e).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${e}, ${a}".`),this._notificationService.status((0,rh.NC)(1704,"The key combination ({0}, {1}) is not a command.",e,a),{hideAfter:1e4}),this._leaveChordMode(),n=!0}}else{this.inChordMode&&this._leaveChordMode(),l.isBubble||(n=!0),this._log(`+ Invoking command ${l.commandId}.`),this._currentlyDispatchingCommandId=l.commandId;try{void 0===l.commandArgs?this._commandService.executeCommand(l.commandId).then(void 0,e=>this._notificationService.warn(e)):this._commandService.executeCommand(l.commandId,l.commandArgs).then(void 0,e=>this._notificationService.warn(e))}finally{this._currentlyDispatchingCommandId=null}As.test(l.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:l.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return n}}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class Ao{static{this.EMPTY=new Ao(null)}constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}class Aa{constructor(e,t,i,n,s,r,o){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?Al(e.getDispatchChords()):[],e&&0===this.chords.length&&(this.chords=Al(e.getSingleModifierDispatchChords())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=s,this.extensionId=r,this.isBuiltinExtension=o}}function Al(e){let t=[];for(let i=0,n=e.length;i<n;i++){let n=e[i];if(!n)return[];t.push(n)}return t}class Ah{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;let n=[];for(let s=0,r=t.length;s<r;s++){let r=t[s],o=i(r);if(null===o)return null;n[s]=function(e,t,i){if(null===t)return"";let n=[];return e.ctrlKey&&n.push(i.ctrlKey),e.shiftKey&&n.push(i.shiftKey),e.altKey&&n.push(i.altKey),e.metaKey&&n.push(i.metaKey),""!==t&&n.push(t),n.join(i.separator)}(r,o,this.modifierLabels[e])}return n.join(" ")}}let Ad=new Ah({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:(0,rh.NC)(35,"Ctrl"),shiftKey:(0,rh.NC)(36,"Shift"),altKey:(0,rh.NC)(37,"Alt"),metaKey:(0,rh.NC)(38,"Windows"),separator:"+"}
250,{ctrlKey:(0,rh.NC)(39,"Ctrl"),shiftKey:(0,rh.NC)(40,"Shift"),altKey:(0,rh.NC)(41,"Alt"),metaKey:(0,rh.NC)(42,"Super"),separator:"+"}),Au=new Ah({ctrlKey:(0,rh.NC)(43,"Control"),shiftKey:(0,rh.NC)(44,"Shift"),altKey:(0,rh.NC)(45,"Option"),metaKey:(0,rh.NC)(46,"Command"),separator:"+"},{ctrlKey:(0,rh.NC)(47,"Control"),shiftKey:(0,rh.NC)(48,"Shift"),altKey:(0,rh.NC)(49,"Alt"),metaKey:(0,rh.NC)(50,"Windows"),separator:"+"},{ctrlKey:(0,rh.NC)(51,"Control"),shiftKey:(0,rh.NC)(52,"Shift"),altKey:(0,rh.NC)(53,"Alt"),metaKey:(0,rh.NC)(54,"Super"),separator:"+"}),Ac=new Ah({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),Ag=new Ah({ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"cmd",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"win",separator:"+"},{ctrlKey:"ctrl",shiftKey:"shift",altKey:"alt",metaKey:"meta",separator:"+"});class Af extends oS{constructor(e,t){if(super(),0===t.length)throw(0,o_.b1)("chords");this._os=e,this._chords=t}getLabel(){return Ad.toLabel(this._os,this._chords,e=>this._getLabel(e))}getAriaLabel(){return Au.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Ac.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return Ag.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new oy(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class Am extends Af{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return tM.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":tM.toString(e.keyCode)}_getElectronAccelerator(e){return tM.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";let t=tM.toUserSettingsUS(e.keyCode);return t?t.toLowerCase():t}_getChordDispatch(e){return Am.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=tM.toString(e.keyCode)}_getSingleModifierChordDispatch(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.ke
250yCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){let t=sw[e];if(-1!==t)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:break;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof oC)return e;let t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new oC(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){let i=Al(e.chords.map(e=>this._toKeyCodeChord(e)));return i.length>0?[new Am(i,t)]:[]}}let Ap=ht("labelService"),A_=ht("progressService");class Av{static{this.None=Object.freeze({report(){}})}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}let Ab=ht("editorProgressService");class AC{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){return e.charCodeAt(0)-this._value.charCodeAt(this._pos)}value(){return this._value[this._pos]}}class Aw{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(46===this._value.charCodeAt(this._to)){if(e)this._from++;else break}else e=!1;return this}cmp(e){return this._caseSensitive?rP(e,this._value,0,e.length,this._from,this._to):rB(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class Ay{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){let e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){let t=this._value.charCodeAt(this._to);if(47===t||this._splitOnBackslash&&92===t){if(e)this._from++;else break}else e=!1}return this}cmp(e){return this._caseSensitive?rP(e,this._value,0,e.length,this._from,this._to):rB(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class AS{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new Ay(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),!this._ignoreQueryAndFragment(e)&&(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return 3===this._states[this._stateIdx]&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(1===this._states[this._stateIdx])return rF(e,this._value.scheme);if(2===this._states[this._stateIdx])return rF(e,this._value.authority);if(3===this._states[this._stateIdx])return this._pathIterator.cmp(e);if(4===this._states[this._stateIdx])return rO(e,this._value.query);if(5===this._states[this._stateIdx])return rO(e,this._value.fragment);throw Error()}value(){if(1===this._states[this._stateIdx])return this._value.scheme;if(2===this._states[this._stateIdx])return this._value.authority;if(3===this._states[this._stateIdx])return this._pathIterator.value();if(4===this._states[this._stateIdx])return this._value.query;if(5===this._states[this._stateIdx])return this._value.fragment;throw Error()}}class AL{static{this.Val=Symbol("undefined_placeholder")}static wrap(e){return void 0===e?AL.Val:e}static unwrap(e){return e===AL.Val?void 0:e}}class Ax{constructor(){this.height=1,this.value=void 0,this.key=void 0,this.left=void 0,this.mid=void 0,this.right=void 0}rotateLeft(){let e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}}class Ak{static forUris(e=()=>!1,t=()=>!1){return new Ak(new AS(e,t))}static forStrings(){return new Ak(new AC)}static forConfigKeys(){return new Ak(new Aw)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){let i;let n=this._iter.reset(e);this._root||(this._root=new Ax,this._root.segment=n.value());let s=[];for(i=this._root;;){let e=n.cmp(i.segment);if(e>
2500)i.left||(i.left=new Ax,i.left.segment=n.value()),s.push([-1,i]),i=i.left;else if(e<0)i.right||(i.right=new Ax,i.right.segment=n.value()),s.push([1,i]),i=i.right;else if(n.hasNext())n.next(),i.mid||(i.mid=new Ax,i.mid.segment=n.value()),s.push([0,i]),i=i.mid;else break}let r=AL.unwrap(i.value);i.value=AL.wrap(t),i.key=e;for(let e=s.length-1;e>=0;e--){let t=s[e][1];t.updateHeight();let i=t.balanceFactor();if(i<-1||i>1){let i=s[e][0],n=s[e+1][0];if(1===i&&1===n)s[e][1]=t.rotateLeft();else if(-1===i&&-1===n)s[e][1]=t.rotateRight();else if(1===i&&-1===n)t.right=s[e+1][1]=s[e+1][1].rotateRight(),s[e][1]=t.rotateLeft();else if(-1===i&&1===n)t.left=s[e+1][1]=s[e+1][1].rotateLeft(),s[e][1]=t.rotateRight();else throw Error();if(e>0)switch(s[e-1][0]){case -1:s[e-1][1].left=s[e][1];break;case 1:s[e-1][1].right=s[e][1];break;case 0:s[e-1][1].mid=s[e][1]}else this._root=s[0][1]}}return r}get(e){return AL.unwrap(this._getNode(e)?.value)}_getNode(e){let t=this._iter.reset(e),i=this._root;for(;i;){let e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){let t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){let i=this._iter.reset(e),n=[],s=this._root;for(;s;){let e=i.cmp(s.segment);if(e>0)n.push([-1,s]),s=s.left;else if(e<0)n.push([1,s]),s=s.right;else if(i.hasNext())i.next(),n.push([0,s]),s=s.mid;else break}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value){if(s.left&&s.right){let e=[[1,s]],t=this._min(s.right,e);if(t.key){s.key=t.key,s.value=t.value,s.segment=t.segment;let i=t.right;if(e.length>1){let[t,n]=e[e.length-1];switch(t){case -1:n.left=i;break;case 0:(0,ab.hu)(!1);case 1:(0,ab.hu)(!1)}}else s.right=i;let r=this._balanceByStack(e);if(n.length>0){let[e,t]=n[n.length-1];switch(e){case -1:t.left=r;break;case 0:t.mid=r;break;case 1:t.right=r}}else this._root=r}}else{let e=s.left??s.right;if(n.length>0){let[t,i]=n[n.length-1];switch(t){case -1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e}}else this._root=e}}this._root=this._balanceByStack(n)??this._root}}_min(e,t){for(;e.left;)t.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){let i=e[t][1];i.updateHeight();let n=i.balanceFactor();if(n>1?(i.right.balanceFactor()>=0||(i.right=i.right.rotateRight()),e[t][1]=i.rotateLeft()):n<-1&&(0>=i.left.balanceFactor()||(i.left=i.left.rotateLeft()),e[t][1]=i.rotateRight()),!(t>0))return e[0][1];switch(e[t-1][0]){case -1:e[t-1][1].left=e[t][1];break;case 1:e[t-1][1].right=e[t][1];break;case 0:e[t-1][1].mid=e[t][1]}}}findSubstr(e){let t;let i=this._iter.reset(e),n=this._root;for(;n;){let e=i.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else if(i.hasNext())i.next(),t=AL.unwrap(n.value)||t,n=n.mid;else break}return n&&AL.unwrap(n.value)||t}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){let i=this._iter.reset(e),n=this._root;for(;n;){let e=i.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else if(i.hasNext())i.next(),n=n.mid;else{if(n.mid)return this._entries(n.mid);if(t)return AL.unwrap(n.value);break}}}forEach(e){for(let[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),void 0!==e.value&&t.push([e.key,AL.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}let AN=ht("contextService");class AD{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}(0,rh.NC)(2050,"Code Workspace"),(nT||(nT={})).inspectTokensAction=(0,rh.NC)(786,"Developer: Inspect Tokens"),(nI||(nI={})).gotoLineActionLabel=(0,rh.NC)(787,"Go to Line/Column..."),(nM||(nM={})).helpQuickAccessActionLabel=(0,rh.NC)(788,"Show all Quick Access Providers"),(th=nR||(nR={})).quickCommandActionLabel=(0,rh.NC)(789,"Command Palette"),th.quickCommandHelp=(0,rh.NC)(790,"Show And Run Commands"),(td=nA||(nA={})).quickOutlineActionLabel=(0,rh.NC)(791,"Go to Symbol..."),td.quickOutlineByCategoryActionLabel=(0,rh.NC)(792,"Go to Symbol by Category..."),(nO||(nO={})).editorViewAccessibleLabel=(0,rh.NC)(793,"Editor content"),(nP||(nP={})).toggleHighContrast=(0,rh.NC)(794,"Toggle High Contrast Theme"),(nF||(nF={})).bulkEditServiceSummary=(0,rh.NC)(795,"Made {0} edits in {1} files");let AE=ht("workspaceTrustManagementService"),AT=[],AI=[],AM=[];function AR(e,t=!1){!function(e,t,i){let n={id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:t,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?Tt(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.f
250ilepattern&&e.filepattern.indexOf(sV.sep)>=0};AT.push(n),n.userConfigured?AM.push(n):AI.push(n),i&&!n.userConfigured&&AT.forEach(e=>{e.mime!==n.mime&&!e.userConfigured&&(n.extension&&e.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&e.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&e.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&e.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))})}(e,!1,t)}function AA(e,t,i){let n,s,r;for(let o=i.length-1;o>=0;o--){let a=i[o];if(t===a.filenameLowercase){n=a;break}if(a.filepattern&&(!s||a.filepattern.length>s.filepattern.length)){let i=a.filepatternOnPath?e:t;a.filepatternLowercase?.(i)&&(s=a)}a.extension&&(!r||a.extension.length>r.extension.length)&&t.endsWith(a.extensionLowercase)&&(r=a)}return n||s||r||void 0}let AO=Object.prototype.hasOwnProperty,AP="vs.editor.nullLanguage";class AF{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(AP,0),this._register(u0,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;let t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||AP}}class AB extends ro.JT{static{this.instanceCount=0}constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new sd.Q5),this.onDidChange=this._onDidChange.event,AB.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new AF,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(u1.onDidChangeLanguages(e=>{this._initializeFromRegistry()})))}dispose(){AB.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},AT=AT.filter(e=>e.userConfigured),AI=[];let e=[].concat(u1.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(let t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(e=>{let t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach(e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier}),t.mimetypes.forEach(e=>{this._mimeTypesMap[e]=t.identifier})}),h5.as(uU).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){let t;let i=e.id;AO.call(this._languages,i)?t=this._languages[i]:(this.languageIdCodec.register(i),t={identifier:i,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[i]=t),this._mergeLanguage(t,e)}_mergeLanguage(e,t){let i=t.id,n=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),n=t.mimetypes[0]),n||(n=`text/x-${i}`,e.mimetypes.push(n)),Array.isArray(t.extensions))for(let s of(t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions),t.extensions))AR({id:i,mime:n,extension:s},this._warnOnOverwrite);if(Array.isArray(t.filenames))for(let s of t.filenames)AR({id:i,mime:n,filename:s},this._warnOnOverwrite),e.filenames.push(s);if(Array.isArray(t.filenamePatterns))for(let e of t.filenamePatterns)AR({id:i,mime:n,filepattern:e},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{let t=new RegExp(e);rT(t)||AR({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(i){console.warn(`[${t.id}]: Invalid regular expression \`${e}\`: `,i)}}e.aliases.push(i);let s=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(s=0===t.aliases.length?[null]:t.aliases),null!==s)for(let t of s)t&&0!==t.length&&e.aliases.push(t);let r=null!==s&&s.length>0;if(r&&null===s[0]);else{let t=(r?s[0]:null)||i;(r||!e.name)&&(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&AO.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){let t=e.toLowerCase();return AO.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&AO.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return e||t?(function(e,t){let i;if(e)switch(e.scheme){case iA.file:i=e.fsPath;break;case iA.data:i=ij.parseMetaData(e).get(ij.META_DATA_LABEL);break;case iA.vscodeNotebookCell:i=void 0;break;default:i=e.path}if(!i)return[{id:"unknown",mime:uF.unknown}];let n=sK(i=i.toLowerCase()),s=AA(i,n,AM);if(s)return[s,{id:u0,mime:uF.text}
250];let r=AA(i,n,AI);if(r)return[r,{id:u0,mime:uF.text}];if(t){let e=function(e){if(r9(e)&&(e=e.substr(1)),e.length>0)for(let t=AT.length-1;t>=0;t--){let i=AT[t];if(!i.firstline)continue;let n=e.match(i.firstline);if(n&&n.length>0)return i}}(t);if(e)return[e,{id:u0,mime:uF.text}]}return[{id:"unknown",mime:uF.unknown}]})(e,t).map(e=>e.id):[]}}class AV extends ro.JT{static{this.instanceCount=0}constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new sd.Q5),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new sd.Q5),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new sd.Q5({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,AV.instanceCount++,this._registry=this._register(new AB(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){AV.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return this._registry.guessLanguageIdByFilepathOrFirstLine(e,t).at(0)??null}createById(e){return new AW(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new AW(this.onDidChange,()=>{let i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e=u0),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),rp.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}class AW{constructor(e,t){this._value=aP(this,e,()=>t()),this.onDidChange=sd.ju.fromObservable(this._value)}get languageId(){return this._value.get()}}function AH(e,t){if(void 0!==e){let i=e.match(/^\s*var\((.+)\)$/);if(i){let e=i[1].split(",",2);return 2===e.length&&(t=AH(e[1].trim(),t)),`var(${e[0]}, ${t})`}return e}return t}function Az(e){let t=e.replaceAll(/[^_\-a-z0-9]/gi,"");return t!==e&&console.warn(`CSS ident value ${e} modified to ${t} to be safe for CSS`),t}function AU(e){return`'${e.replaceAll(/'/g,"\\000027")}'`}function AK(e){return e?Aj`url('${CSS.escape(o0.uriToBrowserUri(e).toString(!0))}')`:"url('')"}function A$(e,t=!1){let i=CSS.escape(e);return t||i===e||console.warn(`CSS class name ${e} modified to ${i} to be safe for CSS`),i}function Aj(e,...t){return e.reduce((e,i,n)=>e+i+(t[n]||""),"")}class Aq{constructor(){this._parts=[]}push(...e){this._parts.push(...e)}join(e="\n"){return this._parts.join(e)}}let AG={RESOURCES:"ResourceURLs",TEXT:uF.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},AQ=()=>({get delay(){return -1},dispose:()=>{},showHover:()=>{}}),AY=new rS(()=>AQ("mouse",!1)),AJ=new rS(()=>AQ("element",!1));function AZ(e){return"element"===e?AJ.value:AY.value}function AX(){return AQ("element",!0)}i(39879);let A1={showInstantHover:()=>void 0,showDelayedHover:()=>void 0,setupDelayedHover:()=>ro.JT.None,setupDelayedHoverAtMouse:()=>ro.JT.None,hideHover:()=>void 0,showAndFocusLastHover:()=>void 0,setupManagedHover:()=>({dispose:()=>void 0,show:()=>void 0,hide:()=>void 0,update:()=>void 0}),showManagedHover:()=>void 0};class A0{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}i(4508);class A2 extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function A5(e,t){let i=[];for(let n of t){if(e.start>=n.range.end)continue;if(e.end<n.range.start)break;let t=nw.intersect(e,n.range);nw.isEmpty(t)||i.push({range:t,size:n.size})}return i}function A4({start:e,end:t},i){return{start:e+i,end:t+i}}class A6{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){let n=i.length-t,s=A5({start:0,end:e},this.groups),r=A5({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(e=>({range:A4(e.range,n),size:e.size})),o=i.map((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size}));this.groups=function(...e){return function(e){let t=[],i=null;for(let n of e){let e=n.range.start,s=n.range.end,r=n.size;if(i&&r===i.size){i.range.end=s;continue}i={range:{start:e,end:s},size:r}
250,t.push(i)}return t}(e.reduce((e,t)=>e.concat(t),[]))}(s,o,r),this._size=this._paddingTop+this.groups.reduce((e,t)=>e+t.size*(t.range.end-t.range.start),0)}get count(){let e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return -1;if(e<this._paddingTop)return 0;let t=0,i=this._paddingTop;for(let n of this.groups){let s=n.range.end-n.range.start,r=i+s*n.size;if(e<r)return t+Math.floor((e-i)/n.size);t+=s,i=r}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return -1;let t=0,i=0;for(let n of this.groups){let s=n.range.end-n.range.start,r=i+s;if(e<r)return this._paddingTop+t+(e-i)*n.size;t+=s*n.size,i=r}return -1}}class A7{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)(i=this.transactionNodesPendingRemoval.has(t.domNode))&&this.transactionNodesPendingRemoval.delete(t.domNode);else{let i=lI(".monaco-list-row"),n=this.getRenderer(e).renderTemplate(i);t={domNode:i,templateId:e,templateData:n}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(let e of this.transactionNodesPendingRemoval)this.doRemoveNode(e);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){let{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(i).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),e.remove()}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(let i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){let t=this.renderers.get(e);if(!t)throw Error(`No renderer found for ${e}`);return t}}i(79124);var A3=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o};let A9={CurrentDragAndDropData:void 0},A8={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class Oe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Ot{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Oi{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){let i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}
250class On{constructor(e){e?.getSetSize?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(e,t,i)=>i,e?.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,e?.getRole?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",e?.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>void 0}}class Os{static{this.InstanceCount=0}get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(let e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:la(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,n=A8){if(this.virtualDelegate=t,this.domId=`list_id_${++Os.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new oF(50),this.splicing=!1,this.dragOverAnimationStopDisposable=ro.JT.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=ro.JT.None,this.onDragLeaveTimeout=ro.JT.None,this.currentSelectionDisposable=ro.JT.None,this.disposables=new ro.SL,this._onDidChangeContentHeight=new sd.Q5,this._onDidChangeContentWidth=new sd.Q5,this.onDidChangeContentHeight=sd.ju.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,n.horizontalScrolling&&n.supportDynamicHeights)throw Error("Horizontal scrolling and dynamic heights not supported simultaneously");for(let e of(this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(n.paddingTop??0),i))this.renderers.set(e.templateId,e);if(this.cache=this.disposables.add(new A7(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support","boolean"!=typeof n.mouseSupport||n.mouseSupport),this._horizontalScrolling=n.horizontalScrolling??A8.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=void 0===n.paddingBottom?0:n.paddingBottom,this.accessibilityProvider=new On(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(n.transformOptimization??A8.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(vG.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new v5({forceIntegerValues:!0,smoothScrollDuration:n.smoothScrolling?125:0,scheduleAtNextAnimationFrame:e=>u(aG(this.domNode),e)})),this.scrollableElement=this.disposables.add(new bt(this.rowsContainer,{alwaysConsumeMouseWheel:n.alwaysConsumeMouseWheel??A8.alwaysConsumeMouseWheel,horizontal:1,vertical:n.verticalScrollMode??A8.verticalScrollMode,useShadows:n.useShadows??A8.useShadows,mouseWheelScrollSensitivity:n.mouseWheelScrollSensitivity,fastScrollSensitivity:n.fastScrollSensitivity,scrollByPage:n.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(a6(this.rowsContainer,i6.Change,e=>this.onTouchChange(e))),this.disposables.add(a6(this.scrollableElement.getDomNode(),"scroll",e=>{let t=e.target,i=t.scrollTop;t.scrollTop=0,n.scrollToActiveElement&&this.setScrollTop(this.scrollTop+i)})),this.disposables.add(a6(this.domNode,"dragover",e=>this.onDragOver(this.toDragEvent(e)))),this.disposables.add(a6(this.domNode,"drop",e=>this.onDrop(this.toDragEvent(e)))),this.disposables.add(a6(this.domNode,"dragleave",e=>this.onDragLeave(this.toDragEvent(e)))),this.disposables.add(a6(this.domNode,"dragend",e=>this.onDragEnd(e))),n.userSelection){if(n.dnd)throw Error("DND and user selection cannot be used simultaneously");this.disposables.add(a6(this.domNode,"mousedown",e=>this.onPotentialSelectionStart(e)))}this.setRowLineHeight=n.setRowLineHeight??A8.setRowLineHeight,this.setRowHeight=n.setRowHeight??A8.setRowHeight,this.supportDynamicHeights=n.supportDynamicHeights??A8.supportDynamicHeights,this.dnd=n.dnd??this.disposables.add(A8.dnd),this.layout(n.initialSize?.height,n.initialSize?.width),n.scrollToActiveElement&&this._setupFocusObserver(e)}_setupFocusObserver(e){this.disposables.add(a6(e,"focus",()=>{let t=lg();this.activeElement!==t&&null!==t&&(this.activeElement=t,this._scrollToActiveElement(this.activeElement,e))},!0))}_scrollToActiveElement(e,t){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect().top-i.top;n<0&&this.setScrollTop(this.scrollTop+n)}updateOptions(e){let t;if(void 0!==e.paddingBottom&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.scrollByPage&&(t={...t??{},scrollByPage:e.scrollByPage}),void 0!==e.mouseWheelScrollSensitivity&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),void 0!==e.fastScrollSensitivity&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),void 0!==e.paddingTop&&e.paddingTop!==this.rangeMap.paddingTop){let t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),i=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(t,Math.max(0,this.lastRenderTop+i),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new A6(e)}splice(e,t,i=[]){if(this.splicing)throw Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){let n;let s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r=nw.intersect(s,{start:e,end:e+t}),o=new Map;for(let e=r.end-1;e>=r.start;e--){let t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){let i=o.get(t.templateId);i||(i=[],o.set(t.templateId,i));let n=this.renderers.get(t.templateId);n&&n.disposeElement&&n.disposeElement(t.element,e,t.row.templateData,{height:t.size}),i.unshift(t.row)}t.row=null,t.stale=!0}let a={start:e+t,end:this.items.length},l=nw.intersect(a,s),h=nw.relativeComplement(a,s),d=i.map(e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:ro.JT.None,checkedDisposable:ro.JT.None,stale:!1}));0===e&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),n=this.items,this.items=d):(this.rangeMap.splice(e,t,d),n=(0,as.db)(this.items,e,t,d));let u=i.length-t,c=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),g=A4(l,u),f=nw.intersect(c,g);for(let e=f.start;e<f.end;e++)this.updateItemInDOM(this.items[e],e);for(let e of nw.relativeComplement(g,c))for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t);let m=h.map(e=>A4(e,u));for(let t of[{start:e,end:e+i.length},...m].map(e=>nw.intersect(c,e)).reverse())for(let e=t.end-1;e>=t.start;e--){let t=this.items[e],i=o.get(t.templateId),n=i?.pop();this.insertItemInDOM(e,n)}for(let e of o.values())for(let t of e)this.cache.release(t);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),n.map(e=>e.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=u(aG(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(let t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}
250rerender(){if(this.supportDynamicHeights){for(let e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getVisibleRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){let t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){let i={height:"number"==typeof e?e:function(e){let t=li.getBorderTopWidth(e)+li.getBorderBottomWidth(e),i=li.getPaddingTop(e)+li.getPaddingBottom(e);return e.offsetHeight-t-i}(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),void 0!==t&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:"number"==typeof t?t:la(this.domNode)})}render(e,t,i,n,s,r=!1,o=!1){let a=this.getRenderRange(t,i),l=nw.relativeComplement(a,e).reverse(),h=nw.relativeComplement(e,a);if(r){let t=nw.intersect(e,a);for(let e=t.start;e<t.end;e++)this.updateItemInDOM(this.items[e],e)}this.cache.transact(()=>{for(let e of h)for(let t=e.start;t<e.end;t++)this.removeItemFromDOM(t,o);for(let e of l)for(let t=e.end-1;t>=e.start;t--)this.insertItemInDOM(t)}),void 0!==n&&(this.rowsContainer.style.left=`-${n}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&void 0!==s&&(this.rowsContainer.style.width=`${Math.max(s,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){let i=this.items[e];if(!i.row){if(t)i.row=t,i.stale=!0;else{let e=this.cache.alloc(i.templateId);i.row=e.row,i.stale||=e.isReusingConnectedDomNode}}let n=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",n);let s=this.accessibilityProvider.isChecked(i.element),r=e=>"mixed"===e?"mixed":String(!!e);if("boolean"==typeof s||"mixed"===s)i.row.domNode.setAttribute("aria-checked",r(s));else if(s){let e=e=>i.row.domNode.setAttribute("aria-checked",r(e));e(s.value),i.checkedDisposable=s.onDidChange(()=>e(s.value))}if(i.stale||!i.row.domNode.parentElement){let t=this.items.at(e+1)?.row?.domNode??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==t)&&this.rowsContainer.insertBefore(i.row.domNode,t),i.stale=!1}this.updateItemInDOM(i,e);let o=this.renderers.get(i.templateId);if(!o)throw Error(`No renderer found for template id ${i.templateId}`);o?.renderElement(i.element,e,i.row.templateData,{height:i.size});let a=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!a,a&&(i.dragStartDisposable=a6(i.row.domNode,"dragstart",e=>this.onDragStart(i.element,a,e))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=la(e.row.domNode);let t=aG(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2==0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvi
250der.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e,t){let i=this.items[e];if(i.dragStartDisposable.dispose(),i.checkedDisposable.dispose(),i.row){let n=this.renderers.get(i.templateId);n&&n.disposeElement&&n.disposeElement(i.element,e,i.row.templateData,{height:i.size,onScroll:t}),this.cache.release(i.row),i.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return sd.ju.map(this.disposables.add(new bc(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return sd.ju.map(this.disposables.add(new bc(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return sd.ju.filter(sd.ju.map(this.disposables.add(new bc(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>1===e.browserEvent.button,this.disposables)}get onMouseDown(){return sd.ju.map(this.disposables.add(new bc(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return sd.ju.map(this.disposables.add(new bc(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return sd.ju.map(this.disposables.add(new bc(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return sd.ju.any(sd.ju.map(this.disposables.add(new bc(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),sd.ju.map(this.disposables.add(new bc(this.domNode,i6.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return sd.ju.map(this.disposables.add(new bc(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return sd.ju.map(this.disposables.add(new bc(this.rowsContainer,i6.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){let t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){let t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){let t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){let t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t],n=i&&i.element,s=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:n,sector:s}}onScroll(e){try{let t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth,void 0,!0),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){let n;if(!i.dataTransfer)return;let s=this.dnd.getDragElements(e);i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(AG.TEXT,t),this.dnd.getDragLabel&&(n=this.dnd.getDragLabel(s,i)),void 0===n&&(n=String(s.length)),function(e,t,i,n=[]){if(!e.dataTransfer)return;let s=lI(".monaco-drag-image");s.textContent=i,s.classList.add(...n),(e=>{for(;e&&!e.classList.contains("monaco-workbench");)e=e.parentElement;return e||t.ownerDocument.body})(t).appendChild(s),e.dataTransfer.setDragImage(s,-10,-10),setTimeout(()=>s.remove(),0)}(i,this.domNode,n,[this.domId]),this.domNode.classList.add("dragging"),this.currentDragData=new Oe(s),A9.CurrentDragAndDropData=new Ot(s),this.dnd.onDragStart?.(this.currentDragData,i)}onPotentialSelectionStart(e){this.currentSelectionDisposable.dispose();let t=aQ(this.domNode),i=this.currentSelectionDisposable=new ro.SL,n=i.add(new ro.SL);n.add(a6(this.domNode,"selectstart",()=>{n.add(a6(t,"mousemove",e=>{t.getSelection()?.isCollapsed===!1&&this.setupDragAndDropScrollTopAnimation(e)})),i.add((0,ro.OF)(()=>{let e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.currentSelectionBounds=void 0,this.render(e,this.lastRenderTop,this.lastRenderHeight,void 0,void 0)})),i.add(a6(t,"selectionchange",()=>{let e=t.getSelection();if(!e||e.isCollapsed){n.isDisposed&&i.dispose();return}let s=this.getIndexOfListElement(e.anchorNode),r=this.getIndexOfListElement(e.focusNode);void 0!==s&&void 0!==r&&(r<s&&([s,r]=[r,s]),this.currentSelectionBounds={start:s,end:r})}))})),n.add(a6(t,"mouseup",()=>{n.dispose(),this.teardownDragAndDropScrollTopAnimation(),t.getSelection()?.isCollapsed!==!1&&i.dispose()}))}getIndexOfListElement(e){if(e&&this.domNode.contains(e))for(;e&&e!==this.domNode;){if(e.dataset?.index)return Number(e.dataset.index);e=e.parentElement}}onDragOver(e){var t,i;let n;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),A9.CurrentDragAndDropData&&"vscode-ui"===A9.CurrentDragAndDropData.getData()||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData){if(A9.CurrentDragAndDropData)this.currentDragData=A9.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new Oi}}let s=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop="boolean"==typeof s?s:s.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof s&&s.effect?.type===0?"copy":"move",n="boolean"!=typeof s&&s.feedback?s.feedback:void 0===e.index?[-1]:[e.index],n=-1===(n=(0,as.EB)(n).filter(e=>e>=-1&&e<this.length).sort((e,t)=>
250e-t))[0]?[-1]:n;let r="boolean"!=typeof s&&s.effect&&s.effect.position?s.effect.position:"drop-target";if(t=this.currentDragFeedback,i=n,(Array.isArray(t)&&Array.isArray(i)?(0,as.fS)(t,i):t===i)&&this.currentDragFeedbackPosition===r)return!0;if(this.currentDragFeedback=n,this.currentDragFeedbackPosition=r,this.currentDragFeedbackDisposable.dispose(),-1===n[0])this.domNode.classList.add(r),this.rowsContainer.classList.add(r),this.currentDragFeedbackDisposable=(0,ro.OF)(()=>{this.domNode.classList.remove(r),this.rowsContainer.classList.remove(r)});else{if(n.length>1&&"drop-target"!==r)throw Error("Can't use multiple feedbacks with position different than 'over'");for(let e of("drop-target-after"===r&&n[0]<this.length-1&&(n[0]+=1,r="drop-target-before"),n)){let t=this.items[e];t.dropTarget=!0,t.row?.domNode.classList.add(r)}this.currentDragFeedbackDisposable=(0,ro.OF)(()=>{for(let e of n){let t=this.items[e];t.dropTarget=!1,t.row?.domNode.classList.remove(r)}})}return!0}onDragLeave(e){this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=oW(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&this.dnd.onDragLeave?.(this.currentDragData,e.element,e.index,e.browserEvent)}onDrop(e){if(!this.canDrop)return;let t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,A9.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,A9.CurrentDragAndDropData=void 0,this.dnd.onDragEnd?.(e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=ro.JT.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){let e=function(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==e.ownerDocument.body&&e!==e.ownerDocument.documentElement;){i-=e.scrollTop;let s=lu(e)?null:le(e);s&&(n-="rtl"!==s.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=li.getBorderLeftWidth(e),i+=li.getBorderTopWidth(e)+e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}(this.domNode).top;this.dragOverAnimationDisposable=function(e,t){let i=()=>{t(),n=u(e,i)},n=u(e,i);return(0,ro.OF)(()=>n.dispose())}(aG(this.domNode),this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=oW(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)return;let t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(void 0!==t)return EE(Math.floor(e.offsetY/this.items[t].size/.25),0,3)}getItemIndexFromEventTarget(e){let t=this.scrollableElement.getDomNode(),i=e;for(;(l_(i)||lb(i))&&i!==this.rowsContainer&&t.contains(i);){let e=i.getAttribute("data-index");if(e){let t=Number(e);if(!isNaN(t))return t}i=i.parentElement}}getVisibleRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}getRenderRange(e,t){let i=this.getVisibleRange(e,t);if(this.currentSelectionBounds){let e=this.rangeMap.count;i.start=Math.min(i.start,this.currentSelectionBounds.start,e),i.end=Math.min(Math.max(i.end,this.currentSelectionBounds.end+1),e)}return i}_rerender(e,t,i){let n,s;let r=this.getRenderRange(e,t);e===this.elementTop(r.start)?(n=r.start,s=0):r.end-r.start>1&&(n=r.start+1,s=this.elementTop(n)-e);let o=0;for(;;){let a=this.getRenderRange(e,t),l=!1;for(let e=a.start;e<a.end;e++){let t=this.probeDynamicHeight(e);0!==t&&this.rangeMap.splice(e,1,[this.items[e]]),o+=t,l=l||0!==t}if(!l){for(let e of(0!==o&&this.eventuallyUpdateScrollDimensions(),nw.relativeComplement(r,a)))for(let t=e.start;t<e.end;t++)this.items[t].row&&this.removeItemFromDOM(t);for(let e of nw.relativeComplement(a,r).reverse())for(let t=e.end-1;t>=e.start;t--)this.insertItemInDOM(t);for(let e=a.start;e<a.end;e++)this.items[e].row&&this.updateItemInDOM(this.items[e],e);if("number"==typeof n){let t=this.scrollable.getFutureScrollPosition().scrollTop-e,r=this.elementTop(n)-s+t;this.setScrollTop(r,i)}this._onDidChangeContentHeight.fire(this.contentHeight);return}}}probeDynamicHeight(e){let t=this.items[e];if(this.virtualDelegate.getDynamicHeight){let e=this.virtualDelegate.getDynamicHeight(t.element);if(null!==e){let i=t.size;return t.size=e,t.lastDynamicHeightWidth=this.renderWidth,e-i}}if(!t.hasDynamicHeight||t.lastDynamicHeightWidth===this.renderWidth||this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(t.element))return 0;let i=t.size;if(t.row)return t.row.domNode.style.height="",t.size=t.row.domNode.offsetHeight,0!==t.size||lh(t.row.domNode,aG(t.row.domNode).document.body)||console.warn("Measuring item node that is not in DOM! Add ListView to the DOM before measuring row height!",Error().stack),t.lastDynamicHeightWidth=this.renderWidth,t.size-i;let{row:n}=this.cache.alloc(t.templateId);n.domNode.style.height="",this.rowsContainer.appendChild(n.domNode);let s=this.renderers.get(t.templateId);if(!s)throw new o_.he("Missing renderer for templateId: "+t.templateId);return s.renderElement(t.element,e,n.templateData),t.size=n.domNode.offsetHeight,s.disposeElement?.(t.element,e,n.templateData),this.virtualDelegate.setDynamicHeight?.(t.element,t.size),t.lastDynamicHeightWidth=this.renderWidth,n.domNo
250de.remove(),this.cache.release(n),t.size-i}getElementDomId(e){return`${this.domId}_${e}`}dispose(){for(let e of this.items)if(e.dragStartDisposable.dispose(),e.checkedDisposable.dispose(),e.row){let t=this.renderers.get(e.row.templateId);t&&(t.disposeElement?.(e.element,-1,e.row.templateData,void 0),t.disposeTemplate(e.row.templateData))}this.items=[],this.domNode?.remove(),this.dragOverAnimationDisposable?.dispose(),this.disposables.dispose()}}function Or(e){return new Oo(e)}A3([vq],Os.prototype,"onMouseClick",null),A3([vq],Os.prototype,"onMouseDblClick",null),A3([vq],Os.prototype,"onMouseMiddleClick",null),A3([vq],Os.prototype,"onMouseDown",null),A3([vq],Os.prototype,"onMouseOver",null),A3([vq],Os.prototype,"onMouseOut",null),A3([vq],Os.prototype,"onContextMenu",null),A3([vq],Os.prototype,"onTouchStart",null),A3([vq],Os.prototype,"onTap",null);class Oo extends a_{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}var Oa=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o};class Ol{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){let n=this.renderedElements.findIndex(e=>e.templateData===i);if(n>=0){let e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else this.renderedElements.push({index:t,templateData:i});this.trait.renderIndex(t,i)}splice(e,t,i){let n=[];for(let s of this.renderedElements)s.index<e?n.push(s):s.index>=e+t&&n.push({index:s.index+i-t,templateData:s.templateData});this.renderedElements=n}renderIndexes(e){for(let{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){let t=this.renderedElements.findIndex(t=>t.templateData===e);t<0||this.renderedElements.splice(t,1)}}class Oh{get onChange(){return this._onChange.event}get name(){return this._trait}get renderer(){return new Ol(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new sd.Q5}splice(e,t,i){let n=i.length-t,s=e+t,r=[],o=0;for(;o<this.sortedIndexes.length&&this.sortedIndexes[o]<e;)r.push(this.sortedIndexes[o++]);for(let t=0;t<i.length;t++)i[t]&&r.push(t+e);for(;o<this.sortedIndexes.length&&this.sortedIndexes[o]>=s;)r.push(this.sortedIndexes[o++]+n);this.renderer.splice(e,t,i.length),this._set(r,r)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(OD),t)}_set(e,t,i){let n=this.indexes,s=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;let r=ON(s,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return(0,as.ry)(this.sortedIndexes,e,OD)>=0}dispose(){(0,ro.B9)(this._onChange)}}Oa([vq],Oh.prototype,"renderer",null);class Od extends Oh{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class Ou{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,Array(i.length).fill(!1));let n=this.trait.get().map(e=>
250this.identityProvider.getId(this.view.element(e)).toString());if(0===n.length)return this.trait.splice(e,t,Array(i.length).fill(!1));let s=new Set(n),r=i.map(e=>s.has(this.identityProvider.getId(e).toString()));this.trait.splice(e,t,r)}}function Oc(e,t){return!!e.classList.contains(t)||!e.classList.contains("monaco-list")&&!!e.parentElement&&Oc(e.parentElement,t)}function Og(e){return Oc(e,"monaco-editor")}function Of(e){return Oc(e,"monaco-tree-sticky-row")}function Om(e){return e.classList.contains("monaco-tree-sticky-container")}class Op{get onKeyDown(){return sd.ju.chain(this.disposables.add(new bc(this.view.domNode,"keydown")).event,e=>e.filter(e=>!lH(e.target)).map(e=>new ok(e)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new ro.SL,this.multipleSelectionDisposables=new ro.SL,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(e=>{switch(e.keyCode){case 3:return this.onEnter(e);case 16:return this.onUpArrow(e);case 18:return this.onDownArrow(e);case 11:return this.onPageUpArrow(e);case 12:return this.onPageDownArrow(e);case 9:return this.onEscape(e);case 31:this.multipleSelectionSupport&&(sS.dz?e.metaKey:e.ctrlKey)&&this.onCtrlA(e)}}))}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);let t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection((0,as.w6)(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}Oa([vq],Op.prototype,"onKeyDown",null),(tu=nB||(nB={}))[tu.Automatic=0]="Automatic",tu[tu.Trigger=1]="Trigger",(tc=nV||(nV={}))[tc.Idle=0]="Idle",tc[tc.Typing=1]="Typing";let O_=new class{mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=98&&e.keyCode<=107||e.keyCode>=85&&e.keyCode<=95)}};class Ov{constructor(e,t,i,n,s){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=s,this.enabled=!1,this.state=nV.Idle,this.mode=nB.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new ro.SL,this.disposables=new ro.SL,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??nB.Automatic}enable(){if(this.enabled)return;let e=!1,t=sd.ju.chain(this.enabledDisposables.add(new bc(this.view.domNode,"keydown")).event,t=>t.filter(e=>!lH(e.target)).filter(()=>this.mode===nB.Automatic||this.triggered).map(e=>new ok(e)).filter(t=>e||this.keyboardNavigationEventFilter(t)).filter(e=>this.delegate.mightProducePrintableCharacter(e)).forEach(e=>lS.stop(e,!0)).map(e=>e.browserEvent.key)),i=sd.ju.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);sd.ju.reduce(sd.ju.any(t,i),(e,t)=>null===t?null:(e||"")+t,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){let e=this.list.getFocus();if(e.length>
2500&&e[0]===this.previouslyFocused){let t=this.list.options.accessibilityProvider?.getAriaLabel(this.list.element(e[0]));"string"==typeof t?mt(t):t&&mt(t.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=nV.Idle,this.triggered=!1;return}let t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===nV.Idle?1:0;this.state=nV.Typing;for(let t=0;t<this.list.length;t++){let s=(i+t+n)%this.list.length,r=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(s)),o=r&&r.toString();if(this.list.options.typeNavigationEnabled){if(void 0!==o){if(T_(e,o)){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}let t=function(e,t){let i=TH(e,e.toLowerCase(),0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return i?function(e){if(void 0===e)return[];let t=[],i=e[1];for(let n=e.length-1;n>1;n--){let s=e[n]+i,r=t[t.length-1];r&&r.end===s?r.end=s+1:t.push({start:s,end:s+1})}return t}(i):null}(e,o);if(t&&t[0].end-t[0].start>1&&1===t.length){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(void 0===o||T_(e,o)){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class Ob{constructor(e,t){this.list=e,this.view=t,this.disposables=new ro.SL;let i=sd.ju.chain(this.disposables.add(new bc(t.domNode,"keydown")).event,e=>e.filter(e=>!lH(e.target)).map(e=>new ok(e)));sd.ju.chain(i,e=>e.filter(e=>2===e.keyCode&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;let t=this.list.getFocus();if(0===t.length)return;let i=this.view.domElement(t[0]);if(!i)return;let n=i.querySelector("[tabIndex]");if(!n||!l_(n)||-1===n.tabIndex)return;let s=aG(n).getComputedStyle(n);
250"hidden"!==s.visibility&&"none"!==s.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function OC(e){return sS.dz?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function Ow(e){return e.browserEvent.shiftKey}let Oy={isSelectionSingleChangeEvent:OC,isSelectionRangeChangeEvent:Ow};class OS{get onPointer(){return this._onPointer.event}constructor(e){this.list=e,this.disposables=new ro.SL,this._onPointer=this.disposables.add(new sd.Q5),!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Oy),this.mouseSupport=void 0===e.options.mouseSupport||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(vG.addTarget(e.getHTMLElement()))),sd.ju.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||Oy))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){Og(e.browserEvent.target)||lg()===e.browserEvent.target||this.list.domFocus()}onContextMenu(e){if(lH(e.browserEvent.target)||Og(e.browserEvent.target))return;
250let t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){var t;if(!this.mouseSupport||lH(e.browserEvent.target)||Og(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;let i=e.index;if(void 0===i){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([i],e.browserEvent),this.list.setAnchor(i),lC(t=e.browserEvent)&&2===t.button||this.list.setSelection([i],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(lH(e.browserEvent.target)||Og(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;let t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){let t=e.index,i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){void 0===i&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));let n=Math.min(i,t),s=Math.max(i,t),r=(0,as.w6)(n,s+1),o=this.list.getSelection(),a=function(e,t){let i=e.indexOf(t);if(-1===i)return[];let n=[],s=i-1;for(;s>=0&&e[s]===t-(i-s);)n.push(e[s--]);for(n.reverse(),s=i;s<e.length&&e[s]===t+(s-i);)n.push(e[s++]);return n}(ON(o,[i]),i);if(0===a.length)return;let l=ON(r,function(e,t){let i=[],n=0,s=0;for(;n<e.length||s<t.length;)if(n>=e.length)i.push(t[s++]);else if(s>=t.length)i.push(e[n++]);else if(e[n]===t[s]){n++,s++;continue}else e[n]<t[s]?i.push(e[n++]):s++;return i}(o,a));this.list.setSelection(l,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){let i=this.list.getSelection(),n=i.filter(e=>e!==t);this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class OL{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){let t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(`
251				.monaco-drag-image${t},
252				.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
253			`),e.listFocusAndSelectionForeground&&i.push(`
254				.monaco-drag-image${t},
255				.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
256			`),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color:  ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color:  ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color:  ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color:  ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color:  ${e.listInactiveFocusBackgroun
256d}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color:  ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color:  ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color:  ${e.listHoverForeground}; }`);let n=AH(e.listFocusAndSelectionOutline,AH(e.listSelectionOutline,e.listFocusOutline??""));n&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused.selected { outline: 1px solid ${n}; outline-offset: -1px;}`),e.listFocusOutline&&i.push(`
257				.monaco-drag-image${t},
258				.monaco-list${t}:focus .monaco-list-row.focused,
259				.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
260			`);let s=AH(e.listSelectionOutline,e.listInactiveFocusOutline??"");s&&i.push(`.monaco-list${t} .monaco-list-row.focused.selected { outline: 1px dotted ${s}; outline-offset: -1px; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropOverBackground&&i.push(`
261				.monaco-list${t}.drop-target,
262				.monaco-list${t} .monaco-list-rows.drop-target,
263				.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropOverBackground} !important; color: inherit !important; }
264			`),e.listDropBetweenBackground&&(i.push(`
265			.monaco-list${t} .monaco-list-rows.drop-target-before .monaco-list-row:first-child::before,
266			.monaco-list${t} .monaco-list-row.drop-target-before::before {
267				content: ""; position: absolute; top: 0px; left: 0px; width: 100%; height: 1px;
268				background-color: ${e.listDropBetweenBackground};
269			}`),i.push(`
270			.monaco-list${t} .monaco-list-rows.drop-target-after .monaco-list-row:last-child::after,
271			.monaco-list${t} .monaco-list-row.drop-target-after::after {
272				content: ""; position: absolute; bottom: 0px; left: 0px; width: 100%; height: 1px;
273				background-color: ${e.listDropBetweenBackground};
274			}`)),e.tableColumnsBorder&&i.push(`
275				.monaco-table > .monaco-split-view2,
276				.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,
277				.monaco-enable-motion .monaco-table:hover > .monaco-split-view2,
278				.monaco-enable-motion .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
279					border-color: ${e.tableColumnsBorder};
280				}
281
282				.monaco-enable-motion .monaco-table > .monaco-split-view2,
283				.monaco-enable-motion .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {
284					border-color: transparent;
285				}
286			`),e.tableOddRowsBackgroundColor&&i.push(`
287				.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,
288				.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,
289				.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {
290					background-color: ${e.tableOddRowsBackgroundColor};
291				}
292			`),this.styleElement.textContent=i.join("\n")}}let Ox={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackgroun
292d:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:gX.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:gX.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:gX.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},Ok={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}}};function ON(e,t){let i=[],n=0,s=0;for(;n<e.length||s<t.length;)if(n>=e.length)i.push(t[s++]);else if(s>=t.length)i.push(e[n++]);else if(e[n]===t[s]){i.push(e[n]),n++,s++;continue}else e[n]<t[s]?i.push(e[n++]):i.push(t[s++]);return i}let OD=(e,t)=>e-t;class OE{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let s=0;for(let r of this.renderers)r.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){let s=0;for(let r of this.renderers)r.disposeElement?.(e,t,i[s],n),s+=1}disposeTemplate(e){let t=0;for(let i of this.renderers)i.disposeTemplate(e[t++])}}class OT{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new ro.SL}}renderElement(e,t,i){let n=this.accessibilityProvider.getAriaLabel(e),s=n&&"string"!=typeof n?n:Or(n);i.disposables.add(aN(e=>{this.setAriaLabel(e.readObservable(s),i.container)}));let r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof r?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class OI{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){let t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){this.dnd.onDragStart?.(e,t)}onDragOver(e,t,i,n,s){return this.dnd.onDragOver(e,t,i,n,s)}onDragLeave(e,t,i,n){this.dnd.onDragLeave?.(e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd?.(e)}drop(e,t,i,n,s){this.dnd.drop(e,t,i,n,s)}dispose(){this.dnd.dispose()}}class OM{get onDidChangeFocus(){return sd.ju.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return sd.ju.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1,t=sd.ju.chain(this.disposables.add(new bc(this.view.domNode,"keydown")).event,t=>t.map(e=>new ok(e)).filter(t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode).map(e=>lS.stop(e,!0)).filter(()=>!1)),i=sd.ju.chain(this.disposables.add(new bc(this.view.domNode,"keyup")).event,t=>t.forEach(()=>e=!1).map(e=>new ok(e)).filter(e=>58===e.keyCode||e.shiftKey&&68===e.keyCode).map(e=>lS.stop(e,!0)).map(({browserEvent:e})=>{let t=this.getFocus(),i=t.length?t[0]:void 0,n=void 0!==i?this.view.element
292(i):void 0,s=void 0!==i?this.view.domElement(i):this.view.domNode;return{index:i,element:n,anchor:s,browserEvent:e}})),n=sd.ju.chain(this.view.onContextMenu,t=>t.filter(t=>!e).map(({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:new oE(aG(this.view.domNode),i),browserEvent:i})));return sd.ju.any(t,i,n)}get onKeyDown(){return this.disposables.add(new bc(this.view.domNode,"keydown")).event}get onDidFocus(){return sd.ju.signal(this.disposables.add(new bc(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return sd.ju.signal(this.disposables.add(new bc(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,n,s=Ok){this.user=e,this._options=s,this.focus=new Oh("focused"),this.anchor=new Oh("anchor"),this.eventBufferer=new sd.E7,this._ariaLabel="",this.disposables=new ro.SL,this._onDidDispose=new sd.Q5,this.onDidDispose=this._onDidDispose.event;let r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?this._options.accessibilityProvider?.getWidgetRole():"list";this.selection=new Od("listbox"!==r);let o=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(o.push(new OT(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant?.(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(e=>new OE(e.templateId,[...o,e]));let a={...s,dnd:s.dnd&&new OI(this,s.dnd)};if(this.view=this.createListView(t,i,n,a),this.view.domNode.setAttribute("role",r),s.styleController)this.styleController=s.styleController(this.view.domId);else{let e=mS(this.view.domNode);this.styleController=new OL(e,this.view.domId)}if(this.spliceable=new A0([new Ou(this.focus,this.view,s.identityProvider),new Ou(this.selection,this.view,s.identityProvider),new Ou(this.anchor,this.view,s.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new Ob(this,this.view)),("boolean"!=typeof s.keyboardSupport||s.keyboardSupport)&&(this.keyboardController=new Op(this,this.view,s),this.disposables.add(this.keyboardController)),s.keyboardNavigationLabelProvider){let e=s.keyboardNavigationDelegate||O_;this.typeNavigationController=new Ov(this,this.view,s.keyboardNavigationLabelProvider,s.keyboardNavigationEventFilter??(()=>!0),e),this.disposables.add(this.typeNavigationController)}if(this.mouseController=this.createMouseController(s),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider){let e=this.accessibilityProvider.getWidgetAriaLabel(),t=e&&"string"!=typeof e?e:Or(e);this.disposables.add(aN(e=>{this.ariaLabel=e.readObservable(t)}))}!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new Os(e,t,i,n)}createMouseController(e){return new OS(this)}updateOptions(e={}){this._options={...this._options,...e},this.typeNavigationController?.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),this.keyboardController?.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new A2(this.user,`Invalid start index: ${e}`);if(t<0)throw new A2(this.user,`Invalid delete count: ${t}`);(0!==t||0!==i.length)&&this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}
292element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(let t of e)if(t<0||t>=this.length)throw new A2(this.user,`Invalid index ${t}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(void 0===e){this.anchor.set([]);return}if(e<0||e>=this.length)throw new A2(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return this.anchor.get().at(0)}getAnchorElement(){let e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(let t of e)if(t<0||t>=this.length)throw new A2(this.user,`Invalid index ${t}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;let s=this.focus.get(),r=this.findNextIndex(s.length>0?s[0]+e:0,t,n);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;let s=this.focus.get(),r=this.findPreviousIndex(s.length>0?s[0]-e:0,t,n);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;let n=this.getFocus()[0];if(n!==i&&(void 0===n||i>n)){let s=this.findPreviousIndex(i,!1,t);s>-1&&n!==s?this.setFocus([s],e):this.setFocus([i],e)}else{let s=this.view.getScrollTop(),r=s+this.view.renderHeight;i>n&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==s&&(this.setFocus([]),await oV(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let n;let s=i(),r=this.view.getScrollTop()+s;n=0===r?this.view.indexAt(r):this.view.indexAfter(r-1);let o=this.getFocus()[0];if(o!==n&&(void 0===o||o>=n)){let i=this.findNextIndex(n,!1,t);i>-1&&o!==i?this.setFocus([i],e):this.setFocus([n],e)}else this.view.setScrollTop(r-this.view.renderHeight-s),this.view.getScrollTop()+i()!==r&&(this.setFocus([]),await oV(0),await this.focusPreviousPage(e,t,i))}focusLast(e,t){if(0===this.length)return;let i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(0===this.length)return;let n=this.findNextIndex(e,!1,i);n>-1&&this.setFocus([n],t)}findNextIndex(e,t=!1,i){for(let n=0;n<this.length&&(!(e>=this.length)||t);n++){if(e%=this.length,!i||i(this.element(e)))return e;e++}return -1}findPreviousIndex(e,t=!1,i){for(let n=0;n<this.length&&(!(e<0)||t);n++){if(e=(this.length+e%this.length)%this.length,!i||i(this.element(e)))return e;e--}return -1}getFocus(){return this.focus.get()}getFocusedElements(){return this.getFocus().map(e=>
292this.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new A2(this.user,`Invalid index ${e}`);let n=this.view.getScrollTop(),s=this.view.elementTop(e),r=this.view.elementHeight(e);if((0,re.hj)(t)){let e=r-this.view.renderHeight+i;this.view.setScrollTop(e*EE(t,0,1)+s-i)}else{let e=s+r,t=n+this.view.renderHeight;s<n+i&&e>=t||(s<n+i||e>=t&&r>=this.view.renderHeight?this.view.setScrollTop(s-i):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new A2(this.user,`Invalid index ${e}`);let i=this.view.getScrollTop(),n=this.view.elementTop(e),s=this.view.elementHeight(e);if(n<i+t||n+s>i+this.view.renderHeight)return null;let r=s-this.view.renderHeight+t;return Math.abs((i+t-n)/r)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(e=>
292this.view.element(e)),browserEvent:t}}_onFocusChange(){let e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){let e=this.focus.get();if(e.length>0){let t;this.accessibilityProvider?.getActiveDescendantId&&(t=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",t||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){let e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Oa([vq],OM.prototype,"onDidChangeFocus",null),Oa([vq],OM.prototype,"onDidChangeSelection",null),Oa([vq],OM.prototype,"onContextMenu",null),Oa([vq],OM.prototype,"onKeyDown",null),Oa([vq],OM.prototype,"onDidFocus",null),Oa([vq],OM.prototype,"onDidBlur",null),i(77077);let OR="selectOption.entry.template";class OA{get templateId(){return OR}renderTemplate(e){let t=Object.create(null);return t.root=e,t.text=lk(e,lI(".option-text")),t.detail=lk(e,lI(".option-detail")),t.decoratorRight=lk(e,lI(".option-decorator-right")),t}renderElement(e,t,i){let n=e.text,s=e.detail,r=e.decoratorRight,o=e.isDisabled;i.text.textContent=n,i.detail.textContent=s||"",i.decoratorRight.textContent=r||"",o?i.root.classList.add("option-disabled"):i.root.classList.remove("option-disabled")}disposeTemplate(e){}}class OO extends ro.JT{static{this.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32}static{this.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2}static{this.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3}constructor(e,t,i,n,s){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._selectionDetailsDisposables=this._register(new ro.SL),this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=s||Object.create(null),"number"!=typeof this.selectBoxOptions.minBottomMargin?this.selectBoxOptions.minBottomMargin=OO.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new sd.Q5,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(A1.setupManagedHover(AZ("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return OR}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=lI(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=lk(this.selectDropDownContainer,lI(".select-box-details-pane"));let t=lk(this.selectDropDownContainer,lI(".select-box-dropdown-container-width-control")),i=lk(t,lI(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",lk(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=mS(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(a6(this.selectDropDownContainer,ly.DRAG_START,e=>{lS.stop(e,!0)}))}registerListeners(){let e;this._register(a7(this.selectElement,"change",e=>{this.selected=e.target.selectedIndex,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(a6(this.selectElement,ly.CLICK,e=>{lS.stop(e),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(a6(this.selectElement,ly.MOUSE_DOWN,e=>{lS.stop(e)})),this._register(a6(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(a6(this.selectElement,"touchend",t=>{lS.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(a6(this.selectElement,ly.KEY_DOWN,e=>{let t=new ok(e),i=!1;sS.dz?(18===t.keyCode||16===t.keyCode||10===t.keyCode||3===t.keyCode)&&(i=!0):(18===t.keyCode&&t.altKey||16===t.keyCode&&t.altKey||10===t.keyCode||3===t.keyCode)&&(i=!0),i&&(this.showSelectDropDown(),lS.stop(e,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(0,as.fS)(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetail
292s=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled)),"string"==typeof e.description&&(this._hasDetails=!0)})),void 0!==t&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){this.selectList?.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){let e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join("\n")}
292styleSelectElement(){let e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){let e=this.styles.selectBackground??"",t=AH(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;let i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){let n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.textContent="",this.contextViewProvider&&!this._isVisible&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){this.contextViewProvider&&this._isVisible&&(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout||!this.selectList)return!1;{this.selectDropDownContainer.classList.add("visible");let t=aG(this.selectElement),i=ls(this.selectElement),n=aG(this.selectElement).getComputedStyle(this.selectElement),s=parseFloat(n.getPropertyValue("--dropdown-padding-top"))+parseFloat(n.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),o=i.top-OO.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=Math.max(this.setWidthControlElement(this.widthControlElement),Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=l,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&void 0===this._cachedMaxDetailsHeight&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());let d=this._hasDetails?this._cachedMaxDetailsHeight:0,u=h+s+d,c=Math.floor((r-s-d)/this.getHeight()),g=Math.floor((o-s-d)/this.getHeight());if(e)return!(i.top+i.height>t.innerHeight-22)&&!(i.top<OO.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN)&&(!(c<1)||!(g<1))&&(c<OO.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&g>c&&this.options.length>c?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetail
292sPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.top<OO.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||0===this._dropDownPosition&&c<1||1===this._dropDownPosition&&g<1)return this.hideSelectDropDown(!0),!1;if(0===this._dropDownPosition){if(this._isVisible&&c+g<1)return this.hideSelectDropDown(!0),!1;u>r&&(h=c*this.getHeight())}else u>o&&(h=g*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=l,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach((e,t)=>{let s=e.detail?e.detail.length:0,r=e.decoratorRight?e.decoratorRight.length:0,o=e.text.length+s+r;o>n&&(i=t,n=o)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=lo(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=lk(e,lI(".select-box-dropdown-list-container")),this.listRenderer=new OA,this.selectList=this._register(new OM("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:e=>{let t=e.text;return e.detail&&(t+=`. ${e.detail}`),e.decoratorRight&&(t+=`. ${e.decoratorRight}`),e.description&&(t+=`. ${e.description}`),t},getWidgetAriaLabel:()=>(0,rh.NC)(16,"Select Box"),getRole:()=>sS.dz?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);let t=this._register(new bc(this.selectDropDownListContainer,"keydown")),i=sd.ju.chain(t.event,e=>e.filter(()=>this.selectList.length>0).map(e=>new ok(e)));this._register(sd.ju.chain(i,e=>e.filter(e=>3===e.keyCode))(this.onEnter,this)),this._register(sd.ju.chain(i,e=>e.filter(e=>2===e.keyCode))(this.onEnter,this)),this._register(sd.ju.chain(i,e=>e.filter(e=>9===e.keyCode))(this.onEscape,this)),this._register(sd.ju.chain(i,e=>e.filter(e=>16===e.keyCode))(this.onUpArrow,this)),this._register(sd.ju.chain(i,e=>e.filter(e=>18===e.keyCode))(this.onDownArrow,this)),this._register(sd.ju.chain(i,e=>e.filter(e=>12===e.keyCode))(this.onPageDown,this)),this._register(sd.ju.chain(i,e=>e.filter(e=>11===e.keyCode))(this.onPageUp,this)),this._register(sd.ju.chain(i,e=>e.filter(e=>14===e.keyCode))(this.onHome,this)),this._register(sd.ju.chain(i,e=>e.filter(e=>13===e.keyCode))(this.onEnd,this)),this._register(sd.ju.chain(i,e=>e.filter(e=>e.keyCode>=21&&e.keyCode<=56||e.keyCode>=85&&e.keyCode<=113))(this.onCharacter,this)),this._register(a6(this.selectList.getHTMLElement(),ly.POINTER_UP,e=>this.onPointerUp(e))),this._register(this.selectList.onMouseOver(e=>void 0!==e.index&&this.selectList.setFocus([e.index]))),this._register(this.selectList.onDidChangeFocus(e=>this.onListFocus(e))),this._register(a6(this.selectDropDownContainer,ly.FOCUS_OUT,e=>{!this._isVisible||lh(e.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;lS.stop(e);let t=e.target;if(!t||t.classList.contains("slider"))return;let i=t.closest(".monaco-list-row");if(!i)return;let n=Number(i.getAttribute("data-index")),s=i.classList.contains("option-disabled");n>=0&&n<this.options.length&&!s&&(this.selected=n,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,t){let i=e=>{for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);"img"===(n.tagName&&n.tagName.toLowerCase())?n.remove():i(n)}},n=M3({value:e,supportThemeIcons:!0},{actionHandler:t});return n.element.classList.add("select-box-description-markdown"),i(n.element),n}
292onListFocus(e){this._isVisible&&this._hasDetails&&this.updateDetail(e.indexes[0])}updateDetail(e){this._selectionDetailsDisposables.clear(),this.selectionDetailsPane.textContent="";let t=this.options[e],i=t?.description??"",n=t?.descriptionIsMarkdown??!1;if(i){if(n){let e=t.descriptionMarkdownActionHandler,n=this._selectionDetailsDisposables.add(this.renderDescriptionMarkdown(i,e));this.selectionDetailsPane.appendChild(n.element)}else this.selectionDetailsPane.textContent=i;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){lS.stop(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){lS.stop(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){lS.stop(e,!0);let t=this.options[this.selected+1].isDisabled;if(t&&this.options.length>this.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(lS.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){lS.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onPageDown(e){lS.stop(e),this.selectList.focusNextPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){lS.stop(e),this.options.length<2||(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){lS.stop(e),this.options.length<2||(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){let t=tM.toString(e.keyCode),i=-1;for(let n=0;n<this.options.length-1;n++)if(i=(n+this.selected+1)%this.options.length,this.options[i].text.charAt(0).toUpperCase()===t&&!this.options[i].isDisabled){this.select(i),this.selectList.setFocus([i]),this.selectList.reveal(this.selectList.getFocus()[0]),lS.stop(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}}class OP extends ro.JT{constructor(e,t,i,n){super(),this.selected=0,this.selectBoxOptions=n||Object.create(null),this.options=[],this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new sd.Q5),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(vG.addTarget(this.selectElement)),[i6.Tap].forEach(e=>{this._register(a6(this.selectElement,e,e=>{this.selectElement.focus()}))}),this._register(a7(this.selectElement,"click",e=>{lS.stop(e,!0)})),this._register(a7(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(a7(this.selectElement,"keydown",e=>{let t=!1;
292sS.dz?(18===e.keyCode||16===e.keyCode||10===e.keyCode)&&(t=!0):(18===e.keyCode&&e.altKey||10===e.keyCode||3===e.keyCode)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){this.options&&(0,as.fS)(this.options,e)||(this.options=e,this.selectElement.options.length=0,this.options.forEach((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled))})),void 0!==t&&this.select(t)}select(e){0===this.options.length?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&"string"==typeof this.options[this.selected].text?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=""}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add("select-container"),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){this.selectElement&&(this.selectElement.style.backgroundColor=this.styles.selectBackground??"",this.selectElement.style.color=this.styles.selectForeground??"",this.selectElement.style.borderColor=this.styles.selectBorder??"")}createOption(e,t,i){let n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}}class OF extends vQ{constructor(e,t,i,n,s){super(),sS.dz&&!s?.useCustomDrawn?this.selectBoxDelegate=new OP(e,t,n,s):this.selectBoxDelegate=new OO(e,t,i,n,s),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,t){this.selectBoxDelegate.setOptions(e,t)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}}i(46020);class OB extends ro.JT{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof hr&&this._register(t.onDidChange(e=>{this.element&&this.handleActionChangeEvent(e)}))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new ho)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){let t=this.element=e;this._register(vG.addTarget(e));let i=this.options&&this.options.draggable;i&&(e.draggable=!0,ol&&this._register(a6(e,ly.DRAG_START,e=>e.dataTransfer?.setData(AG.TEXT,this._action.label)))),this._register(a6(t,i6.Tap,e=>this.onClick(e,!0))),this._register(a6(t,ly.MOUSE_DOWN,e=>{i||lS.stop(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")})),sS.dz&&this._register(a6(t,ly.CONTEXT_MENU,e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)})),this._register(a6(t,ly.CLICK,e=>{lS.stop(e,!0),this.options&&this.options.isMenu||this.onClick(e)})),this._register(a6(t,ly.DBLCLICK,e=>{lS.stop(e,!0)})),[ly.MOUSE_UP,ly.MOUSE_OUT].forEach(e=>{this._register(a6(t,e,e=>{lS.stop(e),t.classList.remove("active")}))})}onClick(e,t=!1){lS.stop(e,!0);let i=(0,re.Jp)(this._context)?this.options?.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}getHoverContents(){return this.getTooltip()}updateTooltip(){if(!this.element)return;let e=this.getHoverContents()??"";if(this.updateAriaLabel(),this.customHover||""===e)this.customHover&&this.customHover.update(e);else{let t=this.options.hoverDelegate??AZ("element");this.customHover=this._store.add(A1.setupManagedHover(t,this.element,e))}}updateAriaLabel(){if(this.element){let e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class OV extends OB{constructor(e,t,i){super(e,t,i={...i,icon:void 0!==i.icon&&i.icon,label:void 0===i.label||i.label}),this.options=i,this.cssClass=""}render(e){super.render(e),(0,re.p_)(this.element);let t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAr
292iaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding&&!this.options.keybindingNotRenderedWithLabel){let e=document.createElement("span");e.classList.add("keybinding"),e.textContent=this.options.keybinding,this.element.appendChild(e)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===ha.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label,this.options.keybinding&&(e=(0,rh.NC)(0,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):this.label?.classList.remove("codicon")}updateEnabled(){this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),this.element?.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),this.element?.classList.add("disabled"))}updateAriaLabel(){if(this.label){let e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(void 0!==this.action.checked?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class OW extends OB{constructor(e,t,i,n,s,r,o){super(e,t),this.selectBox=new OF(i,n,s,r,o),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){this.selectBox?.focus()}blur(){this.selectBox?.blur()}render(e){this.selectBox.render(e)}}i(81287);class OH extends ho{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new sd.Q5),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=lk(e,lI(".monaco-dropdown")),this._label=lk(this._element,lI(".dropdown-label"));let i=t.labelRenderer;for(let e of(i||(i=e=>(e.textContent=t.label||"",null)),[ly.CLICK,ly.MOUSE_DOWN,i6.Tap]))this._register(a6(this.element,e,e=>lS.stop(e,!0)));for(let e of[ly.MOUSE_DOWN,i6.Tap])this._register(a6(this._label,e,e=>{lC(e)&&0!==e.button||(this.visible?this.hide():this.show())}));this._register(a6(this._label,ly.KEY_DOWN,e=>{let t=new ok(e);(t.equals(3)||t.equals(10))&&(lS.stop(e,!0),this.visible?this.hide():this.show())}));let n=i(this._label);n&&this._register(n),this._register(vG.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class Oz extends OH{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>
292this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class OU extends OB{get onDidChangeVisibility(){return this._onDidChangeVisibility.event}constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new sd.Q5),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=n,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;let t=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>(this.element=lk(e,lI("a.action-label")),this.renderLabel(this.element)),menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Oz(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility(e=>{this.element?.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){let e=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return e.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}renderLabel(e){let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter(e=>!!e):this.options.classNames&&(t=this.options.classNames),t.find(e=>"icon"===e)||t.push("codicon"),e.classList.add(...t),this._action.label&&this._register(A1.setupManagedHover(this.options.hoverDelegate??AZ("mouse"),e,this._action.label)),null}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){this.dropdownMenu?.show()}updateEnabled(){let e=!this.action.enabled;this.actionItem?.classList.toggle("disabled",e),this.element?.classList.toggle("disabled",e)}}let OK={keybindingLabelBackground:mD(_b),keybindingLabelForeground:mD(_C),keybindingLabelBorder:mD(_w),keybindingLabelBottomBorder:mD(_y),keybindingLabelShadow:mD(pb)},O$={buttonForeground:mD(p8),buttonSeparator:mD(_e),buttonBackground:mD(_t),buttonHoverBackground:mD(_i),buttonSecondaryForeground:mD(_s),buttonSecondaryBackground:mD(_r),buttonSecondaryHoverBackground:mD(_o),buttonBorder:mD(_n)}
292,Oj={progressBarBackground:mD(mX)},Oq={inputActiveOptionBorder:mD(pj),inputActiveOptionForeground:mD(pQ),inputActiveOptionBackground:mD(pG)};mD(_a),mD(_l),mD(_h),mD(_d),mD(_u),mD(_c),mD(_g);let OG={checkboxBackground:mD(_f),checkboxBorder:mD(_p),checkboxForeground:mD(_m),checkboxDisabledBackground:mD(__),checkboxDisabledForeground:mD(_v)};mD(m2),mD(m5),mD(pb),mD(pC),mD(pR),mD(pA),mD(pO),mD(mj);let OQ={inputBackground:mD(pU),inputForeground:mD(pK),inputBorder:mD(p$),inputValidationInfoBorder:mD(pZ),inputValidationInfoBackground:mD(pY),inputValidationInfoForeground:mD(pJ),inputValidationWarningBorder:mD(p0),inputValidationWarningBackground:mD(pX),inputValidationWarningForeground:mD(p1),inputValidationErrorBorder:mD(p4),inputValidationErrorBackground:mD(p2),inputValidationErrorForeground:mD(p5)},OY={listFilterWidgetBackground:mD(_W),listFilterWidgetOutline:mD(_H),listFilterWidgetNoMatchesOutline:mD(_z),listFilterWidgetShadow:mD(_U),inputBoxStyles:OQ,toggleStyles:Oq},OJ={badgeBackground:mD(mq),badgeForeground:mD(mG),badgeBorder:mD(mK)};mD(pS),mD(py),mD(pL),mD(pL),mD(px);let OZ={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:mD(_S),listFocusForeground:mD(_L),listFocusOutline:mD(_x),listActiveSelectionBackground:mD(_N),listActiveSelectionForeground:mD(_D),listActiveSelectionIconForeground:mD(_E),listFocusAndSelectionOutline:mD(_k),listFocusAndSelectionBackground:mD(_N),listFocusAndSelectionForeground:mD(_D),listInactiveSelectionBackground:mD(_T),listInactiveSelectionIconForeground:mD(_M),listInactiveSelectionForeground:mD(_I),listInactiveFocusBackground:mD(_R),listInactiveFocusOutline:mD(_A),listHoverBackground:mD(_O),listHoverForeground:mD(_P),listDropOverBackground:mD(_F),listDropBetweenBackground:mD(_B),listSelectionOutline:mD(m$),listHoverOutline:mD(m$),treeIndentGuidesStroke:mD(_K),treeInactiveIndentGuidesStroke:mD(_$),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:mD(mQ),tableColumnsBorder:mD(_j),tableOddRowsBackgroundColor:mD(_q)};function OX(e){return function(e,t){let i={...t};for(let t in e){let n=e[t];i[t]=void 0!==n?mD(n):void 0}return i}(e,OZ)}
292let O1={selectBackground:mD(p6),selectListBackground:mD(p7),selectForeground:mD(p3),decoratorRightForeground:mD(_4),selectBorder:mD(p9),focusBorder:mD(mU),listFocusBackground:mD(_8),listInactiveSelectionIconForeground:mD(_9),listFocusForeground:mD(_3),listFocusOutline:(tg=gX.transparent.toString(),`var(${mN(m$)}, ${tg})`),listHoverBackground:mD(_O),listHoverForeground:mD(_P),listHoverOutline:mD(m$),selectListBorder:mD(m4),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},O0={shadowColor:mD(pb),borderColor:mD(_G),foregroundColor:mD(_Q),backgroundColor:mD(_Y),selectionForegroundColor:mD(_J),selectionBackgroundColor:mD(_Z),selectionBorderColor:mD(_X),separatorColor:mD(_1),scrollbarShadow:mD(mQ),scrollbarSliderBackground:mD(mY),scrollbarSliderHoverBackground:mD(mJ),scrollbarSliderActiveBackground:mD(mZ)};function O2(e){if(sS.$L)return"custom";let t=e.getValue("window");if(t){if(sS.dz&&!0===t.nativeTabs||sS.dz&&!1===t.nativeFullScreen)return"native";let e=t.titleBarStyle;if("native"===e||"custom"===e)return e}return"custom"}i(17527);var O5=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},O4=function(e,t){return function(i,n){t(i,n,e)}};function O6(e,t,i,n=e=>"navigation"===e,s=()=>!1,r=!1){let o,a;Array.isArray(t)?(o=t,a=t):(o=t.primary,a=t.secondary);let l=new Set;for(let[t,s]of e){let e;for(let h of(n(t)?(e=o).length>0&&r&&e.push(new ha):(e=a).length>0&&e.push(new ha),s)){i&&(h=h instanceof ds&&h.alt?h.alt:h);let n=e.push(h);h instanceof hl&&l.add({group:t,action:h,index:n-1})}}for(let{group:e,action:t,index:i}of l){let r=n(e)?o:a,l=t.actions;s(t,e,r.length)&&r.splice(i,1,...l)}}let O7=class extends OV{constructor(e,t,i,n,s,r,o,a){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t?.draggable,keybinding:t?.keybinding,hoverDelegate:t?.hoverDelegate,keybindingNotRenderedWithLabel:t?.keybindingNotRenderedWithLabel}),this._options=t,this._keybindingService=i,this._notificationService=n,this._contextKeyService=s,this._themeService=r,this._contextMenuService=o,this._accessibilityService=a,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new ro.XK),this._altKey=lP.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(e){this._notificationService.error(e)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1,i=()=>{let e=!!this._menuItemAction.alt?.enabled&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);e!==this._wantsAltCommand&&(this._wantsAltCommand=e,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(a6(e,"mouseleave",e=>{t=!1,i()})),this._register(a6(e,"mouseenter",e=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){let e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label,n=t?(0,rh.NC)(1644,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&this._menuItemAction.alt?.enabled){let e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),i=t&&t.getLabel(),s=i?(0,rh.NC)(1645,"{0} ({1})",e,i):e;n=(0,rh.NC)(1646,"{0}\n[{1}] {2}",n,Ad.modifierLabels[sS.OS].altKey,s)}return n}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){var t;this._itemClassDispose.value=void 0;let{element:i,label:n}=this;if(!i||!n)return;let s=this._commandAction.checked&&(t=e.toggled)&&void 0!==t.condition&&e.toggled.icon?e.toggled.icon:e.icon;if(s){if(iH.isThemeIcon(s)){let e=iH.asClassNameArray(s);n.classList.add(...e),this._itemClassDispose.value=(0,ro.OF)(()=>{n.classList.remove(...e)})}else n.style.backgroundImage=vL(this._themeService.getColorTheme(
292).type)?AK(s.dark):AK(s.light),n.classList.add("icon"),this._itemClassDispose.value=(0,ro.F8)((0,ro.OF)(()=>{n.style.backgroundImage="",n.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};O7=O5([O4(2,SP),O4(3,Sd),O4(4,hZ),O4(5,CG),O4(6,Tu),O4(7,mg)],O7);let O3=class extends OU{constructor(e,t,i,n,s){super(e,{getActions:()=>e.actions},n,{...t,menuAsChild:t?.menuAsChild??!1,classNames:t?.classNames??(iH.isThemeIcon(e.item.icon)?iH.asClassName(e.item.icon):void 0),keybindingProvider:t?.keybindingProvider??(e=>i.lookupKeybinding(e.id))}),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),(0,re.p_)(this.element),e.classList.add("menu-entry");let{icon:t}=this._action.item;if(t&&!iH.isThemeIcon(t)){this.element.classList.add("icon");let e=()=>{this.element&&(this.element.style.backgroundImage=vL(this._themeService.getColorTheme().type)?AK(t.dark):AK(t.light))};e(),this._register(this._themeService.onDidColorThemeChange(()=>{e()}))}}};O3=O5([O4(2,SP),O4(3,Tu),O4(4,CG)],O3);let O9=class extends OB{constructor(e,t,i,n,s,r,o,a){let l;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=r,this._instaService=o,this._storageService=a,this._defaultActionDisposables=this._register(new ro.SL),this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h=t?.togglePrimaryAction?a.get(this._storageKey,1):void 0;h&&(l=e.actions.find(e=>h===e.id)),l||(l=e.actions[0]),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(O7,l,{keybinding:this._getDefaultActionKeybindingLabel(l)}));let d={keybindingProvider:e=>this._keybindingService.lookupKeybinding(e.id),...t,menuAsChild:t?.menuAsChild??!0,classNames:t?.classNames??["codicon","codicon-chevron-down"],actionRunner:t?.actionRunner??this._register(new ho)};this._dropdown=this._register(new OU(e,e.actions,this._contextMenuService,d)),t?.togglePrimaryAction&&this._register(this._dropdown.actionRunner.onDidRun(e=>{e.action instanceof ds&&this.update(e.action)}))}update(e){this._options?.togglePrimaryAction&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultActionDisposables.clear(),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(O7,e,{keybinding:this._getDefaultActionKeybindingLabel(e)})),this._defaultAction.actionRunner=this._defaultActionDisposables.add(new class extends ho{async runAction(e,t){await e.run(void 0)}}),this._container&&this._defaultAction.render(lN(this._container,lI(".action-container")))}_getDefaultActionKeybindingLabel(e){let t;if(this._options?.renderKeybindingWithDefaultActionLabel){let i=this._keybindingService.lookupKeybinding(e.id);i&&(t=`(${i.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}set actionRunner(e){super.actionRunner=e,this._defaultAction.actionRunner=e,this._dropdown.actionRunner=e}get actionRunner(){return super.actionRunner}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");let t=lI(".action-container");this._defaultAction.render(lk(this._container,t)),this._register(a6(t,ly.KEY_DOWN,e=>{let t=new ok(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())}));let i=lI(".dropdown-action-container");this._dropdown.render(lk(this._container,i)),this._register(a6(i,ly.KEY_DOWN,e=>{let t=new ok(e);t.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),this._defaultAction.element?.focus(),t.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}};O9=O5([O4(2,SP),O4(3,Sd),O4(4,Tu),O4(5,de),O4(6,he),O4(7,RB)],O9);let O8=class extends OW{constructor(e,t,i){super(null,e,e.actions.map(e=>({text:e.id===ha.ID?"─────────":e.label,isDisabled:!e.enabled})),0,t,O1,{ariaLabel:e.tooltip,optionsAsChildren:!0,useCustomDrawn:!function(e,t){var i;if(sS.$L)return!1;let n=(i=void 0,"native"===(i=O2(e))),s=e.getValue("window");return s?.menuStyle==="native"?!!sS.dz||!!n:s?.menuStyle!=="custom"&&n}(i)}),this.select(Math.max(0,e.actions.findIndex(e=>e.checked)))}render(e){super.render(e),e.style.borderColor=mD(p9)}runAction(e,t){let i=this.action.actions[t];i&&this.actionRunner.run(i)}};function Pe(e,t,i){return t instanceof ds?e.createInstance(O7,t,i):t instanceof dn?t.item.isSelection?e.createInstance(O8,t):t.item.isSplitButton?e.createInstance(O9,t,{...i,togglePrimaryAction:"boolean"!=typeof t.item.isSplitButton&&t.item.isSplitButton.togglePrimaryAction}):e.createInstance(O3,t,i):void 0}O8=O5([O4(1,Td),O4(2,uE)],O8);class Pt extends ro.JT{get onDidBlur(){return this._onDidBlur.event}get onDidCancel(){return this._onDidCancel.event}get onDidRun(){return this._onDidRun.event}get onWillRun(){return this._onWillRun.event}constructor(e,t={}){let i,n;switch(super(),this._actionRunnerDisposables=this._register(new ro.SL),this.viewItemDisposables=this._register(new ro.b2),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new sd.Q5),this._onDidCancel=this._register(new sd.Q5({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.cancelHasListener=!1,this._onDidRun=this._register(new sd.Q5),this._onWillRun=this._register(new sd.Q5),this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:this.options.triggerKeys?.keyDown??!1,keys:this.options.triggerKeys?.keys??[3,10]},this._hoverDelegate=t.hoverDelegate??this._register(AX()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new ho,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(e=>this._onWillRun.fire(e))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",this._orientation){case 0:i=[15],n=[17];break;case 1:i=[16],n=[18],this.domNode.className+=" vertical"}this._register(a6(this.domNode,ly.KEY_DOWN,e=>{let t=new ok(e),s=!0,r="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;i&&(t.equals(i[0])||t.equals(i[1]))?s=this.focusPrevious():n&&(t.equals(n[0])||t.equals(n[1]))?s=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?s=this.focusFirst():t.equals(13)?
292s=this.focusLast():t.equals(2)&&r instanceof OB&&r.trapsArrowNavigation?s=this.focusNext(void 0,!0):this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:s=!1,s&&(t.preventDefault(),t.stopPropagation())})),this._register(a6(this.domNode,ly.KEY_UP,e=>{let t=new ok(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026)||t.equals(16)||t.equals(18)||t.equals(15)||t.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(lx(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{lg()!==this.domNode&&lh(lg(),this.domNode)||(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){let e=this.viewItems.find(e=>e instanceof OB&&e.isEnabled());e instanceof OB&&e.setFocusable(!0)}else this.viewItems.forEach(e=>{e instanceof OB&&e.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){let t=this.actionsList.children[e];if(lh(lg(),t)){this.focusedItem=e,this.viewItems[this.focusedItem]?.showHover?.();break}}}get context(){return this._context}set context(e){this._context=e,this.viewItems.forEach(t=>t.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(e=>this._onDidRun.fire(e))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(e=>this._onWillRun.fire(e))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){if("number"==typeof e)return this.viewItems[e]?.action;if(l_(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t<this.actionsList.childNodes.length;t++)if(this.actionsList.childNodes[t]===e)return this.viewItems[t].action}}push(e,t={}){let i=Array.isArray(e)?e:[e],n=(0,re.hj)(t.index)?t.index:null;if(i.forEach(e=>{let i;let s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let r={hoverDelegate:this._hoverDelegate,...t,isTabList:"tablist"===this.options.ariaRole};this.options.actionViewItemProvider&&(i=this.options.actionViewItemProvider(e,r)),i||(i=new OV(this.context,e,r)),this.options.allowContextMenu||this.viewItemDisposables.set(i,a6(s,ly.CONTEXT_MENU,e=>{lS.stop(e,!0)})),i.actionRunner=this._actionRunner,i.setActionContext(this.context),i.render(s),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(i)):(this.actionsList.insertBefore(s,this.actionsList.children[n]),this.viewItems.splice(n,0,i),n++)}),this.focusable){let e=!1;for(let t of this.viewItems)t instanceof OB&&(!e&&t.action.id!==ha.ID&&(t.isEnabled()||!this.options.focusOnlyEnabledItems)?(t.setFocusable(!0),e=!0):t.setFocusable(!1))}"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e<this.actionsList.children.length){let t=this.actionsList.children.item(e);if(t)return t.clientWidth}return 0}pull(e){e>=0&&e<this.viewItems.length&&(this.actionsList.childNodes[e].remove(),this.viewItemDisposables.deleteAndDispose(this.viewItems[e]),(0,ro.B9)(this.viewItems.splice(e,1)),this.refreshRole())}clear(){this.isEmpty()||(this.viewItems=(0,ro.B9)(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),a5(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return 0===this.viewItems.length}focus(e){let t,i=!1;if(void 0===e?i=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(i=e),i&&void 0===this.focusedItem){let e=this.viewItems.findIndex(e=>e.isEnabled());this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==t&&(this.focusedItem=t),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e,t){let i;if(void 0===this.focusedItem)this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;let n=this.focusedItem;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=n,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==n&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===ha.ID));return this.updateFocus(void 0,void 0,t),!0}focusPrevious(e){let t;if(void 0===this.focusedItem)this.focusedItem=0;else if(this.viewItems.length<=1)return!1;let i=this.focusedItem;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=i,!1;this.focusedItem=this.viewItems.length-1}t=this.viewItems[this.focusedItem]}while(this.focusedItem!==i&&(this.options.focusOnlyEnabledItems&&!t.isEnabled()||t.action.id===ha.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&this.viewItems[this.previouslyFocusedItem]?.blur();let n=void 0!==this.focusedItem?this.viewItems[this.focusedItem]:void 0;if(n){let s=!0;(0,re.mf)(n.focus)||(s=!1),this.options.focusOnlyEnabledItems&&(0,re.mf)(n.isEnabled)&&!n.isEnabled()&&(s=!1),n.action.id===ha.ID&&(s=!1),s?(i||this.previouslyFocusedItem!==this.focusedItem)&&(n.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),s&&n.showHover?.()}}doTrigger(e){if(void 0===this.focusedItem)return;let t=this.viewItems[this.focusedItem];if(t instanceof OB){let i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=(0,ro.B9)(this.viewItems),this.getContainer().remove(),super.dispose()}}let Pi=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,Pn=/(&amp;)?(&amp;)([^\s&])/g;(tf=nW||(nW={}))[tf.Right=0]="Right",tf[tf.Left=1]="Left",(tm=nH||(nH={}))[tm.Above=0]="Above",tm[tm.Below=1]="Below";class Ps extends Pt{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");let s=document.createElement("div");s.classList.add("monaco-menu"),s.setAttribute("role","presentation"),super(s,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...sS.dz||sS.IJ?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=s,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,n),this._register(vG.addTarget(s)),this._register(a6(s,ly.KEY_DOWN,e=>{new ok(e).equals(2)&&e.preventDefault()})),i.enableMnemonics&&this._register(a6(s,ly.KEY_DOWN,e=>{let t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){lS.stop(e,!0);let i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof Po&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){let e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}})),sS.IJ&&this._register(a6(s,ly.KEY_DOWN,e=>{let t=new ok(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),lS.stop(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),lS.stop(e,!0))})),this._register(a6(this.domNode,ly.MOUSE_OUT,e=>{lh(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())})),this._register(a6(this.actionsList,ly.MOUSE_OVER,e=>{let t=e.target;if(t&&lh(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){let e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})),this._register(vG.addTarget(this.actionsList)),this._register(a6(this.actionsList,i6.Tap,e=>{let t=e.initialTarget;if(t&&lh(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){let e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}));let r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new bi(s,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));let o=this.scrollableElement.getDomNode();o.style.position="",this.styleScrollElement(o,n),this._register(a6(s,i6.Change,e=>{lS.stop(e,!0);let t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})})),this._register(a6(o,ly.MOUSE_UP,e=>{e.preventDefault()}));let a=aG(e);s.style.maxHeight=`${Math.max(10,a.innerHeight-e.getBoundingClientRect().top-35)}
292px`,t=t.filter((e,n)=>i.submenuIds?.has(e.id)?(console.warn(`Found submenu cycle: ${e.id}`),!1):!(e instanceof ha)||n!==t.length-1&&0!==n&&!(t[n-1]instanceof ha)),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(e=>!(e instanceof Pa)).forEach((e,t,i)=>{e.updatePositionInSet(t+1,i.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(lc(e)?this.styleSheet=mS(e):(Ps.globalStyleSheet||(Ps.globalStyleSheet=mS()),this.styleSheet=Ps.globalStyleSheet)),this.styleSheet.textContent=function(e,t){let i=`
293.monaco-menu {
294	font-size: 13px;
295	border-radius: 5px;
296	min-width: 160px;
297}
298
299${Pl(rr.menuSelection)}
300${Pl(rr.menuSubmenu)}
301
302.monaco-menu .monaco-action-bar {
303	text-align: right;
304	overflow: hidden;
305	white-space: nowrap;
306}
307
308.monaco-menu .monaco-action-bar .actions-container {
309	display: flex;
310	margin: 0 auto;
311	padding: 0;
312	width: 100%;
313	justify-content: flex-end;
314}
315
316.monaco-menu .monaco-action-bar.vertical .actions-container {
317	display: inline-block;
318}
319
320.monaco-menu .monaco-action-bar.reverse .actions-container {
321	flex-direction: row-reverse;
322}
323
324.monaco-menu .monaco-action-bar .action-item {
325	cursor: pointer;
326	display: inline-block;
327	transition: transform 50ms ease;
328	position: relative;  /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
329}
330
331.monaco-menu .monaco-action-bar .action-item.disabled {
332	cursor: default;
333}
334
335.monaco-menu .monaco-action-bar .action-item .icon,
336.monaco-menu .monaco-action-bar .action-item .codicon {
337	display: inline-block;
338}
339
340.monaco-menu .monaco-action-bar .action-item .codicon {
341	display: flex;
342	align-items: center;
343}
344
345.monaco-menu .monaco-action-bar .action-label {
346	font-size: 11px;
347	margin-right: 4px;
348}
349
350.monaco-menu .monaco-action-bar .action-item.disabled .action-label,
351.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
352	color: var(--vscode-disabledForeground);
353}
354
355/* Vertical actions */
356
357.monaco-menu .monaco-action-bar.vertical {
358	text-align: left;
359}
360
361.monaco-menu .monaco-action-bar.vertical .action-item {
362	display: block;
363}
364
365.monaco-menu .monaco-action-bar.vertical .action-label.separator {
366	display: block;
367	border-bottom: 1px solid var(--vscode-menu-separatorBackground);
368	padding-top: 1px;
369	padding: 30px;
370}
371
372.monaco-menu .secondary-actions .monaco-action-bar .action-label {
373	margin-left: 6px;
374}
375
376/* Action Items */
377.monaco-menu .monaco-action-bar .action-item.select-container {
378	overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
379	flex: 1;
380	max-width: 170px;
381	min-width: 60px;
382	display: flex;
383	align-items: center;
384	justify-content: center;
385	margin-right: 10px;
386}
387
388.monaco-menu .monaco-action-bar.vertical {
389	margin-left: 0;
390	overflow: visible;
391}
392
393.monaco-menu .monaco-action-bar.vertical .actions-container {
394	display: block;
395}
396
397.monaco-menu .monaco-action-bar.vertical .action-item {
398	padding: 0;
399	transform: none;
400	display: flex;
401}
402
403.monaco-menu .monaco-action-bar.vertical .action-item.active {
404	transform: none;
405}
406
407.monaco-menu .monaco-action-bar.vertical .action-menu-item {
408	flex: 1 1 auto;
409	display: flex;
410	height: 2em;
411	align-items: center;
412	position: relative;
413	margin: 0 4px;
414	border-radius: 4px;
415}
416
417.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,
418.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {
419	opacity: unset;
420}
421
422.monaco-menu .monaco-action-bar.vertical .action-label {
423	flex: 1 1 auto;
424	text-decoration: none;
425	padding: 0 1em;
426	background: none;
427	font-size: 12px;
428	line-height: 1;
429}
430
431.monaco-menu .monaco-action-bar.vertical .keybinding,
432.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
433	display: inline-block;
434	flex: 2 1 auto;
435	padding: 0 1em;
436	text-align: right;
437	font-size: 12px;
438	line-height: 1;
439	opacity: 0.7;
440}
441
442.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
443	height: 100%;
444}
445
446.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
447	font-size: 16px !important;
448	display: flex;
449	align-items: center;
450}
451
452.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
453	margin-left: auto;
454	margin-right: -20px;
455}
456
457.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
458.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
459	opacity: 0.4;
460}
461
462.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
463	display: inline-block;
464	box-sizing: border-box;
465	margin: 0;
466}
467
468.monaco-menu .monaco-action-bar.vertical .action-item {
469	position: static;
470	overflow: visible;
471}
472
473.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
474	position: absolute;
475}
476
477.monaco-menu .monaco-action-bar.vertical .action-label.separator {
478	width: 100%;
479	height: 0px !important;
480	opacity: 1;
481}
482
483.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
484	padding: 0.7em 1em 0.1em 1em;
485	font-weight: bold;
486	opacity: 1;
487}
488
489.monaco-menu .monaco-action-bar.vertical .action-label:hover {
490	color: inherit;
491}
492
493.monaco-menu .monaco-action-bar.vertical .menu-item-check {
494	position: absolute;
495	visibility: hidden;
496	width: 1em;
497	height: 100%;
498}
499
500.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
501	visibility: visible;
502	display: flex;
503	align-items: center;
504	justify-content: center;
505}
506
507/* Context Menu */
508
509.context-view.monaco-menu-container {
510	outline: 0;
511	border: none;
512	animation: fadeIn 0.083s linear;
513	-webkit-app-region: no-drag;
514}
515
516.context-view.monaco-menu-container :focus,
517.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
518.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
519	outline: 0;
520}
521
522.hc-black .context-view.monaco-menu-container,
523.hc-light .context-view.monaco-menu-container,
524:host-context(.hc-black) .context-view.monaco-menu-container,
525:host-context(.hc-light) .context-view.monaco-menu-container {
526	box-shadow: none;
527}
528
529.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,
530.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,
531:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,
532:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
533	background: none;
534}
535
536/* Vertical Action Bar Styles */
537
538.monaco-menu .monaco-action-bar.vertical {
539	padding: 4px 0;
540}
541
542.monaco-menu .monaco-action-bar.vertical .action-menu-item {
543	height: 2em;
544}
545
546.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
547.monaco-menu .monaco-action-bar.vertical .keybinding {
548	font-size: inherit;
549	padding: 0 2em;
550	max-height: 100%;
551}
552
553.monaco-menu .monaco-action-bar.vertical .menu-item-check {
554	font-size: inherit;
555	width: 2em;
556}
557
558.monaco-menu .monaco-action-bar.vertical .action-label.separator {
559	font-size: inherit;
560	margin: 5px 0 !important;
561	padding: 0;
562	border-radius: 0;
563}
564
565.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,
566:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
567	margin-left: 0;
568	margin-right: 0;
569}
570
571.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
572	font-size: 60%;
573	padding: 0 1.8em;
574}
575
576.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,
577:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
578	height: 100%;
579	mask-size: 10px 10px;
580	-webkit-mask-size: 10px 10px;
581}
582
583.monaco-menu .action-item {
584	cursor: default;
585}`;if(t){i+=`
586			/* Arrows */
587			.monaco-scrollable-element > .scrollbar > .scra {
588				cursor: pointer;
589				font-size: 11px !important;
590			}
591
592			.monaco-scrollable-element > .visible {
593				opacity: 1;
594
595				/* Background rule added for IE9 - to allow clicks on dom node */
596				background:rgba(0,0,0,0);
597
598				transition: opacity 100ms linear;
599			}
600			.monaco-scrollable-element > .invisible {
601				opacity: 0;
602				pointer-events: none;
603			}
604			.monaco-scrollable-element > .invisible.fade {
605				transition: opacity 800ms linear;
606			}
607
608			/* Scrollable Content Inset Shadow */
609			.monaco-scrollable-element > .shadow {
610				position: absolute;
611				display: none;
612			}
613			.monaco-scrollable-element > .shadow.top {
614				display: block;
615				top: 0;
616				left: 3px;
617				height: 3px;
618				width: 100%;
619			}
620			.monaco-scrollable-element > .shadow.left {
621				display: block;
622				top: 3px;
623				left: 0;
624				height: 100%;
625				width: 3px;
626			}
627			.monaco-scrollable-element > .shadow.top-left-corner {
628				display: block;
629				top: 0;
630				left: 0;
631				height: 3px;
632				width: 3px;
633			}
634			/* Fix for https://github.com/microsoft/vscode/issues/103170 */
635			.monaco-menu .action-item .monaco-submenu {
636				z-index: 1;
637			}
638		`;let t=e.scrollbarShadow;t&&(i+=`
639				.monaco-scrollable-element > .shadow.top {
640					box-shadow: ${t} 0 6px 6px -6px inset;
641				}
642
643				.monaco-scrollable-element > .shadow.left {
644					box-shadow: ${t} 6px 0 6px -6px inset;
645				}
646
647				.monaco-scrollable-element > .shadow.top.left {
648					box-shadow: ${t} 6px 6px 6px -6px inset;
649				}
650			`);let n=e.scrollbarSliderBackground;n&&(i+=`
651				.monaco-scrollable-element > .scrollbar > .slider {
652					background: ${n};
653				}
654			`);let s=e.scrollbarSliderHoverBackground;s&&(i+=`
655				.monaco-scrollable-element > .scrollbar > .slider:hover {
656					background: ${s};
657				}
658			`);let r=e.scrollbarSliderActiveBackground;r&&(i+=`
659				.monaco-scrollable-element > .scrollbar > .slider.active {
660					background: ${r};
661				}
662			`)}return i}(t,!!lc(e))}styleScrollElement(e,t){let i=t.foregroundColor??"",n=t.backgroundColor??"",s=t.borderColor?`1px solid ${t.borderColor}`:"",r=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=s,e.style.borderRadius="5px",e.style.color=i,e.style.backgroundColor=n,e.style.boxShadow=r}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){let t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t<this.actionsList.children.length;t++)if(e===this.actionsList.children[t]){this.focusedItem=t;break}}updateFocus(e){super.updateFocus(e,!0,!0),void 0!==this.focusedItem&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof ha)return new Pa(t.context,e,{icon:!0},this.menuStyles);if(e instanceof hl){let n=new Po(e,e.actions,i,{...t,submenuIds:new Set([...t.submenuIds||[],e.id])},this.menuStyles);if(t.enableMnemonics){let e=n.getMnemonic();if(e&&n.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(n),this.mnemonics.set(e,t)}}return n}{let i=t.getKeyBinding?.(e)?.getLabel(),n={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext,keybinding:i},s=new Pr(t.context,e,n,this.menuStyles);if(t.enableMnemonics){let e=s.getMnemonic();if(e&&s.isEnabled()){let t=[];this.mnemonics.has(e)&&(t=this.mnemonics.get(e)),t.push(s),this.mnemonics.set(e,t)}}return s}}}class Pr extends OB{constructor(e,t,i,n){if(super(t,t,i={...i,isMenu:!0,icon:void 0!==i.icon&&i.icon,label:void 0===i.label||i.label}),this.menuStyle=n,this.options=i,this.cssClass="",this.options.label&&i.enableMnemonics){let e=this.action.label;if(e){let t=Pi.exec(e);t&&(this.mnemonic=(t[1]?t[1]:t[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new oK(()=>{this.element&&(this._register(a6(this.element,ly.MOUSE_UP,e=>{(lS.stop(e,!0),ol)?new oE(aG(this.element),e).rightButton||this.onClick(e):setTimeout(()=>{this.onClick(e)},0)})),this._register(a6(this.element,ly.CONTEXT_MENU,e=>{lS.stop(e,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=lk(this.element,lI("a.action-menu-item")),this._action.id===ha.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=lk(this.item,lI("span.menu-item-check"+iH.asCSSSelector(rr.menuSelection))),this.check.setAttribute("role","none"),this.label=lk(this.item,lI("span.action-label")),this.options.label&&this.options.keybinding&&(lk(this.item,lI("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){super.focus(),this.item?.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){if(this.label&&this.options.label){a5(this.label);let e=Tj(this.action.label);if(e){let t=function(e){let t=Pi.exec(e);if(!t)return e;let i=!t[1];return e.replace(Pi,i?"$2$3":"").trim()}(e);this.options.enableMnemonics||(e=t),this.label.setAttribute("aria-label",t.replace(/&&/g,"&"));let i=Pi.exec(e);if(i){e=rk(e),Pn.lastIndex=0;let t=Pn.exec(e);for(;t&&t[1];)t=Pn.exec(e);let n=e=>e.replace(/&amp;&amp;/g,"&amp;");t?this.label.append(rD(n(e.substr(0,t.index))," "),lI("u",{"aria-hidden":"true"},t[3]),function(e,t){if(!e)return e;let i=e.length;if(0===i)return e;let n=i,s=-1;for(;-1!==(s=e.lastIndexOf(" ",n-1))&&s+1===n;){if(0===s)return"";n=s}return e.substring(0,n)}(n(e.substr(t.index+t[0].length))," ")):this.label.textContent=n(e).trim(),this.item?.setAttribute("aria-keyshortcuts",(i[1]?i[1]:i[3]).toLocaleLowerCase())}else this.label.textContent=e.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;let e=this.action.checked;this.item.classList.toggle("checked",!!e),void 0!==e?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){let e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroun
662dColor?this.menuStyle.selectionBackgroundColor:void 0,n=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",s=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=n,this.item.style.outlineOffset=s),this.check&&(this.check.style.color=t??"")}}class Po extends Pr{constructor(e,t,i,n,s){super(e,e,n,s),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new ro.SL),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:{horizontal:nW.Right,vertical:nH.Below},this.showScheduler=new oK(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new oK(()=>{this.element&&!lh(lg(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=lk(this.item,lI("span.submenu-indicator"+iH.asCSSSelector(rr.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(a6(this.element,ly.KEY_UP,e=>{let t=new ok(e);(t.equals(17)||t.equals(3))&&(lS.stop(e,!0),this.createSubmenu(!0))})),this._register(a6(this.element,ly.KEY_DOWN,e=>{let t=new ok(e);lg()===this.item&&(t.equals(17)||t.equals(3))&&lS.stop(e,!0)})),this._register(a6(this.element,ly.MOUSE_OVER,e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(a6(this.element,ly.MOUSE_LEAVE,e=>{this.mouseOver=!1})),this._register(a6(this.element,ly.FOCUS_OUT,e=>{this.element&&!lh(lg(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){lS.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){let s={top:0,left:0};return s.left=Rb(e.width,t.width,{position:n.horizontal===nW.Right?0:1,offset:i.left,size:i.width}),s.left>=i.left&&s.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(s.left=i.left+10),i.top+=10,i.height=0),s.top=Rb(e.height,t.height,{position:0,offset:i.top,size:0}),s.top+t.height===i.top&&s.top+i.height+t.height<=e.height&&(s.top+=i.height),s}createSubmenu(e=!0){if(this.element){if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=lk(this.element,lI("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");let t=parseFloat(aG(this.parentData.parent.domNode).getComputedStyle(this.parentData.parent.domNode).paddingTop||"0")||0;this.submenuContainer.style.position="fixed",this.submenuContainer.style.top="0",this.submenuContainer.style.left="0",this.submenuContainer.style.zIndex="1",this.parentData.submenu=new Ps(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new hh],this.submenuOptions,this.menuStyle);let i=this.element.getBoundingClientRect(),n={top:i.top-t,left:i.left,height:i.height+2*t,width:i.width},s=this.submenuContainer.getBoundingClientRect(),r=aG(this.element),{top:o,left:a}=this.calculateSubmenuMenuLayout(new ln(r.innerWidth,r.innerHeight),ln.lift(s),n,this.expandDirection);this.submenuContainer.style.left=`${a-s.left}px`,this.submenuContainer.style.top=`${o-s.top}px`,this.submenuDisposables.add(a6(this.submenuContainer,ly.KEY_UP,e=>{new ok(e).equals(15)&&(lS.stop(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(a6(this.submenuContainer,ly.KEY_DOWN,e=>{new ok(e).equals(15)&&lS.stop(e,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}}updateAriaExpanded(e){this.item&&this.item?.setAttribute("aria-expanded",e)}applyStyle(){super.applyStyle();let e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=e??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Pa extends OV{constructor(e,t,i,n){super(e,t,i),this.menuStyles=n}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}
662function Pl(e){let t=rt[e.id];return`.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`}class Ph{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){let t;let i=e.getActions();if(!i.length)return;this.focusToReturn=lg();let n=l_(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,layer:e.layer,render:n=>{this.lastContainer=n;let s=e.getMenuClassName?e.getMenuClassName():"";s&&(n.className+=" "+s),this.options.blockMouse&&(this.block=n.appendChild(lI(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",this.blockDisposable?.dispose(),this.blockDisposable=a6(this.block,ly.MOUSE_DOWN,e=>e.stopPropagation()));let r=new ro.SL,o=e.actionRunner||r.add(new ho);o.onWillRun(t=>this.onActionRun(t,!e.skipTelemetry),this,r),o.onDidRun(this.onDidActionRun,this,r),(t=new Ps(n,i,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:o,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)},O0)).onDidCancel(()=>this.contextViewService.hideContextView(!0),null,r),t.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,r);let a=aG(n);return r.add(a6(a,ly.BLUR,()=>this.contextViewService.hideContextView(!0))),r.add(a6(a,ly.MOUSE_DOWN,e=>{if(e.defaultPrevented)return;let t=new oE(a,e),i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}})),(0,ro.F8)(r,t)},focus:()=>{t?.focus(!!e.autoSelectFirstItem)},onHide:t=>{e.onHide?.(!!t),this.block&&(this.block.remove(),this.block=null),this.blockDisposable?.dispose(),this.blockDisposable=null,this.lastContainer&&(lg()===this.lastContainer||lh(lg(),this.lastContainer))&&this.focusToReturn?.focus(),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!(0,o_.n2)(e.error)&&this.notificationService.error(e.error)}}var Pd=function(e,t){return function(i,n){t(i,n,e)}};let Pu=class extends ro.JT{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Ph(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new sd.Q5),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new sd.Q5),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=nz.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{e.onHide?.(t),this._onDidHideContextMenu.fire()}}),lP.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};Pu=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Pd(0,da),Pd(1,Sd),Pd(2,Td),Pd(3,SP),Pd(4,de),Pd(5,hZ)],Pu),(nz||(nz={})).transform=function(e,t,i){if(!(e&&e.menuId instanceof h8))return e;let{menuId:n,menuActionOptions:s,contextKeyService:r}=e;return{...e,getActions:()=>{let o=[];return(n&&(o=function(e,t){let i=[];return function(e,t,i){let n=lP.getInstance();O6(e,t,n.keyStatus.altKey||(sS.ED||sS.IJ)&&n.keyStatus.shiftKey,e=>"navigation"===e)}(e,i),i}(t.getMenuActions(n,r??i,s))),e.getActions)?ha.join(e.getActions(),o):o}}},(tp=nU||(nU={}))[tp.API=0]="API",tp[tp.USER=1]="USER";var Pc=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Pg=function(e,t){return function(i,n){t(i,n,e)}};let Pf=class{constructor(e){this._commandService=e}async open(e,t){if(!oY(e,iA.command))return!1;if(!t?.allowCommands||("string"==typeof e&&(e=sJ.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=I2(decodeURIComponent(e.query))}catch{try{i=I2(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};Pf=Pc([Pg(0,hg)],Pf);let Pm=class{constructor(e){this._editorService=e}async open(e,t){"string"==typeof e&&(e=sJ.parse(e));let{selection:i,uri:n}=function(e){let t;let i=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return i&&(t={startLineNumber:parseInt(i[1]),startColumn:i[2]?parseInt(i[2]):1,endLineNumber:i[4]?parseInt(i[4]):void 0,endColumn:i[4]?i[5]?parseInt(i[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}(e);
662return(e=n).scheme===iA.file&&(e=dD(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t?.fromUserGesture?nU.USER:nU.API,...t?.editorOptions}},this._editorService.getFocusedCodeEditor(),t?.openToSide),!0}};Pm=Pc([Pg(0,hi)],Pm);let Pp=class{constructor(e,t){this._openers=new hu.S,this._validators=new hu.S,this._resolvers=new hu.S,this._resolvedUriTargets=new dh(e=>e.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new hu.S,this._defaultExternalOpener={openExternal:async e=>(oJ(e,iA.http,iA.https)?lO(e):rb.location.href=e,!0)},this._openers.push({open:async(e,t)=>!!(t?.openExternal||oJ(e,iA.mailto,iA.http,iA.https,iA.vsls))&&(await this._doOpenExternal(e,t),!0)}),this._openers.push(new Pf(t)),this._openers.push(new Pm(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){if(!t?.skipValidation){let i="string"==typeof e?sJ.parse(e):e,n=this._resolvedUriTargets.get(i)??e;for(let e of this._validators)if(!await e.shouldOpen(n,t))return!1}for(let i of this._openers)if(await i.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(let i of this._resolvers)try{let n=await i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch{}throw Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){let i,n;let s="string"==typeof e?sJ.parse(e):e;try{i=(await this.resolveExternalUri(s,t)).resolved}catch{i=s}if(n="string"==typeof e&&s.toString()===i.toString()?e:encodeURI(i.toString(!0)),t?.allowContributedOpeners){let e="string"==typeof t?.allowContributedOpeners?t?.allowContributedOpeners:void 0;for(let t of this._externalOpeners)if(await t.openExternal(n,{sourceUri:s,preferredOpenerId:e},tI.None))return!0}return this._defaultExternalOpener.openExternal(n,{sourceUri:s},tI.None)}dispose(){this._validators.clear()}};Pp=Pc([Pg(0,hi),Pg(1,hg)],Pp);let P_=ht("editorWorkerService");(t_=nK||(nK={}))[t_.Hint=1]="Hint",t_[t_.Info=2]="Info",t_[t_.Warning=4]="Warning",t_[t_.Error=8]="Error",function(e){e.compare=function(e,t){return t-e};let t=Object.create(null);t[e.Error]=(0,rh.NC)(1732,"Error"),t[e.Warning]=(0,rh.NC)(1733,"Warning"),t[e.Info]=(0,rh.NC)(1734,"Info"),e.toString=function(e){return t[e]||""};let i=Object.create(null);i[e.Error]=(0,rh.NC)(1735,"Errors"),i[e.Warning]=(0,rh.NC)(1736,"Warnings"),i[e.Info]=(0,rh.NC)(1737,"Infos"),e.toStringPlural=function(e){return i[e]||""},e.fromSeverity=function(t){switch(t){case Sh.Error:return e.Error;case Sh.Warning:return e.Warning;case Sh.Info:return e.Info;case Sh.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return Sh.Error;case e.Warning:return Sh.Warning;case e.Info:return Sh.Info;case e.Hint:return Sh.Ignore}}}(nK||(nK={})),function(e){function t(e,t){let i=[""];return e.source?i.push(e.source.replace("\xa6","\\\xa6")):i.push(""),e.code?"string"==typeof e.code?i.push(e.code.replace("\xa6","\\\xa6")):i.push(e.code.value.replace("\xa6","\\\xa6")):i.push(""),void 0!==e.severity&&null!==e.severity?i.push(nK.toString(e.severity)):i.push(""),e.message&&t?i.push(e.message.replace("\xa6","\\\xa6")):i.push(""),void 0!==e.startLineNumber&&null!==e.startLineNumber?i.push(e.startLineNumber.toString()):i.push(""),void 0!==e.startColumn&&null!==e.startColumn?i.push(e.startColumn.toString()):i.push(""),void 0!==e.endLineNumber&&null!==e.endLineNumber?i.push(e.endLineNumber.toString()):i.push(""),void 0!==e.endColumn&&null!==e.endColumn?i.push(e.endColumn.toString()):i.push(""),i.push(""),i.join("\xa6")}e.makeKey=function(e){return t(e,!0)},e.makeKeyOptionalMessage=t}(n$||(n$={}));let Pv=ht("markerService");var Pb=function(e,t){return function(i,n){t(i,n,e)}};let PC=class extends ro.JT{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new sd.Q5),this._suppressedRanges=new dh,this._markerDecorations=new dh,e.getModels().forEach(e=>this._onModelAdded(e)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}
662dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){let i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(e=>{let t=this._markerDecorations.get(e);t&&this._updateDecorations(t)})}_onModelAdded(e){let t=new Pw(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){let t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===iA.inMemory||e.uri.scheme===iA.internal||e.uri.scheme===iA.vscode)&&this._markerService?.read({resource:e.uri}).map(e=>e.owner).forEach(t=>this._markerService.remove(t,[e.uri]))}_updateDecorations(e){let t=this._markerService.read({resource:e.model.uri,take:500}),i=this._suppressedRanges.get(e.model.uri);i&&(t=t.filter(e=>!hc.$.some(i,t=>s9.areIntersectingOrTouching(t,e)))),e.update(t)&&this._onDidChangeMarker.fire(e.model)}};PC=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Pb(0,hn),Pb(1,Pv)],PC);class Pw extends ro.JT{constructor(e){super(),this.model=e,this._map=new df,this._register((0,ro.OF)(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){let{added:t,removed:i}=function(e,t){let i=[],n=[];for(let n of e)t.has(n)||i.push(n);for(let i of t)e.has(i)||n.push(i);return{removed:i,added:n}}(new Set(this._map.keys()),new Set(e));if(0===t.length&&0===i.length)return!1;let n=i.map(e=>this._map.get(e)),s=t.map(e=>({range:this._createDecorationRange(this.model,e),options:this._createDecorationOption(e)})),r=this.model.deltaDecorations(n,s);for(let e of i)this._map.delete(e);for(let e=0;e<r.length;e++)this._map.set(t[e],r[e]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,t){let i=s9.lift(t);if(t.severity!==nK.Hint||this._hasMarkerTag(t,1)||this._hasMarkerTag(t,2)||(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),(i=e.validateRange(i)).isEmpty()){let t=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(1===t||i.endColumn>=t)return i;let n=e.getWordAtPosition(i.getStartPosition());n&&(i=new s9(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){let n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n<i.endColumn&&(i=new s9(i.startLineNumber,n,i.endLineNumber,i.endColumn),t.startColumn=n)}return i}_createDecorationOption(e){let t,i,n,s,r;switch(e.severity){case nK.Hint:t=this._hasMarkerTag(e,2)?void 0:this._hasMarkerTag(e,1)?"squiggly-unnecessary":"squiggly-hint",i=0;break;case nK.Info:t="squiggly-info",s={id:wS},i=10,n={color:{id:pB},position:1};break;case nK.Warning:t="squiggly-warning",s={id:wy},i=20,n={color:{id:pV},position:1};break;case nK.Error:default:t="squiggly-error",s={id:ww},i=30,n={color:{id:pW},position:1}}return e.tags&&(-1!==e.tags.indexOf(1)&&(r="squiggly-inline-unnecessary"),-1!==e.tags.indexOf(2)&&(r="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:s,position:iY.Right},minimap:n,zIndex:i,inlineClassName:r}}_hasMarkerTag(e,t){return!!e.tags&&e.tags.indexOf(t)>=0}}var Py=function(e,t){return function(i,n){t(i,n,e)}};function PS(e){return e.toString()}class PL{constructor(e,t,i){this.model=e,this._modelEventListeners=new ro.SL,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(t=>i(e,t)))}dispose(){this._modelEventListeners.dispose()}}let Px=sS.IJ||sS.dz?1:2;class Pk{constructor(e,t,i,n,s,r,o,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=s,this.sha1=r,this.versionId=o,this.alternativeVersionId=a}}let PN=class extends ro.JT{static{nj=this}static{this.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520}constructor(e,t,i,n){super(),this._configurationService=e,this._resourcePropertiesService=t,this._und
662oRedoService=i,this._instantiationService=n,this._onModelAdded=this._register(new sd.Q5),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new sd.Q5),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new sd.Q5),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(e=>this._updateModelOptions(e))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){let i=LI.D.tabSize;e.editor&&void 0!==e.editor.tabSize&&(i=(0,sh.Zc)(e.editor.tabSize,LI.D.tabSize,1,100));let n="tabSize";e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize&&(n=(0,sh.Zc)(e.editor.indentSize,"tabSize",1,100));let s=LI.D.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(s="false"!==e.editor.insertSpaces&&!!e.editor.insertSpaces);let r=Px,o=e.eol;"\r\n"===o?r=2:"\n"===o&&(r=1);let a=LI.D.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(a="false"!==e.editor.trimAutoWhitespace&&!!e.editor.trimAutoWhitespace);let l=LI.D.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(l="false"!==e.editor.detectIndentation&&!!e.editor.detectIndentation);let h=LI.D.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(h="false"!==e.editor.largeFileOptimizations&&!!e.editor.largeFileOptimizations);let d=LI.D.bracketPairColorizationOptions;if(e.editor?.bracketPairColorization&&"object"==typeof e.editor.bracketPairColorization){let t=e.editor.bracketPairColorization;d={enabled:!!t.enabled,independentColorPoolPerBracketType:!!t.independentColorPoolPerBracketType}}return{isForSimpleWidget:t,tabSize:i,indentSize:n,insertSpaces:s,detectIndentation:l,defaultEOL:r,trimAutoWhitespace:a,largeFileOptimizations:h,bracketPairColorizationOptions:d}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);let i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"string"==typeof i&&"auto"!==i?i:3===sS.OS||2===sS.OS?"\n":"\r\n"}_shouldRestoreUndoStack(){let e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(e,t,i){let n="string"==typeof e?e:e.languageId,s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){let e=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),r=this._getEOL(t,n);s=nj._readModelOptions({editor:e,eol:r},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){let t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);let i=Object.keys(this._models);for(let n=0,s=i.length;n<s;n++){let s=i[n],r=this._models[s],o=r.model.getLanguageId(),a=r.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:o,resource:a})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:o,resource:a}))continue;let l=t[o+a],h=this.getCreationOptions(o,a,r.model.isForSimpleWidget);nj._setModelOptionsForModel(r.model,h,l)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&1===e.getLineCount()&&e.setEOL(1===t.defaultEOL?0:1),i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&(0,cI.fS)(i.bracketPairColorizationOptions,t.bracketPairColorizationOptions)||(t.detectIndentation?(e.detectIndentation(t.insertSpaces,t.tabSize),e.updateOptions({trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions})):e.updateOptions({insertSpaces:t.insertSpaces,tabSize:t.tabSize,indentSize:t.indentSize,trimAutoWhitespace:t.trimAutoWhitespace,bracketColorizationOptions:t.bracketPairColorizationOptions}))}_insertDisposedModel(e){this._disposedModels.set(PS(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){let t=this._disposedModels.get(PS(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(PS(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){let t=[];
662for(this._disposedModels.forEach(e=>{e.sharesUndoRedoStack||t.push(e)}),t.sort((e,t)=>e.time-t.time);t.length>0&&this._disposedModelsHeapSize>e;){let e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){let s=this.getCreationOptions(t,i,n),r=this._instantiationService.createInstance(Np,e,t,s,i);if(i&&this._disposedModels.has(PS(i))){let e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=this._getSHA1Computer(),s=!!n.canComputeSHA1(r)&&n.computeSHA1(r)===e.sha1;if(s||e.sharesUndoRedoStack){for(let e of t.past)xA(e)&&e.matchesResource(i)&&e.setModel(r);for(let e of t.future)xA(e)&&e.matchesResource(i)&&e.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,e=>xA(e)&&e.matchesResource(i)),s&&(r._overwriteVersionId(e.versionId),r._overwriteAlternativeVersionId(e.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}let o=PS(r.uri);if(this._models[o])throw Error("ModelService: Cannot add model because it already exists!");let a=new PL(r,e=>this._onWillDispose(e),(e,t)=>this._onDidChangeLanguage(e,t));return this._models[o]=a,a}createModel(e,t,i,n=!1){let s;return s=t?this._createModelData(e,t,i,n):this._createModelData(e,u0,i,n),this._onModelAdded.fire(s.model),s.model}getModels(){let e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){let n=t[i];e.push(this._models[n].model)}return e}getModel(e){let t=PS(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===iA.file||e.scheme===iA.vscodeRemote||e.scheme===iA.vscodeUserData||e.scheme===iA.vscodeNotebookCell||"fake-fs"===e.scheme}_onWillDispose(e){let t=PS(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString(),s=!1,r=0;if(n||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){let t=this._undoRedoService.getElements(e.uri);if(t.past.length>0||t.future.length>0){for(let i of t.past)xA(i)&&i.matchesResource(e.uri)&&(s=!0,r+=i.heapSize(e.uri),i.setModel(e.uri));for(let i of t.future)xA(i)&&i.matchesResource(e.uri)&&(s=!0,r+=i.heapSize(e.uri),i.setModel(e.uri))}}let o=nj.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,a=this._getSHA1Computer();if(s){if(n||!(r>o)&&a.canComputeSHA1(e))this._ensureDisposedModelsHeapSize(o-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,t=>xA(t)&&t.matchesResource(e.uri)),this._insertDisposedModel(new Pk(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,r,a.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else{let e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}}else if(!n){let e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){let i=t.oldLanguage,n=e.getLanguageId(),s=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);nj._setModelOptionsForModel(e,r,s),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new PD}};PN=nj=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Py(0,uE),Py(1,fo),Py(2,Nr),Py(3,he)],PN);class PD{static{this.MAX_MODEL_SIZE=10485760}canComputeSHA1(e){return e.getValueLength()<=PD.MAX_MODEL_SIZE}computeSHA1(e){let t;let i=new an,n=e.createSnapshot();for(;t=n.read();)i.update(t);return i.digest()}}i(50845),(tv=nq||(nq={}))[tv.PRESERVE=0]="PRESERVE",tv[tv.LAST=1]="LAST";let PE="workbench.contributions.quickaccess";class PT{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort((e,t)=>
662t.prefix.length-e.prefix.length),(0,ro.OF)(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return(0,as.kX)([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(t=>e.startsWith(t.prefix))||this.defaultProvider}}h5.add(PE,new PT);var PI=function(e,t){return function(i,n){t(i,n,e)}};let PM=class extends ro.JT{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=h5.as(PE),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0,this._register((0,ro.OF)(()=>{for(let e of this.mapProviderToDescriptor.values())(0,ro.Wf)(e)&&e.dispose();this.visibleQuickAccess?.picker.dispose()}))}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){let n;let[s,r]=this.getOrInstantiateProvider(e,i?.enabledProviderPrefixes),o=this.visibleQuickAccess,a=o?.descriptor;if(o&&r&&a===r){e===r.prefix||i?.preserveValue||(o.picker.value=e),this.adjustValueSelection(o.picker,r,i);return}if(r&&!i?.preserveValue){let t;if(o&&a&&a!==r){let e=o.value.substr(a.prefix.length);e&&(t=`${r.prefix}${e}`)}if(!t){let e=s?.defaultFilterValue;e===nq.LAST?t=this.lastAcceptedPickerValues.get(r):"string"==typeof e&&(t=`${r.prefix}${e}`)}"string"==typeof t&&(e=t)}let l=o?.picker?.valueSelection,h=o?.picker?.value,d=new ro.SL,u=d.add(this.quickInputService.createQuickPick({useSeparators:!0}));u.value=e,this.adjustValueSelection(u,r,i),u.placeholder=i?.placeholder??r?.placeholder,u.quickNavigate=i?.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!o,("number"==typeof i?.itemActivation||i?.quickNavigateConfiguration)&&(u.itemActivation=i?.itemActivation??nL.SECOND),u.contextKey=r?.contextKey,u.filterValue=e=>e.substring(r?r.prefix.length:0),t&&(n=new oq,d.add(sd.ju.once(u.onWillAccept)(e=>{e.veto(),u.hide()}))),d.add(this.registerPickerListeners(u,s,r,e,i));let c=d.add(new sg);if(s&&d.add(s.provide(u,c.token,i?.providerOptions)),sd.ju.once(u.onDidHide)(()=>{0===u.selectedItems.length&&c.cancel(),d.dispose(),n?.complete(u.selectedItems.slice(0))}),u.show(),l&&h===e&&(u.valueSelection=l),t)return n?.p}adjustValueSelection(e,t,i){let n;n=i?.preserveValue?[e.value.length,e.value.length]:[t?.prefix.length??0,e.value.length],e.valueSelection=n}registerPickerListeners(e,t,i,n,s){let r=new ro.SL,o=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return r.add((0,ro.OF)(()=>{o===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(e=>{let[i]=this.getOrInstantiateProvider(e,s?.enabledProviderPrefixes);i!==t?this.show(e,{enabledProviderPrefixes:s?.enabledProviderPrefixes,preserveValue:!0,providerOptions:s?.providerOptions}):o.value=e})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e,t){let i=this.registry.getQuickAccessProvider(e);if(!i||t&&!t?.includes(i.prefix))return[void 0,void 0];let n=this.mapProviderToDescriptor.get(i);return n||(n=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,n)),[n,i]}};PM=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([PI(0,RA),PI(1,he)],PM),i(71591);let PR={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class PA extends vQ{get onChange(){return this._onChange.event}get onKeyDown(){return this._onKeyDown.event}constructor(e){super(),this._onChange=this._register(new sd.Q5),this._onKeyDown=this._register(new sd.Q5),this._opts=e,this._title=this._opts.title,this._checked=this._opts.isChecked;let t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...iH.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._register(A1.setupDelayedHover(this.domNode,()=>({content:this._title,style:1}),this._opts.hoverLifecycleOptions)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.setTitle(this._opts.title),this.applyStyles(),this.onclick(this.domNode,e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,e=>
662{if(this.enabled){if(10===e.keyCode||3===e.keyCode){this.checked=!this._checked,this._onChange.fire(!0),e.preventDefault(),e.stopPropagation();return}this._onKeyDown.fire(e)}})}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...iH.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...iH.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1)),this.domNode.classList.remove("disabled")}disable(){this.domNode.setAttribute("aria-disabled",String(!0)),this.domNode.classList.add("disabled")}setTitle(e){this._title=e,this.domNode.setAttribute("aria-label",e)}set visible(e){this.domNode.style.display=e?"":"none"}get visible(){return"none"!==this.domNode.style.display}}class PO extends vQ{static{this.CLASS_NAME="monaco-checkbox"}constructor(e,t,i){super(),this.checkbox=e,this.domNode=t,this.styles=i,this._onChange=this._register(new sd.Q5),this.onChange=this._onChange.event,this.applyStyles()}get enabled(){return this.checkbox.enabled}enable(){this.checkbox.enable(),this.applyStyles(!0)}disable(){this.checkbox.disable(),this.applyStyles(!1)}setTitle(e){this.checkbox.setTitle(e)}applyStyles(e=this.enabled){this.domNode.style.color=(e?this.styles.checkboxForeground:this.styles.checkboxDisabledForeground)||"",this.domNode.style.backgroundColor=(e?this.styles.checkboxBackground:this.styles.checkboxDisabledBackground)||"",this.domNode.style.borderColor=(e?this.styles.checkboxBorder:this.styles.checkboxDisabledBackground)||"";let t=this.styles.size||18;this.domNode.style.width=this.domNode.style.height=this.domNode.style.fontSize=`${t}px`,this.domNode.style.fontSize=`${t-2}px`}}class PP extends PO{constructor(e,t,i){let n=new PA({title:e,isChecked:t,icon:rr.check,actionClassName:PO.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...PR});super(n,n.domNode,i),this._register(n),this._register(this.checkbox.onChange(e=>{this.applyStyles(),this._onChange.fire(e)}
662))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}applyStyles(e){this.checkbox.checked?this.checkbox.setIcon(rr.check):this.checkbox.setIcon(void 0),super.applyStyles(e)}}class PF extends PO{constructor(e,t,i){let n;switch(t){case!0:n=rr.check;break;case"mixed":n=rr.dash;break;case!1:n=void 0}let s=new PA({title:e,isChecked:!0===t,icon:n,actionClassName:PP.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...PR});super(s,s.domNode,i),this._state=t,this._register(s),this._register(this.checkbox.onChange(e=>{this._state=this.checkbox.checked,this.applyStyles(),this._onChange.fire(e)}))}get checked(){return this._state}set checked(e){this._state!==e&&(this._state=e,this.checkbox.checked=!0===e,this.applyStyles())}applyStyles(e){switch(this._state){case!0:this.checkbox.setIcon(rr.check);break;case"mixed":this.checkbox.setIcon(rr.dash);break;case!1:this.checkbox.setIcon(void 0)}super.applyStyles(e)}}i(71769);class PB{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>"string"==typeof e?e:e.label).join("")}}!function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);r>3&&o&&Object.defineProperty(t,i,o)}([vq],PB.prototype,"toString",null);let PV=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi,PW={},PH=new T0("quick-input-button-icon-");function Pz(e,t,i){let n=e.iconClass||function(e){let t;if(!e)return;let i=e.dark.toString();return PW[i]?t=PW[i]:(t=PH.nextId(),mx(`.${t}, .hc-light .${t}`,`background-image: ${AK(e.light||e.dark)}`),mx(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${AK(e.dark)}`),PW[i]=t),t}(e.iconPath);return e.alwaysVisible&&(n=n?`${n} always-visible`:"always-visible"),{id:t,label:"",tooltip:e.tooltip||"",class:n,enabled:!0,run:i}}var PU=function(e,t){return function(i,n){t(i,n,e)}};let PK="inQuickInput",P$=new hJ(PK,!1,(0,rh.NC)(1748,"Whether keyboard focus is inside the quick input control")),Pj=hI.has(PK),Pq=new hJ("quickInputAlignment","top",(0,rh.NC)(1749,"The alignment of the quick input")),PG="quickInputType",PQ=new hJ(PG,void 0,(0,rh.NC)(1750,"The type of the currently visible quick input")),PY="cursorAtEndOfQuickInputBox",PJ=new hJ(PY,!1,(0,rh.NC)(1751,"Whether the cursor in the quick input is at the end of the input box")),PZ=hI.has(PY),PX={iconClass:iH.asClassName(rr.quickInputBack),tooltip:(0,rh.NC)(1752,"Back")};class P1 extends ro.JT{static{this.noPromptMessage=(0,rh.NC)(1753,"Press 'Enter' to confirm your input or 'Escape' to cancel")}constructor(e){super(),this.ui=e,this._visible=aU("visible",!1),this._widgetUpdated=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=P1.noPromptMessage,this._severity=Sh.Ignore,this.onDidTriggerButtonEmitter=this._register(new sd.Q5),this.onDidHideEmitter=this._register(new sd.Q5),this.onWillHideEmitter=this._register(new sd.Q5),this.onDisposeEmitter=this._register(new sd.Q5),this.visibleDisposables=this._register(new ro.SL),this.onDidHide=this.onDidHideEmitter.event}get visible(){return this._visible.get()}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){let t=this._ignoreFocusOut!==e&&!sS.gn;this._ignoreFocusOut=e&&!sS.gn,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter(e=>e===PX),this._rightButtons=e.filter(e=>e!==PX&&e.location!==nk.Inline),this._inlineButtons=e.filter(e=>e.location===nk.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}
662get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{-1!==this.buttons.indexOf(e)&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this._visible.set(!0,void 0),this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=nS.Other){this._visible.set(!1,void 0),this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=nS.Other){this.onWillHideEmitter.fire({reason:e})}update(){if(!this.visible)return;let e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:e||"&nbsp;"===this.ui.title.innerHTML||(this.ui.title.innerText="\xa0");let t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?lD(this.ui.widget,this._widget):lD(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new oz,this.busyDelay.setIfNotSet(()=>{this.visible&&(this.ui.progressBar.infinite(),this.ui.progressBar.getContainer().removeAttribute("aria-hidden"))},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.ui.progressBar.getContainer().setAttribute("aria-hidden","true"),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();let e=this._leftButtons.map((e,t)=>Pz(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.leftActionBar.push(e,{icon:!0,label:!1}),this.ui.rightActionBar.clear();let t=this._rightButtons.map((e,t)=>Pz(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.rightActionBar.push(t,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();let i=this._inlineButtons.map((e,t)=>Pz(e,`id-${t}`,async()=>this.onDidTriggerButtonEmitter.fire(e)));this.ui.inlineActionBar.push(i,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;let e=this.toggles?.filter(e=>e instanceof PA)??[];this.ui.inputBox.toggles=e;let t=22*e.length;this.ui.countContainer.style.right=t>0?`${4+t}px`:"4px",this.ui.visibleCountContainer.style.right=t>0?`${4+t}px`:"4px"}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);let i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,lD(this.ui.message),i&&function(e,t,i){lD(t);let n=function(e){let t;let i=[],n=0;for(;t=PV.exec(e);){t.index-n>0&&i.push(e.substring(n,t.index));let[,s,r,,o]=t;o?i.push({label:s,href:r,title:o}):i.push({label:s,href:r}),n=t.index+t[0].length}return n<e.length&&i.push(e.substring(n)),new PB(i)}(e),s=0;for(let e of n.nodes)if("string"==typeof e)t.append(...M4(e));else{let n=e.title;!n&&e.href.startsWith("command:")?n=(0,rh.NC)(1771,"Click to execute command '{0}'",e.href.substring(8)):n||(n=e.href);let r=lI("a",{href:e.href,title:n,tabIndex:s++},e.label);r.style.textDecoration="underline";let o=t=>{t&&"function"==typeof t.preventDefault&&"function"==typeof t.stopPropagation&&lS.stop(t,!0),i.callback(e.href)},a=i.disposables.add(new bc(r,ly.CLICK)).event,l=i.disposables.add(new bc(r,ly.KEY_DOWN)).event,h=sd.ju.chain(l,e=>e.filter(e=>{let t=new ok(e);return t.equals(10)||t.equals(3)}));i.disposables.add(vG.addTarget(r));let d=i.disposables.add(new bc(r,i6.Tap)).event;sd.ju.any(a,d,h)(o,null,i.disposables),t.appendChild(r)}}(i,this.ui.message,{callback:e=>{this.ui.linkOpenerDelegate(e)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()}
662)`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?(0,rh.NC)(1754,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Sh.Ignore){let t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}class P0 extends P1{static{this.DEFAULT_ARIA_LABEL=(0,rh.NC)(1755,"Type to narrow down results.")}constructor(e){super(e),this._value="",this.onDidChangeValueEmitter=this._register(new sd.Q5),this.onWillAcceptEmitter=this._register(new sd.Q5),this.onDidAcceptEmitter=this._register(new sd.Q5),this.onDidCustomEmitter=this._register(new sd.Q5),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=nL.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new sd.Q5),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new sd.Q5),this.onDidTriggerItemButtonEmitter=this._register(new sd.Q5),this.onDidTriggerSeparatorButtonEmitter=this._register(new sd.Q5),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new sd.E7,this.type="quickPick",this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event,this.noValidationMessage=void 0}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get prompt(){return this.noValidationMessage}set prompt(e){this.noValidationMessage=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?RR:this.ui.keyMods}get valueSelection(){let e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get okLabel(){return this._okLabel??(0,rh.NC)(1756,"OK")}set okLabel(e){this._okLabel=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(nx.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.f
662ire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&(0,as.fS)(e,this._activeItems,(e,t)=>e===t)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany&&!e.some(e=>!1===e.pickable)){e.length&&this.ui.list.setSelectedElements([]);return}!(this.selectedItemsToConfirm!==this._selectedItems&&(0,as.fS)(e,this._selectedItems,(e,t)=>e===t))&&(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(lC(t)&&1===t.button))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&(0,as.fS)(e,this._selectedItems,(e,t)=>e===t)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return a6(this.ui.container,ly.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;let t=new ok(e),i=t.keyCode;this._quickNavigate.keybindings.some(e=>{let n=e.getChords();return!(n.length>1)&&(n[0].shiftKey&&4===i?!t.ctrlKey&&!t.altKey&&!t.metaKey:!!n[0].altKey&&6===i||!!n[0].ctrlKey&&5===i||!!n[0].metaKey&&57===i)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;let e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.titleButtons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:"default"===this.ok?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage||!!this.prompt,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let n=this.ariaLabel;n||!i.inputBox||(n=this.placeholder,this.title&&(n=n?`${n} - ${this.title}`:this.title),n||(n=P0.DEFAULT_ARIA_LABEL)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=n??null),this.ui.inputBox.ariaLabel!==n&&(this.ui.inputBox.ariaLabel=n??"input"),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case nL.NONE:this._itemActivation=nL.FIRST;break;case nL.SECOND:this.ui.list.focus(nx.Second),this._itemActivation=nL.FIRST;break;case nL.LAST:this.ui.list.focus(nx.Last),this._itemActivation=nL.FIRST;break;default:this.trySelectFirst()}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.ok.label=this.okLabel||"",this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",!i.inputBox&&(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(nx.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}
662accept(e){(!e||this._canAcceptInBackground)&&(this.activeItems[0]&&!this._canSelectMany&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(e??!1))}}class P2 extends P1{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new sd.Q5),this.onDidAcceptEmitter=this._register(new sd.Q5),this.type="inputBox",this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){let e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?(0,rh.NC)(1757,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):P1.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}accept(){this.onDidAcceptEmitter.fire()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");let e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password);let t=this.ariaLabel;!t&&e.inputBox&&(t=this.placeholder?this.title?`${this.placeholder} - ${this.title}`:this.placeholder:this.title?this.title:"input"),this.ui.inputBox.ariaLabel!==t&&(this.ui.inputBox.ariaLabel=t||"input")}}let P5=class extends Th{constructor(e,t){super("mouse",void 0,e=>this.getOverrideOptions(e),e,t)}getOverrideOptions(e){return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:(l_(e.content)?e.content.textContent??"":"string"==typeof e.content?e.content:e.content.value).includes("\n"),skipFadeInAnimation:!0}}}};P5=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([PU(0,uE),PU(1,Tl)],P5),i(15739),gX.white.toString(),gX.white.toString();let P4=Object.freeze({allowedTags:{override:["b","i","u","code","span"]},allowedAttributes:{override:["class"]}});class P6 extends ro.JT{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new sd.Q5),this._onDidEscape=this._register(new sd.Q5),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);let i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,n=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=n||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),"string"==typeof t.title&&this.setTitle(t.title),"string"==typeof t.ariaLabel&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this.enabled=!t.disabled,this._register(vG.addTarget(this._element)),[ly.CLICK,i6.Tap].forEac
662h(e=>{this._register(a6(this._element,e,e=>{if(!this.enabled){lS.stop(e);return}this._onDidClick.fire(e)}))}),this._register(a6(this._element,ly.KEY_DOWN,e=>{let t=new ok(e),i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._onDidEscape.fire(e),this._element.blur(),i=!0),i&&lS.stop(t,!0)})),this._register(a6(this._element,ly.MOUSE_OVER,e=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(a6(this._element,ly.MOUSE_OUT,e=>{this.updateBackground(!1)})),this.focusTracker=this._register(lx(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){let t=[];for(let i of M4(e))if("string"==typeof i){if(""===(i=i.trim()))continue;let e=document.createElement("span");e.textContent=i,t.push(e)}else t.push(i);return t}updateBackground(e){let t;(t=this.options.secondary?e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:e?this.options.buttonHoverBackground:this.options.buttonBackground)&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||TZ(this._label)&&TZ(e)&&((t=this._label)===e||t&&e&&t.value===e.value&&t.isTrusted===e.isTrusted&&t.supportThemeIcons===e.supportThemeIcons&&t.supportHtml===e.supportHtml&&t.supportAlertSyntax===e.supportAlertSyntax&&(t.baseUri===e.baseUri||t.baseUri&&e.baseUri&&dL(sJ.from(t.baseUri),sJ.from(e.baseUri)))))return;this._element.classList.add("monaco-text-button");let i=this.options.supportShortLabel?this._labelElement:this._element;if(TZ(e)){let t=M3(e,void 0,document.createElement("span"));t.dispose();let n=t.element.querySelector("p")?.innerHTML;n?M2(i,n,P4):lD(i)}else this.options.supportIcons?lD(i,...this.getContentElements(e)):i.textContent=e;let n="";"string"==typeof this.options.title?n=this.options.title:this.options.title&&(n=function(e,t){if("string"==typeof e)return e;let i=e.value??"";return i.length>1e5&&(i=`${i.substr(0,1e5)}…`),(function(e,t,i={}){return MZ(e,Rs(t,i),"trusted")})(I1(i,{async:!1,renderer:Ra.value}),{isTrusted:!1},{}).toString().replace(/&(#\d+|[a-zA-Z]+);/g,e=>Rr.get(e)??e).trim()}(e)),this.setTitle(n),this._setAriaLabel(),this._label=e}get label(){return this._label}_setAriaLabel(){"string"==typeof this.options.ariaLabel?this._element.setAttribute("aria-label",this.options.ariaLabel):"string"==typeof this.options.title&&this._element.setAttribute("aria-label",this.options.title)}set icon(e){this._setAriaLabel();let t=Array.from(this._element.classList).filter(e=>e.startsWith("codicon-"));this._element.classList.remove(...t),this._element.classList.add(...iH.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){this._hover||""===e?this._hover&&this._hover.update(e):this._hover=this._register(A1.setupManagedHover(this.options.hoverDelegate??AZ("element"),this._element,e))}}i(19463);class P7 extends ro.JT{constructor(e,t,i){super(),this.options=t,this.styles=i,this.count=0,this.hover=this._register(new ro.XK),this.element=lk(e,lI(".monaco-count-badge")),this._register((0,ro.OF)(()=>e.removeChild(this.element))),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0),this.updateHover()}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.updateHover(),this.render()}updateHover(){""===this.titleFormat||this.hover.value?""===this.titleFormat&&this.hover.value&&(this.hover.value=void 0):this.hover.value=A1.setupDelayedHoverAtMouse(this.element,()=>({content:rx(this.titleFormat,this.count),appearance:{compact:!0}}))}render(){this.element.textContent=rx(this.countFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackgroun
662d??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}i(58170);let P3="done",P9="active",P8="infinite",Fe="infinite-long-running",Ft="discrete";class Fi extends ro.JT{static{this.LONG_RUNNING_INFINITE_THRESHOLD=1e4}constructor(e,t){super(),this.progressSignal=this._register(new ro.XK),this.workedVal=0,this.showDelayedScheduler=this._register(new oK(()=>lM(this.element),0)),this.longRunningScheduler=this._register(new oK(()=>this.infiniteLongRunning(),Fi.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=t?.progressBarBackground||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(P9,P8,Fe,Ft),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(P3),this.element.classList.contains(P8)?this.bit.style.opacity="0":this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off(),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(Ft,P3,Fe),this.element.classList.add(P9,P8),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(Fe)}getContainer(){return this.element}}let Fn=(0,rh.NC)(2,"Match Case"),Fs=(0,rh.NC)(3,"Match Whole Word"),Fr=(0,rh.NC)(4,"Use Regular Expression");class Fo extends PA{constructor(e){super({icon:rr.caseSensitive,title:Fn+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputA
662ctiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Fa extends PA{constructor(e){super({icon:rr.wholeWord,title:Fs+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Fl extends PA{constructor(e){super({icon:rr.regex,title:Fr+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Fh{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){let e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function Fd(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;default:return 0}}class Fu{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class Fc{constructor(e=new Set,t=10){this._history=e,this._limit=t,this._onChange(),this._history.onDidChange&&(this._disposable=this._history.onDidChange(()=>this._onChange()))}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return null===this._navigator.current()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();let e=this._elements;this._navigator=new Fu(e,0,e.length,e.length)}_reduceToLimit(){let e=this._elements;if(e.length>this._limit){let t=e.slice(e.length-this._limit);this._history.replace?this._history.replace(t):this._history=new Set(t)}}_currentPosition(){let e=this._navigator.current();return e?this._elements.indexOf(e):-1}get _elements(){let e=[];
662return this._history.forEach(t=>e.push(t)),e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0)}}i(2780);class Fg extends vQ{get onDidChange(){return this._onDidChange.event}get onDidHeightChange(){return this._onDidHeightChange.event}constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this.hover=this._register(new ro.XK),this._onDidChange=this._register(new sd.Q5),this._onDidHeightChange=this._register(new sd.Q5),this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=lk(e,lI(".monaco-inputbox.idle"));let n=this.options.flexibleHeight?"textarea":"input",s=lk(this.element,lI(".ibwrapper"));if(this.input=lk(s,lI(n+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=lk(s,lI("div.mirror")),this.mirror.innerText="\xa0",this.scrollableElement=new be(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),lk(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(e=>this.input.scrollTop=e.scrollTop));let t=this._register(new bc(e.ownerDocument,"selectionchange")),i=sd.ju.filter(t.event,()=>{let t=e.ownerDocument.getSelection();return t?.anchorNode===s});this._register(i(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Pt(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover.value||(this.hover.value=this._register(A1.setupDelayedHoverAtMouse(this.input,()=>({content:this.tooltip,appearance:{compact:!0}}))))}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return"number"==typeof this.cachedHeight?this.cachedHeight:ll(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){var e;return e=this.input,lg()===e}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){let e=this.input.selectionStart;if(null===e)return null;let t=this.input.selectionEnd??e;return{start:e,end:t}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!this.scrollableElement)return;let e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}
662showMessage(e,t){if("open"===this.state&&(0,cI.fS)(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));let i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${AH(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&((e=this.validation(this.value))?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e?.type}stylesForType(e){let t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){let e;if(!this.contextViewProvider||!this.message)return;let t=()=>e.style.width=lo(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:i=>{if(!this.message)return null;e=lk(i,lI(".monaco-inputbox-container")),t();let n=lI("span.monaco-inputbox-message");this.message.formatContent?function(e,t,i){let n=i??document.createElement("div");return n.textContent="",function e(t,i,n,s){let r;if(2===i.type)r=document.createTextNode(i.content||"");else if(3===i.type)r=document.createElement("b");else if(4===i.type)r=document.createElement("i");else if(7===i.type&&s)r=document.createElement("code");else if(5===i.type&&n){let e=document.createElement("a");n.disposables.add(a7(e,"click",e=>{n.callback(String(i.index),e)})),r=e}else 8===i.type?r=document.createElement("br"):1===i.type&&(r=t);r&&t!==r&&t.appendChild(r),r&&Array.isArray(i.children)&&i.children.forEach(t=>{e(r,t,n,s)})}(n,function(e,t){let i={type:1,children:[]},n=0,s=i,r=[],o=new Fh(e);for(;!o.eos();){let e=o.next(),t="\\"===e&&0!==Fd(o.peek());if(t&&(e=o.next()),t||0===Fd(e)||e!==o.peek()){if("\n"===e)2===s.type&&(s=r.pop()),s.children.push({type:8});else if(2!==s.type){let t={type:2,content:e};s.children.push(t),r.push(s),s=t}else s.content+=e}else{o.advance(),2===s.type&&(s=r.pop());let t=Fd(e);if(s.type===t||5===s.type&&6===t)s=r.pop();else{let e={type:t,children:[]};5===t&&(e.index=n,n++),s.children.push(e),r.push(s),s=e}}}return 2===s.type&&(s=r.pop()),i}(e),t?.actionHandler,t?.renderCodeSegments),n}(this.message.content,void 0,n):function(e,t,i){let n=i??document.createElement("div");return n.textContent=e,n}(this.message.content,0,n),n.classList.add(this.classForType(this.message.type));let s=this.stylesForType(this.message.type);return n.style.backgroundColor=s.background??"",n.style.color=s.foreground??"",n.style.border=s.border?`1px solid ${s.border}`:"",lk(e,n),null},onHide:()=>{this.state="closed"},layout:t}),mt(3===this.message.type?(0,rh.NC)(9,"Error: {0}",this.message.content):2===this.message.type?(0,rh.NC)(10,"Warning: {0}",this.message.content):(0,rh.NC)(11,"Info: {0}",this.message.content)),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;let e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText="\xa0",this.layout()}applyStyles(){let e=this.options.inputBoxStyles,t=e.inputBackgroun
662d??"",i=e.inputForeground??"",n=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${AH(n,"transparent")}`}layout(){if(!this.mirror)return;let e=this.cachedContentHeight;this.cachedContentHeight=ll(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){let t=this.inputElement,i=t.selectionStart,n=t.selectionEnd,s=t.value;null!==i&&null!==n&&(this.value=s.substr(0,i)+e+s.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){this._hideMessage(),this.message=null,this.actionbar?.dispose(),super.dispose()}}class Ff extends Fg{constructor(e,t,i){let n=(0,rh.NC)(12," or {0} for history",`\u21C5`),s=(0,rh.NC)(13," ({0} for history)",`\u21C5`);super(e,t,i),this._onDidFocus=this._register(new sd.Q5),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new sd.Q5),this.onDidBlur=this._onDidBlur.event,this.history=this._register(new Fc(i.history,100));let r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(n)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){var e;let t=this.placeholder.endsWith(")")?n:s,r=this.placeholder+t;i.showPlaceholderOnFocus&&(e=this.input,lg()!==e)?this.placeholder=r:this.setPlaceHolder(r)}};this.observer=new MutationObserver((e,t)=>{e.forEach(e=>{e.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{let e=e=>{if(!this.placeholder.endsWith(e))return!1;{let t=this.placeholder.slice(0,this.placeholder.length-e.length);return i.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}};e(s)||e(n)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",mi(this.value?this.value:(0,rh.NC)(14,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,mi(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}i(26755);let Fm=(0,rh.NC)(1,"input");class Fp extends vQ{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onMouseDown(){return this._onMouseDown.event}get onCaseSensitiveKeyDown(){return this._onCaseSensitiveKeyDown.event}get onRegexKeyDown(){return this._onRegexKeyDown.event}constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new ro.XK),this.additionalToggles=[],this._onDidOptionChange=this._register(new sd.Q5),this._onKeyDown=this._register(new sd.Q5),this._onMouseDown=this._register(new sd.Q5),this._onInput=this._register(new sd.Q5),this._onKeyUp=this._register(new sd.Q5),this._onCaseSensitiveKeyDown=this._register(new sd.Q5),this._onRegexKeyDown=this._register(new sd.Q5),this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||Fm,this.showCommonFindToggles=!!i.showCommonFindToggles;let n=i.appendCaseSensitiveLabel||"",s=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",o=!!i.flexibleHeight,a=!!i.flexibleWidth,l=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new Ff(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},showHistoryHint:i.showHistoryHint,flexibleHeight:o,flexibleWidth:a,flexibleMaxHeight:l,inputBoxStyles:i.inputBoxStyles,history:i.history})),this.showCommonFindToggles){let e=i?.hoverLifecycleOptions||{groupId:"find-input"};this.regex=this._register(new Fl({appendTitle:r,isChecked:!1,hoverLifecycleOptions:e,...i.toggleStyles})),this._register(this.regex.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(e=>{this._onRegexKeyDown.fire(e)}
662)),this.wholeWords=this._register(new Fa({appendTitle:s,isChecked:!1,hoverLifecycleOptions:e,...i.toggleStyles})),this._register(this.wholeWords.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new Fo({appendTitle:n,isChecked:!1,hoverLifecycleOptions:e,...i.toggleStyles})),this._register(this.caseSensitive.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(e=>{this._onCaseSensitiveKeyDown.fire(e)}));let t=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){let i=t.indexOf(this.domNode.ownerDocument.activeElement);if(i>=0){let n=-1;e.equals(17)?n=(i+1)%t.length:e.equals(15)&&(n=0===i?t.length-1:i-1),e.equals(9)?(t[i].blur(),this.inputBox.focus()):n>=0&&t[n].focus(),lS.stop(e,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i?.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e?.appendChild(this.domNode),this._register(a6(this.inputBox.inputElement,"compositionstart",e=>{this.imeSessionInProgress=!0})),this._register(a6(this.inputBox.inputElement,"compositionend",e=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,e=>this._onKeyDown.fire(e)),this.onkeyup(this.inputBox.inputElement,e=>this._onKeyUp.fire(e)),this.oninput(this.inputBox.inputElement,e=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,e=>this._onMouseDown.fire(e))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){for(let e of(this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.regex?.enable(),this.wholeWords?.enable(),this.caseSensitive?.enable(),this.additionalToggles))e.enable()}disable(){for(let e of(this.domNode.classList.add("disabled"),this.inputBox.disable(),this.regex?.disable(),this.wholeWords?.disable(),this.caseSensitive?.disable(),this.additionalToggles))e.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(let e of this.additionalToggles)e.domNode.remove();for(let t of(this.additionalToggles=[],this.additionalTogglesDisposables.value=new ro.SL,e??[]))this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(this.caseSensitive?.width()??0)+(this.wholeWords?.width()??0)+(this.regex?.width()??0)+this.additionalToggles.reduce((e,t)=>e+t.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){return this.caseSensitive?.checked??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){return this.wholeWords?.checked??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){return this.regex?.checked??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){this.caseSensitive?.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}
662showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}class F_ extends ro.JT{constructor(e,t,i){super(),this.parent=e,this.onDidChange=e=>this.findInput.onDidChange(e),this.container=lk(this.parent,lI(".quick-input-box")),this.findInput=this._register(new Fp(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));let n=this.findInput.inputBox.inputElement;n.role="textbox",n.ariaHasPopup="menu",n.ariaAutoComplete="list"}get onKeyDown(){return this.findInput.onKeyDown}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return"password"===this.findInput.inputBox.inputElement.type}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}get ariaLabel(){return this.findInput.inputBox.inputElement.getAttribute("aria-label")||""}set ariaLabel(e){this.findInput.inputBox.inputElement.setAttribute("aria-label",e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===Sh.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Sh.Info?1:e===Sh.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Sh.Info?1:e===Sh.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}i(37107);class Fv extends ro.JT{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=lk(e,lI("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n,s){e||(e=""),n&&(e=Fv.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&(0,cI.fS)(this.highlights,t)||(this.text=e,this.title=i,this.highlights=t,this.render(s))}render(e){let t=[],i=0;for(let n of this.highlights){if(n.end===n.start)continue;if(i<n.start){let s=this.text.substring(i,n.start);e?t.push(...M4(s)):t.push(s),i=n.start}let s=this.text.substring(i,n.end),r=lI("span.highlight",void 0,...e?M4(s):[s]);n.extraClasses&&r.classList.add(...n.extraClasses),t.push(r),i=n.end}if(i<this.text.length){let n=this.text.substring(i);e?t.push(...M4(n)):t.push(n)}if(lD(this.domNode,...t),this.customHover||""===this.title)this.customHover&&this.customHover.update(this.title);else{let e=this.options?.hoverDelegate??AZ("mouse");this.customHover=this._register(A1.setupManagedHover(e,this.domNode,this.title))}this.didEverRender=!0}static escapeNewLines(e,t){let i=0,n=0;return e.replace(/\r\n|\r|\n/g,(e,s)=>{for(let r of(n="\r\n"===e?-1:0,s+=i,t))!(r.end<=s)&&(r.start>=s&&(r.start+=n),r.end>=s&&(r.end+=n));return i+=n,"⏎"})}}class Fb{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||(0,cI.fS)(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class FC extends ro.JT{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new Fb(lk(e,lI(".monaco-icon-label")))),this.labelContainer=lk(this.domNode.element,lI(".monaco-icon-label-container")),this.nameContainer=lk(this.labelContainer,lI("span.monaco-icon-name-container")),t?.supportHighlights||t?.supportIcons?this.nameNode=this._register(new Fy(this.nameContainer,!!t.supportIcons)):this.nameNode=new Fw(this.nameContainer),this.hoverDelegate=t?.hoverDelegate??AZ("mouse")}
662get element(){return this.domNode.element}setLabel(e,t,i){let n=["monaco-icon-label"],s=["monaco-icon-label-container"],r="";i&&(i.extraClasses&&n.push(...i.extraClasses),i.bold&&n.push("bold"),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&("string"==typeof i.title?r+=i.title:r+=e));let o=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i?.iconPath){let e;if(o&&l_(o)?e=o:(e=lI(".monaco-icon-label-iconpath"),this.domNode.element.prepend(e)),iH.isThemeIcon(i.iconPath)){let t=iH.asClassName(i.iconPath);e.className=`monaco-icon-label-iconpath ${t}`,e.style.backgroundImage=""}else e.style.backgroundImage=AK(i?.iconPath);e.style.backgroundRepeat="no-repeat",e.style.backgroundPosition="center",e.style.backgroundSize="contain"}else o&&o.remove();if(this.domNode.classNames=n,this.domNode.element.setAttribute("aria-label",r),this.labelContainer.classList.value="",this.labelContainer.classList.add(...s),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){let e=this.getOrCreateDescriptionNode();if(e instanceof Fv){let n=i?.supportIcons??this.creationOptions?.supportIcons;e.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines,n),this.setupHover(e.element,i?.descriptionTitle)}else e.textContent=t&&i?.labelEscapeNewLines?Fv.escapeNewLines(t,[]):t||"",this.setupHover(e.element,i?.descriptionTitle||""),e.empty=!t}(i?.suffix||this.suffixNode)&&(this.getOrCreateSuffixNode().textContent=i?.suffix??"")}setupHover(e,t){let i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}let n=e;if(this.creationOptions?.hoverTargetOverride){if(!lh(e,this.creationOptions.hoverTargetOverride))throw Error("hoverTargetOverrride must be an ancestor of the htmlElement");n=this.creationOptions.hoverTargetOverride}let s=A1.setupManagedHover(this.hoverDelegate,n,t);s&&this.customHovers.set(e,s)}dispose(){for(let e of(super.dispose(),this.customHovers.values()))e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){var e,t;let i=this._register(new Fb((e=this.nameContainer,t=lI("span.monaco-icon-suffix-container"),e.after(t),t)));this.suffixNode=this._register(new Fb(lk(i.element,lI("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){if(!this.descriptionNode){let e=this._register(new Fb(lk(this.labelContainer,lI("span.monaco-icon-description-container"))));this.creationOptions?.supportDescriptionHighlights?this.descriptionNode=this._register(new Fv(lk(e.element,lI("span.label-description")))):this.descriptionNode=this._register(new Fb(lk(e.element,lI("span.label-description"))))}return this.descriptionNode}}class Fw{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&(0,cI.fS)(this.options,t))){if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=lk(this.container,lI("a.label-name",{id:t?.domId}))),this.singleLabel.textContent=e;else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){let n=e[i],s=t?.domId&&`${t?.domId}_${i}`;lk(this.container,lI("a.label-name",{id:s,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&lk(this.container,lI("span.label-separator",void 0,t?.separator||"/"))}}}}}class Fy extends ro.JT{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label===e&&(0,cI.fS)(this.options,t))return;this.label=e,this.options=t;let i=t?.supportIcons??this.supportIcons;if("string"==typeof e)this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new Fv(lk(this.container,lI("a.label-name",{id:t?.domId}))))),this.singleLabel.set(e,t?.matches,void 0,t?.labelEscapeNewLines,i);else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;let n=t?.separator||"/",s=function(e,t,i){if(!i)return;let n=0;return e.map(e=>{let s={start:n,end:n+e.length},r=i.map(e=>nw.intersect(s,e)).filter(e=>!nw.isEmpty(e)).map(({start:e,end:t})=>({start:e-n,end:t-n}));return n=s.end+t.length,r})}(e,n,t?.matches);for(let r=0;r<e.length;r++){let o=e[r],a=s?s[r]:void 0,l=lI("a.label-name",{id:t?.domId&&`${t?.domId}_${r}`,"data-icon-label-count":e.length,"data-icon-label-index":r,role:"treeitem"});this._register(new Fv(lk(this.container,l))).set(o,a,void 0,t?.labelEscapeNewLines,i),r<e.length-1&&lk(l,lI("span.label-separator",void 0,n))}}}}i(68674);class FS extends ro.JT{constructor(e,t,i){super(),this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);let n=this.options.keybindingLabelForeground;this.domNode=lk(e,lI(".monaco-keybinding")),n&&(this.domNode.style.color=n),this.hover=this._register(A1.setupManagedHover(AZ("mouse"),this.domNode,"")),this.didEverRender=!1,e.appendChild(this.domNode)}set(e,t){this.didEverRender&&this.keybinding===e&&FS.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}
662render(){if(this.clear(),this.keybinding){let e=this.keybinding.getChords();e[0]&&this.renderChord(this.domNode,e[0],this.matches?this.matches.firstPart:null);for(let t=1;t<e.length;t++)lk(this.domNode,lI("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,e[t],this.matches?this.matches.chordPart:null);let t=this.options.disableTitle?void 0:this.keybinding.getAriaLabel()||void 0;this.hover.update(t),this.domNode.setAttribute("aria-label",t||"")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){a5(this.domNode),this.keyElements.clear()}renderChord(e,t,i){let n=Ad.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,n.ctrlKey,!!i?.ctrlKey,n.separator),t.shiftKey&&this.renderKey(e,n.shiftKey,!!i?.shiftKey,n.separator),t.altKey&&this.renderKey(e,n.altKey,!!i?.altKey,n.separator),t.metaKey&&this.renderKey(e,n.metaKey,!!i?.metaKey,n.separator);let s=t.keyLabel;s&&this.renderKey(e,s,!!i?.keyCode,"")}renderKey(e,t,i,n){lk(e,this.createKeyElement(t,i?".highlight":"")),n&&lk(e,lI("span.monaco-keybinding-key-separator",void 0,n))}renderUnbound(e){lk(e,this.createKeyElement((0,rh.NC)(15,"Unbound")))}createKeyElement(e,t=""){let i=lI("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),this.options.keybindingLabelBackground&&(i.style.backgroundColor=this.options.keybindingLabelBackground),this.options.keybindingLabelBorder&&(i.style.borderColor=this.options.keybindingLabelBorder),this.options.keybindingLabelBottomBorder&&(i.style.borderBottomColor=this.options.keybindingLabelBottomBorder),this.options.keybindingLabelShadow&&(i.style.boxShadow=`inset 0 -1px 0 ${this.options.keybindingLabelShadow}`),i}static areSame(e,t){return e===t||!e&&!t||!!e&&!!t&&(0,cI.fS)(e.firstPart,t.firstPart)&&(0,cI.fS)(e.chordPart,t.chordPart)}}(tb=nG||(nG={}))[tb.Expanded=0]="Expanded",tb[tb.Collapsed=1]="Collapsed",tb[tb.PreserveOrExpanded=2]="PreserveOrExpanded",tb[tb.PreserveOrCollapsed=3]="PreserveOrCollapsed",(tC=nQ||(nQ={}))[tC.Unknown=0]="Unknown",tC[tC.Twistie=1]="Twistie",tC[tC.Element=2]="Element",tC[tC.Filter=3]="Filter";class FL extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class Fx{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function Fk(e){return!!e&&void 0!==e.visibility}function FN(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function FD(e){return"collapsible"in e}class FE{constructor(e,t,i={}){this.user=e,this.rootRef=[],this.eventBufferer=new sd.E7,this._onDidSpliceModel=new sd.Q5,this.onDidSpliceModel=this._onDidSpliceModel.event,this._onDidSpliceRenderedNodes=new sd.Q5,this.onDidSpliceRenderedNodes=this._onDidSpliceRenderedNodes.event,this._onDidChangeCollapseState=new sd.Q5,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new sd.Q5,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this.refilterDelayer=new oF(oI),this.collapseByDefault=void 0!==i.collapseByDefault&&i.collapseByDefault,this.allowNonCollapsibleParents=i.allowNonCollapsibleParents??!1,this.filter=i.filter,this.autoExpandSingleChildren=void 0!==i.autoExpandSingleChildren&&i.autoExpandSingleChildren,this.root={parent:void 0,element:t,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=hc.$.empty(),n={}){if(0===e.length)throw new FL(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n=hc.$.empty(),s,r=s.diffDepth??0){let{parentNode:o}=this.getParentNodeWithListIndex(t);if(!o.lastDiffIds)return this.spliceSimple(t,i,n,s);let a=[...n],l=t[t.length-1],h=new cm({getElements:()=>o.lastDiffIds},{getElements:()=>[...o.children.slice(0,l),...a,...o.children.slice(l+i)].map(t=>e.getId(t.element).toString())}).ComputeDiff(!1);if(h.quitEarly)return o.lastDiffIds=void 0,this.spliceSimple(t,i,a,s);let d=t.slice(0,-1),u=(t,i,n)=>{if(r>0)for(let o=0;o<n;o++)t--,i--,this.spliceSmart(e,[...d,t,0],Number.MAX_SAFE_INTEGER,a[i].children,s,r-1)},c=Math.min(o.children.length,l+i),g=a.length;for(let e of h.changes.sort((e,t)=>
662t.originalStart-e.originalStart))u(c,g,c-(e.originalStart+e.originalLength)),c=e.originalStart,g=e.modifiedStart-l,this.spliceSimple([...d,c],e.originalLength,hc.$.slice(a,g,g+e.modifiedLength),s);u(c,g,c)}spliceSimple(e,t,i=hc.$.empty(),{onDidCreateNode:n,onDidDeleteNode:s,diffIdentityProvider:r}){let{parentNode:o,listIndex:a,revealed:l,visible:h}=this.getParentNodeWithListIndex(e),d=[],u=hc.$.map(i,e=>this.createTreeNode(e,o,o.visible?1:0,l,d,n)),c=e[e.length-1],g=0;for(let e=c;e>=0&&e<o.children.length;e--){let t=o.children[e];if(t.visible){g=t.visibleChildIndex;break}}let f=[],m=0,p=0;for(let e of u)f.push(e),p+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=g+m++);let _=(0,as.db)(o.children,c,t,f);r?o.lastDiffIds?(0,as.db)(o.lastDiffIds,c,t,f.map(e=>r.getId(e.element).toString())):o.lastDiffIds=o.children.map(e=>r.getId(e.element).toString()):o.lastDiffIds=void 0;let v=0;for(let e of _)e.visible&&v++;if(0!==v)for(let e=c+f.length;e<o.children.length;e++){let t=o.children[e];t.visible&&(t.visibleChildIndex-=v)}if(o.visibleChildrenCount+=m-v,_.length>0&&s){let e=t=>{s(t),t.children.forEach(e)};_.forEach(e)}if(l&&h){let e=_.reduce((e,t)=>e+(t.visible?t.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(o,p-e),this._onDidSpliceRenderedNodes.fire({start:a,deleteCount:e,elements:d})}this._onDidSpliceModel.fire({insertedNodes:f,deletedNodes:_});let b=o;for(;b;){if(2===b.visibility){this.refilterDelayer.trigger(()=>this.refilter());break}b=b.parent}}rerender(e){if(0===e.length)throw new FL(this.user,"Invalid tree location");let{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this._onDidSpliceRenderedNodes.fire({start:i,deleteCount:1,elements:[t]})}has(e){return this.hasTreeNode(e)}getListIndex(e){let{listIndex:t,visible:i,revealed:n}=this.getTreeNodeWithListIndex(e);return i&&n?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){let i=this.getTreeNode(e);void 0===t&&(t=!i.collapsible);let n={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,n))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){let n=this.getTreeNode(e);void 0===t&&(t=!n.collapsed);let s={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}_setCollapseState(e,t){let{node:i,listIndex:n,revealed:s}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,n,s,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!FD(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e<i.children.length;e++)if(i.children[e].visible){if(n>-1){n=-1;break}n=e}n>-1&&this._setCollapseState([...e,n],t)}return r}_setListNodeCollapseState(e,t,i,n){let s=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!s)return s;let r=e.renderNodeCount,o=this.updateNodeAfterCollapseChange(e);return this._onDidSpliceRenderedNodes.fire({start:t+1,deleteCount:r-(-1===t?0:1),elements:o.slice(1)}),s}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(FD(t)?(n=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(n=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):n=!1,n&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!FD(t)&&t.recursive)for(let i of e.children)n=this._setNodeCollapseState(i,t,!0)||n;return n}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){let e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this._onDidSpliceRenderedNodes.fire({start:0,deleteCount:e,elements:t}),this.refilterDelayer.cancel()}createTreeNode(e,t,i,n,s,r){let o={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(o,i);o.visibility=a,n&&s.push(o);let l=e.children||hc.$.empty(),h=n&&0!==a&&!o.collapsed,d=0,u=1;for(let e of l){let t=this.createTreeNode(e,o,a,h,s,r);o.children.push(t),u+=t.renderNodeCount,t.visible&&(t.visibleChildIndex=d++)}return this.allowNonCollapsibleParents||(o.collapsible=o.collapsible||o.children.length>0),o.visibleChildrenCount=d,o.visible=2===a?d>0:1===a,o.visible?o.collapsed||(o.renderNodeCount=u):(o.renderNodeCount=0,n&&s.pop()),r?.(o),o}updateNodeAfterCollapseChange(e){let t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(let i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){let t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let s;if(e!==this.root){if(0===(s=this._filterNode(e,t)))return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}let r=i.length;e.renderNodeCount=e===this.root?0:1;let o=!1;if(e.collapsed&&0===s)e.visibleChildrenCount=0;else{let t=0;for(let r of e.children)o=this._updateNodeAfterFilterChange(r,s,i,n&&!e.collapsed)||o,r.visible&&(r.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===s?o:1===s,e.visibility=s),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){let i=this.filter?this.filter.filter(e.element,t):1;return"boolean"==typeof i?(e.filterData=void 0,i?1:0):Fk(i)?(e.filterData=i.data,FN(i.visibility)):(e.filterData=void 0,FN(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;let[i,...n]=e;return!(i<0)&&!(i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;let[i,...n]=e;if(i<0||i>t.children.length)throw new FL(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};let{parentNode:t,listIndex:i,revealed:n,visible:s}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new FL(this.user,"Invalid tree location");let o=t.children[r];return{node:o,listIndex:i,revealed:n,visible:s&&o.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,s=!0){let[r,...o]=e;if(r<0||r>t.children.length)throw new FL(this.user,"Invalid tree location");for(let e=0;e<r;e++)i+=t.children[e].renderNodeCount;return(n=n&&!t.collapsed,s=s&&t.visible,0===o.length)?{parentNode:t,listIndex:i,revealed:n,visible:s}:this.getParentNodeWithListIndex(o,t.children[r],i+1,n,s)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){let t=[],i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){return 0===e.length?void 0:1===e.length?[]:(0,as.Gb)(e)[0]}getFirstElementChild(e){let t=this.getTreeNode(e);if(0!==t.children.length)return t.children[0].element}}i(60996);class FT extends Oe{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function FI(e){return e instanceof Oe?new FT(e):e}class FM{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=ro.JT.None,this.disposables=new ro.SL}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(FI(e),t)}onDragOver(e,t,i,n,s,r=!0){let o=this.dnd.onDragOver(FI(e),t&&t.element,i,n,s),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return o;if(a&&"boolean"!=typeof o&&o.autoExpand&&(this.autoExpandDisposable=oW(()=>{let e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0}
662,500,this.disposables)),"boolean"==typeof o||!o.accept||void 0===o.bubble||o.feedback)return r?o:{accept:"boolean"==typeof o?o:o.accept,effect:"boolean"==typeof o?void 0:o.effect,feedback:[i]};if(1===o.bubble){let i=this.modelProvider(),r=i.getNodeLocation(t),o=i.getParentNodeLocation(r),a=i.getNode(o),l=o&&i.getListIndex(o);return this.onDragOver(e,a,l,n,s,!1)}let l=this.modelProvider(),h=l.getNodeLocation(t),d=l.getListIndex(h),u=l.getListRenderCount(h);return{...o,feedback:(0,as.w6)(d,d+u)}}drop(e,t,i,n,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(FI(e),t&&t.element,i,n,s)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}class FR{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){this.delegate.setDynamicHeight?.(e.element,t)}}(tw=nY||(nY={})).None="none",tw.OnHover="onHover",tw.Always="always";class FA{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new ro.SL,this.onDidChange=sd.ju.forEach(e,e=>this._elements=e,this.disposables)}dispose(){this.disposables.dispose()}}class FO{static{this.DefaultIndent=8}constructor(e,t,i,n,s,r={}){this.renderer=e,this.model=t,this.activeNodes=n,this.renderedIndentGuides=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=FO.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=ro.JT.None,this.disposables=new ro.SL,this.templateId=e.templateId,this.updateOptions(r),sd.ju.map(i,e=>e.node)(this.onDidChangeNodeTwistieState,this,this.disposables),e.onDidChangeTwistieState?.(this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent){let t=EE(e.indent,0,40);if(t!==this.indent)for(let[e,i]of(this.indent=t,this.renderedNodes))i.indentSize=FO.DefaultIndent+(e.depth-1)*this.indent,this.renderTreeElement(e,i)}if(void 0!==e.renderIndentGuides){let t=e.renderIndentGuides!==nY.None;if(t!==this.shouldRenderIndentGuides){for(let[e,i]of(this.shouldRenderIndentGuides=t,this.renderedNodes))this._renderIndentGuides(e,i);if(this.indentGuidesDisposable.dispose(),t){let e=new ro.SL;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){let t=lk(e,lI(".monaco-tl-row")),i=lk(t,lI(".monaco-tl-indent")),n=lk(t,lI(".monaco-tl-twistie")),s=lk(t,lI(".monaco-tl-contents")),r=this.renderer.renderTemplate(s);return{container:e,indent:i,twistie:n,indentGuidesDisposable:ro.JT.None,indentSize:0,templateData:r}}renderElement(e,t,i,n){i.indentSize=FO.DefaultIndent+(e.depth-1)*this.indent,this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,{...n,indent:i.indentSize})}disposeElement(e,t,i,n){i.indentGuidesDisposable.dispose(),this.renderer.disposeElement?.(e,t,i.templateData,{...n,indent:i.indentSize}),"number"==typeof n?.height&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){let t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){let t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){t.twistie.style.paddingLeft=`${t.indentSize}px`,t.indent.style.width=`${t.indentSize+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...iH.asClassNameArray(rr.treeItemExpanded));let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...iH.asClassNameArray(rr.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(a5(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;let i=new ro.SL;for(;;){let n=this.model.getNodeLocation(e),s=this.model.getParentNodeLocation(n);if(!s)break;let r=this.model.getNode(s),o=lI(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&o.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(o):t.indent.insertBefore(o,t.indent.firstElementChild),this.renderedIndentGuides.add(r,o),i.add((0,ro.OF)(()=>this.renderedIndentGuides.delete(r,o))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;let t=new Set;
662e.forEach(e=>{let i=this.model.getNodeLocation(e);try{let n=this.model.getParentNodeLocation(i);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):n&&t.add(this.model.getNode(n))}catch{}}),this.activeIndentNodes.forEach(e=>{t.has(e)||this.renderedIndentGuides.forEach(e,e=>e.classList.remove("active"))}),t.forEach(e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,e=>e.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),(0,ro.B9)(this.disposables)}}class FP{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set findMatchType(e){this._findMatchType=e}get findMatchType(){return this._findMatchType}set findMode(e){this._findMode=e}get findMode(){return this._findMode}constructor(e,t,i){this._keyboardNavigationLabelProvider=e,this._filter=t,this._defaultFindVisibility=i,this._totalCount=0,this._matchCount=0,this._findMatchType=nZ.Fuzzy,this._findMode=nJ.Highlight,this._pattern="",this._lowercasePattern="",this.disposables=new ro.SL}filter(e,t){let i=1;if(this._filter){let n=this._filter.filter(e,t);if(0===(i="boolean"==typeof n?n?1:0:Fk(n)?FN(n.visibility):n))return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:nC.Default,visibility:i};let n=this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),s=Array.isArray(n)?n:[n];for(let e of s){let t;let n=e&&e.toString();if(void 0===n)return{data:nC.Default,visibility:i};if(t=this._findMatchType===nZ.Contiguous?function(e,t){let i;let n=t.toLowerCase().indexOf(e);if(n>-1){i=[Number.MAX_SAFE_INTEGER,0];for(let t=e.length;t>0;t--)i.push(n+t-1)}return i}(this._lowercasePattern,n.toLowerCase()):TH(this._pattern,this._lowercasePattern,0,n,n.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0}))return this._matchCount++,1===s.length?{data:t,visibility:i}:{data:{label:n,score:t},visibility:i}}return this._findMode!==nJ.Filter?{data:nC.Default,visibility:i}:"number"==typeof this._defaultFindVisibility?this._defaultFindVisibility:this._defaultFindVisibility?this._defaultFindVisibility(e):2}reset(){this._totalCount=0,this._matchCount=0}dispose(){(0,ro.B9)(this.disposables)}}class FF{constructor(e){this.stateMap=new Map(e.map(e=>[e.id,{...e}]))}get(e){let t=this.stateMap.get(e);if(void 0===t)throw Error(`No state found for toggle id ${e}`);return t.isChecked}set(e,t){let i=this.stateMap.get(e);if(void 0===i)throw Error(`No state found for toggle id ${e}`);return i.isChecked!==t&&(i.isChecked=t,!0)}}(ty=nJ||(nJ={}))[ty.Highlight=0]="Highlight",ty[ty.Filter=1]="Filter",(tS=nZ||(nZ={}))[tS.Fuzzy=0]="Fuzzy",tS[tS.Contiguous=1]="Contiguous",(tL=nX||(nX={})).Mode="mode",tL.MatchType="matchType";class FB{get pattern(){return this._pattern}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.widget?.setPlaceHolder(e)}constructor(e,t,i,n={}){this.tree=e,this.filter=t,this.contextViewProvider=i,this.options=n,this._pattern="",this._onDidChangePattern=new sd.Q5,this._onDidChangeOpenState=new sd.Q5,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new ro.SL,this.disposables=new ro.SL,this.toggles=new FF(n.toggles??[]),this._placeholder=n.placeholder??(0,rh.NC)(20,"Type to search")}isOpened(){return!!this.widget}updateToggleState(e,t){this.toggles.set(e,t),this.widget?.setToggleState(e,t)}renderMessage(e,t){e?this.tree.options.showNotFoundMessage??!0?this.widget?.showMessage({type:2,content:t??rh.NC(21,"No results found.")}):this.widget?.showMessage({type:2}):this.widget?.clearMessage()}alertResults(e){e?mt((0,rh.NC)(23,"{0} results",e)):mt((0,rh.NC)(22,"No results"))}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class FV extends FB{get mode(){return this.toggles.get(nX.Mode)?nJ.Filter:nJ.Highlight}set mode(e){if(e===this.mode)return;let t=e===nJ.Filter;this.updateToggleState(nX.Mode,t),this.placeholder=t?(0,rh.NC)(24,"Type to filter"):(0,rh.NC)(25,"Type to search"),this.filter.findMode=e,this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e)}get matchType(){return this.toggles.get(nX.MatchType)?nZ.Fuzzy:nZ.Contiguous}set matchType(e){e!==this.matchType&&(this.updateToggleState(nX.MatchType,e===nZ.Fuzzy),this.filter.findMatchType=e,this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,n={}){let s=n.defaultFindMode??nJ.Highlight,r=n.defaultFindMatchType??nZ.Fuzzy,o=[{id:nX.Mode,icon:rr.listFilter,title:(0,rh.NC)(26,"Filter"),isChecked:s===nJ.Filter},{id:nX.MatchType,icon:rr.searchFuzzy,title:(0,rh.NC)(27,"Fuzzy Match"),isChecked:r===nZ.Fuzzy}];t.findMatchType=r,t.findMode=s,super(e,t,i,{...n,toggles:o}),this.filter=t,this._onDidChangeMode=new sd.Q5,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new sd.Q5,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this.disposables.add(this.tree.onDidChangeModel(()=>{this.isOpened()&&(0!==this.pattern.length&&this.tree.refilter(),this.render())})),this.disposables.add(this.tree.onWillRefilter(()=>this.filter.reset()))}updateOptions(e={}){void 0!==e.defaultFindMode&&(this.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.matchType=e.defaultFindMatchType)}shouldAllowFocus(e){return!this.isOpened()||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1||!nC.isDefault(e.filterData)}render(){let e=0===this.filter.matchCount&&this.filter.totalCount>0&&this.pattern.length>0;this.renderMessage(e),this.pattern.length&&this.alertResults(this.filter.matchCount)}}function FW(e,t){return e.position===t.position&&FH(e,t)}
662function FH(e,t){return e.node.element===t.node.element&&e.startIndex===t.startIndex&&e.height===t.height&&e.endIndex===t.endIndex}class Fz{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return(0,as.fS)(this.stickyNodes,e.stickyNodes,FW)}contains(e){return this.stickyNodes.some(t=>t.node.element===e.element)}lastNodePartiallyVisible(){if(0===this.count)return!1;let e=this.stickyNodes[this.count-1];if(1===this.count)return 0!==e.position;let t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!(0,as.fS)(this.stickyNodes,e.stickyNodes,FH)||0===this.count)return!1;let t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class FU{constrainStickyScrollNodes(e,t,i){for(let n=0;n<e.length;n++){let s=e[n];if(s.position+s.height>i||n>=t)return e.slice(0,n)}return e}}class FK extends ro.JT{constructor(e,t,i,n,s,r={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=s,this.maxWidgetViewRatio=.4;let o=this.validateStickySettings(r);this.stickyScrollMaxItemCount=o.stickyScrollMaxItemCount,this.stickyScrollDelegate=r.stickyScrollDelegate??new FU,this.paddingTop=r.paddingTop??0,this._widget=this._register(new F$(i.getScrollableElement(),i,e,n,s,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this._register(t.onDidSpliceRenderedNodes(e=>{let t=this._widget.state;if(t){if(e.deleteCount>0&&t.stickyNodes.some(e=>!this.model.has(this.model.getNodeLocation(e.node)))){this.update();return}t.stickyNodes.some(i=>{let n=this.model.getListIndex(this.model.getNodeLocation(i.node));return n>=e.start&&n<e.start+e.deleteCount&&t.contains(i.node)})&&this._widget.rerender()}})),this.update()}get height(){return this._widget.height}getNodeAtHeight(e){let t;if(!((t=0===e?this.view.firstVisibleIndex:this.view.indexAt(e+this.view.scrollTop))<0)&&!(t>
662=this.view.length))return this.view.element(t)}update(){let e=this.getNodeAtHeight(this.paddingTop);if(!e||this.tree.scrollTop<=this.paddingTop){this._widget.setState(void 0);return}let t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){let t=[],i=e,n=0,s=this.getNextStickyNode(i,void 0,n);for(;s&&(t.push(s),n+=s.height,!(t.length<=this.stickyScrollMaxItemCount)||(i=this.getNextVisibleNode(s)));)s=this.getNextStickyNode(i,s.node,n);let r=this.constrainStickyNodes(t);return r.length?new Fz(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){let n=this.getAncestorUnderPrevious(e,t);if(!(!n||n===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(n,i)}nodeTopAlignsWithStickyNodesBottom(e,t){let i=this.getNodeIndex(e),n=this.view.getElementTop(i);return this.view.scrollTop===n-t}createStickyScrollNode(e,t){let i=this.treeDelegate.getHeight(e),{startIndex:n,endIndex:s}=this.getNodeRange(e);return{node:e,position:this.calculateStickyNodePosition(s,t,i),height:i,startIndex:n,endIndex:s}}getAncestorUnderPrevious(e,t){let i=e,n=this.getParentNode(i);for(;n;){if(n===t)return i;i=n,n=this.getParentNode(i)}if(void 0===t)return i}calculateStickyNodePosition(e,t,i){let n=this.view.getRelativeTop(e);if(null===n&&this.view.firstVisibleIndex===e&&e+1<this.view.length){let t=this.treeDelegate.getHeight(this.view.element
662(e)),i=this.view.getRelativeTop(e+1);n=i?i-t/this.view.renderHeight:null}if(null===n)return t;let s=this.view.element(e),r=this.treeDelegate.getHeight(s),o=n*this.view.renderHeight+r;return t+i>o&&t<=o?o-i:t}constrainStickyNodes(e){if(0===e.length)return[];let t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;let n=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!n.length)return[];let s=n[n.length-1];if(n.length>this.stickyScrollMaxItemCount||s.position+s.height>t)throw Error("stickyScrollDelegate violates constraints");return n}getParentNode(e){let t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){let t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){let t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){let t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw Error("Node not found in tree");return{startIndex:i,endIndex:i+this.model.getListRenderCount(t)-1}}nodePositionTopBelowWidget(e){let t=[],i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let n=0;for(let e=0;e<t.length&&e<this.stickyScrollMaxItemCount;e++)n+=this.treeDelegate.getHeight(t[e]);return n}domFocus(){this._widget.domFocus()}focusedLast(){return this._widget.focusedLast()}updateOptions(e={}){if(void 0!==e.paddingTop&&(this.paddingTop=e.paddingTop),void 0!==e.stickyScrollMaxItemCount){let t=this.validateStickySettings(e);this.stickyScrollMaxItemCount!==t.stickyScrollMaxItemCount&&(this.stickyScrollMaxItemCount=t.stickyScrollMaxItemCount,this.update())}}validateStickySettings(e){let t=7;return"number"==typeof e.stickyScrollMaxItemCount&&(t=Math.max(e.stickyScrollMaxItemCount,1)),{stickyScrollMaxItemCount:t}}}class F${get state(){return this._previousState}constructor(e,t,i,n,s,r){this.view=t,this.tree=i,this.treeRenderers=n,this.treeDelegate=s,this.accessibilityProvider=r,this._previousElements=[],this._previousStateDisposables=new ro.SL,this._rootDomNode=lI(".monaco-tree-sticky-container.empty"),e.appendChild(this._rootDomNode);let o=lI(".monaco-tree-sticky-container-shadow");this._rootDomNode.appendChild(o),this.stickyScrollFocus=new Fj(this._rootDomNode,t),this.onDidChangeHasFocus=this.stickyScrollFocus.onDidChangeHasFocus,this.onContextMenu=this.stickyScrollFocus.onContextMenu}get height(){if(!this._previousState)return 0;let e=this._previousState.stickyNodes[this._previousState.count-1];
662return e.position+e.height}setState(e){let t=!!this._previousState&&this._previousState.count>0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}let n=e.stickyNodes[e.count-1];this._previousState&&e.animationStateChanged(this._previousState)?this._previousElements[this._previousState.count-1].style.top=`${n.position}px`:this.renderState(e),this._previousState=e,this._rootDomNode.style.height=`${n.position+n.height}px`}renderState(e){this._previousStateDisposables.clear();let t=Array(e.count);for(let i=e.count-1;i>=0;i--){let n=e.stickyNodes[i],{element:s,disposable:r}=this.createElement(n,i,e.count);t[i]=s,this._rootDomNode.appendChild(s),this._previousStateDisposables.add(r)}this.stickyScrollFocus.updateElements(t,e),this._previousElements=t}rerender(){this._previousState&&this.renderState(this._previousState)}createElement(e,t,i){let n=e.startIndex,s=document.createElement("div");s.style.top=`${e.position}px`,!1!==this.tree.options.setRowHeight&&(s.style.height=`${e.height}px`),!1!==this.tree.options.setRowLineHeight&&(s.style.lineHeight=`${e.height}px`),s.classList.add("monaco-tree-sticky-row"),s.classList.add("monaco-list-row"),s.setAttribute("data-index",`${n}`),s.setAttribute("data-parity",n%2==0?"even":"odd"),s.setAttribute("id",this.view.getElementID(n));let r=this.setAccessibilityAttributes(s,e.node.element,t,i),o=this.treeDelegate.getTemplateId(e.node),a=this.treeRenderers.find(e=>e.templateId===o);if(!a)throw Error(`No renderer found for template id ${o}`);let l=e.node;l===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(l=new Proxy(e.node,{}));let h=a.renderTemplate(s);a.renderElement(l,e.startIndex,h,{height:e.height});let d=(0,ro.OF)(()=>{r.dispose(),a.disposeElement(l,e.startIndex,h,{height:e.height}),a.disposeTemplate(h),s.remove()});return{element:s,disposable:d}}setAccessibilityAttributes(e,t,i,n){if(!this.accessibilityProvider)return ro.JT.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,n))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");let s=this.accessibilityProvider.getAriaLabel(t),r=s&&"string"!=typeof s?s:Or(s),o=aN(t=>{let i=t.readObservable(r);i?e.setAttribute("aria-label",i):e.removeAttribute("aria-label")});"string"==typeof s||s&&e.setAttribute("aria-label",s.get());let a=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return"number"==typeof a&&e.setAttribute("aria-level",`${a}`),e.setAttribute("aria-selected",String(!1)),o}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}}class Fj extends ro.JT{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new sd.Q5,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new sd.Q5,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(a6(this.container,"focus",()=>this.onFocus())),this._register(a6(this.container,"blur",()=>this.onBlur())),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(e=>this.onKeyDown(e))),this._register(this.view.onMouseDown(e=>this.onMouseDown(e))),this._register(this.view.onContextMenu(e=>this.handleContextMenu(e)))}handleContextMenu(e){let t=e.browserEvent.target;if(!Om(t)&&!Of(t)){this.focusedLast()&&this.view.domFocus();return}if(!lw(e.browserEvent)){if(!this.state)throw Error("Context menu should not be triggered when state is undefined");let t=this.state.stickyNodes.findIndex(t=>t.node.element===e.element?.element);if(-1===t)throw Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(t);return}if(!this.state||this.focusedIndex<0)throw Error("Context menu key should not be triggered when focu
662s is not in sticky scroll widget");let i=this.state.stickyNodes[this.focusedIndex].node.element,n=this.elements[this.focusedIndex];this._onContextMenu.fire({element:i,anchor:n,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if("ArrowUp"===e.key)this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if("ArrowDown"===e.key||"ArrowRight"===e.key){if(this.focusedIndex>=this.state.count-1){let e=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([e]),this.scrollNodeUnderWidget(e,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){let t=e.browserEvent.target;(Om(t)||Of(t))&&(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&0===t.count)throw Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw Error("Sticky scroll focus received illigel state");let i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){let e=EE(i,0,t.count-1);this.setFocus(e)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){let t=this.state;if(!t)throw Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e<t.count-1)&&t.lastNodePartiallyVisible()){let i=t.stickyNodes[e];this.scrollNodeUnderWidget(i.endIndex+1,t)}}scrollNodeUnderWidget(e,t){let i=t.stickyNodes[t.count-1],n=t.count>1?t.stickyNodes[t.count-2]:void 0,s=this.view.getElementTop(e),r=n?n.position+n.height+i.height:i.height;this.view.scrollTop=s-r}domFocus(){if(!this.state)throw Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return!!this.state&&this.view.getHTMLElement().classList.contains("sticky-scroll-focused")}removeFocus(){-1!==this.focusedIndex&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw Error("Cannot set focus index to an index that does not exist");let t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){-1!==this.focusedIndex&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||0===this.elements.length)throw Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),-1===this.focusedIndex&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function Fq(e){let t=nQ.Unknown;return ld(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=nQ.Twistie:ld(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?t=nQ.Element:ld(e.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(t=nQ.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function FG(e){let t=Om(e.browserEvent.target);return{element:e.element?e.element.element:null,browserEvent:e.browserEvent,anchor:e.anchor,isStickyScroll:t}}function FQ(e,t){t(e),e.children.forEach(e=>FQ(e,t))}class FY{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new sd.Q5,this.onDidChange=this._onDidChange.event}set(e,t){!t?.__forceEvent&&(0,as.fS)(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){let e=this;this._onDidChange.fire({get elements(){return e.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}
662){if(!this.identityProvider){let e=this.createNodeSet(),i=t=>e.delete(t);t.forEach(e=>FQ(e,i)),this.set([...e.values()]);return}let i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach(e=>FQ(e,n));let s=new Map,r=e=>s.set(this.identityProvider.getId(e.element).toString(),e);e.forEach(e=>FQ(e,r));let o=[];for(let e of this.nodes){let t=this.identityProvider.getId(e.element).toString();if(i.has(t)){let e=s.get(t);e&&e.visible&&o.push(e)}else o.push(e)}if(this.nodes.length>0&&0===o.length){let e=this.getFirstViewElementWithTrait();e&&o.push(e)}this._set(o,!0)}createNodeSet(){let e=new Set;for(let t of this.nodes)e.add(t);return e}}class FJ extends OS{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(function e(t){return!!("A"===t.tagName&&t.classList.contains("monaco-button")||"DIV"===t.tagName&&t.classList.contains("monaco-button-dropdown"))||!t.classList.contains("monaco-list")&&!!t.parentElement&&e(t.parentElement)}(e.browserEvent.target)||lH(e.browserEvent.target)||Og(e.browserEvent.target)||e.browserEvent.isHandledByList)return;let t=e.element;if(!t||this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);let i=e.browserEvent.target,n=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,s=Of(e.browserEvent.target),r=!1;if(r=!!s||("function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick),s)this.handleStickyScrollMouseEvent(e,t);else if(r&&!n&&2!==e.browserEvent.detail||!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e);if(t.collapsible&&(!s||n)){let i=this.tree.getNodeLocation(t),s=e.browserEvent.altKey;if(this.tree.setFocus([i]),this.tree.toggleCollapsed(i,s),n){e.browserEvent.isHandledByList=!0;return}}s||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(Oc(e.browserEvent.target,"monaco-custom-toggle")||Oc(e.browserEvent.target,"action-item"))return;let i=this.stickyScrollProvider();if(!i)throw Error("Sticky scroll controller not found");let n=this.list.indexOf(t),s=this.list.getElementTop(n),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=s-r,this.list.domFocus(),this.list.setFocus([n]),this.list.setSelection([n])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){let t=e.browserEvent.target;if(!Om(t)&&!Of(t)){super.onMouseDown(e);return}}onContextMenu(e){let t=e.browserEvent.target;if(!Om(t)&&!Of(t)){super.onContextMenu(e);return}}}class FZ extends OM{constructor(e,t,i,n,s,r,o,a){super(e,t,i,n,a),this.focusTrait=s,this.selectionTrait=r,this.anchorTrait=o}createMouseController(e){return new FJ(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){let n;if(super.splice(e,t,i),0===i.length)return;let s=[],r=[];i.forEach((t,i)=>{this.focusTrait.has(t)&&s.push(e+i),this.selectionTrait.has(t)&&r.push(e+i),this.anchorTrait.has(t)&&(n=e+i)}),s.length>0&&super.setFocus((0,as.EB)([...super.getFocus(),...s])),r.length>0&&super.setSelection((0,as.EB)([...super.getSelection(),...r])),"number"==typeof n&&super.setAnchor(n)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(e=>this.element(e)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(e=>this.element(e)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class FX{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return sd.ju.filter(sd.ju.map(this.view.onMouseDblClick,Fq),e=>e.target!==nQ.Filter)}get onMouseOver(){return sd.ju.map(this.view.onMouseOver,Fq)}get onMouseOut(){return sd.ju.map(this.view.onMouseOut,Fq)}get onContextMenu(){return sd.ju.any(sd.ju.filter(sd.ju.map(this.view.onContextMenu,FG),e=>!e.isStickyScroll),this.stickyScrollController?.onContextMenu??sd.ju.None)}get onPointer(){return sd.ju.map(this.view.onPointer,Fq)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return sd.ju.any(this.onDidChangeModelRelay.event,this.onDidSwapModel.event)}get onDidChangeCollapseState(){return this.onDidChangeCollapseStateRelay.event}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,s={}){var r,o,a;this._user=e,this._options=s,this.eventBufferer=new sd.E7,this.onDidChangeFindOpenState=sd.ju.None,this.onDidChangeStickyScrollFocused=sd.ju.None,this.disposables=new ro.SL,this.onDidSwapModel=this.disposables.add(new sd.Q5),this.onDidChangeModelRelay=this.disposables.add(new sd.ZD),this.onDidSpliceModelRelay=this.disposables.add(new sd.ZD),this.onDidChangeCollapseStateRelay=this.disposables.add(new sd.ZD),this.onDidChangeRenderNodeCountRelay=this.disposables.add(new sd.ZD),this.onDidChangeActiveNodesRelay=this.disposables.add(new sd.ZD),this._onWillRefilter=new sd.Q5,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new sd.Q5,this.modelDisposables=new ro.SL,s.keyboardNavigationLabelProvider&&(s.findWidgetEnabled??!0)&&(this.findFilter=new FP(s.keyboardNavigationLabelProvider,s.filter,s.defaultFindVisibility),s={...s,filter:this.findFilter},this.disposables.add(this.findFilter)),this.model=this.createModel(e,s),this.treeDelegate=new FR(i);let l=this.disposables.add(new FA(this.onDidChangeActiveNodesRelay.event)),h=new dm;for(let e of(this.renderers=n.map(e=>new FO(e,this.model,this.onDidChangeCollapseStateRelay.event,l,h,s)),this.renderers))this.disposables.add(e);if(this.focus=new FY(()=>
662this.view.getFocusedElements()[0],s.identityProvider),this.selection=new FY(()=>this.view.getSelectedElements()[0],s.identityProvider),this.anchor=new FY(()=>this.view.getAnchorElement(),s.identityProvider),this.view=new FZ(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...(r=()=>this.model,o=this.disposables,(a=s)&&{...a,identityProvider:a.identityProvider&&{getId:e=>a.identityProvider.getId(e.element)},dnd:a.dnd&&o.add(new FM(r,a.dnd)),multipleSelectionController:a.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>a.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element}),isSelectionRangeChangeEvent:e=>a.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})},accessibilityProvider:a.accessibilityProvider&&{...a.accessibilityProvider,getSetSize(e){let t=r(),i=t.getNodeLocation(e),n=t.getParentNodeLocation(i);return t.getNode(n).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:a.accessibilityProvider&&a.accessibilityProvider.isChecked?e=>a.accessibilityProvider.isChecked(e.element):void 0,getRole:a.accessibilityProvider&&a.accessibilityProvider.getRole?e=>a.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>a.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>a.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:a.accessibilityProvider&&a.accessibilityProvider.getWidgetRole?()=>a.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:a.accessibilityProvider&&a.accessibilityProvider.getAriaLevel?e=>a.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:a.accessibilityProvider.getActiveDescendantId&&(e=>a.accessibilityProvider.getActiveDescendantId(e.element))},keyboardNavigationLabelProvider:a.keyboardNavigationLabelProvider&&{...a.keyboardNavigationLabelProvider,getKeyboardNavigationLabel:e=>a.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.setupModel(this.model),!1!==s.keyboardSupport){let e=sd.ju.chain(this.view.onKeyDown,e=>e.filter(e=>!lH(e.target)).map(e=>new ok(e)));sd.ju.chain(e,e=>e.filter(e=>15===e.keyCode))(this.onLeftArrow,this,this.disposables),sd.ju.chain(e,e=>e.filter(e=>17===e.keyCode))(this.onRightArrow,this,this.disposables),sd.ju.chain(e,e=>e.filter(e=>10===e.keyCode))(this.onSpace,this,this.disposables)}if((s.findWidgetEnabled??!0)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider){let e={styles:s.findWidgetStyles,defaultFindMode:s.defaultFindMode,defaultFindMatchType:s.defaultFindMatchType,showNotFoundMessage:s.showNotFoundMessage};this.findController=this.disposables.add(new FV(this,this.findFilter,s.contextViewProvider,e)),this.focusNavigationFilter=e=>this.findController.shouldAllowFocus(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=sd.ju.None,this.onDidChangeFindMatchType=sd.ju.None;s.enableStickyScroll&&(this.stickyScrollController=new FK(this,this.model,this.view,this.renderers,this.treeDelegate,s),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=mS(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===nY.Always)}updateOptions(e={}){for(let t of(this._options={...this._options,...e},this.renderers))t.updateOptions(e);this.view.updateOptions(this._options),this.findController?.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===nY.Always)}get options(){return this._options}updateStickyScroll(e){!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new FK(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=sd.ju.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),this.stickyScrollController?.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){this.stickyScrollController?.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){let t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide  { opacity: 1; border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${e.treeIndentGuidesStroke}; }`));
662let n=e.treeStickyScrollBackground??e.listBackground;n&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${n}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${n}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));let s=AH(e.listFocusAndSelectionOutline,AH(e.listSelectionOutline,e.listFocusOutline??""));s&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join("\n"),this.view.style(e)}getParentElement(e){let t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{let i=e.map(e=>this.model.getNode(e));this.selection.set(i,t);let n=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setSelection(n,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{let i=e.map(e=>this.model.getNode(e));this.focus.set(i,t);let n=e.map(e=>this.model.getListIndex(e)).filter(e=>e>-1);this.view.setFocus(n,t,!0)})}focusNext(e=1,t=!1,i,n=lw(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}focusPrevious(e=1,t=!1,i,n=lw(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,n)}focusNextPage(e,t=lw(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=lw(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>this.stickyScrollController?.height??0)}focusLast(e,t=lw(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=lw(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);let i=this.model.getListIndex(e);if(-1!==i){if(this.stickyScrollController){let n=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,n)}else this.view.reveal(i,t)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();let t=this.view.getFocusedElements();if(0===t.length)return;let i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){let e=this.model.getParentNodeLocation(n);if(!e)return;let t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();let t=this.view.getFocusedElements();if(0===t.length)return;let i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(e=>e.visible))return;let[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();let t=this.view.getFocusedElements();if(0===t.length)return;let i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}setupModel(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidSpliceRenderedNodes(({start:e,deleteCount:t,elements:i})=>this.view.splice(e,t,i)));let t=sd.ju.forEach(e.onDidSpliceModel,e=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)})},this.modelDisposables);t(()=>null,null,this.modelDisposables);let i=this.modelDisposables.add(new sd.Q5),n=this.modelDisposables.add(new oF(0));this.modelDisposables.add(sd.ju.any(t,this.focus.onDidChange,this.selection.onDidChange)(()=>{n.trigger(()=>{let e=new Set;for(let t of this.focus.getNodes())e.add(t);for(let t of this.selection.getNodes())e.add(t);i.fire([...e.values()])})})),this.onDidChangeActiveNodesRelay.input=i.event,this.onDidChangeModelRelay.input=sd.ju.signal(e.onDidSpliceModel),this.onDidChangeCollapseStateRelay.input=e.onDidChangeCollapseState,this.onDidChangeRenderNodeCountRelay.input=e.onDidChangeRenderNodeCount,this.onDidSpliceModelRelay.input=e.onDidSpliceModel}dispose(){(0,ro.B9)(this.disposables),this.stickyScrollController?.dispose(),this.view.dispose(),this.modelDisposables.dispose()}}let F1=new rS(()=>{let e=cN.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}});new rS(()=>({collator:cN.Collator(void 0,{numeric:!0}).value})),new rS(()=>({collator:cN.Collator(void 0,{numeric:!0,sensitivity:"accent"}).value}));class F0{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:ro.JT.None}}renderElement(e,t,i,n){if(i.disposable?.dispose(),!i.data)return;let s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,i.data,n);let r=new sg,o=s.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),o.then(t=>this.renderer.renderElement(t,e,i.data,n))}
662disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class F2{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){let t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}class F5{constructor(e,t,i,n,s={}){this.modelDisposables=new ro.SL;let r=()=>this.model,o=n.map(e=>new F0(e,r));this.list=new OM(e,t,i,o,{...s,accessibilityProvider:s.accessibilityProvider&&new F2(r,s.accessibilityProvider)})}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return sd.ju.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return sd.ju.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return sd.ju.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(e=>this._model.get(e)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this.modelDisposables.clear(),this._model=e,this.list.splice(0,this.list.length,(0,as.w6)(e.length)),this.modelDisposables.add(e.onDidIncrementLength(e=>this.list.splice(this.list.length,0,(0,as.w6)(this.list.length,e))))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose(),this.modelDisposables.dispose()}}i(34231);var F4=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o};(tx=n1||(n1={})).North="north",tx.South="south",tx.East="east",tx.West="west";let F6=new sd.Q5,F7=new sd.Q5;class F3{constructor(e){this.el=e,this.disposables=new ro.SL}get onPointerMove(){return this.disposables.add(new bc(aG(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new bc(aG(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}F4([vq],F3.prototype,"onPointerMove",null),F4([vq],F3.prototype,"onPointerUp",null);class F9{get onPointerMove(){return this.disposables.add(new bc(this.el,i6.Change)).event}get onPointerUp(){return this.disposables.add(new bc(this.el,i6.End)).event}constructor(e){this.el=e,this.disposables=new ro.SL}dispose(){this.disposables.dispose()}}F4([vq],F9.prototype,"onPointerMove",null),F4([vq],F9.prototype,"onPointerUp",null);class F8{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}F4([vq],F8.prototype,"onPointerMove",null),F4([vq],F8.prototype,"onPointerUp",null);let Be="pointer-events-disabled";class Bt extends ro.JT{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}get onDidStart(){return this._onDidStart.event}get onDidChange(){return this._onDidChange.event}get onDidReset(){return this._onDidReset.event}get onDidEnd(){return this._onDidEnd.event}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){let t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=lk(this.el,lI(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add((0,ro.OF)(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(a6(this._orthogonalStartDragHandle,"mouseenter",()=>Bt.onMouseEnter(e))),this.orthogonalStartDragHandleDisposables.add(a6(this._orthogonalStartDragHandle,"mouseleave",()=>Bt.onMouseLeave(e))))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){let t=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=lk(this.el,lI(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add((0,ro.OF)(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(a6(this._orthogonalEndDragHandle,"mouseenter",()=>Bt.onMouseEnter(e))),this.orthogonalEndDragHandleDisposables.add(a6(this._orthogonalEndDragHandle,"mouseleave",()=>Bt.onMouseLeave(e))))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){let n;super(),this.hoverDelay=300,this.hoverDelayer=this._register(new oF(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new sd.Q5),this._onDidStart=this._register(new sd.Q5),this._onDidChange=this._register(new sd.Q5),this._onDidReset=this._register(new sd.Q5),this._onDidEnd=this._register(new sd.Q5),this.orthogonalStartSashDisposables=this._register(new ro.SL),this.orthogonalStartDragHandleDisposables=this._register(new ro.SL),this.orthogonalEndSashDisposables=this._register(new ro.SL),this.orthogonalEndDragHandleDisposables=this._register(new ro.SL),this.linkedSash=void 0,this.el=lk(e,lI(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),sS.dz&&this.el.classList.add("mac"),this._register(a6(this.el,"mousedown",t=>this.onPointerStart(t,new F3(e)))),this._register(a6(this.el,"dblclick",e=>this.onPointerDoublePress(e))),this._register(a6(this.el,"mouseenter",()=>Bt.onMouseEnter(this))),this._register(a6(this.el,"mouseleave",()=>Bt.onMouseLeave(this))),this._register(vG.addTarget(this.el)),this._register(a6(this.el,i6.Start,e=>this.onPointerStart(e,new F9(this.el)))),this._register(a6(this.el,i6.Tap,e=>{if(n){clearTimeout(n),n=void 0,this.onPointerDoublePress(e);return}clearTimeout(n),n=setTimeout(()=>n=void 0,250)})),"number"==typeof i.size?(this.size=i.size,0===i.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=4,this._register(F6.event(e=>{this.size=e,this.layout()}))),this._register(F7.event(e=>this.hoverDelay=e)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,1===this.orientation?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",!1),this.layout()}onPointerStart(e,t){lS.stop(e);let i=!1;if(!e.__orthogonalSashEvent){let n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new F8(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new F8(t))),!this.state)return;let n=this.el.ownerDocument.getElementsByTagName("iframe");for(let e of n)e.classList.add(Be);let s=e.pageX,r=e.pageY,o=e.altKey;this.el.classList.add("active"),this._onDidStart.fire({startX:s,currentX:s,startY:r,currentY:r,altKey:o});let a=mS(this.el),l=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":sS.dz?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":sS.dz?"col-resize":"ew-resize",a.textContent=`* { cursor: ${e} !important; }`},h=new ro.SL;l(),i||this.onDidEnablementChange.event(l,null,h),t.onPointerMove(e=>{lS.stop(e,!1);let t={startX:s,currentX:e.pageX,startY:r,currentY:e.pageY,altKey:o};this._onDidChange.fire(t)},null,h),t.onPointerUp(e=>{for(let t of(lS.stop(e,!1),a.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose(),n))t.classList.remove(Be)},null,h),h.add(t)}onPointerDoublePress(e){let t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Bt.onMouseEnter(e.linkedSash,!0)}
662static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Bt.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Bt.onMouseLeave(this)}layout(){if(0===this.orientation){let e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{let e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){let t=e.initialTarget??e.target;if(t&&l_(t)&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}i(30921);let Bi={separatorBorder:gX.transparent};class Bn{set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){if(e!==this.visible){e?(this.size=EE(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{this.view.setVisible?.(e)}catch(e){console.error("Splitview: Failed to set visible view"),console.error(e)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(e){console.error("Splitview: Failed to layout view"),console.error(e)}}dispose(){this.disposable.dispose()}}class Bs extends Bn{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Br extends Bn{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}(tk=n0||(n0={}))[tk.Idle=0]="Idle",tk[tk.Busy=1]="Busy",(tN=n2||(n2={})).Distribute={type:"distribute"},tN.Split=function(e){return{type:"split",index:e}},tN.Auto=function(e){return{type:"auto",index:e}},tN.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};class Bo extends ro.JT{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(let t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(let t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=n0.Idle,this._onDidSashChange=this._register(new sd.Q5),this._onDidSashReset=this._register(new sd.Q5),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??0,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.get
662SashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=lk(this.el,lI(".sash-container")),this.viewContainer=lI(".split-view-container"),this.scrollable=this._register(new v5({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:e=>u(aG(this.el),e)})),this.scrollableElement=this._register(new bt(this.viewContainer,{vertical:0===this.orientation?t.scrollbarVisibility??1:2,horizontal:1===this.orientation?t.scrollbarVisibility??1:2},this.scrollable));let i=this._register(new bc(this.viewContainer,"scroll")).event;this._register(i(e=>{let t=this.scrollableElement.getScrollPosition(),i=1>=Math.abs(this.viewContainer.scrollLeft-t.scrollLeft)?void 0:this.viewContainer.scrollLeft,n=1>=Math.abs(this.viewContainer.scrollTop-t.scrollTop)?void 0:this.viewContainer.scrollTop;(void 0!==i||void 0!==n)&&this.scrollableElement.setScrollPosition({scrollLeft:i,scrollTop:n})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(e=>{e.scrollTopChanged&&(this.viewContainer.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this.viewContainer.scrollLeft=e.scrollLeft)})),lk(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||Bi),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((e,t)=>{let i=(0,re.o8)(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)}),this._contentSize=this.viewItems.reduce((e,t)=>e+t.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,n){this.doAddView(e,t,i,n)}layout(e,t){let i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let t=0;for(let i=0;i<this.viewItems.length;i++){let n=this.viewItems[i],s=this.proportions[i];"number"==typeof s?t+=s:e-=n.size}for(let i=0;i<this.viewItems.length;i++){let n=this.viewItems[i],s=this.proportions[i];"number"==typeof s&&t>0&&(n.size=EE(Math.round(s*e/t),n.minimumSize,n.maximumSize))}}else{let t=(0,as.w6)(this.viewItems.length),n=t.filter(e=>1===this.viewItems[e].priority),s=t.filter(e=>2===this.viewItems[e].priority);this.resize(this.viewItems.length-1,e-i,void 0,n,s)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(let e of this.viewItems)e.enabled=!1;let n=this.sashItems.findIndex(t=>t.sash===e),s=(0,ro.F8)(a6(this.el.ownerDocument.body,"keydown",e=>r(this.sashDragState.current,e.altKey)),a6(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(e,t)=>{let i,r;let o=this.viewItems.map(e=>e.size),a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t){if(n===this.sashItems.length-1){let e=this.viewItems[n];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{let e=this.viewItems[n+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}}if(!t){let e=(0,as.w6)(n,-1),t=(0,as.w6)(n+1,this.viewItems.length),s=e.reduce((e,t)=>e+(this.viewItems[t].minimumSize-o[t]),0),a=e.reduce((e,t)=>e+(this.viewItems[t].viewMaximumSize-o[t]),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce((e,t)=>e+(o[t]-this.viewItems[t].minimumSize),0),h=Math.max(s,0===t.length?Number.NEGATIVE_INFINITY:t.reduce((e,t)=>e+(o[t]-this.viewItems[t].viewMaximumSize),0)),d=Math.min(l,a),u=this.findFirstSnapIndex(e),c=this.findFirstSnapIndex(t);if("number"==typeof u){let e=this.viewItems[u],t=Math.floor(e.viewMinimumSize/2);i={index:u,limitDelta:e.visible?h-t:h+t,size:e.size}}if("number"==typeof c){let e=this.viewItems[c],t=Math.floor(e.viewMinimumSize/2);r={index:c,limitDelta:e.visible?d+t:d-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:o,minDelta:a,maxDelta:l,alt:t,snapBefore:i,snapAfter:r,disposable:s}};r(t,i)}onSashChange({current:e}){let{index:t,start:i,sizes:n,alt:s,minDelta:r,maxDelta:o,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;let h=this.resize(t,e-i,n,void 0,void 0,r,o,a,l);if(s){let e=t===this.sashItems.length-1,i=this.viewItems.map(e=>e.size),n=e?t:t+1,s=this.viewItems[n],r=s.size-s.maximumSize,o=s.size-s.minimumSize;this.resize(e?t-1:t+1,-h,i,void 0,void 0,r,o)}
662this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){for(let t of(this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions(),this.viewItems))t.enabled=!0}onViewChange(e,t){let i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=EE(t="number"==typeof t?t:e.size,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0)&&!(e>=this.viewItems.length)){if(this.state!==n0.Idle)throw Error("Cant modify splitview");this.state=n0.Busy;try{let i=(0,as.w6)(this.viewItems.length).filter(t=>t!==e),n=[...i.filter(e=>1===this.viewItems[e].priority),e],s=i.filter(e=>2===this.viewItems[e].priority),r=this.viewItems[e];t=Math.round(t),t=EE(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(n,s)}finally{this.state=n0.Idle}}}distributeViewSizes(){let e=[],t=0;for(let i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);let i=Math.floor(t/e.length);for(let t of e)t.size=EE(i,t.minimumSize,t.maximumSize);let n=(0,as.w6)(this.viewItems.length),s=n.filter(e=>1===this.viewItems[e].priority),r=n.filter(e=>2===this.viewItems[e].priority);this.relayout(s,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,n){if(this.state!==n0.Idle)throw Error("Cant modify splitview");this.state=n0.Busy;try{let s,r;let o=lI(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));let a=e.onDidChange(e=>this.onViewChange(d,e)),l=(0,ro.OF)(()=>o.remove()),h=(0,ro.F8)(a,l);"number"==typeof t?s=t:("auto"===t.type&&(t=this.areViewsDistributed()?{type:"distribute"}:{type:"split",index:t.index}),s="split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize);let d=0===this.orientation?new Bs(o,e,s,h):new Br(o,e,s,h);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){let e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},t=0===this.orientation?new Bt(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},{...e,orientation:1}):new Bt(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},{...e,orientation:0}),n=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),s=sd.ju.map(t.onDidStart,n)(this.onSashStart,this),r=sd.ju.map(t.onDidChange,n)(this.onSashChange,this),o=sd.ju.map(t.onDidEnd,()=>this.sashItems.findIndex(e=>e.sash===t))(this.onSashEnd,this),a=t.onDidReset(()=>{let e=this.sashItems.findIndex(e=>e.sash===t),i=(0,as.w6)(e,-1),n=(0,as.w6)(e+1,this.viewItems.length),s=this.findFirstSnapIndex(i),r=this.findFirstSnapIndex(n);("number"!=typeof s||this.viewItems[s].visible)&&("number"!=typeof r||this.viewItems[r].visible)&&this._onDidSashReset.fire(e)}),l=(0,ro.F8)(s,r,o,a,t);this.sashItems.splice(i-1,0,{sash:t,disposable:l})}o.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(r=[t.index]),n||this.relayout([i],r),n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}finally{this.state=n0.Idle}}relayout(e,t){let i=this.viewItems.reduce((e,t)=>e+t.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(e=>e.size),n,s,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;let h=(0,as.w6)(e,-1),d=(0,as.w6)(e+1,this.viewItems.length);if(s)for(let e of s)(0,as.zI)(h,e),(0,as.zI)(d,e);if(n)for(let e of n)(0,as.al)(h,e),(0,as.al)(d,e);let u=h.map(e=>this.viewItems[e]),c=h.map(e=>i[e]),g=d.map(e=>this.viewItems[e]),f=d.map(e=>i[e]),m=h.reduce((e,t)=>e+(this.viewItems[t].minimumSize-i[t]),0),p=h.reduce((e,t)=>
662e+(this.viewItems[t].maximumSize-i[t]),0),_=0===d.length?Number.POSITIVE_INFINITY:d.reduce((e,t)=>e+(i[t]-this.viewItems[t].minimumSize),0),v=Math.max(m,0===d.length?Number.NEGATIVE_INFINITY:d.reduce((e,t)=>e+(i[t]-this.viewItems[t].maximumSize),0),r),b=Math.min(_,p,o),C=!1;if(a){let e=this.viewItems[a.index],i=t>=a.limitDelta;C=i!==e.visible,e.setVisible(i,a.size)}if(!C&&l){let e=this.viewItems[l.index],i=t<l.limitDelta;C=i!==e.visible,e.setVisible(i,l.size)}if(C)return this.resize(e,t,i,n,s,r,o);t=EE(t,v,b);for(let e=0,i=t;e<u.length;e++){let t=u[e],n=EE(c[e]+i,t.minimumSize,t.maximumSize);i-=n-c[e],t.size=n}for(let e=0,i=t;e<g.length;e++){let t=g[e],n=EE(f[e]-i,t.minimumSize,t.maximumSize);i+=n-f[e],t.size=n}return t}distributeEmptySpace(e){let t=this.viewItems.reduce((e,t)=>e+t.size,0),i=this.size-t,n=(0,as.w6)(this.viewItems.length-1,-1),s=n.filter(e=>1===this.viewItems[e].priority);for(let e of n.filter(e=>2===this.viewItems[e].priority))(0,as.zI)(n,e);for(let e of s)(0,as.al)(n,e);"number"==typeof e&&(0,as.al)(n,e);for(let e=0;0!==i&&e<n.length;e++){let t=this.viewItems[n[e]],s=EE(t.size+i,t.minimumSize,t.maximumSize);i-=s-t.size,t.size=s}}layoutViews(){this._contentSize=this.viewItems.reduce((e,t)=>e+t.size,0);let e=0;for(let t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(e=>e.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1,t=this.viewItems.map(t=>e=t.size-t.minimumSize>0||e);e=!1;let i=this.viewItems.map(t=>e=t.maximumSize-t.size>0||e),n=[...this.viewItems].reverse();e=!1;let s=n.map(t=>e=t.size-t.minimumSize>0||e).reverse();e=!1;let r=n.map(t=>e=t.maximumSize-t.size>0||e).reverse(),o=0;for(let e=0;e<this.sashItems.length;e++){let{sash:n}=this.sashItems[e];o+=this.viewItems[e].size;let a=!(t[e]&&r[e+1]),l=!(i[e]&&s[e+1]);if(a&&l){let i=(0,as.w6)(e,-1),r=(0,as.w6)(e+1,this.viewItems.length),a=this.findFirstSnapIndex(i),l=this.findFirstSnapIndex(r),h="number"==typeof a&&!this.viewItems[a].visible,d="number"==typeof l&&!this.viewItems[l].visible;h&&s[e]&&(o>0||this.startSnappingEnabled)?n.state=1:d&&t[e]&&(o<this._contentSize||this.endSnappingEnabled)?n.state=2:n.state=0}else a&&!l?n.state=1:!a&&l?n.state=2:n.state=3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(let t of e){let e=this.viewItems[t];if(e.visible&&e.snap)return t}for(let t of e){let e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)break;if(!e.visible&&e.snap)return t}}areViewsDistributed(){let e,t;for(let i of this.viewItems)if(e=void 0===e?i.size:Math.min(e,i.size),(t=void 0===t?i.size:Math.max(t,i.size))-e>2)return!1;return!0}dispose(){this.sashDragState?.disposable.dispose(),(0,ro.B9)(this.viewItems),this.viewItems=[],this.sashItems.forEach(e=>e.disposable.dispose()),this.sashItems=[],super.dispose()}}i(48698);class Ba{static{this.TemplateId="row"}constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=Ba.TemplateId,this.renderedTemplates=new Set;let n=new Map(t.map(e=>[e.templateId,e]));for(let t of(this.renderers=[],e)){let e=n.get(t.templateId);if(!e)throw Error(`Table cell renderer for template id ${t.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){let t=lk(e,lI(".monaco-table-tr")),i=[],n=[];for(let e=0;e<this.columns.length;e++){let s=this.renderers[e],r=lk(t,lI(".monaco-table-td",{"data-col-index":e}));r.style.width=`${this.getColumnSize(e)}px`,i.push(r),n.push(s.renderTemplate(r))}let s={container:e,cellContainers:i,cellTemplateData:n};return this.renderedTemplates.add(s),s}renderElement(e,t,i,n){for(let s=0;s<this.columns.length;s++){let r=this.columns[s].project(e);this.renderers[s].renderElement(r,t,i.cellTemplateData[s],n)}}disposeElement(e,t,i,n){for(let s=0;s<this.columns.length;s++){let r=this.renderers[s];if(r.disposeElement){let o=this.columns[s].project(e);
662r.disposeElement(o,t,i.cellTemplateData[s],n)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);a5(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(let{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}class Bl extends ro.JT{get minimumSize(){return this.column.minimumWidth??120}get maximumSize(){return this.column.maximumWidth??Number.POSITIVE_INFINITY}get onDidChange(){return this.column.onDidChangeWidthConstraints??sd.ju.None}constructor(e,t){super(),this.column=e,this.index=t,this._onDidLayout=new sd.Q5,this.onDidLayout=this._onDidLayout.event,this.element=lI(".monaco-table-th",{"data-col-index":t},e.label),e.tooltip&&this._register(A1.setupManagedHover(AZ("mouse"),this.element,e.tooltip))}layout(e){this._onDidLayout.fire([this.index,e])}}class Bh{static{this.InstanceCount=0}get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onDidScroll(){return this.list.onDidScroll}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollHeight(){return this.list.scrollHeight}get renderHeight(){return this.list.renderHeight}get onDidDispose(){return this.list.onDidDispose}constructor(e,t,i,n,s,r){this.virtualDelegate=i,this.columns=n,this.domId=`table_id_${++Bh.InstanceCount}`,this.disposables=new ro.SL,this.cachedWidth=0,this.cachedHeight=0,this.domNode=lk(t,lI(`.monaco-table.${this.domId}`));let o=n.map((e,t)=>this.disposables.add(new Bl(e,t))),a={size:o.reduce((e,t)=>e+t.column.weight,0),views:o.map(e=>({size:e.column.weight,view:e}))};this.splitview=this.disposables.add(new Bo(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:a})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;let l=new Ba(n,s,e=>this.splitview.getViewSize(e));this.list=this.disposables.add(new OM(e,this.domNode,{getHeight:e=>i.getHeight(e),getTemplateId:()=>Ba.TemplateId},[l],r)),sd.ju.any(...o.map(e=>e.onDidLayout))(([e,t])=>l.layoutColumn(e,t),null,this.disposables),this.splitview.onDidSashReset(e=>{let t=n.reduce((e,t)=>e+t.weight,0),i=n[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,i)},null,this.disposables),this.styleElement=mS(this.domNode),this.style(Ox)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){let t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {
663			top: ${this.virtualDelegate.headerRowHeight+1}px;
664			height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
665		}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}class Bd{constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new FE(e,null,t),this.onDidSpliceModel=this.model.onDidSpliceModel,this.onDidSpliceRenderedNodes=this.model.onDidSpliceRenderedNodes,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,t.sorter&&(this.sorter={compare:(e,i)=>t.sorter.compare(e.element,i.element)}),this.identityProvider=t.identityProvider}setChildren(e,t=hc.$.empty(),i={}){let n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=hc.$.empty(),i){let n=new Set,s=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:e=>{if(null!==e.element){if(n.add(e.element),this.nodes.set(e.element,e),this.identityProvider){let t=this.identityProvider.getId(e.element).toString();s.add(t),this.nodesByIdentity.set(t,e)}i.onDidCreateNode?.(e)}},onDidDeleteNode:e=>{if(null!==e.element){if(n.has(e.element)||this.nodes.delete(e.element),this.identityProvi
665der){let t=this.identityProvider.getId(e.element).toString();s.has(t)||this.nodesByIdentity.delete(t)}i.onDidDeleteNode?.(e)}}})}preserveCollapseState(e=hc.$.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),hc.$.map(e,e=>{let t,i=this.nodes.get(e.element);if(!i&&this.identityProvider){let t=this.identityProvider.getId(e.element).toString();i=this.nodesByIdentity.get(t)}if(!i){let t;return t=void 0===e.collapsed?void 0:e.collapsed===nG.Collapsed||e.collapsed===nG.PreserveOrCollapsed||e.collapsed!==nG.Expanded&&e.collapsed!==nG.PreserveOrExpanded&&!!e.collapsed,{...e,children:this.preserveCollapseState(e.children),collapsed:t}}let n="boolean"==typeof e.collapsible?e.collapsible:i.collapsible;return t=void 0===e.collapsed||e.collapsed===nG.PreserveOrCollapsed||e.collapsed===nG.PreserveOrExpanded?i.collapsed:e.collapsed===nG.Collapsed||e.collapsed!==nG.Expanded&&!!e.collapsed,{...e,collapsible:n,collapsed:t,children:this.preserveCollapseState(e.children)}})}rerender(e){let t=this.getElementLocation(e);this.model.rerender(t)}resort(e=null,t=!0){if(!this.sorter)return;let i=this.getElementLocation(e),n=this.model.getNode(i);this._setChildren(i,this.resortChildren(n,t),{})}resortChildren(e,t,i=!0){let n=[...e.children];return(t||i)&&(n=n.sort(this.sorter.compare.bind(this.sorter))),hc.$.map(n,e=>({element:e.element,collapsible:e.collapsible,collapsed:e.collapsed,children:this.resortChildren(e,t,!1)}))}getFirstElementChild(e=null){let t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){let t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){let t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){let t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){let i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){let t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){let n=this.getElementLocation(e);return this.model.setCollapsed(n,t,i)}expandTo(e){let t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(null===e)return this.model.getNode(this.model.rootRef);let t=this.nodes.get(e);if(!t)throw new FL(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new FL(this.user,"Invalid getParentNodeLocation call");let t=this.nodes.get(e);if(!t)throw new FL(this.user,`Tree element not found: ${e}`);let i=this.model.getNodeLocation(t),n=this.model.getParentNodeLocation(i);return this.model.getNode(n).element}getElementLocation(e){if(null===e)return[];let t=this.nodes.get(e);if(!t)throw new FL(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function Bu(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:hc.$.map(hc.$.from(e.children),Bu),collapsible:e.collapsible,collapsed:e.collapsed}}function Bc(e){let t,i;let n=[e.element],s=e.incompressible||!1;for(;[i,t]=hc.$.consume(hc.$.from(e.children),2),1===i.length&&!i[0].incompressible;)n.push((e=i[0]).element);return{element:{elements:n,incompressible:s},children:hc.$.map(hc.$.concat(i,t),Bc),collapsible:e.collapsible,collapsed:e.collapsed}}function Bg(e){return function e(t,i=0){let n;return(n=i<t.element.elements.length-1?[e(t,i+1)]:hc.$.map(hc.$.from(t.children),t=>e(t,0)),0===i&&t.element.incompressible)?{element:t.element.elements[i],children:n,incompressible:!0,collapsible:t.collapsible,collapsed:t.collapsed}:{element:t.element.elements[i],children:n,collapsible:t.collapsible,collapsed:t.collapsed}}(e,0)}let Bf=e=>({getId:t=>t.elements.map(t=>e.getId(t).toString()).join("\0")});class Bm{get onDidSpliceRenderedNodes(){return this.model.onDidSpliceRenderedNodes}get onDidSpliceModel(){return this.model.onDidSpliceModel}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new Bd(e,t),this.enabled=void 0===t.compressionEnabled||t.compressionEnabled,this.identityProvi
665der=t.identityProvider}setChildren(e,t=hc.$.empty(),i){let n=i.diffIdentityProvider&&Bf(i.diffIdentityProvider);if(null===e){let e=hc.$.map(t,this.enabled?Bc:Bu);this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0});return}let s=this.nodes.get(e);if(!s)throw new FL(this.user,"Unknown compressed tree node");let r=this.model.getNode(s),o=this.model.getParentNodeLocation(s),a=this.model.getNode(o),l=function e(t,i,n){return t.element===i?{...t,children:n}:{...t,children:hc.$.map(hc.$.from(t.children),t=>e(t,i,n))}}(Bg(r),e,t),h=(this.enabled?Bc:Bu)(l),d=i.diffIdentityProvider?(e,t)=>i.diffIdentityProvider.getId(e)===i.diffIdentityProvider.getId(t):void 0;if((0,as.fS)(h.element.elements,r.element.elements,d)){this._setChildren(s,h.children||hc.$.empty(),{diffIdentityProvider:n,diffDepth:1});return}let u=a.children.map(e=>e===r?h:e);this._setChildren(a.element,u,{diffIdentityProvider:n,diffDepth:r.depth-a.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;let t=this.model.getNode().children,i=hc.$.map(t,Bg),n=hc.$.map(i,e?Bc:Bu);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){let n=new Set;this.model.setChildren(e,t,{...i,onDidCreateNode:e=>{for(let t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(let t of e.element.elements)n.has(t)||this.nodes.delete(t)}})}has(e){return this.nodes.has(e)}getListIndex(e){let t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){let t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(void 0===e)return this.model.getNode();let t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){let t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){let t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?null:i.elements[i.elements.length-1]}getFirstElementChild(e){let t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){let t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){let i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){let t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){let n=this.getCompressedNode(e);return this.model.setCollapsed(n,t,i)}expandTo(e){let t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){let t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}resort(e=null,t=!0){let i=this.getCompressedNode(e);this.model.resort(i,t)}getCompressedNode(e){if(null===e)return null;let t=this.nodes.get(e);if(!t)throw new FL(this.user,`Tree element not found: ${e}`);return t}}let Bp=e=>e[e.length-1];class B_{get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new B_(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}class Bv{get onDidSpliceModel(){return sd.ju.map(this.model.onDidSpliceModel,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(e=>this.nodeMapper.map(e)),deletedNodes:t.map(e=>this.nodeMapper.map(e))}))}get onDidSpliceRenderedNodes(){return sd.ju.map(this.model.onDidSpliceRenderedNodes,({start:e,deleteCount:t,elements:i})=>({start:e,deleteCount:t,elements:i.map(e=>this.nodeMapper.map(e))}))}get onDidChangeCollapseState(){return sd.ju.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return sd.ju.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t={}){this.rootRef=null,this.elementMapper=t.elementMapper||Bp;let i=e=>this.elementMapper(e.elements);this.nodeMapper=new Fx(e=>
665new B_(i,e)),this.model=new Bm(e,{...t,identityProvider:t.identityProvider&&{getId:e=>t.identityProvider.getId(i(e))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter(e,i){let n=e.elements;for(let e=0;e<n.length-1;e++){let s=t.filter.filter(n[e],i);i=FN(Fk(s)?s.visibility:s)}return t.filter.filter(n[n.length-1],i)}}})}setChildren(e,t=hc.$.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){let t=this.model.getFirstElementChild(e);return null==t?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}resort(e=null,t=!0){return this.model.resort(e,t)}getCompressedTreeNode(e=null){return this.model.getNode(e)}}class Bb extends FX{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,s={}){super(e,t,i,n,s),this.user=e}setChildren(e,t=hc.$.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(void 0===e){this.view.rerender();return}this.model.rerender(e)}resort(e,t=!0){this.model.resort(e,t)}hasElement(e){return this.model.has(e)}createModel(e,t){return new Bd(e,t)}}class BC{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){let s=this.stickyScrollDelegate.getCompressedNode(e);s||(s=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),1===s.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=s,this.renderer.renderCompressedElements(s,t,i.data,n))}disposeElement(e,t,i,n){i.compressedTreeNode?this.renderer.disposeCompressedElements?.(i.compressedTreeNode,t,i.data,n):this.renderer.disposeElement?.(e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?.(e,t)??!1}}!function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);r>3&&o&&Object.defineProperty(t,i,o)}([vq],BC.prototype,"compressedTreeNodeProvider",null);class Bw{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),0===e.length)return[];for(let n=0;n<e.length;n++){let s=e[n],r=s.position+s.height;if(n+1<e.length&&r+e[n+1].height>i||n>=t-1&&t<e.length){let t=e.slice(0,n),i=e.slice(n);return[...t,this.compressStickyNodes(i)]}}return e}compressStickyNodes(e){if(0===e.length)throw Error("Can't compress empty sticky nodes");let t=this.modelProvider();if(!t.isCompressionEnabled())return e[0];let i=[];for(let n=0;n<e.length;n++){let s=e[n],r=t.getCompressedTreeNode(s.node.element);if(r.element){if(0!==n&&r.element.incompressible)break;i.push(...r.element.elements)}}if(i.length<2)return e[0];let n=e[e.length-1],s={...n.node,children:[],element:{elements:i,incompressible:!1}},r=new Proxy(e[0].node,{}),o={node:r,startIndex:e[0].startIndex,endIndex:n.endIndex,position:e[0].position,height:e[0].height};return this.compressedStickyNodes.set(r,s),o}}class By extends Bb{constructor(e,t,i,n,s={}){let r=()=>this,o=new Bw(()=>this.model);super(e,t,i,n.map(e=>new BC(r,o,e)),{...s&&{...s,keyboardNavigationLabelProvider:s.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(e){let t;try{t=r().getCompressedTreeNode(e)}catch{return s.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e)}return 1===t.element.elements.length?s.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e):s.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.element.elements)}}},stickyScrollDelegate:o})}setChildren(e,t=hc.$.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t){return new Bv(e,t)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function BS(e){return{...e,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function BL(e,t){return!!t.parent&&(t.parent===e||BL(e,t.parent))}
665class Bx{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new Bx(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class Bk{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...iH.asClassNameArray(rr.treeItemLoading)),!0):(t.classList.remove(...iH.asClassNameArray(rr.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function BN(e){return{browserEvent:e.browserEvent,elements:e.elements.map(e=>e.element)}}function BD(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class BE extends Oe{constructor(e){super(e.elements.map(e=>e.element)),this.data=e}}function BT(e){return e instanceof Oe?new BE(e):e}class BI{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(e=>e.element),t)}onDragStart(e,t){this.dnd.onDragStart?.(BT(e),t)}onDragOver(e,t,i,n,s,r=!0){return this.dnd.onDragOver(BT(e),t&&t.element,i,n,s)}drop(e,t,i,n,s){this.dnd.drop(BT(e),t&&t.element,i,n,s)}onDragEnd(e){this.dnd.onDragEnd?.(e)}dispose(){this.dnd.dispose()}}class BM extends FP{constructor(e,t,i){super(t,i),this.findProvider=e,this.isFindSessionActive=!1}filter(e,t){let i=super.filter(e,t);return this.isFindSessionActive&&this.findMode!==nJ.Highlight&&this.findProvider.isVisible?0===FN(Fk(i)?i.visibility:i)?0:this.findProvider.isVisible(e)?i:0:i}}class BR extends FV{constructor(e,t,i,n,s){super(e,i,n,s),this.findProvider=t,this.filter=i,this.activeSession=!1,this.asyncWorkInProgress=!1,this.disposables.add((0,ro.OF)(async()=>{this.activeSession&&await this.findProvider.endSession?.()}))}render(){if(this.asyncWorkInProgress||!this.activeFindMetadata)return;let e=0===this.activeFindMetadata.matchCount&&this.pattern.length>0;this.renderMessage(e),this.pattern.length&&this.alertResults(this.activeFindMetadata.matchCount)}shouldAllowFocus(e){return this.shouldFocusWhenNavigating(e)}shouldFocusWhenNavigating(e){if(!this.activeSession||!this.activeFindMetadata)return!0;let t=e.element?.element;return!!(t&&this.activeFindMetadata.isMatch(t))||!nC.isDefault(e.filterData)}}function BA(e){return e&&{...e,collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new BI(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent({...t,element:t.element}),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent({...t,element:t.element})},accessibilityProvider:e.accessibilityProvider&&{...e.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>!!e.accessibilityProvider?.isChecked(t.element):void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvi
665der.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))},filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)},sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),defaultFindVisibility:t=>t.hasChildren&&t.stale?1:"number"==typeof e.defaultFindVisibility?e.defaultFindVisibility:void 0===e.defaultFindVisibility?2:e.defaultFindVisibility(t.element),stickyScrollDelegate:e.stickyScrollDelegate}}function BO(e,t){t(e),e.children.forEach(e=>BO(e,t))}class BP{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return sd.ju.map(this.tree.onDidChangeFocus,BN)}get onDidChangeSelection(){return sd.ju.map(this.tree.onDidChangeSelection,BN)}get onMouseDblClick(){return sd.ju.map(this.tree.onMouseDblClick,BD)}get onPointer(){return sd.ju.map(this.tree.onPointer,BD)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,s,r={}){let o;this.user=e,this.dataSource=s,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new sd.Q5,this._onDidChangeNodeSlowState=new sd.Q5,this.nodeMapper=new Fx(e=>new Bx(e)),this.disposables=new ro.SL,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=void 0!==r.autoExpandSingleChildren&&r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=e=>r.collapseByDefault?r.collapseByDefault(e)?nG.PreserveOrCollapsed:nG.PreserveOrExpanded:void 0;let a=!1;if(r.findProvider&&(r.findWidgetEnabled??!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider&&(a=!0,o=new BM(r.findProvider,r.keyboardNavigationLabelProvider,r.filter)),this.tree=this.createTree(e,t,i,n,{...r,findWidgetEnabled:!a,filter:o??r.filter}),this.root=BS({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables),a){let e={styles:r.findWidgetStyles,showNotFoundMessage:r.showNotFoundMessage,defaultFindMatchType:r.defaultFindMatchType,defaultFindMode:r.defaultFindMode};this.findController=this.disposables.add(new BR(this.tree,r.findProvider,o,this.tree.options.contextViewProvider,e)),this.focusNavigationFilter=e=>this.findController.shouldFocusWhenNavigating(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindOpenState=this.tree.onDidChangeFindOpenState,this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType}createTree(e,t,i,n,s){return new Bb(e,t,new FR(i),n.map(e=>new Bk(e,this.nodeMapper,this._onDidChangeNodeSlowState.event)),BA(s)||{})}updateOptions(e={}){this.findController&&(void 0!==e.defaultFindMode&&(this.findController.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.findController.matchType=e.defaultFindMatchType)),this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.cancelAllRefreshPromises(),this.root.element=e;let i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}
665cancelAllRefreshPromises(e=!1){this.refreshPromises.forEach(e=>e.cancel()),this.refreshPromises.clear(),e&&(this.subTreeRefreshPromises.forEach(e=>e.cancel()),this.subTreeRefreshPromises.clear())}async _updateChildren(e=this.root.element,t=!0,i=!1,n,s){if(void 0===this.root.element)throw new FL(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await sd.ju.toPromise(this._onDidRender.event));let r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,n,s),i)try{this.tree.rerender(r)}catch{}}rerender(e){if(void 0===e||e===this.root.element){this.tree.rerender();return}let t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){let t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){let i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(void 0===this.root.element)throw new FL(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await sd.ju.toPromise(this._onDidRender.event));let i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await i.refreshPromise,await sd.ju.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;let n=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await i.refreshPromise,await sd.ju.toPromise(this._onDidRender.event)),n}setSelection(e,t){let i=e.map(e=>this.getDataNode(e));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(e=>e.element)}setFocus(e,t){let i=e.map(e=>this.getDataNode(e));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(e=>e.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){let t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){let t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){let t=this.nodes.get(e===this.root.element?null:e);if(!t){let t=this.identityProvider?.getId(e).toString();throw new FL(this.user,`Data tree node not found${t?`: ${t}`:""}`)}return t}async refreshAndRenderNode(e,t,i,n){!this.disposables.isDisposed&&(await this.refreshNode(e,t,i),this.disposables.isDisposed||this.render(e,i,n))}async refreshNode(e,t,i){let n;if(this.subTreeRefreshPromises.forEach((s,r)=>{!n&&(r===e||BL(r,e)||BL(e,r))&&(n=s.then(()=>this.refreshNode(e,t,i)))}),n)return n;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){let n=oR(async()=>{let n=await this.doRefreshNode(e,t,i);e.stale=!1,await iR.settled(n.map(e=>this.doRefreshSubTree(e,t,i)))});return e.refreshPromise=n,this.subTreeRefreshPromises.set(e,n),n.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}),n}async doRefreshNode(e,t,i){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){let t=this.doGetChildren(e);if((0,re.TW)(t))n=Promise.resolve(t);else{let i=oV(800);i.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},e=>null),n=t.finally(()=>i.cancel())}}else n=Promise.resolve(hc.$.empty());try{let s=await n;return this.setChildren(e,s,t,i)}catch(t){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),(0,o_.n2)(t))return[];throw t}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;let i=this.dataSource.getChildren(e.element);return(0,re.TW)(i)?this.processChildren(i):(t=oR(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(o_.dL))}setChildren(e,t,i,n){let s=[...t];if(0===e.children.length&&0===s.length)return[];let r=new Map,o=new Map;
665for(let t of e.children)r.set(t.element,t),this.identityProvider&&o.set(t.id,{node:t,collapsed:this.tree.hasElement(t)&&this.tree.isCollapsed(t)});let a=[],l=s.map(t=>{let s=!!this.dataSource.hasChildren(t);if(!this.identityProvider){let i=BS({element:t,parent:e,hasChildren:s,defaultCollapseState:this.getDefaultCollapseState(t)});return s&&i.defaultCollapseState===nG.PreserveOrExpanded&&a.push(i),i}let l=this.identityProvider.getId(t).toString(),h=o.get(l);if(h){let e=h.node;return r.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=s,i?h.collapsed?(e.children.forEach(e=>BO(e,e=>this.nodes.delete(e.element))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):s&&!h.collapsed&&a.push(e),e}let d=BS({element:t,parent:e,id:l,hasChildren:s,defaultCollapseState:this.getDefaultCollapseState(t)});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(d),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(d),n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(d):s&&d.defaultCollapseState===nG.PreserveOrExpanded&&a.push(d),d});for(let e of r.values())BO(e,e=>this.nodes.delete(e.element));for(let e of l)this.nodes.set(e.element,e);return(0,as.db)(e.children,0,e.children.length,l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].forceExpanded=!0,a.push(l[0])),a}render(e,t,i){let n=e.children.map(e=>this.asTreeElement(e,t)),s=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.element)}};this.tree.setChildren(e===this.root?null:e,n,s),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){let i;return e.stale?{element:e,collapsible:e.hasChildren,collapsed:!0}:(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?hc.$.map(e.children,e=>this.asTreeElement(e,t)):[],collapsible:e.hasChildren,collapsed:i})}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class BF{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new BF(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class BB{constructor(e,t,i,n){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=n,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,n)}renderCompressedElements(e,t,i,n){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}renderTwistie(e,t){return e.slow?(t.classList.add(...iH.asClassNameArray(rr.treeItemLoading)),!0):(t.classList.remove(...iH.asClassNameArray(rr.treeItemLoading)),!1)}disposeElement(e,t,i,n){this.renderer.disposeElement?.(this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){this.renderer.disposeCompressedElements?.(this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=(0,ro.B9)(this.disposables)}}class BV extends BP{constructor(e,t,i,n,s,r,o={}){super(e,t,i,s,r,o),this.compressionDelegate=n,this.compressibleNodeMapper=new Fx(e=>new BF(e)),this.filter=o.filter}createTree(e,t,i,n,s){return new By(e,t,new FR(i),n.map(e=>new BB(e,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),function(e){let t=e&&BA(e);return t&&{...t,keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(e=>e.element))},stickyScrollDelegate:t.stickyScrollDelegate}}(s)||{})}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}
665render(e,t,i){if(!this.identityProvider)return super.render(e,t);let n=e=>this.identityProvider.getId(e).toString(),s=e=>{let t=new Set;for(let i of e){let e=this.tree.getCompressedTreeNode(i===this.root?null:i);if(e.element)for(let i of e.element.elements)t.add(n(i.element))}return t},r=s(this.tree.getSelection()),o=s(this.tree.getFocus());super.render(e,t,i);let a=this.getSelection(),l=!1,h=this.getFocus(),d=!1,u=e=>{let t=e.element;if(t)for(let e=0;e<t.elements.length;e++){let i=n(t.elements[e].element),s=t.elements[t.elements.length-1].element;r.has(i)&&-1===a.indexOf(s)&&(a.push(s),l=!0),o.has(i)&&-1===h.indexOf(s)&&(h.push(s),d=!0)}e.children.forEach(u)};u(this.tree.getCompressedTreeNode(e===this.root?null:e)),l&&this.setSelection(a),d&&this.setFocus(h)}processChildren(e){return this.filter&&(e=hc.$.filter(e,e=>{var t;let i="boolean"==typeof(t=this.filter.filter(e,1))?t?1:0:Fk(t)?FN(t.visibility):FN(t);if(2===i)throw Error("Recursive tree visibility not supported in async data compressed trees");return 1===i})),super.processChildren(e)}}class BW extends FX{constructor(e,t,i,n,s,r={}){super(e,t,i,n,r),this.user=e,this.dataSource=s,this.identityProvider=r.identityProvider}createModel(e,t){return new Bd(e,t)}}new hJ("isMac",sS.dz,(0,rh.NC)(1684,"Whether the operating system is macOS")),new hJ("isLinux",sS.IJ,(0,rh.NC)(1685,"Whether the operating system is Linux")),new hJ("isWindows",sS.ED,(0,rh.NC)(1686,"Whether the operating system is Windows")),new hJ("isWeb",sS.$L,(0,rh.NC)(1687,"Whether the platform is a web browser")),new hJ("isMacNative",sS.dz&&!sS.$L,(0,rh.NC)(1688,"Whether the operating system is macOS on a non-browser platform")),new hJ("isIOS",sS.gn,(0,rh.NC)(1689,"Whether the operating system is iOS")),new hJ("isMobile",sS.tq,(0,rh.NC)(1690,"Whether the platform is a mobile web browser")),new hJ("isDevelopment",!1,!0),new hJ("productQualityType","",(0,rh.NC)(1691,"Quality type of VS Code"));let BH="inputFocus",Bz=new hJ(BH,!1,(0,rh.NC)(1692,"Whether keyboard focus is inside an input box"));var BU=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},BK=function(e,t){return function(i,n){t(i,n,e)}};let B$=ht("listService");class Bj{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new ro.SL,this.lists=[],this._lastFocusedWidget=void 0}setLastFocusedList(e){e!==this._lastFocusedWidget&&(this._lastFocusedWidget?.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,this._lastFocusedWidget?.getHTMLElement().classList.add("last-focused"))}register(e,t){var i;if(this.lists.some(t=>t.widget===e))throw Error("Cannot register the same widget multiple times");let n={widget:e,extraContextKeys:t};return this.lists.push(n),i=e.getHTMLElement(),lg()===i&&this.setLastFocusedList(e),(0,ro.F8)(e.onDidFocus(()=>this.setLastFocusedList(e)),(0,ro.OF)(()=>this.lists.splice(this.lists.indexOf(n),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(e=>e!==n),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}let Bq=new hJ("listScrollAtBoundary","none");hI.or(Bq.isEqualTo("top"),Bq.isEqualTo("both")),hI.or(Bq.isEqualTo("bottom"),Bq.isEqualTo("both"));let BG=new hJ("listFocus",!0),BQ=new hJ("treestickyScrollFocused",!1),BY=new hJ("listSupportsMultiselect",!0);hI.and(BG,hI.not(BH),BQ.negate());let BJ=new hJ("listHasSelectionOrFocus",!1),BZ=new hJ("listDoubleSelection",!1),BX=new hJ("listMultiSelection",!1),B1=new hJ("listSelectionNavigation",!1),B0=new hJ("listSupportsFind",!0),B2=new hJ("treeElementCanCollapse",!1),B5=new hJ("treeElementHasParent",!1),B4=new hJ("treeElementCanExpand",!1),B6=new hJ("treeElementHasChild",!1),B7=new hJ("treeFindOpen",!1),B3="listTypeNavigationMode",B9="listAutomaticKeyboardNavigation";function B8(e,t){let i=e.createScoped(t.getHTMLElement());return BG.bindTo(i),i}function Ve(e,t){let i=Bq.bindTo(e),n=()=>{let e=0===t.scrollTop,n=t.scrollHeight-t.renderHeight-t.scrollTop<1;e&&n?i.set("both"):e?i.set("top"):n?i.set("bottom"):i.set("none")};return n(),t.onDidScroll(n)}let Vt="workbench.list.multiSelectModifier",Vi="workbench.list.openMode",Vn="workbench.list.horizontalScrolling",Vs="workbench.list.defaultFindMode",Vr="workbench.list.typeNavigationMode",Vo="workbench.list.keyboardNavigation",Va="workbench.list.scrollByPage",Vl="workbench.list.defaultFindMatchType",Vh="workbench.tree.indent",Vd="workbench.tree.renderIndentGuides",Vu="workbench.list.smoothScrolling",Vc="workbench.list.mouseWheelScrollSensitivity",Vg="workbench.list.fastScrollSensitivity",Vf="workbench.tree.expandMode",Vm="workbench.tree.enableStickyScroll",Vp="workbench.tree.stickyScrollMaxItemCount";function V_(e){return"alt"===e.getValue(Vt)}class Vv extends ro.JT{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=V_(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Vt)&&(this.useAltAsMultipleSelectionModifier=V_(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:OC(e)}isSelectionRangeChangeEvent(e){return Ow(e)}}function Vb(e,t){let i;let n=e.get(uE),s=e.get(SP),r=new ro.SL;return[{...t,keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>s.mightProducePrintableCharacter(e)},smoothScrolling:!!n.getValue(Vu),mouseWheelScrollSensitivity:n.getValue(Vc),fastScrollSensitivity:n.getValue(Vg),multipleSelectionController:t.multipleSelectionController??r.add(new Vv(n)),keyboardNavigationEventFilter:(i=!1,e=>{if(e.toKeyCodeChord().isModifierKey())return!1;if(i)return i=!1,!1;let t=s.softDispatch(e,e.target);return 1===t.kind?(i=!0,!1):(i=!1,0===t.kind)}),scrollByPage:!!n.getValue(Va)},r]}let VC=class extends OM{constructor(e,t,i,n,s,r,o,a,l){let h=void 0!==s.horizontalScrolling?s.horizontalScrolling:!!a.getValue(Vn),[d,u]=l.invokeFunction(Vb,s);super(e,t,i,n,{keyboardSupport:!1,...d,horizontalScrolling:h}),this.disposables.add(u),this.contextKeyService=B8(r,this),this.disposables.add(Ve(this.contextKeyService,this)),this.listSupportsMultiSelect=BY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport),B1.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=BJ.bindTo(this.contextKeyService),this.listDoubleSelection=BZ.bindTo(this.contextKeyService),this.listMultiSelection=BX.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=V_(a),this.disposables.add(this.contextKeyService),this.disposables.add(o.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{let e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)})})),this.disposables.add(this.onDidChangeFocus(()=>{let e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)})),this.disposables.add(a.onDidChangeConfiguration(e=>{e.affectsConfiguration(Vt)&&(this._useAltAsMultipleSelectionModifier=V_(a));let t={};if(e.affectsConfiguration(Vn)&&void 0===this.horizontalScrolling){let e=!!a.getValue(Vn);t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(Va)){let e=!!a.getValue(Va);t={...t,scrollByPage:e}}if(e.affectsConfiguration(Vu)){let e=!!a.getValue(Vu);t={...t,smoothScrolling:e}}if(e.affectsConfiguration(Vc)){let e=a.getValue(Vc);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(Vg)){let e=a.getValue(Vg);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new VL(this,{configurationService:a,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?OX(e):OZ)}};VC=BU([BK(5,hZ),BK(6,B$),BK(7,uE),BK(8,he)],VC);let Vw=class extends F5{constructor(e,t,i,n,s,r,o,a,l){let h=void 0!==s.horizontalScrolling?s.horizontalScrolling:!!a.getValue(Vn),[d,u]=l.invokeFunction(Vb,s);super(e,t,i,n,{keyboardSupport:!1,...d,horizontalScrolling:h}),this.disposables=new ro.SL,this.disposables.add(u),this.contextKeyService=B8(r,this),this.disposables.add(Ve(this.contextKeyService,this.widget)),this.horizontalScrolling=s.horizontalScrolling,this.listSupportsMultiSelect=BY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport),B1.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this._useAltAsMultipleSelectionModifier=V_(a),this.disposables.add(this.contextKeyService),this.disposables.add(o.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(a.onDidChangeConfiguration(e=>{e.affectsConfiguration(Vt)&&(this._useAltAsMultipleSelectionModifier=V_(a));let t={};if(e.affectsConfiguration(Vn)&&void 0===this.horizontalScrolling){let e=!!a.getValue(Vn);t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(Va)){let e=!!a.getValue(Va);t={...t,scrollByPage:e}}if(e.affectsConfiguration(Vu)){let e=!!a.getValue(Vu);t={...t,smoothScrolling:e}}if(e.affectsConfiguration(Vc)){let e=a.getValue(Vc);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(Vg)){let e=a.getValue(Vg);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new VL(this,{configurationService:a,...s}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?OX(e):OZ)}dispose(){this.disposables.dispose(),super.dispose()}};Vw=BU([BK(5,hZ),BK(6,B$),BK(7,uE),BK(8,he)],Vw);let Vy=class extends Bh{constructor(e,t,i,n,s,r,o,a,l,h){let d=void 0!==r.horizontalScrolling?r.horizontalScrolling:!!l.getValue(Vn),[u,c]=h.invokeFunction(Vb,r);super(e,t,i,n,s,{keyboardSupport:!1,...u,horizontalScrolling:d}),this.disposables.add(c),this.contextKeyService=B8(o,this),this.disposables.add(Ve(this.contextKeyService,this)),this.listSupportsMultiSelect=BY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==r.multipleSelectionSupport),B1.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=BJ.bindTo(this.contextKeyService),this.listDoubleSelection=BZ.bindTo(this.contextKeyService),this.listMultiSelection=BX.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=V_(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{let e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)})})),this.disposables.add(this.onDidChangeFocus(()=>{let e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)})),this.disposables.add(l.onDidChangeConfiguration(e=>{e.affectsConfiguration(Vt)&&(this._useAltAsMultipleSelectionModifier=V_(l));let t={};if(e.affectsConfiguration(Vn)&&void 0===this.horizontalScrolling){let e=!!l.getValue(Vn);t={...t,horizontalScrolling:e}}if(e.affectsConfiguration(Va)){let e=!!l.getValue(Va);t={...t,scrollByPage:e}}if(e.affectsConfiguration(Vu)){let e=!!l.getValue(Vu);t={...t,smoothScrolling:e}}if(e.affectsConfiguration(Vc)){let e=l.getValue(Vc);t={...t,mouseWheelScrollSensitivity:e}}if(e.affectsConfiguration(Vg)){let e=l.getValue(Vg);t={...t,fastScrollSensitivity:e}}Object.keys(t).length>0&&this.updateOptions(t)})),this.navigator=new Vx(this,{configurationService:l,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?OX(e):OZ)}dispose(){this.disposables.dispose(),super.dispose()}};Vy=BU([BK(6,hZ),BK(7,B$),BK(8,uE),BK(9,he)],Vy);class VS extends ro.JT{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new sd.Q5),this.onDidOpen=this._onDidOpen.event,this._register(sd.ju.filter(this.widget.onDidChangeSelection,e=>lw(e.browserEvent))(e=>this.onSelectionFromKeyboard(e))),this._register(this.widget.onPointer(e=>this.onPointer(e.element,e.browserEvent))),this._register(this.widget.onMouseDblClick(e=>this.onMouseDblClick(e.element,e.browserEvent))),"boolean"!=typeof t?.openOnSingleClick&&t?.configurationService?(this.openOnSingleClick=t?.configurationService.getValue(Vi)!=="doubleClick",this._register(t?.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Vi)&&(this.openOnSingleClick=t?.configurationService.getValue(Vi)!=="doubleClick")}))):this.openOnSingleClick=t?.openOnSingleClick??!0}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;let t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||2===t.detail)return;let i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,t)}onMouseDblClick(e,t){if(!t)return;let i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;let n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,t)}_open(e,t,i,n,s){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:s})}}class VL extends VS{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Vx extends VS{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Vk extends VS{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}let VN=class extends Bb{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,s,r,o,a,l){let{options:h,getTypeNavigationMode:d,disposable:u}=r.invokeFunction(VA,s);super(e,t,i,n,h),this.disposables.add(u),this.internals=new VO(this,s,d,s.overrideStyles,o,a,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};VN=BU([BK(5,he),BK(6,hZ),BK(7,B$),BK(8,uE)],VN);let VD=class extends By{constructor(e,t,i,n,s,r,o,a,l){let{options:h,getTypeNavigationMode:d,disposable:u}=r.invokeFunction(VA,s);super(e,t,i,n,h),this.disposables.add(u),this.internals=new VO(this,s,d,s.overrideStyles,o,a,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};VD=BU([BK(5,he),BK(6,hZ),BK(7,B$),BK(8,uE)],VD);let VE=class extends BW{constructor(e,t,i,n,s,r,o,a,l,h){let{options:d,getTypeNavigationMode:u,disposable:c}=o.invokeFunction(VA,r);super(e,t,i,n,s,d),this.disposables.add(c),this.internals=new VO(this,r,u,r.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),void 0!==e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};VE=BU([BK(6,he),BK(7,hZ),BK(8,B$),BK(9,uE)],VE);let VT=class extends BP{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,s,r,o,a,l,h){let{options:d,getTypeNavigationMode:u,disposable:c}=o.invokeFunction(VA,r);super(e,t,i,n,s,d),this.disposables.add(c),this.internals=new VO(this,r,u,r.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={
665}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};VT=BU([BK(6,he),BK(7,hZ),BK(8,B$),BK(9,uE)],VT);let VI=class extends BV{constructor(e,t,i,n,s,r,o,a,l,h,d){let{options:u,getTypeNavigationMode:c,disposable:g}=a.invokeFunction(VA,o);super(e,t,i,n,s,r,u),this.disposables.add(g),this.internals=new VO(this,o,c,o.overrideStyles,l,h,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function VM(e){let t=e.getValue(Vs);if("highlight"===t)return nJ.Highlight;if("filter"===t)return nJ.Filter;let i=e.getValue(Vo);return"simple"===i||"highlight"===i?nJ.Highlight:"filter"===i?nJ.Filter:void 0}function VR(e){let t=e.getValue(Vl);return"fuzzy"===t?nZ.Fuzzy:"contiguous"===t?nZ.Contiguous:void 0}function VA(e,t){let i=e.get(uE),n=e.get(Td),s=e.get(hZ),r=e.get(he),o=void 0!==t.horizontalScrolling?t.horizontalScrolling:!!i.getValue(Vn),[a,l]=r.invokeFunction(Vb,t),h=t.paddingBottom,d=void 0!==t.renderIndentGuides?t.renderIndentGuides:i.getValue(Vd);return{getTypeNavigationMode:()=>{let e=s.getContextKeyValue(B3);if("automatic"===e)return nB.Automatic;if("trigger"===e||!1===s.getContextKeyValue(B9))return nB.Trigger;let t=i.getValue(Vr);return"automatic"===t?nB.Automatic:"trigger"===t?nB.Trigger:void 0},disposable:l,options:{keyboardSupport:!1,...a,indent:"number"==typeof i.getValue(Vh)?i.getValue(Vh):void 0,renderIndentGuides:d,smoothScrolling:!!i.getValue(Vu),defaultFindMode:t.defaultFindMode??VM(i),defaultFindMatchType:t.defaultFindMatchType??VR(i),horizontalScrolling:o,scrollByPage:!!i.getValue(Va),paddingBottom:h,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:t.expandOnlyOnTwistieClick??"doubleClick"===i.getValue(Vf),contextViewProvider:n,findWidgetStyles:OY,enableStickyScroll:!!i.getValue(Vm),stickyScrollMaxItemCount:Number(i.getValue(Vp))}}}VI=BU([BK(7,he),BK(8,hZ),BK(9,B$),BK(10,uE)],VI);let VO=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,s,r,o){this.tree=e,this.disposables=[],this.contextKeyService=B8(s,e),this.disposables.push(Ve(this.contextKeyService,e)),this.listSupportsMultiSelect=BY.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport),B1.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=B0.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=BJ.bindTo(this.contextKeyService),this.hasDoubleSelection=BZ.bindTo(this.contextKeyService),this.hasMultiSelection=BX.bindTo(this.contextKeyService),this.treeElementCanCollapse=B2.bindTo(this.contextKeyService),this.treeElementHasParent=B5.bindTo(this.contextKeyService),this.treeElementCanExpand=B4.bindTo(this.contextKeyService),this.treeElementHasChild=B6.bindTo(this.contextKeyService),this.treeFindOpen=B7.bindTo(this.contextKeyService),this.treeStickyScrollFocused=BQ.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=V_(o),this.updateStyleOverrides(n);let a=()=>{let t=e.getFocus()[0];if(!t)return;let i=e.getNode(t);this.treeElementCanCollapse.set(i.collapsible&&!i.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(i.collapsible&&i.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))},l=new Set;l.add(B3),l.add(B9),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{let t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)})}),e.onDidChangeFocus(()=>{let t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0),a()}),e.onDidChangeCollapseState(a),e.onDidChangeModel(a),e.onDidChangeFindOpenState(e=>this.treeFindOpen.set(e)),e.onDidChangeStickyScrollFocused(e=>this.treeStickyScrollFocused.set(e)),o.onDidChangeConfiguration(n=>{let s={};if(n.affectsConfiguration(Vt)&&(this._useAltAsMultipleSelectionModifier=V_(o)),n.affectsConfiguration(Vh)){let e=o.getValue(Vh);s={...s,indent:e}}if(n.affectsConfiguration(Vd)&&void 0===t.renderIndentGuides){let e=o.getValue(Vd);s={...s,renderIndentGuides:e}}if(n.affectsConfiguration(Vu)){let e=!!o.getValue(Vu);s={...s,smoothScrolling:e}}if(n.affectsConfiguration(Vs)||n.affectsConfiguration(Vo)){let e=VM(o);s={...s,defaultFindMode:e}}if(n.affectsConfiguration(Vr)||n.affectsConfiguration(Vo)){let e=i();s={...s,typeNavigationMode:e}}if(n.affectsConfiguration(Vl)){let e=VR(o);s={...s,defaultFindMatchType:e}}if(n.affectsConfiguration(Vn)&&void 0===t.horizontalScrolling){let e=!!o.getValue(Vn);s={...s,horizontalScrolling:e}}if(n.affectsConfiguration(Va)){let e=!!o.getValue(Va);s={...s,scrollByPage:e}}if(n.affectsConfiguration(Vf)&&void 0===t.expandOnlyOnTwistieClick&&(s={...s,expandOnlyOnTwistieClick:"doubleClick"===o.getValue(Vf)}),n.affectsConfiguration(Vm)){let e=o.getValue(Vm);s={...s,enableStickyScroll:e}}if(n.affectsConfiguration(Vp)){let e=Math.max(1,o.getValue(Vp));s={...s,stickyScrollMaxItemCount:e}}if(n.affectsConfiguration(Vc)){let e=o.getValue(Vc);s={...s,mouseWheelScrollSensitivity:e}}if(n.affectsConfiguration(Vg)){let e=o.getValue(Vg);s={...s,fastScrollSensitivity:e}}Object.keys(s).length>0&&e.updateOptions(s)}),this.contextKeyService.onDidChangeContext(t=>{t.affectsSome(l)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new Vk(e,{configurationService:o,...t}),this.disposables.push(this.navigator)}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?OX(e):OZ)}dispose(){this.disposables=(0,ro.B9)(this.disposables)}};
665VO=BU([BK(4,hZ),BK(5,B$),BK(6,uE)],VO),h5.as(uU).registerConfiguration({id:"workbench",order:7,title:(0,rh.NC)(1705,"Workbench"),type:"object",properties:{[Vt]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[(0,rh.NC)(1706,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),(0,rh.NC)(1707,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:(0,rh.NC)(1708,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[Vi]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:(0,rh.NC)(1709,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Vn]:{type:"boolean",default:!1,description:(0,rh.NC)(1710,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[Va]:{type:"boolean",default:!1,description:(0,rh.NC)(1711,"Controls whether clicks in the scrollbar scroll page by page.")},[Vh]:{type:"number",default:8,minimum:4,maximum:40,description:(0,rh.NC)(1712,"Controls tree indentation in pixels.")},[Vd]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:(0,rh.NC)(1713,"Controls whether the tree should render indent guides.")},[Vu]:{type:"boolean",default:!1,description:(0,rh.NC)(1714,"Controls whether lists and trees have smooth scrolling.")},[Vc]:{type:"number",default:1,markdownDescription:(0,rh.NC)(1715,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Vg]:{type:"number",default:5,markdownDescription:(0,rh.NC)(1716,"Scrolling speed multiplier when pressing `Alt`.")},[Vs]:{type:"string",enum:["highlight","filter"],enumDescriptions:[(0,rh.NC)(1717,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),(0,rh.NC)(1718,"Filter elements when searching.")],default:"highlight",description:(0,rh.NC)(1719,"Controls the default find mode for lists and trees in the workbench.")},[Vo]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[(0,rh.NC)(1720,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),(0,rh.NC)(1721,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),(0,rh.NC)(1722,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:(0,rh.NC)(1723,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:(0,rh.NC)(1724,"Please use 'workbench.list.defaultFindMode' and	'workbench.list.typeNavigationMode' instead.")},[Vl]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[(0,rh.NC)(1725,"Use fuzzy matching when searching."),(0,rh.NC)(1726,"Use contiguous matching when searching.")],default:"fuzzy",description:(0,rh.NC)(1727,"Controls the type of matching used when searching lists and trees in the workbench.")},[Vf]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:(0,rh.NC)(1728,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Vm]:{type:"boolean",default:!0,description:(0,rh.NC)(1729,"Controls whether sticky scrolling is enabled in trees.")},[Vp]:{type:"number",minimum:1,default:7,markdownDescription:(0,rh.NC)(1730,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[Vr]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:(0,rh.NC)(1731,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var VP=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},VF=function(e,t){return function(i,n){t(i,n,e)}};class VB{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new rS(()=>{let e=i.label??"",t=TQ(e).text.trim(),n=i.ariaLabel||[e,this.saneDescription,this.saneDetail].map(e=>Tq(e)).filter(e=>!!e).join(", ");return{saneLabel:e,saneSortLabel:t,saneAriaLabel:n}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}
665get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class VV extends VB{constructor(e,t,i,n,s,r,o){super(e,i,r),this.childIndex=t,this.fireButtonTriggered=n,this._onChecked=s,this.item=r,this._separator=o,this._checked=!1,this.onChecked=i?sd.ju.map(sd.ju.filter(this._onChecked.event,e=>e.element===this),e=>e.checked):sd.ju.None,this._saneDetail=r.detail,this._labelHighlights=r.highlights?.label,this._descriptionHighlights=r.highlights?.description,this._detailHighlights=r.highlights?.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}(tD=n4||(n4={}))[tD.NONE=0]="NONE",tD[tD.MOUSE_HOVER=1]="MOUSE_HOVER",tD[tD.ACTIVE_ITEM=2]="ACTIVE_ITEM";class VW extends VB{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=[],this.focusInsideSeparator=n4.NONE}}class VH{getHeight(e){return e instanceof VW?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof VV?VK.ID:V$.ID}}class Vz{getWidgetAriaLabel(){return(0,rh.NC)(1770,"Quick Input")}getAriaLabel(e){return e.separator?.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox&&e instanceof VV)return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class VU{constructor(e){this.hoverDelegate=e}renderTemplate(e){let t=Object.create(null);t.toDisposeElement=new ro.SL,t.toDisposeTemplate=new ro.SL,t.entry=lk(e,lI(".quick-input-list-entry"));let i=lk(t.entry,lI("label.quick-input-list-label"));t.outerLabel=i,t.checkbox=t.toDisposeTemplate.add(new ro.XK),t.toDisposeTemplate.add(a7(i,ly.CLICK,e=>{if(t.checkbox.value&&!e.defaultPrevented&&t.checkbox.value.enabled){let e=!t.checkbox.value.checked;t.checkbox.value.checked=e,t.element.checked=e}}));let n=lk(i,lI(".quick-input-list-rows")),s=lk(n,lI(".quick-input-list-row")),r=lk(n,lI(".quick-input-list-row"));t.label=new FC(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=lN(t.label.element,lI(".quick-input-list-icon"));let o=lk(s,lI(".quick-input-list-entry-keybinding"));t.keybinding=new FS(o,sS.OS),t.toDisposeTemplate.add(t.keybinding);let a=lk(r,lI(".quick-input-list-label-meta"));return t.detail=new FC(a,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=lk(t.entry,lI(".quick-input-list-separator")),t.actionBar=new Pt(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}let VK=class extends VU{static{n5=this}static{this.ID="quickpickitem"}constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return n5.ID}ensureCheckbox(e,t){if(!e.hasCheckbox){t.checkbox.value?.domNode.remove(),t.checkbox.clear();return}let i=t.checkbox.value;i?i.setTitle(e.saneLabel):(i=new PP(e.saneLabel,e.checked,{...OG,size:15}),t.checkbox.value=i,t.outerLabel.prepend(i.domNode)),e.checkboxDisabled?
665i.disable():i.enable(),i.checked=e.checked,t.toDisposeElement.add(e.onChecked(e=>i.checked=e)),t.toDisposeElement.add(i.onChange(()=>e.checked=i.checked))}renderElement(e,t,i){let n;let s=e.element;i.element=s,s.element=i.entry??void 0;let r=s.item;s.element.classList.toggle("not-pickable",!1===s.item.pickable),this.ensureCheckbox(s,i);let{labelHighlights:o,descriptionHighlights:a,detailHighlights:l}=s;if(r.iconPath){let e=vL(this.themeService.getColorTheme().type)?r.iconPath.dark:r.iconPath.light??r.iconPath.dark,t=sJ.revive(e);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=AK(t)}else i.icon.style.backgroundImage="",i.icon.className=r.iconClass?`quick-input-list-icon ${r.iconClass}`:"";!s.saneTooltip&&s.saneDescription&&(n={markdown:{value:rk(s.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});let h={matches:o||[],descriptionTitle:n,descriptionMatches:a||[],labelEscapeNewLines:!0};if(h.extraClasses=r.iconClasses,h.italic=r.italic,h.strikethrough=r.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,h),i.keybinding.set(r.keybinding),s.saneDetail){let e;s.saneTooltip||(e={markdown:{value:rk(s.saneDetail),supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:l,title:e,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";s.separator?.label?(i.separator.textContent=s.separator.label,i.separator.style.display="",this.addItemWithSeparator(s)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!s.separator&&0!==s.childIndex);let d=r.buttons;d&&d.length?(i.actionBar.push(d.map((e,t)=>Pz(e,`id-${t}`,()=>s.fireButtonTriggered({button:e,item:s.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){let t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}};VK=n5=VP([VF(1,CG)],VK);class V$ extends VU{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}static{this.ID="quickpickseparator"}get templateId(){return V$.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){let n;let s=e.element;i.element=s,s.element=i.entry??void 0,s.element.classList.toggle("focus-inside",!!s.focusInsideSeparator);let r=s.separator,{labelHighlights:o,descriptionHighlights:a}=s;i.icon.style.backgroundImage="",i.icon.className="",!s.saneTooltip&&s.saneDescription&&(n={markdown:{value:rk(s.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});let l={matches:o||[],descriptionTitle:n,descriptionMatches:a||[],labelEscapeNewLines:!0};i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,l),i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");let h=r.buttons;h&&h.length?(i.actionBar.push(h.map((e,t)=>Pz(e,`id-${t}`,()=>s.fireSeparatorButtonTriggered({button:e,separator:s.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(s)}disposeElement(e,t,i){this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||e.element.element?.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){let t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}}let Vj=class extends ro.JT{constructor(e,t,i,n,s,r){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=r,this._onKeyDown=new sd.Q5,this._onLeave=new sd.Q5,this.onLeave=this._onLeave.event,this._visibleCountObservable=aU("VisibleCount",0),this.onChangedVisibleCount=sd.ju.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=aU("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=sd.ju.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=aU("CheckedCount",0),this.onChangedCheckedCount=sd.ju.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=kx({equalsFn:as.fS},[]),this.onChangedCheckedElements=sd.ju.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new sd.Q5,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new sd.Q5,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new sd.Q5,this._elementCheckedEventBufferer=new sd.E7,this._hasCheckboxes=!1,this._inputElements=[],this._elementTree=[],this._itemElements=[],this._elementDisposable=this._register(new ro.SL),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=lk(this.parent,lI(".quick-input-list")),this._separatorRenderer=new V$(t),this._itemRenderer=s.createInstance(VK,t),this._tree=this._register(s.createInstance(VN,"QuickInput",this._container,new VH,[this._itemRenderer,this._separatorRenderer],{filter:{filter:e=>e.hidden?0:e instanceof VW?2:1},sorter:{compare:(e,t)=>
665this.sortByLabel&&this._lastQueryString?function(e,t,i){let n=e.labelHighlights||[],s=t.labelHighlights||[];return n.length&&!s.length?-1:!n.length&&s.length?1:0===n.length&&0===s.length?0:function(e,t,i){let n=e.toLowerCase(),s=t.toLowerCase(),r=function(e,t,i){let n=e.toLowerCase(),s=t.toLowerCase(),r=n.startsWith(i),o=s.startsWith(i);if(r!==o)return r?-1:1;if(r&&o){if(n.length<s.length)return -1;if(n.length>s.length)return 1}return 0}(e,t,i);if(r)return r;let o=n.endsWith(i);if(o!==s.endsWith(i))return o?-1:1;let a=function(e,t,i=!1){let n=e||"",s=t||"",r=F1.value.collator.compare(n,s);return F1.value.collatorIsNumeric&&0===r&&n!==s?n<s?-1:1:r}(n,s);return 0!==a?a:n.localeCompare(s)}(e.saneSortLabel,t.saneSortLabel,i)}(e,t,this._lastQueryString.toLowerCase()):0},accessibilityProvider:new Vz,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:nY.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=n,this._registerListeners()}get onDidChangeFocus(){return sd.ju.map(this._tree.onDidChangeFocus,e=>e.elements.filter(e=>e instanceof VV).map(e=>e.item),this._store)}get onDidChangeSelection(){return sd.ju.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(e=>e instanceof VV).map(e=>e.item),event:e.browserEvent}),this._store)}get displayed(){return"none"!==this._container.style.display}set displayed(e){this._container.style.display=e?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{let t=new ok(e);10===t.keyCode&&this.toggleCheckbox(),this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(a6(this._container,ly.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(a6(this._container,ly.AUXCLICK,e=>{1===e.button&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{let e=this._itemElements.filter(e=>!e.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){let e=this._register(new oB("function"==typeof this.hoverDelegate.delay?this.hoverDelegate.delay():this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{if(lv(t.browserEvent.target)){e.cancel();return}if(!(!lv(t.browserEvent.relatedTarget)&&lh(t.browserEvent.relatedTarget,t.element?.element)))try{await e.trigger(async()=>{t.element instanceof VV&&this.showHover(t.element)})}catch(e){if(!(0,o_.n2)(e))throw e}})),this._register(this._tree.onMouseOut(t=>{lh(t.browserEvent.relatedTarget,t.element?.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{let t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(let e of this._separatorRenderer.visibleSeparators){let i=e===t;!!(e.focusInsideSeparator&n4.ACTIVE_ITEM)!==i&&(i?e.focusInsideSeparator|=n4.ACTIVE_ITEM:e.focusInsideSeparator&=~n4.ACTIVE_ITEM,this._tree.rerender(e))}})),this._register(this._tree.onMouseOver(e=>{let t=e.element?this._tree.getParentElement(e.element):null;for(let e of this._separatorRenderer.visibleSeparators)e===t&&(e.focusInsideSeparator&n4.MOUSE_HOVER||(e.focusInsideSeparator|=n4.MOUSE_HOVER,this._tree.rerender(e)))})),this._register(this._tree.onMouseOut(e=>{let t=e.element?this._tree.getParentElement(e.element):null;for(let e of this._separatorRenderer.visibleSeparators)e===t&&e.focusInsideSeparator&n4.MOUSE_HOVER&&(e.focusInsideSeparator&=~n4.MOUSE_HOVER,this._tree.rerender(e))}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{let t=e.elements.filter(e=>e instanceof VV);t.length!==e.elements.length&&(1===e.elements.length&&e.elements[0]instanceof VW&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>
665{this._itemElements.forEach(t=>{t.hidden||t.checkboxDisabled||!1===t.item.pickable||(t.checked=e)})})}setElements(e){let t;this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes"),this._itemElements=[],this._elementTree=e.reduce((i,n,s)=>{let r;if("separator"===n.type){if(!n.buttons)return i;r=t=new VW(s,e=>this._onSeparatorButtonTriggered.fire(e),n)}else{let o;let a=s>0?e[s-1]:void 0;a&&"separator"===a.type&&!a.buttons&&(o=a);let l=new VV(s,t?.children?t.children.length:s,this._hasCheckboxes&&!1!==n.pickable,e=>this._onButtonTriggered.fire(e),this._elementChecked,n,o);if(this._itemElements.push(l),t)return t.children.push(l),i;r=l}return i.push(r),i},[]),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{let e=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),t=e?.parentNode;if(e&&t){let i=e.nextSibling;e.remove(),t.insertBefore(e,i)}},0)}setFocusedElements(e){let t=e.map(e=>this._itemElements.find(t=>t.item===e)).filter(e=>!!e).filter(e=>!e.hidden);if(this._tree.setFocus(t),e.length>0){let e=this._tree.getFocus()[0];e&&this._tree.reveal(e)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){let t=e.map(e=>this._itemElements.find(t=>t.item===e)).filter(e=>!!e);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{let t=new Set;for(let i of e)t.add(i);for(let e of this._itemElements)e.checked=t.has(e.item)})}focus(e){if(this._itemElements.length)switch(e===nx.Second&&this._itemElements.length<2&&(e=nx.First),e){case nx.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,e=>e.element instanceof VV);break;case nx.Second:{this._tree.scrollTop=0;let e=!1;this._tree.focusFirst(void 0,t=>t.element instanceof VV&&(!!e||(e=!e,!1)));break}case nx.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,e=>e.element instanceof VV);break;case nx.Next:{let e=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,e=>e.element instanceof VV&&(this._tree.reveal(e.element),!0));let t=this._tree.getFocus();e.length&&e[0]===t[0]&&this._onLeave.fire();break}case nx.Previous:{let e=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,e=>{if(!(e.element instanceof VV))return!1;let t=this._tree.getParentElement(e.element);return null===t||t.children[0]!==e.element?this._tree.reveal(e.element):this._tree.reveal(t),!0});let t=this._tree.getFocus();e.length&&e[0]===t[0]&&this._onLeave.fire();break}case nx.NextPage:this._tree.focusNextPage(void 0,e=>e.element instanceof VV&&(this._tree.reveal(e.element),!0));break;case nx.PreviousPage:this._tree.focusPreviousPage(void 0,e=>{if(!(e.element instanceof VV))return!1;let t=this._tree.getParentElement(e.element);return null===t||t.children[0]!==e.element?this._tree.reveal(e.element):this._tree.reveal(t),!0});break;case nx.NextSeparator:{let e=!1,t=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,t=>{if(e)return!0;if(t.element instanceof VW)e=!0,this._separatorRenderer.isSeparatorVisible(t.element)?this._tree.reveal(t.element.children[0]):this._tree.reveal(t.element,0);else if(t.element instanceof VV){if(t.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(t.element)?this._tree.reveal(t.element):this._tree.reveal(t.element,0),!0;if(t.element===this._elementTree[0])return this._tree.reveal(t.element,0),!0}return!1}),t===this._tree.getFocus()[0]&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,e=>e.element instanceof VV));break}case nx.PreviousSeparator:{let e;let t=!!this._tree.getFocus()[0]?.separator;this._tree.focusPrevious(void 0,!0,void 0,i=>{if(i.element instanceof VW)t?e||(this._separatorRenderer.isSeparatorVisible(i.element)?this._tree.reveal(i.element):this._tree.reveal(i.element,0),e=i.element.children[0]):t=!0;else if(i.element instanceof VV&&!e){if(i.element.separator)this._itemRenderer.isItemWithSeparatorVisible(i.element)?this._tree.reveal(i.element):this._tree.reveal(i.element,0),e=i.element;else if(i.element===this._elementTree[0])return this._tree.reveal(i.element,0),!0}return!1}),e&&this._tree.setFocus([e])}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${44*Math.floor(e/44)+6}
665px`:"",this._tree.layout()}filter(e){if(this._lastQueryString=e,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;let t=e;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let i;this._itemElements.forEach(n=>{let s;s="fuzzy"===this.matchOnLabelMode?this.matchOnLabel?TY(e,TQ(n.saneLabel))??void 0:void 0:this.matchOnLabel?function(e,t){let{text:i,iconOffsets:n}=t;if(!n||0===n.length)return Vq(e,i);let s=rD(i," "),r=i.length-s.length,o=Vq(e,s);if(o)for(let e of o){let t=n[e.start+r]+r;e.start+=t,e.end+=t}return o}(t,TQ(n.saneLabel))??void 0:void 0;let r=this.matchOnDescription?TY(e,TQ(n.saneDescription||""))??void 0:void 0,o=this.matchOnDetail?TY(e,TQ(n.saneDetail||""))??void 0:void 0;if(s||r||o?(n.labelHighlights=s,n.descriptionHighlights=r,n.detailHighlights=o,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item||!n.item.alwaysShow),n.item?n.separator=void 0:n.separator&&(n.hidden=!0),!this.sortByLabel){let e=n.index&&this._inputElements[n.index-1]||void 0;e?.type!=="separator"||e.buttons||(i=e),i&&!n.hidden&&(n.separator=i,i=void 0)}})}else this._itemElements.forEach(e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;let t=e.index&&this._inputElements[e.index-1];e.item&&(e.separator=t&&"separator"===t.type&&!t.buttons?t:void 0)});return this._setElementsToTree(this._sortByLabel&&e?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{let e=this._tree.getFocus().filter(e=>e instanceof VV),t=this._allVisibleChecked(e);for(let i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){let e=this._tree.getFocus()[0];if(!e?.saneTooltip||!(e instanceof VV))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);let t=new ro.SL;t.add(this._tree.onDidChangeFocus(e=>{e.elements[0]instanceof VV&&this.showHover(e.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){let t=[];for(let i of e)i instanceof VW?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(e=>({element:e,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i<n;i++){let n=e[i];if(!n.hidden&&!1!==n.item.pickable){if(!n.checked)return!1;t=!0}}return t}_updateCheckedObservables(){aM(e=>{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),e);let t=this._itemElements.filter(e=>e.checked).length;this._checkedCountObservable.set(t,e),this._checkedElementsObservable.set(this.getCheckedElements(),e)})}showHover(e){this._lastHover&&!this._lastHover.isDisposed&&(this.hoverDelegate.onDidHideHover?.(),this._lastHover?.dispose()),e.element&&e.saneTooltip&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:e=>{this.linkOpenerDelegate(e)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};function Vq(e,t){let i=t.toLowerCase().indexOf(e.toLowerCase());return -1!==i?[{start:i,end:i+e.length}]:null}
665function VG(e,t={}){h6.registerCommandAndKeybindingRule({weight:200,when:hI.and(hI.or(hI.equals(PG,"quickPick"),hI.equals(PG,"quickTree")),Pj),metadata:{description:(0,rh.NC)(1759,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...e,secondary:VY(e.primary,e.secondary??[],t)})}VP([vq],Vj.prototype,"onDidChangeFocus",null),VP([vq],Vj.prototype,"onDidChangeSelection",null),Vj=VP([VF(4,he),VF(5,mg)],Vj);let VQ=sS.dz?256:2048;function VY(e,t,i={}){return i.withAltMod&&t.push(512+e),i.withCtrlMod&&(t.push(VQ+e),i.withAltMod&&t.push(512+VQ+e)),i.withCmdMod&&sS.dz&&(t.push(2048+e),i.withCtrlMod&&t.push(2304+e),i.withAltMod&&(t.push(2560+e),i.withCtrlMod&&t.push(2816+e))),t}function VJ(e,t){return i=>{let n=i.get(RA).currentQuickInput;return n?t&&n.quickNavigate?n.focus(t):n.focus(e):void 0}}VG({id:"quickInput.pageNext",primary:12,handler:VJ(nx.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),VG({id:"quickInput.pagePrevious",primary:11,handler:VJ(nx.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),VG({id:"quickInput.first",primary:VQ+14,handler:VJ(nx.First)},{withAltMod:!0,withCmdMod:!0}),VG({id:"quickInput.last",primary:VQ+13,handler:VJ(nx.Last)},{withAltMod:!0,withCmdMod:!0}),VG({id:"quickInput.next",primary:18,handler:VJ(nx.Next)},{withCtrlMod:!0}),VG({id:"quickInput.previous",primary:16,handler:VJ(nx.Previous)},{withCtrlMod:!0});let VZ=(0,rh.NC)(1760,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),VX=(0,rh.NC)(1761,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");sS.dz?(VG({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2066,handler:VJ(nx.NextSeparator,nx.Next),metadata:{description:VZ}}),VG({id:"quickInput.nextSeparator",primary:2578,secondary:[2322],handler:VJ(nx.NextSeparator)},{withCtrlMod:!0}),VG({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2064,handler:VJ(nx.PreviousSeparator,nx.Previous),metadata:{description:VX}}),VG({id:"quickInput.previousSeparator",primary:2576,secondary:[2320],handler:VJ(nx.PreviousSeparator)},{withCtrlMod:!0})):(VG({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:530,handler:VJ(nx.NextSeparator,nx.Next),metadata:{description:VZ}}),VG({id:"quickInput.nextSeparator",primary:2578,handler:VJ(nx.NextSeparator)}),VG({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:528,handler:VJ(nx.PreviousSeparator,nx.Previous),metadata:{description:VX}}),VG({id:"quickInput.previousSeparator",primary:2576,handler:VJ(nx.PreviousSeparator)})),h6.registerCommandAndKeybindingRule({id:"quickInput.accept",primary:3,weight:200,when:hI.and(hI.notEquals(PG,"quickWidget"),Pj,hI.not("isComposing")),metadata:{description:(0,rh.NC)(1762,"Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},handler:e=>{let t=e.get(RA).currentQuickInput;t?.accept()},secondary:VY(3,[],{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0})}),VG({id:"quickInput.acceptInBackground",when:hI.and(Pj,hI.equals(PG,"quickPick"),hI.or(Bz.negate(),PZ)),primary:17,weight:250,handler:e=>{let t=e.get(RA).currentQuickInput;t?.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),function(e,t={}){h6.registerCommandAndKeybindingRule({weight:200,when:Pj,metadata:{description:(0,rh.NC)(1758,"Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...e,secondary:VY(e.primary,e.secondary??[],t)})}({id:"quickInput.hide",primary:9,handler:e=>{let t=e.get(RA).currentQuickInput;t?.hide()}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0}),VG({id:"quickInput.toggleHover",primary:10|VQ,handler:e=>{e.get(RA).toggleHover()}});let V1=class extends ro.JT{static{n6=this}static{this.ID="quickInputTreeElement"}constructor(e,t,i,n){super(),this._hoverDelegate=e,this._buttonTriggeredEmitter=t,this.onCheckedEvent=i,this._themeService=n,this.templateId=n6.ID}renderTemplate(e){let t=new ro.SL,i=lk(e,lI(".quick-input-tree-entry")),n=t.add(new PF("",!1,{...OG,size:15}));i.appendChild(n.domNode);let s=lk(i,lI("label.quick-input-tree-label")),r=lk(s,lI(".quick-input-tree-rows")),o=lk(r,lI(".quick-input-tree-row")),a=lN(o,lI(".quick-input-tree-icon")),l=t.add(new FC(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this._hoverDelegate})),h=t.add(new Pt(i,this._hoverDelegate?{hoverDelegate:this._hoverDelegate}:void 0));return h.domNode.classList.add("quick-input-tree-entry-action-bar"),{toDisposeTemplate:t,entry:i,checkbox:n,icon:a,label:l,actionBar:h,toDisposeElement:new ro.SL}}renderElement(e,t,i,n){let s;let r=i.toDisposeElement,o=e.element;
665if(!1===o.pickable?i.checkbox.domNode.style.display="none":(i.checkbox.domNode.style.display="",i.checkbox.checked=o.checked??!1,r.add(sd.ju.filter(this.onCheckedEvent,e=>e.item===o)(e=>i.checkbox.checked=e.checked)),o.disabled&&i.checkbox.disable()),o.iconPath){let e=vL(this._themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,t=sJ.revive(e);i.icon.className="quick-input-tree-icon",i.icon.style.backgroundImage=AK(t)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-tree-icon ${o.iconClass}`:"";let{labelHighlights:a,descriptionHighlights:l}=e.filterData||{};o.description&&(s={markdown:{value:rk(o.description),supportThemeIcons:!0},markdownNotSupportedFallback:o.description}),i.label.setLabel(o.label,o.description,{matches:a,descriptionMatches:l,extraClasses:o.iconClasses,italic:o.italic,strikethrough:o.strikethrough,labelEscapeNewLines:!0,descriptionTitle:s});let h=o.buttons;h&&h.length?(i.actionBar.push(h.map((e,t)=>Pz(e,`tree-${t}`,()=>this._buttonTriggeredEmitter.fire({item:o,button:e}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i,n){i.toDisposeElement.clear(),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}};V1=n6=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){CG(e,t,3)}],V1);class V0{getHeight(e){return 22}getTemplateId(e){return V1.ID}}class V2{constructor(e){this.onCheckedEvent=e}getWidgetAriaLabel(){return(0,rh.NC)(1772,"Quick Tree")}getAriaLabel(e){return e.ariaLabel||[e.label,e.description].map(e=>Tq(e)).filter(e=>!!e).join(", ")}getWidgetRole(){return"tree"}getRole(e){return"checkbox"}isChecked(e){return{get value(){return"mixed"===e.checked?"mixed":!!e.checked},onDidChange:t=>sd.ju.filter(this.onCheckedEvent,t=>t.item===e)(e=>t())}}}class V5{constructor(){this.filterValue="",this.matchOnLabel=!0,this.matchOnDescription=!1}filter(e,t){if(!this.filterValue||!(this.matchOnLabel||this.matchOnDescription))return e.children?{visibility:2,data:{}}:{visibility:1,data:{}};let i=this.matchOnLabel?TY(this.filterValue,TQ(e.label))??void 0:void 0,n=this.matchOnDescription?TY(this.filterValue,TQ(e.description||""))??void 0:void 0;return{visibility:1===t?1:i||n?1:e.children?2:0,data:{labelHighlights:i,descriptionHighlights:n}}}}class V4 extends ro.JT{constructor(){super(...arguments),this._sortByLabel=!0}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}compare(e,t){if(!this._sortByLabel)return 0;if(e.label<t.label)return -1;if(e.label>t.label)return 1;if(e.description&&t.description){if(e.description<t.description)return -1;if(e.description>t.description)return 1}else if(e.description)return -1;else if(t.description)return 1;return 0}}let V6=class extends ro.JT{constructor(e,t,i){super(),this.instantiationService=i,this._onDidTriggerButton=this._register(new sd.Q5),this._onDidChangeCheckboxState=this._register(new sd.Q5),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidCheckedLeafItemsChange=this._register(new sd.Q5),this._onLeave=new sd.Q5,this.onLeave=this._onLeave.event,this._onDidAccept=this._register(new sd.Q5),this.onDidAccept=this._onDidAccept.event,this._container=lk(e,lI(".quick-input-tree")),this._renderer=this._register(this.instantiationService.createInstance(V1,t,this._onDidTriggerButton,this.onDidChangeCheckboxState)),this._filter=this.instantiationService.createInstance(V5),this._sorter=this._register(new V4),this._tree=this._register(this.instantiationService.createInstance(VN,"QuickInputTree",this._container,new V0,[this._renderer],{accessibilityProvider:new V2(this.onDidChangeCheckboxState),horizontalScrolling:!1,multipleSelectionSupport:!1,findWidgetEnabled:!1,alwaysConsumeMouseWheel:!0,hideTwistiesOfChildlessElements:!0,renderIndentGuides:nY.None,expandOnDoubleClick:!0,expandOnlyOnTwistieClick:!0,disableExpandOnSpacebar:!0,sorter:this._sorter,filter:this._filter})),this.registerOnOpenListener()}get tree(){return this._tree}get displayed(){return"none"!==this._container.style.display}set displayed(e){this._container.style.display=e?"":"none"}get sortByLabel(){return this._sorter.sortByLabel}set sortByLabel(e){this._sorter.sortByLabel=e,this._tree.resort(null,!0)}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}updateFilterOptions(e){void 0!==e.matchOnLabel&&(this._filter.matchOnLabel=e.matchOnLabel),void 0!==e.matchOnDescription&&(this._filter.matchOnDescription=e.matchOnDescription),this._tree.refilter()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${44*Math.floor(e/44)+6}
665px`:"",this._tree.layout()}registerOnOpenListener(){this._register(this._tree.onDidOpen(e=>{let t=e.element;if(!t||t.disabled)return;if(!1===t.pickable){this._tree.setFocus([t]),this._onDidAccept.fire();return}let i=!0!==t.checked;if((t.checked??!1)===i)return;t.checked=i,this._tree.rerender(t);let n=new Set,s=[...this._tree.getNode(t).children];for(;s.length;){let e=s.shift();e?.element&&!n.has(e.element)&&(n.add(e.element),(e.element.checked??!1)!==t.checked&&(e.element.checked=t.checked,this._tree.rerender(e.element)),s.push(...e.children))}let r=this._tree.getParentElement(t);for(;r;){let e=function(e){let t=!1,i=!1,n=!1;for(let s of e){switch(s.element?.checked){case"mixed":n=!0;break;case!0:t=!0;break;default:i=!0}if(t&&i&&n)break}return i?n?"mixed":!!t&&"mixed":n?"mixed":t}([...this._tree.getNode(r).children]);(r.checked??!1)!==e&&(r.checked=e,this._tree.rerender(r)),r=this._tree.getParentElement(r)}this._onDidChangeCheckboxState.fire({item:t,checked:t.checked??!1}),this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems())}))}getCheckedLeafItems(){let e=new Set,t=[...this._tree.getNode().children],i=[];for(;t.length;){let n=t.shift();!(!n?.element||e.has(n.element))&&n.element.checked&&(e.add(n.element),t.push(...n.children),n.element.children||i.push(n.element))}return i}};V6=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){he(e,t,2)}],V6);var V7=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},V3=function(e,t){return function(i,n){t(i,n,e)}};let V9="workbench.quickInput.viewState",V8=class extends ro.JT{static{n7=this}static{this.MAX_WIDTH=600}get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,n,s){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.storageService=s,this.enabled=!0,this.onDidAcceptEmitter=this._register(new sd.Q5),this.onDidCustomEmitter=this._register(new sd.Q5),this.onDidTriggerButtonEmitter=this._register(new sd.Q5),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new sd.Q5),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new sd.Q5),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=P$.bindTo(n),this.quickInputTypeContext=PQ.bindTo(n),this.endOfQuickInputBoxContext=PJ.bindTo(n),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(sd.ju.runAndSubscribe(a1,({window:e,disposables:t})=>this.registerKeyModsListeners(e,t),{window:rb,disposables:this._store})),this._register(a0(e=>{this.ui&&aG(this.ui.container)===e&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))}
665)),this.viewState=this.loadViewState()}registerKeyModsListeners(e,t){let i=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};for(let n of[ly.KEY_DOWN,ly.KEY_UP,ly.MOUSE_DOWN])t.add(a6(e,n,i,!0))}getUI(e){if(this.ui)return e&&aG(this._container)!==aG(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;let t=lk(this._container,lI(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";let i=mS(t),n=lk(t,lI(".quick-input-titlebar")),s=this._register(new Pt(n,{hoverDelegate:this.options.hoverDelegate}));s.domNode.classList.add("quick-input-left-action-bar");let r=lk(n,lI(".quick-input-title")),o=this._register(new Pt(n,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-right-action-bar");let a=lk(t,lI(".quick-input-header")),l=this._register(new PF((0,rh.NC)(1763,"Toggle all checkboxes"),!1,{...OG,size:15}));lk(a,l.domNode),this._register(l.onChange(()=>{let e=l.checked;N.setAllVisibleChecked(!0===e)})),this._register(a6(l.domNode,ly.CLICK,e=>{(e.x||e.y)&&c.setFocus()}));let h=lk(a,lI(".quick-input-description")),d=lk(a,lI(".quick-input-and-message")),u=lk(d,lI(".quick-input-filter")),c=this._register(new F_(u,this.styles.inputBox,this.styles.toggle));c.setAttribute("aria-describedby",`${this.idPrefix}message`);let g=lk(u,lI(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");let f=this._register(new P7(g,{countFormat:(0,rh.NC)(1764,"{0} Results")},this.styles.countBadge)),m=lk(u,lI(".quick-input-count"));m.setAttribute("aria-live","polite");let p=this._register(new P7(m,{countFormat:(0,rh.NC)(1765,"{0} Selected")},this.styles.countBadge)),_=this._register(new Pt(a,{hoverDelegate:this.options.hoverDelegate}));_.domNode.classList.add("quick-input-inline-action-bar");let v=lk(a,lI(".quick-input-action")),b=this._register(new P6(v,this.styles.button));b.label=(0,rh.NC)(1766,"OK"),this._register(b.onDidClick(e=>{this.onDidAcceptEmitter.fire()}));let C=lk(a,lI(".quick-input-action")),w=this._register(new P6(C,{...this.styles.button,supportIcons:!0}));w.label=(0,rh.NC)(1767,"Custom"),this._register(w.onDidClick(e=>{this.onDidCustomEmitter.fire()}));let y=lk(d,lI(`#${this.idPrefix}message.quick-input-message`)),S=this._register(new Fi(t,this.styles.progressBar));S.getContainer().classList.add("quick-input-progress");let L=lk(t,lI(".quick-input-html-widget"));L.tabIndex=-1;let x=lk(t,lI(".quick-input-description")),k=this.idPrefix+"list",N=this._register(this.instantiationService.createInstance(Vj,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,k));c.setAttribute("aria-controls",k),this._register(N.onDidChangeFocus(()=>{c.hasFocus()&&c.setAttribute("aria-activedescendant",N.getActiveDescendant()??"")})),this._register(N.onChangedAllVisibleChecked(e=>{l.checked=e})),this._register(N.onChangedVisibleCount(e=>{f.setCount(e)})),this._register(N.onChangedCheckedCount(e=>{(0,sS.fn)(()=>p.setCount(e))})),this._register(N.onLeave(()=>{setTimeout(()=>{this.controller&&(c.setFocus(),this.controller instanceof P0&&this.controller.canSelectMany&&N.clearFocus())},0)}));let D=this._register(this.instantiationService.createInstance(V6,t,this.options.hoverDelegate));this._register(D.tree.onDidChangeFocus(()=>{c.hasFocus()&&c.setAttribute("aria-activedescendant",D.getActiveDescendant()??"")})),this._register(D.onLeave(()=>{setTimeout(()=>{this.controller&&(c.setFocus(),D.tree.setFocus([]))},0)})),this._register(D.onDidAccept(()=>{this.onDidAcceptEmitter.fire()})),this._register(D.tree.onDidChangeContentHeight(()=>this.updateLayout()));let E=lx(t);return this._register(E),this._register(a6(t,ly.FOCUS,e=>{let t=this.getUI();if(lh(e.relatedTarget,t.inputContainer)){let e=t.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==e&&this.endOfQuickInputBoxContext.set(e)}lh(e.relatedTarget,t.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=l_(e.relatedTarget)?e.relatedTarget:void 0)},!0)),this._register(E.onDidBlur(()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(nS.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(c.onKeyDown(e=>{let t=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==t&&this.endOfQuickInputBoxContext.set(t),c.removeAttribute("aria-activedescendant")})),this._register(a6(t,ly.FOCUS,e=>{c.setFocus()})),this.dndController=this._register(this.instantiationService.createInstance(We,this._container,t,[{node:n,includeChildren:!0},{node:a,includeChildren:!1}],this.viewState)),this._register(aN(e=>{let t=this.dndController?.dndViewState.read(e);t&&(void 0!==t.top&&void 0!==t.left?this.viewState={...this.viewState,top:t.top,left
665:t.left}:this.viewState=void 0,this.updateLayout(),t.done&&this.saveViewState(this.viewState))})),this.ui={container:t,styleSheet:i,leftActionBar:s,titleBar:n,title:r,description1:x,description2:h,widget:L,rightActionBar:o,inlineActionBar:_,checkAll:l,inputContainer:d,filterContainer:u,inputBox:c,visibleCountContainer:g,visibleCount:f,countContainer:m,count:p,okContainer:v,ok:b,message:y,customButtonContainer:C,customButton:w,list:N,tree:D,progressBar:S,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e),linkOpenerDelegate:e=>this.options.linkOpenerDelegate(e)},this.updateStyles(),this.ui}reparentUI(e){this.ui&&(this._container=e,lk(this._container,this.ui.container),this.dndController?.reparentUI(this._container))}pick(e,t={},i=tI.None){return new Promise((n,s)=>{let r,o=e=>{o=n,t.onKeyMods?.(a.keyMods),n(e)};if(i.isCancellationRequested){o(void 0);return}let a=this.createQuickPick({useSeparators:!0}),l=[a,a.onDidAccept(()=>{if(a.canSelectMany)o(a.selectedItems.slice()),a.hide();else{let e=a.activeItems[0];e&&(o(e),a.hide())}}),a.onDidChangeActive(e=>{let i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)}),a.onDidChangeSelection(e=>{if(!a.canSelectMany){let t=e[0];t&&(o(t),a.hide())}}),a.onDidTriggerItemButton(e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...e,removeItem:()=>{let t=a.items.indexOf(e.item);if(-1!==t){let e=a.items.slice(),i=e.splice(t,1),n=a.activeItems.filter(e=>e!==i[0]),s=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=e,n&&(a.activeItems=n),a.keepScrollPosition=s}}})),a.onDidTriggerSeparatorButton(e=>t.onDidTriggerSeparatorButton?.(e)),a.onDidChangeValue(e=>{r&&!e&&(1!==a.activeItems.length||a.activeItems[0]!==r)&&(a.activeItems=[r])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{(0,ro.B9)(l),o(void 0)})];a.title=t.title,t.value&&(a.value=t.value),a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.prompt=t.prompt,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,void 0!==t.sortByLabel&&(a.sortByLabel=t.sortByLabel),a.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([e,t])=>{r=t,a.busy=!1,a.items=e,a.canSelectMany&&(a.selectedItems=e.filter(e=>"separator"!==e.type&&e.picked)),r&&(a.activeItems=[r])}),a.show(),Promise.resolve(e).then(void 0,e=>{s(e),a.hide()})})}setValidationOnInput(e,t){t&&(0,re.HD)(t)?(e.severity=Sh.Error,e.validationMessage=t):t&&!(0,re.HD)(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=Sh.Ignore,e.validationMessage=void 0)}input(e={},t=tI.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}let n=this.createInputBox(),s=e.validateInput||(()=>Promise.resolve(void 0)),r=sd.ju.debounce(n.onDidChangeValue,(e,t)=>t,100),o=e.value||"",a=Promise.resolve(s(o)),l=[n,r(e=>{e!==o&&(a=Promise.resolve(s(e)),o=e),a.then(t=>{e===o&&this.setValidationOnInput(n,t)})}),n.onDidAccept(()=>{let e=n.value;e!==o&&(a=Promise.resolve(s(e)),o=e),a.then(t=>{t&&((0,re.HD)(t)||t.severity===Sh.Error)?e===o&&this.setValidationOnInput(n,t):(i(e),n.hide())})}),t.onCancellationRequested(()=>{n.hide()}),n.onDidHide(()=>{(0,ro.B9)(l),i(void 0)})];n.title=e.title,n.value=e.value||"",n.valueSelection=e.valueSelection,n.prompt=e.prompt,n.placeholder=e.placeHolder,n.password=!!e.password,n.ignoreFocusOut=!!e.ignoreFocusLost,n.show()})}createQuickPick(e={useSeparators:!1}){return new P0(this.getUI(!0))}createInputBox(){return new P2(this.getUI(!0))}show(e){let t=this.getUI(!0);this.onShowEmitter.fire();let i=this.controller;this.controller=e,i?.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",lD(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Sh.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),lD(t.message),t.progressBar.stop(),t.progressBar.getContainer().setAttribute("aria-hidden","true"),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.tree.updateFilterOptions({matchOnDescription:!1,matchOnLabel:!0}),t.tree.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;let n=this.options.backKeybindingLabel();PX.tooltip=n?(0,rh.NC)(1768,"Back ({0})",n):(0,rh.NC)(1769,"Back"),t.container.style.display="",this.updateLayout(),this.dndController?.layoutContainer(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&"none"!==this.ui.container.style.display}setVisibilities(e){let t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.domNode.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.displayed=!!e.list,t.tree.displayed=!!e.tree,t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;let t=this.getUI();for(let i of t.leftActionBar.viewItems)i.action.enabled=e;for(let i of t.rightActionBar.viewItems)i.action.enabled=e;e?t.checkAll.enable():t.checkAll.disable(),t.inputBox.enabled=e,t.ok.enabled=e,t.list.enabled=e}}hide(e){let t=this.controller;if(!t)return;t.willHide(e);let i=this.ui?.container,n=i&&!lh(lg(),i);
665if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!n){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=e.parentElement??void 0;e?.offsetParent?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}toggleHover(){this.isVisible()&&this.controller instanceof P0&&this.getUI().list.toggleHover()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isVisible()){let e=this.ui.container.style,t=Math.min(.62*this.dimension.width,n7.MAX_WIDTH);e.width=t+"px",e.top=`${this.viewState?.top?Math.round(this.dimension.height*this.viewState.top):this.titleBarOffset}px`,e.left=`${Math.round(this.dimension.width*(this.viewState?.left??.5)-t/2)}px`,this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height),this.ui.tree.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){let{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:s}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=s?`0 0 8px 2px ${s}`:"",this.ui.list.style(this.styles.list),this.ui.tree.tree.style(this.styles.list);let r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color:  ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color:  ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));let o=r.join("\n");o!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=o)}}loadViewState(){try{let e=JSON.parse(this.storageService.get(V9,-1,"{}"));if(void 0!==e.top||void 0!==e.left)return e}catch{}}saveViewState(e){this.layoutService.activeContainer===this.layoutService.mainContainer&&(void 0!==e?this.storageService.store(V9,JSON.stringify(e),-1,1):this.storageService.remove(V9,-1))}};V8=n7=V7([V3(1,Eu),V3(2,he),V3(3,hZ),V3(4,RB)],V8);let We=class extends ro.JT{constructor(e,t,i,n,s,r,o){super(),this._container=e,this._quickInputContainer=t,this._quickInputDragAreas=i,this._layoutService=s,this.configurationService=o,this.dndViewState=aU(this,void 0),this._snapThreshold=20,this._snapLineHorizontalRatio=.25,this._quickInputAlignmentContext=Pq.bindTo(r);let a="custom"===function(e){if(sS.$L||sS.dz||"native"===O2(e))return"native";let t=e.getValue("window"),i=t?.controlsStyle;return"custom"===i||"hidden"===i?i:"native"}(this.configurationService);this._controlsOnLeft=a&&1===sS.Jv,this._controlsOnRight=a&&(3===sS.Jv||2===sS.Jv),this._registerLayoutListener(),this.registerMouseListeners(),this.dndViewState.set({...n,done:!0},void 0)}reparentUI(e){this._container=e}layoutContainer(e=this._layoutService.activeContainerDimension){let t=this.dndViewState.get(),i=this._quickInputContainer.getBoundingClientRect();
665if(t?.top&&t?.left){let n=Math.round(100*t.left)/100,s=e.width,r=i.width;this._layout(t.top*e.height,n*s-r/2)}}_registerLayoutListener(){this._register(sd.ju.filter(this._layoutService.onDidLayoutContainer,e=>e.container===this._container)(e=>this.layoutContainer(e.dimension)))}registerMouseListeners(){var e;let t=this._quickInputContainer;this._register(a3(t,e=>{let i=new oE(aG(t),e);2===i.detail&&this._quickInputDragAreas.some(({node:e,includeChildren:t})=>t?lh(i.target,e):i.target===e)&&this.dndViewState.set({top:void 0,left:void 0,done:!0},void 0)})),this._register((e=e=>{var t;let i=aG(this._layoutService.activeContainer),n=new oE(i,e);if(!this._quickInputDragAreas.some(({node:e,includeChildren:t})=>t?lh(n.target,e):n.target===e))return;let s=this._quickInputContainer.getBoundingClientRect(),r=n.browserEvent.clientX-s.left,o=n.browserEvent.clientY-s.top,a=!1,l=(t=e=>{new oE(i,e).preventDefault(),a||(a=!0),this._layout(e.clientY-o,e.clientX-r)},a6(i,sS.gn&&op.pointerEvents?ly.POINTER_MOVE:ly.MOUSE_MOVE,t,void 0)),h=a3(i,e=>{if(a){let e=this.dndViewState.get();this.dndViewState.set({top:e?.top,left:e?.left,done:!0},void 0)}l.dispose(),h.dispose()})},a6(t,sS.gn&&op.pointerEvents?ly.POINTER_DOWN:ly.MOUSE_DOWN,e,void 0)))}_layout(e,t){let i=this._getTopSnapValue(),n=this._getCenterYSnapValue(),s=this._getCenterXSnapValue();(e=Math.max(0,Math.min(e,this._container.clientHeight-this._quickInputContainer.clientHeight)))<this._layoutService.activeContainerOffset.top&&(this._controlsOnLeft?t=Math.max(t,80/oo(lm())):this._controlsOnRight&&(t=Math.min(t,this._container.clientWidth-this._quickInputContainer.clientWidth-140/oo(lm()))));let r=Math.abs(e-i)<this._snapThreshold,o=Math.abs((e=r?i:e)-n)<this._snapThreshold,a=(e=o?n:e)/this._container.clientHeight,l=Math.abs((t=Math.max(0,Math.min(t,this._container.clientWidth-this._quickInputContainer.clientWidth)))-s)<this._snapThreshold;t=l?s:t;let h=this._container.clientWidth,d=this._quickInputContainer.clientWidth,u=t;if(this.dndViewState.set({top:a,left:(u+d/2)/h,done:!1},void 0),l){if(r){this._quickInputAlignmentContext.set("top");return}if(o){this._quickInputAlignmentContext.set("center");return}}this._quickInputAlignmentContext.set(void 0)}_getTopSnapValue(){return this._layoutService.activeContainerOffset.quickPickTop}_getCenterYSnapValue(){return Math.round(this._container.clientHeight*this._snapLineHorizontalRatio)}_getCenterXSnapValue(){return Math.round(this._container.clientWidth/2)-Math.round(this._quickInputContainer.clientWidth/2)}};We=V7([V3(4,Eu),V3(5,hZ),V3(6,uE)],We);var Wt=function(e,t){return function(i,n){t(i,n,e)}};let Wi=class extends C1{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(PM))),this._quickAccess}constructor(e,t,i,n,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this.configurationService=s,this._onShow=this._register(new sd.Q5),this._onHide=this._register(new sd.Q5),this.contexts=new Map}createController(e=this.layoutService,t){let i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>void 0,setContextKey:e=>this.setContextKey(e),linkOpenerDelegate:e=>{this.instantiationService.invokeFunction(t=>{t.get(Ru).open(e,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(P5))},n=this._register(this.instantiationService.createInstance(V8,{...i,...t}));return n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(t=>{aG(e.activeContainer)===aG(n.container)&&n.layout(t,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{n.isVisible()||n.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;!e||(t=this.contexts.get(e))||(t=new hJ(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t)),t&&t.get()||(this.resetContextKeys(),t?.set(!0))}
665resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t,i=tI.None){return this.controller.pick(e,t,i)}input(e={},t=tI.None){return this.controller.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}toggleHover(){this.hasController&&this.controller.toggleHover()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:mD(_0),quickInputForeground:mD(_2),quickInputTitleBackground:mD(_5),widgetBorder:mD(pC),widgetShadow:mD(pb)},inputBox:OQ,toggle:Oq,countBadge:OJ,button:O$,progressBar:Oj,keybindingLabel:OK,list:OX({listBackground:_0,listFocusBackground:_8,listFocusForeground:_3,listInactiveFocusForeground:_3,listInactiveSelectionIconForeground:_9,listInactiveFocusBackground:_8,listFocusOutline:m$,listInactiveFocusOutline:m$,treeStickyScrollBackground:_0}),pickerGroup:{pickerGroupBorder:mD(_6),pickerGroupForeground:mD(_4)}}}};Wi=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Wt(0,he),Wt(1,hZ),Wt(2,CG),Wt(3,Eu),Wt(4,uE)],Wi);var Wn=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Ws=function(e,t){return function(i,n){t(i,n,e)}};let Wr=class extends Wi{constructor(e,t,i,n,s,r){super(t,i,n,new Em(e.getContainerDomNode(),s),r),this.host=void 0;let o=Wa.get(e);if(o){let t=o.widget;this.host={_serviceBrand:void 0,get mainContainer(){return t.getDomNode()},getContainer:()=>t.getDomNode(),whenContainerStylesLoaded(){},get containers(){return[t.getDomNode()]},get activeContainer(){return t.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return sd.ju.map(e.onDidLayoutChange,e=>({container:t.getDomNode(),dimension:e}))},get onDidChangeActiveContainer(){return sd.ju.None},get onDidAddContainer(){return sd.ju.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};Wr=Wn([Ws(1,he),Ws(2,hZ),Ws(3,CG),Ws(4,hi),Ws(5,uE)],Wr);let Wo=class{get activeService(){let e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){let i=t=this.instantiationService.createInstance(Wr,e);this.mapEditorToService.set(e,t),(0,ym.M)(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t,i=tI.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.activeService.createQuickPick(e)}createInputBox(){return this.activeService.createInputBox()}toggleHover(){return this.activeService.toggleHover()}};Wo=Wn([Ws(0,he),Ws(1,hi)],Wo);class Wa{static{this.ID="editor.controller.quickInput"}static get(e){return e.getContribution(Wa.ID)}constructor(e){this.editor=e,this.widget=new Wl(this.editor)}
665dispose(){this.widget.dispose()}}class Wl{static{this.ID="editor.contrib.quickInputWidget"}constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Wl.ID}getDomNode(){return this.domNode}getPosition(){return{preference:{top:0,left:0}}}dispose(){this.codeEditor.removeOverlayWidget(this)}}dq(Wa.ID,Wa,4);class Wh{constructor(e,t,i,n,s){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=s}}let Wd=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class Wu{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;let t=e.match(Wd);if(!t)throw Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=gX.fromHex("#"+e)),i}getColorMap(){return this._id2color.slice(0)}}class Wc{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];let t=[],i=0;for(let n=0,s=e.length;n<s;n++){let s=e[n],r=-1;if("string"==typeof s.fontStyle){r=0;let e=s.fontStyle.split(" ");for(let t=0,i=e.length;t<i;t++)switch(e[t]){case"italic":r|=1;break;case"bold":r|=2;break;case"underline":r|=4;break;case"strikethrough":r|=8}}let o=null;"string"==typeof s.foreground&&(o=s.foreground);let a=null;"string"==typeof s.background&&(a=s.background),t[i++]=new Wh(s.token||"",n,r,o,a)}return t}(e),t)}static createFromParsedTokenTheme(e,t){return function(e,t){e.sort((e,t)=>{var i,n;let s=(i=e.token)<(n=t.token)?-1:i>n?1:0;return 0!==s?s:e.index-t.index});let i=0,n="000000",s="ffffff";for(;e.length>=1&&""===e[0].token;){let t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(s=t.background)}let r=new Wu;for(let e of t)r.getId(e);let o=new Wm(new Wf(i,r.getId(n),r.getId(s)));for(let t=0,i=e.length;t<i;t++){let i=e[t];o.insert(i.token,i.fontStyle,r.getId(i.foreground),r.getId(i.background))}return new Wc(r,o)}(e,t)}constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(void 0===i){let e=this._match(t),n=function(e){let t=e.match(Wg);if(!t)return 0;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":case"regexp":return 3}throw Error("Unexpected match for standard token type!")}(t);i=(e.metadata|n<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}let Wg=/\b(comment|string|regex|regexp)\b/;class Wf{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new Wf(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class Wm{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){let t,i;if(""===e)return this._mainRule;let n=e.indexOf(".");-1===n?(t=e,i=""):(t=e.substring(0,n),i=e.substring(n+1));let s=this._children.get(t);return void 0!==s?s.match(i):this._mainRule}insert(e,t,i,n){let s,r;if(""===e){this._mainRule.acceptOverwrite(t,i,n);return}let o=e.indexOf(".");-1===o?(s=e,r=""):(s=e.substring(0,o),r=e.substring(o+1));let a=this._children.get(s);void 0===a&&(a=new Wm(this._mainRule.clone()),this._children.set(s,a)),a.insert(r,t,i,n)}}let Wp={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[m1]:"#FFFFFE",[m0]:"#000000",[ps]:"#E5EBF1",[wn]:"#D3D3D3",[wh]:"#939393",[pr]:"#ADD6FF4D"}}
665,W_={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[m1]:"#1E1E1E",[m0]:"#D4D4D4",[ps]:"#3A3D41",[wn]:"#404040",[wh]:"#707070",[pr]:"#ADD6FF26"}},Wv={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[m1]:"#000000",[m0]:"#FFFFFF",[wn]:"#FFFFFF",[wh]:"#FFFFFF"}},Wb={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[m1]:"#FFFFFF",[m0]:"#292929",[wn]:"#292929",[wh]:"#292929"}};(n3||(n3={})).getDefinition=function(e,t){let i=e.defaults;for(;iH.isThemeIcon(i);){let e=WS.getIcon(i.id);if(!e)return;i=e.defaults}return i},(tE=n9||(n9={})).toJSONObject=function(e){return{weight:e.weight,style:e.style,src:e.src.map(e=>({format:e.format,location:e.location.toString()}))}},tE.fromJSONObject=function(e){let t=e=>(0,re.HD)(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every(e=>(0,re.HD)(e.format)&&(0,re.HD)(e.location)))return{weight:t(e.weight),style:t(e.style),src:e.src.map(e=>({format:e.format,location:sJ.parse(e.location)}))}};let WC=/^([\w_-]+)$/,Ww=(0,rh.NC)(2024,"The font ID must only contain letters, numbers, underscores and dashes.");class Wy extends ro.JT{constructor(){super(),this._onDidChange=this._register(new sd.Q5),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:(0,rh.NC)(2025,"The id of the font to use. If not set, the font that is defined first is used."),pattern:WC.source,patternErrorMessage:Ww},fontCharacter:{type:"string",description:(0,rh.NC)(2026,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e
665030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${iH.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){let s=this.iconsById[e];if(s){if(i&&!s.description){s.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;let t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return s}this.iconsById[e]={id:e,description:i,defaults:t,deprecationMessage:n};let r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){let e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;iH.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`},i=[];i.push("| preview     | identifier                        | default codicon ID                | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");let n=Object.keys(this.iconsById).map(e=>this.iconsById[e]);for(let s of n.filter(e=>!!e.description).sort(e))i.push(`|<i class="${t(s)}"></i>|${s.id}|${iH.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);for(let s of(i.push("| preview     | identifier                        "),i.push("| ----------- | --------------------------------- |"),n.filter(e=>!iH.isThemeIcon(e.defaults)).sort(e)))i.push(`|<i class="${t(s)}"></i>|${s.id}|`);return i.join("\n")}}let WS=new Wy;function WL(e,t,i,n){return WS.registerIcon(e,t,i,n)}h5.add("base.contributions.icons",WS),function(){for(let e in rt){let t="\\"+rt[e].toString(16);WS.registerIcon(e,{fontCharacter:t})}}();let Wx="vscode://schemas/icons",Wk=h5.as(uB);Wk.registerSchema(Wx,WS.getIconSchema());let WN=new oK(()=>Wk.notifySchemaChanged(Wx),200);WS.onDidChange(()=>{WN.isScheduled()||WN.schedule()}),WL("widget-close",rr.close,(0,rh.NC)(2027,"Icon for the close action in widgets.")),WL("goto-previous-location",rr.arrowUp,(0,rh.NC)(2028,"Icon for goto previous editor location.")),WL("goto-next-location",rr.arrowDown,(0,rh.NC)(2029,"Icon for goto next editor location.")),iH.modify(rr.sync,"spin"),iH.modify(rr.loading,"spin");class WD{getIcon(e){let t=e.defaults;for(;iH.isThemeIcon(t);){let e=WS.getIcon(t.id);if(!e)return;t=e.defaults}return t}}let WE="vs-dark",WT="hc-black",WI="hc-light",WM=h5.as(mE),WR=h5.as(CY);class WA{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;let i=t.base;e.length>0?(WO(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){let e=new Map;for(let t in this.themeData.colors)e.set(t,gX.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){let t=WP(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,gX.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){return this.getColors().get(e)||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=WM.resolveDefaultColor(e,this),this.defaultColors[e]=t),t}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case"vs":return i2.LIGHT;case WT:return i2.HIGH_CONTRAST_DARK;case WI:return i2.HIGH_CONTRAST_LIGHT;default:return i2.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){let i=WP(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}let i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){let t={token:""};i&&(t.foreground=i),n&&(t.background=n),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=Wc.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){let n=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=fS.getForeground(n),r=fS.getFontStyle(n);return{foreground:s,italic:!!(1&r),bold:!!(2&r),underline:!!(4&r),strikethrough:!!(8&r)}}get tokenColorMap(){return[]}}function WO(e){return"vs"===e||e===WE||e===WT||e===WI}function WP(e){switch(e){case"vs":return Wp;case WE:return W_;case WT:return Wv;case WI:return Wb}}function WF(e){let t=WP(e);return new WA(e,t)}class WB extends ro.JT{constructor(){super(),this._onColorThemeChange=this._register(new sd.Q5),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new sd.Q5),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new WD,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set("vs",WF("vs")),this._knownThemes.set(WE,WF(WE)),this._knownThemes.set(WT,WF(WT)),this._knownThemes.set(WI,WF(WI));let e=this._register(function(e){let t=new ro.SL,i=t.add(new sd.Q5);return t.add(WS.onDidChange(()=>i.fire())),e&&t.add(e.onDidProductIconThemeChange(()=>i.fire())),{dispose:()=>t.dispose(),onDidChange:i.event,getCSS(){let t=e?e.getProductIconTheme():new WD,i={},n=new Aq,s=new Aq;for(let e of WS.getIcons()){let r=t.getIcon(e);if(!r)continue;let o=r.font,a=Aj`--vscode-icon-${A$(e.id)}-font-family`,l=Aj`--vscode-icon-${A$(e.id)}-content`;o?(i[o.id]=o.definition,s.push(Aj`${a}: ${AU(o.id)};`,Aj`${l}: ${AU(r.fontCharacter)};`),n.push(Aj`.codicon-${A$(e.id)}:before { content: ${AU(r.fontCharacter)}; font-family: ${AU(o.id)}; }`)):(s.push(Aj`${l}: ${AU(r.fontCharacter)}; ${a}: 'codicon';`),n.push(Aj`.codicon-${A$(e.id)}:before { content: ${AU(r.fontCharacter)}; }`))}for(let e in i){let t=i[e],s=t.weight?Aj`font-weight: ${Az(t.weight)};
665`:Aj``,r=t.style?Aj`font-style: ${Az(t.style)};`:Aj``,o=new Aq;for(let e of t.src)o.push(Aj`${AK(e.location)} format(${AU(e.format)})`);n.push(Aj`@font-face { src: ${o.join(", ")}; font-family: ${AU(e)};${s}${r} font-display: block; }`)}return n.push(Aj`:root { ${s.join(" ")} }`),n.join("\n")}}}(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
666${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme("vs"),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),or(rb,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return lc(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=mS(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),ro.JT.None}_registerShadowDomContainer(e){let t=mS(e,e=>{e.className="monaco-colors",e.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let e=0;e<this._styleElements.length;e++)if(this._styleElements[e]===t){this._styleElements.splice(e,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw Error("Illegal theme name!");if(!WO(t.base)&&!WO(e))throw Error("Illegal theme base!");this._knownThemes.set(e,new WA(e,t)),WO(e)&&this._knownThemes.forEach(t=>{t.base===e&&t.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get("vs"),this._updateActualTheme(t)}_updateActualTheme(e){e&&this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){let e=rb.matchMedia("(forced-colors: active)").matches;if(e!==vS(this._theme.type)){let t;t=vL(this._theme.type)?e?WT:WE:e?WI:"vs",this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){let e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};
666WR.getThemingParticipants().forEach(e=>e(this._theme,i,this._environment));let n=[];for(let e of WM.getColors()){let t=this._theme.getColor(e.id,!0);t&&n.push(`${mN(e.id)}: ${t.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${n.join("\n")} }`);let s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){let t=[];for(let i=1,n=e.length;i<n;i++){let n=e[i];t[i]=`.mtk${i} { color: ${n}; }`}return t.push(".mtki { font-style: italic; }"),t.push(".mtkb { font-weight: bold; }"),t.push(".mtku { text-decoration: underline; text-underline-position: under; }"),t.push(".mtks { text-decoration: line-through; }"),t.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),t.join("\n")}(s)),i.addRule(".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }"),this._themeCSS=e.join("\n"),this._updateCSS(),rp.setColorMap(s),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}
667${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}let WV=ht("themeService");var WW=function(e,t){return function(i,n){t(i,n,e)}};let WH=class extends ro.JT{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new sd.Q5,this._onDidChangeReducedMotion=new sd.Q5,this._onDidChangeLinkUnderline=new sd.Q5,this._accessibilityModeEnabledContext=mf.bindTo(this._contextKeyService);let n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),e.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));let s=rb.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(s),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(a6(e,"change",()=>{this._systemMotionReduced=e.matches,"auto"===this._configMotionReduced&&this._onDidChangeReducedMotion.fire()}));let t=()=>{let e=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("monaco-reduce-motion",e),this._layoutService.mainContainer.classList.toggle("monaco-enable-motion",!e)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration("accessibility.underlineLinks")){let e=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=e,this._onDidChangeLinkUnderline.fire()}}));let e=()=>{let e=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",e)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){let e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){let e=this._configMotionReduced;return"on"===e||"auto"===e&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};WH=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([WW(0,hZ),WW(1,Eu),WW(2,uE)],WH);var Wz=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},WU=function(e,t){return function(i,n){t(i,n,e)}};let WK=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new W$(i)}createMenu(e,t,i){return new WG(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){let n=new WG(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),s=n.getActions(i);return n.dispose(),s}resetHiddenStates(e){this._hiddenStates.reset(e)}};WK=Wz([WU(0,hg),WU(1,SP),WU(2,RB)],WK);let W$=class{static{n8=this}static{this._key="menu.hiddenCommands"}constructor(e){this._storageService=e,this._disposables=new ro.SL,this._onDidChange=new sd.Q5,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{let t=e.get(n8._key,0,"{}");this._data=JSON.parse(t)}catch(e){this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,n8._key,this._disposables)(()=>
667{if(!this._ignoreChangeEvent)try{let t=e.get(n8._key,0,"{}");this._data=JSON.parse(t)}catch(e){console.log("FAILED to read storage after UPDATE",e)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){let i=this._isHiddenByDefault(e,t),n=this._data[e.id]?.includes(t)??!1;return i?!n:n}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);let n=this._data[e.id];if(i)n?0>n.indexOf(t)&&n.push(t):this._data[e.id]=[t];else if(n){let i=n.indexOf(t);i>=0&&(0,as.LS)(n,i),0===n.length&&delete this._data[e.id]}this._persist()}reset(e){if(void 0===e)this._data=Object.create(null),this._persist();else{for(let{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;let e=JSON.stringify(this._data);this._storageService.store(n8._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};W$=n8=Wz([WU(0,RB)],W$);class Wj{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,this._menuGroups=[],this._allMenuIds=new Set,this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get allMenuIds(){return this._allMenuIds}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){let e;for(let t of(this._menuGroups.length=0,this._allMenuIds.clear(),this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear(),this._sort(di.getMenuItems(this._id)))){let i=t.group||"";e&&e[0]===i||(e=[i,[]],this._menuGroups.push(e)),e[1].push(t),this._collectContextKeysAndSubmenuIds(t)}this._allMenuIds.add(this._id)}_sort(e){return e}_collectContextKeysAndSubmenuIds(e){if(Wj._fillInKbExprKeys(e.when,this._structureContextKeys),h9(e)){if(e.command.precondition&&Wj._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){let t=e.command.toggled.condition||e.command.toggled;Wj._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&(di.getMenuItems(e.submenu).forEach(this._collectContextKeysAndSubmenuIds,this),this._allMenuIds.add(e.submenu))}static _fillInKbExprKeys(e,t){if(e)for(let i of e.keys())t.add(i)}}let Wq=se=class extends Wj{constructor(e,t,i,n,s,r){super(e,i),this._hiddenStates=t,this._commandService=n,this._keybindingService=s,this._contextKeyService=r,this.refresh()}createActionGroups(e){let t=[];for(let i of this._menuGroups){let n;let[s,r]=i;for(let t of r)if(this._contextKeyService.contextMatchesRules(t.when)){let i=h9(t);i&&this._hiddenStates.setDefaultState(this._id,t.command.id,!!t.isHiddenByDefault);let s=function(e,t,i){let n=void 0!==t.submenu?t.submenu.id:t.id,s="string"==typeof t.title?t.title:t.title.value,r=hd({id:`hide/${e.id}/${n}`,label:(0,rh.NC)(1651,"Hide '{0}'",s),run(){i.updateHidden(e,n,!0)}}),o=hd({id:`toggle/${e.id}/${n}`,label:s,get checked(){return!i.isHidden(e,n)},run(){i.updateHidden(e,n,!!this.checked)}});return{hide:r,toggle:o,get isHidden(){return!o.checked}}}(this._id,i?t.command:t,this._hiddenStates);if(i){let i=WQ(this._commandService,this._keybindingService,t.command.id,t.when);(n??=[]).push(new ds(t.command,t.alt,e,s,i,this._contextKeyService,this._commandService))}else{let i=new se(t.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),r=ha.join(...i.map(e=>e[1]));r.length>0&&(n??=[]).push(new dn(t,s,r))}}n&&n.length>0&&t.push([s,n])}return t}_sort(e){return e.sort(se._compareMenuItems)}static _compareMenuItems(e,t){let i=e.group,n=t.group;if(i!==n){if(!i)return 1;if(!n||"navigation"===i)return -1;if("navigation"===n)return 1;let e=i.localeCompare(n);if(0!==e)return e}let s=e.order||0,r=t.order||0;return s<r?-1:s>r?1:se._compareTitles(h9(e)?e.command.title:e.title,h9(t)?t.command.title:t.title)}static _compareTitles(e,t){let i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}};Wq=se=Wz([WU(3,hg),WU(4,SP),WU(5,hZ)],Wq);let WG=class{constructor(e,t,i,n,s,r){this._disposables=new ro.SL,this._menuInfo=new Wq(e,t,i.emitEventsForSubmenuChanges,n,s,r);let o=new oK(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStru
667cturalChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(o),this._disposables.add(di.onDidChangeMenu(e=>{for(let t of this._menuInfo.allMenuIds)if(e.has(t)){o.schedule();break}}));let a=this._disposables.add(new ro.SL);this._onDidChange=new sd.D0({onWillAddFirstListener:()=>{a.add(r.onDidChangeContext(e=>{let t=e.affectsSome(this._menuInfo.structureContextKeys),i=e.affectsSome(this._menuInfo.preconditionContextKeys),n=e.affectsSome(this._menuInfo.toggledContextKeys);(t||i||n)&&this._onDidChange.fire({menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n})})),a.add(t.onDidChange(e=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))},onDidRemoveLastListener:a.clear.bind(a),delay:i.eventDebounceDelay,merge:e=>{let t=!1,i=!1,n=!1;for(let s of e)if(t=t||s.isStructuralChange,i=i||s.isEnablementChange,n=n||s.isToggleChange,t&&i&&n)break;return{menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n}}}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};function WQ(e,t,i,n,s=!0){return hd({id:`configureKeybinding/${i}`,label:(0,rh.NC)(1652,"Configure Keybinding"),enabled:s,run(){let s=!t.lookupKeybinding(i)&&n?n.serialize():void 0;e.executeCommand("workbench.action.openGlobalKeybindings",`@command:${i}`+(s?` +when:${s}`:""))}})}WG=Wz([WU(3,hg),WU(4,SP),WU(5,hZ)],WG);var WY=function(e,t){return function(i,n){t(i,n,e)}};let WJ="application/vnd.code.resources",WZ=class extends ro.JT{static{st=this}constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(ou||oc)&&this.installWebKitWriteTextWorkaround(),this._register(sd.ju.runAndSubscribe(a1,({window:e,disposables:t})=>{t.add(a6(e.document,"copy",()=>this.clearResourcesState()))},{window:rb,disposables:this._store}))}triggerPaste(){this.logService.trace("BrowserClipboardService#triggerPaste")}installWebKitWriteTextWorkaround(){let e=()=>{let e=new oq;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,lm().navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch(async t=>{t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)})};this._register(sd.ju.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(a6(t,"click",e)),i.add(a6(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.logService.trace("BrowserClipboardService#writeText called with type:",t," text.length:",e.length),this.clearResourcesState(),t){this.mapTextToType.set(t,e),this.logService.trace("BrowserClipboardService#writeText");return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return this.logService.trace("before navigator.clipboard.writeText"),await lm().navigator.clipboard.writeText(e)}catch(e){console.error(e)}this.fallbackWriteText(e)}fallbackWriteText(e){this.logService.trace("BrowserClipboardService#fallbackWriteText");let t=lf(),i=t.activeElement,n=t.body.appendChild(lI("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),t.execCommand("copy"),l_(i)&&i.focus(),n.remove()}async readText(e){if(this.logService.trace("BrowserClipboardService#readText called with type:",e),e){let t=this.mapTextToType.get(e)||"";return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}try{let e=await lm().navigator.clipboard.readText();return this.logService.trace("BrowserClipboardService#readText text.length:",e.length),e}catch(e){console.error(e)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}static{this.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3}async readResources(){try{for(let e of(await lm().navigator.clipboard.read()))if(e.types.includes(`web ${WJ}`)){let t=await e.getType(`web ${WJ}`);return JSON.parse(await t.text()).map(e=>sJ.from(e))}}catch(e){}let e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(0!==this.resources.length)return o9((await this.readText()).substring(0,st.MAX_RESOURCE_STATE_SOURCE_LENGTH),0)}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}};WZ=st=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([WY(0,Eu),WY(1,dM)],WZ);let WX=ht("clipboardService"),W1="data-keybinding-context";class W0{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){let t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class W2 extends W0{static{this.INSTANCE=new W2}constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}class W5 extends W0{static{this._keyPrefix="config."}constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Ak.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(e=>{if(7===e.source){let e=Array.from(this._values,([e])=>e);this._values.clear(),i.fire(new W7(e))}else{let t=[];for(let i of e.affectedKeys){let e=`config.${i}`,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...hc.$.map(n,([e])=>e)),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new W7(t))}})}dispose(){this._listener.dispose()}getValue(e){let t;if(0!==e.indexOf(W5._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);let i=e.substr(W5._keyPrefix.length),n=this._configurationService.getValue(i);switch(typeof n){case"number":case"boolean":case"string":t=n;break;default:t=Array.isArray(n)?JSON.stringify(n):n}return this._values.set(e,t),t}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}class W4{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class W6{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class W7{constructor(e){this.keys=e}affectsSome(e){for(let t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class W3{constructor(e){this.events=e}affectsSome(e){for(let t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}class W9 extends ro.JT{get onDidChangeContext(){return this._onDidChangeContext.event}constructor(e){super(),this._onDidChangeContext=this._register(new sd.K3({merge:e=>new W3(e)})),this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw Error("AbstractContextKeyService has been disposed");return new W4(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw Error("AbstractContextKeyService has been disposed");return new He(this,e)}contextMatchesRules(e){if(this._isDisposed)throw Error("AbstractContextKeyService has been disposed");let t=this.getContextValuesContainer(this._myContextId);return!e||e.evaluate(t)}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;let i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new W6(e))}
667removeContext(e){!this._isDisposed&&this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new W6(e))}getContext(e){return this._isDisposed?W2.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute(W1)){let t=e.getAttribute(W1);if(t)return parseInt(t,10);return NaN}e=e.parentElement}return 0}(e))}dispose(){super.dispose(),this._isDisposed=!0}}let W8=class extends W9{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0,this.inputFocusedContext=Bz.bindTo(this);let t=this._register(new W5(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t),this._register(sd.ju.runAndSubscribe(a1,({window:e,disposables:t})=>{let i=t.add(new ro.XK);t.add(a6(e,ly.FOCUS_IN,()=>{i.value=new ro.SL,this.updateInputContextKeys(e.document,i.value)},!0))},{window:rb,disposables:this._store}))}updateInputContextKeys(e,t){function i(){return!!e.activeElement&&lH(e.activeElement)}let n=i();if(this.inputFocusedContext.set(n),n){let n=t.add(lx(e.activeElement));sd.ju.once(n.onDidBlur)(()=>{lm().document===e&&this.inputFocusedContext.set(i()),n.dispose()},void 0,t)}}getContextValuesContainer(e){return this._isDisposed?W2.INSTANCE:this._contexts.get(e)||W2.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw Error("ContextKeyService has been disposed");let t=++this._lastContextId;return this._contexts.set(t,new W0(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};W8=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){uE(e,t,0)}],W8);class He extends W9{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new ro.XK),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(W1)){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${e?": "+e:""}`)}this._domNode.setAttribute(W1,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{let t=this._parent.getContextValuesContainer(this._myContextId).value;e.allKeysContainedIn(new Set(Object.keys(t)))||this._onDidChangeContext.fire(e)}
667)}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(W1),super.dispose())}getContextValuesContainer(e){return this._isDisposed?W2.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}hf.registerCommand("_setContext",function(e,t,i){e.get(hZ).createKey(String(t),(0,cI.rs)(i,e=>"object"==typeof e&&1===e.$mid?sJ.revive(e).toString():e instanceof sJ?e.toString():void 0))}),hf.registerCommand({id:"getContextKeyInfo",handler:()=>[...hJ.all()].sort((e,t)=>e.key.localeCompare(t.key)),metadata:{description:(0,rh.NC)(1674,"A command that returns information about context keys"),args:[]}}),hf.registerCommand("_generateContextKeyInfo",function(){let e=[],t=new Set;for(let i of hJ.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort((e,t)=>e.key.localeCompare(t.key)),console.log(JSON.stringify(e,void 0,2))});class Ht{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class Hi{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let t of this._nodes.values())0===t.outgoing.size&&e.push(t);return e}insertEdge(e,t){let i=this.lookupOrInsertNode(e),n=this.lookupOrInsertNode(t);i.outgoing.set(n.key,n),n.incoming.set(i.key,i)}removeNode(e){let t=this._hashFn(e);for(let e of(this._nodes.delete(t),this._nodes.values()))e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){let t=this._hashFn(e),i=this._nodes.get(t);return i||(i=new Ht(t,e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){let e=[];for(let[t,i]of this._nodes)e.push(`${t}
668	(-> incoming)[${[...i.incoming.keys()].join(", ")}]
669	(outgoing ->)[${[...i.outgoing.keys()].join(",")}]
670`);return e.join("\n")}findCycleSlow(){for(let[e,t]of this._nodes){let i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(let[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);let e=this._findCycle(n,t);if(e)return e;t.delete(i)}}}class Hn extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: 
671${e.toString()}`}}class Hs{constructor(e=new D2,t=!1,i,n=!1){this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(he,this),this._globalGraph=n?i?._globalGraph??new Hi(e=>e):void 0}dispose(){if(!this._isDisposed){for(let e of(this._isDisposed=!0,(0,ro.B9)(this._children),this._children.clear(),this._servicesToMaybeDispose))(0,ro.Wf)(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();let i=this,n=new class extends Hs{dispose(){i._children.delete(n),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(n),t?.add(n),n}invokeFunction(e,...t){this._throwIfDisposed();let i=Hr.traceInvocation(this._enableTracing,e),n=!1;try{return e({get:e=>{if(n)throw(0,o_.L6)("service accessor is only valid during the invocation of its target method");let t=this._getOrCreateServiceInstance(e,i);if(!t)throw Error(`[invokeFunction] unknown service '${e}'`);return t},getIfExists:e=>{if(n)throw(0,o_.L6)("service accessor is only valid during the invocation of its target method");return this._getOrCreateServiceInstance(e,i)}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return this._throwIfDisposed(),e instanceof uA?(i=Hr.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Hr.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){let n=iV.getServiceDependencies(e).sort((e,t)=>e.index-t.index),s=[];for(let t of n){let n=this._getOrCreateServiceInstance(t.id,i);n||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`,!1),s.push(n)}let r=n.length>0?n[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);let i=r-t.length;t=i>0?t.concat(Array(i)):t.slice(0,r)}return Reflect.construct(e,t.concat(s))}_setCreatedServiceInstance(e,t){if(this._services.get(e) instanceof uA)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let i=this._getServiceInstanceOrDescriptor(e);return i instanceof uA?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){let n=new Hi(e=>e.id.toString()),s=0,r=[{id:e,desc:t,_trace:i}],o=new Set;for(;r.length;){let t=r.pop();if(!o.has(String(t.id))){if(o.add(String(t.id)),n.lookupOrInsertNode(t),s++>1e3)throw new Hn(n);for(let i of iV.getServiceDependencies(t.desc.ctor)){let s=this._getServiceInstanceOrDescriptor(i.id);if(s||this._throwIfStrict(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(t.id),String(i.id)),s instanceof uA){let e={
671id:i.id,desc:s,_trace:t._trace.branch(i.id,!0)};n.insertEdge(t,e),r.push(e)}}}}for(;;){let e=n.roots();if(0===e.length){if(!n.isEmpty())throw new Hn(n);break}for(let{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id) instanceof uA){let e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setCreatedServiceInstance(t.id,e)}n.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e) instanceof uA)return this._createServiceInstance(e,t,i,n,s,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,s);throw Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,s,r){if(n){let n=new Hs(void 0,this._strict,this,this._enableTracing);n._globalGraphImplicitDependency=String(e);let o=new Map,a=new oj(()=>{let e=n._createInstance(t,i,s);for(let[t,i]of o){let n=e[t];if("function"==typeof n)for(let t of i)t.disposable=n.apply(e,t.listener)}return o.clear(),r.add(e),e});return new Proxy(Object.create(null),{get(e,t){if(!a.isInitialized&&"string"==typeof t&&(t.startsWith("onDid")||t.startsWith("onWill"))){let e=o.get(t);return e||(e=new hu.S,o.set(t,e)),(i,n,s)=>{if(a.isInitialized)return a.value[t](i,n,s);{let t={listener:[i,n,s],disposable:void 0},r=e.push(t);return(0,ro.OF)(()=>{r(),t.disposable?.dispose()})}}}if(t in e)return e[t];let i=a.value,n=i[t];return"function"!=typeof n||(n=n.bind(i),e[t]=n),n},set:(e,t,i)=>(a.value[t]=i,!0),getPrototypeOf:e=>t.prototype})}{let e=this._createInstance(t,i,s);return r.add(e),e}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw Error(e)}}class Hr{static{this.all=new Set}static{this._None=new class extends Hr{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,t){return e?new Hr(2,t.name||Error().stack.split("\n").slice(3,4).join("\n")):Hr._None}
671static traceCreation(e,t){return e?new Hr(1,t.name):Hr._None}static{this._totals=0}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){let i=new Hr(3,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;Hr._totals+=e;let t=!1,i=[`${1===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(i,n){let s=[],r=Array(i+1).join("	");for(let[o,a,l]of n._dep)if(a&&l){t=!0,s.push(`${r}CREATES -> ${o}`);let n=e(i+1,l);n&&s.push(n)}else s.push(`${r}uses -> ${o}`);return s.join("\n")}(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Hr._totals.toFixed(2)}ms)`];(e>2||t)&&Hr.all.add(i.join("\n"))}}let Ho=new Set([iA.inMemory,iA.vscodeSourceControl,iA.walkThrough,iA.walkThroughSnippet,iA.vscodeChatCodeBlock,iA.vscodeTerminal]);class Ha{constructor(){this._byResource=new dh,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let s=this._byOwner.get(t);s||(s=new dh,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){let i=this._byResource.get(e);return i?.get(t)}delete(e,t){let i=!1,n=!1,s=this._byResource.get(e);s&&(i=s.delete(t));let r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw Error("illegal state");return i&&n}values(e){return"string"==typeof e?this._byOwner.get(e)?.values()??hc.$.empty():sJ.isUri(e)?this._byResource.get(e)?.values()??hc.$.empty():hc.$.map(hc.$.concat(...this._byOwner.values()),e=>e[1])}}class Hl{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new dh,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(let t of e){let e=this._data.get(t);e&&this._substract(e);let i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){let t={errors:0,warnings:0,infos:0,unknowns:0};if(Ho.has(e.scheme))return t;for(let{severity:i}of this._service.read({resource:e}))i===nK.Error?t.errors+=1:i===nK.Warning?t.warnings+=1:i===nK.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class Hh{constructor(){this._onMarkerChanged=new sd.D0({delay:0,merge:Hh._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new Ha,this._stats=new Hl(this),this._filteredResources=new dh}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(let i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if((0,as.XY)(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{let n=[];for(let s of i){let i=Hh._toMarker(e,t,s);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:r,source:o,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:u,tags:c,origin:g}=i;if(r)return l=l>0?l:1,h=h>=(a=a>0?a:1)?h:a,d=d>0?d:l,{resource:t,owner:e,code:n,severity:s,message:r,source:o,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:u,tags:c,origin:g}}changeAll(e,t){let i=[],n=this._data.values(e);if(n)for(let t of n){let n=hc.$.first(t);n&&(i.push(n.resource),this._data.delete(n.resource,e))}if((0,as.Of)(t)){let n=new dh;for(let{resource:s,marker:r}of t){let t=Hh._toMarker(e,s,r);if(!t)continue;let o=n.get(s);o?o.push(t):(n.set(s,[t]),i.push(s))}for(let[t,i]of n)this._data.set(t,e,i)}i.length>0&&this._onMarkerChanged.fire(i)}_createFilteredMarker(e,t){let i=1===t.length?(0,rh.NC)(1738,'Problems are paused because: "{0}"',t[0]):(0,rh.NC)(1739,'Problems are paused because: "{0}" and {1} more',t[0],t.length-1);return{owner:"markersFilter",resource:e,severity:nK.Info,message:i,startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){let r=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);if(r?.length)return[this._createFilteredMarker(i,r)];let o=this._data.get(i,t);if(!o)return[];let a=[];for(let t of o){if(s>0&&a.length===s)break;let r=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);r?.length?a.push(this._createFilteredMarker(i,r)):Hh._accept(t,n)&&a.push(t)}return a}{let r=t||i?this._data.values(i??t):this._data.values(),o=[],a=new dd;for(let t of r)for(let i of t){if(a.has(i.resource))continue;if(s>0&&o.length===s)break;let t=e.ignoreResourceFilters?void 0:this._filteredResources.get(i.resource);t?.length?(o.push(this._createFilteredMarker(i.resource,t)),a.add(i.resource)):Hh._accept(i,n)&&o.push(i)}return o}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){let t=new dh;for(let i of e)for(let e of i)t.set(e,!0);return Array.from(t.keys())}}class Hd extends ro.JT{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=R4.createEmptyModel(e)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=R4.createEmptyModel(this.logService);let e=h5.as(uU).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){let i=this.getConfigurationDefaultOverrides();for(let n of e){let e=i[n],s=t[n];void 0!==e?this._configurationModel.setValue(n,e):s?this._configurationModel.setValue(n,(0,cI.I8)(s.default)):this._configurationModel.removeValue(n)}}}let Hu=ht("accessibilitySignalService");class Hc{static register(e){return new Hc(e.fileName)}static{this.error=Hc.register({fileName:"error.mp3"})}static{this.warning=Hc.register({fileName:"warning.mp3"})}static{this.success=Hc.register({fileName:"success.mp3"})}static{this.foldedArea=Hc.register({fileName:"foldedAreas.mp3"})}static{this.break=Hc.register({fileName:"break.mp3"})}static{this.quickFixes=Hc.register({fileName:"quickFixes.mp3"})}static{this.taskCompleted=Hc.register({fileName:"taskCompleted.mp3"})}static{this.taskFailed=Hc.register({fileName:"taskFailed.mp3"})}static{this.terminalBell=Hc.register({fileName:"terminalBell.mp3"})}static{this.diffLineInserted=Hc.register({fileName:"diffLineInserted.mp3"})}
671static{this.diffLineDeleted=Hc.register({fileName:"diffLineDeleted.mp3"})}static{this.diffLineModified=Hc.register({fileName:"diffLineModified.mp3"})}static{this.requestSent=Hc.register({fileName:"requestSent.mp3"})}static{this.responseReceived1=Hc.register({fileName:"responseReceived1.mp3"})}static{this.responseReceived2=Hc.register({fileName:"responseReceived2.mp3"})}static{this.responseReceived3=Hc.register({fileName:"responseReceived3.mp3"})}static{this.responseReceived4=Hc.register({fileName:"responseReceived4.mp3"})}static{this.clear=Hc.register({fileName:"clear.mp3"})}static{this.save=Hc.register({fileName:"save.mp3"})}static{this.format=Hc.register({fileName:"format.mp3"})}static{this.voiceRecordingStarted=Hc.register({fileName:"voiceRecordingStarted.mp3"})}static{this.voiceRecordingStopped=Hc.register({fileName:"voiceRecordingStopped.mp3"})}static{this.progress=Hc.register({fileName:"progress.mp3"})}static{this.chatEditModifiedFile=Hc.register({fileName:"chatEditModifiedFile.mp3"})}static{this.editsKept=Hc.register({fileName:"editsKept.mp3"})}static{this.editsUndone=Hc.register({fileName:"editsUndone.mp3"})}static{this.nextEditSuggestion=Hc.register({fileName:"nextEditSuggestion.mp3"})}static{this.terminalCommandSucceeded=Hc.register({fileName:"terminalCommandSucceeded.mp3"})}static{this.chatUserActionRequired=Hc.register({fileName:"chatUserActionRequired.mp3"})}static{this.codeActionTriggered=Hc.register({fileName:"codeActionTriggered.mp3"})}static{this.codeActionApplied=Hc.register({fileName:"codeActionApplied.mp3"})}constructor(e){this.fileName=e}}class Hg{constructor(e){this.randomOneOf=e}}class Hf{constructor(e,t,i,n,s,r,o=!1){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=n,this.legacyAnnouncementSettingsKey=s,this.announcementMessage=r,this.managesOwnEnablement=o}static{this._signals=new Set}static register(e){let t=new Hf(new Hg("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.managesOwnEnablement);return Hf._signals.add(t),t}static{this.errorAtPosition=Hf.register({name:(0,rh.NC)(1576,"Error at Position"),sound:Hc.error,announcementMessage:(0,rh.NC)(1577,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"})}static{this.warningAtPosition=Hf.register({name:(0,rh.NC)(1578,"Warning at Position"),sound:Hc.warning,announcementMessage:(0,rh.NC)(1579,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"})}static{this.errorOnLine=Hf.register({name:(0,rh.NC)(1580,"Error on Line"),sound:Hc.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:(0,rh.NC)(1581,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"})}static{this.warningOnLine=Hf.register({name:(0,rh.NC)(1582,"Warning on Line"),sound:Hc.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:(0,rh.NC)(1583,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"})}static{this.foldedArea=Hf.register({name:(0,rh.NC)(1584,"Folded Area on Line"),sound:Hc.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:(0,rh.NC)(1585,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"})}static{this.break=Hf.register({name:(0,rh.NC)(1586,"Breakpoint on Line"),sound:Hc.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:(0,rh.NC)(1587,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"})}static{this.inlineSuggestion=Hf.register({name:(0,rh.NC)(1588,"Inline Suggestion on Line"),sound:Hc.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"})}static{this.nextEditSuggestion=Hf.register({name:(0,rh.NC)(1589,"Next Edit Suggestion on Line"),sound:Hc.nextEditSuggestion,legacySoundSettingsKey:"audioCues.nextEditSuggestion",settingsKey:"accessibility.signals.nextEditSuggestion",announcementMessage:(0,rh.NC)(1590,"Next Edit Suggestion")})}static{this.terminalQuickFix=Hf.register({name:(0,rh.NC)(1591,"Terminal Quick Fix"),sound:Hc.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:(0,rh.NC)(1592,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"})}static{this.onDebugBreak=Hf.register({name:(0,rh.NC)(1593,"Debugger Stopped on Breakpoint"),sound:Hc.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:(0,rh.NC)(1594,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"})}static{this.noInlayHints=Hf.register({name:(0,rh.NC)(1595,"No Inlay Hints on Line"),sound:Hc.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:(0,rh.NC)(1596,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"})}static{this.taskCompleted=Hf.register({name:(0,rh.NC)(1597,"Task Completed"),sound:Hc.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:(0,rh.NC)(1598,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"})}static{this.taskFailed=Hf.register({name:(0,rh.NC)(1599,"Task Failed"),sound:Hc.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:(0,rh.NC)(1600,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"})}static{this.terminalCommandFailed=Hf.register({name:(0,rh.NC)(1601,"Terminal Command Failed"),sound:Hc.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:(0,rh.NC)(1602,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"})}static{this.terminalCommandSucceeded=Hf.register({name:(0,rh.NC)(1603,"Terminal Command Succeeded"),sound:Hc.terminalCommandSucceeded,announcementMessage:(0,rh.NC)(1604,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"})}static{this.terminalBell=Hf.register({name:(0,rh.NC)(1605,"Terminal Bell"),sound:Hc.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:(0,rh.NC)(1606,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"})}static{this.notebookCellCompleted=Hf.register({name:(0,rh.NC)(1607,"Notebook Cell Completed"),sound:Hc.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:(0,rh.NC)(1608,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"})}static{this.notebookCellFailed=Hf.register({name:(0,rh.NC)(1609,"Notebook Cell Failed"),sound:Hc.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:(0,rh.NC)(1610,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"})}static{this.diffLineInserted=Hf.register({name:(0,rh.NC)(1611,"Diff Line Inserted"),sound:Hc.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",
671settingsKey:"accessibility.signals.diffLineInserted"})}static{this.diffLineDeleted=Hf.register({name:(0,rh.NC)(1612,"Diff Line Deleted"),sound:Hc.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"})}static{this.diffLineModified=Hf.register({name:(0,rh.NC)(1613,"Diff Line Modified"),sound:Hc.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"})}static{this.chatEditModifiedFile=Hf.register({name:(0,rh.NC)(1614,"Chat Edit Modified File"),sound:Hc.chatEditModifiedFile,announcementMessage:(0,rh.NC)(1615,"File Modified from Chat Edits"),settingsKey:"accessibility.signals.chatEditModifiedFile"})}static{this.chatRequestSent=Hf.register({name:(0,rh.NC)(1616,"Chat Request Sent"),sound:Hc.requestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:(0,rh.NC)(1617,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"})}static{this.chatResponseReceived=Hf.register({name:(0,rh.NC)(1618,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Hc.responseReceived1,Hc.responseReceived2,Hc.responseReceived3,Hc.responseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"})}static{this.codeActionTriggered=Hf.register({name:(0,rh.NC)(1619,"Code Action Request Triggered"),sound:Hc.codeActionTriggered,legacySoundSettingsKey:"audioCues.codeActionRequestTriggered",legacyAnnouncementSettingsKey:"accessibility.alert.codeActionRequestTriggered",announcementMessage:(0,rh.NC)(1620,"Code Action Request Triggered"),settingsKey:"accessibility.signals.codeActionTriggered"})}static{this.codeActionApplied=Hf.register({name:(0,rh.NC)(1621,"Code Action Applied"),legacySoundSettingsKey:"audioCues.codeActionApplied",sound:Hc.codeActionApplied,settingsKey:"accessibility.signals.codeActionApplied"})}static{this.progress=Hf.register({name:(0,rh.NC)(1622,"Progress"),sound:Hc.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:(0,rh.NC)(1623,"Progress"),settingsKey:"accessibility.signals.progress"})}static{this.clear=Hf.register({name:(0,rh.NC)(1624,"Clear"),sound:Hc.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:(0,rh.NC)(1625,"Clear"),settingsKey:"accessibility.signals.clear"})}static{this.save=Hf.register({name:(0,rh.NC)(1626,"Save"),sound:Hc.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:(0,rh.NC)(1627,"Save"),settingsKey:"accessibility.signals.save"})}static{this.format=Hf.register({name:(0,rh.NC)(1628,"Format"),sound:Hc.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:(0,rh.NC)(1629,"Format"),settingsKey:"accessibility.signals.format"})}static{this.voiceRecordingStarted=Hf.register({name:(0,rh.NC)(1630,"Voice Recording Started"),sound:Hc.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"})}static{this.voiceRecordingStopped=Hf.register({name:(0,rh.NC)(1631,"Voice Recording Stopped"),sound:Hc.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"})}static{this.editsKept=Hf.register({name:(0,rh.NC)(1632,"Edits Kept"),sound:Hc.editsKept,announcementMessage:(0,rh.NC)(1633,"Edits Kept"),settingsKey:"accessibility.signals.editsKept"})}static{this.editsUndone=Hf.register({name:(0,rh.NC)(1634,"Undo Edits"),sound:Hc.editsUndone,announcementMessage:(0,rh.NC)(1635,"Edits Undone"),settingsKey:"accessibility.signals.editsUndone"})}static{this.chatUserActionRequired=Hf.register({name:(0,rh.NC)(1636,"Chat User Action Required"),sound:Hc.chatUserActionRequired,announcementMessage:(0,rh.NC)(1637,"Chat User Action Required"),settingsKey:"accessibility.signals.chatUserActionRequired",managesOwnEnablement:!0})}}class Hm extends ro.JT{constructor(e,t=[]){super(),this.logger=new dF([e,...t]),this._register(e.onDidChangeLogLevel(e=>this.setLevel(e)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}let Hp=[];class H_{getParserClass(){throw Error("not implemented in StandaloneTreeSitterLibraryService")}supportsLanguage(e,t){return!1}
671getLanguage(e,t,i){}getInjectionQueries(e,t){return null}getHighlightingQueries(e,t){return null}}let Hv=ht("dataChannelService");class Hb{getDataChannel(e){return{sendData:()=>{}}}}var HC=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Hw=function(e,t){return function(i,n){t(i,n,e)}};class Hy{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new sd.Q5}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let HS=class{constructor(e){this.modelService=e}createModelReference(e){let t=this.modelService.getModel(e);return t?Promise.resolve(new ro.Jz(new Hy(t))):Promise.reject(Error("Model not found"))}};HS=HC([Hw(0,hn)],HS);class HL{static{this.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}}}show(){return HL.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}}class Hx{withProgress(e,t,i){return t({report:()=>{}})}}class Hk{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class HN{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}
671}doConfirm(e,t){let i=e;return t&&(i=i+"\n\n"+t),rb.confirm(i)}async prompt(e){let t;if(this.doConfirm(e.message,e.detail)){let i=[...e.buttons??[]];e.cancelButton&&"string"!=typeof e.cancelButton&&"boolean"!=typeof e.cancelButton&&i.push(e.cancelButton),t=await i[0]?.run({checkboxChecked:!1})}return{result:t}}async error(e,t){await this.prompt({type:Sh.Error,message:e,detail:t})}}class HD{static{this.NO_OP=new Su}info(e){return this.notify({severity:Sh.Info,message:e})}warn(e){return this.notify({severity:Sh.Warning,message:e})}error(e){return this.notify({severity:Sh.Error,message:e})}notify(e){switch(e.severity){case Sh.Error:console.error(e.message);break;case Sh.Warning:console.warn(e.message);break;default:console.log(e.message)}return HD.NO_OP}prompt(e,t,i,n){return HD.NO_OP}status(e,t){return{close:()=>{}}}}let HE=class{constructor(e){this._onWillExecuteCommand=new sd.Q5,this._onDidExecuteCommand=new sd.Q5,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){let i=hf.getCommand(e);if(!i)return Promise.reject(Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(e){return Promise.reject(e)}}};HE=HC([Hw(0,he)],HE);let HT=class extends Ar{constructor(e,t,i,n,s,r){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];let o=e=>{let t=new ro.SL;t.add(a6(e,ly.KEY_DOWN,e=>{let t=new ok(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())})),t.add(a6(e,ly.KEY_UP,e=>{let t=new ok(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()})),this._domNodeListeners.push(new HI(e,t))},a=e=>{for(let t=0;t<this._domNodeListeners.length;
671t++){let i=this._domNodeListeners[t];i.domNode===e&&(this._domNodeListeners.splice(t,1),i.dispose())}},l=e=>{e.getOption(70)||o(e.getContainerDomNode())};this._register(r.onCodeEditorAdd(l)),this._register(r.onCodeEditorRemove(e=>{e.getOption(70)||a(e.getContainerDomNode())})),r.listCodeEditors().forEach(l);let h=e=>{o(e.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(e=>{a(e.getContainerDomNode())})),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return(0,ro.F8)(hf.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){let t=e.map(e=>({keybinding:ov(e.keybinding,sS.OS),command:e.command??null,commandArgs:e.commandArgs,when:e.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),(0,ro.OF)(()=>{for(let e=0;e<this._dynamicKeybindings.length;e++)if(this._dynamicKeybindings[e]===t[0]){this._dynamicKeybindings.splice(e,t.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){let e=this._toNormalizedKeybindingItems(h6.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new At(e,t,e=>this._log(e))}return this._cachedResolver}_documentHasFocus(){return rb.document.hasFocus()}_toNormalizedKeybindingItems(e,t){let i=[],n=0;for(let s of e){let e=s.when||void 0,r=s.keybinding;if(r)for(let o of Am.resolveKeybinding(r,sS.OS))i[n++]=new Aa(o,s.command,s.commandArgs,e,t,null,!1);else i[n++]=new Aa(void 0,s.command,s.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){return new Am([new oC(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode)],sS.OS)}};HT=HC([Hw(0,hZ),Hw(1,hg),Hw(2,da),Hw(3,Sd),Hw(4,dM),Hw(5,hi)],HT);class HI extends ro.JT{constructor(e,t){super(),this.domNode=e,this._register(t)}}function HM(e){return!!e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof sJ)}let HR=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new sd.Q5,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;let t=new Hd(e);this._configuration=new R3(t.reload(),R4.createEmptyModel(e),R4.createEmptyModel(e),R4.createEmptyModel(e),R4.createEmptyModel(e),R4.createEmptyModel(e),new dh,R4.createEmptyModel(e),new dh,e),t.dispose()}getValue(e,t){let i="string"==typeof e?e:void 0,n=HM(e)?e:HM(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){let t={data:this._configuration.toData()},i=[];for(let t of e){let[e,n]=t;this.getValue(e)!==n&&(this._configuration.updateValue(e,n),i.push(e))}if(i.length>0){let e=new R9({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);e.source=8,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}};HR=HC([Hw(0,dM)],HR);let HA=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new sd.Q5,this.configurationService.onDidChangeConfiguration(e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})})}getValue(e,t,i){let n=s3.isIPosition(t)?t:null,s=n?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0,r=e?this.getLanguage(e,n):void 0;return void 0===s?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(s,{resource:e,overrideIdentifier:r})}getLanguage(e,t){let i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};HA=HC([Hw(0,uE),Hw(1,hn),Hw(2,uR)],HA);let HO=class{constructor(e){this.configurationService=e}getEOL(e,t){let i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"string"==typeof i&&"auto"!==i?i:sS.IJ||sS.dz?"\n":"\r\n"}};HO=HC([Hw(0,uE)],HO);class HP{publicLog2(){}}class HF{static{this.SCHEME="inmemory"}constructor(){let e=sJ.from({scheme:HF.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new AD({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===HF.SCHEME?this.workspace.folders[0]:null}}function HB(e,t,i){if(!t||!(e instanceof HR))return;let n=[];
671Object.keys(t).forEach(e=>{R0()[`editor.${e}`]&&n.push([`editor.${e}`,t[e]]),i&&R0()[`diffEditor.${e}`]&&n.push([`diffEditor.${e}`,t[e]])}),n.length>0&&e.updateValues(n)}let HV=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){let i=Array.isArray(e)?e:RQ.convert(e),n=new Map;for(let e of i){if(!(e instanceof RY))throw Error("bad edit - only text edits are supported");let t=this._modelService.getModel(e.resource);if(!t)throw Error("bad edit - model not found");if("number"==typeof e.versionId&&t.getVersionId()!==e.versionId)throw Error("bad state - model changed in the meantime");let i=n.get(t);i||(i=[],n.set(t,i)),i.push(R2.replaceMove(s9.lift(e.textEdit.range),e.textEdit.text))}let s=0,r=0;for(let[e,t]of n)e.pushStackElement(),e.pushEditOperations([],t,()=>[]),e.pushStackElement(),r+=1,s+=t.length;return{ariaSummary:rx(nF.bulkEditServiceSummary,s,r),isApplied:s>0}}};HV=HC([Hw(0,hn)],HV);class HW{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}getUriBasenameLabel(e){return dx(e)}}let HH=class extends RS{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){let e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,i)}};HH=HC([Hw(0,Eu),Hw(1,hi)],HH);class Hz{constructor(){this._neverEmitter=new sd.Q5,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class HU extends AV{constructor(){super()}}class HK extends Hm{constructor(){super(new dP)}}let H$=class extends Pu{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r),this.configure({blockMouse:!1})}};H$=HC([Hw(0,da),Hw(1,Sd),Hw(2,Td),Hw(3,SP),Hw(4,de),Hw(5,hZ)],H$);let Hj={esmModuleLocation:void 0,label:"editorWorkerService"},Hq=class extends fc{constructor(e,t,i,n,s){super(Hj,e,t,i,n,s)}};Hq=HC([Hw(0,hn),Hw(1,fr),Hw(2,dM),Hw(3,u8),Hw(4,fa)],Hq);class HG{async playSignal(e,t){}}function HQ(e,t,i,n=iP.ofCaller()){let s=e.bindTo(t),r=new ro.SL;return aL({debugName:()=>`Set Context Key "${e.key}"`},e=>{let t=i(e);return s.set(t),t},n).recomputeInitiallyAndOnChange(r),r}uP(dM,HK,0),uP(uE,HR,0),uP(fr,HA,0),uP(fo,HO,0),uP(AN,HF,0),uP(Ap,HW,0),uP(da,HP,0),uP(Ep,HN,0),uP(EM,Hk,0),uP(Sd,HD,0),uP(Pv,Hh,0),uP(uR,HU,0),uP(WV,WB,0),uP(hn,PN,0),uP(ms,PC,0),uP(hZ,W8,0),uP(A_,Hx,0),uP(Ab,HL,0),uP(RB,RW,0),uP(P_,Hq,0),uP(RG,HV,0),uP(AE,Hz,0),uP(hs,HS,0),uP(mg,WH,0),uP(B$,Bj,0),uP(hg,HE,0),uP(SP,HT,0),uP(RA,Wo,0),uP(Td,HH,0),uP(Ru,Pp,0),uP(WX,WZ,0),uP(Tu,H$,0),uP(de,WK,0),uP(Hu,HG,0),uP(k0,H_,0),uP(dR,dW,0),uP(Hv,Hb,0),function(e){let t=new D2;for(let[e,i]of uO)t.set(e,i);let i=new Hs(t,!0);t.set(he,i),e.get=function(e){n||r({});let s=t.get(e);if(!s)throw Error("Missing service "+e);return s instanceof uA?i.invokeFunction(t=>t.get(e)):s};let n=!1,s=new sd.Q5;function r(e){if(n)return i;for(let[e,i]of(n=!0,uO))t.get(e)||t.set(e,i);for(let i in e)if(e.hasOwnProperty(i)){let n=ht(i);t.get(n) instanceof uA&&t.set(n,e[i])}for(let e of Hp.slice(0))try{i.createInstance(e)}catch(e){(0,o_.dL)(e)}return s.fire(),i}e.initialize=r,e.withServices=function(e){if(n)return e();let t=new ro.SL,i=t.add(s.event(()=>{i.dispose(),t.add(e())}));return t}}(si||(si={}));class HY{static capture(e){if(0===e.getScrollTop()||e.hasPendingScrollAnimation())return new HY(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0,n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();let s=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-s}return new HY(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=s}restore(e){if((this._initialContentHeight!==e.getContentHeight()||this._initialScrollTop!==e.getScrollTop())&&this._visiblePosition){let t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;let t=e.getPosition();if(!this._cursorPosition||!t)return;let i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,1)}}function HJ(e,t){let i=new ro.SL,n=e.createDecorationsCollection();return i.add(aD({debugName:()=>
671`Apply decorations from ${t.debugName}`},e=>{let i=t.read(e);n.set(i)})),i.add({dispose:()=>{n.clear()}}),i}function HZ(e,t){return e.appendChild(t),(0,ro.OF)(()=>{t.remove()})}class HX extends ro.JT{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new mo(e,t)),this._width=aU(this,this.elementSizeObserver.getWidth()),this._height=aU(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(e=>aM(e=>{this._width.set(this.elementSizeObserver.getWidth(),e),this._height.set(this.elementSizeObserver.getHeight(),e)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function H1(e,t,i){let n,s=t.get(),r=s,o=s,a=aU("animatedValue",s),l=-1;return i.add(aE({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(e,i)=>(e.didChange(t)&&(i.animate=i.animate||e.change),!0)}},(i,h)=>{void 0!==n&&(e.cancelAnimationFrame(n),n=void 0),r=o,s=t.read(i),l=Date.now()-(h.animate?0:300),function t(){var i,h;let d=Date.now()-l;o=Math.floor((i=r,h=s-r,300===d?i+h:h*(-Math.pow(2,-10*d/300)+1)+i)),d<300?n=e.requestAnimationFrame(t):o=s,a.set(o,void 0)}()})),a}class H0 extends ro.JT{constructor(e,t,i){super(),this._register(new H5(e,i)),this._register(H4(i,{height:t.actualHeight,top:t.actualTop}))}}class H2{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=aU(this,void 0),this._actualHeight=aU(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=e=>{this._actualTop.set(e,void 0)},this.onComputedHeight=e=>{this._actualHeight.set(e,void 0)}}}class H5{static{this._counter=0}constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${H5._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}function H4(e,t){return aN(i=>{for(let[n,s]of Object.entries(t))s&&"object"==typeof s&&"read"in s&&(s=s.read(i)),"number"==typeof s&&(s=`${s}px`),n=n.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),e.style[n]=s})}function H6(e,t,i,n){let s=new ro.SL,r=[];return s.add(aT((s,o)=>{let a=t.read(s),l=new Map,h=new Map;i&&i(!0),e.changeViewZones(e=>{for(let t of r)e.removeZone(t),n?.delete(t);for(let t of(r.length=0,a)){let i=e.addZone(t);t.setZoneId&&t.setZoneId(i),r.push(i),n?.add(i),l.set(t,i)}}),i&&i(!1),o.add(aE({changeTracker:{createChangeSummary:()=>({zoneIds:[]}),handleChange(e,t){let i=h.get(e.changedObservable);return void 0!==i&&t.zoneIds.push(i),!0}}},(t,n)=>{for(let e of a)e.onChange&&(h.set(e.onChange,l.get(e)),e.onChange.read(t));i&&i(!0),e.changeViewZones(e=>{for(let t of n.zoneIds)e.layoutZone(t)}),i&&i(!1)}))})),s.add({dispose(){i&&i(!0),e.changeViewZones(e=>{for(let t of r)e.removeZone(t)}),n?.clear(),i&&i(!1)}}),s}function H7(e,t){let i=cJ(t,t=>t.original.startLineNumber<=e.lineNumber);if(!i)return s9.fromPositions(e);if(i.original.endLineNumberExclusive<=e.lineNumber){let t=e.lineNumber-i.original.endLineNumberExclusive+i.modified.endLineNumberExclusive;return s9.fromPositions(new s3(t,e.column))}if(!i.innerChanges)return s9.fromPositions(new s3(i.modified.startLineNumber,1));let n=cJ(i.innerChanges,t=>t.originalRange.getStartPosition().isBeforeOrEqual(e));if(!n){let t=e.lineNumber-i.original.startLineNumber+i.modified.startLineNumber;return s9.fromPositions(new s3(t,e.column))}if(n.originalRange.containsPosition(e))return n.modifiedRange;{var s;let t=(s=n.originalRange.getEndPosition()).lineNumber===e.lineNumber?new c6(0,e.column-s.column):new c6(e.lineNumber-s.lineNumber,e.column-1);return s9.fromPositions(t.addToPosition(n.modifiedRange.getEndPosition()))}}class H3{static create(e,t){return new H9(e,e,t)}static createWithDisposable(e,t,i){let n=new ro.SL;return n.add(t),n.add(e),new H9(e,n,i)}}class H9 extends H3{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new H8(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,0===this._refCount&&this._disposable.dispose(),e){let t=this._owners.indexOf(e);-1!==t&&this._owners.splice(t,1)}}}class H8 extends H3{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}i(33709);var ze=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},zt=function(e,t){return function(i,n){t(i,n,e)}};let zi=WL("diff-review-insert",rr.add,(0,rh.NC)(97,"Icon for 'Insert' in accessible diff viewer.")),zn=WL("diff-review-remove",rr.remove,(0,rh.NC)(98,"Icon for 'Remove' in accessible diff viewer.")),zs=WL("diff-review-close",rr.close,(0,rh.NC)(99,"Icon for 'Close' in accessible diff viewer.")),zr=class extends ro.JT{static{this._ttPolicy=ut("diffReview",{createHTML:e=>e})}constructor(e,t,i,n,s,r,o,a,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose
671=n,this._width=s,this._height=r,this._diffs=o,this._models=a,this._instantiationService=l,this._state=ay(this,e=>{let t=this._visible.read(e);if(this._parentNode.style.visibility=t?"visible":"hidden",!t)return null;let i=e.store.add(this._instantiationService.createInstance(zo,this._diffs,this._models,this._setVisible,this._canClose)),n=e.store.add(this._instantiationService.createInstance(zc,this._parentNode,i,this._width,this._height,this._models));return{model:i,view:n}}).recomputeInitiallyAndOnChange(this._store)}next(){aM(e=>{let t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){aM(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){aM(e=>{this._setVisible(!1,e)})}};zr=ze([zt(8,he)],zr);let zo=class extends ro.JT{constructor(e,t,i,n,s){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=n,this._accessibilitySignalService=s,this._groups=aU(this,[]),this._currentGroupIdx=aU(this,0),this._currentElementIdx=aU(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((e,t)=>this._groups.read(t)[e]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((e,t)=>this.currentGroup.read(t)?.lines[e]),this._register(aN(e=>{let t=this._diffs.read(e);if(!t){this._groups.set([],void 0);return}let i=function(e,t,i){let n=[];for(let s of(0,as.mw)(e,(e,t)=>t.modified.startLineNumber-e.modified.endLineNumberExclusive<6)){let e=[];e.push(new zl);let r=new c5(Math.max(1,s[0].original.startLineNumber-3),Math.min(s[s.length-1].original.endLineNumberExclusive+3,t+1)),o=new c5(Math.max(1,s[0].modified.startLineNumber-3),Math.min(s[s.length-1].modified.endLineNumberExclusive+3,i+1));(0,as.zy)(s,(t,i)=>{let n=new c5(t?t.original.endLineNumberExclusive:r.startLineNumber,i?i.original.startLineNumber:r.endLineNumberExclusive),s=new c5(t?t.modified.endLineNumberExclusive:o.startLineNumber,i?i.modified.startLineNumber:o.endLineNumberExclusive);n.forEach(t=>{e.push(new zu(t,s.startLineNumber+(t-n.startLineNumber)))}),i&&(i.original.forEach(t=>{e.push(new zh(i,t))}),i.modified.forEach(t=>{e.push(new zd(i,t))}))});let a=s[0].modified.join(s[s.length-1].modified),l=s[0].original.join(s[s.length-1].original);n.push(new za(new go(a,l),e))}return n}(t,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());aM(e=>{let t=this._models.getModifiedPosition();if(t){let n=i.findIndex(e=>t?.lineNumber<e.range.modified.endLineNumberExclusive);-1!==n&&this._currentGroupIdx.set(n,e)}this._groups.set(i,e)})})),this._register(aN(e=>{let t=this.currentElement.read(e);t?.type===sn.Deleted?this._accessibilitySignalService.playSignal(Hf.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):t?.type===sn.Added&&this._accessibilitySignalService.playSignal(Hf.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(aN(e=>{let t=this.currentElement.read(e);if(t&&t.type!==sn.Header){let e=t.modifiedLineNumber??t.diff.modified.startLineNumber;this._models.modifiedSetSelection(s9.fromPositions(new s3(e,1)))}}))}_goToGroupDelta(e,t){let i=this.groups.get();i&&!(i.length<=1)&&aA(t,t=>{this._currentGroupIdx.set(cQ.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),t),this._currentElementIdx.set(0,t)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){let t=this.currentGroup.get();t&&!(t.lines.length<=1)&&aM(i=>{this._currentElementIdx.set(cQ.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){let t=this.currentGroup.get();if(!t)return;let i=t.lines.indexOf(e);-1!==i&&aM(e=>{this._currentElementIdx.set(i,e)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);let e=this.currentElement.get();e&&(e.type===sn.Deleted?this._models.originalReveal(s9.fromPositions(new s3(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==sn.Header?s9.fromPositions(new s3(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};zo=ze([zt(4,Hu)],zo),(tT=sn||(sn={}))[tT.Header=0]="Header",tT[tT.Unchanged=1]="Unchanged",tT[tT.Deleted=2]="Deleted",tT[tT.Added=3]="Added";class za{constructor(e,t){this.range=e,this.lines=t}}class zl{constructor(){this.type=sn.Header}}class zh{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=sn.Deleted,this.modifiedLineNumber=void 0}}class zd{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=sn.Added,this.originalLineNumber=void 0}}class zu{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=sn.Unchanged}}let zc=class extends ro.JT{constructor(e,t,i,n,s,r){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._models=s,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";let o=document.createElement("div");o.className="diff-review-actions",this._actionBar=this._register(new Pt(o)),this._register(aN(e=>{this._actionBar.clear(),this._model.canClose.read(e)&&this._actionBar.push(hd({id:"diffreview.close",label:(0,rh.NC)(100,"Close"),class:"close-diff-review "+iH.asClassName(zs),enabled:!0,run:async()=>t.close()}),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new bi(this._content,{})),lD(this.domNode,this._scrollbar.getDomNode(),o),this._register(aN(e=>{this._height.read(e),this._width.read(e),this._scrollbar.scanDomNode()})),this._register((0,ro.OF)(()=>{lD(this.domNode)})),this._register(H4(this.domNode,{width:this._width,height:this._height})),this._register(H4(this._content,{width:this._width,height:this._height})),this._register(aT((e,t)=>
671{this._model.currentGroup.read(e),this._render(t)})),this._register(a7(this.domNode,"keydown",e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._model.goToNextLine()),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._model.goToPreviousLine()),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this._model.close()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){let t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",(0,rh.NC)(101,"Accessible Diff Viewer. Use arrow up and down to navigate.")),l5(n,i.get(59)),lD(this._content,n);let s=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!s||!r)return;let o=s.getOptions(),a=r.getOptions(),l=i.get(75),h=this._model.currentGroup.get();for(let d of h?.lines||[]){let u;if(!h)break;if(d.type===sn.Header){let e=document.createElement("div");e.className="diff-review-row",e.setAttribute("role","listitem");let t=h.range,i=this._model.currentGroupIndex.get(),n=this._model.groups.get().length,s=e=>0===e?(0,rh.NC)(102,"no lines changed"):1===e?(0,rh.NC)(103,"1 line changed"):(0,rh.NC)(104,"{0} lines changed",e),r=s(t.original.length),o=s(t.modified.length);e.setAttribute("aria-label",(0,rh.NC)(105,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",i+1,n,t.original.startLineNumber,r,t.modified.startLineNumber,o));let a=document.createElement("div");a.className="diff-review-cell diff-review-summary",a.appendChild(document.createTextNode(`${i+1}/${n}: @@ -${t.original.startLineNumber},${t.original.length} +${t.modified.startLineNumber},${t.modified.length} @@`)),e.appendChild(a),u=e}else u=this._createRow(d,l,this._width.get(),t,s,o,i,r,a);n.appendChild(u);let c=ay(e=>this._model.currentElement.read(e)===d);e.add(aN(e=>{let t=c.read(e);u.tabIndex=t?0:-1,t&&u.focus()})),e.add(a6(u,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,s,r,o,a,l){let h;let d=n.get(165),u=d.glyphMarginWidth+d.lineNumbersWidth,c=o.get(165),g=10+c.glyphMarginWidth+c.lineNumbersWidth,f="diff-review-row",m="",p=null;switch(e.type){case sn.Added:f="diff-review-row line-insert",m=" char-insert",p=zi;break;case sn.Deleted:f="diff-review-row line-delete",m=" char-delete",p=zn}let _=document.createElement("div");_.style.minWidth=i+"px",_.className=f,_.setAttribute("role","listitem"),_.ariaLevel="";let v=document.createElement("div");v.className="diff-review-cell",v.style.height=`${t}px`,_.appendChild(v);let b=document.createElement("span");b.style.width=u+"px",b.style.minWidth=u+"px",b.className="diff-review-line-number"+m,void 0!==e.originalLineNumber?b.appendChild(document.createTextNode(String(e.originalLineNumber))):b.innerText="\xa0",v.appendChild(b);let C=document.createElement("span");C.style.width=g+"px",C.style.minWidth=g+"px",C.style.paddingRight="10px",C.className="diff-review-line-number"+m,void 0!==e.modifiedLineNumber?C.appendChild(document.createTextNode(String(e.modifiedLineNumber))):C.innerText="\xa0",v.appendChild(C);let w=document.createElement("span");if(w.className="diff-review-spacer",p){let e=document.createElement("span");e.className=iH.asClassName(p),e.innerText="\xa0\xa0",w.appendChild(e)}else w.innerText="\xa0\xa0";if(v.appendChild(w),void 0!==e.modifiedLineNumber){let t=this._getLineHtml(a,o,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);zr._ttPolicy&&(t=zr._ttPolicy.createHTML(t)),v.insertAdjacentHTML("beforeend",t),h=a.getLineContent(e.modifiedLineNumber)}else{let t=this._getLineHtml(s,n,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);zr._ttPolicy&&(t=zr._ttPolicy.createHTML(t)),v.insertAdjacentHTML("beforeend",t),h=s.getLineContent(e.originalLineNumber)}0===h.length&&(h=(0,rh.NC)(106,"blank"));let y="";switch(e.type){case sn.Unchanged:y=e.originalLineNumber===e.modifiedLineNumber?(0,rh.NC)(107,"{0} unchanged line {1}",h,e.originalLineNumber):(0,rh.NC)(108,"{0} original line {1} modified line {2}",h,e.originalLineNumber,e.modifiedLineNumber);break;case sn.Added:y=(0,rh.NC)(109,"+ {0} modified line {1}",h,e.modifiedLineNumber);break;case sn.Deleted:y=(0,rh.NC)(110,"- {0} original line {1}",h,e.originalLineNumber)}return _.setAttribute("aria-label",y),_}_getLineHtml(e,t,i,n,s){let r=e.getLineContent(n),o=t.get(59),a=t.get(117).verticalScrollbarSize,l=fL.createEmpty(r,s),h=fj.isBasicASCII(r,e.mightContainNonBasicASCII()),d=fj.containsRTL(r,h,e.mightContainRTL());return fW(new fA(o.isMonospace&&!t.get(40),o.canUseHalfwidthRightwardsArrow,r,!1,h,d,0,l,[],i,0,o.spaceWidth,o.middotWidth,o.wsmiddotWidth,t.get(133),t.get(113),t.get(108),t.get(60)!==sh.n0.OFF,null,null,a)).html}};zc=ze([zt(5,uR)],zc);class zg{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focu
671s()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}mM("diffEditor.move.border","#8b8b8b9c",(0,rh.NC)(137,"The border color for text that got moved in the diff editor.")),mM("diffEditor.moveActive.border","#FFA500",(0,rh.NC)(138,"The active border color for text that got moved in the diff editor.")),mM("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},(0,rh.NC)(139,"The color of the shadow around unchanged region widgets."));let zf=WL("diff-insert",rr.add,(0,rh.NC)(140,"Line decoration for inserts in the diff editor.")),zm=WL("diff-remove",rr.remove,(0,rh.NC)(141,"Line decoration for removals in the diff editor.")),zp=Nk.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+iH.asClassName(zf),marginClassName:"gutter-insert"}),z_=Nk.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+iH.asClassName(zm),marginClassName:"gutter-delete"}),zv=Nk.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),zb=Nk.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),zC=Nk.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),zw=Nk.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),zy=Nk.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),zS=Nk.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),zL=Nk.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),zx=Nk.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});var zk=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},zN=function(e,t){return function(i,n){t(i,n,e)}};let zD=ht("diffProviderFactoryService"),zE=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(zT,e)}};uP(zD,zE=zk([zN(0,he)],zE),1);let zT=class{static{ss=this}static{this.diffCache=new Map}constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new sd.Q5,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){this.diffAlgorithmOnDidChangeSubscription?.dispose()}async computeDiff(e,t,i,n){if("string"!=typeof this.diffAlgorithm)return this.diffAlgorithm.computeDiff(e,t,i,n);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return 1===t.getLineCount()&&1===t.getLineMaxColumn(1)?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new gh(new c5(1,2),new c5(1,t.getLineCount()+1),[new gd(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};let s=JSON.stringify([e.uri.toString(),t.uri.toString()]),r=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),o=ss.diffCache.get(s);if(o&&o.context===r)return o.result;let a=ck.G.create(),l=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),h=a.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:l?.quitEarly??!0,detectedMoves:i.computeMoves?l?.moves.length??0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!l)throw Error("no diff result available");return ss.diffCache.size>10&&ss.diffCache.delete(ss.diffCache.keys().next().value),ss.diffCache.set(s,{result:l,context:r}),l}setOptions(e){let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription?.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,"string"!=typeof e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>
671this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}};function zI(e,t,i=iP.ofCaller()){return new zM("string"==typeof e?e:new ad(e,void 0,void 0),t,i)}zT=ss=zk([zN(1,P_),zN(2,da)],zT);class zM extends av{constructor(e,t,i){super(i),this.event=t,this.handleEvent=()=>{aM(e=>{for(let t of this._observers)e.updateObserver(t,this),t.handleChange(this,void 0)},()=>this.debugName)},this.debugName="string"==typeof e?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}let zR=class extends ro.JT{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=aU(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=aU(this,void 0),this.diff=this._diff,this._unchangedRegions=aU(this,void 0),this.unchangedRegions=ay(this,e=>this._options.hideUnch
671angedRegions.read(e)?this._unchangedRegions.read(e)?.regions??[]:(aM(e=>{for(let t of this._unchangedRegions.read(void 0)?.regions||[])t.collapseAll(e)}),[])),this.movedTextToCompare=aU(this,void 0),this._activeMovedText=aU(this,void 0),this._hoveredMovedText=aU(this,void 0),this.activeMovedText=ay(this,e=>this.movedTextToCompare.read(e)??this._hoveredMovedText.read(e)??this._activeMovedText.read(e)),this._cancellationTokenSource=new sg,this._diffProvider=ay(this,e=>{let t=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(e)}),i=zI("onDidChange",t.onDidChange);return{diffProvider:t,onChangeSignal:i}}),this._register((0,ro.OF)(()=>this._cancellationTokenSource.cancel()));let n=ky("contentChangedSignal"),s=this._register(new oK(()=>n.trigger(void 0),200));this._register(aN(t=>{let i=this._unchangedRegions.read(t);if(!i||i.regions.some(e=>e.isDragged.read(t)))return;let n=i.originalDecorationIds.map(t=>e.original.getDecorationRange(t)).map(e=>e?c5.fromRangeInclusive(e):void 0),s=i.modifiedDecorationIds.map(t=>e.modified.getDecorationRange(t)).map(e=>e?c5.fromRangeInclusive(e):void 0),r=i.regions.map((e,i)=>n[i]&&s[i]?new zP(n[i].startLineNumber,s[i].startLineNumber,n[i].length,e.visibleLineCountTop.read(t),e.visibleLineCountBottom.read(t)):void 0).filter(re.$K),o=[],a=!1;for(let e of(0,as.mw)(r,(e,i)=>e.getHiddenModifiedRange(t).endLineNumberExclusive===i.getHiddenModifiedRange(t).startLineNumber))if(e.length>1){a=!0;let t=e.reduce((e,t)=>e+t.lineCount,0),i=new zP(e[0].originalLineNumber,e[0].modifiedLineNumber,t,e[0].visibleLineCountTop.read(void 0),e[e.length-1].visibleLineCountBottom.read(void 0));o.push(i)}else o.push(e[0]);if(a){let t=e.original.deltaDecorations(i.originalDecorationIds,o.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),n=e.modified.deltaDecorations(i.modifiedDecorationIds,o.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));aM(e=>{this._unchangedRegions.set({regions:o,originalDecorationIds:t,modifiedDecorationIds:n},e)})}}));let r=(t,i,n)=>{let s;let r=zP.fromDiffs(t.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnch
671angedRegionsMinimumLineCount.read(n),this._options.hideUnchangedRegionsContextLineCount.read(n)),o=this._unchangedRegions.get();if(o){var a,l;let t;let i=o.originalDecorationIds.map(t=>e.original.getDecorationRange(t)).map(e=>e?c5.fromRangeInclusive(e):void 0),r=o.modifiedDecorationIds.map(t=>e.modified.getDecorationRange(t)).map(e=>e?c5.fromRangeInclusive(e):void 0),h=(a=o.regions.map((e,t)=>{if(!i[t]||!r[t])return;let n=i[t].length;return new zP(i[t].startLineNumber,r[t].startLineNumber,n,Math.min(e.visibleLineCountTop.get(),n),Math.min(e.visibleLineCountBottom.get(),n-e.visibleLineCountTop.get()))}).filter(re.$K),l=(e,t)=>!t||e.modifiedLineNumber>=t.modifiedLineNumber+t.lineCount&&e.originalLineNumber>=t.originalLineNumber+t.lineCount,a.filter(e=>{let i=l(e,t);return t=e,i})).map(e=>new go(e.getHiddenOriginalRange(n),e.getHiddenModifiedRange(n)));h=go.clip(h,c5.ofLength(1,e.original.getLineCount()),c5.ofLength(1,e.modified.getLineCount())),s=go.inverse(h,e.original.getLineCount(),e.modified.getLineCount())}let h=[];if(s)for(let e of r){let t=s.filter(t=>t.original.intersectsStrict(e.originalUnchangedRange)&&t.modified.intersectsStrict(e.modifiedUnchangedRange));h.push(...e.setVisibleRanges(t,i))}else h.push(...r);let d=e.original.deltaDecorations(o?.originalDecorationIds||[],h.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),u=e.modified.deltaDecorations(o?.modifiedDecorationIds||[],h.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:h,originalDecorationIds:d,modifiedDecorationIds:u},i)};this._register(e.modified.onDidChangeContent(t=>{this._diff.get()&&(LH.fromModelContentChanges(t.changes),this._lastDiff,e.original,e.modified),this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(e.original.onDidChangeContent(t=>{this._diff.get()&&(LH.fromModelContentChanges(t.changes),this._lastDiff,e.original,e.modified),this._isDiffUpToDate.set(!1,void 0),s.schedule()})),this._register(aT(async(t,i)=>
671{this._options.hideUnchangedRegionsMinimumLineCount.read(t),this._options.hideUnchangedRegionsContextLineCount.read(t),s.cancel(),n.read(t);let o=this._diffProvider.read(t);o.onChangeSignal.read(t),this._isDiffUpToDate.set(!1,void 0);let a=[];i.add(e.original.onDidChangeContent(e=>{let t=LH.fromModelContentChanges(e.changes);a=xd(a,t)}));let l=[];i.add(e.modified.onDidChangeContent(e=>{let t=LH.fromModelContentChanges(e.changes);l=xd(l,t)}));let h=await o.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(t),maxComputationTimeMs:this._options.maxComputationTimeMs.read(t),computeMoves:this._options.showMoves.read(t)},this._cancellationTokenSource.token);if(!(this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed())){var d,u,c,g,f,m,p,_,v,b,C;h=(_=h=(g=(d=h,u=e.original,c=e.modified,h={changes:d.changes.map(e=>new gh(e.original,e.modified,e.innerChanges?e.innerChanges.map(e=>{let t,i;return t=e.originalRange,i=e.modifiedRange,1===t.startColumn&&1===i.startColumn&&(1!==t.endColumn||1!==i.endColumn)&&t.endColumn===u.getLineMaxColumn(t.endLineNumber)&&i.endColumn===c.getLineMaxColumn(i.endLineNumber)&&t.endLineNumber<u.getLineCount()&&i.endLineNumber<c.getLineCount()&&(t=t.setEndPosition(t.endLineNumber+1,1),i=i.setEndPosition(i.endLineNumber+1,1)),new gd(t,i)}):void 0)),moves:d.moves,identical:d.identical,quitEarly:d.quitEarly}),f=0,m=e.original,(void(p=e.modified))??h),v=0,b=e.original,(void(C=e.modified))??h),aM(e=>{r(h,e),this._lastDiff=h;let t=zA.fromDiffResult(h);this._diff.set(t,e),this._isDiffUpToDate.set(!0,e);let i=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(i?this._lastDiff.moves.find(e=>e.lineRangeMapping.modified.intersect(i.lineRangeMapping.modified)):void 0,e)})}}))}ensureModifiedLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length!==0){for(let n of this._unchangedRegions.get()?.regions||[])if(n.getHiddenModifiedRange(void 0).contains(e)){n.showModifiedLine(e,t,i);return}}}ensureOriginalLineIsVisible(e,t,i){if(this.diff.get()?.mappings.length!==0){for(let n of this._unchangedRegions.get()?.regions||[])if(n.getHiddenOriginalRange(void 0).contains(e)){n.showOriginalLine(e,t,i);return}}}async waitForDiff(){var e,t;await (e=this.isDiffUpToDate,(t=e=>e)||(t=e=>null!=e),new Promise((i,n)=>{let s=!0,r=!1,o=e.map(e=>({isFinished:t(e),error:!1,state:e})),a=aN(e=>{let{isFinished:t,error:l,state:h}=o.read(e);(t||l)&&(s?r=!0:a.dispose(),l?n(!0===l?h:l):i(h))});s=!1,r&&a.dispose()}))}serializeState(){let e=this._unchangedRegions.get();return{collapsedRegions:e?.regions.map(e=>({range:e.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){let t=e.collapsedRegions?.map(e=>c5.deserialize(e.range)),i=this._unchangedRegions.get();i&&t&&aM(e=>{for(let n of i.regions)for(let i of t)if(n.modifiedUnchangedRange.intersect(i)){n.setHiddenModifiedRange(i,e);break}})}};zR=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){zD(e,t,2)}],zR);class zA{static fromDiffResult(e){return new zA(e.changes.map(e=>new zO(e)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class zO{constructor(e){this.lineRangeMapping=e}}class zP{static fromDiffs(e,t,i,n,s){let r=gh.inverse(e,t,i),o=[];for(let e of r){let r=e.original.startLineNumber,a=e.modified.startLineNumber,l=e.original.length,h=1===r&&1===a,d=r+l===t+1&&a+l===i+1;(h||d)&&l>=s+n?(h&&!d&&(l-=s),d&&!h&&(r+=s,a+=s,l-=s),o.push(new zP(r,a,l,0,0))):l>=2*s+n&&(r+=s,a+=s,l-=2*s,o.push(new zP(r,a,l,0,0)))}return o}get originalUnchangedRange(){return c5.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return c5.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,s){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=aU(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=aU(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=ay(this,e=>this.visibleLineCountTop.read(e)+this.visibleLineCountBottom.read(e)===this.lineCount&&!this.isDragged.read(e)),this.isDragged=aU(this,void 0);let r=Math.max(Math.min(n,this.lineCount),0),o=Math.max(Math.min(s,this.lineCount-n),0);(0,ab.wN)(n===r),(0,ab.wN)(s===o),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(o,void 0)}setVisibleRanges(e,t){let i=[],n=new c4(e.map(e=>e.modified)).subtractFrom(this.modifiedUnchangedRange),s=this.originalLineNumber,r=this.modifiedLineNumber,o=this.modifiedLineNumber+this.lineCount;if(0===n.ranges.length)this.showAll(t),i.push(this);else{let e=0;for(let a of n.ranges){let l=e===n.ranges.length-1;e++;let h=(l?o:a.endLineNumberExclusive)-r,d=new zP(s,r,h,0,0);d.setHiddenModifiedRange(a,t),i.push(d),s=d.originalUnchangedRange.endLineNumberExclusive,r=d.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return c5.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return c5.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){let i=e.startLineNumber-this.modifiedLineNumber,n=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,n,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){let i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){let i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){let n=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;0===t&&n<s||1===t?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+n,i):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+s,i)}showOriginalLine(e,t,i){let n=e-this.originalLineNumber,s=this.originalLineNumber+this.lineCount-e;0===t&&n<s||1===t?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+s-n,this.getMaxVisibleLineCountTop()),i):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+n-s,this.getMaxVisibleLineCountBottom()),i)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,t,i){e=Math.max(Math.min(e,this.lineCount),0),t=Math.max(Math.min(t,this.lineCount-e),0),this._visibleLineCountTop.set(e,i),this._visibleLineCountBottom.set(t,i)}}class zF extends ro.JT{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,n,s,r,o,a,l,h){super(),this._getViewZoneId=e,this._marginDomNode=t,this._deletedCodeDomNode=i,this._modifiedEditor=n,this._diff=s,this._editor=r,this._renderLinesResult=o,this._originalTextModel=a,this._contextMenuService=l,this._clipboardService=h,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=iH.asClassName(rr.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";let d=this._modifiedEditor.getOption(75);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${d}px`,this._diffActions.style.lineHeight=`${d}px`,this._marginDomNode.appendChild(this._diffActions);let u=0,c=n.getOption(144)&&!sS.gn,g=(e,t,i)=>{this._contextMenuService.showContextMenu({domForShadowRoot:c?n.getDomNode()??void 0:void 0,getAnchor:()=>e,onHide:i,getActions:()=>{let e=[],t=s.modified.isEmpty;return e.push(new hr("diff.clipboard.copyDeletedContent",t?s.original.length>1?(0,rh.NC)(112,"Copy deleted lines"):(0,rh.NC)(113,"Copy deleted line"):s.original.length>1?(0,rh.NC)(114,"Copy changed lines"):(0,rh.NC)(115,"Copy changed line"),void 0,!0,async()=>{let e=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());await this._clipboardService.writeText(e)}
671)),s.original.length>1&&e.push(new hr("diff.clipboard.copyDeletedLineContent",t?(0,rh.NC)(116,"Copy deleted line ({0})",s.original.startLineNumber+u):(0,rh.NC)(117,"Copy changed line ({0})",s.original.startLineNumber+u),void 0,!0,async()=>{let e=this._originalTextModel.getLineContent(s.original.startLineNumber+u);""===e&&(e=0===this._originalTextModel.getEndOfLineSequence()?"\n":"\r\n"),await this._clipboardService.writeText(e)})),n.getOption(104)||e.push(new hr("diff.inline.revertChange",(0,rh.NC)(118,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),e},autoSelectFirstItem:!0})};this._register(a7(this._diffActions,"mousedown",e=>{if(!e.leftButton)return;let{top:t,height:i}=ls(this._diffActions),n=Math.floor(d/3);e.preventDefault(),g({x:e.posx,y:t+i+n})})),this._register(n.onMouseMove(e=>{(8===e.target.type||5===e.target.type)&&e.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(function(e){let{domNode:t,renderLinesResult:i,diffEntry:n,originalModel:s,clipboardService:r}=e,o=new ro.SL;return o.add(a6(t,"copy",e=>{e.preventDefault();let o=t.ownerDocument.getSelection();if(!o||0===o.rangeCount)return;let a=o.getRangeAt(0);if(!a||a.collapsed)return;let l=a.startContainer.nodeType===Node.TEXT_NODE?a.startContainer.parentElement:a.startContainer,h=a.endContainer.nodeType===Node.TEXT_NODE?a.endContainer.parentElement:a.endContainer;if(!l||!h)return;let d=i.getModelPositionAt(l,a.startOffset),u=i.getModelPositionAt(h,a.endOffset);if(!d||!u)return;let c=d.delta(n.original.startLineNumber-1),g=u.delta(n.original.startLineNumber-1),f=g.isBefore(c)?s9.fromPositions(g,c):s9.fromPositions(c,g),m=s.getValueInRange(f);r.writeText(m)})),o}
671({domNode:this._deletedCodeDomNode,diffEntry:s,originalModel:this._originalTextModel,renderLinesResult:this._renderLinesResult,clipboardService:h}))}_updateLightBulbPosition(e,t,i){let{top:n}=ls(e),s=Math.floor((t-n)/i);if(this._diffActions.style.top=`${s*i}px`,this._renderLinesResult.viewLineCounts){let e=0;for(let t=0;t<this._renderLinesResult.viewLineCounts.length;t++)if(s<(e+=this._renderLinesResult.viewLineCounts[t]))return t}return s}}let zB=ut("diffEditorWidget",{createHTML:e=>e});class zV{constructor(e,t=e.map(e=>null),i=!0,n=!0){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class zW{static fromEditor(e){let t=e.getOptions(),i=t.get(59),n=t.get(165);return new zW(e.getModel()?.getOptions().tabSize||0,i,t.get(40),i.typicalHalfwidthCharacterWidth,t.get(118),t.get(75),n.decorationsWidth,t.get(133),t.get(113),t.get(108),t.get(60),t.get(117).verticalScrollbarSize)}constructor(e,t,i,n,s,r,o,a,l,h,d,u,c=!0){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=s,this.lineHeight=r,this.lineDecorationsWidth=o,this.stopRenderingLineAfter=a,this.renderWhitespace=l,this.renderControlCharacters=h,this.fontLigatures=d,this.verticalScrollbarSize=u,this.setWidth=c}withSetWidth(e){return new zW(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,e)}withScrollBeyondLastColumn(e){return new zW(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,e,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}}class zH{constructor(e,t,i,n,s){this.heightInLines=e,this.minWidthInPx=t,this.viewLineCounts=i,this._renderOutputs=n,this._source=s}getModelPositionAt(e,t){let i=e;for(;i&&!i.classList.contains("view-line");)i=i.parentElement;if(!i)return;let n=i.parentElement;if(!n)return;let s=n.querySelectorAll(".view-line"),r=-1;for(let e=0;e<s.length;e++)if(s[e]===i){r=e;break}if(-1===r||r>=this._renderOutputs.length)return;let o=1,a=r;for(let e=0;e<this.viewLineCounts.length;e++){if(a<this.viewLineCounts[e]){o=e+1;break}a-=this.viewLineCounts[e]}if(o>this._source.lineTokens.length)return;let l=this._renderOutputs[r];if(l)return new s3(o,vM(l.characterMapping,e,t)+l.offset)}}class zz extends fF{constructor(e,t,i){super(e,t),this.offset=i}}
671function zU(e,t,i,n,s,r,o,a,l){a.appendString('<div class="view-line'),l||n||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(e*o.lineHeight)),o.setWidth?a.appendString('px;width:1000000px;">'):a.appendString('px;">');let h=t.getLineContent(),d=fj.isBasicASCII(h,s),u=fj.containsRTL(h,d,r),c=fB(new fA(o.fontInfo.isMonospace&&!o.disableMonospaceOptimizations,o.fontInfo.canUseHalfwidthRightwardsArrow,h,!1,d,u,0,t,i,o.tabSize,0,o.fontInfo.spaceWidth,o.fontInfo.middotWidth,o.fontInfo.wsmiddotWidth,o.stopRenderingLineAfter,o.renderWhitespace,o.renderControlCharacters,o.fontLigatures!==sh.n0.OFF,null,null,o.verticalScrollbarSize),a);a.appendString("</div>");let g=c.characterMapping.getHorizontalOffset(c.characterMapping.length);return{output:c,maxCharWidth:g}}var zK=function(e,t){return function(i,n){t(i,n,e)}};let z$=class extends ro.JT{constructor(e,t,i,n,s,r,o,a,l,h){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=n,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=o,this._modViewZonesToIgnore=a,this._clipboardService=l,this._contextMenuService=h,this._originalTopPadding=aU(this,0),this._originalScrollOffset=aU(this,0),this._originalScrollOffsetAnimated=H1(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=aU(this,0),this._modifiedScrollOffset=aU(this,0),this._modifiedScrollOffsetAnimated=H1(this._targetWindow,this._modifiedScrollOffset,this._store);let d=aU("invalidateAlignmentsState",0),u=this._register(new oK(()=>{d.set(d.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(e=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(e=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(e=>
671{(e.hasChanged(166)||e.hasChanged(75))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(e=>{(e.hasChanged(166)||e.hasChanged(75))&&u.schedule()}));let c=this._diffModel.map(e=>e?aP(this,e.model.original.onDidChangeTokens,()=>2===e.model.original.tokenization.backgroundTokenizationState):void 0).map((e,t)=>e?.read(t)),g=ay(e=>{let t=this._diffModel.read(e),i=t?.diff.read(e);if(!t||!i)return null;d.read(e);let n=this._options.renderSideBySide.read(e);return zj(this._editors.original,this._editors.modified,i.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,n)}),f=ay(e=>{let t=this._diffModel.read(e)?.movedTextToCompare.read(e);if(!t)return null;d.read(e);let i=t.changes.map(e=>new zO(e));return zj(this._editors.original,this._editors.modified,i,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function m(){let e=document.createElement("div");return e.className="diagonal-fill",e}let p=this._register(new ro.SL);this.viewZones=ay(this,e=>{p.clear();let t=g.read(e)||[],i=[],n=[],r=this._modifiedTopPadding.read(e);r>0&&n.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:r,showInHiddenAreas:!0,suppressMouseDown:!0});let o=this._originalTopPadding.read(e);o>0&&i.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:o,showInHiddenAreas:!0,suppressMouseDown:!0});let a=this._options.renderSideBySide.read(e),l=a?void 0:this._editors.modified._getViewModel()?.createLineBreaksComputer();if(l){let e=this._editors.original.getModel();for(let s of t)if(s.diff)for(let t=s.originalRange.startLineNumber;t<s.originalRange.endLineNumberExclusive;t++){if(t>e.getLineCount())return{orig:i,mod:n};l?.addRequest(e.getLineContent(t),null,null)}}let h=l?.finalize()??[],d=0,u=this._editors.modified.getOption(75),_=this._diffModel.read(e)?.movedTextToCompare.read(e),v=this._editors.original.getModel()?.mightContainNonBasicASCII()??!1,b=this._editors.original.getModel()?.mightContainRTL()??!1,C=zW.fromEditor(this._editors.modified);for(let r of t)if(!r.diff||a||this._options.useTrueInlineDiffRendering.read(e)&&zG(r.diff)){let t=r.modifiedHeightInPx-r.originalHeightInPx;if(t>0){if(_?.lineRangeMapping.original.delta(-1).deltaLength(2).contains(r.originalRange.endLineNumberExclusive-1))continue;i.push({afterLineNumber:r.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:t,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let i;if(_?.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(r.modifiedRange.endLineNumberExclusive-1))continue;r.diff&&r.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(e)&&(i=function(){let t=document.createElement("div");return t.className="arrow-revert-change "+iH.asClassName(rr.arrowRight),e.store.add(a6(t,"mousedown",e=>e.stopPropagation())),e.store.add(a6(t,"click",e=>{e.stopPropagation(),s.revert(r.diff)})),lI("div",{},t)}()),n.push({afterLineNumber:r.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-t,marginDomNode:i,showInHiddenAreas:!0,suppressMouseDown:!0})}}else{if(!r.originalRange.isEmpty){let t;c.read(e);let s=document.createElement("div");s.classList.add("view-lines","line-delete","line-delete-selectable","monaco-mouse-cursor-text");let o=this._editors.original.getModel();if(r.originalRange.endLineNumberExclusive-1>o.getLineCount())return{orig:i,mod:n};let a=new zV(r.originalRange.mapToLineArray(e=>o.tokenization.getLineTokens(e)),r.originalRange.mapToLineArray(e=>h[d++]),v,b),l=[];for(let e of r.diff.innerChanges||[])l.push(new DR(e.originalRange.delta(-(r.diff.original.startLineNumber-1)),zS.className,0));let g=function(e,t,i,n,s=!1){l5(n,t.fontInfo);let r=i.length>0,o=new um(1e4),a=0,l=0,h=[],d=[];for(let n=0;n<e.lineTokens.length;n++){let u=n+1,c=e.lineTokens[n],g=e.lineBreakData[n],f=fE.filter(i,u,1,Number.MAX_SAFE_INTEGER);if(g){let i=0;for(let n of g.breakOffsets){let h=zU(l,c.sliceAndInflate(i,n,0),fE.extractWrapped(f,i,n),r,e.mightContainNonBasicASCII,e.mightContainRTL,t,o,s);a=Math.max(a,h.maxCharWidth),d.push(new zz(h.output.characterMapping,h.output.containsForeignElements,i)),l++,i=n}h.push(g.breakOffsets.length)}else{h.push(1);let i=zU(l,c,f,r,e.mightContainNonBasicASCII,e.mightContainRTL,t,o,s);a=Math.max(a,i.maxCharWidth),d.push(new zz(i.output.characterMapping,i.output.containsForeignElements,0)),l++}}a+=t.scrollBeyondLastColumn;let u=o.build(),c=zB?zB.createHTML(u):u;return n.innerHTML=c,new zH(l,a*t.typicalHalfwidthCharacterWidth,h,d,e)}(a,C,l,s),f=document.createElement("div");if(f.className="inline-deleted-margin-view-zone",l5(f,C.fontInfo),this._options.renderIndicators.read(e))for(let e=0;e<g.heightInLines;e++){let t=document.createElement("div");t.className=`delete-sign ${iH.asClassName(zm)}`,t.setAttribute("style",`position:absolute;top:${e*u}px;width:${C.lineDecorationsWidth}px;height:${u}px;right:0;`),f.appendChild(t)}p.add(new zF(()=>(0,re.d9)(t),f,s,this._editors.modified,r.diff,this._diffEditorWidget,g,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let e=0;e<g.viewLineCounts.length;e++){let t=g.viewLineCounts[e];t>1&&i.push({afterLineNumber:r.originalRange.startLineNumber+e,domNode:m(),heightInPx:(t-1)*u,showInHiddenAreas:!0,suppressMouseDown:!0})}n.push({afterLineNumber:r.modifiedRange.startLineNumber-1,domNode:s,heightInPx:g.heightInLines*u,minWidthInPx:g.minWidthInPx,marginDomNode:f,setZoneId(e){t
671=e},showInHiddenAreas:!0,suppressMouseDown:!1})}let t=document.createElement("div");t.className="gutter-delete",i.push({afterLineNumber:r.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:r.modifiedHeightInPx,marginDomNode:t,showInHiddenAreas:!0,suppressMouseDown:!0})}for(let t of f.read(e)??[]){if(!_?.lineRangeMapping.original.intersect(t.originalRange)||!_?.lineRangeMapping.modified.intersect(t.modifiedRange))continue;let e=t.modifiedHeightInPx-t.originalHeightInPx;e>0?i.push({afterLineNumber:t.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:e,showInHiddenAreas:!0,suppressMouseDown:!0}):n.push({afterLineNumber:t.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-e,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:i,mod:n}});let _=!1;this._register(this._editors.original.onDidScrollChange(e=>{e.scrollLeftChanged&&!_&&(_=!0,this._editors.modified.setScrollLeft(e.scrollLeft),_=!1)})),this._register(this._editors.modified.onDidScrollChange(e=>{e.scrollLeftChanged&&!_&&(_=!0,this._editors.original.setScrollLeft(e.scrollLeft),_=!1)})),this._originalScrollTop=aP(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=aP(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(aN(e=>{let t=this._originalScrollTop.read(e)-(this._originalScrollOffsetAnimated.read(void 0)-this._modifiedScrollOffsetAnimated.read(e))-(this._originalTopPadding.read(void 0)-this._modifiedTopPadding.read(e));t!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(t,1)})),this._register(aN(e=>{let t=this._modifiedScrollTop.read(e)-(this._modifiedScrollOffsetAnimated.read(void 0)-this._originalScrollOffsetAnimated.read(e))-(this._modifiedTopPadding.read(void 0)-this._originalTopPadding.read(e));t!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(t,1)})),this._register(aN(e=>{let t=this._diffModel.read(e)?.movedTextToCompare.read(e),i=0;if(t){let e=this._editors.original.getTopForLineNumber(t.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.read(void 0);i=this._editors.modified.getTopForLineNumber(t.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.read(void 0)-e}i>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(i,void 0)):i<0?(this._modifiedTopPadding.set(-i,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0)-i,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0)+i,void 0,!0)}))}};function zj(e,t,i,n,s,r){let o=new as.H9(zq(e,n)),a=new as.H9(zq(t,s)),l=e.getOption(75),h=t.getOption(75),d=[],u=0,c=0;function g(e,t){for(;;){let i=o.peek(),n=a.peek();if(i&&i.lineNumber>=e&&(i=void 0),n&&n.lineNumber>=t&&(n=void 0),!i&&!n)break;let s=i?i.lineNumber-u:Number.MAX_VALUE,r=n?n.lineNumber-c:Number.MAX_VALUE;s<r?(o.dequeue(),n={lineNumber:i.lineNumber-u+c,heightInPx:0}):s>r?(a.dequeue(),i={lineNumber:n.lineNumber-c+u,heightInPx:0}):(o.dequeue(),a.dequeue()),d.push({originalRange:c5.ofLength(i.lineNumber,1),modifiedRange:c5.ofLength(n.lineNumber,1),originalHeightInPx:l+i.heightInPx,modifiedHeightInPx:h+n.heightInPx,diff:void 0})}}for(let t of i){let i=t.lineRangeMapping;g(i.original.startLineNumber,i.modified.startLineNumber);let n=!0,s=i.modified.startLineNumber,m=i.original.startLineNumber;function f(e,i,r=!1){if(e<m||i<s)return;if(n)n=!1;else if(!r&&(e===m||i===s))return;let u=new c5(m,e),c=new c5(s,i);if(u.isEmpty&&c.isEmpty)return;let g=o.takeWhile(t=>t.lineNumber<e)?.reduce((e,t)=>e+t.heightInPx,0)??0,f=a.takeWhile(e=>e.lineNumber<i)?.reduce((e,t)=>e+t.heightInPx,0)??0;d.push({originalRange:u,modifiedRange:c,originalHeightInPx:u.length*l+g,modifiedHeightInPx:c.length*h+f,diff:t.lineRangeMapping}),m=e,s=i}if(r)for(let t of i.innerChanges||[]){t.originalRange.startColumn>1&&t.modifiedRange.startColumn>1&&f(t.originalRange.startLineNumber,t.modifiedRange.startLineNumber);let i=e.getModel(),n=t.originalRange.endLineNumber<=i.getLineCount()?i.getLineMaxColumn(t.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;t.originalRange.endColumn<n&&f(t.originalRange.endLineNumber,t.modifiedRange.endLineNumber)}f(i.original.endLineNumberExclusive,i.modified.endLineNumberExclusive,!0),u=i.original.endLineNumberExclusive,c=i.modified.endLineNumberExclusive}return g(Number.MAX_VALUE,Number.MAX_VALUE),d}function zq(e,t){let i=[],n=[],s=-1!==e.getOption(166).wrappingColumn,r=e._getViewModel().coordinatesConverter,o=e.getOption(75);if(s)for(let t=1;t<=e.getModel().getLineCount();t++){let e=r.getModelLineViewLineCount(t);e>1&&n.push({lineNumber:t,heightInPx:o*(e-1)})}
671for(let n of e.getWhitespaces()){if(t.has(n.id))continue;let e=0===n.afterLineNumber?0:r.convertViewPositionToModelPosition(new s3(n.afterLineNumber,1)).lineNumber;i.push({lineNumber:e,heightInPx:n.height})}return function(e,t,i,n){if(0===e.length)return t;if(0===t.length)return e;let s=[],r=0,o=0;for(;r<e.length&&o<t.length;){let a=e[r],l=t[o],h=i(a),d=i(l);h<d?(s.push(a),r++):(h>d?s.push(l):(s.push(n(a,l)),r++),o++)}for(;r<e.length;)s.push(e[r]),r++;for(;o<t.length;)s.push(t[o]),o++;return s}(i,n,e=>e.lineNumber,(e,t)=>({lineNumber:e.lineNumber,heightInPx:e.heightInPx+t.heightInPx}))}function zG(e){return!!e.innerChanges&&e.innerChanges.every(e=>zQ(e.modifiedRange)&&zQ(e.originalRange)||e.originalRange.equalsRange(new s9(1,1,1,1)))}function zQ(e){return e.startLineNumber===e.endLineNumber}z$=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([zK(8,WX),zK(9,Tu)],z$);class zY extends ro.JT{static{this.movedCodeBlockPadding=4}constructor(e,t,i,n,s){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=s,this._originalScrollTop=aP(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=aP(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=zI("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=aU(this,0),this._modifiedViewZonesChangedSignal=zI("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=zI("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=ay(this,e=>{this._element.replaceChildren();let t=this._diffModel.read(e),i=t?.diff.read(e)?.movedTexts;if(!i||0===i.length){this.width.set(0,void 0);return}this._viewZonesChanged.read(e);let n=this._originalEditorLayoutInfo.read(e),s=this._modifiedEditorLayoutInfo.read(e);if(!n||!s){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(e),this._originalViewZonesChangedSignal.read(e);let r=i.map(t=>{function i(e,t){return(t.getTopForLineNumber(e.startLineNumber,!0)+t.getTopForLineNumber(e.endLineNumberExclusive,!0))/2}let n=i(t.lineRangeMapping.original,this._editors.original),s=this._originalScrollTop.read(e),r=i(t.lineRangeMapping.modified,this._editors.modified),o=this._modifiedScrollTop.read(e);return{range:new cQ(Math.min(n,r),Math.max(n,r)),from:n-s,to:r-o,fromWithoutScroll:n,toWithoutScroll:r,move:t}});r.sort((0,as.f_)((0,as.tT)(e=>e.fromWithoutScroll>e.toWithoutScroll,as.nW),(0,as.tT)(e=>e.fromWithoutScroll>e.toWithoutScroll?e.fromWithoutScroll:-e.toWithoutScroll,as.fv)));let o=zJ.compute(r.map(e=>e.range)),a=n.verticalScrollbarWidth,l=(o.getTrackCount()-1)*10+20,h=a+l+(s.contentLeft-zY.movedCodeBlockPadding),d=0;for(let i of r){let n=a+10+10*o.getTrack(d),r=s.glyphMarginWidth+s.lineNumbersWidth,l=document.createElementNS("http://www.w3.org/2000/svg","rect");l.classList.add("arrow-rectangle"),l.setAttribute("x",`${h-r}`),l.setAttribute("y",`${i.to-9}`),l.setAttribute("width",`${r}`),l.setAttribute("height","18"),this._element.appendChild(l);let u=document.createElementNS("http://www.w3.org/2000/svg","g"),c=document.createElementNS("http://www.w3.org/2000/svg","path");c.setAttribute("d",`M 0 ${i.from} L ${n} ${i.from} L ${n} ${i.to} L ${h-15} ${i.to}`),c.setAttribute("fill","none"),u.appendChild(c);let g=document.createElementNS("http://www.w3.org/2000/svg","polygon");g.classList.add("arrow"),e.store.add(aN(e=>{c.classList.toggle("currentMove",i.move===t.activeMovedText.read(e)),g.classList.toggle("currentMove",i.move===t.activeMovedText.read(e))})),g.setAttribute("points",`${h-15},${i.to-7.5} ${h},${i.to} ${h-15},${i.to+7.5}`),u.appendChild(g),this._element.appendChild(u),d++}this.width.set(l,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register((0,ro.OF)(()=>this._element.remove())),this._register(aN(e=>{let t=this._originalEditorLayoutInfo.read(e),i=this._modifiedEditorLayoutInfo.read(e);t&&i&&(this._element.style.left=`${t.width-t.verticalScrollbarWidth}px`,this._element.style.height=`${t.height}px`,this._element.style.width=`${t.verticalScrollbarWidth+t.contentLeft-zY.movedCodeBlockPadding+this.width.read(e)}px`)})),this._register(aB(this._state));let r=ay(e=>{let t=this._diffModel.read(e),i=t?.diff.read(e);return i?i.movedTexts.map(e=>({move:e,original:new H2(Or(e.lineRangeMapping.original.startLineNumber-1),18),modified:new H2(Or(e.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(H6(this._editors.original,r.map(e=>e.map(e=>e.original)))),this._register(H6(this._editors.modified,r.map(e=>e.map(e=>
671e.modified)))),this._register(aT((e,t)=>{for(let i of r.read(e))t.add(new zZ(this._editors.original,i.original,i.move,"original",this._diffModel.get())),t.add(new zZ(this._editors.modified,i.modified,i.move,"modified",this._diffModel.get()))}));let o=zI("original.onDidFocusEditorWidget",e=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>e(void 0),0))),a=zI("modified.onDidFocusEditorWidget",e=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>e(void 0),0))),l="modified";this._register(aE({changeTracker:{createChangeSummary:()=>void 0,handleChange:(e,t)=>(e.didChange(o)&&(l="original"),e.didChange(a)&&(l="modified"),!0)}},e=>{let t;o.read(e),a.read(e);let i=this._diffModel.read(e);if(!i)return;let n=i.diff.read(e);if(n&&"original"===l){let i=this._editors.originalCursor.read(e);i&&(t=n.movedTexts.find(e=>e.lineRangeMapping.original.contains(i.lineNumber)))}if(n&&"modified"===l){let i=this._editors.modifiedCursor.read(e);i&&(t=n.movedTexts.find(e=>e.lineRangeMapping.modified.contains(i.lineNumber)))}t!==i.movedTextToCompare.read(void 0)&&i.movedTextToCompare.set(void 0,void 0),i.setActiveMovedText(t)}))}}class zJ{static compute(e){let t=[],i=[];for(let n of e){let e=t.findIndex(e=>!e.intersectsStrict(n));-1===e&&(t.length>=6?e=function(e,t){if(0===e.length)return -1;let i=0;for(let n=1;n<e.length;n++)t(e[n],e[i])>0&&(i=n);return i}(t,(0,as.tT)(e=>e.intersectWithRangeLength(n),as.fv)):(e=t.length,t.push(new cY))),t[e].addRange(n),i.push(e)}return new zJ(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class zZ extends H0{constructor(e,t,i,n,s){let r;let o=lV("div.diff-hidden-lines-widget");super(e,t,o.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=s,this._nodes=lV("div.diff-moved-code-block",{style:{marginRight:"4px"}},[lV("div.text-content@textContent"),lV("div.action-bar@actionBar")]),o.root.appendChild(this._nodes.root);let a=aP(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(H4(this._nodes.root,{paddingRight:a.map(e=>e.verticalScrollbarWidth)})),r=i.changes.length>0?"original"===this._kind?(0,rh.NC)(131,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):(0,rh.NC)(132,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):"original"===this._kind?(0,rh.NC)(133,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):(0,rh.NC)(134,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);let l=this._register(new Pt(this._nodes.actionBar,{highlightToggledItems:!0})),h=new hr("",r,"",!1);l.push(h,{icon:!1,label:!0});let d=new hr("","Compare",iH.asClassName(rr.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(aN(e=>{let t=this._diffModel.movedTextToCompare.read(e)===i;d.checked=t})),l.push(d,{icon:!1,label:!0})}}class zX extends ro.JT{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=ay(this,e=>{let t=this._diffModel.read(e),i=t?.diff.read(e);if(!i)return null;let n=this._diffModel.read(e).movedTextToCompare.read(e),s=this._options.renderIndicators.read(e),r=this._options.showEmptyDecorations.read(e),o=[],a=[];if(!n)for(let n of i.mappings)if(n.lineRangeMapping.original.isEmpty||o.push({range:n.lineRangeMapping.original.toInclusiveRange(),options:s?z_:zb}),n.lineRangeMapping.modified.isEmpty||a.push({range:n.lineRangeMapping.modified.toInclusiveRange(),options:s?zp:zv}),n.lineRangeMapping.modified.isEmpty||n.lineRangeMapping.original.isEmpty)n.lineRangeMapping.original.isEmpty||o.push({range:n.lineRangeMapping.original.toInclusiveRange(),options:zL}),n.lineRangeMapping.modified.isEmpty||a.push({range:n.lineRangeMapping.modified.toInclusiveRange(),options:zw});else{let i=this._options.useTrueInlineDiffRendering.read(e)&&zG(n.lineRangeMapping);for(let e of n.lineRangeMapping.innerChanges||[])if(n.lineRangeMapping.original.contains(e.originalRange.startLineNumber)&&o.push({range:e.originalRange,options:e.originalRange.isEmpty()&&r?zx:zS}),n.lineRangeMapping.modified.contains(e.modifiedRange.startLineNumber)&&a.push({range:e.modifiedRange,options:e.modifiedRange.isEmpty()&&r&&!i?zy:zC}),i){let i=t.model.original.getValueInRange(e.originalRange);a.push({range:e.modifiedRange,options:{description:"deleted-text",before:{content:i,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(n)for(let e of n.changes){let t=e.original.toInclusiveRange();t&&o.push({range:t,options:s?z_:zb});let i=e.modified.toInclusiveRange();for(let t of(i&&a.push({range:i,options:s?zp:zv}),e.innerChanges||[]))o.push({range:t.originalRange,options:zS}),a.push({range:t.modifiedRange,options:zC})}let l=this._diffModel.read(e).activeMovedText.read(e);for(let e of i.movedTexts)o.push({range:e.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(e===l?" currentMove":""),blockPadding:[zY.movedCodeBlockPadding,0,zY.movedCodeBlockPadding,zY.movedCodeBlockPadding]}}),a.push({range:e.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(e===l?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:o,modifiedDecorations:a}}),this._register(HJ(this._editors.original,this._decorations.map(e=>e?.originalDecorations||[]))),this._register(HJ(this._editors.modified,this._decorations.map(e=>e?.modifiedDecorations||[])))}}class z1{static equals(e,t){return e.x===t.x&&e.y===t.y}constructor(e,t){this.x=e,this.y=t}add(e){return new z1(this.x+e.x,this.y+e.y)}deltaX(e){return new z1(this.x+e,this.y)}deltaY(e){return new z1(this.x,this.y+e)}toString(){return`(${this.x},${this.y})`}subtract(e){return new z1(this.x-e.x,this.y-e.y)}scale(e){return new z1(this.x*e,this.y*e)}mapComponents(e){return new z1(e(this.x),e(this.y))}isZero(){return 0===this.x&&0===this.y}withThreshold(e){return this.mapComponents(t=>t>e?t-e:t<-e?t+e:0)}}function z0(e){return z2.get(e)}class z2 extends ro.JT{static{this._map=new Map}static get(e){let t=z2._map.get(e);if(!t){t=new z2(e),z2._map.set(e,t);let i=e.onDidDispose(()=>{let t=z2._map.get(e);t&&(z2._map.delete(e),t.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,1===this._updateCounter&&(this._currentTransaction=new aO(()=>{}))}_endUpdate(){if(this._updateCounter--,0===this._updateCounter){let e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=aU(this,this.editor.getModel()),this.model=this._model,this.isReadonly=aP(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(104)),this._versionId=kx({owner:this,lazy:!0},this.editor.getModel()?.getVersionId()??null),this.versionId=this._versionId,this._selections=kx({owner:this,equalsFn:ah(al(s8.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=aL({owner:this,equalsFn:ah(al(s3.equals))},e=>this.selections.read(e)?.map(e=>e.getStartPosition())??null),this.isFocused=aP(this,e=>{let t=this.editor.onDidFocusEditorWidget(e),i=this.editor.onDidBlurEditorWidget(e);return{dispose(){t.dispose(),i.dispose()}}},()=>this.editor.hasWidgetFocus()),this.isTextFocused=aP(this,e=>{let t=this.editor.onDidFocusEditorText(e),i=this.editor.onDidBlurEditorText(e);return{dispose(){t.dispose(),i.dispose()}}},()=>this.editor.hasTextFocus()),this.inComposition=aP(this,e=>{let t=this.editor.onDidCompositionStart(()=>{e(void 0)}),i=this.editor.onDidCompositionEnd(()=>{e(void 0)});return{dispose(){t.dispose(),i.dispose()}}},()=>this.editor.inComposition),this.value=aS(this,e=>(this.versionId.read(e),this.model.read(e)?.getValue()??""),(e,t)=>{let i=this.model.get();null!==i&&e!==i.getValue()&&i.setValue(e)}),this.valueIsEmpty=ay(this,e=>(this.versionId.read(e),this.editor.getModel()?.getValueLength()===0)),this.cursorSelection=aL({owner:this,equalsFn:ah(s8.selectionsEqual)},e=>this.selections.read(e)?.[0]??null),this.cursorPosition=aL({owner:this,equalsFn:s3.equals},e=>this.selections.read(e)?.[0]?.getPosition()??null),this.cursorLineNumber=ay(this,e=>this.cursorPosition.read(e)?.lineNumber??null),this.onDidType=ky(this),this.onDidPaste=ky(this),this.scrollTop=aP(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=aP(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=aP(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(e=>e.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(e=>e.decorationsLeft),this.layoutInfoWidth=this.layoutInfo.map(e=>e.width),this.layoutInfoHeight=this.layoutInfo.map(e=>e.height),this.layoutInfoMinimap=this.layoutInfo.map(e=>e.minimap),this.layoutInfoVerticalScrollbarWidth=this.layoutInfo.map(e=>e.verticalScrollbarWidth),this.contentWidth=aP(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this.contentHeight=aP(this.editor.onDidContentSizeChange,()=>this.editor.getContentHeight()),this._widgetCounter=0,this.openedPeekWidgets=aU(this,0),this._register(this.editor.onBeginU
671pdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(e=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,e)}finally{this._endUpdate()}})),this._register(this.editor.onDidPaste(e=>{this._beginUpdate();try{this._forceUpdate(),this.onDidPaste.trigger(this._currentTransaction,e)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(e=>{this._beginUpdate();try{this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,e),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(e=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,e),this._forceUpdate()}finally{this._endUpdate()}})),this.domNode=ay(e=>(this.model.read(e),this.editor.getDomNode()))}forceUpdate(e){this._beginUpdate();try{if(this._forceUpdate(),!e)return;return e(this._currentTransaction)}finally{this._endUpdate()}}_forceUpdate(){this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(this.editor.getModel()?.getVersionId()??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e,t=iP.ofCaller()){return aP(this,t=>this.editor.onDidChangeConfiguration(i=>{i.hasChanged(e)&&t(void 0)}),()=>this.editor.getOption(e),t)}setDecorations(e){let t=new ro.SL,i=this.editor.createDecorationsCollection();return t.add(aD({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},t=>{let n=e.read(t);i.set(n)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){let t="observableOverlayWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);let n=aN(t=>{e.position.read(t),e.minContentWidthInPx.read(t),this.editor.layoutOverlayWidget(i)});return(0,ro.OF)(()=>{n.dispose(),this.editor.removeOverlayWidget(i)})}createContentWidget(e){let t="observableContentWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow};this.editor.addContentWidget(i);let n=aN(t=>{e.position.read(t),this.editor.layoutContentWidget(i)});return(0,ro.OF)(()=>{n.dispose(),this.editor.removeContentWidget(i)})}observeLineOffsetRange(e,t){let i=this.observePosition(e.map(e=>new s3(e.startLineNumber,1)),t),n=this.observePosition(e.map(e=>new s3(e.endLineNumberExclusive+1,1)),t);return ay(t=>{i.read(t),n.read(t);let s=e.read(t),r=this.model.read(t)?.getLineCount(),o=(void 0!==r&&s.startLineNumber>r?this.editor.getBottomForLineNumber(r):this.editor.getTopForLineNumber(s.startLineNumber))-this.scrollTop.read(t),a=s.isEmpty?o:this.editor.getBottomForLineNumber(s.endLineNumberExclusive-1)-this.scrollTop.read(t);return new cQ(o,a)})}observePosition(e,t){let i=e.get(),n=kx({owner:this,debugName:()=>`topLeftOfPosition${i?.toString()}`,equalsFn:ah(z1.equals)},new z1(0,0)),s="observablePositionWidget"+this._widgetCounter++,r=document.createElement("div"),o={getDomNode:()=>r,getPosition:()=>i?{preference:[0],position:e.get()}:null,getId:()=>s,allowEditorOverflow:!1,afterRender:(e,t)=>{let s=this._model.get();s&&i&&i.lineNumber>s.getLineCount()?n.set(new z1(0,this.editor.getBottomForLineNumber(s.getLineCount())-this.scrollTop.get()),void 0):n.set(t?new z1(t.left,t.top):null,void 0)}};return this.editor.addContentWidget(o),t.add(aN(t=>{i=e.read(t),this.editor.layoutContentWidget(o)})),t.add((0,ro.OF)(()=>{this.editor.removeContentWidget(o)})),n}isTargetHovered(e,t){let i=aU("isInjectedTextHovered",!1);return t.add(this.editor.onMouseMove(t=>{let n=e(t);i.set(n,void 0)})),t.add(this.editor.onMouseLeave(e=>{i.set(!1,void 0)})),i}observeLineHeightForPosition(e){return ay(t=>{let i=e instanceof s3?e:e.read(t);return null===i?null:(this.getOption(75).read(t),this.editor.getLineHeightForPosition(i))})}observeLineHeightForLine(e){return"number"==typeof e?this.observeLineHeightForPosition(new s3(e,1)):ay(t=>{let i=e.read(t);return null===i?null:this.observeLineHeightForPosition(new s3(i,1)).read(t)})}observeLineHeightsForLineRange(e){return ay(t=>{let i=e instanceof c5?e:e.read(t),n=[];for(let e=i.startLineNumber;e<i.endLineNumberExclusive;e++)n.push(this.observeLineHeightForLine(e).read(t));return n})}}let z5=class extends ro.JT{static{sr=this}static{this.ONE_OVERVIEW_WIDTH=15}static{this.ENTIRE_DIFF_OVERVIEW_WIDTH=2*this.ONE_OVERVIEW_WIDTH}constructor(e,t,i,n,s,r,o){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=s,this._modifiedEditorLayoutInfo=r,this._themeService=o,this.width=sr.ENTIRE_DIFF_OVERVIEW_WIDTH;let a=aP(this._themeService.onDidColorThemeChange,()=>
671this._themeService.getColorTheme()),l=ay(e=>{let t=a.read(e);return{insertColor:t.getColor(p_)||(t.getColor(pm)||pg).transparent(2),removeColor:t.getColor(pv)||(t.getColor(pp)||pf).transparent(2)}}),h=l2(document.createElement("div"));h.setClassName("diffViewport"),h.setPosition("absolute");let d=lV("div.diffOverview",{style:{position:"absolute",top:"0px",width:sr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(HZ(d,h.domNode)),this._register(a7(d,ly.POINTER_DOWN,e=>{this._editors.modified.delegateVerticalScrollbarPointerDown(e)})),this._register(a6(d,ly.MOUSE_WHEEL,e=>{this._editors.modified.delegateScrollFromMouseWheelEvent(e)},{passive:!1})),this._register(HZ(this._rootElement,d)),this._register(aT((e,t)=>{let i=this._diffModel.read(e),n=this._editors.original.createOverviewRuler("original diffOverviewRuler");n&&(t.add(n),t.add(HZ(d,n.getDomNode())));let s=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(s&&(t.add(s),t.add(HZ(d,s.getDomNode()))),!n||!s)return;let r=zI("viewZoneChanged",this._editors.original.onDidChangeViewZones),o=zI("viewZoneChanged",this._editors.modified.onDidChangeViewZones),a=zI("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),u=zI("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);t.add(aN(e=>{r.read(e),o.read(e),a.read(e),u.read(e);let t=l.read(e),h=i?.diff.read(e)?.mappings;function d(e,t,i){let n=i._getViewModel();return n?e.filter(e=>e.length>0).map(e=>{let i=n.coordinatesConverter.convertModelPositionToViewPosition(new s3(e.startLineNumber,1)),s=n.coordinatesConverter.convertModelPositionToViewPosition(new s3(e.endLineNumberExclusive,1)),r=s.lineNumber-i.lineNumber;return new yP(i.lineNumber,s.lineNumber,r,t.toString())}):[]}let c=d((h||[]).map(e=>e.lineRangeMapping.original),t.removeColor,this._editors.original),g=d((h||[]).map(e=>e.lineRangeMapping.modified),t.insertColor,this._editors.modified);n?.setZones(c),s?.setZones(g)})),t.add(aN(e=>{let t=this._rootHeight.read(e),i=this._rootWidth.read(e),r=this._modifiedEditorLayoutInfo.read(e);if(r){let i=sr.ENTIRE_DIFF_OVERVIEW_WIDTH-2*sr.ONE_OVERVIEW_WIDTH;n.setLayout({top:0,height:t,right:i+sr.ONE_OVERVIEW_WIDTH,width:sr.ONE_OVERVIEW_WIDTH}),s.setLayout({top:0,height:t,right:0,width:sr.ONE_OVERVIEW_WIDTH});let o=this._editors.modifiedScrollTop.read(e),a=this._editors.modifiedScrollHeight.read(e),l=this._editors.modified.getOption(117),d=new vX(l.verticalHasArrows?l.arrowSize:0,l.verticalScrollbarSize,0,r.height,a,o);h.setTop(d.getSliderPosition()),h.setHeight(d.getSliderSize())}else h.setTop(0),h.setHeight(0);d.style.height=t+"px",d.style.left=i-sr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",h.setWidth(sr.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}};z5=sr=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){CG(e,t,6)}],z5);var z4=function(e,t){return function(i,n){t(i,n,e)}};let z6=class extends ro.JT{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,n,s,r,o,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=n,this._createInnerEditor=s,this._contextKeyService=r,this._instantiationService=o,this._keybindingService=a,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new sd.Q5),this.modifiedScrollTop=aP(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=aP(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=z0(this.modified),this.originalObs=z0(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=aP(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=aL({owner:this,equalsFn:s3.equals},e=>this.modifiedSelections.read(e)[0]?.getPosition()??new s3(1,1)),this.originalCursor=aP(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new s3(1,1)),this.isOriginalFocused=z0(this.original).isFocused,this.isModifiedFocused=z0(this.modified).isFocused,this.isFocused=ay(this,e=>this.isOriginalFocused.read(e)||this.isModifiedFocused.read(e)),this._argCodeEditorWidgetOptions=null,this._register(aE({changeTracker:{createChangeSummary:()=>({}),handleChange:(e,t)=>
671(e.didChange(i.editorOptions)&&Object.assign(t,e.change.changedOptions),!0)}},(e,t)=>{i.editorOptions.read(e),this._options.renderSideBySide.read(e),this.modified.updateOptions(this._adjustOptionsForRightHandSide(e,t)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(e,t))}))}_createLeftHandSideEditor(e,t){let i=this._adjustOptionsForLeftHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t),s=this._contextKeyService.createKey("isInDiffLeftEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>s.set(!0))),this._register(n.onDidBlurEditorWidget(()=>s.set(!1))),n}_createRightHandSideEditor(e,t){let i=this._adjustOptionsForRightHandSide(void 0,e),n=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t),s=this._contextKeyService.createKey("isInDiffRightEditor",n.hasWidgetFocus());return this._register(n.onDidFocusEditorWidget(()=>s.set(!0))),this._register(n.onDidBlurEditorWidget(()=>s.set(!1))),n}_constructInnerEditor(e,t,i,n){let s=this._createInnerEditor(e,t,i,n);return this._register(s.onDidContentSizeChange(e=>{let t=this.original.getContentWidth()+this.modified.getContentWidth()+z5.ENTIRE_DIFF_OVERVIEW_WIDTH,i=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:i,contentWidth:t,contentHeightChanged:e.contentHeightChanged,contentWidthChanged:e.contentWidthChanged})})),s}_adjustOptionsForLeftHandSide(e,t){let i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){let i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=sh.BH.revealHorizontalRightPadding.defaultValue+z5.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){let t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.allowVariableLineHeights=!1,t.allowVariableFonts=!1,t.allowVariableFontsInAccessibilityMode=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}}
671,t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){e||(e="");let t=(0,rh.NC)(111," use {0} to open the accessibility help.",this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp")?.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};z6=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([z4(5,hZ),z4(6,he),z4(7,SP)],z6);class z7{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=aS(this,e=>{let t=this._sashRatio.read(e)??this._options.splitViewDefaultRatio.read(e);return this._computeSashLeft(t,e)},(e,t)=>{let i=this.dimensions.width.get();this._sashRatio.set(e/i,t)}),this._sashRatio=aU(this,void 0)}_computeSashLeft(e,t){let i=this.dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),s=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n;return i<=200?n:s<100?100:s>i-100?i-100:s}}class z3 extends ro.JT{constructor(e,t,i,n,s,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=n,this.sashLeft=s,this._resetSash=r,this._sash=this._register(new Bt(this._domNode,{getVerticalSashTop:e=>0,getVerticalSashLeft:e=>this.sashLeft.get(),getVerticalSashHeight:e=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(e=>{this.sashLeft.set(this._startSashPosition+(e.currentX-e.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(aN(e=>{let t=this._boundarySashes.read(e);t&&(this._sash.orthogonalEndSash=t.bottom)})),this._register(aN(e=>{let t=this._enabled.read(e);this._sash.state=t?3:0,this.sashLeft.read(e),this._dimensions.height.read(e),this._sash.layout()}))}}class z9 extends ro.JT{constructor(){super(...arguments),this._id=++z9.idCounter,this._onDidDispose=this._register(new sd.Q5),this.onDidDispose=this._onDidDispose.event}static{this.idCounter=0}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}
671getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}let z8=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=aU(this,0),this._screenReaderMode=aP(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=ay(this,e=>this._options.read(e).renderSideBySide&&this._diffEditorWidth.read(e)<=this._options.read(e).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=ay(this,e=>this._options.read(e).renderOverviewRuler),this.renderSideBySide=ay(this,e=>!(this.compactMode.read(e)&&this.shouldRenderInlineViewInSmartMode.read(e))&&this._options.read(e).renderSideBySide&&!(this._options.read(e).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(e)&&!this._screenReaderMode.read(e))),this.readOnly=ay(this,e=>this._options.read(e).readOnly),this.shouldRenderOldRevertArrows=ay(this,e=>!(!this._options.read(e).renderMarginRevertIcon||!this.renderSideBySide.read(e)||this.readOnly.read(e)||this.shouldRenderGutterMenu.read(e))),this.shouldRenderGutterMenu=ay(this,e=>this._options.read(e).renderGutterMenu),this.renderIndicators=ay(this,e=>this._options.read(e).renderIndicators),this.enableSplitViewResizing=ay(this,e=>this._options.read(e).enableSplitViewResizing),this.splitViewDefaultRatio=ay(this,e=>this._options.read(e).splitViewDefaultRatio),this.ignoreTrimWhitespace=ay(this,e=>this._options.read(e).ignoreTrimWhitespace),this.maxComputationTimeMs=ay(this,e=>this._options.read(e).maxComputationTime),this.showMoves=ay(this,e=>this._options.read(e).experimental.showMoves&&this.renderSideBySide.read(e)),this.isInEmbeddedEditor=ay(this,e=>this._options.read(e).isInEmbeddedEditor),this.diffWordWrap=ay(this,e=>this._options.read(e).diffWordWrap),this.originalEditable=ay(this,e=>this._options.read(e).originalEditable),this.diffCodeLens=ay(this,e=>this._options.read(e).diffCodeLens),this.accessibilityVerbose=ay(this,e=>this._options.read(e).accessibilityVerbose),this.diffAlgorithm=ay(this,e=>this._options.read(e).diffAlgorithm),this.showEmptyDecorations=ay(this,e=>this._options.read(e).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=ay(this,e=>this._options.read(e).onlyShowAccessibleDiffViewer),this.compactMode=ay(this,e=>this._options.read(e).compactMode),this.trueInlineDiffRenderingEnabled=ay(this,e=>this._options.read(e).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=ay(this,e=>!this.renderSideBySide.read(e)&&this.trueInlineDiffRenderingEnabled.read(e)),this.hideUnchangedRegions=ay(this,e=>this._options.read(e).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=ay(this,e=>this._options.read(e).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=ay(this,e=>this._options.read(e).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=ay(this,e=>this._options.read(e).hideUnchangedRegions.minimumLineCount),this._model=aU(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,e=>{var t,i;let n;return t=t=>{var i;let n=e?.diff.read(t);return n?(i=this.trueInlineDiffRenderingEnabled.read(t),n.mappings.every(e=>0===e.lineRangeMapping.original.length||0===e.lineRangeMapping.modified.length||i&&zG(e.lineRangeMapping))):void 0},aL({owner:this,debugReferenceFn:i=(e,i)=>i??t(e)},e=>n=i(e,n))}).flatten().map(this,e=>!!e),this.inlineViewHideOriginalLineNumbers=this.compactMode;let i={...e,...Ue(e,RZ)};this._options=aU(this,i)}updateOptions(e){let t=Ue(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};function Ue(e,t){return{enableSplitViewResizing:(0,sh.O7)(e.enableSplitViewResizing,t.enableSplitViewResizing),splitViewDefaultRatio:(0,sh.L_)(e.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:(0,sh.O7)(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:(0,sh.O7)(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:(0,sh.Zc)(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:(0,sh.Zc)(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:(0,sh.O7)(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:(0,sh.O7)(e.renderIndicators,t.renderIndicators),originalEditable:(0,sh.O7)(e.originalEditable,t.originalEditable),diffCodeLens:(0,sh.O7)(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:(0,sh.O7)(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:(0,sh.NY)(e.diffWordWrap,t.diffWordWrap,["off","on","inherit"]),diffAlgorithm:(0,sh.NY)(e.diffAlgorithm,t.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:(0,sh.O7)(e.accessibilityVerbose,t.accessibilityVerbose),experimental:{showMoves:(0,sh.O7)(e.experimental?.showMoves,t.experimental.showMoves),showEmptyDecorations:(0,sh.O7)(e.experimental?.showEmptyDecorations,t.experimental.showEmptyDecorations),useTrueInlineView:(0,sh.O7)(e.experimental?.useTrueInlineView,t.experimental.useTrueInlineView)}
671,hideUnchangedRegions:{enabled:(0,sh.O7)(e.hideUnchangedRegions?.enabled??e.experimental?.collapseUnchangedRegions,t.hideUnchangedRegions.enabled),contextLineCount:(0,sh.Zc)(e.hideUnchangedRegions?.contextLineCount,t.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:(0,sh.Zc)(e.hideUnchangedRegions?.minimumLineCount,t.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:(0,sh.Zc)(e.hideUnchangedRegions?.revealLineCount,t.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:(0,sh.O7)(e.isInEmbeddedEditor,t.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:(0,sh.O7)(e.onlyShowAccessibleDiffViewer,t.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:(0,sh.Zc)(e.renderSideBySideInlineBreakpoint,t.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:(0,sh.O7)(e.useInlineViewWhenSpaceIsLimited,t.useInlineViewWhenSpaceIsLimited),renderGutterMenu:(0,sh.O7)(e.renderGutterMenu,t.renderGutterMenu),compactMode:(0,sh.O7)(e.compactMode,t.compactMode)}}z8=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){mg(e,t,1)}],z8),i(35635);class Ut extends ro.JT{get onDidChangeDropdownVisibility(){return this._onDidChangeDropdownVisibility.event}constructor(e,t,i={orientation:0}){if(super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new sd.z5),this.originalPrimaryActions=[],this.originalSecondaryActions=[],this.hiddenActions=[],this.disposables=this._register(new ro.SL),i.hoverDelegate=i.hoverDelegate??this._register(AX()),this.options=i,this.toggleMenuAction=this._register(new Ui(()=>this.toggleMenuActionViewItem?.show(),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Pt(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(e,n)=>{if(e.id===Ui.ID)return this.toggleMenuActionViewItem=new OU(e,{getActions:()=>this.toggleMenuAction.menuActions},t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:iH.asClassNameArray(i.moreIcon??rr.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){let t=i.actionViewItemProvider(e,n);if(t)return t}if(e instanceof hl){let i=new OU(e,e.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:e.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return i.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(i),this.disposables.add(this._onDidChangeDropdownVisibility.add(i.onDidChangeVisibility)),i}}})),this.options.responsive){this.element.classList.add("responsive");let e=new ResizeObserver(()=>{this.setToolbarMaxWidth(this.element.getBoundingClientRect().width)});e.observe(this.element),this._store.add((0,ro.OF)(()=>e.disconnect()))}}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){for(let t of(this.actionBar.context=e,this.toggleMenuActionViewItem?.setActionContext(e),this.submenuActionViewItems))t.setActionContext(e)}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}getItemWidth(e){return this.actionBar.getWidth(e)}setActions(e,t){this.clear(),this.originalPrimaryActions=e?e.slice(0):[],this.originalSecondaryActions=t?t.slice(0):[];let i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.length>
6710&&this.options.trailingSeparator&&i.push(new ha),i.forEach(e=>{this.actionBar.push(e,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(e)})}),this.options.responsive&&(this.hiddenActions.length=0,this.setToolbarMaxWidth(this.element.getBoundingClientRect().width))}getKeybindingLabel(e){let t=this.options.getKeyBinding?.(e);return t?.getLabel()??void 0}getItemsWidthResponsive(){return 24*this.actionBar.length()}setToolbarMaxWidth(e){if(this.actionBar.isEmpty()||this.getItemsWidthResponsive()<=e&&0===this.hiddenActions.length)return;if(this.getItemsWidthResponsive()>e)for(;this.getItemsWidthResponsive()>e&&this.actionBar.length()>0;){let e=this.originalPrimaryActions.length-this.hiddenActions.length-1;if(e<0)break;let t=Math.min(24,this.getItemWidth(e)),i=this.originalPrimaryActions[e];this.hiddenActions.unshift({action:i,size:t}),this.actionBar.pull(e),0===this.originalSecondaryActions.length&&1===this.hiddenActions.length&&this.actionBar.push(this.toggleMenuAction,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(this.toggleMenuAction)})}else for(;this.hiddenActions.length>0;){let t=this.hiddenActions.shift();if(this.getItemsWidthResponsive()+t.size>e){this.hiddenActions.unshift(t);break}this.actionBar.push(t.action,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(t.action),index:this.originalPrimaryActions.length-this.hiddenActions.length-1}),0===this.originalSecondaryActions.length&&1===this.hiddenActions.length&&(this.toggleMenuAction.menuActions=[],this.actionBar.pull(this.actionBar.length()-1))}let t=this.hiddenActions.map(e=>e.action);if(this.originalSecondaryActions.length>0||t.length>0){let e=this.originalSecondaryActions.slice(0);this.toggleMenuAction.menuActions=ha.join(t,e)}}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class Ui extends hr{static{this.ID="toolbar.toggle.more"}constructor(e,t){super(Ui.ID,t=t||(0,rh.NC)(17,"More Actions..."),void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}let Un=ht("IActionViewItemService");class Us{constructor(){this._providers=new Map,this._onDidChange=new sd.Q5,this.onDidChange=this._onDidChange.event}dispose(){this._onDidChange.dispose()}lookUp(e,t){return this._providers.get(this._makeKey(e,t))}_makeKey(e,t){return`${e.id}/${t instanceof h8?t.id:t}`}}uP(Un,Us,1);var Ur=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Uo=function(e,t){return function(i,n){t(i,n,e)}};let Ua=class extends Ut{constructor(e,t,i,n,s,r,o,a){super(e,s,{getKeyBinding:e=>r.lookupKeybinding(e.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:"string"==typeof t?.telemetrySource}),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=s,this._keybindingService=r,this._commandService=o,this._sessionDisposables=this._store.add(new ro.SL);let l=t?.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(e=>a.publicLog2("workbenchActionExecuted",{id:e.action.id,from:l})))}setActions(e,t=[],i){this._sessionDisposables.clear();let n=e.slice(),s=t.slice(),r=[],o=0,a=[],l=!1;if(this._options?.hiddenItemStrategy!==-1)for(let e=0;e<n.length;e++){let t=n[e];(t instanceof ds||t instanceof dn)&&t.hideActions&&(r.push(t.hideActions.toggle),t.hideActions.toggle.checked&&o++,t.hideActions.isHidden&&(l=!0,n[e]=void 0,this._options?.hiddenItemStrategy!==0&&(a[e]=t)))}if(this._options?.overflowBehavior!==void 0){let e=Nh(new Set(this._options.overflowBehavior.exempted),hc.$.map(n,e=>e?.id)),t=this._options.overflowBehavior.maxItems-e.size,i=0;for(let s=0;s<n.length;s++){let r=n[s];r&&(i++,!e.has(r.id)&&i>=t&&(n[s]=void 0,a[s]=r))}}(0,as.Rs)(n),(0,as.Rs)(a),super.setActions(n,ha.join(a,s)),(r.length>0||n.length>0)&&this._sessionDisposables.add(a6(this.getElement(),"contextmenu",e=>{let t=new oE(aG(this.getElement()),e),n=this.getItemAction(t.target);if(!n)return;t.preventDefault(),t.stopPropagation();let s=[];if(n instanceof ds&&n.menuKeybinding)s.push(n.menuKeybinding);else if(!(n instanceof dn||n instanceof Ui)){let e=!!this._keybindingService.lookupKeybinding(n.id);s.push(WQ(this._commandService,this._keybindingService,n.id,void 0,e))}if(r.length>0){let e=!1;if(1===o&&this._options?.hiddenItemStrategy===0){e=!0;for(let e=0;e<r.length;e++)if(r[e].checked){r[e]=hd({id:n.id,label:n.label,checked:!0,enabled:!1,run(){}});break}}if(!e&&(n instanceof ds||n instanceof dn)){if(!n.hideActions)return;s.push(n.hideActions.hide)}
671else s.push(hd({id:"label",label:(0,rh.NC)(1649,"Hide"),enabled:!1,run(){}}))}let a=ha.join(s,r);this._options?.resetMenu&&!i&&(i=[this._options.resetMenu]),l&&i&&(a.push(new ha),a.push(hd({id:"resetThisMenu",label:(0,rh.NC)(1650,"Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),0!==a.length&&this._contextMenuService.showContextMenu({getAnchor:()=>t,getActions:()=>a,menuId:this._options?.contextMenu,menuActionOptions:{renderShortTitle:!0,...this._options?.menuOptions},skipTelemetry:"string"==typeof this._options?.telemetrySource,contextKeyService:this._contextKeyService})}))}};Ua=Ur([Uo(2,de),Uo(3,hZ),Uo(4,Tu),Uo(5,SP),Uo(6,hg),Uo(7,da)],Ua);let Ul=class extends Ua{get onDidChangeMenuItems(){return this._onDidChangeMenuItems.event}constructor(e,t,i,n,s,r,o,a,l,h,d){super(e,{resetMenu:t,...i,actionViewItemProvider:(n,s)=>{let r=h.lookUp(t,n instanceof dn?n.item.submenu.id:n.id);return r||(r=i?.actionViewItemProvider),r?.(n,s,d,aG(e).vscodeWindowId)||Pe(d,n,s)}},n,s,r,o,a,l),this._onDidChangeMenuItems=this._store.add(new sd.Q5);let u=this._store.add(n.createMenu(t,s,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:i?.eventDebounceDelay})),c=()=>{let{primary:t,secondary:n}=function(e,t,i,n){let s={primary:[],secondary:[]};return O6(e,s,!1,"string"==typeof t?e=>e===t:t,i,n),s}(u.getActions(i?.menuOptions),i?.toolbarOptions?.primaryGroup,i?.toolbarOptions?.shouldInlineSubmenu,i?.toolbarOptions?.useSeparatorsInPrimaryActions);e.classList.toggle("has-no-actions",0===t.length&&0===n.length),super.setActions(t,n)};this._store.add(u.onDidChange(()=>{c(),this._onDidChangeMenuItems.fire(this)})),this._store.add(h.onDidChange(e=>{e===t&&c()})),c()}setActions(){throw new o_.he("This toolbar is populated from a menu.")}};Ul=Ur([Uo(3,de),Uo(4,hZ),Uo(5,Tu),Uo(6,SP),Uo(7,hg),Uo(8,da),Uo(9,Un),Uo(10,he)],Ul);class Uh extends c8{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}getLineLength(e){return this._textModel.getLineLength(e)}get length(){let e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new c6(e-1,t)}}class Ud extends ho{constructor(e){super(),this._getContext=e}runAction(e,t){let i=this._getContext();return super.runAction(e,i)}}class Uu extends ro.JT{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=aP(this,this._editor.onDidScrollChange,e=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(e=>0===e),this.modelAttached=aP(this,this._editor.onDidChangeModel,e=>this._editor.hasModel()),this.editorOnDidChangeViewZones=zI("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=zI("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=ky("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";
671let n=this._domNode.appendChild(lV("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),s=new ResizeObserver(()=>{aM(e=>{this.domNodeSizeChanged.trigger(e)})});s.observe(this._domNode),this._register((0,ro.OF)(()=>s.disconnect())),this._register(aN(e=>{n.className=this.isScrollTopZero.read(e)?"":"scroll-decoration"})),this._register(aN(e=>this.render(e)))}dispose(){super.dispose(),lD(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);let t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),n=new Set(this.views.keys()),s=cQ.ofStartAndLength(0,this._domNode.clientHeight);if(!s.isEmpty)for(let r of i){let i=new c5(r.startLineNumber,r.endLineNumber+1),o=this.itemProvider.getIntersectingGutterItems(i,e);aM(e=>{for(let r of o){if(!r.range.intersect(i))continue;n.delete(r.id);let o=this.views.get(r.id);if(o)o.item.set(r,e);else{let e=document.createElement("div");this._domNode.appendChild(e);let t=aU("item",r),i=this.itemProvider.createView(t,e);o=new Uc(t,i,e),this.views.set(r.id,o)}let a=r.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(r.range.startLineNumber,!0)-t:r.range.startLineNumber>1?this._editor.getBottomForLineNumber(r.range.startLineNumber-1,!1)-t:0,l=(1===r.range.endLineNumberExclusive?Math.max(a,this._editor.getTopForLineNumber(r.range.startLineNumber,!1)-t):Math.max(a,this._editor.getBottomForLineNumber(r.range.endLineNumberExclusive-1,!0)-t))-a;o.domNode.style.top=`${a}px`,o.domNode.style.height=`${l}px`,o.gutterItemView.layout(cQ.ofStartAndLength(a,l),s)}})}for(let e of n){let t=this.views.get(e);t.gutterItemView.dispose(),t.domNode.remove(),this.views.delete(e)}}}class Uc{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}var Ug=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},Uf=function(e,t){return function(i,n){t(i,n,e)}};let Um=[],Up=class extends ro.JT{constructor(e,t,i,n,s,r,o,a,l){var h;super(),this._diffModel=t,this._editors=i,this._options=n,this._sashLayout=s,this._boundarySashes=r,this._instantiationService=o,this._contextKeyService=a,this._menuService=l,this._menu=this._register(this._menuService.createMenu(h8.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=aP(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(e=>e.length>0),this._showSash=ay(this,e=>this._options.renderSideBySide.read(e)&&this._hasActions.read(e)),this.width=ay(this,e=>this._hasActions.read(e)?35:0),this.elements=lV("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:"35px"}},[]),this._currentDiff=ay(this,e=>{let t=this._diffModel.read(e);if(!t)return;let i=t.diff.read(e)?.mappings,n=this._editors.modifiedCursor.read(e);if(n)return i?.find(e=>e.lineRangeMapping.modified.contains(n.lineNumber))}),this._selectedDiffs=ay(this,e=>{let t=this._diffModel.read(e),i=t?.diff.read(e);if(!i)return Um;let n=this._editors.modifiedSelections.read(e);if(n.every(e=>e.isEmpty()))return Um;let s=new c4(n.map(e=>c5.fromRangeInclusive(e))),r=i.mappings.filter(e=>e.lineRangeMapping.innerChanges&&s.intersects(e.lineRangeMapping.modified)).map(e=>({mapping:e,rangeMappings:e.lineRangeMapping.innerChanges.filter(e=>n.some(t=>s9.areIntersecting(e.modifiedRange,t)))}));return 0===r.length||r.every(e=>0===e.rangeMappings.length)?Um:r}),this._register((h=this.elements.root,e.prepend(h),(0,ro.OF)(()=>{h.remove()}))),this._register(a6(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(H4(this.elements.root,{display:this._hasActions.map(e=>e?"block":"none")})),ax(this,t=>this._showSash.read(t)?new z3(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,aS(this,e=>this._sashLayout.sashLeft.read(e)-35,(e,t)=>this._sashLayout.sashLeft.set(e+35,t)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store);let d=ay(this,e=>{let t=this._diffModel.read(e);if(!t)return[];let i=t.diff.read(e);if(!i)return[];let n=this._selectedDiffs.read(e);if(n.length>0)return[new U_(gh.fromRangeMappings(n.flatMap(e=>
671e.rangeMappings)),!0,h8.DiffEditorSelectionToolbar,void 0,t.model.original.uri,t.model.modified.uri)];let s=this._currentDiff.read(e);return i.mappings.map(e=>new U_(e.lineRangeMapping.withInnerChangesFromLineRanges(),e.lineRangeMapping===s?.lineRangeMapping,h8.DiffEditorHunkToolbar,void 0,t.model.original.uri,t.model.modified.uri))});this._register(new Uu(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(e,t)=>d.read(t),createView:(e,t)=>this._instantiationService.createInstance(Uv,e,t,this)})),this._register(a6(this.elements.gutter,ly.MOUSE_WHEEL,e=>{this._editors.modified.getOption(117).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(e)},{passive:!1}))}computeStagedValue(e){let t=e.innerChanges??[],i=new Uh(this._editors.modifiedModel.get()),n=new Uh(this._editors.original.getModel());return new gn(t.map(e=>e.toTextEdit(i))).apply(n)}layout(e){this.elements.gutter.style.left=e+"px"}};Up=Ug([Uf(6,he),Uf(7,hZ),Uf(8,de)],Up);class U_{constructor(e,t,i,n,s,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=n,this.originalUri=s,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let Uv=class extends ro.JT{constructor(e,t,i,n){super(),this._item=e,this._elements=lV("div.gutterItem",{style:{height:"20px",width:"34px"}},[lV("div.background@background",{},[]),lV("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,e=>e.showAlways),this._menuId=this._item.map(this,e=>e.menuId),this._isSmall=aU(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;let s=this._register(n.createInstance(Th,"element",{instantHover:!0},{position:{hoverPosition:1}}));this._register(HZ(t,this._elements.root)),this._register(aN(e=>{let t=this._showAlways.read(e);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",t),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(aT((e,t)=>{this._elements.buttons.replaceChildren();let r=t.add(n.createInstance(Ul,this._elements.buttons,this._menuId.read(e),{orientation:1,hoverDelegate:s,toolbarOptions:{primaryGroup:e=>e.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(e)?1:3},hiddenItemStrategy:0,actionRunner:t.add(new Ud(()=>{let e=this._item.read(void 0),t=e.mapping;return{mapping:t,originalWithModifiedChanges:i.computeStagedValue(t),originalUri:e.originalUri,modifiedUri:e.modifiedUri}})),menuOptions:{shouldForwardArgs:!0}}));t.add(r.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(1===this._item.get().mapping.original.startLineNumber&&e.length<30,void 0),i=this._elements.buttons.clientHeight;let n=e.length/2-i/2,s=i,r=e.start+n,o=cQ.tryCreate(s,t.endExclusive-s-i),a=cQ.tryCreate(e.start+s,e.endExclusive-i-s);a&&o&&a.start<a.endExclusive&&(r=o.clip(r),r=a.clip(r)),this._elements.buttons.style.top=`${r-e.start}px`}};Uv=Ug([Uf(3,he)],Uv);let Ub=class extends ro.JT{static{so=this}static{this._breadcrumbsSourceFactory=aU(this,()=>({dispose(){},getBreadcrumbItems:(e,t)=>[]}))}static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=n,this._modifiedOutlineSource=ax(this,e=>{let t=this._editors.modifiedModel.read(e),i=so._breadcrumbsSourceFactory.read(e);return t&&i?i(t,this._instantiationService):void 0}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(e=>{if(1===e.reason)return;let t=this._diffModel.get();aM(e=>{for(let i of this._editors.original.getSelections()||[])t?.ensureOriginalLineIsVisible(i.getStartPosition().lineNumber,0,e),t?.ensureOriginalLineIsVisible(i.getEndPosition().lineNumber,0,e)})})),this._register(this._editors.modified.onDidChangeCursorPosition(e=>{if(1===e.reason)return;let t=this._diffModel.get();aM(e=>{for(let i of this._editors.modified.getSelections()||[])t?.ensureModifiedLineIsVisible(i.getStartPosition().lineNumber,0,e),t?.ensureModifiedLineIsVisible(i.getEndPosition().lineNumber,0,e)})}));let s=this._diffModel.map((e,t)=>{let i=e?.unchangedRegions.read(t)??[];return 1===i.length&&1===i[0].modifiedLineNumber&&i[0].lineCount===this._editors.modifiedModel.read(t)?.getLineCount()?[]:i});this.viewZones=ay(this,e=>{let t=this._modifiedOutlineSource.read(e);if(!t)return{origViewZones:[],modViewZones:[]};let i=[],n=[],r=this._options.renderSideBySide.read(e),o=this._options.compactMode.read(e),a=s.read(e);for(let s=0;s<a.length;s++){let l=a[s];if(!l.shouldHideControls(e)&&(!o||0!==s&&s!==a.length-1)){if(o){{let t=new H2(ay(this,e=>l.getHiddenOriginalRange(e).startLineNumber-1),12);i.push(t),e.store.add(new UC(this._editors.original,t,l,!r))}{let t=new H2(ay(this,e=>l.getHiddenModifiedRange(e).startLineNumber-1),12);n.push(t),e.store.add(new UC(this._editors.modified,t,l))}}else{{let n=new H2(ay(this,e=>l.getHiddenOriginalRange(e).startLineNumber-1),24);i.push(n),e.store.add(new Uw(this._editors.original,n,l,l.originalUnchangedRange,!r,t,e=>this._diffModel.get().ensureModifiedLineIsVisible(e,2,void 0),this._options))}{let i=new H2(ay(this,e=>l.getHiddenModifiedRange(e).startLineNumber-1),24);n.push(i),e.store.add(new Uw(this._editors.modified,i,l,l.modifiedUnchangedRange,!1,t,e=>this._diffModel.get().ensureModifiedLineIsVisible(e,2,void 0),this._options))}}}}return{origViewZones:i,modViewZones:n}});let r={description:"unchanged lines",className:"diff-unchanged-lines",
671isWholeLine:!0},o={description:"Fold Unchanged",glyphMarginHoverMessage:new TJ(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown((0,rh.NC)(124,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+iH.asClassName(rr.fold),zIndex:10001};this._register(HJ(this._editors.original,ay(this,e=>{let t=s.read(e),i=t.map(e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:r}));for(let n of t)n.shouldHideControls(e)&&i.push({range:s9.fromPositions(new s3(n.originalLineNumber,1)),options:o});return i}))),this._register(HJ(this._editors.modified,ay(this,e=>{let t=s.read(e),i=t.map(e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(let n of t)n.shouldHideControls(e)&&i.push({range:c5.ofLength(n.modifiedLineNumber,1).toInclusiveRange(),options:o});return i}))),this._register(aN(e=>{let t=s.read(e);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(t.map(t=>t.getHiddenOriginalRange(e).toInclusiveRange()).filter(re.$K)),this._editors.modified.setHiddenAreas(t.map(t=>t.getHiddenModifiedRange(e).toInclusiveRange()).filter(re.$K))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(e=>{if(!e.event.rightButton&&e.target.position&&e.target.element?.className.includes("fold-unchanged")){let t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;let n=i.unchangedRegions.get().find(e=>e.modifiedUnchangedRange.contains(t));n&&(n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault())}})),this._register(this._editors.original.onMouseUp(e=>{if(!e.event.rightButton&&e.target.position&&e.target.element?.className.includes("fold-unchanged")){let t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;let n=i.unchangedRegions.get().find(e=>e.originalUnchangedRange.contains(t));n&&(n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault())}}))}};Ub=so=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){he(e,t,3)}],Ub);class UC extends H0{constructor(e,t,i,n=!1){let s=lV("div.diff-hidden-lines-widget");super(e,t,s.root),this._unchangedRegion=i,this._hide=n,this._nodes=lV("div.diff-hidden-lines-compact",[lV("div.line-left",[]),lV("div.text@text",[]),lV("div.line-right",[])]),s.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(aN(e=>{if(!this._hide){let t=this._unchangedRegion.getHiddenModifiedRange(e).length,i=(0,rh.NC)(125,"{0} hidden lines",t);this._nodes.text.innerText=i}}))}}class Uw extends H0{constructor(e,t,i,n,s,r,o,a){let l=lV("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this._hide=s,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=o,this._options=a,this._nodes=lV("div.diff-hidden-lines",[lV("div.top@top",{title:(0,rh.NC)(126,"Click or drag to show more above")}),lV("div.center@content",{style:{display:"flex"}},[lV("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[lI("a",{title:(0,rh.NC)(127,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...M4("$(unfold)"))]),lV("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),lV("div.bottom@bottom",{title:(0,rh.NC)(128,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root),this._hide?lD(this._nodes.first):this._register(H4(this._nodes.first,{width:z0(this._editor).layoutInfoContentLeft})),this._register(aN(e=>{let t=this._unchangedRegion.visibleLineCountTop.read(e)+this._unchangedRegion.visibleLineCountBottom.read(e)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!t),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),this._nodes.top.classList.toggle("canMoveBottom",!t);let i=this._unchangedRegion.isDragged.read(e),n=this._editor.getDomNode();n&&(n.classList.toggle("draggingUnchangedRegion",!!i),"top"===i?(n.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(e)>0),n.classList.toggle("canMoveBottom",!t)):"bottom"===i?(n.classList.toggle("canMoveTop",!t),n.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(e)>0)):(n.classList.toggle("canMoveTop",!1),n.classList.toggle("canMoveBottom",!1)))}));let h=this._editor;this._register(a6(this._nodes.top,"mousedown",e=>{if(0!==e.button)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();let t=e.clientY,i=!1,n=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);let s=aG(this._nodes.top),r=a6(s,"mousemove",e=>{let s=e.clientY-t;i=i||Math.abs(s)>2;let r=Math.max(0,Math.min(n+Math.round(s/h.getOption(75)),this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(r,void 0)}),o=a6(s,"mouseup",e=>
671{i||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),r.dispose(),o.dispose()})})),this._register(a6(this._nodes.bottom,"mousedown",e=>{if(0!==e.button)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();let t=e.clientY,i=!1,n=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);let s=aG(this._nodes.bottom),r=a6(s,"mousemove",e=>{let s=e.clientY-t;i=i||Math.abs(s)>2;let r=Math.max(0,Math.min(n-Math.round(s/h.getOption(75)),this._unchangedRegion.getMaxVisibleLineCountBottom())),o=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(r,void 0);let a=this._unchangedRegionRange.endLineNumberExclusive>h.getModel().getLineCount()?h.getContentHeight():h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(a-o))}),o=a6(s,"mouseup",e=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!i){let e=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);
671this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);let t=h.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);h.setScrollTop(h.getScrollTop()+(t-e))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),r.dispose(),o.dispose()})})),this._register(aN(e=>{let t=[];if(!this._hide){let n=i.getHiddenModifiedRange(e).length,s=(0,rh.NC)(129,"{0} hidden lines",n),r=lI("span",{title:(0,rh.NC)(130,"Double click to unfold")},s);r.addEventListener("dblclick",e=>{0===e.button&&(e.preventDefault(),this._unchangedRegion.showAll(void 0))}),t.push(r);let o=this._unchangedRegion.getHiddenModifiedRange(e),a=this._modifiedOutlineSource.getBreadcrumbItems(o,e);if(a.length>0){t.push(lI("span",void 0,"\xa0\xa0|\xa0\xa0"));for(let e=0;e<a.length;e++){let i=a[e],n=lV("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[M6(tH.toIcon(i.kind)),"\xa0",i.name,...e===a.length-1?[]:[M6(rr.chevronRight)]]).root;t.push(n),n.onclick=()=>{this._revealModifiedHiddenLine(i.startLineNumber)}}}}lD(this._nodes.others,...t)}))}}let Uy=[];class US extends ro.JT{constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=n,this._selectedDiffs=ay(this,e=>{let t=this._diffModel.read(e),i=t?.diff.read(e);if(!i)return Uy;let n=this._editors.modifiedSelections.read(e);if(n.every(e=>e.isEmpty()))return Uy;let s=new c4(n.map(e=>c5.fromRangeInclusive(e))),r=i.mappings.filter(e=>e.lineRangeMapping.innerChanges&&s.intersects(e.lineRangeMapping.modified)).map(e=>({mapping:e,rangeMappings:e.lineRangeMapping.innerChanges.filter(e=>n.some(t=>s9.areIntersecting(e.modifiedRange,t)))}));return 0===r.length||r.every(e=>0===e.rangeMappings.length)?Uy:r}),this._register(aT((e,t)=>{if(!this._options.shouldRenderOldRevertArrows.read(e))return;let i=this._diffModel.read(e),n=i?.diff.read(e);if(!i||!n||i.movedTextToCompare.read(e))return;let s=[],r=this._selectedDiffs.read(e),o=new Set(r.map(e=>e.mapping));if(r.length>0){let i=this._editors.modifiedSelections.read(e),n=t.add(new UL(i[i.length-1].positionLineNumber,this._widget,r.flatMap(e=>e.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(n),s.push(n)}for(let e of n.mappings)if(!o.has(e)&&!e.lineRangeMapping.modified.isEmpty&&e.lineRangeMapping.innerChanges){let i=t.add(new UL(e.lineRangeMapping.modified.startLineNumber,this._widget,e.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(i),s.push(i)}t.add((0,ro.OF)(()=>{for(let e of s)this._editors.modified.removeGlyphMarginWidget(e)}))}))}}class UL extends ro.JT{static{this.counter=0}getId(){return this._id}constructor(e,t,i,n){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=n,this._id=`revertButton${UL.counter++}`,this._domNode=lV("div.revertButton",{title:this._revertSelection?(0,rh.NC)(135,"Revert Selected Changes"):(0,rh.NC)(136,"Revert Change")}
671,[M6(rr.arrowRight)]).root,this._register(a6(this._domNode,ly.MOUSE_DOWN,e=>{2!==e.button&&(e.stopPropagation(),e.preventDefault())})),this._register(a6(this._domNode,ly.MOUSE_UP,e=>{e.stopPropagation(),e.preventDefault()})),this._register(a6(this._domNode,ly.CLICK,e=>{this._diffs instanceof go?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),e.stopPropagation(),e.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:iJ.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}}i(31120);var Ux=function(e,t){return function(i,n){t(i,n,e)}};let Uk=class extends z9{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,n,s,r,o,a){let l;super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=s,this._codeEditorService=r,this._accessibilitySignalService=o,this._editorProgressService=a,this.elements=lV("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[lV("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),lV("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),lV("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(a$(this,void 0)),this._diffModel=ay(this,e=>this._diffModelSrc.read(e)?.object),this.onDidChangeModel=sd.ju.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new D2([hZ,this._contextKeyService]))),this._boundarySashes=aU(this,void 0),this._accessibleDiffViewerShouldBeVisible=aU(this,!1),this._accessibleDiffViewerVisible=ay(this,e=>!!this._options.onlyShowAccessibleDiffViewer.read(e)||this._accessibleDiffViewerShouldBeVisible.read(e)),this._movedBlocksLinesPart=aU(this,void 0),this._layoutInfo=ay(this,e=>{let t,i,n,s,r;let o=this._rootSizeObserver.width.read(e),a=this._rootSizeObserver.height.read(e);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=a+"px";let l=this._sash.read(e),h=this._gutter.read(e),d=h?.width.read(e)??0,u=this._overviewRulerPart.read(e)?.width??0;if(l){let a=l.sashLeft.read(e);t=0,i=a-d-(this._movedBlocksLinesPart.read(e)?.width.read(e)??0),r=a-d,s=o-(n=a)-u}else{r=0;let a=this._options.inlineViewHideOriginalLineNumbers.read(e);t=d,s=o-(n=d+(i=a?0:Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(e))))-u}return this.elements.original.style.left=t+"px",this.elements.original.style.width=i+"px",this._editors.original.layout({width:i,height:a},!0),h?.layout(r),this.elements.modified.style.left=n+"px",this.elements.modified.style.width=s+"px",this._editors.modified.layout({width:s,height:a},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((e,t)=>e?.diff.read(t)),this.onDidUpdateDiff=sd.ju.fromObservableLight(this._diffValue),this._codeEditorService.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register((0,ro.OF)(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new HX(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(z8,t),this._register(aN(e=>{this._options.setWidth(this._rootSizeObserver.width.read(e))})),this._contextKeyService.createKey(i8.isEmbeddedDiffEditor.key,!1),this._register(HQ(i8.isEmbeddedDiffEditor,this._contextKeyService,e=>this._options.isInEmbeddedEditor.read(e))),this._register(HQ(i8.comparingMovedCode,this._contextKeyService,e=>!!this._diffModel.read(e)?.movedTextToCompare.read(e))),this._register(HQ(i8.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,e=>this._options.couldShowInlineViewBecauseOfSize.read(e))),this._register(HQ(i8.diffEditorInlineMode,this._contextKeyService,e=>!this._options.renderSideBySide.read(e))),this._register(HQ(i8.hasChanges,this._contextKeyService,e=>(this._diffModel.read(e)?.diff.read(e)?.mappings.length??0)>0)),this._editors=this._register(this._instantiationService.createInstance(z6,this.elements.original,this.elements.modified,this._options,i,(e,t,i,n)=>this._createInnerEditor(e,t,i,n))),this._register(HQ(i8.diffEditorOriginalWritable,this._contextKeyService,e=>this._options.originalEditable.read(e))),this._register(HQ(i8.diffEditorModifiedWritable,this._contextKeyService,e=>!this._options.readOnly.read(e))),this._register(HQ(i8.diffEditorOriginalUri,this._contextKeyService,e=>this._diffModel.read(e)?.model.original.uri.toString()??"")),this._register(HQ(i8.diffEditorModifiedUri,this._contextKeyService,e=>this._diffModel.read(e)?.model.modified.uri.toString()??"")),this._overviewRulerPart=ax(this,e=>this._options.renderOverviewRuler.read(e)?this._instantiationService.createInstance(z5,this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(e=>e.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);let h={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((e,t)=>e-(this._overviewRulerPart.read(t)?.width??0))};this._sashLayout=new z7(this._options,h),this._sash=ax(this,e=>{let t=this._options.renderSideBySide.read(e);return this.elements.root.classList.toggle("side-by-side",t),t?new z3(this.elements.root,h,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);let d=ax(this,e=>this._instantiationService.createInstance(Ub,this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);ax(this,e=>this._instantiationService.createInstance(zX,this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);let u=new Set,c=new Set,g=!1,f=ax(this,e=>this._instantiationService.createInstance(z$,aG(this._domElement),this._editors,this._diffModel,this._options,this,()=>g||d.read(void 0).isUpdatingHiddenAreas,u,c)).recomputeInitiallyAndOnChange(this._store),m=ay(this,e=>{let t=f.read(e).viewZones.read(e).orig,i=d.read(e).viewZones.read(e).origViewZones;return t.concat(i)}),p=ay(this,e=>{let t=f.read(e).viewZones.read(e).mod,i=d.read(e).viewZones.read(e).modViewZones;return t.concat(i)});this._register(H6(this._editors.original,m,e=>{g=e},u)),this._register(H6(this._editors.modified,p,e=>{(g=e)?l=HY.capture(this._editors.modified):(l?.restore(this._editors.modified),l=void 0)},c)),this._accessibleDiffViewer=ax(this,e=>this._instantiationService.createInstance(zr,this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(e,t)=>this._accessibleDiffViewerShouldBeVisible.set(e,t),this._options.onlyShowAccessibleDiffViewer.map(e=>!e),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((e,t)=>e?.diff.read(t)?.mappings.map(e=>e.lineRangeMapping)),new zg(this._editors))).recomputeInitiallyAndOnChange(this._store);let _=this._accessibleDiffViewerVisible.map(e=>e?"hidden":"visible");this._register(H4(this.elements.modified,{visibility:_})),this._register(H4(this.elements.original,{visibility:_})),this._createDiffEditorContributions(),this._codeEditorService.addDiffEditor(this),this._register((0,ro.OF)(()=>{this._codeEditorService.removeDiffEditor(this)})),this._gutter=ax(this,e=>this._options.shouldRenderGutterMenu.read(e)?this._instantiationService.createInstance(Up,this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(aB(this._layoutInfo)),ax(this,e=>new zY(this.elements.root,this._diffModel,this._layoutInfo.map(e=>e.originalEditor),this._layoutInfo.map(e=>e.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,e=>{this._movedBlocksLinesPart.set(e,void 0)}),this._register(sd.ju.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,e=>this._handleCursorPositionChange(e,!0))),this._register(sd.ju.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,e=>this._handleCursorPositionChange(e,!1)));let v=this._diffModel.map(this,(e,t)=>{if(e)return void 0===e.diff.read(t)&&!e.isDiffUpToDate.read(t)});this._register(aT((e,t)=>
671{if(!0===v.read(e)){let e=this._editorProgressService.show(!0,1e3);t.add((0,ro.OF)(()=>e.done()))}})),this._register(aT((e,t)=>{t.add(new US(this._editors,this._diffModel,this._options,this))})),this._register(aT((e,t)=>{let i=this._diffModel.read(e);if(i)for(let e of[i.model.original,i.model.modified])t.add(e.onWillDispose(e=>{(0,o_.dL)(new o_.he("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(aN(e=>{this._options.setModel(this._diffModel.read(e))}))}_createInnerEditor(e,t,i,n){return e.createInstance(D4,t,i,n)}_createDiffEditorContributions(){for(let e of iG.getDiffEditorContributions())try{this._register(this._instantiationService.createInstance(e.ctor,this))}catch(e){(0,o_.dL)(e)}}get _targetEditor(){return this._editors.modified}getEditorType(){return fb.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){return{original:this._editors.original.saveViewState(),modified:this._editors.modified.saveViewState(),modelState:this._diffModel.get()?.serializeState()}}restoreViewState(e){e&&e.original&&e.modified&&(this._editors.original.restoreViewState(e.original),this._editors.modified.restoreViewState(e.modified),e.modelState&&this._diffModel.get()?.restoreSerializedState(e.modelState))}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(zR,e,this._options)}getModel(){return this._diffModel.get()?.model??null}setModel(e){let t=e?"model"in e?H3.create(e).createNewRef(this):H3.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){let i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==e?.object&&aA(t,t=>{let i=e?.object;aP.batchEventsGlobally(t,()=>{this._editors.original.setModel(i?i.model.original:null),this._editors.modified.setModel(i?i.model.modified:null)});let n=this._diffModelSrc.get()?.createNewRef(this);this._diffModelSrc.set(e?.createNewRef(this),t),setTimeout(()=>{n?.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){let e=this._diffModel.get()?.diff.get();return e?e.mappings.map(e=>{let t,i,n,s;let r=e.lineRangeMapping,o=r.innerChanges;return r.original.isEmpty?(t=r.original.startLineNumber-1,i=0,o=void 0):(t=r.original.startLineNumber,i=r.original.endLineNumberExclusive-1),r.modified.isEmpty?(n=r.modified.startLineNumber-1,s=0,o=void 0):(n=r.modified.startLineNumber,s=r.modified.endLineNumberExclusive-1),{originalStartLineNumber:t,originalEndLineNumber:i,modifiedStartLineNumber:n,modifiedEndLineNumber:s,charChanges:o?.map(e=>({originalStartLineNumber:e.originalRange.startLineNumber,originalStartColumn:e.originalRange.startColumn,originalEndLineNumber:e.originalRange.endLineNumber,originalEndColumn:e.originalRange.endColumn,modifiedStartLineNumber:e.modifiedRange.startLineNumber,modifiedStartColumn:e.modifiedRange.startColumn,modifiedEndLineNumber:e.modifiedRange.endLineNumber,modifiedEndColumn:e.modifiedRange.endColumn}))}}):null}getDiffComputationResult(){let e=this._diffModel.get()?.diff.get();return e?{changes:this.getLineChanges(),changes2:e.mappings.map(e=>e.lineRangeMapping),identical:e.identical,quitEarly:e.quitEarly}:null}revert(e){let t=this._diffModel.get();t&&t.isDiffUpToDate.get()&&(this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}]),this._editors.modified.pushUndoStop())}revertRangeMappings(e){let t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;let i=e.map(e=>({range:e.modifiedRange,text:t.model.original.getValueInRange(e.originalRange)}));this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",i),this._editors.modified.pushUndoStop()}revertFocusedRangeMappings(){let e=this._diffModel.get();if(!e||!e.isDiffUpToDate.get())return;let t=this._diffModel.get()?.diff.get()?.mappings;if(!t||0===t.length)return;let i=this._editors.modified;if(!i.hasTextFocus())return;let n=i.getPosition().lineNumber,s=i.getSelection(),r=c5.fromRange(s||new s9(n,0,n,0
671)),o=t.filter(e=>e.lineRangeMapping.modified.intersect(r));i.pushUndoStop(),i.executeEdits("diffEditor",o.map(t=>({range:t.lineRangeMapping.modified.toExclusiveRange(),text:e.model.original.getValueInRange(t.lineRangeMapping.original.toExclusiveRange())}))),i.pushUndoStop()}_goTo(e){this._editors.modified.setPosition(new s3(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){let t;let i=this._diffModel.get()?.diff.get()?.mappings;if(!i||0===i.length)return;let n=this._editors.modified.getPosition().lineNumber;t="next"===e?this._editors.modified.getModel().getLineCount()===n?i[0]:i.find(e=>e.lineRangeMapping.modified.startLineNumber>n)??i[0]:cJ(i,e=>e.lineRangeMapping.modified.startLineNumber<n)??i[i.length-1],this._goTo(t),t.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Hf.diffLineDeleted,{source:"diffEditor.goToDiff"}):t.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Hf.diffLineInserted,{source:"diffEditor.goToDiff"}):t&&this._accessibilitySignalService.playSignal(Hf.diffLineModified,{source:"diffEditor.goToDiff"})}revealFirstDiff(){let e=this._diffModel.get();e&&this.waitForDiff().then(()=>{let t=e.diff.get()?.mappings;t&&0!==t.length&&this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){let e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){let e;let t=this._editors.modified.hasWidgetFocus(),i=t?this._editors.modified:this._editors.original,n=t?this._editors.original:this._editors.modified,s=i.getSelection();if(s){let i=this._diffModel.get()?.diff.get()?.mappings.map(e=>t?e.lineRangeMapping.flip():e.lineRangeMapping);if(i){let t=H7(s.getStartPosition(),i),n=H7(s.getEndPosition(),i);e=s9.plusRange(t,n)}}return{destination:n,destinationSelection:e}}switchSide(){let{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){let e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){let e=this._diffModel.get()?.unchangedRegions.get();e&&aM(t=>{for(let i of e)i.collapseAll(t)})}showAllUnchangedRegions(){let e=this._diffModel.get()?.unchangedRegions.get();e&&aM(t=>{for(let i of e)i.showAll(t)})}_handleCursorPositionChange(e,t){if(e?.reason===3){let i=this._diffModel.get()?.diff.get()?.mappings.find(i=>t?i.lineRangeMapping.modified.contains(e.position.lineNumber):i.lineRangeMapping.original.contains(e.position.lineNumber));i?.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(Hf.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):i?.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(Hf.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):i&&this._accessibilitySignalService.playSignal(Hf.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};Uk=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Ux(3,hZ),Ux(4,he),Ux(5,hi),Ux(6,Hu),Ux(7,Ab)],Uk),i(17649);var UN=function(e,t){return function(i,n){t(i,n,e)}};let UD=class{static{sa=this}static{this._ttpTokenizer=ut("tokenizeToString",{createHTML:e=>e})}constructor(e,t){this._configurationService=e,this._languageService=t}async renderCodeBlock(e,t,i){var n;let s;let r=(n=i.context)&&"function"==typeof n.getEditorType&&n.getEditorType()===fb.ICodeEditor?i.context:void 0;e?s=this._languageService.getLanguageIdByLanguageName(e):r&&(s=r.getModel()?.getLanguageId()),s||(s=u0);let o=await Dy(this._languageService,t,s),a=sa._ttpTokenizer?sa._ttpTokenizer.createHTML(o)??o:o,l=document.createElement("span");l.innerHTML=a;let h=l.querySelector(".monaco-tokenized-source");return l_(h)?(l5(h,this.getFontInfo(r)),l):document.createElement("span")}getFontInfo(e){return e?e.getOption(59):function(e,t,i=!1){let n=sh.BH.fontFamily.validate(e.fontFamily),s=sh.BH.fontWeight.validate(e.fontWeight),r=sh.BH.fontSize.validate(e.fontSize),o=sh.BH.fontLigatures2.validate(e.fontLigatures),a=sh.BH.fontVariations.validate(e.fontVariations),l=sh.BH.lineHeight.validate(e.lineHeight),h=sh.BH.letterSpacing.validate(e.letterSpacing);return l7.E4._create(n,s,r,o,a,l,h,1,i)}({fontFamily:this._configurationService.getValue("editor").fontFamily},0)}};UD=sa=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([UN(0,uE),UN(1,uR)],UD);var UE=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o},UT=function(e,t){return function(i,n){t(i,n,e)}};let UI=0,UM=!1,UR=class extends D4{constructor(e,t,i,n,s,r,o,a,l,h,d,u,c,g){let f={...t};f.ariaLabel=f.ariaLabel||nO.editorViewAccessibleLabel,super(e,f,{},i,n,s,r,l,h,d,u,c),a instanceof HT?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,function(e){if(!e){if(UM)return;UM=!0}!function(e){(_=document.createElement("div")).className="monaco-aria-container";let t=()=>{let e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),_.appendChild(e),e};v=t(),b=t();let i=()=>{let e=document.createElement("div");return e.className="monaco-status",e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),_.appendChild(e),e};C=i(),w=i(),e.appendChild(_)}(e||rb.document.body)}(f.ariaContainerElement),AQ=(e,t)=>i.createInstance(Th,e,{instantHover:t},{}),A1=o,g.setDefaultCodeBlockRenderer(i.createInstance(UD))}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;let n="DYNAMIC_"+ ++UI,s=hI.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,s),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),ro.JT.None;let t=e.id,i=e.label,n=hI.and(hI.equals("editorId",this.getId()),hI.deserialize(e.precondition)),s=e.keybindings,r=hI.and(n,hI.deserialize(e.keybindingContext)),o=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),h=new ro.SL,d=this.getId()+":"+t;if(h.add(hf.registerCommand(d,l)),o&&h.add(di.appendMenuItem(h8.EditorContext,{command:{id:d,title:i},when:n,group:o,order:a})),Array.isArray(s))for(let e of s)h.add(this._standaloneKeybindingService.addDynamicKeybinding(d,e,l,r));let u=new LE(d,i,i,void 0,n,(...t)=>Promise.resolve(e.run(this,...t)),this._contextKeyService);return this._actions.set(t,u),h.add((0,ro.OF)(()=>{this._actions.delete(t)})),h}_triggerCommand(e,t){if(this._codeEditorService instanceof Ed)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};UR=UE([UT(2,he),UT(3,hi),UT(4,hg),UT(5,hZ),UT(6,Tl),UT(7,SP),UT(8,CG),UT(9,Sd),UT(10,mg),UT(11,u8),UT(12,fa),UT(13,Rc)],UR);let UA=class extends UR{constructor(e,t,i,n,s,r,o,a,l,h,d,u,c,g,f,m,p){let _;let v={...t};HB(d,v,!1);
671let b=l.registerEditorContainer(e);"string"==typeof v.theme&&l.setTheme(v.theme),void 0!==v.autoDetectHighContrast&&l.setAutoDetectHighContrast(!!v.autoDetectHighContrast);let C=v.model;if(delete v.model,super(e,v,i,n,s,r,o,a,l,h,u,f,m,p),this._configurationService=d,this._standaloneThemeService=l,this._register(b),void 0===C){let e=g.getLanguageIdByMimeType(v.language)||v.language||u0;_=UP(c,g,v.value||"",e,void 0),this._ownsModel=!0}else _=C,this._ownsModel=!1;if(this._attachModel(_),_){let e={oldModelUrl:null,newModelUrl:_.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){HB(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};UA=UE([UT(2,he),UT(3,hi),UT(4,hg),UT(5,hZ),UT(6,Tl),UT(7,SP),UT(8,WV),UT(9,Sd),UT(10,uE),UT(11,mg),UT(12,hn),UT(13,uR),UT(14,u8),UT(15,fa),UT(16,Rc)],UA);let UO=class extends Uk{constructor(e,t,i,n,s,r,o,a,l,h,d,u){let c={...t};HB(a,c,!0);let g=r.registerEditorContainer(e);"string"==typeof c.theme&&r.setTheme(c.theme),void 0!==c.autoDetectHighContrast&&r.setAutoDetectHighContrast(!!c.autoDetectHighContrast),super(e,c,{},n,i,s,u,h),this._configurationService=a,this._standaloneThemeService=r,this._register(g)}dispose(){super.dispose()}updateOptions(e){HB(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(UR,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};function UP(e,t,i,n,s){if(i=i||"",!n){let n=i.indexOf("\n"),r=i;return -1!==n&&(r=i.substring(0,n)),UF(e,i,t.createByFilepathOrFirstLine(s||null,r),s)}return UF(e,i,t.createById(n),s)}function UF(e,t,i,n){return e.createModel(t,i,n)}UO=UE([UT(2,he),UT(3,hZ),UT(4,hi),UT(5,WV),UT(6,Sd),UT(7,uE),UT(8,Tu),UT(9,Ab),UT(10,WX),UT(11,Hu)],UO),mM("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},(0,rh.NC)(142,"The background color of the diff editor's header")),mM("multiDiffEditor.background",m1,(0,rh.NC)(143,"The background color of the multi file diff editor")),mM("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},(0,rh.NC)(144,"The border color of the multi file diff editor"));var UB=function(e,t){return function(i,n){t(i,n,e)}};class UV{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let UW=class extends ro.JT{constructor(e,t,i,n,s){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=n,this._viewModel=aU(this,void 0),this._collapsed=ay(this,e=>this._viewModel.read(e)?.collapsed.read(e)),this._editorContentHeight=aU(this,500),this.contentHeight=ay(this,e=>(this._collapsed.read(e)?0:this._editorContentHeight.read(e))+this._outerEditorHeight),this._modifiedContentWidth=aU(this,0),this._modifiedWidth=aU(this,0),this._originalContentWidth=aU(this,0),this._originalWidth=aU(this,0),this.maxScroll=ay(this,e=>{let t=this._modifiedContentWidth.read(e)-this._modifiedWidth.read(e),i=this._originalContentWidth.read(e)-this._originalWidth.read(e);return t>i?{maxScroll:t,width:this._modifiedWidth.read(e)}:{maxScroll:i,width:this._originalWidth.read(e)}}),this._elements=lV("div.multiDiffEntry",[lV("div.header@header",[lV("div.header-content",[lV("div.collapse-button@collapseButton"),lV("div.file-path",[lV("div.title.modified.show-file-icons@primaryPath",[]),lV("div.status.deleted@status",["R"]),lV("div.title.original.show-file-icons@secondaryPath",[])]),lV("div.actions@actions")])]),lV("div.editorParent",[lV("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(Uk,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode,fixedOverflowWidgets:!0},{})),this.isModifedFocused=z0(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=z0(this.editor.getOriginalEditor()).isFocused,this.isFocused=ay(this,e=>this.isModifedFocused.read(e)||this.isOriginalFocused.read(e)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new ro.SL),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;let r=new P6(this._elements.collapseButton,{});this._register(aN(e=>{r.element.className="",r.icon=this._collapsed.read(e)?rr.chevronRight:rr.chevronDown})),this._register(r.onDidClick(()=>{this._viewModel.get()?.collapsed.set(!this._collapsed.get(),void 0)})),this._register(aN(e=>{this._elements.editor.style.display=this._collapsed.read(e)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(e=>
671{let t=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(t,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(e=>{let t=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(t,void 0)})),this._register(this.editor.onDidContentSizeChange(e=>{aR(t=>{this._editorContentHeight.set(e.contentHeight,t),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),t),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),t)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(e=>{if(this._isSettingScrollTop||!e.scrollTopChanged||!this._data)return;let t=e.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(t)})),this._register(aN(e=>{let t=this._viewModel.read(e)?.isActive.read(e);this._elements.root.classList.toggle("active",t)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(s.createScoped(this._elements.actions));let o=this._register(this._instantiationService.createChild(new D2([hZ,this._contextKeyService])));this._register(o.createInstance(Ul,this._elements.actions,h8.MultiDiffEditorFileToolbar,{actionRunner:this._register(new Ud(()=>this._viewModel.get()?.modifiedUri??this._viewModel.get()?.originalUri)),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:e=>e.startsWith("navigation")},actionViewItemProvider:(e,t)=>Pe(o,e,t)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){function t(e){return{...e,scrollBeyondLastLine:!1,hideUnch
671angedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(this._data=e,!e){aR(e=>{this._viewModel.set(void 0,e),this.editor.setDiffModel(null,e),this._dataStore.clear()});return}let i=e.viewModel.documentDiffItem;if(aR(n=>{this._resourceLabel?.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:void 0===e.viewModel.modifiedUri});let s=!1,r=!1,o=!1,a="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(a="R",s=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(a="A",o=!0):(a="D",r=!0),this._elements.status.classList.toggle("renamed",s),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",o),this._elements.status.innerText=a,this._resourceLabel2?.setUri(s?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,n),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,n),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,e=>{e||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(let[t,i]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(t,i)}render(e,t,i,n){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";let s=e.length-this._headerHeight,r=Math.max(0,Math.min(n.start-e.start,s));this._elements.header.style.transform=`translateY(${r}px)`,aR(i=>{this.editor.layout({width:t-16-2,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===s)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};UW=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([UB(3,he),UB(4,hZ)],UW);class UH{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(0===this._unused.size)t=this._create(e),this._itemData.set(t,e);else{let i=[...this._unused.values()];t=i.find(t=>this._itemData.get(t).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(let e of this._used)e.dispose();for(let e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}i(15890);var Uz=function(e,t){return function(i,n){t(i,n,e)}};let UU=class extends ro.JT{constructor(e,t,i,n,s,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=n,this._parentContextKeyService=s,this._parentInstantiationService=r,this._scrollableElements=lV("div.scrollContent",[lV("div@content",{style:{overflow:"hidden"}}),lV("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new v5({forceIntegerValues:!1,scheduleAtNextAnimationFrame:e=>u(aG(this._element),e),smoothScrollDuration:100})),this._scrollableElement=this._register(new bt(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=lV("div.monaco-component.multiDiffEditor",{},[lV("div",{},[this._scrollableElement.getDomNode()]),lV("div.placeholder@placeholder",{},[lV("div")])]),this._sizeObserver=this._register(new HX(this._element,void 0)),this._objectPool=this._register(new UH(e=>{let t=this._instantiationService.createInstance(UW,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return t.setData(e),t})),this.scrollTop=aP(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=aP(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=ay(this,e=>{let t=this._viewModel.read(e);if(!t)return{items:[],getItem:e=>{throw new o_.he}};let i=t.items.read(e),n=new Map;return{items:i.map(t=>{let i=e.store.add(new UK(t,this._objectPool,this.scrollLeft,e=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+e})})),s=this._lastDocStates?.[i.getKey()];return s&&aM(e=>
671{i.setViewState(s,e)}),n.set(t,i),i}),getItem:e=>n.get(e)}}),this._viewItems=this._viewItemsInfo.map(this,e=>e.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(e,t)=>e.reduce((e,i)=>e+i.contentHeight.read(t)+this._spaceBetweenPx,0)),this.activeControl=ay(this,e=>{let t=this._viewModel.read(e)?.activeDiffItem.read(e);if(!t)return;let i=this._viewItemsInfo.read(e).getItem(t);return i.template.read(e)?.editor}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new D2([hZ,this._contextKeyService]))),this._contextKeyService.createKey(i8.inMultiDiffEditor.key,!0),this._lastDocStates={},this._register(aT((e,t)=>{let i=this._viewModel.read(e);if(i&&i.contextKeys)for(let[e,n]of Object.entries(i.contextKeys)){let i=this._contextKeyService.createKey(e,void 0);i.set(n),t.add((0,ro.OF)(()=>i.reset()))}}));let o=this._parentContextKeyService.createKey(i8.multiDiffEditorAllCollapsed.key,!1);this._register(aN(e=>{let t=this._viewModel.read(e);if(t){let i=t.items.read(e).every(t=>t.collapsed.read(e));o.set(i)}})),this._register(aN(e=>{let t=this._dimension.read(e);this._sizeObserver.observe(t)}));let a=ay(e=>{if(this._viewItems.read(e).length>0)return;let t=this._viewModel.read(e);return!t||t.isLoading.read(e)?(0,rh.NC)(145,"Loading..."):(0,rh.NC)(146,"No Changed Files")});this._register(aN(e=>{let t=a.read(e);this._elements.placeholder.innerText=t??"",this._elements.placeholder.classList.toggle("visible",!!t)})),this._scrollableElements.content.style.position="relative",this._register(aN(e=>{let t=this._sizeObserver.height.read(e);this._scrollableElements.root.style.height=`${t}px`;let i=this._totalHeight.read(e);this._scrollableElements.content.style.height=`${i}px`;let n=this._sizeObserver.width.read(e),s=n,r=c2(this._viewItems.read(e),(0,as.tT)(t=>t.maxScroll.read(e).maxScroll,as.fv));r&&(s=n+r.maxScroll.read(e).maxScroll),this._scrollableElement.setScrollDimensions({width:n,height:t,scrollHeight:i,scrollWidth:s})})),e.replaceChildren(this._elements.root),this._register((0,ro.OF)(()=>{e.replaceChildren()})),this._register(aN(e=>{let t=this._viewModel.read(e);if(t&&!t.isLoading.read(e)){if(0===t.items.read(e).length||t.activeDiffItem.read(e))return;this.goToNextChange()}})),this._register(this._register(aN(e=>{aR(t=>{this.render(e)})})))}reveal(e,t){let i=this._viewItems.get(),n=i.findIndex(t=>t.viewModel.originalUri?.toString()===e.original?.toString()&&t.viewModel.modifiedUri?.toString()===e.modified?.toString());if(-1===n)throw new o_.he("Resource not found in diff editor");let s=i[n];this._viewModel.get().activeDiffItem.setCache(s.viewModel,void 0);let r=0;for(let e=0;e<n;e++)r+=i[e].contentHeight.get()+this._spaceBetweenPx;this._scrollableElement.setScrollPosition({scrollTop:r});let o=s.template.get()?.editor,a="original"in e?o?.getOriginalEditor():o?.getModifiedEditor();a&&t?.range&&(a.revealRangeInCenter(t.range),function(e,t){let i=e.getModel(),n=e.createDecorationsCollection([{range:t,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{e.getModel()===i&&n.clear()},350)}(a,t.range))}goToNextChange(){this._navigateToChange("next")}_navigateToChange(e){let t=this._viewItems.get();if(0===t.length)return;let i=this._viewModel.get()?.activeDiffItem.get(),n=i?t.findIndex(e=>e.viewModel===i):-1;if(-1===n){this._goToFile(0,"first");return}let s=t[n];s.viewModel.collapsed.get()&&s.viewModel.collapsed.set(!1,void 0);let r=s.template.get()?.editor;if(r?.getDiffComputationResult()?.changes2?.length){let t=r.getModifiedEditor().getPosition()?.lineNumber||1,i=r.getDiffComputationResult().changes2;if("next"===e?i.some(e=>e.modified.startLineNumber>t):i.some(e=>e.modified.endLineNumberExclusive<=t)){r.goToDiff(e);return}}let o=(n+("next"===e?1:-1)+t.length)%t.length;this._goToFile(o,"next"===e?"first":"last")}_goToFile(e,t){let i=this._viewItems.get()[e];i.viewModel.collapsed.get()&&i.viewModel.collapsed.set(!1,void 0),this.reveal({original:i.viewModel.originalUri,modified:i.viewModel.modifiedUri});let n=i.template.get()?.editor;if(n?.getDiffComputationResult()?.changes2?.length){if("first"===t)n.revealFirstDiff();else{let e=n.getDiffComputationResult().changes2.at(-1),t=n.getModifiedEditor();t.setPosition({lineNumber:e.modified.startLineNumber,column:1}),t.revealLineInCenter(e.modified.startLineNumber)}}n?.focus()}render(e){let t=this.scrollTop.read(e),i=0,n=0,s=0,r=this._sizeObserver.height.read(e),o=cQ.ofStartAndLength(t,r),a=this._sizeObserver.width.read(e);for(let l of this._viewItems.read(e)){let h=l.contentHeight.read(e),d=Math.min(h,r),u=cQ.ofStartAndLength(n,d),c=cQ.ofStartAndLength(s,h);if(c.isBefore(o))i-=h-d,l.hide();
671else if(c.isAfter(o))l.hide();else{let e=Math.max(0,Math.min(o.start-c.start,h-d));i-=e;let n=cQ.ofStartAndLength(t+i,r);l.render(u,e,a,n)}n+=d+this._spaceBetweenPx,s+=h+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};UU=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([Uz(4,hZ),Uz(5,he)],UU);class UK extends ro.JT{constructor(e,t,i,n){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=n,this._templateRef=this._register(a$(this,void 0)),this.contentHeight=ay(this,e=>this._templateRef.read(e)?.object.contentHeight?.read(e)??this.viewModel.lastTemplateData.read(e).contentHeight),this.maxScroll=ay(this,e=>this._templateRef.read(e)?.object.maxScroll.read(e)??{maxScroll:0,scrollWidth:0}),this.template=ay(this,e=>this._templateRef.read(e)?.object),this._isHidden=aU(this,!1),this._isFocused=ay(this,e=>this.template.read(e)?.isFocused.read(e)??!1),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(aN(e=>{let t=this._scrollLeft.read(e);this._templateRef.read(e)?.object.setScrollLeft(t)})),this._register(aN(e=>{let t=this._templateRef.read(e);!t||!this._isHidden.read(e)||t.object.isFocused.read(e)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){return`VirtualViewItem(${this.viewModel.documentDiffItem.modified?.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);let i=this.viewModel.lastTemplateData.get(),n=e.selections?.map(s8.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:n},t);let s=this._templateRef.get();s&&n&&s.object.editor.setSelections(n)}_updateTemplateData(e){let t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){let e=this._templateRef.get();e&&aM(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,n){this._isHidden.set(!1,void 0);let s=this._templateRef.get();if(!s){s=this._objectPool.getUnusedObj(new UV(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(s,void 0);let e=this.viewModel.lastTemplateData.get().selections;e&&s.object.editor.setSelections(e)}s.object.render(e,i,t,n)}}let U$=class extends ro.JT{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=aU(this,void 0),this._viewModel=aU(this,void 0),this._widgetImpl=ay(this,e=>e.store.add(this._instantiationService.createInstance(UU,this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))),this._register(aB(this._widgetImpl))}};function Uj(e){let t=si.get(SP);return t instanceof HT?t.addDynamicKeybindings(e.map(e=>({keybinding:e.keybinding,command:e.command,commandArgs:e.commandArgs,when:hI.deserialize(e.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),ro.JT.None)}function Uq(e,t){return"boolean"==typeof e?e:t}function UG(e,t){return"string"==typeof e?e:t}function UQ(e,t=!1){t&&(e=e.map(function(e){return e.toLowerCase()}));let i=function(e){let t={};for(let i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function UY(e,t,i){let n;t=t.replace(/@@/g,`\x01`);let s=0;do n=!1,t=t.replace(/@(\w+)/g,function(i,s){n=!0;let r="";if("string"==typeof e[s])r=e[s];else if(e[s]&&e[s]instanceof RegExp)r=e[s].source;else{if(void 0===e[s])throw fJ(e,"language definition does not contain attribute '"+s+"', used at: "+t);throw fJ(e,"attribute reference '"+s+"' must be a string, used at: "+t)}return r?"(?:"+r+")":""}),s++;while(n&&s<5);t=t.replace(/\x01/g,"@");let r=(e.ignoreCase?"i":"")+(e.unicode?"u":"");
671if(i&&t.match(/\$[sS](\d\d?)/g)){let i=null,n=null;return s=>{let o;return n&&i===s?n:(i=s,n=new RegExp((o=null,t.replace(/\$[sS](\d\d?)/g,function(t,i){return(null===o&&(o=s.split(".")).unshift(s),i&&i<o.length)?rN(fQ(e,o[i])):""})),r))}}return new RegExp(t,r)}U$=function(e,t,i,n){var s,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,i,o):s(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}([function(e,t){he(e,t,2)}],U$);class UJ{constructor(e){this.regex=RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if("string"==typeof t)i=t;else if(t instanceof RegExp)i=t.source;else throw fJ(e,"rules must start with a match string or regular expression: "+this.name);this.matchOnlyAtLineStart=i.length>0&&"^"===i[0],this.name=this.name+": "+i,this.regex=UY(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=function e(t,i,n){if(!n)return{token:""};if("string"==typeof n)return n;if(n.token||""===n.token){if("string"!=typeof n.token)throw fJ(t,"a 'token' attribute must be of type string, in rule: "+i);{let e={token:n.token};if(n.token.indexOf("$")>=0&&(e.tokenSubst=!0),"string"==typeof n.bracket){if("@open"===n.bracket)e.bracket=1;else if("@close"===n.bracket)e.bracket=-1;else throw fJ(t,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+i)}if(n.next){if("string"!=typeof n.next)throw fJ(t,"the next state must be a string value in rule: "+i);{let s=n.next;if(!/^(@pop|@push|@popall)$/.test(s)&&("@"===s[0]&&(s=s.substr(1)),0>s.indexOf("$")&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;let t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(t,fZ(t,s,"",[],""))))throw fJ(t,"the next state '"+n.next+"' is not defined in rule: "+i);e.next=s}}return"number"==typeof n.goBack&&(e.goBack=n.goBack),"string"==typeof n.switchTo&&(e.switchTo=n.switchTo),"string"==typeof n.log&&(e.log=n.log),"string"==typeof n.nextEmbedded&&(e.nextEmbedded=n.nextEmbedded,t.usesEmbedded=!0),e}}if(Array.isArray(n)){let s=[];for(let r=0,o=n.length;r<o;r++)s[r]=e(t,i,n[r]);return{group:s}}if(n.cases){let s=[],r=!1;for(let o in n.cases)if(n.cases.hasOwnProperty(o)){let a=e(t,i,n.cases[o]);"@default"===o||"@"===o||""===o?s.push({test:void 0,value:a,name:o}):"@eos"===o?s.push({test:function(e,t,i,n){return n},value:a,name:o}):s.push(function(e,t,i,n){let s,r=-1,o=i,a=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);a&&(a[3]&&(r=parseInt(a[3]),a[2]&&(r+=100)),o=a[4]);let l="~",h=o;if(o&&0!==o.length?/^\w*$/.test(h)?l="==":(a=o.match(/^(@|!@|~|!~|==|!=)(.*)$/))&&(l=a[1],h=a[2]):(l="!=",h=""),("~"===l||"!~"===l)&&/^(\w|\|)*$/.test(h)){let t=UQ(h.split("|"),e.ignoreCase);s=function(e){return"~"===l?t(e):!t(e)}}else if("@"===l||"!@"===l){let i=e[h];if(!i)throw fJ(e,"the @ match target '"+h+"' is not defined, in rule: "+t);if(!function(e,t){if(!t||!Array.isArray(t))return!1;for(let i of t)if(!e(i))return!1;return!0}(function(e){return"string"==typeof e},i))throw fJ(e,"the @ match target '"+h+"' must be an array of strings, in rule: "+t);let n=UQ(i,e.ignoreCase);s=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l){if(0>h.indexOf("$")){let t=UY(e,"^"+h+"$",!1);s=function(e){return"~"===l?t.test(e):!t.test(e)}}else s=function(t,i,n,s){return UY(e,"^"+fZ(e,h,i,n,s)+"$",!1).test(t)}}else if(0>h.indexOf("$")){let t=fQ(e,h);s=function(e){return"=="===l?e===t:e!==t}}else{let t=fQ(e,h);s=function(i,n,s,r,o){let a=fZ(e,t,n,s,r);return"=="===l?i===a:i!==a}}return -1===r?{name:i,value:n,test:function(e,t,i,n){return s(e,e,t,i,n)}}:{name:i,value:n,test:function(e,t,i,n){let o=function(e,t,i,n){if(n<0)return e;if(n<t.length)return t[n];if(n>=100){n-=100;let e=i.split(".");if(e.unshift(i),n<e.length)return e[n]}return null}(e,t,i,r);return s(o||"",e,t,i,n)}}}(t,i,o,a)),r||(r=!(0,re.HD)(a)&&(a.hasEmbeddedEndInCases||["@pop","@popall"].includes(a.nextEmbedded||"")))}let o=t.defaultToken;return{hasEmbeddedEndInCases:r,test:function(e,t,i,n){for(let r of s)if(!r.test||r.test(e,t,i,n))return r.value;return o}}}throw fJ(t,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+i)}(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function UZ(e,t){if(!t||"object"!=typeof t)throw Error("Monarch: expecting a language definition object");let i={languageId:e,includeLF:Uq(t.includeLF,!1),noThrow:!1,maxStack:100,start:"string"==typeof t.start?t.start:null,ignoreCase:Uq(t.ignoreCase,!1),unicode:Uq(t.unicode,!1),tokenPostfix:UG(t.tokenPostfix,"."+e),defaultToken:UG(t.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]};if(t.languageId=e,t.includeLF=i.includeLF,t.ignoreCase=i.ignoreCase,t.unicode=i.unicode,t.noThrow=i.noThrow,t.usesEmbedded=i.usesEmbedded,t.stateNames=t.tokenizer,t.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw fJ(i,"a language definition must define the 'tokenizer' attribute as an object");for(let e in i.tokenizer=[],t.tokenizer)if(t.tokenizer.hasOwnProperty(e)){i.start||(i.start=e);let n=t.tokenizer[e];i.tokenizer[e]=[],function e(n,s,r){for(let o of r){let r=o.include;if(r){if("string"!=typeof r)throw fJ(i,"an 'include' attribute must be a string at: "+n);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw fJ(i,"include target '"+r+"' is not defined at: "+n);e(n+"."+r,s,t.tokenizer[r])}else{let e=new UJ(n);if(Array.isArray(o)&&o.length>=1&&o.length<=3){if(e.setRegex(t,o[0]),o.length>=3){if("string"==typeof o[1])e.setAction(t,{token:o[1],next:o[2]});else if("object"==typeof o[1]){let i=o[1];i.next=o[2],e.setAction(t,i)}
671else throw fJ(i,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+n)}else e.setAction(t,o[1])}else{if(!o.regex)throw fJ(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+n);o.name&&"string"==typeof o.name&&(e.name=o.name),o.matchOnlyAtStart&&(e.matchOnlyAtLineStart=Uq(o.matchOnlyAtLineStart,!1)),e.setRegex(t,o.regex),e.setAction(t,o.action)}s.push(e)}}}("tokenizer."+e,i.tokenizer[e],n)}if(i.usesEmbedded=t.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw fJ(i,"the 'brackets' attribute must be defined as an array")}else t.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];let n=[];for(let e of t.brackets){let t=e;if(t&&Array.isArray(t)&&3===t.length&&(t={token:t[2],open:t[0],close:t[1]}),t.open===t.close)throw fJ(i,"open and close brackets in a 'brackets' attribute must be different: "+t.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"==typeof t.open&&"string"==typeof t.token&&"string"==typeof t.close)n.push({token:t.token+i.tokenPostfix,open:fQ(i,t.open),close:fQ(i,t.close)});else throw fJ(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return i.brackets=n,i.noThrow=!0,i}class UX{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if("function"==typeof this._actual.tokenize)return U1.adaptTokenize(this._languageId,this._actual,e,i);throw Error("Not supported!")}tokenizeEncoded(e,t,i){let n=this._actual.tokenizeEncoded(e,i);return new rc(n.tokens,n.endState)}}class U1{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){let i=[],n=0;for(let s=0,r=e.length;s<r;s++){let r=e[s],o=r.startIndex;0===s?o=0:o<n&&(o=n),i[s]=new rd(o,r.scopes,t),n=o}return i}static adaptTokenize(e,t,i,n){let s=t.tokenize(i,n);return new ru(U1._toClassicTokens(s.tokens,e),s.endState.equals(n)?n:s.endState)}tokenize(e,t,i){return U1.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){let i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[],r=0,o=0;for(let e=0,a=t.length;e<a;e++){let a=t[e],l=1024|n.match(i,a.scopes);if(r>0&&s[r-1]===l)continue;let h=a.startIndex;0===e?h=0:h<o&&(h=o),s[r++]=h,s[r++]=l,o=h}let a=new Uint32Array(r);for(let e=0;e<r;e++)a[e]=s[e];return a}tokenizeEncoded(e,t,i){let n=this._actual.tokenize(e,i);return new rc(this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens),n.endState.equals(i)?i:n.endState)}}function U0(e){return e&&"function"==typeof e.then}function U2(e,t){return"tokenizeEncoded"in t?new UX(e,t):new U1(e,t,si.get(uR),si.get(WV))}function U5(e,t){let i=new rm(async()=>{let i=await Promise.resolve(t.create());return i?"function"==typeof i.getInitialState?U2(e,i):new f3(si.get(uR),si.get(WV),e,UZ(e,i),si.get(uE)):null});return rp.registerFactory(e,i)}let U4=ht("IEditorCancelService"),U6=new hJ("cancellableOperation",!1,(0,rh.NC)(939,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));uP(U4,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext(e=>({key:U6.bindTo(e.get(hZ)),tokens:new hu.S})),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){let t=this._tokens.get(e);if(!t)return;let i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},1),dj(new class extends d${constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:U6})}runEditorCommand(e,t){e.get(U4).cancel(t)}});class U7{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}
671class U3{constructor(e){if(this._set=new Set,e)for(let t of e)this.add(t)}add(e){this._set.add(U7.toKey(e))}has(e){return this._set.has(U7.toKey(e))}}class U9{static{this._selectors=new hu.S}static setFormatterSelector(e){return{dispose:U9._selectors.unshift(e)}}static async select(e,t,i,n){if(0===e.length)return;let s=hc.$.first(U9._selectors);if(s)return await s(e,t,i,n)}}async function U8(e,t,i,n,s,r){for(let o of t.documentRangeFormattingEditProvider.ordered(i)){let t=await Promise.resolve(o.provideDocumentRangeFormattingEdits(i,n,s,r)).catch(o_.Cp);if((0,as.Of)(t))return await e.computeMoreMinimalEdits(i.uri,t)}}async function Ke(e,t,i,n,s){for(let r of function(e,t,i){let n=[],s=new U3;for(let t of e.ordered(i))n.push(t),t.extensionId&&s.add(t.extensionId);for(let e of t.ordered(i)){if(e.extensionId){if(s.has(e.extensionId))continue;s.add(e.extensionId)}n.push({displayName:e.displayName,extensionId:e.extensionId,provideDocumentFormattingEdits:(t,i,n)=>e.provideDocumentRangeFormattingEdits(t,t.getFullModelRange(),i,n)})}return n}(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,i)){let t=await Promise.resolve(r.provideDocumentFormattingEdits(i,n,s)).catch(o_.Cp);if((0,as.Of)(t))return await e.computeMoreMinimalEdits(i.uri,t)}}hf.registerCommand("_executeFormatRangeProvider",async function(e,...t){let[i,n,s]=t;(0,re.p_)(sJ.isUri(i)),(0,re.p_)(s9.isIRange(n));let r=e.get(hs),o=e.get(P_),a=e.get(fa),l=await r.createModelReference(i);try{return U8(o,a,l.object.textEditorModel,s9.lift(n),s,tI.None)}finally{l.dispose()}}),hf.registerCommand("_executeFormatDocumentProvider",async function(e,...t){let[i,n]=t;(0,re.p_)(sJ.isUri(i));let s=e.get(hs),r=e.get(P_),o=e.get(fa),a=await s.createModelReference(i);try{return Ke(r,o,a.object.textEditorModel,n,tI.None)}finally{a.dispose()}}),hf.registerCommand("_executeFormatOnTypeProvider",async function(e,...t){let[i,n,s,r]=t;(0,re.p_)(sJ.isUri(i)),(0,re.p_)(s3.isIPosition(n)),(0,re.p_)("string"==typeof s);let o=e.get(hs),a=e.get(P_),l=e.get(fa),h=await o.createModelReference(i);try{return function(e,t,i,n,s,r,o){let a=t.onTypeFormattingEditProvider.ordered(i);return 0===a.length||0>a[0].autoFormatTriggerCharacters.indexOf(s)?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(i,n,s,r,o)).catch(o_.Cp).then(t=>e.computeMoreMinimalEdits(i.uri,t))}(a,l,h.object.textEditorModel,s3.lift(n),s,r,tI.None)}finally{h.dispose()}}),sh.BH.wrappingIndent.defaultValue=0,sh.BH.glyphMargin.defaultValue=!1,sh.BH.autoIndent.defaultValue=3,sh.BH.overviewRulerLanes.defaultValue=2,U9.setFormatterSelector((e,t,i)=>Promise.resolve(e[0]));let Kt=rv();Kt.editor={create:function(e,t,i){return si.initialize(i||{}).createInstance(UA,e,t)},getEditors:function(){return si.get(hi).listCodeEditors()},getDiffEditors:function(){return si.get(hi).listDiffEditors()},onDidCreateEditor:function(e){return si.get(hi).onCodeEditorAdd(t=>{e(t)})},onDidCreateDiffEditor:function(e){return si.get(hi).onDiffEditorAdd(t=>{e(t)})},createDiffEditor:function(e,t,i){return si.initialize(i||{}).createInstance(UO,e,t)},addCommand:function(e){if("string"!=typeof e.id||"function"!=typeof e.run)throw Error("Invalid command descriptor, `id` and `run` are required properties!");return hf.registerCommand(e.id,e.run)},addEditorAction:function(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");let t=hI.deserialize(e.precondition),i=new ro.SL;if(i.add(hf.registerCommand(e.id,(i,...n)=>d$.runEditorCommand(i,n,t,(t,i,n)=>Promise.resolve(e.run(i,...n))))),e.contextMenuGroupId){let n={command:{id:e.id,title:e.label},when:t,group:e.contextMenuGroupId,order:e.contextMenuOrder||0};i.add(di.appendMenuItem(h8.EditorContext,n))}if(Array.isArray(e.keybindings)){let n=si.get(SP);if(n instanceof HT){let s=hI.and(t,hI.deserialize(e.keybindingContext));i.add(n.addDynamicKeybindings(e.keybindings.map(t=>({keybinding:t,command:e.id,when:s}))))}else console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService")}return i},addKeybindingRule:function(e){return Uj([e])},addKeybindingRules:Uj,createModel:function(e,t,i){let n=si.get(uR),s=n.getLanguageIdByMimeType(t)||t;return UP(si.get(hn),n,e,s,i)},setModelLanguage:function(e,t){let i=si.get(uR),n=i.getLanguageIdByMimeType(t)||t||u0;e.setLanguage(i.createById(n))},setModelMarkers:function(e,t,i){e&&si.get(Pv).changeOne(t,e.uri,i)},getModelMarkers:function(e){return si.get(Pv).read(e)},removeAllMarkers:function(e){si.get(Pv).changeAll(e,[])},onDidChangeMarkers:function(e){return si.get(Pv).onMarkerChanged(e)},getModels:function(){return si.get(hn).getModels()},getModel:function(e){return si.get(hn).getModel(e)},onDidCreateModel:function(e){return si.get(hn).onModelAdded(e)},onWillDisposeModel:function(e){return si.get(hn).onModelRemoved(e)},onDidChangeModelLanguage:function(e){return si.get(hn).onModelLanguageChanged(t=>{e({model:t.model,oldLanguage:t.oldLanguageId})})},createWebWorker:function(e){return new f_(si.get(hn),e)},colorizeElement:function(e,t){let i=si.get(uR),n=si.get(WV);return f8.colorizeElement(n,i,e,t).then(()=>
671{n.registerEditorContainer(e)})},colorize:function(e,t,i){let n=si.get(uR);return si.get(WV).registerEditorContainer(rb.document.body),f8.colorize(n,e,t,i)},colorizeModelLine:function(e,t,i=4){return si.get(WV).registerEditorContainer(rb.document.body),f8.colorizeModelLine(e,t,i)},tokenize:function(e,t){var i;rp.getOrCreate(t);let n=(i=t,rp.get(i)||{getInitialState:()=>fC,tokenize:(e,t,n)=>fw(i,n)}),s=rI(e),r=[],o=n.getInitialState();for(let e=0,t=s.length;e<t;e++){let t=s[e],i=n.tokenize(t,!0,o);r[e]=i.tokens,o=i.endState}return r},defineTheme:function(e,t){si.get(WV).defineTheme(e,t)},setTheme:function(e){si.get(WV).setTheme(e)},remeasureFonts:function(){l8.clearAllFontInfos()},registerCommand:function(e,t){return hf.registerCommand({id:e,handler:t})},registerLinkOpener:function(e){return si.get(Ru).registerOpener({open:async t=>("string"==typeof t&&(t=sJ.parse(t)),e.open(t))})},registerEditorOpener:function(e){return si.get(hi).registerCodeEditorOpenHandler(async(t,i,n)=>{let s;if(!i)return null;let r=t.options?.selection;return(r&&"number"==typeof r.endLineNumber&&"number"==typeof r.endColumn?s=r:r&&(s={lineNumber:r.startLineNumber,column:r.startColumn}),await e.openCodeEditor(i,t.resource,s))?i:null})},AccessibilitySupport:tj,ContentWidgetPositionPreference:tZ,CursorChangeReason:tX,DefaultEndOfLine:t1,EditorAutoIndentStrategy:t2,EditorOption:t5,EndOfLinePreference:t4,EndOfLineSequence:t6,MinimapPosition:il,MinimapSectionHeaderStyle:ih,MouseTargetType:id,OverlayWidgetPositionPreference:ig,OverviewRulerLane:im,GlyphMarginLane:t7,RenderLineNumbersType:iv,RenderMinimap:ib,ScrollbarVisibility:iw,ScrollType:iC,TextEditorCursorBlinkingStyle:iD,TextEditorCursorStyle:iE,TrackedRangeStickiness:iT,WrappingIndent:iI,InjectedTextCursorStops:t8,PositionAffinity:i_,ShowLightbulbIconMode:iS,TextDirection:iN,ConfigurationChangedEvent:sh.Bb,BareFontInfo:l7.E4,FontInfo:l7.pR,TextModelResolvedOptions:cM,FindMatch:cR,ApplyUpdateResult:sh.rk,EditorZoom:fv.C,createMultiFileDiffEditor:function(e,t){let i=si.initialize(t||{});return new U$(e,{},i)},EditorType:fb,EditorOptions:sh.BH},Kt.languages={register:function(e){u1.registerLanguage(e)},getLanguages:function(){return[].concat(u1.getLanguages())},onLanguage:function(e,t){return si.withServices(()=>{let i=si.get(uR).onDidRequestRichLanguageFeatures(n=>{n===e&&(i.dispose(),t())});return i})},onLanguageEncountered:function(e,t){return si.withServices(()=>{let i=si.get(uR).onDidRequestBasicLanguageFeatures(n=>{n===e&&(i.dispose(),t())});return i})},getEncodedLanguageId:function(e){return si.get(uR).languageIdCodec.encodeLanguageId(e)},setLanguageConfiguration:function(e,t){if(!si.get(uR).isRegisteredLanguageId(e))throw Error(`Cannot set configuration for unknown language ${e}`);return si.get(u8).register(e,t,100)},setColorMap:function(e){let t=si.get(WV);if(e){let i=[null];for(let t=1,n=e.length;t<n;t++)i[t]=gX.fromHex(e[t]);t.setColorMapOverride(i)}else t.setColorMapOverride(null)},registerTokensProviderFactory:U5,setTokensProvider:function(e,t){if(!si.get(uR).isRegisteredLanguageId(e))throw Error(`Cannot set tokens provider for unknown language ${e}`);return U0(t)?U5(e,{create:()=>t}):rp.register(e,U2(e,t))},setMonarchTokensProvider:function(e,t){return U0(t)?U5(e,{create:()=>t}):rp.register(e,new f3(si.get(uR),si.get(WV),e,UZ(e,t),si.get(uE)))},registerReferenceProvider:function(e,t){return si.get(fa).referenceProvider.register(e,t)},registerRenameProvider:function(e,t){return si.get(fa).renameProvider.register(e,t)},registerNewSymbolNameProvider:function(e,t){return si.get(fa).newSymbolNamesProvider.register(e,t)},registerCompletionItemProvider:function(e,t){return si.get(fa).completionProvider.register(e,t)},registerSignatureHelpProvider:function(e,t){return si.get(fa).signatureHelpProvider.register(e,t)},registerHoverProvider:function(e,t){return si.get(fa).hoverProvider.register(e,{provideHover:async(e,i,n,s)=>{let r=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n,s)).then(e=>{if(e)return!e.range&&r&&(e.range=new s9(i.lineNumber,r.startColumn,i.lineNumber,r.endColumn)),e.range||(e.range=new s9(i.lineNumber,i.column,i.lineNumber,i.column)),e})}})},registerDocumentSymbolProvider:function(e,t){return si.get(fa).documentSymbolProvider.register(e,t)},registerDocumentHighlightProvider:function(e,t){return si.get(fa).documentHighlightProvider.register(e,t)},registerLinkedEditingRangeProvider:function(e,t){return si.get(fa).linkedEditingRangeProvider.register(e,t)},registerDefinitionProvider:function(e,t){return si.get(fa).definitionProvider.register(e,t)},registerImplementationProvider:function(e,t){return si.get(fa).implementationProvider.register(e,t)},registerTypeDefinitionProvider:function(e,t){return si.get(fa).typeDefinitionProvider.register(e,t)},registerCodeLensProvider:function(e,t){return si.get(fa).codeLensProvider.register(e,t)},registerCodeActionProvider:function(e,t,i){return si.get(fa).codeActionProvider.register(e,{providedCodeActionKinds:i?.providedCodeActionKinds,documentation:i?.documentation,provideCodeActions:(e,i,n,s)=>{let r=si.get(Pv).read({resource:e.uri}).filter(e=>s9.areIntersectingOrTouching(e,i));return t.provideCodeActions(e,i,{markers:r,only:n.only,trigger:n.trigger},s)}
671,resolveCodeAction:t.resolveCodeAction})},registerDocumentFormattingEditProvider:function(e,t){return si.get(fa).documentFormattingEditProvider.register(e,t)},registerDocumentRangeFormattingEditProvider:function(e,t){return si.get(fa).documentRangeFormattingEditProvider.register(e,t)},registerOnTypeFormattingEditProvider:function(e,t){return si.get(fa).onTypeFormattingEditProvider.register(e,t)},registerLinkProvider:function(e,t){return si.get(fa).linkProvider.register(e,t)},registerColorProvider:function(e,t){return si.get(fa).colorProvider.register(e,t)},registerFoldingRangeProvider:function(e,t){return si.get(fa).foldingRangeProvider.register(e,t)},registerDeclarationProvider:function(e,t){return si.get(fa).declarationProvider.register(e,t)},registerSelectionRangeProvider:function(e,t){return si.get(fa).selectionRangeProvider.register(e,t)},registerDocumentSemanticTokensProvider:function(e,t){return si.get(fa).documentSemanticTokensProvider.register(e,t)},registerDocumentRangeSemanticTokensProvider:function(e,t){return si.get(fa).documentRangeSemanticTokensProvider.register(e,t)},registerInlineCompletionsProvider:function(e,t){return si.get(fa).inlineCompletionsProvider.register(e,t)},registerInlayHintsProvider:function(e,t){return si.get(fa).inlayHintsProvider.register(e,t)},DocumentHighlightKind:t0,CompletionItemKind:tQ,CompletionItemTag:tY,CompletionItemInsertTextRule:tG,SymbolKind:ix,SymbolTag:ik,IndentAction:t9,CompletionTriggerKind:tJ,SignatureHelpTriggerKind:iL,InlayHintKind:ie,InlineCompletionTriggerKind:is,CodeActionTriggerType:tq,NewSymbolNameTag:iu,NewSymbolNameTriggerKind:ic,PartialAcceptTriggerKind:ip,HoverVerbosityAction:t3,InlineCompletionEndOfLifeReasonKind:it,InlineCompletionHintStyle:ii,FoldingRangeKind:rf,SelectedSuggestionInfo:rg,EditDeltaInfo:xD};let Ki=Kt.CancellationTokenSource,Kn=Kt.Emitter,Ks=Kt.KeyCode,Kr=Kt.KeyMod,Ko=Kt.Position,Ka=Kt.Range,Kl=Kt.Selection,Kh=Kt.SelectionDirection,Kd=Kt.MarkerSeverity,Ku=Kt.MarkerTag,Kc=Kt.Uri,Kg=Kt.Token,Kf=Kt.editor,Km=Kt.languages,Kp=om(),K_=globalThis;(Kp?.globalAPI||"function"==typeof K_.define&&K_.define.amd)&&(K_.monaco=Kt),void 0!==K_.require&&"function"==typeof K_.require.config&&K_.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});let Kv=globalThis.MonacoEnvironment;Kv?.globalAPI&&(globalThis.monaco=sl)},34187:function(e,t,i){"use strict";i.d(t,{NC:function(){return o},vv:function(){return l}});var n=i(16675);let s="pseudo"===(0,n.f)()||"undefined"!=typeof document&&document.location&&"string"==typeof document.location.hash&&document.location.hash.indexOf("pseudo=true")>=0;function r(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}
671/g,(e,i)=>{let n=t[i[0]],s=e;return"string"==typeof n?s=n:("number"==typeof n||"boolean"==typeof n||null==n)&&(s=String(n)),s}),s&&(i="ï¼»"+i.replace(/[aouei]/g,"$&$&")+"ï¼½"),i}function o(e,t,...i){return"number"==typeof e?r(a(e,t),i):r(t,i)}function a(e,t){let i=n.$()?.[e];if("string"!=typeof i){if("string"==typeof t)return t;throw Error(`!!! NLS MISSING: ${e} !!!`)}return i}function l(e,t,...i){let n;let s=r(n="number"==typeof e?a(e,t):t,i);return{value:s,original:t===n?s:r(t,i)}}},16675:function(e,t,i){"use strict";function n(){return globalThis._VSCODE_NLS_MESSAGES}function s(){return globalThis._VSCODE_NLS_LANGUAGE}i.d(t,{$:function(){return n},f:function(){return s}})},40257:function(e,t,i){"use strict";var n,s;e.exports=(null==(n=i.g.process)?void 0:n.env)&&"object"==typeof(null==(s=i.g.process)?void 0:s.env)?i.g.process:i(44227)},96434:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),i=t[0],n=t[1];return(i+n)*3/4-n},t.toByteArray=function(e){var t,i,r=l(e),o=r[0],a=r[1],h=new s((o+a)*3/4-a),d=0,u=a>0?o-4:o;for(i=0;i<u;i+=4)t=n[e.charCodeAt(i)]<<18|n[e.charCodeAt(i+1)]<<12|n[e.charCodeAt(i+2)]<<6|n[e.charCodeAt(i+3)],h[d++]=t>>16&255,h[d++]=t>>8&255,h[d++]=255&t;return 2===a&&(t=n[e.charCodeAt(i)]<<2|n[e.charCodeAt(i+1)]>>4,h[d++]=255&t),1===a&&(t=n[e.charCodeAt(i)]<<10|n[e.charCodeAt(i+1)]<<4|n[e.charCodeAt(i+2)]>>2,h[d++]=t>>8&255,h[d++]=255&t),h},t.fromByteArray=function(e){for(var t,n=e.length,s=n%3,r=[],o=0,a=n-s;o<a;o+=16383)r.push(function(e,t,n){for(var s,r=[],o=t;o<n;o+=3)r.push(i[(s=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]))>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return r.join("")}(e,o,o+16383>a?a:o+16383));return 1===s?r.push(i[(t=e[n-1])>>2]+i[t<<4&63]+"=="):2===s&&r.push(i[(t=(e[n-2]<<8)+e[n-1])>>10]+i[t>>4&63]+i[t<<2&63]+"="),r.join("")};for(var i=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=r.length;o<a;++o)i[o]=r[o],n[r.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");-1===i&&(i=t);var n=i===t?0:4-i%4;return[i,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},72:function(e,t,i){"use strict";var n=i(675),s=i(783),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,i){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return d(e)}return l(e,t,i)}function l(e,t,i){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw TypeError("Unknown encoding: "+t);var i=0|g(e,t),n=o(i),s=n.write(e,t);return s!==i&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(E(e,ArrayBuffer)||e&&E(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(E(e,SharedArrayBuffer)||e&&E(e.buffer,SharedArrayBuffer)))return function(e,t,i){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),a.prototype),n}(e,t,i);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,i);var s=function(e){if(a.isBuffer(e)){var t,i=0|c(e.length),n=o(i);return 0===n.length||e.copy(n,0,0,i),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?o(0):u(e):"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');
671if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return h(e),o(e<0?0:0|c(e))}function u(e){for(var t=e.length<0?0:0|c(e.length),i=o(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function c(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function g(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||E(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return x(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return N(e).length;default:if(s)return n?-1:x(e).length;t=(""+t).toLowerCase(),s=!0}}function f(e,t,i){var s,r,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0||(i>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var s="",r=t;r<i;++r)s+=T[e[r]];return s}(this,t,i);case"utf8":case"utf-8":return v(this,t,i);case"ascii":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(127&e[s]);return n}(this,t,i);case"latin1":case"binary":return function(e,t,i){var n="";i=Math.min(e.length,i);for(var s=t;s<i;++s)n+=String.fromCharCode(e[s]);return n}(this,t,i);case"base64":return s=t,r=i,0===s&&r===this.length?n.fromByteArray(this):n.fromByteArray(this.slice(s,r));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var n=e.slice(t,i),s="",r=0;r<n.length;r+=2)s+=String.fromCharCode(n[r]+256*n[r+1]);return s}(this,t,i);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function p(e,t,i,n,s){var r;if(0===e.length)return -1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),(r=i=+i)!=r&&(i=s?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(s)return -1;i=e.length-1}else if(i<0){if(!s)return -1;i=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:_(e,t,i,n,s);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?s?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):_(e,[t],i,n,s);throw TypeError("val must be string, number or Buffer")}function _(e,t,i,n,s){var r,o=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,a/=2,l/=2,i/=2}function h(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(s){var d=-1;for(r=i;r<a;r++)if(h(e,r)===h(t,-1===d?0:r-d)){if(-1===d&&(d=r),r-d+1===l)return d*o}else -1!==d&&(r-=r-d),d=-1}else for(i+l>a&&(i=a-l),r=i;r>=0;r--){for(var u=!0,c=0;c<l;c++)if(h(e,r+c)!==h(t,c)){u=!1;break}if(u)return r}return -1}function v(e,t,i){i=Math.min(e.length,i);for(var n=[],s=t;s<i;){var r,o,a,l,h=e[s],d=null,u=h>239?4:h>223?3:h>191?2:1;if(s+u<=i)switch(u){case 1:h<128&&(d=h);break;case 2:(192&(r=e[s+1]))==128&&(l=(31&h)<<6|63&r)>127&&(d=l);break;case 3:r=e[s+1],o=e[s+2],(192&r)==128&&(192&o)==128&&(l=(15&h)<<12|(63&r)<<6|63&o)>2047&&(l<55296||l>57343)&&(d=l);break;case 4:r=e[s+1],o=e[s+2],a=e[s+3],(192&r)==128&&(192&o)==128&&(192&a)==128&&(l=(15&h)<<18|(63&r)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(d=l)}null===d?(d=65533,u=1):d>65535&&(d-=65536,n.push(d>>>10&1023|55296),d=56320|1023&d),n.push(d),s+=u}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var i="",n=0;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return i}(n)}function b(e,t,i){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>i)throw RangeError("Trying to access beyond buffer length")}function C(e,t,i,n,s,r){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<r)throw RangeError('"value" argument is out of bounds');if(i+n>e.length)throw RangeError("Index out of range")}function w(e,t,i,n,s,r){if(i+n>e.length||i<0)throw RangeError("Index out of range")}function y(e,t,i,n,r){return t=+t,i>>>=0,r||w(e,t,i,4,34028234663852886e22,-34028234663852886e22),s.write(e,t,i,n,23,4),i+4}function S(e,t,i,n,r){return t=+t,i>>>=0,r||w(e,t,i,8,17976931348623157e292,-17976931348623157e292),s.write(e,t,i,n,52,8),i+8}t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)}
vendor: 9,056 bytes, line 671
671,t.INSPECT_MAX_BYTES=50,t.kMaxLength=2147483647,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,i){return l(e,t,i)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,i){return(h(e),e<=0)?o(e):void 0!==t?"string"==typeof i?o(e).fill(t,i):o(e).fill(t):o(e)},a.allocUnsafe=function(e){return d(e)},a.allocUnsafeSlow=function(e){return d(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(E(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),E(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,n=t.length,s=0,r=Math.min(i,n);s<r;++s)if(e[s]!==t[s]){i=e[s],n=t[s];break}return i<n?-1:n<i?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);if(void 0===t)for(i=0,t=0;i<e.length;++i)t+=e[i].length;var i,n=a.allocUnsafe(t),s=0;for(i=0;i<e.length;++i){var r=e[i];if(E(r,Uint8Array)&&(r=a.from(r)),!a.isBuffer(r))throw TypeError('"list" argument must be an Array of Buffers');r.copy(n,s),s+=r.length}return n},a.byteLength=g,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):f.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(e,t,i,n,s){if(E(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||i>e.length||n<0||s>this.length)throw RangeError("out of range index");if(n>=s&&t>=i)return 0;if(n>=s)return -1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;for(var r=s-n,o=i-t,l=Math.min(r,o),h=this.slice(n,s),d=e.slice(t,i),u=0;u<l;++u)if(h[u]!==d[u]){r=h[u],o=d[u];break}return r<o?-1:o<r?1:0},a.prototype.includes=function(e,t,i){return -1!==this.indexOf(e,t,i)},a.prototype.indexOf=function(e,t,i){return p(this,e,t,i,!0)},a.prototype.lastIndexOf=function(e,t,i){return p(this,e,t,i,!1)},a.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,r,o,a,l,h,d,u,c,g,f,m,p=this.length-t;if((void 0===i||i>p)&&(i=p),e.length>0&&(i<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var _=!1;;)switch(n){case"hex":return function(e,t,i,n){i=Number(i)||0;var s=e.length-i;n?(n=Number(n))>s&&(n=s):n=s;var r=t.length;n>r/2&&(n=r/2);for(var o=0;o<n;++o){var a=parseInt(t.substr(2*o,2),16);if(a!=a)break;e[i+o]=a}return o}(this,e,t,i);case"utf8":case"utf-8":return l=t,h=i,D(x(e,this.length-l),this,l,h);case"ascii":return d=t,u=i,D(k(e),this,d,u);case"latin1":case"binary":return s=this,r=e,o=t,a=i,D(k(r),s,o,a);case"base64":return c=t,g=i,D(N(e),this,c,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f=t,m=i,D(function(e,t){for(var i,n,s=[],r=0;r<e.length&&!((t-=2)<0);++r)n=(i=e.charCodeAt(r))>>8,s.push(i%256),s.push(n);return s}(e,this.length-f),this,f,m);default:if(_)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),_=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){var i=this.length;e=~~e,t=void 0===t?i:~~t,e<0?(e+=i)<0&&(e=0):e>i&&(e=i),t<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,a.prototype),n},a.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||b(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n},a.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||b(e,t,this.length);for(var n=this[e+--t],s=1;t>0&&(s*=256);)n+=this[e+--t]*s;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||b(e,t,this.length);for(var n=this[e],s=1,r=0;++r<t&&(s*=256);)n+=this[e+r]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||b(e,t,this.length);for(var n=t,s=1,r=this[e+--n];n>0&&(s*=256);)r+=this[e+--n]*s;return r>=(s*=128)&&(r-=Math.pow(2,8*t)),r},a.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),s.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),s.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),s.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),s.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,i,n){if(e=+e,t>>>=0,i>>>=0,!n){var s=Math.pow(2,8*i)-1;C(this,e,t,i,s,0)}var r=1,o=0;for(this[t]=255&e;++o<i&&(r*=256);)this[t+o]=e/r&255;return t+i},a.prototype.writeUIntBE=function(e,t,i,n){if(e=+e,t>>>=0,i>>>=0,!n){var s=Math.pow(2,8*i)-1;C(this,e,t,i,s,0)}var r=i-1,o=1;for(this[t+r]=255&e;--r>=0&&(o*=256);)this[t+r]=e/o&255;return t+i},a.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var s=Math.pow(2,8*i-1);C(this,e,t,i,s-1,-s)}
671var r=0,o=1,a=0;for(this[t]=255&e;++r<i&&(o*=256);)e<0&&0===a&&0!==this[t+r-1]&&(a=1),this[t+r]=(e/o>>0)-a&255;return t+i},a.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var s=Math.pow(2,8*i-1);C(this,e,t,i,s-1,-s)}var r=i-1,o=1,a=0;for(this[t+r]=255&e;--r>=0&&(o*=256);)e<0&&0===a&&0!==this[t+r+1]&&(a=1),this[t+r]=(e/o>>0)-a&255;return t+i},a.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,i){return y(this,e,t,!0,i)},a.prototype.writeFloatBE=function(e,t,i){return y(this,e,t,!1,i)},a.prototype.writeDoubleLE=function(e,t,i){return S(this,e,t,!0,i)},a.prototype.writeDoubleBE=function(e,t,i){return S(this,e,t,!1,i)},a.prototype.copy=function(e,t,i,n){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s=n-i;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,i,n);else if(this===e&&i<t&&t<n)for(var r=s-1;r>=0;--r)e[r+t]=this[r+i];else Uint8Array.prototype.set.call(e,this.subarray(i,n),t);return s},a.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var s,r=e.charCodeAt(0);("utf8"===n&&r<128||"latin1"===n)&&(e=r)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(s=t;s<i;++s)this[s]=e;else{var o=a.isBuffer(e)?e:a.from(e,n),l=o.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-t;++s)this[s+t]=o[s%l]}return this};var L=/[^+/0-9A-Za-z-_]/g;function x(e,t){t=t||1/0;for(var i,n=e.length,s=null,r=[],o=0;o<n;++o){if((i=e.charCodeAt(o))>55295&&i<57344){if(!s){if(i>56319||o+1===n){(t-=3)>-1&&r.push(239,191,189);continue}s=i;continue}if(i<56320){(t-=3)>-1&&r.push(239,191,189),s=i;continue}i=(s-55296<<10|i-56320)+65536}else s&&(t-=3)>-1&&r.push(239,191,189);if(s=null,i<128){if((t-=1)<0)break;r.push(i)}else if(i<2048){if((t-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return r}function k(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}function N(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,i,n){for(var s=0;s<n&&!(s+i>=t.length)&&!(s>=e.length);++s)t[s+i]=e[s];return s}function E(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var T=function(){for(var e="0123456789abcdef",t=Array(256),i=0;i<16;++i)for(var n=16*i,s=0;s<16;++s)t[n+s]=e[i]+e[s];return t}()},783:function(e,t){t.read=function(e,t,i,n,s){var r,o,a=8*s-n-1,l=(1<<a)-1,h=l>>1,d=-7,u=i?s-1:0,c=i?-1:1,g=e[t+u];for(u+=c,r=g&(1<<-d)-1,g>>=-d,d+=a;d>0;r=256*r+e[t+u],u+=c,d-=8);for(o=r&(1<<-d)-1,r>>=-d,d+=n;d>0;o=256*o+e[t+u],u+=c,d-=8);if(0===r)r=1-h;else{if(r===l)return o?NaN:1/0*(g?-1:1);o+=Math.pow(2,n),r-=h}return(g?-1:1)*o*Math.pow(2,r-n)},t.write=function(e,t,i,n,s,r){var o,a,l,h=8*r-s-1,d=(1<<h)-1,u=d>>1,c=23===s?5960464477539062e-23:0,g=n?0:r-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(a=isNaN(t)?1:0,o=d):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+u>=1?t+=c/l:t+=c*Math.pow(2,1-u),t*l>=2&&(o++,l/=2),o+u>=d?(a=0,o=d):o+u>=1?(a=(t*l-1)*Math.pow(2,s),o+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,s),o=0));s>=8;e[i+g]=255&a,g+=f,a/=256,s-=8);for(o=o<<s|a,h+=s;h>0;e[i+g]=255&o,g+=f,o/=256,h-=8);e[i+g-f]|=128*m}}},i={};function n(e){var s=i[e];if(void 0!==s)return s.exports;var r=i[e]={exports:{}},o=!0;try{t[e](r,r.exports,n),o=!1}finally{o&&delete i[e]}
671return r.exports}n.ab="//";var s=n(72);e.exports=s}()},44227:function(e){!function(){var t={229:function(e){var t,i,n,s=e.exports={};function r(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(i){try{return t.call(null,e,0)}catch(i){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(e){i=o}}();var l=[],h=!1,d=-1;function u(){h&&n&&(h=!1,n.length?l=n.concat(l):d=-1,l.length&&c())}function c(){if(!h){var e=a(u);h=!0;for(var t=l.length;t;){for(n=l,l=[];++d<t;)n&&n[d].run();d=-1,t=l.length}n=null,h=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function f(){}s.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];l.push(new g(e,t)),1!==l.length||h||a(c)},g.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=f,s.addListener=f,s.once=f,s.off=f,s.removeListener=f,s.removeAllListeners=f,s.emit=f,s.prependListener=f,s.prependOnceListener=f,s.listeners=function(e){return[]},s.binding=function(e){throw Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw Error("process.chdir is not supported")},s.umask=function(){return 0}}},i={};function n(e){var s=i[e];if(void 0!==s)return s.exports;var r=i[e]={exports:{}},o=!0;try{t[e](r,r.exports,n),o=!1}finally{o&&delete i[e]}return r.exports}n.ab="//";var s=n(229);e.exports=s}()},46020:function(){},55893:function(){},15739:function(){},35204:function(){},19463:function(){},79124:function(){},81287:function(){},26755:function(){},46793:function(){},37107:function(){},2780:function(){},68674:function(){},4508:function(){},69781:function(){},58170:function(){},34231:function(){},9778:function(){},39879:function(){},77077:function(){},30921:function(){},48698:function(){},71591:function(){},35635:function(){},60996:function(){},22473:function(){},36660:function(){},95462:function(){},57153:function(){},12445:function(){},39194:function(){},1240:function(){},55689:function(){},11937:function(){},91699:function(){},34083:function(){},99225:function(){},52509:function(){},85799:function(){},78326:function(){},40500:function(){},81174:function(){},38342:function(){},23068:function(){},8741:function(){},25296:function(){},49378:function(){},33709:function(){},31120:function(){},17649:function(){},15890:function(){},50845:function(){},16291:function(){},17527:function(){},7606:function(){},71769:function(){}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.