610 lines
1.8 MiB
JavaScript
Raw Normal View History

2025-06-30 09:38:03 +08:00
var $E=Object.defineProperty;var jE=(s,e,t)=>e in s?$E(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var _a=(s,e,t)=>(jE(s,typeof e!="symbol"?e+"":e,t),t);import{aJ as T0,aK as ZC}from"./index-f87df9cc.js";globalThis&&globalThis.__awaiter;let KE=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function qE(s,e){let t;return e.length===0?t=s:t=s.replace(/\{(\d+)\}/g,(i,n)=>{const o=n[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),KE&&(t=""+t.replace(/[aouei]/g,"$&$&")+""),t}function p(s,e,...t){return qE(e,t)}var fm;const Tc="en";let zu=!1,Uu=!1,yu=!1,oL=!1,M0=!1,A0=!1,Td,gm=Tc,GE,lo;const et=typeof self=="object"?self:typeof global=="object"?global:{};let Xt;typeof et.vscode<"u"&&typeof et.vscode.process<"u"?Xt=et.vscode.process:typeof process<"u"&&(Xt=process);const ZE=typeof((fm=Xt==null?void 0:Xt.versions)===null||fm===void 0?void 0:fm.electron)=="string",YE=ZE&&(Xt==null?void 0:Xt.type)==="renderer";if(typeof navigator=="object"&&!YE)lo=navigator.userAgent,zu=lo.indexOf("Windows")>=0,Uu=lo.indexOf("Macintosh")>=0,A0=(lo.indexOf("Macintosh")>=0||lo.indexOf("iPad")>=0||lo.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,yu=lo.indexOf("Linux")>=0,M0=!0,p({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),Td=Tc,gm=Td;else if(typeof Xt=="object"){zu=Xt.platform==="win32",Uu=Xt.platform==="darwin",yu=Xt.platform==="linux",yu&&Xt.env.SNAP&&Xt.env.SNAP_REVISION,Xt.env.CI||Xt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Td=Tc,gm=Tc;const s=Xt.env.VSCODE_NLS_CONFIG;if(s)try{const e=JSON.parse(s),t=e.availableLanguages["*"];Td=e.locale,gm=t||Tc,GE=e._translationsConfigFile}catch{}oL=!0}else console.error("Unable to resolve platform.");const Ri=zu,Ee=Uu,yi=yu,Kc=oL,ql=M0,QE=M0&&typeof et.importScripts=="function",wl=A0,os=lo,XE=typeof et.postMessage=="function"&&!et.importScripts,rL=(()=>{if(XE){const s=[];et.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=s.length;i<n;i++){const o=s[i];if(o.id===t.data.vscodeScheduleAsyncWork){s.splice(i,1),o.callback();return}}});let e=0;return t=>{const i=++e;s.push({id:i,callback:t}),et.postMessage({vscodeScheduleAsyncWork:i},"*")}}return s=>setTimeout(s)})(),an=Uu||A0?2:zu?1:3;let YC=!0,QC=!1;function aL(){if(!QC){QC=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,YC=new Uint16Array(s.buffer)[0]===512+1}return YC}const lL=!!(os&&os.indexOf("Chrome")>=0),JE=!!(os&&os.indexOf("Firefox")>=0),eI=!!(!lL&&os&&os.indexOf("Safari")>=0),tI=!!(os&&os.indexOf("Edg/")>=0);os&&os.indexOf("Android")>=0;var fe;(function(s){function e(L){return L&&typeof L=="object"&&typeof L[Symbol.iterator]=="function"}s.is=e;const t=Object.freeze([]);function i(){return t}s.empty=i;function*n(L){yield L}s.single=n;function o(L){return L||t}s.from=o;function r(L){return!L||L[Symbol.iterator]().next().done===!0}s.isEmpty=r;function a(L){return L[Symbol.iterator]().next().value}s.first=a;function l(L,E){for(const k of L)if(E(k))return!0;return!1}s.some=l;function c(L,E){for(const k of L)if(E(k))return k}s.find=c;function*h(L,E){for(const k of L)E(k)&&(yield k)}s.filter=h;function*d(L,E){let k=0;for(const y of L)yield E(y,k++)}s.map=d;function*u(...L){for(const E of L)for(const k of E)yield k}s.concat=u;function*f(L){for(const E of L)for(const k of E)yield k}s.concatNested=f;function m(L,E,k){let y=k;for(const S of L)y=E(y,S);return y}s.reduce=m;function _(L,E){let k=0;for(const y of L)E(y,k++)}s.forEach=_;function*b(L,E,k=L.length){for(E<0&&(E+=L.length),k<0?k+=L.length:k>L.length&&(k=L.length);E<k;E++)yield L[E]}s.slice=b;function v(L,E=Number.POSITIVE_INFINITY){const k=[];if(E===0)return[k,L];const y=L[Symbol.iterator]();for(let S=0;S<E;S++){const D=y.next();if(D.done)return[k,s.empty()];k.push(D.value)}return[k,{[Symbol.iterator](){return y}}]}s.consume=v;function C(L){return v(L)[0]}s.collect=C;function w(L,E,k=(y,S)=>y===S){const y=L[Symbol.iterator](),S=E[Symbol.iterator]();for(;;){const D=y.next(),N=S.next();
- Use 0 to automatically compute the line height from the font size.
- Values between 0 and 8 will be used as a multiplier with the font size.
- Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class VI extends ht{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(67,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:p("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:p("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[p("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),p("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),p("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:p("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:p("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:p("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:p("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:p("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:p("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:q(t.enabled,this.defaultValue.enabled),autohide:q(t.autohide,this.defaultValue.autohide),size:Nt(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Nt(t.side,this.defaultValue.side,["right","left"]),showSlider:Nt(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:q(t.renderCharacters,this.defaultValue.renderCharacters),scale:Me.clampedInt(t.scale,1,1,3),maxColumn:Me.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function WI(s){return s==="ctrlCmd"?Ee?"metaKey":"ctrlKey":"altKey"}class HI extends ht{constructor(){super(77,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:p("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:Me.clampedInt(t.top,0,0,1e3),bottom:Me.clampedInt(t.bottom,0,0,1e3)}}}class zI extends ht{constructor(){const e={enabled:!0,cycle:!1};super(78,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:p("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:p("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:q(t.enabled,this.defaultValue.enabled),cycle:q(t.cycle,this.defaultValue.cycle)}}}class UI extends Zl{constructor(){super(131)}compute(e,t,i){return e.pixelRatio}}class $I extends ht{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],en
`+e.stack):new Error(e.message+`
`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const CL=new ax;function lt(s){cd(s)||CL.onUnexpectedError(s)}function ig(s){cd(s)||CL.onUnexpectedExternalError(s)}function nv(s){if(s instanceof Error){const{name:e,message:t}=s,i=s.stacktrace||s.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:Sl.isErrorNoTelemetry(s)}}return s}const Ku="Canceled";function cd(s){return s instanceof hd?!0:s instanceof Error&&s.name===Ku&&s.message===Ku}class hd extends Error{constructor(){super(Ku),this.name=this.message}}function lx(){const s=new Error(Ku);return s.name=s.message,s}function F0(s){return s?new Error(`Illegal argument: ${s}`):new Error("Illegal argument")}function cx(s){return s?new Error(`Illegal state: ${s}`):new Error("Illegal state")}class hx extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Sl extends Error{constructor(e){super(e),this.name="ErrorNoTelemetry"}static fromError(e){if(e instanceof Sl)return e;const t=new Sl;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="ErrorNoTelemetry"}}class B0 extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,B0.prototype);debugger}}function Ur(s){const e=this;let t=!1,i;return function(){return t||(t=!0,i=s.apply(e,arguments)),i}}class dx extends Error{constructor(e){super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`),this.errors=e}}function ux(s){return typeof s.dispose=="function"&&s.dispose.length===0}function $e(s){if(fe.is(s)){const e=[];for(const t of s)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new dx(e);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function Po(...s){return He(()=>$e(s))}function He(s){return{dispose:Ur(()=>{s()})}}class ae{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){try{$e(this._toDispose.values())}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?ae.DISABLE_DISPOSED_WARNING||console.warn(new 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}}ae.DISABLE_DISPOSED_WARNING=!1;class H{constructor(){this._store=new ae,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}H.None=Object.freeze({dispose(){}});class vL{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}clearAndLeak(){const e=this._value;return this._value=void 0,e}}class fx{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1}set(e){let t=e;return this.unset=()=>t=void 0,this.isset=()=>t!==void 0,this.dispose=()=>{t&&(t(),t=void 0)},this}}class gx{constructor(e){this.object=e}dispose(){}}const mx=et.performance&&typeof et.performance.now=="function";class ea{constructor(e){this._highResolution=mx&&e,this._startTime=this._now(),this._stopTime=-1}static create(e=!0){return new ea(e)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?et.performance.now():Date.now()}}var Y;(function(s){s.None=()=>H.None;function e(k){return(y,S=null,D)=>{let N=!1,T;return T=k(P=>{if(!N)return T?T.dispose():N=!0,y.call(S,P)},null,D),N&&T.dispose(),T}}s.once=e;function t(k,y,S){return l((D,N=null,T)=>k(P=>D.call(N,y(P)),null,T),S)}s.map=t;f
`).slice(2).join(`
`))}}class px{constructor(e,t,i){this.callback=e,this.callbackThis=t,this.stack=i,this.subscription=new fx}invoke(e){this.callback.call(this.callbackThis,e)}}let A=class{constructor(e){var t,i;this._disposed=!1,this._options=e,this._leakageMon=void 0,this._perfMon=!((t=this._options)===null||t===void 0)&&t._profName?new ng(this._options._profName):void 0,this._deliveryQueue=(i=this._options)===null||i===void 0?void 0:i.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,this._listeners&&this._listeners.clear(),(e=this._deliveryQueue)===null||e===void 0||e.clear(this),(i=(t=this._options)===null||t===void 0?void 0:t.onLastListenerRemove)===null||i===void 0||i.call(t),(n=this._leakageMon)===null||n===void 0||n.dispose())}get event(){return this._event||(this._event=(e,t,i)=>{var n,o,r;this._listeners||(this._listeners=new wi);const a=this._listeners.isEmpty();a&&(!((n=this._options)===null||n===void 0)&&n.onFirstListenerAdd)&&this._options.onFirstListenerAdd(this);let l,c;this._leakageMon&&this._listeners.size>=30&&(c=V0.create(),l=this._leakageMon.check(c,this._listeners.size+1));const h=new px(e,t,c),d=this._listeners.push(h);a&&(!((o=this._options)===null||o===void 0)&&o.onFirstListenerDidAdd)&&this._options.onFirstListenerDidAdd(this),!((r=this._options)===null||r===void 0)&&r.onListenerDidAdd&&this._options.onListenerDidAdd(this,e,t);const u=h.subscription.set(()=>{l==null||l(),this._disposed||(d(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return i instanceof ae?i.add(u):Array.isArray(i)&&i.push(u),u}),this._event}fire(e){var t,i;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new _x);for(const n of this._listeners)this._deliveryQueue.push(this,n,e);(t=this._perfMon)===null||t===void 0||t.start(this._deliveryQueue.size),this._deliveryQueue.deliver(),(i=this._perfMon)===null||i===void 0||i.stop()}}};class wL{constructor(){this._queue=new wi}get size(){return this._queue.size}push(e,t,i){this._queue.push(new bx(e,t,i))}clear(e){const t=new wi;for(const i of this._queue)i.emitter!==e&&t.push(i);this._queue=t}deliver(){for(;this._queue.size>0;){const e=this._queue.shift();try{e.listener.invoke(e.event)}catch(t){lt(t)}}}}class _x extends wL{clear(e){this._queue.clear()}}class bx{constructor(e,t,i){this.emitter=e,this.listener=t,this.event=i}}class qu extends A{constructor(e){super(e),this._isPaused=0,this._eventQueue=new wi,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._listeners&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class Cx extends qu{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class W0{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e(o=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>t.call(i,o)):t.call(i,o)},void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(n=>n()),i}}class sv{constructor(){this.listening=!1,this.inputEvent=Y.None,this.inputEventListener=H.None,this.emitter=new A({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{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()}}const SL=Object.freeze(function(s,e){const t=setTimeout(s.bind(e),0);return{dispose(){clearTimeout(t)}}});var Li;(function(s){function e(t){ret
`;const Cv=typeof Buffer<"u";let vm;class ag{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(e){return Cv&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new ag(e)}toString(){return Cv?this.buffer.toString():(vm||(vm=new TextDecoder),vm.decode(this.buffer))}}function LN(s,e){return s[e+0]<<0>>>0|s[e+1]<<8>>>0}function kN(s,e,t){s[t+0]=e&255,e=e>>>8,s[t+1]=e&255}function _n(s,e){return s[e]*Math.pow(2,24)+s[e+1]*Math.pow(2,16)+s[e+2]*Math.pow(2,8)+s[e+3]}function bn(s,e,t){s[t+3]=e,e=e>>>8,s[t+2]=e,e=e>>>8,s[t+1]=e,e=e>>>8,s[t]=e}function vv(s,e){return s[e]}function wv(s,e,t){s[t]=e}let wm;function UL(){return wm||(wm=new TextDecoder("UTF-16LE")),wm}let Sm;function DN(){return Sm||(Sm=new TextDecoder("UTF-16BE")),Sm}let ym;function $L(){return ym||(ym=aL()?UL():DN()),ym}const jL=typeof TextDecoder<"u";let kl,B_;jL?(kl=s=>new IN(s),B_=EN):(kl=s=>new xN,B_=KL);function EN(s,e,t){const i=new Uint16Array(s.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?KL(s,e,t):UL().decode(i)}function KL(s,e,t){const i=[];let n=0;for(let o=0;o<t;o++){const r=LN(s,e);e+=2,i[n++]=String.fromCharCode(r)}return i.join("")}class IN{constructor(e){this._capacity=e|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings!==null?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(this._bufferLength===0)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return $L().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}write1(e){const t=this._capacity-this._bufferLength;t<=1&&(t===0||yt(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCII(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIIString(e){const 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 xN{constructor(){this._pieces=[],this._piecesLen=0}reset(){this._pieces=[],this._piecesLen=0}build(){return this._pieces.join("")}write1(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCII(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCIIString(e){this._pieces[this._piecesLen++]=e}}class ef{constructor(e,t,i,n,o,r){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=o,this.reversedRegex=r,this._openSet=ef._toSet(this.open),this._closeSet=ef._toSet(this.close)}isOpen(e){return this._openSet.has(e)}isClose(e){return this._closeSet.has(e)}static _toSet(e){const t=new Set;for(const i of e)t.add(i);return t}}function NN(s){const e=s.length;s=s.map(r=>[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r<e;r++)t[r]=r;const i=(r,a)=>{const[l,c]=r,[h,d]=a;return l===h||l===d||c===h||c===d},n=(r,a)=>{const l=Math.min(r,a),c=Math.max(r,a);for(let h=0;h<e;h++)t[h]===c&&(t[h]=l)};for(let r=0;r<e;r++){const a=s[r];for(let l=r+1;l<e;l++){const c=s[l];i(a,c)&&n(t[r],t[l])}}const o=[];for(let r=0;r<e;r++){const a=[],l=[];for(let c=0;c<e;c++)if(t[c]===r){const[h,d]=s[c];a.push(h),l.push(d)}a.length>0&&o.push({open:a,close:l})}return o}class TN{constructor(e,t){this._richEditBracketsBrand=void 0;const i=NN(t);this.brackets=i.map((n,o)=>new ef(e,o,n.open,n.close,MN(n.open,n.close,i,o),AN(n.open,n.close,i,o))),this.forwardRegex=RN(this.brackets),this.reversedRegex=PN(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const o of n.open)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of n.close)this.textIsBracket[o]=n,this.textIsOpenBracket[o]=!1
`)>=0;let t=null;try{t=RL(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new CN(t,this.wordSeparators?El(this.wordSeparators):null,i?this.searchString:null)}}function HT(s){if(!s||s.length===0)return!1;for(let e=0,t=s.length;e<t;e++){const i=s.charCodeAt(e);if(i===10)return!0;if(i===92){if(e++,e>=t)break;const n=s.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function pr(s,e,t){if(!t)return new wh(s,null);const i=[];for(let n=0,o=e.length;n<o;n++)i[n]=e[n];return new wh(s,i)}class Vv{constructor(e){const t=[];let i=0;for(let n=0,o=e.length;n<o;n++)e.charCodeAt(n)===10&&(t[i++]=n);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,n=t.length-1;if(n===-1||e<=t[0])return 0;for(;i<n;){const o=i+((n-i)/2>>0);t[o]>=e?n=o-1:t[o+1]>=e?(i=o,n=o):i=o+1}return i+1}}class Fd{static findMatches(e,t,i,n,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new Wa(r.wordSeparators,r.regex),n,o):this._doFindMatchesLineByLine(e,i,r,n,o):[]}static _getMultilineMatchRange(e,t,i,n,o,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(n){const f=n.findLineFeedCountBeforeOffset(o+r.length)-l;c=a+r.length+f}else c=a+r.length;const h=e.getPositionAt(a),d=e.getPositionAt(c);return new M(h.lineNumber,h.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,n,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r
`?new Vv(a):null,c=[];let h=0,d;for(i.reset(0);d=i.next(a);)if(c[h++]=pr(this._getMultilineMatchRange(e,r,a,l,d.index,d[0]),d,n),h>=o)return c;return c}static _doFindMatchesLineByLine(e,t,i,n,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,n,o),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,o);for(let c=t.startLineNumber+1;c<t.endLineNumber&&a<o;c++)a=this._findMatchesInLine(i,e.getLineContent(c),c,0,a,r,n,o);if(a<o){const c=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,c,t.endLineNumber,0,a,r,n,o)}return r}static _findMatchesInLine(e,t,i,n,o,r,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const u=e.simpleSearch,f=u.length,m=t.length;let _=-f;for(;(_=t.indexOf(u,_+f))!==-1;)if((!c||lb(c,t,m,_,f))&&(r[o++]=new wh(new M(i,_+1+n,i,_+1+f+n),null),o>=l))return o;return o}const h=new Wa(e.wordSeparators,e.regex);let d;h.reset(0);do if(d=h.next(t),d&&(r[o++]=pr(new M(i,d.index+1+n,i,d.index+1+d[0].length+n),d,a),o>=l))return o;while(d);return o}static findNextMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new Wa(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const o=new O(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new M(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r
`?new Vv(l):null;i.reset(t.column-1);const h=i.next(l);return h?pr(this._getMultilineMatchRange(e,r,l,c,h.index,h[0]),h,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new O(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let c=1;c<=o;c++){const h=(r+c-1)%o,d=e.getLineContent(h+1),u=this._findFirstMatchInLine(i,d,h+1,1,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,o){e.reset(n-1);const r=e.next(t);return r?pr(new M(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,n){const o=t.parseSearchRequest();if(!o)return null;const r=new Wa(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const o=this._doFindMatchesMultiline(e,new M(1,1,t.lineNumber,t.column),i,n,10*WT);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new O(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,n);if(l)return l;for(let c=1;c<=o;c++){const h=(o+r-c-1)%o,d=e.getLineContent(h+1),u=this._findLastMatchInLine(i,d,h+1,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let o=null,r;for(e.reset(0);r=e.next(t);)o=pr(new M(i,r.index+1,i,r.index+1+r[0].length),r,n);return o}}function zT(s,e,t,i,n){if(i===0)return!0;const o=e.charCodeAt(i-1);if(s.get(o)!==0||o===13||o===10)return!0;if(n>0){const r=e.charCodeAt(i);if(s.get(r)!==0)return!0}return!1}function UT(s,e,t,i,n){if(i+n===t)return!0;const o=e.charCodeAt(i+n);if(s.get(o)!==0||o===13||o===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(s.get(r)!==0)return!0}return!1}function lb(s,e,t,i,n){return zT(s,e,t,i,n)&&UT(s,e,t,i,n)}class Wa{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){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const n=i.index,o=i[0].length;if(n===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){Yu(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=o,!this._wordSeparators||lb(this._wordSeparators,e,t,n,o))return i}while(i);return null}}class $T{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new Wv(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${jT(Array.from(a))}`,"g");const c=new Wa(null,l),h=[];let d=!1,u,f=0,m=0,_=0;e:for(let b=n,v=o;b<=v;b++){const C=e.getLineContent(b),w=C.length;c.reset(0);do if(u=c.next(C),u){let L=u.index,E=u.index+u[0].length;if(L>0){const D=C.charCodeAt(L-1);yt(D)&&L--}if(E+1<w){const D=C.charCodeAt(E-1);yt(D)&&E++}const k=C.substring(L,E),y=ph(L+1,R0,C,0),S=r.shouldHighlightNonBasicASCII(k,y?y.word:null);if(S!==0){S===3?f++:S===2?m++:S===1?_++:O0();const D=1e3;if(h.length>=D){d=!0;break e}h.push(new M(b,L+1,b,E+1))}}while(u)}return{ranges:h,hasMore:d,ambiguousCharacterCount:f,invisibleCharacterCount:m,nonBasicAsciiCharacterCount:_}}static computeUnicodeHighlightReason(e,t){const i=new Wv(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=un.getLocales().filter(l=>!un.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}functio
`||s===" "}var ar=globalThis&&globalThis.__awaiter||function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(h){try{c(i.next(h))}catch(d){r(d)}}function l(h){try{c(i.throw(h))}catch(d){r(d)}}function c(h){h.done?o(h.value):n(h.value).then(a,l)}c((i=i.apply(s,e||[])).next())})};class KT extends MT{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){const i=ph(e.column,hL(t),this._lines[e.lineNumber-1],0);return i?new M(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let n=0,o="",r=0,a=[];return{*[Symbol.iterator](){for(;;)if(r<a.length){const l=o.substring(a[r].start,a[r].end);r+=1,yield l}else if(n<t.length)o=t[n],a=i(o,e),r=0,n+=1;else break}}}getLineWords(e,t){const i=this._lines[e-1],n=this._wordenize(i,t),o=[];for(const r of n)o.push({word:i.substring(r.start,r.end),startColumn:r.start+1,endColumn:r.end+1});return o}_wordenize(e,t){const i=[];let n;for(t.lastIndex=0;(n=t.exec(e))&&n[0].length!==0;)i.push({start:n.index,end:n.index+n[0].length});return i}getValueInRange(e){if(e=this._validateRange(e),e.startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const t=this._eol,i=e.startLineNumber-1,n=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let r=i+1;r<n;r++)o.push(this._lines[r]);return o.push(this._lines[n].substring(0,e.endColumn-1)),o.join(t)}offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.lineNumber-2)+(e.column-1)}positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();const 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){const 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(!O.isIPosition(e))throw new 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{const o=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>o&&(i=o,n=!0)}return n?{lineNumber:t,column:i}:e}}class Vo{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new KT(Se.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeUnicodeHighlights(e,t,i){return ar(this,void 0,void 0,function*(){const n=this._getModel(e);return n?$T.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,i,n){return ar(this,void 0,void 0,function*(){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:Vo.computeDiff(o,r,i,n)})}static computeDiff(e,t,i,n){const o=e.getLinesContent(),r=t.getLinesContent(),l=new xT(o,r,{shouldComputeCharChanges:!0,shouldPostProcessCharChanges:!0,shouldIgnoreTrimWhitespace:i,shouldMakePrettyDiff:!0,maxComputationTime:n}).computeDiff(),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);return{quitEarly:l.quitEarly,identical:c,changes:l.changes}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),n=t.getLi
`:e,l=a.length;let c=i.embeddedLanguageData,h=i.stack,d=0,u=null,f=!0;for(;f||d<l;){const m=d,_=h.depth,b=u?u.groups.length:0,v=h.state;let C=null,w=null,L=null,E=null,k=null;if(u){C=u.matches;const D=u.groups.shift();w=D.matched,L=D.action,E=u.rule,u.groups.length===0&&(u=null)}else{if(!f&&d>=l)break;f=!1;let D=this._lexer.tokenizer[v];if(!D&&(D=Bd(this._lexer,v),!D))throw Te(this._lexer,"tokenizer state is not defined: "+v);const N=a.substr(d);for(const T of D)if((d===0||!T.matchOnlyAtLineStart)&&(C=N.match(T.regex),C)){w=C[0],L=T.action;break}}if(C||(C=[""],w=""),L||(d<l&&(C=[a.charAt(d)],w=C[0]),L=this._lexer.defaultToken),w===null)break;for(d+=w.length;_4(L)&&qv(L)&&L.test;)L=L.test(w,C,v,d===l);let y=null;if(typeof L=="string"||Array.isArray(L))y=L;else if(L.group)y=L.group;else if(L.token!==null&&L.token!==void 0){if(L.tokenSubst?y=wo(this._lexer,L.token,w,C,v):y=L.token,L.nextEmbedded)if(L.nextEmbedded==="@pop"){if(!c)throw Te(this._lexer,"cannot pop embedded language if not inside one");c=null}else{if(c)throw Te(this._lexer,"cannot enter embedded language from within an embedded language");k=wo(this._lexer,L.nextEmbedded,w,C,v)}if(L.goBack&&(d=Math.max(0,d-L.goBack)),L.switchTo&&typeof L.switchTo=="string"){let D=wo(this._lexer,L.switchTo,w,C,v);if(D[0]==="@"&&(D=D.substr(1)),Bd(this._lexer,D))h=h.switchTo(D);else throw Te(this._lexer,"trying to switch to a state '"+D+"' that is undefined in rule: "+this._safeRuleName(E))}else{if(L.transform&&typeof L.transform=="function")throw Te(this._lexer,"action.transform not supported");if(L.next)if(L.next==="@push"){if(h.depth>=this._lexer.maxStack)throw Te(this._lexer,"maximum tokenizer stack size reached: ["+h.state+","+h.parent.state+",...]");h=h.push(v)}else if(L.next==="@pop"){if(h.depth<=1)throw Te(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(E));h=h.pop()}else if(L.next==="@popall")h=h.popall();else{let D=wo(this._lexer,L.next,w,C,v);if(D[0]==="@"&&(D=D.substr(1)),Bd(this._lexer,D))h=h.push(D);else throw Te(this._lexer,"trying to set a next state '"+D+"' that is undefined in rule: "+this._safeRuleName(E))}}L.log&&typeof L.log=="string"&&b4(this._lexer,this._lexer.languageId+": "+wo(this._lexer,L.log,w,C,v))}if(y===null)throw Te(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(E));const S=D=>{const N=this._languageService.getLanguageIdByLanguageName(D)||this._languageService.getLanguageIdByMimeType(D)||D,T=this._getNestedEmbeddedLanguageData(N);if(d<l){const P=e.substr(d);return this._nestedTokenize(P,t,So.create(h,T),n+d,o)}else return So.create(h,T)};if(Array.isArray(y)){if(u&&u.groups.length>0)throw Te(this._lexer,"groups cannot be nested: "+this._safeRuleName(E));if(C.length!==y.length+1)throw Te(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(E));let D=0;for(let N=1;N<C.length;N++)D+=C[N].length;if(D!==w.length)throw Te(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(E));u={rule:E,matches:C,groups:[]};for(let N=0;N<y.length;N++)u.groups[N]={action:y[N],matched:C[N+1]};d-=w.length;continue}else{if(y==="@rematch"&&(d-=w.length,w="",C=null,y="",k!==null))return S(k);if(w.length===0){if(l===0||_!==h.depth||v!==h.state||(u?u.groups.length:0)!==b)continue;throw Te(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(E))}let D=null;if(Ck(y)&&y.indexOf("@brackets")===0){const N=y.substr(9),T=y4(this._lexer,w);if(!T)throw Te(this._lexer,"@brackets token returned but no bracket defined as: "+w);D=Gv(T.token+N)}else{const N=y===""?"":y+this._lexer.tokenPostfix;D=Gv(N)}m<r&&o.emit(m+n,D)}if(k!==null)return S(k)}return So.create(h,c)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new Ha(e,tf);e!==this._languageId&&(rt.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=rt.get(e);return t?new Ha(e,t.getInitialState()):new Ha(e,tf)}};Eh=v4([w4(4,ft)],Eh);function y4(s,e){if(!e)return null;e=Wo(s,e);const t=s.brackets;for(const i of t){i
`)}}const Mg=new q5;At.add(Qk.ColorContribution,Mg);function G5(s){return s===null||typeof s.hcLight>"u"&&(s.hcDark===null||typeof s.hcDark=="string"?s.hcLight=s.hcDark:s.hcLight=s.light),s}function I(s,e,t,i,n){return Mg.registerColor(s,G5(e),t,i,n)}const ue=I("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},p("foreground","Overall foreground color. This color is only used if not overridden by a component."));I("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},p("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));I("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},p("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));I("descriptionForeground",{light:"#717171",dark:G(ue,.7),hcDark:G(ue,.7),hcLight:G(ue,.7)},p("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));I("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},p("iconForeground","The default color for icons in the workbench."));const hn=I("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#0F4A85"},p("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),be=I("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},p("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),ct=I("contrastActiveBorder",{light:null,dark:null,hcDark:hn,hcLight:hn},p("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));I("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},p("selectionBackground","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."));I("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:R.black,hcLight:"#292929"},p("textSeparatorForeground","Color for text separators."));I("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},p("textLinkForeground","Foreground color for links in text."));I("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},p("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));I("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},p("textPreformatForeground","Foreground color for preformatted text segments."));I("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},p("textBlockQuoteBackground","Background color for block quotes in text."));I("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:R.white,hcLight:"#292929"},p("textBlockQuoteBorder","Border color for block quotes in text."));I("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:R.black,hcLight:"#F2F2F2"},p("textCodeBlockBackground","Background color for code blocks in text."));const Dr=I("widget.shadow",{dark:G(R.black,.36),light:G(R.black,.16),hcDark:null,hcLight:null},p("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),Xk=I("input.background",{dark:"#3C3C3C",light:R.white,hcDark:R.black,hcLight:R.white},p("inputBoxBackground","Input box background.")),Jk=I("input.foreground",{dark:ue,light:ue,hcDark:ue,hcLight:ue},p("inputBoxForeground","Input box foreground.")),e2=I("input.border",{dark:null,light:null,hcDark:be,hcLight:be},p("inputBoxBorder","Input box border.")),Z5=I("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hcDark:be,hcLight:be},p("inputBoxActiveOptionBorder","Border color of activated options in input fields."));I("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark
target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?pt.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return hi.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return hi.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return hi.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return hi.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return hi.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return hi.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return hi.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return hi.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return hi.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new wb(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const Iw={isAfterLines:!0};function zm(s){return{isAfterLines:!1,horizontalDistanceToText:s}}class Ot{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=rs.collect(t,this._viewHelper.viewDomNode);return!!(nn.isChildOfContentWidgets(i)||nn.isChildOfOverflowingContentWidgets(i)||nn.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,n,o){const r=new Al(this._context,this._viewHelper,e),a=new wb(r,t,i,n,o);try{return Ot._createMouseTarget(r,a,!1)}catch{return a.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(t.target===null){if(i)return t.fulfillUnknown();const r=Ot._doHitTest(e,t);return r.type===1?Ot.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}const n=t;let o=null;return o=o||Ot._hitTestContentWidget(e,n),o=o||Ot._hitTestOverlayWidget(e,n),o=o||Ot._hitTestMinimap(e,n),o=o||Ot._hitTestScrollbarSlider(e,n),o=o||Ot._hitTestViewZone(e,n),o=o||Ot._hitTestMargin(e,n),o=o||Ot._hitTestViewCursor(e,n),o=o||Ot._hitTestTextArea(e,n),o=o||Ot._hitTestViewLines(e,n,i),o=o||Ot._hitTestScrollbar(e,n),o||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(nn.isChildOfContentWidgets(t.targetPath)||nn.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(nn.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const n of i)if(t.target===n.domNode)return t.fulfillContentText(n.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,n=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const r of i){if(n<r.contentLeft||n>r.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const n=t.isInContentArea?8:5;return t.fulfillViewZone(n,i.position,i)}return null}static _hitTestTextArea(e,t){return nn.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){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWid
`,o+1))!==-1;)n++;return[e,i*t.length,n]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const n=Math.min(M_(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(A_(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-o);const r=t.value.substring(n,t.value.length-o),a=e.selectionStart-n,l=e.selectionEnd-n,c=t.selectionStart-n,h=t.selectionEnd-n;if(c===h){const u=e.selectionStart-n;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const d=l-a;return{text:r,replacePrevCharCnt:d,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};const i=Math.min(M_(e.value,t.value),e.selectionEnd),n=Math.min(A_(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-r.length}}}It.EMPTY=new It("",0,0,null,null);class Ga{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,o=i+t;return new M(n,1,o+1,1)}static fromEditorSelection(e,t,i,n,o){const r=Ga._getPageOfLine(i.startLineNumber,n),a=Ga._getRangeForPage(r,n),l=Ga._getPageOfLine(i.endLineNumber,n),c=Ga._getRangeForPage(l,n),h=a.intersectRanges(new M(1,1,i.startLineNumber,i.startColumn));let d=t.getValueInRange(h,1);const u=t.getLineCount(),f=t.getLineMaxColumn(u),m=c.intersectRanges(new M(i.endLineNumber,i.endColumn,u,f));let _=t.getValueInRange(m,1),b;if(r===l||r+1===l)b=t.getValueInRange(i,1);else{const v=a.intersectRanges(i),C=c.intersectRanges(i);b=t.getValueInRange(v,1)+String.fromCharCode(8230)+t.getValueInRange(C,1)}return o&&(d.length>500&&(d=d.substring(d.length-500,d.length)),_.length>500&&(_=_.substring(0,500)),b.length>2*500&&(b=b.substring(0,500)+String.fromCharCode(8230)+b.substring(b.length-500,b.length))),new It(d+b+_,d.length,d.length+b.length,new O(i.startLineNumber,i.startColumn),new O(i.endLineNumber,i.endColumn))}}var pf;(function(s){s.Tap="-monaco-textarea-synthetic-tap"})(pf||(pf={}));class _f{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)}}_f.INSTANCE=new _f;class E7{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class I7 extends H{constructor(e,t,i,n){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._onFocus=this._register(new A),this.onFocus=this._onFocus.event,this._onBlur=this._register(new A),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new A),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new A),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new A),this.onCut=this._onCut.event,this._onPaste=this._register(new A),this.onPaste=this._onPaste.event,this._onType=this._register(new A),this.onType=this._onType.event,this._onCompositionStart=this._register(new A),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new A),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new A),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new A),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new ni(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new ni(()=>this.writeScreenReaderContent("asyncFocusGain"),
`):t.text,i),e.preventDefault(),e.clipboardData&&xw.setTextData(e.clipboardData,t.text,t.html,i)}}class xw{static getTextData(e){const t=e.getData(Ps.text);let i=null;const n=e.getData("vscode-editor-data");if(typeof n=="string")try{i=JSON.parse(n),i.version!==1&&(i=null)}catch{}return t.length===0&&i===null&&e.files.length>0?[Array.prototype.slice.call(e.files,0).map(r=>r.name).join(`
`),null]:[t,i]}static setTextData(e,t,i,n){e.setData(Ps.text,t),typeof i=="string"&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}}class x7 extends H{constructor(e){super(),this._actual=e,this.onKeyDown=this._register(pn(this._actual,"keydown")).event,this.onKeyUp=this._register(pn(this._actual,"keyup")).event,this.onCompositionStart=this._register(pn(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(pn(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(pn(this._actual,"compositionend")).event,this.onInput=this._register(pn(this._actual,"input")).event,this.onCut=this._register(pn(this._actual,"cut")).event,this.onCopy=this._register(pn(this._actual,"copy")).event,this.onPaste=this._register(pn(this._actual,"paste")).event,this.onFocus=this._register(pn(this._actual,"focus")).event,this.onBlur=this._register(pn(this._actual,"blur")).event,this._onSyntheticTap=this._register(new A),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(W(this._actual,pf.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=xl(this._actual);return e?e.activeElement===this._actual:Dk(this._actual)?document.activeElement===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let o=null;const r=xl(n);r?o=r.activeElement:o=document.activeElement;const a=o===n,l=n.selectionStart,c=n.selectionEnd;if(a&&l===t&&c===i){Xi&&window.parent!==window&&n.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),Xi&&window.parent!==window&&n.focus();return}try{const h=f5(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),g5(n,h)}catch{}}}class N7 extends Sb{constructor(e,t,i){super(e,t,i),this._register(Ie.addTarget(this.viewHelper.linesContentDomNode)),this._register(W(this.viewHelper.linesContentDomNode,Ve.Tap,o=>this.onTap(o))),this._register(W(this.viewHelper.linesContentDomNode,Ve.Change,o=>this.onChange(o))),this._register(W(this.viewHelper.linesContentDomNode,Ve.Contextmenu,o=>this._onContextMenu(new Zo(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(W(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new u7(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Zo(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:t.type===6&&t.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){e.browser
`),v=_.substring(b+1),C=v.lastIndexOf(" "),w=v.length-C-1,L=d.getStartPosition(),E=Math.min(L.column-1,w),k=L.column-1-E,y=v.substring(0,v.length-E),S=cA(y,this._fontInfo);return{distanceToModelLineStart:k,widthOfHiddenTextBefore:S}})(),{distanceToModelLineEnd:m}=(()=>{const _=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),b=_.indexOf(`
`),v=b===-1?_:_.substring(0,b),C=v.indexOf(" "),w=C===-1?v.length:v.length-C-1,L=d.getEndPosition(),E=Math.min(this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column,w);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column-E}})();this._context.viewModel.revealRange("keyboard",!0,M.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new aA(this._context,d.startLineNumber,u,f,m),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${Vr} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(c=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName(`inputarea ${Vr}`),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)}))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=El(t);let o=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const h=i.charCodeAt(r-2);n.get(h)!==0?o=!1:r--}if(a&&l>i.length&&(a=!1),a){const h=i.charCodeAt(l-1);n.get(h)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=El(this._context.configuration.options.get(119));let n=e.column,o=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||o>50)return t.substring(n-1,e.column-1);o++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!yt(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){return e.get(2)===1?p("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",yi?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===Jr.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(133);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(46),this._lineHeight=t.get(61),this._emptySelectionClipboard=t.get(33),this._copyWithSyntaxHighlighting=t.get(21),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(114))),(e.hasChanged(30)||e.hasChanged(83))&&(t.get(30)&&t.get(83)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("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()}focusTextArea(){this._textAreaInput.focusTextArea()}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","fals
`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:Sc?0:1,height:Sc?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;di(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?R.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.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const n=this._context.configuration.options;n.get(52)?i.setClassName("monaco-editor-background textAreaCover "+Kr.OUTER_CLASS_NAME):n.get(62).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+Rl.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}}function cA(s,e){if(s.length===0)return 0;const t=document.createElement("div");t.style.position="absolute",t.style.top="-50000px",t.style.width="50000px";const i=document.createElement("span");di(i,e),i.style.whiteSpace="pre",i.append(s),t.appendChild(i),document.body.appendChild(t);const n=i.offsetWidth;return document.body.removeChild(t),n}function hA(s,e,t){let i=0;for(let o=0;o<s.length;o++)s.charAt(o)===" "?i=pt.nextIndentTabStop(i,e):i++;let n="";if(!t){const o=Math.floor(i/e);i=i%e;for(let r=0;r<o;r++)n+=" "}for(let o=0;o<i;o++)n+=" ";return n}function N2(s,e,t){let i=Ai(s);return i===-1&&(i=s.length),hA(s.substring(0,i),e,t)+s.substring(i)}const dA=()=>!0,uA=()=>!1,fA=s=>s===" "||s===" ";class ya{constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,r=o.get(133);this.readOnly=o.get(83),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(106),this.lineHeight=o.get(61),this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=o.get(118),this.wordSeparators=o.get(119),this.emptySelectionClipboard=o.get(33),this.copyWithSyntaxHighlighting=o.get(21),this.multiCursorMergeOverlapping=o.get(71),this.multiCursorPaste=o.get(73),this.autoClosingBrackets=o.get(5),this.autoClosingQuotes=o.get(8),this.autoClosingDelete=o.get(6),this.autoClosingOvertype=o.get(7),this.autoSurround=o.get(11),this.autoIndent=o.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const a=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(a)for(const l of a)this.surroundingPairs[l.open]=l.close}static shouldRecreate(e){return e.hasChanged(133)||e.hasChanged(119)||e.hasChanged(33)||e.hasChanged(71)||e.hasChanged(73)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(118)||e.hasChanged(61)||e.hasChanged(83)}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=og(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return o?o.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return N2(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return fA;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e);case"always":return dA;case"never":return uA}}_getLanguageDefinedShouldAutoClose(e){const t=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet();
* 'to': A mandatory logical position value providing where to move the cursor.
\`\`\`
'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
\`\`\`
* 'by': Unit to move. Default is computed based on 'to' value.
\`\`\`
'line', 'wrappedLine', 'character', 'halfLine'
\`\`\`
* 'value': Number of units to move. Default is '1'.
* 'select': If 'true' makes the selection. Default is 'false'.
`,constraint:e,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}}}}]},s.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"},s.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case s.RawDirection.Left:n=0;break;case s.RawDirection.Right:n=1;break;case s.RawDirection.Up:n=2;break;case s.RawDirection.Down:n=3;break;case s.RawDirection.PrevBlankLine:n=4;break;case s.RawDirection.NextBlankLine:n=5;break;case s.RawDirection.WrappedLineStart:n=6;break;case s.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case s.RawDirection.WrappedLineColumnCenter:n=8;break;case s.RawDirection.WrappedLineEnd:n=9;break;case s.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case s.RawDirection.ViewPortTop:n=11;break;case s.RawDirection.ViewPortBottom:n=13;break;case s.RawDirection.ViewPortCenter:n=12;break;case s.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let o=0;switch(i.by){case s.RawUnit.Line:o=1;break;case s.RawUnit.WrappedLine:o=2;break;case s.RawUnit.Character:o=3;break;case s.RawUnit.HalfLine:o=4;break}return{direction:n,unit:o,select:!!i.select,value:i.value||1}}s.parse=t})(bf||(bf={}));function f1(s,e,t,i){const n=sl(e,t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(n.languageId);if(!o)return null;const r=n.getLineContent(),a=r.substr(0,t.startColumn-1-n.firstCharOffset);let l;t.isEmpty()?l=r.substr(t.startColumn-1-n.firstCharOffset):l=sl(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-n.firstCharOffset);let c="";if(t.startLineNumber>1&&n.firstCharOffset===0){const _=sl(e,t.startLineNumber-1);_.languageId===n.languageId&&(c=_.getLineContent())}const h=o.onEnter(s,c,a,l);if(!h)return null;const d=h.indentAction;let u=h.appendText;const f=h.removeText||0;u?d===ei.Indent&&(u=" "+u):d===ei.Indent||d===ei.IndentOutdent?u=" ":u="";let m=tk(e,t.startLineNumber,t.startColumn);return f&&(m=m.substring(0,m.length-f)),{indentAction:d,appendText:u,removeText:f,indentation:m}}var _A=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},bA=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};const $m=Object.create(null);function cr(s,e){if(e<=0)return"";$m[s]||($m[s]=["",s]);const t=$m[s];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+s;return t[e]}let wr=class g1{constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}static unshiftIndent(e,t,i,n,o){const r=pt.visibleColumnFromColumn(e,t,i);if(o){const a=cr(" ",n),c=pt.prevIndentTabStop(r,n)/n;return cr(a,c)}else{const a=" ",c=pt.prevRenderTabStop(r,i)/i;return cr(a,c)}}static shiftIndent(e,t,i,n,o){const r=pt.visibleColumnFromColumn(e,t,i);if(o){const a=cr(" ",n),c=pt.nextIndentT
`)!==n.length-1&&(o=!1),o){const d=new M(h.lineNumber,1,h.lineNumber,1);r[a]=new pA(d,n,c,!0)}else r[a]=new mi(c,n)}return new li(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,o){if(n||t.length===1)return null;if(o&&o.length===t.length)return o;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substr(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substr(0,i.length-1));const r=ud(i);if(r.length===t.length)return r}return null}static paste(e,t,i,n,o,r){const a=this._distributePasteToCursors(e,i,n,o,r);return a?(i=i.sort(M.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,o)}static _goodIndentForLine(e,t,i){let n=null,o="";const r=yb(e.autoIndent,t,i,!1,e.languageConfigurationService);if(r)n=r.action,o=r.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const h=t.getLineContent(a);if(Ql(h)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=f1(e.autoIndent,t,new M(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return n&&(n===ei.Indent&&(o=Ke.shiftIndent(e,o)),n===ei.Outdent&&(o=Ke.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,n){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let h=0;h<c;h++)o+=" "}else o=" ";return new mi(i,o,n)}static tab(e,t,i){const n=[];for(let o=0,r=i.length;o<r;o++){const a=i[o];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let c=this._goodIndentForLine(e,t,a.startLineNumber);c=c||" ";const h=e.normalizeIndentation(c);if(!l.startsWith(h)){n[o]=new mi(new M(a.startLineNumber,1,a.startLineNumber,l.length+1),h,!0);continue}}n[o]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){const l=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==l){n[o]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}n[o]=new wr(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return n}static compositionType(e,t,i,n,o,r,a,l){const c=n.map(h=>this._compositionType(i,h,o,r,a,l));return new li(4,c,{shouldPushStackElementBefore:Zd(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),h=new M(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(h)===i&&r===0?null:new Tu(h,i,0,r)}static _typeCommand(e,t,i){return i?new Gd(e,t,!0):new mi(e,t,!0)}static _enter(e,t,i,n){if(e.autoIndent===0)return Ke._typeCommand(n,`
`,i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),c=pi(l).substring(0,n.startColumn-1);return Ke._typeCommand(n,`
`+e.normalizeIndentation(c),i)}const o=f1(e.autoIndent,t,n,e.languageConfigurationService);if(o){if(o.indentAction===ei.None)return Ke._typeCommand(n,`
`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ei.Indent)return Ke._typeCommand(n,`
`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ei.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),h=`
`+c+`
`+l;return i?new Gd(n,h,!0):new Tu(n,h,-1,c.length-l.length,!0)}else if(o.indentAction===ei.Outdent){const l=Ke.unshiftIndent(e,o.indentation);return Ke._typeCommand(n,`
`+e.normalizeIndentation(l+o.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=pi(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=SA(e.autoIndent,t,n,{unshiftIndent:c=>Ke.unshiftIndent(e,c),shiftIndent:c=>Ke.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,n.getEndPosition());const h=n.endColumn,d=t.getLineContent(n.endLineNumber),u=Ai(d);if(u>=0?n=n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,u+1)):n=n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Gd(n,`
`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return h<=u+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new Tu(n,`
`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return Ke._typeCommand(n,`
`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,o=i.length;n<o;n++)if(!t.tokenization.isCheapToTokenize(i[n].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const o=tk(t,i.startLineNumber,i.startColumn),r=yA(e.autoIndent,t,i,n,{shiftIndent:a=>Ke.shiftIndent(e,a),unshiftIndent:a=>Ke.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Ke._typeCommand(new M(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+n,!1):Ke._typeCommand(new M(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r<a;r++){const l=i[r];if(!l.isEmpty())return!1;const c=l.getPosition(),h=t.getLineContent(c.lineNumber);if(h.charAt(c.column-1)!==o)return!1;const u=fo(o);if((c.column>2?h.charCodeAt(c.column-2):0)===92&&u)return!1;if(e.autoClosingOvertype==="auto"){let m=!1;for(let _=0,b=n.length;_<b;_++){const v=n[_];if(c.lineNumber===v.startLineNumber&&c.column===v.startColumn){m=!0;break}}if(!m)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,o){const r=[];for(let a=0,l=n.length;a<l;a++){const h=n[a].getPosition(),d=new M(h.lineNumber,h.column,h.lineNumber,h.column+1);r[a]=new mi(d,o)}return new li(4,r,{shouldPushStackElementBefore:Zd(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(l=>t.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,n){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new M(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+n!==a.open){l=!1;break}l&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),n=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of n)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,n,o){const r=fo(n),a=r?e.autoClosingQuotes:e.autoClosingBrackets,l=r?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;if(a==="never")return null;for(const m of i)if(!m.isEmpty())return null;const c=i.map(m=>{const _=m.getPosition();return o?{lineNumber:_.lineNumber,beforeColumn:_.column-n.length,afterColumn:_.column}:{lineNumber:_.lineNumber,beforeColumn:_.column,afterColumn:_.column}}),h=this._findAutoClosingPairOpen(e,t,c.map(m=>new O(m.lineNumber,m.beforeColumn)),n);if(!h)return null;const d=this._findContainedAutoClosingPair(e,h),u=d?d.close:"";let f=!0;for(const m of c){const{lineNumber:_,beforeColumn:b,afterColumn:v}=m,C=t.getLineContent(_),w=C.substring(0,b-1),L=C.substring(v-1);if(L.startsWith(u)||(f=!1),L.length>0){const S=L.charAt(0);if(!Ke._isBeforeClosingBrace(e,L)&&!l(S))return null}if(h.open.length===1&&(n==="'"||n==='"')&&a!=="always"){const S=El(e.wordSeparators);if(w.length>0){const D=w.charCodeAt(w.length-1);if(S.get(D)===0)return null}}if(!t.tokenization.isCheapToTokenize(_))return null;t.tokenization.forceTokenization(_);const E=t.tokenization.getLineTokens(_),k=og(E,b-1);if(!h.shouldAutoClose(k,b-k.firstCharOffset))return null;const y=h.findNeutralCharacter();if(y){const S=t.tokenization.getTokenTypeIfInsertingCharacter(_,b,y);if(!h.isOK(S))return null}}return f?h.close.substring(0,h.close.length-u.length):h.close}static _runAutoClosingOpenCharType(e,t,i,n,o,r,a){const l=[];for(let c=0,h=n.len
`){const h=[];for(let d=0,u=o.length;d<u;d++)h[d]=Ke._enter(i,n,!1,o[d]);return new li(4,h,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,o)){const h=[];let d=!1;for(let u=0,f=o.length;u<f;u++)if(h[u]=this._runAutoIndentType(i,n,o[u],a),!h[u]){d=!0;break}if(!d)return new li(4,h,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,n,o,r,a))return this._runAutoClosingOvertype(t,i,n,o,a);if(!e){const h=this._getAutoClosingPairClose(i,n,o,a,!1);if(h)return this._runAutoClosingOpenCharType(t,i,n,o,a,!1,h)}if(!e&&this._isSurroundSelectionType(i,n,o,a))return this._runSurroundSelectionType(t,i,n,o,a);if(!e&&this._isTypeInterceptorElectricChar(i,n,o)){const h=this._typeInterceptorElectricChar(t,i,n,o[0],a);if(h)return h}const l=[];for(let h=0,d=o.length;h<d;h++)l[h]=new mi(o[h],a);const c=jm(a,t);return new li(c,l,{shouldPushStackElementBefore:Zd(t,c),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,o){const r=[];for(let l=0,c=n.length;l<c;l++)r[l]=new mi(n[l],o);const a=jm(o,e);return new li(a,r,{shouldPushStackElementBefore:Zd(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let o=0,r=i.length;o<r;o++){let a=i[o].positionLineNumber;if(a===1)n[o]=new Gd(new M(1,1,1,1),`
`);else{a--;const l=t.getLineMaxColumn(a);n[o]=this._enter(e,t,!1,new M(a,l,a,l))}}return n}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const n=[];for(let o=0,r=i.length;o<r;o++){const a=i[o].positionLineNumber,l=t.getLineMaxColumn(a);n[o]=this._enter(e,t,!1,new M(a,l,a,l))}return n}static lineBreakInsert(e,t,i){const n=[];for(let o=0,r=i.length;o<r;o++)n[o]=this._enter(e,t,!0,i[o]);return n}}class T2 extends Tu{constructor(e,t,i,n){super(e,(i?t:"")+n,0,-n.length),this._openCharacter=t,this._closeCharacter=n,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const n=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new M(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new M(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}}class LA{constructor(e,t,i,n,o,r){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=o,this.insertedSelectionEnd=r}}function jm(s,e){return s===" "?e===5||e===6?6:5:4}function Zd(s,e){return Mw(s)&&!Mw(e)?!0:s===5?!1:Tw(s)!==Tw(e)}function Tw(s){return s===6||s===5?"space":s}function Mw(s){return s===4||s===5||s===6}var $;(function(s){s.editorSimpleInput=new te("editorSimpleInput",!1,!0),s.editorTextFocus=new te("editorTextFocus",!1,p("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),s.focus=new te("editorFocus",!1,p("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),s.textInputFocus=new te("textInputFocus",!1,p("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),s.readOnly=new te("editorReadonly",!1,p("editorReadonly","Whether the editor is read only")),s.inDiffEditor=new te("inDiffEditor",!1,p("inDiffEditor","Whether the context is a diff editor")),s.columnSelection=new te("editorColumnSelection",!1,p("editorColumnSelection","Whether `editor.columnSelection` is enabled")),s.writable=s.readOnly.toNegated(),s.hasNonEmptySelection=new te("editorHasSelection",!1,p("editorHasSelection","Whether the editor has text selected")),s.hasOnlyEmptySelection=s.hasNonEmptySelection.toNegated(),s.hasMultipleSelections=new te("editorHasMultipleSelections",!1,p("editorHasMultipleSelections","Whether the editor has multiple selections")),s.hasSingleSelection=s.hasMultipleSelections.toNegated(),s.tabMovesFocus=new te("editorTabMovesFocus",!1,p("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),s.tabDoesNotMoveFocus=s.tabMovesFocus.toNegated(),s.isInWalkThroughSnippet=new te("isInEmbeddedEditor",!1,!0),s.canUndo=new te("canUndo",!1,!0),s.canRedo=new te("canRedo",!1,!0),s.hoverVisible=new te("editorHoverVisible",!1,p("editorHoverVisible","Whether the editor hover is visible")),s.inCompositeEditor=new te("inCompositeEditor",void 0,p("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),s.notInCompositeEditor=s.inCompositeEditor.toNegated(),s.languageId=new te("editorLangId","",p("editorLangId","The language identifier of the editor")),s.hasCompletionItemProvider=new te("editorHasCompletionItemProvider",!1,p("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),s.hasCodeActionsProvider=new te("editorHasCodeActionsProvider",!1,p("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),s.hasCodeLensProvider=new te("editorHasCodeLensProvider",!1,p("editorHasCodeLensProvider","Whether the editor has a code lens provider")),s.hasDefinitionProvider=new te("editorHasDefinitionProvider",!1,p("editorHasDefinitionProvider","Whether the editor has a definition provider")),s.hasDeclarationProvider=new te("editorHasDeclarationProvider",!1,p("editorHasDeclarationProvider","Whether the editor has a declaration provider")),s.hasImplementationProvider=new te("editorHasImplementationProvider",!1,p("editorHasImplementationProvid
.monaco-scrollable-element > .shadow.top {
box-shadow: ${t} 0 6px 6px -6px inset;
}
.monaco-scrollable-element > .shadow.left {
box-shadow: ${t} 6px 0 6px -6px inset;
}
.monaco-scrollable-element > .shadow.top.left {
box-shadow: ${t} 6px 6px 6px -6px inset;
}
`);const i=s.getColor(Ir);i&&e.addRule(`
.monaco-scrollable-element > .scrollbar > .slider {
background: ${i};
}
`);const n=s.getColor(xr);n&&e.addRule(`
.monaco-scrollable-element > .scrollbar > .slider:hover {
background: ${n};
}
`);const o=s.getColor(Nr);o&&e.addRule(`
.monaco-scrollable-element > .scrollbar > .slider.active {
background: ${o};
}
`)});class wf{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class Db extends sc{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const l=a-e;n[l]=[]}if(i.length===0)return n;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.className<l.className?-1:1);let o=null,r=0;for(let a=0,l=i.length;a<l;a++){const c=i[a],h=c.className;let d=Math.max(c.startLineNumber,e)-e;const u=Math.min(c.endLineNumber,t)-e;o===h?(d=Math.max(r+1,d),r=Math.max(r,u)):(o=h,r=u);for(let f=d;f<=r;f++)n[f].push(o)}return n}}class ZA extends Db{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(133);this._lineHeight=t.get(61),this._glyphMargin=t.get(52),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(133);return this._lineHeight=t.get(61),this._glyphMargin=t.get(52),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!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){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let o=0,r=t.length;o<r;o++){const a=t[o],l=a.options.glyphMarginClassName;l&&(i[n++]=new wf(a.range.startLineNumber,a.range.endLineNumber,l))}return i}prepareRender(e){if(!this._glyphMargin){this._renderResult=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),o=this._lineHeight.toString(),r=this._glyphMarginLeft.toString(),a=this._glyphMarginWidth.toString(),l='" style="left:'+r+"px;width:"+a+"px;height:"+o+'px;"></div>',c=[];for(let h=t;h<=i;h++){const d=h-t,u=n[d];u.length===0?c[d]="":c[d]='<div class="cgmr codicon '+u.join(" ")+l}this._renderResult=c}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class B2 extends H{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function YA(s,e){let t=0,i=0;const n=s.length;for(;i<n;){const o=s.charCodeAt(i);if(o===32)t++;else if(o===9)t=t-t%e+e;else break;i++}return i===n?-1:t}var Wr;(function(s){s[s.Disabled=0]="Disabled",s[s.EnabledForActive=1]="EnabledForActive",s[s.Enabled=2]="Enabled"})(Wr||(Wr={}));class Ar{constructor(e,t,i,n,o,r){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=n,this.forWrappedLinesAfterColumn=o,this.forWrappedLinesBeforeOrAtColumn=r,e!==-1==(t!==-1))throw new Error}}class Xc{constructor(e,t){this.top=e,this.endColumn=t}}class QA extends B2{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return YA(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,l=-1,c=-2,h=-1;const d=y=>{if(a!==-1&&(a===-2||a>y-1)){a=-1,l=-1;for(let S=y-2;S>=0;S--){const D=this._computeIndentLevel(S);if(D>=0){a=S,l=D;break}}}if(c===-2){c=-1,h=-1;for(let S=y;S<n;S++){const D=this._computeIndentLevel(S);if(D>=0){c=S,h=D;break}}}};let u=-2,f=-1,m=-2,_=-1;const b=y=>{if(u===-2){u=-1,f=-1;for(let S=y-2;S>=0;S--){const D=this._computeIndentLevel(S);if(D>=0){u=S,f=D;break}}}if(m!==-1&&(m===-2||m<y
`)>=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,h=o.text.length-r[2].length-1,d=o.text.lastIndexOf(c,h-1);if(d===-1)return null;t.push([d,h])}return t}executeEdits(e,t,i,n){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(o)for(let d=0,u=o.length;d<u;d++){const[f,m]=o[d],_=c[d],b=_.range.startLineNumber,v=_.range.startColumn-1+f,C=_.range.startColumn-1+m;r.push(new M(b,C+1,b,C+2)),a.push(new M(b,v+1,b,C+2))}const h=n(c);return h&&(this._isHandling=!0),h});l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),r.length>0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const o=th.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){lt(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return Zw.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new ih(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(Ke.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const n=t.length;let o=0;for(;o<n;){const r=Z0(t,o),a=t.substr(o,r);this._executeEditOperation(Ke.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),o+=r}}else this._executeEditOperation(Ke.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,o,r){if(t.length===0&&i===0&&n===0){if(o!==0){const a=this.getSelections().map(l=>{const c=l.getPosition();return new Pe(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Ke.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,o))},e,r)}paste(e,t,i,n,o){this._executeEdit(()=>{this._executeEditOperation(Ke.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(qr.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new li(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new li(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}Ol.MAX_CURSOR_COUNT=1e4;class th{constructor(e,t){this.modelVersionId=e,this.cursorState=t}static from(e,t){return new th(e.getVersionId(),t.getCursorStates())}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.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 Zw{constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEn
`,"gi"):null,o=[];let r,a=0,l=0,c=0,h=0;const d=new Array;for(let m=0;m<60;m++)d.push(new Lo(Je(0,m),0,-1,ot.getEmpty(),new Aa(Je(0,m))));const u=new Array;for(let m=0;m<60;m++)u.push(new Lo(Je(1,m),0,-1,ot.getEmpty(),new Aa(Je(1,m))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const m=r.index,_=r[0];if(_===`
`)a++,l=m+1;else{if(c!==m){let b;if(h===a){const v=m-c;if(v<d.length)b=d[v];else{const C=Je(0,v);b=new Lo(C,0,-1,ot.getEmpty(),new Aa(C))}}else{const v=a-h,C=m-l;if(v===1&&C<u.length)b=u[C];else{const w=Je(v,C);b=new Lo(w,0,-1,ot.getEmpty(),new Aa(w))}}o.push(b)}o.push(t.getToken(_)),c=m+_.length,h=a}}const f=e.length;if(c!==f){const m=h===a?Je(0,f-c):Je(a-h,f-l);o.push(new Lo(m,0,-1,ot.getEmpty(),new Aa(m)))}this.length=Je(a,f-l),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new hx}}class Rb{constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}static createFromLanguage(e,t){function i(o){return t.getKey(`${o.languageId}:::${o.bracketText}`)}const n=new Map;for(const o of e.bracketsNew.openingBrackets){const r=Je(0,o.bracketText.length),a=i(o),l=ot.getEmpty().add(a,Qw);n.set(o.bracketText,new Lo(r,1,a,l,Ef.create(r,o,l)))}for(const o of e.bracketsNew.closingBrackets){const r=Je(0,o.bracketText.length);let a=ot.getEmpty();const l=o.getClosedBrackets();for(const c of l)a=a.add(i(c),Qw);n.set(o.bracketText,new Lo(r,2,i(l[0]),a,Ef.create(r,o,a)))}return new Rb(n)}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>bR(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function bR(s){let e=Ys(s);return/^[\w ]+/.test(s)&&(e=`\\b${e}`),/[\w ]+$/.test(s)&&(e=`${e}\\b`),e}class CR{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=Rb.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function vR(s){if(s.length===0)return null;if(s.length===1)return s[0];let e=0;function t(){if(e>=s.length)return null;const r=e,a=s[r].listHeight;for(e++;e<s.length&&s[e].listHeight===a;)e++;return e-r>=2?U2(r===0&&e===s.length?s:s.slice(r,e),!1):s[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())Xw(i,n)<=Xw(n,r)?(i=Ym(i,n),n=r):n=Ym(n,r);return Ym(i,n)}function U2(s,e=!1){if(s.length===0)return null;if(s.length===1)return s[0];let t=s.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const o=n<<1;s[n]=as.create23(s[o],s[o+1],o+3===t?s[o+2]:null,e)}t=i}return as.create23(s[0],s[1],t>=3?s[2]:null,e)}function Xw(s,e){return Math.abs(s.listHeight-e.listHeight)}function Ym(s,e){return s.listHeight===e.listHeight?as.create23(s,e,null,!1):s.listHeight>e.listHeight?wR(s,e):SR(e,s)}function wR(s,e){s=s.toMutable();let t=s;const i=new Array;let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=as.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?as.create23(s,n,null,!1):s}function SR(s,e){s=s.toMutable();let t=s;const i=new Array;for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let o=i.length-1;o>=0;o--){const r=i[o];n?r.childrenLength>=3?n=as.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?as.create23(n,s,null,!1):s}class yR{constructor(e){this.lastOffset=En,this.nextNodes=[e],this.offsets=[En],this.idxs=[]}readLongestNodeAt(e,t){if(fl(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=Lc(this.nextNodes);if(!i)return;const n=Lc(this.offsets);if(fl(e,n))return;if(fl(n,e))if(_t(n,i.length)<=e)this.nextN
`?0:1}function Ms(s){return s?s instanceof G2||s instanceof PR:!1}class Ob{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Ms(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Ms(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(Ms(t)&&t.canAppend(this._model))return t;const i=new G2(p("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],y1(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),o=this._model.applyEdits(t,!0),r=Ob._computeCursorState(i,o),a=o.map((l,c)=>({index:c,textChange:l.textChange}));return a.sort((l,c)=>l.textChange.oldPosition===c.textChange.oldPosition?l.index-c.index:l.textChange.oldPosition-c.textChange.oldPosition),n.append(this._model,a.map(l=>l.textChange),y1(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return lt(i),null}}}class OR{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function FR(s,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let o;for(o=0;o<e&&o<i;o++){const u=s.charCodeAt(o),f=t.charCodeAt(o);if(u!==f)break}let r=0,a=0;for(let u=o;u<e;u++)s.charCodeAt(u)===32?r++:a++;let l=0,c=0;for(let u=o;u<i;u++)t.charCodeAt(u)===32?l++:c++;if(r>0&&a>0||l>0&&c>0)return;const h=Math.abs(a-c),d=Math.abs(r-l);if(h===0){n.spacesDiff=d,d>0&&0<=l-1&&l-1<s.length&&l<t.length&&t.charCodeAt(l)!==32&&s.charCodeAt(l-1)===32&&s.charCodeAt(s.length-1)===44&&(n.looksLikeAlignment=!0);return}if(d%h===0){n.spacesDiff=d/h;return}}function nS(s,e,t){const i=Math.min(s.getLineCount(),1e4);let n=0,o=0,r="",a=0;const l=[2,4,6,8,3,5,7],c=8,h=[0,0,0,0,0,0,0,0,0],d=new OR;for(let m=1;m<=i;m++){const _=s.getLineLength(m),b=s.getLineContent(m),v=_<=65536;let C=!1,w=0,L=0,E=0;for(let y=0,S=_;y<S;y++){const D=v?b.charCodeAt(y):s.getLineCharCode(m,y);if(D===9)E++;else if(D===32)L++;else{C=!0,w=y;break}}if(!C||(E>0?n++:L>1&&o++,FR(r,a,b,w,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const k=d.spacesDiff;k<=c&&h[k]++,r=b,a=w}let u=t;n!==o&&(u=n<o);let f=e;if(u){let m=u?0:.1*i;l.forEach(_=>{const b=h[_];b>m&&(m=b,f=_)}),f===4&&h[4]>0&&h[2]>0&&h[2]>=h[4]/2&&(f=2)}return{insertSpaces:u,tabSize:f}}function ci(s){return(s.metadata&1)>>>0}function Ne(s,e){s.metadata=s.metadata&254|e<<0}function Mt(s){return(s.metadata&2)>>>1===1}function xe(s,e){s.metadata=s.metadata&253|(e?1:0)<<1}function Z2(s){return(s.metadata&4)>>>2===1}function sS(s,e){s.metadata=s.metadata&251|(e?1:0)<<2}function BR(s){return(s.metadata&24)>>>3}function oS(s,e){s.metadata=s.metadata&231|e<<3}function VR(s){return(s.metadata&32)>>>5===1}function rS(s,e){s.metadata=s.metadata&223|(e?1:0)<<5}class Y2{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Ne(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,sS(this,!1),oS(this,1),rS(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,xe(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;const t=this.options.className;sS(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),oS(this,this.options.stickiness),rS(this,this.options.collapseOnReplaceEdit)}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}}const oe=new Y2(null,0,0);oe.parent=oe;oe.left=oe;oe.right=oe;Ne(oe,0);class Jm{constructor(){this.root=oe,this.requestNor
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,o-1)===13){const _=this.positionInBuffer(n,o-1);this.deleteNodeTail(n,_),t="\r"+t,n.piece.length===0&&h.push(n)}else this.deleteNodeTail(n,c);else this.deleteNodeTail(n,c);const u=this.createNewPieces(t);d.length>0&&this.rbInsertRight(n,d);let f=n;for(let m=0;m<u.length;m++)f=this.rbInsertRight(f,u[m]);this.deleteNodes(h)}else this.insertContentToNodeRight(t,n)}else{const n=this.createNewPieces(t);let o=this.rbInsertLeft(null,n[0]);for(let r=1;r<n.length;r++)o=this.rbInsertRight(o,n[r])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===ee)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),o=i.node,r=n.node;if(o===r){const u=this.positionInBuffer(o,i.remainder),f=this.positionInBuffer(o,n.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){const m=o.next();nu(this,o),this.validateCRLFWithPrevNode(m),this.computeBufferMetadata();return}this.deleteNodeHead(o,f),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),this.computeBufferMetadata();return}if(i.nodeStartOffset+o.piece.length===e+t){this.deleteNodeTail(o,u),this.validateCRLFWithNextNode(o),this.computeBufferMetadata();return}this.shrinkNode(o,u,f),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,l),this._searchCache.validate(e),o.piece.length===0&&a.push(o);const c=this.positionInBuffer(r,n.remainder);this.deleteNodeHead(r,c),r.piece.length===0&&a.push(r);const h=o.next();for(let u=h;u!==ee&&u!==r;u=u.next())a.push(u);const d=o.piece.length===0?o.prev():o;this.deleteNodes(a),this.validateCRLFWithNextNode(d),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const r=t.piece,a={line:r.start.line+1,column:0},l=new gi(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),r.length-1);t.piece=l,e+=`
`,Ds(this,t,-1,-1),t.piece.length===0&&i.push(t)}const n=this.createNewPieces(e);let o=this.rbInsertLeft(t,n[n.length-1]);for(let r=n.length-2;r>=0;r--)o=this.rbInsertLeft(o,n[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
`);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let o=n;for(let r=1;r<i.length;r++)o=this.rbInsertRight(o,i[r]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,o=e.piece.bufferIndex,r=this._buffers[o].lineStarts,l=r[n.start.line]+n.start.column+t;let c=n.start.line,h=n.end.line,d=0,u=0,f=0;for(;c<=h&&(d=c+(h-c)/2|0,f=r[d],d!==h);)if(u=r[d+1],l<f)h=d-1;else if(l>=u)c=d+1;else break;return i?(i.line=d,i.column=l-f,null):{line:d,column:l-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const o=n[i.line+1],r=n[i.line]+i.column;if(o>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?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++)nu(this,e[t])}createNewPieces(e){if(e.length>ws){const h=[];for(;e.length>ws;){const u=e.charCodeAt(ws-1);let f;u===13||u>=55296&&u<=56319?(f=e.substring(0,ws-1),e=e.substring(ws-1)):(f=e.substring(0,ws),e=e.substring(ws));const m=Is(f);h.push(new gi(this._buffers.length,{line:0,column:0},{line:m.length-1,column:f.length-m[m.length-1]},m.length-1,f.length)),this._buffers.push(new Sr(f,m))}const d=Is(e);return h.push(new gi(this._buffers.length,{line:0,column:0},{line:d.length-1,column:e.length-d[d.length-1]},d.length-1,e.length)),this._buffers.push(new Sr(e,d)),h}let t=this._buffers[0].buffer.length;const i=Is(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&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 h=0;h<i.length;h++)i[h]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let h=0;h<i.length;h++)i[h]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,r=this._buffers[0].lineStarts.length-1,a=o-this._buffers[0].lineStarts[r],l={line:r,column:a},c=new gi(0,n,l,this.getLineFeedCnt(0,n,l),o-t);return this._lastChangeBufferPos=l,[c]}getLineRawContent(e,t=0){let i=this.root,n="";const o=this._searchCache.get2(e);if(o){i=o.node;const r=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt===e)n=a.substring(l+r,l+i.piece.length);else{const c=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return a.substring(l+r,l+c-t)}}else{let r=0;const a=e;for(;i!==ee;)if(i.left!==ee&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),h=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),h.substring(d+l,d+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,h=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=c.substring(h+l,h+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==ee;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=r.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=r.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==ee;)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.
`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=Is(t,!1);for(let f=0;f<o.length;f++)o[f]+=n;if(i){const f=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-f}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const r=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[r],l={line:r,column:a},c=e.piece.length+t.length,h=e.piece.lineFeedCnt,d=this.getLineFeedCnt(0,e.piece.start,l),u=d-h;e.piece=new gi(e.piece.bufferIndex,e.piece.start,l,d,c),this._lastChangeBufferPos=l,Ds(this,e,t.length,u)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let n=0;for(;t!==ee;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(o),o}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!==ee;)if(i.left!==ee&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=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(o+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:n};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==ee;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const 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&&this._EOL===`
`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===ee||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,o=i[n]+t.start.column;return n===i.length-1||i[n+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===ee||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],n=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new gi(e.piece.bufferIndex,e.piece.start,o,a,r),Ds(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,h=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new gi(t.piece.bufferIndex,l,t.piece.end,h,c),Ds(this,t,-1,-1),t.piece.length===0&&i.push(t);const d=this.createNewPieces(`\r
`);this.rbInsertRight(e,d[0]);for(let u=0;u<i.length;u++)nu(this,i[u])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+=`
`,i.piece.length===1)nu(this,i);else{const n=i.piece,o={line:n.start.line+1,column:0},r=n.length-1,a=this.getLineFeedCnt(n.bufferIndex,o,n.end);i.piece=new gi(n.bufferIndex,o,n.end,a,r),Ds(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===ee)return t(ee);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===ee)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),o=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,o)}getPieceContent(e){const 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){const i=new L1(t,1);if(i.left=ee,i.right=ee,i.parent=ee,i.size_left=0,i.lf_left=0,this.root===ee)this.root=i,i.color=0;else if(e.right===ee)e.right=i,i.parent=e;else{const o=Fb(e.right);o.left=i,i.parent=o}return cS(this,i),i}rbInsertLeft(e,t){const i=new L1(t,1);if(i.left=ee,i.right=ee,i.parent=ee,i.size_left=0,i.lf_left=0,this.root===ee)this.root=i,i.color=0;else if(e.left===ee)e.left=i,i.parent=e;else{const n=X2(e.left);n.right=i,i.parent=n}return cS(this,i),i}}class gl extends H{constructor(e,t,i,n,o,r,a){super(),this._onDidChangeContent=this._register(new A),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._pieceTree=new tP(e,i,a)}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){const i=e+t,n=this.getPositionAt(e),o=this.getPositionAt(i);return new M(n.lineNumber,n.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const 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;const i=this.getOffsetAt(e.startLineNumber,e.startColumn);return this.getOffsetAt(e.endLineNumber,e.endColumn)-i}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,o=e.endLineNumber;for(let r=n;r<=o;r++){const a=this.getLineContent(r),l=r===n?e.startColumn-1:0,c=r===o?e.endColumn-1:a.length;for(let h=l;h<c;h++)yt(a.charCodeAt(h))?(i=i+1,h=h+1):i=i+1}return i+=this._getEndOfLine(t).length*(o-n),i}return this.getValueLengthInRange(e,t)}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){const t=Ai(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Ql(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return`
`;case 2:return`\r
`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let n=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let _=0;_<e.length;_++){const b=e[_];a&&b._isTracked&&(a=!1);const v=b.range;if(b.text){let k=!0;r||(k=!Y0(b.text),r=k),!n&&k&&(n=Ch(b.text)),!o&&k&&(o=FL(b.text))}let C="",w=0,L=0,E=0;if(b.text){let k;[w,L,E,k]=Fl(b.text);const y=this.getEOL();k===0||k===(y===`\r
`?2:1)?C=b.text:C=b.text.replace(/\r\n|\r|\n/g,y)}l[_]={sortIndex:_,identifier:b.identifier||null,range:v,rangeOffset:this.getOffsetAt(v.startLineNumber,v.startColumn),rangeLength:this.getValueLengthInRange(v),text:C,eolCount:w,firstLineLength:L,lastLineLength:E,forceMoveMarkers:!!b.forceMoveMarkers,isAutoWhitespaceEdit:b.isAutoWhitespaceEdit||!1}}l.sort(gl._sortOpsAscending);let c=!1;for(let _=0,b=l.length-1;_<b;_++){const v=l[_].range.getEndPosition(),C=l[_+1].range.getStartPosition();if(C.isBeforeOrEqual(v)){if(C.isBefore(v))throw new Error("Overlapping ranges are not allowed!");c=!0}}a&&(l=this._reduceOperations(l));const h=i||t?gl._getInverseEditRanges(l):[],d=[];if(t)for(let _=0;_<l.length;_++){const b=l[_],v=h[_];if(b.isAutoWhitespaceEdit&&b.range.isEmpty())for(let C=v.startLineNumber;C<=v.endLineNumber;C++){let w="";C===v.startLineNumber&&(w=this.getLineContent(b.range.startLineNumber),Ai(w)!==-1)||d.push({lineNumber:C,oldContent:w})}}let u=null;if(i){let _=0;u=[];for(let b=0;b<l.length;b++){const v=l[b],C=h[b],w=this.getValueInRange(v.range),L=v.rangeOffset+_;_+=v.text.length-w.length,u[b]={sortIndex:v.sortIndex,identifier:v.identifier,range:C,text:w,textChange:new xt(v.rangeOffset,w,L,v.text)}}c||u.sort((b,v)=>b.sortIndex-v.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(l);let m=null;if(t&&d.length>0){d.sort((_,b)=>b.lineNumber-_.lineNumber),m=[];for(let _=0,b=d.length;_<b;_++){const v=d[_].lineNumber;if(_>0&&d[_-1].lineNumber===v)continue;const C=d[_].oldContent,w=this.getLineContent(v);w.length===0||w===C||Ai(w)!==-1||m.push(v)}}return this._onDidChangeContent.fire(),new vN(u,f,m)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,n=e[e.length-1].range,o=new M(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,m=e.length;f<m;f++){const _=e[f],b=_.range;t=t||_.forceMoveMarkers,l.push(this.getValueInRange(new M(r,a,b.startLineNumber,b.startColumn))),_.text.length>0&&l.push(_.text),r=b.endLineNumber,a=b.endColumn}const c=l.join(""),[h,d,u]=Fl(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:h,firstLineLength:d,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(gl._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],o=n.range.startLineNumber,r=n.range.startColumn,a=n.range.endLineNumber,l=n.range.endColumn;if(o===a&&r===l&&n.text.length===0)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);const c=new M(o,r,a,l);t.push({range:c,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){const t=[];let i=0,n=0,o=null;for(let r=0,a=e.length;r<a;r++){const l=e[r];let c,h;o?o.range.endLineNumber===l.range.startLineNumber?(c=i,h=n+(l.range.startColumn-o.range.endColumn)):(c=i+(l.range.startLineNumber-o.range.endLineNumber),h=l.range.startColumn):(c=l.range.startLineNumber,h=l.range.startColumn);let d;if(l.text.length>0){const u=l.eolCount+1;u===1?d=new M(c,h,c,h+l.firstLineLength):d=new M(c,h,c+u-1,l.lastLineLength+1)}else d=new M(c,h,c,h);i=d.endLineNumber,n=d.endColumn,t.push(d),o=l}return t}static _sortOpsAscending(e,t){const i=M.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=M.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class iP{constructor(e,t,i,n,o,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._n
`:`\r
`:i>t/2?`\r
`:`
`}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r
`&&(this._cr>0||this._lf>0)||t===`
`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o<r;o++){const a=i[o].buffer.replace(/\r\n|\r|\n/g,t),l=Is(a);i[o]=new Sr(a,l)}const n=new gl(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class eD{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(e.length===0)return;this.chunks.length===0&&X0(e)&&(this.BOM=eN,e=e.substr(1));const t=e.charCodeAt(e.length-1);t===13||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=XR(this._tmpLineStarts,e);this.chunks.push(new Sr(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),!this.isBasicASCII&&!this.containsRTL&&(this.containsRTL=Ch(e)),!this.isBasicASCII&&!this.containsUnusualLineTerminators&&(this.containsUnusualLineTerminators=FL(e))}finish(e=!0){return this._finish(),new iP(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=Is(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class nP{constructor(e,t){this._startLineNumber=e,this._tokens=t}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class ip{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new nP(e,[t]))}finalize(){return this._tokens}}class hS{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}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let n=0;n<t;n++)i[n]=this._default;this._store=eg(this._store,e,i)}}class sP{constructor(e,t){this.tokenizationSupport=e,this.initialState=t,this._lineBeginState=new hS(null),this._lineNeedsTokenization=new hS(!0),this._firstLineNeedsTokenization=0,this._lineBeginState.set(0,this.initialState)}get invalidLineStartIndex(){return this._firstLineNeedsTokenization}markMustBeTokenized(e){this._lineNeedsTokenization.set(e,!0),this._firstLineNeedsTokenization=Math.min(this._firstLineNeedsTokenization,e)}getBeginState(e){return this._lineBeginState.get(e)}setEndState(e,t,i){if(this._lineNeedsTokenization.set(t,!1),this._firstLineNeedsTokenization=t+1,t===e-1)return;const n=this._lineBeginState.get(t+1);if(n===null||!i.equals(n)){this._lineBeginState.set(t+1,i),this.markMustBeTokenized(t+1);return}let o=t+1;for(;o<e&&!this._lineNeedsTokenization.get(o);)o++;this._firstLineNeedsTokenization=o}applyEdits(e,t){this.markMustBeTokenized(e.startLineNumber-1),this._lineBeginState.delete(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineNeedsTokenization.delete(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineBeginState.insert(e.startLineNumber,t),this._lineNeedsTokenization.insert(e.startLineNumber,t)}}class oP extends H{constructor(e,t,i){super(),this._textModel=e,this._tokenizationPart=t,this._languageIdCodec=i,this._isScheduled=!1,this._isDisposed=!1,this._tokenizationStateStore=null,this.
`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=H.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new Hr(e,t)))}setValue(e){if(this._assertNotDisposed(),e===null)return;const{textBuffer:t,disposable:i}=uS(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,o,r,a){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokenizationTextModelPart.flush(),this._decorations=Object.create(null),this._decorationsTree=new fS,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new ul([new I9],this._versionId,!1,!1),this._createContentChanged2(new M(1,1,o,r),0,n,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r
`:`
`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new ul([new T9],this._versionId,!1,!1),this._createContentChanged2(new M(1,1,o,r),0,n,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const o=t[i],r=o.range,a=o.cachedAbsoluteStart-o.start,l=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),c=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);o.cachedAbsoluteStart=l,o.cachedAbsoluteEnd=c,o.cachedVersionId=e,o.start=l-a,o.end=c-a,Yo(o)}}onBeforeAttached(){this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}onBeforeDetached(){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const o=this._buffer.getLineLength(n);o>=dP?t+=o:e+=o}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();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.indentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new Eu({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=nS(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),N2(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){const t=this.findMatches(OL.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.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();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versi
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const d=this.getLineMaxColumn(o);r>=d&&(r=d)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),h=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,h=1;else if(c>t)c=t,h=this.getLineMaxColumn(c);else if(h<=1)h=1;else{const d=this.getLineMaxColumn(c);h>=d&&(h=d)}return i===o&&n===r&&a===c&&l===h&&e instanceof M&&!(e instanceof Pe)?e:new M(o,r,c,h)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const n=this._buffer.getLineCount();if(e>n)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(yt(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new O(1,1);if(n>r)return new O(r,this.getLineMaxColumn(r));if(o<=1)return new O(n,1);const a=this.getLineMaxColumn(n);if(o>=a)return new O(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,o-2);if(yt(l))return new O(n,o-1)}return new O(n,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof O&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(o,r,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,c=yt(a),h=yt(l);return!c&&!h}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof M&&!(e instanceof Pe)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const c=r>1?this._buffer.getLineCharCode(o,r-2):0,h=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,d=yt(c),u=yt(h);return!d&&!u?new M(o,r,a,l):o===a&&r===l?new M(o,r-1,a,l-1):d&&u?new M(o,r-1,a,l+1):d?new M(o,r-1,a,l):new M(o,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new M(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,o,r,a=hP){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(d=>M.isIRange(d))&&(l=t.map(d=>this.validateRange(d)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((d,u)=>d.startLineNumber-u.startLineNumber||d.startColumn-u.startColumn);const c=[];c.push(l.reduce((d,u)=>M.areIntersecting(d,u)?d.plusRange(u):(c.push(d),u)));let h;if(!i&&e.indexOf(`
`)<0){const u=new Sa(e,i,n,o).parseSearchRequest();if(!u)return[];h=f=>this.findMatchesLineByLine(f,u,r,a)}else h=d=>Fd.findMatches(this,new Sa(e,i,n,o),d,r,a);return c.map(h).reduce((d,u)=>d.concat(u),[])}findNextMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(`
`)<0){const c=new Sa(e,i,n,o).parseSearchRequest();if(!c)return null;const h=this.getLineCount();let d=new M(a.lineNumber,a.column,h,this.getLineMaxColumn(h)),u=this.findMatchesLineByLine(d,c,r,1);return Fd.findNextMatch(this,new Sa(e,i,n,o),a,r),u.length>0||(d=new M(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(d,c,r,1),u.length>0)?u[0]:null}return Fd.findNextMatch(this,new Sa(e,i,n,o),a,r)}findPreviousMatch(e,t,i,n,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return Fd.findPreviousMatch(this,new Sa(e,i,n,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===`
`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof bm?e:new bm(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const n=t.map(r=>({range:this.validateRange(r.range),text:r.text}));let o=!0;if(e)for(let r=0,a=e.length;r<a;r++){const l=e[r];let c=!1;for(let h=0,d=n.length;h<d;h++){const u=n[h].range,f=u.startLineNumber>l.endLineNumber,m=l.startLineNumber>u.endLineNumber;if(!f&&!m){c=!0;break}}if(!c){o=!1;break}}if(o)for(let r=0,a=this._trimAutoWhitespaceLines.length;r<a;r++){const l=this._trimAutoWhitespaceLines[r],c=this.getLineMaxColumn(l);let h=!0;for(let d=0,u=n.length;d<u;d++){const f=n[d].range,m=n[d].text;if(!(l<f.startLineNumber||l>f.endLineNumber)&&!(l===f.startLineNumber&&f.startColumn===c&&f.isEmpty()&&m&&m.length>0&&m.charAt(0)===`
`)&&!(l===f.startLineNumber&&f.startColumn===1&&f.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===`
`)){h=!1;break}}if(h){const d=new M(l,1,l,c);t.push(new bm(null,d,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i)}_applyUndo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new M(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new M(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),n=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,h=r.length;c<h;c++){const d=r[c],[u,f,m]=Fl(d.text);this._tokenizationTextModelPart.acceptEdit(d.range,d.text,u,f,m),this._decorationsTree.acceptReplace(d.rangeOffset,d.rangeLength,d.text.length,d.forceMoveMarkers)}const a=[];this._increaseVersionId();let l=i;for(let c=0,h=r.length;c<h;c++){const d=r[c],[u]=Fl(d.text);this._onDidChangeDecorations.fire();const f=d.range.startLineNumber,m=d.range.endLineNumber,_=m-f,b=u,v=Math.min(_,b),C=b-_,w=o-l-C+f,L=w,E=w+b,k=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new O(L,1)),this.getOffsetAt(new O(E,this.getLineMaxColumn(E))),0),y=Rn.fromDecorations(k),S=new _h(y);for(let D=v;D>=0;D--){const N=f+D,T=w+D;S.takeFromEndWhile(B=>B.lineNumber>T);const P=S.takeFromEndWhile(B=>B.lineNumber===T);a.push(new Gw(N,this.getLineContent(T),P))}if(v<_){const D=f+v;a.push(new x9(D+1,m))}if(v<b){const D=new _h(y),N=f+v,T=b-v,P=o-l-T+N+1,B=[],z=[];for(let j=0;j<T;j++){const X=P+j;z[j]=this.getLineContent(X),D.takeWhile(J=>J.lineNumber<X),B[j]=D.takeWhile(J=>J.lineNumber===X)}a.push(new N9(N+1,f+b,z,B))}l+=C}this._emitContentChangedEvent(new ul(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return n.reverseEdits===null?void 0:n.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){if(e===null||e.size===0)return;const i=Array.from(e).map(n=>new Gw(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new W2(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,mS(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let n=null;try{n=t(i)}catch(o){lt(o)}return i.addDecoration=Dc,i.changeDecora
`:this.model.getEOL();e=e.slice(0),e.sort(M.compareRangesUsingStarts);let o=!1,r=!1;for(const l of e)l.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const l=e.map(h=>h.startLineNumber);let c="";for(let h=0;h<l.length;h++)h>0&&l[h-1]===l[h]||(c+=this.model.getLineContent(l[h])+n);return c}if(o&&t){const l=[];let c=0;for(const h of e){const d=h.startLineNumber;h.isEmpty()?d!==c&&l.push(this.model.getLineContent(d)):l.push(this.model.getValueInRange(h,i?2:0)),c=d}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===es||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const h=n.startLineNumber;n=new M(h,this.model.getLineMinColumn(h),h,this.model.getLineMaxColumn(h))}const o=this._configuration.options.get(46),r=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Yi.fontFamily;let c;return l?c=Yi.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Yi.fontFamily}`),{mode:i,html:`<div style="color: ${r[1]};background-color: ${r[2]};font-family: ${c};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,r)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const h=this.model.tokenization.getLineTokens(c),d=h.getLineContent(),u=c===i?n-1:0,f=c===o?r-1:d.length;d===""?l+="<br>":l+=bP(d,h.inflate(),t,u,f,a,Ri)}return l}_getColorMap(){const e=rt.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=R.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 q9);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}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,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,o))}paste(e,t,i,n){this._executeCursorEdit(o=>this._cursor.paste(o,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))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(n=>this._cursor.revealPrimary(n,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new M(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new Mu(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new M(
`?i=1:e&&e.lineEnding&&e.lineEnding===`\r
`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),n=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(n)}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const 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():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,n){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?Ra._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?Ra._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?Ra._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e){var t;(t=this._modelData)===null||t===void 0||t.viewModel.setHiddenAreas(e.map(i=>M.lift(i)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return pt.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(!O.isIPosition(e))throw new 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(!M.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);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(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new M(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(!O.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new M(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"){const i=Pe.isISelection(e),n=M.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const o={selectionStartLineNumber:
`:`
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=`
`,this.value+=t,this.value+="\n```\n",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){const i=new RegExp(Ys(t),"g");return e.replace(i,(n,o)=>e.charAt(o-1)!=="\\"?`\\${n}`:n)}}function R8(s){return s instanceof A8?!0:s&&typeof s=="object"?typeof s.value=="string"&&(typeof s.isTrusted=="boolean"||s.isTrusted===void 0)&&(typeof s.supportThemeIcons=="boolean"||s.supportThemeIcons===void 0):!1}function P8(s){return s.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")}var A1=globalThis&&globalThis.__awaiter||function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(h){try{c(i.next(h))}catch(d){r(d)}}function l(h){try{c(i.throw(h))}catch(d){r(d)}}function c(h){h.done?o(h.value):n(h.value).then(a,l)}c((i=i.apply(s,e||[])).next())})};function O8(s,e){Mi(e)?s.title=mD(e):e!=null&&e.markdownNotSupportedFallback?s.title=e.markdownNotSupportedFallback:s.removeAttribute("title")}class F8{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var n;return A1(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Mi(e)||e instanceof HTMLElement)o=e;else if(!$u(e.markdown))o=(n=e.markdown)!==null&&n!==void 0?n:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(p("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Yl;const r=this._cancellationTokenSource.token;if(o=yield e.markdown(r),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(o,t,i)})}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!n},i);this._hoverWidget=this.hoverDelegate.showHover(o,t)}n==null||n.dispose()}hasContent(e){return e?R8(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function pD(s,e,t,i){let n,o;const r=(d,u)=>{var f;d&&(o==null||o.dispose(),o=void 0),u&&(n==null||n.dispose(),n=void 0),(f=s.onDidHideHover)===null||f===void 0||f.call(s)},a=(d,u,f)=>new Jo(()=>A1(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new F8(s,f||e,d>0),yield o.update(t,u,i))}),d),l=()=>{if(n)return;const d=new ae,u=_=>r(!1,_.fromElement===e);d.add(W(e,U.MOUSE_LEAVE,u,!0));const f=()=>r(!0,!0);d.add(W(e,U.MOUSE_DOWN,f,!0));const m={targetElements:[e],dispose:()=>{}};if(s.placement===void 0||s.placement==="mouse"){const _=b=>{m.x=b.x+10,b.target instanceof HTMLElement&&b.target.classList.contains("action-label")&&r(!0,!0)};d.add(W(e,U.MOUSE_MOVE,_,!0))}d.add(a(s.delay,!1,m)),n=d},c=W(e,U.MOUSE_OVER,l,!0);return{show:d=>{r(!1,!0),a(0,d)},hide:()=>{r(!0,!0)},update:(d,u)=>A1(this,void 0,void 0,function*(){t=d,yield o==null?void 0:o.update(t,void 0,u)}),dispose:()=>{c.dispose(),r(!0,!0)}}}class bo extends H{constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof ts&&this._register(t.onDidChange(n=>{this.element&&this.handleActionChangeEvent(n)}))}get action(){return this._action}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new pb)),this._actionRunner}set actionRunner(e){this._actionRunner=e}getAction(){return this._action}isEnabled(){return this._action.enabled}set
`)}}const ra=new W8;At.add(V8.IconContribution,ra);function tr(s,e,t,i){return ra.registerIcon(s,e,t,i)}function bD(){return ra}function H8(){for(const s of g.getAll())ra.registerIcon(s.id,s.definition,s.description)}H8();const CD="vscode://schemas/icons",vD=At.as(hg.JSONContribution);vD.registerSchema(CD,ra.getIconSchema());const MS=new ni(()=>vD.notifySchemaChanged(CD),200);ra.onDidChange(()=>{MS.isScheduled()||MS.schedule()});tr("widget-close",g.close,p("widgetClose","Icon for the close action in widgets."));tr("goto-previous-location",g.arrowUp,p("previousChangeIcon","Icon for goto previous editor location."));tr("goto-next-location",g.arrowDown,p("nextChangeIcon","Icon for goto next editor location."));ii.modify(g.sync,"spin");ii.modify(g.loading,"spin");var z8=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},U8=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}},$8=globalThis&&globalThis.__awaiter||function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(h){try{c(i.next(h))}catch(d){r(d)}}function l(h){try{c(i.throw(h))}catch(d){r(d)}}function c(h){h.done?o(h.value):n(h.value).then(a,l)}c((i=i.apply(s,e||[])).next())})},up;const hu=3;class Ec{constructor(e,t,i,n){this.originalLineStart=e,this.originalLineEnd=t,this.modifiedLineStart=i,this.modifiedLineEnd=n}getType(){return this.originalLineStart===0?1:this.modifiedLineStart===0?2:0}}class fp{constructor(e){this.entries=e}}const j8=tr("diff-review-insert",g.add,p("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),K8=tr("diff-review-remove",g.remove,p("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),q8=tr("diff-review-close",g.close,p("diffReviewCloseIcon","Icon for 'Close' in diff review."));let Rf=class gr extends H{constructor(e,t){super(),this._languageService=t,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=ge(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=ge(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new Vl(this.actionBarContainer.domNode)),this._actionBar.push(new ts("diffreview.close",p("label.close","Close"),"close-diff-review "+ii.asClassName(q8),!0,()=>$8(this,void 0,void 0,function*(){return this.hide()})),{label:!1,icon:!0}),this.domNode=ge(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=ge(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new F2(this._content.domNode,{})),this.domNode.domNode.appendChild(this.scrollbar.getDomNode()),this._register(e.onDidUpdateDiff(()=>{this._isVisible&&(this._diffs=this._compute(),this._render())})),this._register(e.getModifiedEditor().onDidChangeCursorPosition(()=>{this._isVisible&&this._render()})),this._register(ui(this.domNode.domNode,"click",i=>{i.preventDefault();const n=Nk(i.target,"diff-review-row");n&&this._goToRow(n)})),this._register(ui(this.domNode.domNode,"keydown",i=>{(i.equals(18)||i.equals(2066)||i.equals(530))&&(i.preventDefault(),this._goToRow(this._getNextRow())),(i.equals(16)||i.equals(2064)||i.equals(528))&&(i.preventDefault(),this._goToRow(this._getPrevRow())),(i.equals(9)||i.equals(2057)||i.equals(521)||i.equals(1033))&&(i.preventDefault(),this.hide()),(i.equals(10)||i.equals(3))&&(i.preventDefault(),this.accept())})),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let i=-1;for(let n=0,o=this._diffs.length;n<o;n++)if(this._diffs[n]===this._currentDiff){i=n;break}e=this._diffs.length+i-1}
`:`\r
`)}else yield this._clipboardService.writeText(_)})),c.push(u)),i.getOption(83)||c.push(new ts("diff.inline.revertChange",p("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>gp(this,void 0,void 0,function*(){const _=new M(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),b=n.originalModel.getValueInRange(_);if(n.modifiedEndLineNumber===0){const v=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new M(n.modifiedStartLineNumber,v,n.modifiedStartLineNumber,v),text:l+b}])}else{const v=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new M(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,v),text:b}])}})));const m=(_,b)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:_,y:b}),getActions:()=>(u&&(u.label=h?p("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+d):p("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.originalStartLineNumber+d)),c),autoSelectFirstItem:!0})};this._register(ui(this._diffActions,"mousedown",_=>{const{top:b,height:v}=Yn(this._diffActions),C=Math.floor(a/3);_.preventDefault(),m(_.posx,b+v+C)})),this._register(i.onMouseMove(_=>{_.target.type===8||_.target.type===5?_.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,d=this._updateLightBulbPosition(this._marginDomNode,_.event.browserEvent.y,a)):this.visibility=!1:this.visibility=!1})),this._register(i.onMouseDown(_=>{_.event.rightButton&&(_.target.type===8||_.target.type===5)&&_.target.detail.viewZoneId===this._viewZoneId&&(_.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,_.event.browserEvent.y,a),m(_.event.posx,_.event.posy+a))}))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,e?this._diffActions.style.visibility="visible":this._diffActions.style.visibility="hidden")}_updateLightBulbPosition(e,t,i){const{top:n}=Yn(e),o=t-n,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this.diff.viewLineCounts){let l=0;for(let c=0;c<this.diff.viewLineCounts.length;c++)if(l+=this.diff.viewLineCounts[c],r<l)return c}return r}}const tC=Ce("clipboardService"),X8=Ce("progressService"),iC=Ce("editorProgressService");var J8=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ks=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}},mp;class AS{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter(t=>!this._zonesMap[String(t.id)])}clean(e){this._zones.length>0&&e.changeViewZones(t=>{for(const i of this._zones)t.removeZone(i)}),this._zones=[],this._zonesMap={},e.changeDecorations(t=>{this._decorations=t.deltaDecorations(this._decorations,[])})}apply(e,t,i,n){const o=n?qb.capture(e):null;e.changeViewZones(r=>{var a;for(const l of this._zones)r.removeZone(l);for(const l of this._inlineDiffMargins)l.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let l=0,c=i.zones.length;l<c;l++){const h=i.zones[l];h.suppressMouseDown=!0;const d=r.addZone(h);this._zones.push(d),this._zonesMap[String(d)]=!0,i.zones[l].diff&&h.marginDomNode&&(h.suppressMouseDown=!1,((a=i.zones[l].diff)===null||a===void 0?void 0:a.originalModel.getValueLength())!==0&&this._inlineDiffMargins.push(new Q8(d,h.marginDomNode,e,i.zones[l].diff,this._contextMenuService,this._clipboardService)))}}),o==null||o.restore(e),e.changeDecorations(r=>{this._decorations=r.deltaDecorations(this._decorations,i.decorations)}),t==null||t.setZones(i.overviewZones)}}let e3=0;const t3=tr("diff-insert",g.
.monaco-diff-editor .diffViewport {
background: ${u};
}
`);const f=s.getColor(xr);f&&e.addRule(`
.monaco-diff-editor .diffViewport:hover {
background: ${f};
}
`);const m=s.getColor(Nr);m&&e.addRule(`
.monaco-diff-editor .diffViewport:active {
background: ${m};
}
`);const _=s.getColor(LM);e.addRule(`
.monaco-editor .diagonal-fill {
background-image: linear-gradient(
-45deg,
${_} 12.5%,
#0000 12.5%, #0000 50%,
${_} 50%, ${_} 62.5%,
#0000 62.5%, #0000 100%
);
background-size: 8px 8px;
}
`)});var a3=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},l3=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}},c3=globalThis&&globalThis.__awaiter||function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(h){try{c(i.next(h))}catch(d){r(d)}}function l(h){try{c(i.throw(h))}catch(d){r(d)}}function c(h){h.done?o(h.value):n(h.value).then(a,l)}c((i=i.apply(s,e||[])).next())})};let R1=class extends H{constructor(e){super(),this._themeService=e,this._onCodeEditorAdd=this._register(new A),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new A),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new A),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new A),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new wi,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}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])}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;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const n=e.toString();let o;this._modelProperties.has(n)?o=this._modelProperties.get(n):(o=new Map,this._modelProperties.set(n,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}openCodeEditor(e,t,i){return c3(this,void 0,void 0,function*(){for(const n of this._codeEditorOpenHandlers){const o=yield n(e,t,i);if(o!==null)return o}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return He(t)}};R1=a3([l3(0,Ct)],R1);var h3=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},BS=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}},d3=globalThis&&globalThis.__awaiter||function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(h){try{c(i.next(h))}catch(d){r(d)}}function l(h){try{c(i.throw(h))}catch(d){r(d)}}function c(h){h.done?o(h.value):n(h.value).then(a,l)}c((i=i.apply(s,e||[])).next())})};let Ff=class extends R1{constructor(e,t){super(t),this.onCodeEditorAdd(()=>this._checkContextKey()),this.onCodeEditorRemove(()=>this._checkContextKey()),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this.registerCodeEditorOpenHandler((i,n,o)=>d3(this,void 0,void 0,function*(){return n?this.doOpenEditor(n,i):null}))}_checkContextKey(){let e=!1;for(const t of this.listCodeEd
`)}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 f3{constructor(e,t,i,n,o,r,a){this.id=++ND,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=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new HS),this.removedResources.has(t)||this.removedResources.set(t,new WS(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new HS),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new WS(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class TD{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const 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(`
`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,n=this._past.length;i<n;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new tD(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,o=-1;for(let a=0,l=this._past.length;a<l;a++,n++){const c=this._past[a];i&&(n>=t||c.id!==e.elements[n])&&(i=!1,o=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,n++){const l=this._future[a];i&&(n>=t||l.id!==e.elements[n])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(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 pp{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;t++)this._versionIds[t]=this.editStacks[t].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}}const MD=new TD("","");MD.locked=!0;let O1=class{constructor(e,t){this._dialogService=e,this._notificationService=t,this._editStacks=new Map,this._uriComparisonKeyComputers=[]}getUriComparisonKey(e){for(const 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}: `);const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(`
`))}pushElement(e,t=Bl.None,i=Gn.None){if(e.type===0){const n=uu(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new fu(e,n,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,o=[],r=[];for(const a of e.resources){const l=uu(a),c=this.getUriComparisonKey(a);n.has(c)||(n.add(c),o.push(l),r.push(c))}o.length===1?this._pushElement(new fu(e,o[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new f3(e,o,r,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const n=e.resourceLabels[t],o=e.strResources[t];let r;this._editStacks.has(o)?r=this._editStacks.get(o):(r=new TD(n,o),this._editStacks.set(o,r)),r.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const n=i.getClosestPastElement();return n?n.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const o of i){const r=uu(o.resource),a=this.getUriComparisonKey(o.resource),l=new fu(o,r,a,0,0,0,0);n.set(l.strResource,l)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const o of i){const r=uu(o.resource),a=this.getUriComparisonKey(o.resource),l=new fu(o,r,a,0,0,0,0);n.set(l.strResource,l)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitFutureWorkspaceElement(e,n)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const n=this.getUriComparisonKey(e);this._editStacks.has(n)&&this._editStacks.get(n).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new tD(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const 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(const[n,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof Gn){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){lt(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,n,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),n.dispose(),o()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),o())}_invokeWorkspacePrepare(e){return du(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return H.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?H.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(H.None);const i=e.actual.prepareUndoRedo();return i?ux(i)?t(i):i.then(n=>t(n)):t(H.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||MD);return new pp(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new gu(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(n),new gu}_checkWorkspac
:host {
all: initial; /* 1st rule so subsequent properties are reset. */
}
@font-face {
font-family: "codicon";
font-display: block;
src: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");
}
.codicon[class*='codicon-'] {
font: normal normal normal 16px/1 codicon;
display: inline-block;
text-decoration: none;
text-rendering: auto;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
:host {
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
}
:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
: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; }
: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; }
: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; }
: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; }
`;var W3=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},H3=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};let W1=class extends H{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=H.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Wl(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?(t!==this.container||this.shadowRoot!==i)&&(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const n=He(()=>{this.currentViewDisposable===n&&this.hideContextView()});return this.currentViewDisposable=n,n}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};W1=W3([H3(0,lc)],W1);var JS=globalThis&&globalThis.__awaiter||function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(h){try{c(i.next(h))}catch(d){r(d)}}function l(h){try{c(i.throw(h))}catch(d){r(d)}}function c(h){h.done?o(h.value):n(h.value).then(a,l)}c((i=i.apply(s,e||[])).next())})};const pu="**",ey="/",Pu="[/\\\\]",Ou="[^/\\\\]",z3=/\//g;function ty(s,e){switch(s){case 0:return"";case 1:return`${Ou}*?`;default:return`(?:${Pu}|${Ou}+${Pu}${e?`|${Pu}${Ou}+`:""})*?`}}function iy(s,e){if(!s)return[];const t=[];let i=!1,n=!1,o="";for(const r of s){switch(r){case e:if(!i&&!n){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}o+=r}return o&&t.push(o),t}function FD(s){if(!s)return"";let e="";const t=iy(s,ey);if(t.every(i=>i===pu))e=".*";else{let i=!1;t.forEach((n,o)=>{if(n===pu){if(i)return;e+=ty(2,o===t.length-1)}else{let r=!1,a="",l=!1,c="";for(const h of n){if(h!=="}"&&r){a+=h;continue}if(l&&(h!=="]"||!c)){let d;h==="-"?d=h:(h==="^"||h==="!")&&!c?d="^":h===ey?d="":d=Ys(h),c+=d;continue}switch(h){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const u=`(?:${iy(a,",").map(f=>FD(f)).join("|")})`;e+=u,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=Ou;continue;case"*":e+=ty(1);continue;default:e+=Ys(h)}}o<t.length-1&&(t[o+1]!==pu||o+2<t.length)&&(e+=Pu)}i=n===pu})}return e}const U3=/^\*\*\/\*\.[\w\.-]+$/,$3=/^\*\*\/([\w\.-]+)\/?$/,j3=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,K3=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,q3=/^\*\*((\/[\w\.-]+)+)\/?$/,G3=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,ny=new Gb(1e4),sy=function(){return!1},ss=function(){return null};function sC(s,e){if(!s)return ss;let t;typeof s!="string"?t=s.pattern:t=s,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let n=ny.get(i);if(n)return oy(n,s);let o;return U3.test(t)?n=Z3(t.substr(4),t):(o=$3.exec(_p(t,e)))?n=Y3(o[1],t):(e.trimForExclusions?K3:j3).test(t)?n=Q3(t,e):(o=q3.exec(_p(t,e)))?n=ry(o[1].substr(1),t,!0):(o=G3.exec(_p(t,e)))?n=ry(o[1],t,!1):n=X3(t),ny.set(i,n),oy(n,s)}function oy(s,e){if(typeof e=="string")return s;const t=function(i,n){return S1(i,e.base,!yi)?s(i.substr(e.base.length+1),n):null};return t.allBasenames=s.allBasenames,t.allPaths=s.allPaths,t.basenames=s.basenames,t.patterns=s.patterns,t}function _p(s,e){return e.trimForExclusions&&s.endsWith("/**")?s.substr(0,s.length-2):s}function Z3(s,e){return function(t,i){return typeof t=="string"&&t.endsWith(s)?e:null}}function Y3(s,e){const t=`/${s}`,i=`\\${s}`,n=function(r,a){return typeof r!="string"?null:a?a===s?e:null:r===s||r.endsWith(t)||r.endsWith(i)?e:null},o=[s];return n.basenames=o
.monaco-menu {
font-size: 13px;
border-radius: 5px;
min-width: 160px;
}
${hy(g.menuSelection)}
${hy(g.menuSubmenu)}
.monaco-menu .monaco-action-bar {
text-align: right;
overflow: hidden;
white-space: nowrap;
}
.monaco-menu .monaco-action-bar .actions-container {
display: flex;
margin: 0 auto;
padding: 0;
width: 100%;
justify-content: flex-end;
}
.monaco-menu .monaco-action-bar.vertical .actions-container {
display: inline-block;
}
.monaco-menu .monaco-action-bar.reverse .actions-container {
flex-direction: row-reverse;
}
.monaco-menu .monaco-action-bar .action-item {
cursor: pointer;
display: inline-block;
transition: transform 50ms ease;
position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
}
.monaco-menu .monaco-action-bar .action-item.disabled {
cursor: default;
}
.monaco-menu .monaco-action-bar.animated .action-item.active {
transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */
}
.monaco-menu .monaco-action-bar .action-item .icon,
.monaco-menu .monaco-action-bar .action-item .codicon {
display: inline-block;
}
.monaco-menu .monaco-action-bar .action-item .codicon {
display: flex;
align-items: center;
}
.monaco-menu .monaco-action-bar .action-label {
font-size: 11px;
margin-right: 4px;
}
.monaco-menu .monaco-action-bar .action-item.disabled .action-label,
.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
color: var(--vscode-disabledForeground);
}
/* Vertical actions */
.monaco-menu .monaco-action-bar.vertical {
text-align: left;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
display: block;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
display: block;
border-bottom: 1px solid var(--vscode-menu-separatorBackground);
padding-top: 1px;
padding: 30px;
}
.monaco-menu .secondary-actions .monaco-action-bar .action-label {
margin-left: 6px;
}
/* Action Items */
.monaco-menu .monaco-action-bar .action-item.select-container {
overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
flex: 1;
max-width: 170px;
min-width: 60px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
}
.monaco-menu .monaco-action-bar.vertical {
margin-left: 0;
overflow: visible;
}
.monaco-menu .monaco-action-bar.vertical .actions-container {
display: block;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
padding: 0;
transform: none;
display: flex;
}
.monaco-menu .monaco-action-bar.vertical .action-item.active {
transform: none;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
flex: 1 1 auto;
display: flex;
height: 2em;
align-items: center;
position: relative;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {
opacity: unset;
}
.monaco-menu .monaco-action-bar.vertical .action-label {
flex: 1 1 auto;
text-decoration: none;
padding: 0 1em;
background: none;
font-size: 12px;
line-height: 1;
}
.monaco-menu .monaco-action-bar.vertical .keybinding,
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
display: inline-block;
flex: 2 1 auto;
padding: 0 1em;
text-align: right;
font-size: 12px;
line-height: 1;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
height: 100%;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
font-size: 16px !important;
display: flex;
align-items: center;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
margin-left: auto;
margin-right: -20px;
}
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
opacity: 0.4;
}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
display: inline-block;
box-sizing: border-box;
margin: 0;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
position: static;
overflow: visible;
}
.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
position: absolute;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
width: 100%;
height: 0px !important;
opacity: 1;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
padding: 0.7em 1em 0.1em 1em;
font-weight: bold;
opacity: 1;
}
.monaco-menu .monaco-action-bar.vertical .action-label:hover {
color: inherit;
}
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
position: absolute;
visibility: hidden;
width: 1em;
height: 100%;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
visibility: visible;
display: flex;
align-items: center;
justify-content: center;
}
/* Context Menu */
.context-view.monaco-menu-container {
outline: 0;
border: none;
animation: fadeIn 0.083s linear;
-webkit-app-region: no-drag;
}
.context-view.monaco-menu-container :focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
outline: 0;
}
.hc-black .context-view.monaco-menu-container,
.hc-light .context-view.monaco-menu-container,
:host-context(.hc-black) .context-view.monaco-menu-container,
:host-context(.hc-light) .context-view.monaco-menu-container {
box-shadow: none;
}
.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,
.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
background: none;
}
/* Vertical Action Bar Styles */
.monaco-menu .monaco-action-bar.vertical {
padding: .6em 0;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
height: 2em;
}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
.monaco-menu .monaco-action-bar.vertical .keybinding {
font-size: inherit;
padding: 0 2em;
}
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
font-size: inherit;
width: 2em;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
font-size: inherit;
margin: 5px 0 !important;
padding: 0;
border-radius: 0;
}
.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
margin-left: 0;
margin-right: 0;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
font-size: 60%;
padding: 0 1.8em;
}
.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
height: 100%;
mask-size: 10px 10px;
-webkit-mask-size: 10px 10px;
}
.monaco-menu .action-item {
cursor: default;
}`;if(e){t+=`
/* Arrows */
.monaco-scrollable-element > .scrollbar > .scra {
cursor: pointer;
font-size: 11px !important;
}
.monaco-scrollable-element > .visible {
opacity: 1;
/* Background rule added for IE9 - to allow clicks on dom node */
background:rgba(0,0,0,0);
transition: opacity 100ms linear;
}
.monaco-scrollable-element > .invisible {
opacity: 0;
pointer-events: none;
}
.monaco-scrollable-element > .invisible.fade {
transition: opacity 800ms linear;
}
/* Scrollable Content Inset Shadow */
.monaco-scrollable-element > .shadow {
position: absolute;
display: none;
}
.monaco-scrollable-element > .shadow.top {
display: block;
top: 0;
left: 3px;
height: 3px;
width: 100%;
}
.monaco-scrollable-element > .shadow.left {
display: block;
top: 3px;
left: 0;
height: 100%;
width: 3px;
}
.monaco-scrollable-element > .shadow.top-left-corner {
display: block;
top: 0;
left: 0;
height: 3px;
width: 3px;
}
`;const i=s.scrollbarShadow;i&&(t+=`
.monaco-scrollable-element > .shadow.top {
box-shadow: ${i} 0 6px 6px -6px inset;
}
.monaco-scrollable-element > .shadow.left {
box-shadow: ${i} 6px 0 6px -6px inset;
}
.monaco-scrollable-element > .shadow.top.left {
box-shadow: ${i} 6px 6px 6px -6px inset;
}
`);const n=s.scrollbarSliderBackground;n&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider {
background: ${n};
}
`);const o=s.scrollbarSliderHoverBackground;o&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider:hover {
background: ${o};
}
`);const r=s.scrollbarSliderActiveBackground;r&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider.active {
background: ${r};
}
`)}return t}function vn(s,e){const t=Object.create(null);for(const i in e){const n=e[i];n&&(t[i]=Es(n,s))}return t}function zD(s,e,t){function i(){const n=vn(s.getColorTheme(),e);typeof t=="function"?t(n):t.style(n)}return i(),s.onDidColorThemeChange(i)}function zl(s,e,t){return zD(e,Object.assign(Object.assign({},$g),t||{}),s)}const $g={listFocusBackground:kM,listFocusForeground:DM,listFocusOutline:EM,listActiveSelectionBackground:js,listActiveSelectionForeground:Qn,listActiveSelectionIconForeground:Fc,listFocusAndSelectionOutline:IM,listFocusAndSelectionBackground:js,listFocusAndSelectionForeground:Qn,listInactiveSelectionBackground:xM,listInactiveSelectionIconForeground:TM,listInactiveSelectionForeground:NM,listInactiveFocusBackground:MM,listInactiveFocusOutline:AM,listHoverBackground:RM,listHoverForeground:PM,listDropBackground:OM,listSelectionOutline:ct,listHoverOutline:ct,listFilterWidgetBackground:FM,listFilterWidgetOutline:BM,listFilterWidgetNoMatchesOutline:VM,listFilterWidgetShadow:WM,treeIndentGuidesStroke:HM,tableColumnsBorder:zM,tableOddRowsBackgroundColor:UM,inputActiveOptionBorder:Z5,inputActiveOptionForeground:Q5,inputActiveOptionBackground:Y5,inputBackground:Xk,inputForeground:Jk,inputBorder:e2,inputValidationInfoBackground:t2,inputValidationInfoForeground:i2,inputValidationInfoBorder:n2,inputValidationWarningBackground:s2,inputValidationWarningForeground:o2,inputValidationWarningBorder:r2,inputValidationErrorBackground:a2,inputValidationErrorForeground:l2,inputValidationErrorBorder:c2},uO={shadowColor:Dr,borderColor:qM,foregroundColor:GM,backgroundColor:ZM,selectionForegroundColor:YM,selectionBackgroundColor:QM,selectionBorderColor:XM,separatorColor:JM,scrollbarShadow:ic,scrollbarSliderBackground:Ir,scrollbarSliderHoverBackground:xr,scrollbarSliderActiveBackground:Nr};function fO(s,e,t){return zD(e,Object.assign(Object.assign({},uO),t),s)}class gO{constructor(e,t,i,n,o){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.themeService=o,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i;const n=Mk(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{const r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(re(".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",W(this.block,U.MOUSE_DOWN,c=>c.stopPropagation()));const a=new ae,l=e.actionRunner||new pb;return l.onBeforeRun(this.onActionRun,this,a),l.onDidRun(this.onDidActionRun,this,a),i=new HD(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:c=>this.keybindingService.lookupKeybinding(c.id)}),a.add(fO(i,this.themeService)),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a),a.add(W(window,U.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(W(window,U.MOUSE_DOWN,c=>{if(c.defaultPrevented)return;const h=new Hs(c);let d=h.target;if(!h.rightButton){for(;d;){if(d===o)return;d=d.parentElement}this.contextViewService.hideContextView(!0)}})),Po(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r;(r=e.onHide)===null||r===void 0||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},n,!!n)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&
`?a=2:l===`
`&&(a=1);let c=Bt.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let h=Bt.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(h=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Bt.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let u=Bt.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(u={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:o,insertSpaces:r,detectIndentation:h,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:u}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:an===3||an===2?`
`:`\r
`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){let n=this._modelCreationOptionsByLanguageAndResource[e+t];if(!n){const o=this._configurationService.getValue("editor",{overrideIdentifier:e,resource:t}),r=this._getEOL(t,e);n=zc._readModelOptions({editor:o,eol:r},i),this._modelCreationOptionsByLanguageAndResource[e+t]=n}return n}_updateModelOptions(){const e=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const o=t[i],r=this._models[o],a=r.model.getLanguageId(),l=r.model.uri,c=e[a+l],h=this.getCreationOptions(a,l,r.model.isForSimpleWidget);zc._setModelOptionsForModel(r.model,h,c)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&Zi(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(ro(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(ro(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(ro(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,n)=>i.time-n.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const o=this.getCreationOptions(t,i,n),r=new Gr(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(ro(i))){const c=this._removeDisposedModel(i),h=this._undoRedoService.getElements(i),d=py(r)===c.sha1;if(d||c.sharesUndoRedoStack){for(const u of h.past)Ms(u)&&u.matchesResource(i)&&u.setModel(r);for(const u of h.future)Ms(u)&&u.matchesResource(i)&&u.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,u=>Ms(u)&&u.matchesResource(i)),d&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=ro(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new IO(r,c=>this._onWillDispose(c),(c,h)=>this._onDidChangeLanguage(c,h));return this._models[a]=l,l}createModel(e,t,i,n=!1){let o;return t?(o=this._createModelData(e,t.languageId,i,n),this.setMode(o.model,t)):o=this._createModelData(e,es,i,n),this._onModelAdded.fire(o.model),o.model}setMode(e,t){if(!t)return;const i=this._models[ro(e.uri)];i&&i.setLanguage(t)}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const o=t[i];e.push(this._models[o].model)}return e}getModel(e){const t=ro(e),i=this._models[t];return i?i.model:null}getSemanticTokensProviderStyling(e){return this._semanticStyling.get(e)}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===we.file||e.scheme===we.vscodeRemote||e.scheme===we.vscodeUserData||e.scheme===we.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=ro(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let o=!1,r=0;if(n||
`)n.type===2&&(n=o.pop()),n.children.push({type:8});else if(n.type!==2){const c={type:2,content:a};n.children.push(c),o.push(n),n=c}else n.content+=a}return n.type===2&&(n=o.pop()),t}function jO(s,e){return X1(s,e)!==0}function X1(s,e){switch(s){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const xc=re,KO={inputBackground:R.fromHex("#3C3C3C"),inputForeground:R.fromHex("#CCCCCC"),inputValidationInfoBorder:R.fromHex("#55AAFF"),inputValidationInfoBackground:R.fromHex("#063B49"),inputValidationWarningBorder:R.fromHex("#B89500"),inputValidationWarningBackground:R.fromHex("#352A05"),inputValidationErrorBorder:R.fromHex("#BE1100"),inputValidationErrorBackground:R.fromHex("#5A1D1D")};class qO extends Og{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new A),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new A),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),Qr(this.options,KO,!1),this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(n=this.options.tooltip)!==null&&n!==void 0?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Z(e,xc(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",r=Z(this.element,xc(".ibwrapper"));if(this.input=Z(r,xc(o+".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=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Z(r,xc("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new KA(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Z(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new Be(document,"selectionchange")),l=Y.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===r});this._register(l(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.ignoreGesture(this.input),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actio
`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=n),a.end>=r&&(a.end+=n));return i+=n,"⏎"})}}class Lp{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 className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class yy extends H{constructor(e,t){super(),this.customHovers=new Map,this.domNode=this._register(new Lp(Z(e,re(".monaco-icon-label")))),this.labelContainer=Z(this.domNode.element,re(".monaco-icon-label-container"));const i=Z(this.labelContainer,re("span.monaco-icon-name-container"));this.descriptionContainer=this._register(new Lp(Z(this.labelContainer,re("span.monaco-icon-description-container")))),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new XO(i,!!t.supportIcons):this.nameNode=new YO(i),t!=null&&t.supportDescriptionHighlights?this.descriptionNodeFactory=()=>new Ul(Z(this.descriptionContainer.element,re("span.label-description")),{supportIcons:!!t.supportIcons}):this.descriptionNodeFactory=()=>this._register(new Lp(Z(this.descriptionContainer.element,re("span.label-description")))),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"];i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough")),this.domNode.className=n.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),(t||this.descriptionNode)&&(this.descriptionNode||(this.descriptionNode=this.descriptionNodeFactory()),this.descriptionNode instanceof Ul?(this.descriptionNode.set(t||"",i?i.descriptionMatches:void 0),this.setupHover(this.descriptionNode.element,i==null?void 0:i.descriptionTitle)):(this.descriptionNode.textContent=t||"",this.setupHover(this.descriptionNode.element,(i==null?void 0:i.descriptionTitle)||""),this.descriptionNode.empty=!t))}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)O8(e,t);else{const n=pD(this.hoverDelegate,e,t);n&&this.customHovers.set(e,n)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}}class YO{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Zi(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=Z(this.container,re("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const n=e[i],o=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${i}`;Z(this.container,re("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&Z(this.container,re("span.label-separator",void 0,(t==null?void 0:t.separator)||"/"))}}}}function QO(s,e,t){if(!t)return;let i=0;return s.map(n=>{const o={start:i,end:i+n.length},r=t.map(a=>Ft.intersect(o,a)).filter(a=>!Ft.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class XO{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Zi(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new Ul(Z(this.container,re("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines)
`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}}Gg.MAX_WIDTH=600;class l6{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}class xa extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function Ey(s,e){const t=[];for(const i of e){if(s.start>=i.range.end)continue;if(s.end<i.range.start)break;const n=Ft.intersect(s,i.range);Ft.isEmpty(n)||t.push({range:n,size:i.size})}return t}function e0({start:s,end:e},t){return{start:s+t,end:e+t}}function c6(s){const e=[];let t=null;for(const i of s){const n=i.range.start,o=i.range.end,r=i.size;if(t&&r===t.size){t.range.end=o;continue}t={range:{start:n,end:o},size:r},e.push(t)}return e}function h6(...s){return c6(s.reduce((e,t)=>e.concat(t),[]))}class Iy{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const n=i.length-t,o=Ey({start:0,end:e},this.groups),r=Ey({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:e0(l.range,n),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=h6(o,a,r),this._size=this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const 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;let t=0,i=0;for(const n of this.groups){const o=n.range.end-n.range.start,r=i+o*n.size;if(e<r)return t+Math.floor((e-i)/n.size);t+=o,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(const n of this.groups){const o=n.range.end-n.range.start,r=i+o;if(e<r)return t+(e-i)*n.size;t+=o*n.size,i=r}return-1}}function d6(s){var e;try{(e=s.parentElement)===null||e===void 0||e.removeChild(s)}catch{}}class u6{constructor(e){this.renderers=e,this.cache=new Map}alloc(e){let t=this.getTemplateCache(e).pop();if(!t){const i=re(".monaco-list-row"),o=this.getRenderer(e).renderTemplate(i);t={domNode:i,templateId:e,templateData:o}}return t}release(e){e&&this.releaseRow(e)}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(t.classList.remove("scrolling"),d6(t)),this.getTemplateCache(i).push(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var nr=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const Vn={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(s){return[s]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class Ld{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class f6{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class g6{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++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}function m6(s,e){return Array.isArray(s)&&Array.isArray(e)?Jn(s,e):s===e}class p6{constructor(e){e!=null&&e.getSetSize?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(t,i,n)=>n,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class fn{constructor(e,t,i,n=Vn){var o,r,a,l
.monaco-drag-image,
.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
`),e.listFocusAndSelectionForeground&&i.push(`
.monaco-drag-image,
.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
`),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.listInactiveFocusBackground}; }`)),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) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listFocusOutline&&i.push(`
.monaco-drag-image,
.monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; 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.listDropBackground&&i.push(`
.monaco-list${t}.drop-target,
.monaco-list${t} .monaco-list-rows.drop-target,
.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }
`),e.tableColumnsBorder&&i.push(`
.monaco-table:hover > .monaco-split-view2,
.monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
border-color: ${e.tableColumnsBorder};
}`),e.tableOddRowsBackgroundColor&&i.push(`
.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,
.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,
.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {
background-color: ${e.tableOddRowsBackgroundColor};
}
`),this.styleElement.textContent=i.join(`
`)}}const y6={listFocusBackground:R.fromHex("#7FB0D0"),listActiveSelectionBackground:R.fromHex("#0E639C"),listActiveSelectionForeground:R.fromHex("#FFFFFF"),listActiveSelectionIconForeground:R.fromHex("#FFFFFF"),listFocusAndSelectionOutline:R.fromHex("#90C2F9"),listFocusAndSelectionBackground:R.fromHex("#094771"),listFocusAndSelectionForeground:R.fromHex("#FFFFFF"),listInactiveSelectionBackground:R.fromHex("#3F3F46"),listInactiveSelectionIconForeground:R.fromHex("#FFFFFF"),listHoverBackground:R.fromHex("#2A2D2E"),listDropBackground:R.fromHex("#383B3D"),treeIndentGuidesStroke:R.fromHex("#a9a9a9"),tableColumnsBorder:R.fromHex("#cccccc").transparent(.2),tableOddRowsBackgroundColor:R.fromHex("#cccccc").transparent(.04)},L6={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function k6(s,e){const t=s.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&s[n]===e-(t-n);)i.push(s[n--]);for(i.reverse(),n=t;n<s.length&&s[n]===e+(n-t);)i.push(s[n++]);return i}function t0(s,e){const t=[];let i=0,n=0;for(;i<s.length||n<e.length;)if(i>=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){t.push(s[i]),i++,n++;continue}else s[i]<e[n]?t.push(s[i++]):t.push(e[n++]);return t}function D6(s,e){const t=[];let i=0,n=0;for(;i<s.length||n<e.length;)if(i>=s.length)t.push(e[n++]);else if(n>=e.length)t.push(s[i++]);else if(s[i]===e[n]){i++,n++;continue}else s[i]<e[n]?t.push(s[i++]):n++;return t}const Ty=(s,e)=>s-e;class E6{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 o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],n)}disposeElement(e,t,i,n){var o;let r=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,i[r],n),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class I6{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class x6{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const 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){var i,n;(n=(i=this.dnd).onDragStart)===null||n===void 0||n.call(i,e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var o,r;(r=(o=this.dnd).onDragLeave)===null||r===void 0||r.call(o,e,t,i,n)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}}class Js{constructor(e,t,i,n,o=L6){var r,a,l,c;this.user=e,this._options=o,this.focus=new qf("focused"),this.anchor=new qf("anchor"),this.eventBufferer=new W0,this._ariaLabel="",this.disposables=new ae,this._onDidDispose=new A,this.onDidDispose=this._onDidDispose.event;const h=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new b6(h!=="listbox"),Qr(o,y6,!1);const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(d.push(new I6(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(f=>new E6(f.templateId,[...d,f]));const u=Object.assign(Object.assign({},o),{dnd:o.dnd&&new x6(this,o.dnd)});if(this.view=new fn(t,i,n,u),this.view.domNode.setAttribute("role",h),
top: ${this.virtualDelegate.headerRowHeight+1}px;
height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
}`),this.styleElement.textContent=t.join(`
`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}Zg.InstanceCount=0;R.fromHex("#007ACC00"),R.fromHex("#FFFFFF"),R.fromHex("#0E639C50");p("caseDescription","Match Case");p("wordsDescription","Match Whole Word");p("regexDescription","Use Regular Expression");p("defaultLabel","input");var Pr;(function(s){s[s.Unknown=0]="Unknown",s[s.Twistie=1]="Twistie",s[s.Element=2]="Element",s[s.Filter=3]="Filter"})(Pr||(Pr={}));class ji extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class hC{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 dC(s){return typeof s=="object"&&"visibility"in s&&"data"in s}function td(s){switch(s){case!0:return 1;case!1:return 0;default:return s}}function Dp(s){return typeof s.collapsible=="boolean"}class W6{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new W0,this._onDidChangeCollapseState=new A,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new A,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new A,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new dg(rk),this.collapseByDefault=typeof n.collapseByDefault>"u"?!1:n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=typeof n.autoExpandSingleChildren>"u"?!1:n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=fe.empty(),n={}){if(e.length===0)throw new ji(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,o,r){var a;n===void 0&&(n=fe.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,n,o);const c=[...n],h=t[t.length-1],d=new Os({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,h),...c,...l.children.slice(h+i)].map(b=>e.getId(b.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const u=t.slice(0,-1),f=(b,v,C)=>{if(r>0)for(let w=0;w<C;w++)b--,v--,this.spliceSmart(e,[...u,b,0],Number.MAX_SAFE_INTEGER,c[v].children,o,r-1)};let m=Math.min(l.children.length,h+i),_=c.length;for(const b of d.changes.sort((v,C)=>C.originalStart-v.originalStart))f(m,_,m-(b.originalStart+b.originalLength)),m=b.originalStart,_=b.modifiedStart-h,this.spliceSimple([...u,m],b.originalLength,fe.slice(c,_,_+b.modifiedLength),o);f(m,_,m)}spliceSimple(e,t,i=fe.empty(),{onDidCreateNode:n,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:h}=this.getParentNodeWithListIndex(e),d=[],u=fe.map(i,y=>this.createTreeNode(y,a,a.visible?1:0,c,d,n)),f=e[e.length-1],m=a.children.length>0;let _=0;for(let y=f;y>=0&&y<a.children.length;y--){const S=a.children[y];if(S.visible){_=S.visibleChildIndex;break}}const b=[];let v=0,C=0;for(const y of u)b.push(y),C+=y.renderNodeCount,y.visible&&(y.visibleChildIndex=_+v++);const w=JC(a.children,f,t,b);r?a.lastDiffIds?JC(a.lastDiffIds,f,t,b.map(y=>r.getId(y.element).toString())):a.lastDiffIds=a.children.map(y=>r.getId(y.element).toString()):a.lastDiffIds=void 0;let L=0;for(const y of w)y.visible&&L++;if(L!==0)for(let y=f+b.length;y<a.children.length;y++){const S=a.children[y];S.visible&&(S.visibleChildIndex-=L)}if(a.visibleChildrenCount+=v-L,c&&h){const y=w.reduce((S,D)=>S+(D.visible?D.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,C-y),this.list.splice(l,y,d)}if(w.length>0&&o){const y=S=>{o(S),S.children.forEach(y)};w.forEach(y)}this._onDidSplice.fire({insertedNodes:b,deletedNodes
`),(t=this.findController)===null||t===void 0||t.style(e),this.view.style(e)}getParentElement(e){const 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)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,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){const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const n=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(n,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const r=this.model.getParentNodeLocation(n);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],n=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,o)}dispose(){$e(this.disposables),this.view.dispose()}}class fC{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new W6(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(n,o){return i.sorter.compare(n.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=fe.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=fe.empty(),i){const n=new Set,o=new Set,r=l=>{var c;if(l.element===null)return;const h=l;if(n.add(h.element),this.nodes.set(h.element,h),this.identityProvider){const d=this.identityProvider.getId(h.element).toString();o.add(d),this.nodesByIdentity.set(d,h)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,h)},a=l=>{var c;if(l.element===null)return;const h=l;if(n.has(h.element)||this.nodes.delete(h.element),this.identityProvider){const d=this.identityProvider.getId(h.element).toString();o.has(d)||this.nodesByIdentity.delete(d)}(c=i.onDidDeleteNode)===null||c===void 0||c.call(i,h)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:a}))}preserveCollapseState(e=fe.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),fe.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i)return Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children)});const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible,o=typeof t.collapsed<"u"?t.collapsed:i.collapsed;return Object.assign(Object.assign({},t),{collapsible:n,collapsed:o,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this
`)}const OF={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:{[Wt]:"#FFFFFE",[nc]:"#000000",[Cb]:"#E5EBF1",[Cd]:"#D3D3D3",[vd]:"#939393",[h2]:"#ADD6FF4D"}},FF={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:{[Wt]:"#1E1E1E",[nc]:"#D4D4D4",[C
`)}}}class SE{getIcon(e){const t=bD();let i=e.defaults;for(;ii.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const ko="vs",gh="vs-dark",_l="hc-black",bl="hc-light",yE=At.as(Qk.ColorContribution),HF=At.as(Hk.ThemingContribution);class LE{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(Hu(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){const e=new Map;for(const t in this.themeData.colors)e.set(t,R.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=f0(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,R.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=yE.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case ko:return Ki.LIGHT;case _l:return Ki.HIGH_CONTRAST_DARK;case bl:return Ki.HIGH_CONTRAST_LIGHT;default:return Ki.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=f0(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const o={token:""};i&&(o.foreground=i),n&&(o.background=n),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=wE.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Ci.getForeground(o),a=Ci.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function Hu(s){return s===ko||s===gh||s===_l||s===bl}function f0(s){switch(s){case ko:return OF;case gh:return FF;case _l:return BF;case bl:return VF}}function vu(s){const e=f0(s);return new LE(s,e)}class zF extends H{constructor(){super(),this._onColorThemeChange=this._register(new A),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new A),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new SE,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(ko,vu(ko)),this._knownThemes.set(gh,vu(gh)),this._knownThemes.set(_l,vu(_l)),this._knownThemes.set(bl,vu(bl));const e=WF(this);this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(ko),this._onOSSchemeChanged(),e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}),J0("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return t1(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=An(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),H.None}_registerShadowDomContainer(e){const t=An(e);return t.className="monaco-colors",t.textContent=this._allCSS,this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!Hu(t.base)&&!Hu(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new LE(e,t)),Hu(e)&&this._knownThemes.forEach(i=>{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(ko),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==ns(this._theme.type)){let t;L5(this._theme.type)?t=e?_l:gh:t=e?bl:ko,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};HF.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of yE.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${K5(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor { ${n.join(`
`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(PF(o)),this._themeCSS=e.join(`
`),this._updateCSS(),rt.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const gn=Ce("themeService");var UF=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Tp=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};let g0=class extends H{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new A,this._onDidChangeReducedMotion=new A,this._accessibilityModeEnabledContext=B5.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),n(),this._register(this.onDidChangeScreenReaderOptimized(()=>n()));const o=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(W(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",i),this._layoutService.container.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};g0=UF([Tp(0,Ze),Tp(1,lc),Tp(2,ft)],g0);var Uc=globalThis&&globalThis.__awaiter||function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(h){try{c(i.next(h))}catch(d){r(d)}}function l(h){try{c(i.throw(h))}catch(d){r(d)}}function c(h){h.done?o(h.value):n(h.value).then(a,l)}c((i=i.apply(s,e||[])).next())})},el;(function(s){s[s.None=0]="None",s[s.Initialized=1]="Initialized",s[s.Closed=2]="Closed"})(el||(el={}));class Cl extends H{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new A),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=el.None,this.cache=new Map,this.flushDelayer=new cT(Cl.DEFAULT_FLUSH_DELAY),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;(t=e.changed)===null||t===void 0||t.forEach((n,o)=>this.accept(o,n)),(i=e.deleted)===null||i===void 0||i.forEach(n=>this.accept(n,void 0))}accept(e,t){if(this.state===el.Closed)return;let i=!1;Hi(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire(e)}get(e,t){const i=this.cache.get(e);return Hi(i)?t:i}getBoolean(
`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(const[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(n,t);if(o)return o;t.delete(i)}}}class Zy extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph:
${e.toString()}`}}class xC{constructor(e=new Bg,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(Et,this)}createChild(e){return new xC(e,this._strict,this)}invokeFunction(e,...t){const i=ln.traceInvocation(e);let n=!1;try{return e({get:r=>{if(n)throw cx("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof $n?(i=ln.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=ln.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=Ln.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of n){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const 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`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return new e(...t,...o)}_setServiceInstance(e,t){if(this._services.get(e)instanceof $n)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){const i=this._getServiceInstanceOrDescriptor(e);return i instanceof $n?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new 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){const n=new nB(a=>a.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const a=r.pop();if(n.lookupOrInsertNode(a),o++>1e3)throw new Zy(n);for(const l of Ln.getServiceDependencies(a.desc.ctor)){const c=this._getServiceInstanceOrDescriptor(l.id);if(c||this._throwIfStrict(`[createInstance] ${e} depends on ${l.id} which is NOT registered.`,!0),c instanceof $n){const h={id:l.id,desc:c,_trace:a._trace.branch(l.id,!0)};n.insertEdge(a,h),r.push(h)}}}for(;;){const a=n.roots();if(a.length===0){if(!n.isEmpty())throw new Zy(n);break}for(const{data:l}of a){if(this._getServiceInstanceOrDescriptor(l.id)instanceof $n){const h=this._createServiceInstanceWithOwner(l.id,l.desc.ctor,l.desc.staticArguments,l.desc.supportsDelayedInstantiation,l._trace);this._setServiceInstance(l.id,h)}n.removeNode(l)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,o){if(this._services.get(e)instanceof $n)return this._createServiceInstance(t,i,n,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t=[],i,n){if(i){const o=new ug(()=>this._createInstance(e,t,n));return new Proxy(Object.create(null),{get(r,a){if(a in r)return r[a];const l=o.value;let c=l[a];return typeof c!="function"||(c=c.bind(l),r[a]=c),c},set(r,a,l){return o.value[a]=l,!0}})}else return this._createInstance(e,t,n)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class ln{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return ln._None}static traceCreation(e){return ln._None}branch(e,t){const i=new ln(2,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;ln._totals+=e;let t=!1;function i(o,r){const a=[],l=new Array(o+1).join(" ");for(const[c,h,d]of r._dep)if(h&&d){t=!0,a
`)}const n=[`${this.type===0?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${ln._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(n.join(`
`))}}ln._None=new class extends ln{constructor(){super(-1,null)}stop(){}branch(){return this}};ln._totals=0;class sB{constructor(){this._byResource=new ti,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 o=this._byOwner.get(t);o||(o=new ti,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(n=r.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:fe.empty():Se.isUri(e)?(o=(n=this._byResource.get(e))===null||n===void 0?void 0:n.values())!==null&&o!==void 0?o:fe.empty():fe.map(fe.concat(...this._byOwner.values()),r=>r[1])}}class oB{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new ti,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(e.scheme===we.inMemory||e.scheme===we.walkThrough||e.scheme===we.walkThroughSnippet||e.scheme===we.vscodeSourceControl)return t;for(const{severity:i}of this._service.read({resource:e}))i===$i.Error?t.errors+=1:i===$i.Warning?t.warnings+=1:i===$i.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 Co{constructor(){this._onMarkerChanged=new Cx({delay:0,merge:Co._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new sB,this._stats=new oB(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(cI(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const o of i){const r=Co._toMarker(e,t,o);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:h,endColumn:d,relatedInformation:u,tags:f}=i;if(r)return l=l>0?l:1,c=c>0?c:1,h=h>=l?h:l,d=d>0?d:c,{resource:t,owner:e,code:n,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:h,endColumn:d,relatedInformation:u,tags:f}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const o of n){const r=fe.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(Jf(t)){const o=new ti;for(const{resource:r,marker:a}of t){const l=Co._toMarker(e,r,a);if(!l)continue;const c=o.get(r);c?c.push(l):(o.set(r,[l]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(Co._accept(l,n)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(Co._accept(l,n)){const c=r.push(l);if(o>0&&c===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const c of l)if(Co._accept(c,n)){const h=a.push(c);if(o>0&&h===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new ti;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}function DE(s,e,t,i,n,o){if(Array.isArray(s)){let r=0;for(const a of s){const l=DE(a,e,t,i,n,o);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof s=="string")return i?s==="*"?5:s===t?10:0:0;if(s){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:h}=s;if(!i&&!c)return 0;h&&n&&(e=
`+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}}class nm{info(e){return this.notify({severity:mt.Info,message:e})}warn(e){return this.notify({severity:mt.Warning,message:e})}error(e){return this.notify({severity:mt.Error,message:e})}notify(e){switch(e.severity){case mt.Error:console.error(e.message);break;case mt.Warning:console.warn(e.message);break;default:console.log(e.message);break}return nm.NO_OP}status(e,t){return H.None}}nm.NO_OP=new FP;let v0=class{constructor(e){this._onWillExecuteCommand=new A,this._onDidExecuteCommand=new A,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Rt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const n=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}};v0=sr([qt(0,Et)],v0);let Kl=class extends x3{constructor(e,t,i,n,o,r){super(e,t,i,n,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const m=new ae;m.add(W(f,U.KEY_DOWN,_=>{const b=new tt(_);this._dispatch(b,b.target)&&(b.preventDefault(),b.stopPropagation())})),m.add(W(f,U.KEY_UP,_=>{const b=new tt(_);this._singleModifierDispatch(b,b.target)&&b.preventDefault()})),this._domNodeListeners.push(new dB(f,m))},l=f=>{for(let m=0;m<this._domNodeListeners.length;m++){const _=this._domNodeListeners[m];_.domNode===f&&(this._domNodeListeners.splice(m,1),_.dispose())}},c=f=>{f.getOption(56)||a(f.getContainerDomNode())},h=f=>{f.getOption(56)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(h)),r.listCodeEditors().forEach(c);const d=f=>{a(f.getContainerDomNode())},u=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(d)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,i,n){return Po(Rt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>{var n,o;const r=Q_(i.keybinding,an);return{keybinding:(n=r==null?void 0:r.parts)!==null&&n!==void 0?n:null,command:(o=i.command)!==null&&o!==void 0?o:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),He(()=>{for(let i=0;i<this._dynamicKeybindings.length;i++)if(this._dynamicKeybindings[i]===t[0]){this._dynamicKeybindings.splice(i,t.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(Ig.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new dh(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[n++]=new jS(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=Zh.resolveUserBinding(a,an);for(const c of l)i[n++]=new jS(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Ih(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new Zh(t,an)}};Kl=sr([qt(0,Ze),qt(1,tn),qt(2,pd),qt(3,fs),qt(4,er),qt(5,bt)],Kl);class dB extends H{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Qy(s){return s&&typeof s=="object"&&(!s.overrideIdentifier||typeof s.overrideIdentifier=="string")&&(!s.resource||s.resource instanceof Se)}class xE{constructor(){this._onDidChangeConfiguration=new A,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new zg(new aB,new bi,new bi,new bi)}get
`:`\r
`}};S0=sr([qt(0,ft)],S0);class uB{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class rd{constructor(){const e=Se.from({scheme:rd.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new O3({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===rd.SCHEME?this.workspace.folders[0]:null}}rd.SCHEME="inmemory";function Qf(s,e,t){if(!e||!(s instanceof xE))return;const i=[];Object.keys(e).forEach(n=>{y3(n)&&i.push([`editor.${n}`,e[n]]),t&&L3(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&s.updateValues(i)}let y0=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return IE(this,void 0,void 0,function*(){const i=new Map;for(const r of e){if(!(r instanceof zr))throw new Error("bad edit - only text edits are supported");const a=this._modelService.getModel(r.resource);if(!a)throw new Error("bad edit - model not found");if(typeof r.versionId=="number"&&a.getVersionId()!==r.versionId)throw new Error("bad state - model changed in the meantime");let l=i.get(a);l||(l=[],i.set(a,l)),l.push(D3.replaceMove(M.lift(r.textEdit.range),r.textEdit.text))}let n=0,o=0;for(const[r,a]of i)r.pushStackElement(),r.pushEditOperations([],a,()=>[]),r.pushStackElement(),o+=1,n+=a.length;return{ariaSummary:N_(V1.bulkEditServiceSummary,n,o)}})}};y0=sr([qt(0,zt)],y0);class fB{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Pb(e)}}let L0=class extends W1{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const n=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();n&&(t=n.getContainerDomNode())}return super.showContextView(e,t,i)}};L0=sr([qt(0,lc),qt(1,bt)],L0);class gB{constructor(){this._neverEmitter=new A,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class mB extends Qh{constructor(){super()}}class pB extends ZT{constructor(){super(new GT)}}let k0=class extends U1{constructor(e,t,i,n,o){super(e,t,i,n,o),this.configure({blockMouse:!1})}};k0=sr([qt(0,pd),qt(1,fs),qt(2,Wg),qt(3,ir),qt(4,Ct)],k0);ke(ft,xE);ke(uk,w0);ke(fk,S0);ke(P3,rd);ke(R3,fB);ke(pd,uB);ke(xD,hB);ke(fs,nm);ke(aa,Co);ke(Zt,mB);ke(gn,zF);ke(er,pB);ke(zt,Kf);ke(Ok,G1);ke(Ze,b0);ke(X8,cB);ke(iC,im);ke(DC,$F);ke(ac,Z_);ke(v3,y0);ke(B3,gB);ke(bg,C0);ke(na,g0);ke(ms,o0);ke(tn,v0);ke(ir,Kl);ke(CE,u0);ke(Wg,L0);ke(m3,q1);ke(tC,_0);ke(eC,k0);ke(Uk,m0);var Q;(function(s){const e=new Bg;for(const[r,a]of yv())e.set(r,a);const t=new xC(e,!0);e.set(Et,t);function i(r){const a=e.get(r);if(!a)throw new Error("Missing service "+r);return a instanceof $n?t.invokeFunction(l=>l.get(r)):a}s.get=i;let n=!1;function o(r){if(n)return t;n=!0;for(const[a,l]of yv())e.get(a)||e.set(a,l);for(const a in r)if(r.hasOwnProperty(a)){const l=Ce(a);e.get(l)instanceof $n&&e.set(l,r[a])}return t}s.initialize=o})(Q||(Q={}));var NC=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Ae=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};let _B=0,Xy=!1;function bB(s){if(!s){if(Xy)return;Xy=!0}C5(s||document.body)}let Xf=class extends qh{constructor(e,t,i,n,o,r,a,l,c,h,d,u){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||Hf.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+Hf.accessibilityHelpMessage,super(e,f,{},i,n,o,r,l,c,h,d,u),a instanceof Kl?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,bB(f.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++_B,o=Vt.deserialize(i);return this._sta
`);let r=t;return o!==-1&&(r=t.substring(0,o)),Jy(s,t,e.createByFilepathOrFirstLine(n||null,r),n)}return Jy(s,t,e.createById(i),n)}function Jy(s,e,t,i){return s.createModel(e,t,i)}function CB(s,e,t){return Q.initialize(t||{}).createInstance(D0,s,e)}function vB(s){return Q.get(bt).onCodeEditorAdd(t=>{s(t)})}function wB(s){return Q.get(bt).onDiffEditorAdd(t=>{s(t)})}function SB(){return Q.get(bt).listCodeEditors()}function yB(){return Q.get(bt).listDiffEditors()}function LB(s,e,t){return Q.initialize(t||{}).createInstance(E0,s,e)}function kB(s,e){return new _N(s,e)}function DB(s){if(typeof s.id!="string"||typeof s.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Rt.registerCommand(s.id,s.run)}function EB(s){if(typeof s.id!="string"||typeof s.label!="string"||typeof s.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Vt.deserialize(s.precondition),t=(n,...o)=>Go.runEditorCommand(n,o,e,(r,a,l)=>Promise.resolve(s.run(a,...l))),i=new ae;if(i.add(Rt.registerCommand(s.id,t)),s.contextMenuGroupId){const n={command:{id:s.id,title:s.label},when:e,group:s.contextMenuGroupId,order:s.contextMenuOrder||0};i.add(ll.appendMenuItem(x.EditorContext,n))}if(Array.isArray(s.keybindings)){const n=Q.get(ir);if(!(n instanceof Kl))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=Vt.and(e,Vt.deserialize(s.keybindingContext));i.add(n.addDynamicKeybindings(s.keybindings.map(r=>({keybinding:r,command:s.id,when:o}))))}}return i}function IB(s){return TE([s])}function TE(s){const e=Q.get(ir);return e instanceof Kl?e.addDynamicKeybindings(s.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Vt.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),H.None)}function xB(s,e,t){const i=Q.get(Zt),n=i.getLanguageIdByMimeType(e)||e;return NE(Q.get(zt),i,s,n,t)}function NB(s,e){const t=Q.get(Zt);Q.get(zt).setMode(s,t.createById(e))}function TB(s,e,t){s&&Q.get(aa).changeOne(e,s.uri,t)}function MB(s){Q.get(aa).changeAll(s,[])}function AB(s){return Q.get(aa).read(s)}function RB(s){return Q.get(aa).onMarkerChanged(s)}function PB(s){return Q.get(zt).getModel(s)}function OB(){return Q.get(zt).getModels()}function FB(s){return Q.get(zt).onModelAdded(s)}function BB(s){return Q.get(zt).onModelRemoved(s)}function VB(s){return Q.get(zt).onModelLanguageChanged(t=>{s({model:t.model,oldLanguage:t.oldLanguageId})})}function WB(s){return e4(Q.get(zt),Q.get(ds),s)}function HB(s,e){const t=Q.get(Zt),i=Q.get(gn);return i.registerEditorContainer(s),fb.colorizeElement(i,t,s,e)}function zB(s,e,t){const i=Q.get(Zt);return Q.get(gn).registerEditorContainer(document.body),fb.colorize(i,s,e,t)}function UB(s,e,t=4){return Q.get(gn).registerEditorContainer(document.body),fb.colorizeModelLine(s,e,t)}function $B(s){const e=rt.get(s);return e||{getInitialState:()=>tf,tokenize:(t,i,n)=>nk(s,n)}}function jB(s,e){rt.getOrCreate(e);const t=$B(e),i=ud(s),n=[];let o=t.getInitialState();for(let r=0,a=i.length;r<a;r++){const l=i[r],c=t.tokenize(l,!0,o);n[r]=c.tokens,o=c.endState}return n}function KB(s,e){Q.get(gn).defineTheme(s,e)}function qB(s){Q.get(gn).setTheme(s)}function GB(){F_.clearAllFontInfos()}function ZB(s,e){return Rt.registerCommand({id:s,handler:e})}function YB(){return{create:CB,getEditors:SB,getDiffEditors:yB,onDidCreateEditor:vB,onDidCreateDiffEditor:wB,createDiffEditor:LB,createDiffNavigator:kB,addCommand:DB,addEditorAction:EB,addKeybindingRule:IB,addKeybindingRules:TE,createModel:xB,setModelLanguage:NB,setModelMarkers:TB,getModelMarkers:AB,removeAllMarkers:MB,onDidChangeMarkers:RB,getModels:OB,getModel:PB,onDidCreateModel:FB,onWillDisposeModel:BB,onDidChangeModelLanguage:VB,createWebWorker:WB,colorizeElement:HB,colorize:zB,colorizeModelLine:UB,tokenize:jB,defineTheme:KB,setTheme:qB,remeasureFonts:GB,registerCommand:ZB,AccessibilitySupport:Kp,ContentWidgetPositionPreferenc
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:Wo(t,a.open),close:Wo(t,a.close)});else throw Te(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}var iV=globalThis&&globalThis.__awaiter||function(s,e,t,i){function n(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(h){try{c(i.next(h))}catch(d){r(d)}}function l(h){try{c(i.throw(h))}catch(d){r(d)}}function c(h){h.done?o(h.value):n(h.value).then(a,l)}c((i=i.apply(s,e||[])).next())})};function nV(s){Dl.registerLanguage(s)}function sV(){let s=[];return s=s.concat(Dl.getLanguages()),s}function oV(s){return Q.get(Zt).languageIdCodec.encodeLanguageId(s)}function rV(s,e){const i=Q.get(Zt).onDidEncounterLanguage(n=>{n===s&&(i.dispose(),e())});return i}function aV(s,e){if(!Q.get(Zt).isRegisteredLanguageId(s))throw new Error(`Cannot set configuration for unknown language ${s}`);return Q.get(ds).register(s,e,100)}class lV{constructor(e,t){this._languageId=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return ad.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const n=this._actual.tokenizeEncoded(e,i);return new sg(n.tokens,n.endState)}}class ad{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let o=0,r=e.length;o<r;o++){const a=e[o];let l=a.startIndex;o===0?l=0:l<n&&(l=n),i[o]=new bh(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const o=t.tokenize(i,n),r=ad._toClassicTokens(o.tokens,e);let a;return o.endState.equals(n)?a=n:a=o.endState,new U0(r,a)}tokenize(e,t,i){return ad.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let r=0,a=0;for(let c=0,h=t.length;c<h;c++){const d=t[c],u=n.match(i,d.scopes);if(r>0&&o[r-1]===u)continue;let f=d.startIndex;c===0?f=0:f<a&&(f=a),o[r++]=f,o[r++]=u,a=f}const l=new Uint32Array(r);for(let c=0;c<r;c++)l[c]=o[c];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new sg(o,r)}}function cV(s){return typeof s.getInitialState=="function"}function hV(s){return"tokenizeEncoded"in s}function AE(s){return s&&typeof s.then=="function"}function dV(s){const e=Q.get(gn);if(s){const t=[null];for(let i=1,n=s.length;i<n;i++)t[i]=R.fromHex(s[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function RE(s,e){return hV(e)?new lV(s,e):new ad(s,e,Q.get(Zt),Q.get(gn))}function TC(s,e){const t={createTokenizationSupport:()=>iV(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?cV(i)?RE(s,i):new Eh(Q.get(Zt),Q.get(gn),s,ME(s,i),Q.get(ft)):null})};return rt.registerFactory(s,t)}function uV(s,e){if(!Q.get(Zt).isRegisteredLanguageId(s))throw new Error(`Cannot set tokens provider for unknown language ${s}`);return AE(e)?TC(s,{create:()=>e}):rt.register(s,RE(s,e))}function fV(s,e){const t=i=>new Eh(Q.get(Zt),Q.get(gn),s,ME(s,i),Q.get(ft));return AE(e)?TC(s,{create:()=>e}):rt.register(s,t(e))}function gV(s,e){return Q.get(Le).referenceProvider.register(s,e)}function mV(s,e){return Q.get(Le).renameProvider.register(s,e)}function pV(s,e){return Q.get(Le).signatureHelpProvider.register(s,e)}function _V(s,e){return Q.get(Le).hoverProvider.register(s,{provideHover:(i,n,o)=>{const r=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,o)).then(a=>{if(a)return!a.range&&r&&(a.range=new M(n.lineNumber,r.startColumn,n.lineNumber,r.endColumn)),a.range||(a.range=new M(n.lineNumber,n.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var nW=Object.defineProperty,sW=Object.getOwnPropertyDescriptor,oW=Object.getOwnPropertyNames,rW=Object.prototype.hasOwnProperty,iL=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of oW(e))!rW.call(s,n)&&n!==t&&nW(s,n,{get:()=>e[n],enumerable:!(i=sW(e,n))||i.enumerable});return s},aW=(s,e,t)=>(iL(s,e,"default"),t&&iL(t,e,"default")),jc={};aW(jc,N0);var FE={},Pp={},BE=class{constructor(s){_a(this,"_languageId");_a(this,"_loadingTriggered");_a(this,"_lazyLoadPromise");_a(this,"_lazyLoadPromiseResolve");_a(this,"_lazyLoadPromiseReject");this._languageId=s,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(s){return Pp[s]||(Pp[s]=new BE(s)),Pp[s]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,FE[this._languageId].loader().then(s=>this._lazyLoadPromiseResolve(s),s=>this._lazyLoadPromiseReject(s))),this._lazyLoadPromise}};function MC(s){const e=s.id;FE[e]=s,jc.languages.register(s);const t=BE.getOrCreate(e);jc.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),jc.languages.onLanguage(e,async()=>{const i=await t.load();jc.languages.setLanguageConfiguration(e,i.conf)})}MC({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>T0(()=>import("./javascript-90d947bd.js"),["assets/javascript-90d947bd.js","assets/index-f87df9cc.js","assets/index-a9d4fdcf.css"])});MC({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>T0(()=>import("./sql-d6fbbba2.js"),[])});MC({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>T0(()=>import("./html-d12deeb1.js"),["assets/html-d12deeb1.js","assets/index-f87df9cc.js","assets/index-a9d4fdcf.css"])});function nL(s){return JSON.stringify(s,null,4)}function sL(){}const bH={name:"MonacoEditor",props:{diffEditor:{type:Boolean,default:!1},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"400px"},original:String,modelValue:[String,Object,Array],language:{type:String,default:"javascript"},theme:{type:String,default:"vs-dark"},disabled:{type:Boolean,default:!1},options:{type:Object,default(){return{}}},editorMounted:{type:Function,default:sL},editorBeforeMount:{type:Function,default:sL}},watch:{options:{deep:!0,handler(s){this.editor&&this.editor.updateOptions(s)}},language(){if(this.editor)if(this.diffEditor){const{original:s,modified:e}=this.editor.getModel();mo.setModelLanguage(s,this.language),mo.setModelLanguage(e,this.language)}else mo.setModelLanguage(this.editor.getModel(),this.language)},theme(){this.editor&&mo.setTheme(this.theme)},style(){this.editor&&this.$nextTick(()=>{this.editor.layout()})},modelValue(s){this.editor&&s!==this._getValue()&&this._setValue(s)}},computed:{style(){return{width:/^\d+$/.test(this.width)?`${this.width}px`:this.width,height:/^\d+$/.test(this.height)?`${this.height}px`:this.height,position:"relative"}}},mounted(){this.initMonaco()},beforeDestroy(){this.editor&&this.editor.dispose()},render(){const s=this.options.fullScreen;return ZC("div",{class:"monaco_editor_container",style:this.style},[s?ZC("i",{class:"el-icon-full-screen",style:{width:"1.2em",height:"1.2em",position:"absolute",left:"0px",top:"0px",zIndex:"1",cursor:"pointer"},on:{click:this._handleFullScreen}}):""])},methods:{initMonaco(){const{modelValue:s,language:e,theme:t,disabled:i,options:n}=this,o=s;Object.assign(n,this._editorBeforeMount()),this.editor=mo[this.diffEditor?"createDiffEditor":"create"](this.$el,{value:typeof o=="string"?o:nL(o),language:e,theme:t,readOnly:i,minimap:{enabled:!1},fontSize:13,fullScreen:!0,automaticLayout:!0,foldingStrategy:"indentation",autoClosingBrackets:"always",folding:!0,...n}),this.diffEdi