it-tools/dist/client/assets/chunks/chunk-978df63c.js

739 lines
3 MiB
JavaScript
Raw Normal View History

2024-04-28 00:48:29 +08:00
import{b as YH}from"./chunk-a740628f.js";import{_ as Ce}from"./chunk-cf010ec4.js";import{d as XH,G as QH,r as JH,u as ez,A as xA,al as tz,b as iz,j as U3,D as nz,_ as sz,k as oz,l as rz,m as az}from"./chunk-449c23a2.js";function So(o,e=0){return o[o.length-(1+e)]}function lz(o){if(o.length===0)throw new Error("Invalid tail call");return[o.slice(0,o.length-1),o[o.length-1]]}function Ki(o,e,t=(i,n)=>i===n){if(o===e)return!0;if(!o||!e||o.length!==e.length)return!1;for(let i=0,n=o.length;i<n;i++)if(!t(o[i],e[i]))return!1;return!0}function dz(o,e){const t=o.length-1;e<t&&(o[e]=o[t]),o.pop()}function K_(o,e,t){return cz(o.length,i=>t(o[i],e))}function cz(o,e){let t=0,i=o-1;for(;t<=i;){const n=(t+i)/2|0,s=e(n);if(s<0)t=n+1;else if(s>0)i=n-1;else return n}return-(t+1)}function $3(o,e){let t=0,i=o.length;if(i===0)return 0;for(;t<i;){const n=Math.floor((t+i)/2);e(o[n])?i=n:t=n+1}return t}function Kx(o,e,t){if(o=o|0,o>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],n=[],s=[],r=[];for(const a of e){const l=t(a,i);l<0?n.push(a):l>0?s.push(a):r.push(a)}return o<n.length?Kx(o,n,t):o<n.length+r.length?r[0]:Kx(o-(n.length+r.length),s,t)}function kA(o,e){const t=[];let i;for(const n of o.slice(0).sort(e))!i||e(i[0],n)!==0?(i=[n],t.push(i)):i.push(n);return t}function qa(o){return o.filter(e=>!!e)}function IA(o){let e=0;for(let t=0;t<o.length;t++)o[t]&&(o[e]=o[t],e+=1);o.length=e}function j3(o){return!Array.isArray(o)||o.length===0}function Fn(o){return Array.isArray(o)&&o.length>0}function Sc(o,e=t=>t){const t=new Set;return o.filter(i=>{const n=e(i);return t.has(n)?!1:(t.add(n),!0)})}function K3(o,e){const t=qx(o,e);if(t!==-1)return o[t]}function qx(o,e){for(let t=o.length-1;t>=0;t--){const i=o[t];if(e(i))return t}return-1}function q3(o,e){return o.length>0?o[0]:e}function Jn(o,e){let t=typeof e=="number"?o:0;typeof e=="number"?t=o:(t=0,e=o);const i=[];if(t<=e)for(let n=t;n<e;n++)i.push(n);else for(let n=t;n>e;n--)i.push(n);return i}function LS(o,e,t){const i=o.slice(0,e),n=o.slice(e);return i.concat(t,n)}function VL(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.unshift(e))}function m0(o,e){const t=o.indexOf(e);t>-1&&(o.splice(t,1),o.push(e))}function EA(o,e){for(const t of e)o.push(t)}function nR(o){return Array.isArray(o)?o:[o]}function hz(o,e){for(const t of o){const i=e(t);if(i!==void 0)return i}}function uz(o,e,t){const i=G3(o,e),n=o.length,s=t.length;o.length=n+s;for(let r=n-1;r>=i;r--)o[r+s]=o[r];for(let r=0;r<s;r++)o[r+i]=t[r]}function TA(o,e,t,i){const n=G3(o,e),s=o.splice(n,t);return uz(o,n,i),s}function G3(o,e){return e<0?Math.max(e+o.length,0):Math.min(e,o.length)}var gu;(function(o){function e(s){return s<0}o.isLessThan=e;function t(s){return s<=0}o.isLessThanOrEqual=t;function i(s){return s>0}o.isGreaterThan=i;function n(s){return s===0}o.isNeitherLessOrGreaterThan=n,o.greaterThan=1,o.lessThan=-1,o.neitherLessOrGreaterThan=0})(gu||(gu={}));function rr(o,e){return(t,i)=>e(o(t),o(i))}function gz(...o){return(e,t)=>{for(const i of o){const n=i(e,t);if(!gu.isNeitherLessOrGreaterThan(n))return n}return gu.neitherLessOrGreaterThan}}const Ul=(o,e)=>o-e,fz=(o,e)=>Ul(o?1:0,e?1:0);function Z3(o){return(e,t)=>-o(e,t)}function Y3(o,e){if(o.length===0)return;let t=o[0];for(let i=1;i<o.length;i++){const n=o[i];e(n,t)>0&&(t=n)}return t}function mz(o,e){if(o.length===0)return;let t=o[0];for(let i=1;i<o.length;i++){const n=o[i];e(n,t)>=0&&(t=n)}return t}function pz(o,e){return Y3(o,(t,i)=>-e(t,i))}function _z(o,e){if(o.length===0)return-1;let t=0;for(let i=1;i<o.length;i++){const n=o[i];e(n,o[t])>0&&(t=i)}return t}class dd{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.len
- 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 iU extends Jt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(71,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:m("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:m("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[m("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),m("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),m("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:m("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:m("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:m("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:m("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:m("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:m("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:_e(t.enabled,this.defaultValue.enabled),autohide:_e(t.autohide,this.defaultValue.autohide),size:li(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:li(t.side,this.defaultValue.side,["right","left"]),showSlider:li(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:_e(t.renderCharacters,this.defaultValue.renderCharacters),scale:Nt.clampedInt(t.scale,1,1,3),maxColumn:Nt.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function nU(o){return o==="ctrlCmd"?nt?"metaKey":"ctrlKey":"altKey"}class sU extends Jt{constructor(){super(82,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:m("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:m("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:Nt.clampedInt(t.top,0,0,1e3),bottom:Nt.clampedInt(t.bottom,0,0,1e3)}}}class oU extends Jt{constructor(){const e={enabled:!0,cycle:!0};super(84,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:m("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:m("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:_e(t.enabled,this.defaultValue.enabled),cycle:_e(t.cycle,this.defaultValue.cycle)}}}class rU extends wb{constructor(){super(140)}compute(e,t,i){return e.pixelRatio}}class aU extends Jt{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off
`+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 h9=new DU;function Ve(o){sa(o)||h9.onUnexpectedError(o)}function Ii(o){sa(o)||h9.onUnexpectedExternalError(o)}function OA(o){if(o instanceof Error){const{name:e,message:t}=o,i=o.stacktrace||o.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:Yf.isErrorNoTelemetry(o)}}return o}const y1="Canceled";function sa(o){return o instanceof Zc?!0:o instanceof Error&&o.name===y1&&o.message===y1}class Zc extends Error{constructor(){super(y1),this.name=this.message}}function xU(){const o=new Error(y1);return o.name=o.message,o}function Ao(o){return o?new Error(`Illegal argument: ${o}`):new Error("Illegal argument")}function lR(o){return o?new Error(`Illegal state: ${o}`):new Error("Illegal state")}class kU extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class Yf extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Yf)return e;const t=new Yf;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Mi extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Mi.prototype)}}function Za(o){const e=this;let t=!1,i;return function(){return t||(t=!0,i=o.apply(e,arguments)),i}}function dR(o){return typeof o.dispose=="function"&&o.dispose.length===0}function Ct(o){if(Qe.is(o)){const e=[];for(const t of o)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function lr(...o){return Oe(()=>Ct(o))}function Oe(o){return{dispose:Za(()=>{o()})}}class X{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ct(this._toDispose)}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?X.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}}X.DISABLE_DISPOSED_WARNING=!1;class H{constructor(){this._store=new X,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 In{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}}class IU{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class EU{constructor(e){this.object=e}dispose(){}}class cR{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Ct(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var n;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(n=this._store.get(e))===null||n===void 0||n.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const TU=globalThis.performance&&typeof globalThis.performance.now=="function";class Bn{static create(e){return new Bn(e)}constructor(
`).slice(2).join(`
`))}}class zL{constructor(e){this.value=e}}const MU=2;let B=class{constructor(e){var t,i,n,s,r;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new RU((n=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&n!==void 0?n:NU):void 0,this._perfMon=!((s=this._options)===null||s===void 0)&&s._profName?new Xf(this._options._profName):void 0,this._deliveryQueue=(r=this._options)===null||r===void 0?void 0:r.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||i===void 0||i.call(t),(n=this._leakageMon)===null||n===void 0||n.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,i,n)=>{var s,r,a,l,d;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),H.None;if(this._disposed)return H.None;i&&(t=t.bind(i));const c=new zL(t);let h;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(c.stack=hR.create(),h=this._leakageMon.check(c.stack,this._size+1)),this._listeners?this._listeners instanceof zL?((d=this._deliveryQueue)!==null&&d!==void 0||(this._deliveryQueue=new u9),this._listeners=[this._listeners,c]):this._listeners.push(c):((r=(s=this._options)===null||s===void 0?void 0:s.onWillAddFirstListener)===null||r===void 0||r.call(s,this),this._listeners=c,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const u=Oe(()=>{h?.(),this._removeListener(c)});return n instanceof X?n.add(u):Array.isArray(n)&&n.push(u),u}),this._event}_removeListener(e){var t,i,n,s;if((i=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||i===void 0||i.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(s=(n=this._options)===null||n===void 0?void 0:n.onDidRemoveLastListener)===null||s===void 0||s.call(n,this),this._size=0;return}const r=this._listeners,a=r.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*MU<=r.length){let d=0;for(let c=0;c<r.length;c++)r[c]?r[d++]=r[c]:l&&(this._deliveryQueue.end--,d<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=d}}_deliver(e,t){var i;if(!e)return;const n=((i=this._options)===null||i===void 0?void 0:i.onListenerError)||Ve;if(!n){e.value(t);return}try{e.value(t)}catch(s){n(s)}}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,i,n,s;if(!((t=this._deliveryQueue)===null||t===void 0)&&t.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)===null||i===void 0||i.stop()),(n=this._perfMon)===null||n===void 0||n.start(this._size),this._listeners)if(this._listeners instanceof zL)this._deliver(this._listeners,e);else{const r=this._deliveryQueue;r.enqueue(this,e,this._listeners.length),this._deliverQueue(r)}(s=this._perfMon)===null||s===void 0||s.stop()}hasListeners(){return this._size>0}};const AU=()=>new u9;class u9{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class fu extends B{constructor(e){super(e),this._isPaused=0,this._eventQueue=new rs,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){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(
| KEY '=~' REGEX
| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=m("contextkey.parser.error.expectedButGot",`Expected: {0}
Received: '{1}'.`,e,kh.getLexeme(t)),s=t.offset,r=kh.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:r,additionalInfo:i}),$p._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};B9._parseError=new Error;class Y{static false(){return hs.INSTANCE}static true(){return ys.INSTANCE}static has(e){return Xu.create(e)}static equals(e,t){return xb.create(e,t)}static notEquals(e,t){return TS.create(e,t)}static regex(e,t){return iv.create(e,t)}static in(e,t){return IS.create(e,t)}static notIn(e,t){return ES.create(e,t)}static not(e){return Qu.create(e)}static and(...e){return Wh.create(e,null,!0)}static or(...e){return Fl.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}Y._parser=new B9({regexParsingWithErrorRecovery:!1});function Y$(o,e){const t=o?o.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function p_(o,e){return o.cmp(e)}class hs{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return ys.INSTANCE}}hs.INSTANCE=new hs;class ys{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return hs.INSTANCE}}ys.INSTANCE=new ys;class Xu{static create(e,t=null){const i=Wn.get(e);return typeof i=="boolean"?i?ys.INSTANCE:hs.INSTANCE:new Xu(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:V9(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Wn.get(this.key);return typeof e=="boolean"?e?ys.INSTANCE:hs.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Qu.create(this.key,this)),this.negated}}class xb{static create(e,t,i=null){if(typeof t=="boolean")return t?Xu.create(e,i):Qu.create(e,i);const n=Wn.get(e);return typeof n=="boolean"?t===(n?"true":"false")?ys.INSTANCE:hs.INSTANCE:new xb(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Ju(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Wn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?ys.INSTANCE:hs.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=TS.create(this.key,this.value,this)),this.negated}}class IS{static create(e,t){return new IS(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Ju(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?H$.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=ES.create(this.key,this.valueKey)),this.negated}}class ES{static create(e,t){return new ES(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=IS.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}c
`;em.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
`;const qA=typeof Buffer<"u";let ZL;class FS{static wrap(e){return qA&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new FS(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return qA?this.buffer.toString():(ZL||(ZL=new TextDecoder),ZL.decode(this.buffer))}}function oj(o,e){return o[e+0]<<0>>>0|o[e+1]<<8>>>0}function rj(o,e,t){o[t+0]=e&255,e=e>>>8,o[t+1]=e&255}function Rr(o,e){return o[e]*Math.pow(2,24)+o[e+1]*Math.pow(2,16)+o[e+2]*Math.pow(2,8)+o[e+3]}function Mr(o,e,t){o[t+3]=e,e=e>>>8,o[t+2]=e,e=e>>>8,o[t+1]=e,e=e>>>8,o[t]=e}function GA(o,e){return o[e]}function ZA(o,e,t){o[t]=e}let YL;function H9(){return YL||(YL=new TextDecoder("UTF-16LE")),YL}let XL;function aj(){return XL||(XL=new TextDecoder("UTF-16BE")),XL}let QL;function z9(){return QL||(QL=n9()?H9():aj()),QL}function lj(o,e,t){const i=new Uint16Array(o.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?dj(o,e,t):H9().decode(i)}function dj(o,e,t){const i=[];let n=0;for(let s=0;s<t;s++){const r=oj(o,e);e+=2,i[n++]=String.fromCharCode(r)}return i.join("")}class eg{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 z9().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(t===0||$i(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(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 A1{constructor(e,t,i,n,s,r){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=s,this.reversedRegex=r,this._openSet=A1._toSet(this.open),this._closeSet=A1._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 cj(o){const e=o.length;o=o.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,d]=r,[c,h]=a;return l===c||l===h||d===c||d===h},n=(r,a)=>{const l=Math.min(r,a),d=Math.max(r,a);for(let c=0;c<e;c++)t[c]===d&&(t[c]=l)};for(let r=0;r<e;r++){const a=o[r];for(let l=r+1;l<e;l++){const d=o[l];i(a,d)&&n(t[r],t[l])}}const s=[];for(let r=0;r<e;r++){const a=[],l=[];for(let d=0;d<e;d++)if(t[d]===r){const[c,h]=o[d];a.push(c),l.push(h)}a.length>0&&s.push({open:a,close:l})}return s}class hj{constructor(e,t){this._richEditBracketsBrand=void 0;const i=cj(t);this.brackets=i.map((n,s)=>new A1(e,s,n.open,n.close,uj(n.open,n.close,i,s),gj(n.open,n.close,i,s))),this.forwardRegex=fj(this.brackets),this.reversedRegex=mj(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const n of this.brackets){for(const s of n.open)this.textIsBracket[s]=n,this.textIsOpenBracket[s]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,s.length);for(const s of n.close)this.textIsBracket[s]=n,this.textIsOpenBracket[s]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,s.length)}}}function U9(o,e,t,i){for(let n=0,s=e.length;n<s;n++){if(n===t)continue;const r=e[n];for(const a of r.open)a.indexOf(o)>=0&&i.push(a);for(const a of r.close)a.indexOf(o)>=0&&i.push(a)}}function $9(o,e){return o.length-e.length}function BS(o){if(o.length<=1)return o;const e=[],t=new Set;for(const i of o)t.has(i)||(e.push(i),t.add(i));return
`)>=0;let t=null;try{t=I9(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 ej(t,this.wordSeparators?Bo(this.wordSeparators):null,i?this.searchString:null)}}function vK(o){if(!o||o.length===0)return!1;for(let e=0,t=o.length;e<t;e++){const i=o.charCodeAt(e);if(i===10)return!0;if(i===92){if(e++,e>=t)break;const n=o.charCodeAt(e);if(n===110||n===114||n===87)return!0}}return!1}function Ih(o,e,t){if(!t)return new nv(o,null);const i=[];for(let n=0,s=e.length;n<s;n++)i[n]=e[n];return new nv(o,i)}class hP{constructor(e){const t=[];let i=0;for(let n=0,s=e.length;n<s;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 s=i+((n-i)/2>>0);t[s]>=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class w0{static findMatches(e,t,i,n,s){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new Jg(r.wordSeparators,r.regex),n,s):this._doFindMatchesLineByLine(e,i,r,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,r){let a,l=0;n?(l=n.findLineFeedCountBeforeOffset(s),a=t+s+l):a=t+s;let d;if(n){const g=n.findLineFeedCountBeforeOffset(s+r.length)-l;d=a+r.length+g}else d=a+r.length;const c=e.getPositionAt(a),h=e.getPositionAt(d);return new D(c.lineNumber,c.column,h.lineNumber,h.column)}static _doFindMatchesMultiline(e,t,i,n,s){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r
`?new hP(a):null,d=[];let c=0,h;for(i.reset(0);h=i.next(a);)if(d[c++]=Ih(this._getMultilineMatchRange(e,r,a,l,h.index,h[0]),h,n),c>=s)return d;return d}static _doFindMatchesLineByLine(e,t,i,n,s){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const d=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,d,t.startLineNumber,t.startColumn-1,a,r,n,s),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,n,s);for(let d=t.startLineNumber+1;d<t.endLineNumber&&a<s;d++)a=this._findMatchesInLine(i,e.getLineContent(d),d,0,a,r,n,s);if(a<s){const d=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,d,t.endLineNumber,0,a,r,n,s)}return r}static _findMatchesInLine(e,t,i,n,s,r,a,l){const d=e.wordSeparators;if(!a&&e.simpleSearch){const u=e.simpleSearch,g=u.length,f=t.length;let p=-g;for(;(p=t.indexOf(u,p+g))!==-1;)if((!d||ER(d,t,f,p,g))&&(r[s++]=new nv(new D(i,p+1+n,i,p+1+g+n),null),s>=l))return s;return s}const c=new Jg(e.wordSeparators,e.regex);let h;c.reset(0);do if(h=c.next(t),h&&(r[s++]=Ih(new D(i,h.index+1+n,i,h.index+1+h[0].length+n),h,a),s>=l))return s;while(h);return s}static findNextMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new Jg(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,r,n):this._doFindNextMatchLineByLine(e,i,r,n)}static _doFindNextMatchMultiline(e,t,i,n){const s=new W(t.lineNumber,1),r=e.getOffsetAt(s),a=e.getLineCount(),l=e.getValueInRange(new D(s.lineNumber,s.column,a,e.getLineMaxColumn(a)),1),d=e.getEOL()===`\r
`?new hP(l):null;i.reset(t.column-1);const c=i.next(l);return c?Ih(this._getMultilineMatchRange(e,r,l,d,c.index,c[0]),c,n):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new W(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const s=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,n);if(l)return l;for(let d=1;d<=s;d++){const c=(r+d-1)%s,h=e.getLineContent(c+1),u=this._findFirstMatchInLine(i,h,c+1,1,n);if(u)return u}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);const r=e.next(t);return r?Ih(new D(i,r.index+1,i,r.index+1+r[0].length),r,s):null}static findPreviousMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const r=new Jg(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,n):this._doFindPreviousMatchLineByLine(e,i,r,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const s=this._doFindMatchesMultiline(e,new D(1,1,t.lineNumber,t.column),i,n,10*_K);if(s.length>0)return s[s.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new W(r,e.getLineMaxColumn(r)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const s=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 d=1;d<=s;d++){const c=(s+r-d-1)%s,h=e.getLineContent(c+1),u=this._findLastMatchInLine(i,h,c+1,n);if(u)return u}return null}static _findLastMatchInLine(e,t,i,n){let s=null,r;for(e.reset(0);r=e.next(t);)s=Ih(new D(i,r.index+1,i,r.index+1+r[0].length),r,n);return s}}function bK(o,e,t,i,n){if(i===0)return!0;const s=e.charCodeAt(i-1);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i);if(o.get(r)!==0)return!0}return!1}function CK(o,e,t,i,n){if(i+n===t)return!0;const s=e.charCodeAt(i+n);if(o.get(s)!==0||s===13||s===10)return!0;if(n>0){const r=e.charCodeAt(i+n-1);if(o.get(r)!==0)return!0}return!1}function ER(o,e,t,i,n){return bK(o,e,t,i,n)&&CK(o,e,t,i,n)}class Jg{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,s=i[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(s===0){N1(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||ER(this._wordSeparators,e,t,n,s))return i}while(i);return null}}class TR{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,s=i?i.endLineNumber:e.getLineCount(),r=new uP(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${wK(Array.from(a))}`,"g");const d=new Jg(null,l),c=[];let h=!1,u,g=0,f=0,p=0;e:for(let _=n,v=s;_<=v;_++){const b=e.getLineContent(_),C=b.length;d.reset(0);do if(u=d.next(b),u){let w=u.index,S=u.index+u[0].length;if(w>0){const I=b.charCodeAt(w-1);$i(I)&&w--}if(S+1<C){const I=b.charCodeAt(S-1);$i(I)&&S++}const k=b.substring(w,S);let L=Z_(w+1,aR,b,0);L&&L.endColumn<=w+1&&(L=null);const x=r.shouldHighlightNonBasicASCII(k,L?L.word:null);if(x!==0){x===3?g++:x===2?f++:x===1?p++:kS();const I=1e3;if(c.length>=I){h=!0;break e}c.push(new D(_,w+1,_,S+1))}}while(u)}return{ranges:c,hasMore:h,ambiguousCharacterCount:g,invisibleCharacterCount:f,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new uP(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const s=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(s),a=vu.getLocales().filter(l=>!vu.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(s));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLo
`||o===" "}class dt{static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let n=i;for(;n<t.length&&t[n].start<=e.endExclusive;)n++;if(i===n)t.splice(i,0,e);else{const s=Math.min(e.start,t[i].start),r=Math.max(e.endExclusive,t[n-1].endExclusive);t.splice(i,n-i,new dt(s,r))}}static tryCreate(e,t){if(!(e>t))return new dt(e,t)}static ofLength(e){return new dt(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Mi(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new dt(this.start+e,this.endExclusive+e)}deltaStart(e){return new dt(this.start+e,this.endExclusive)}deltaEnd(e){return new dt(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new dt(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new dt(t,i)}slice(e){return e.slice(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Mi(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Mi(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}}class NR{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{const n=Math.min(e.start,this._sortedRanges[t].start),s=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new dt(n,s))}}toString(){return this._sortedRanges.map(e=>e.toString()).join(", ")}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(e){const t=new NR;for(const i of this._sortedRanges){const n=i.intersect(e);n&&t.addRange(n)}return t}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce((e,t)=>e+t.length,0)}}let mt=class Lo{static fromRange(e){return new Lo(e.startLineNumber,e.endLineNumber)}static subtract(e,t){return t?e.startLineNumber<t.startLineNumber&&t.endLineNumberExclusive<e.endLineNumberExclusive?[new Lo(e.startLineNumber,t.startLineNumber),new Lo(t.endLineNumberExclusive,e.endLineNumberExclusive)]:t.startLineNumber<=e.startLineNumber&&e.endLineNumberExclusive<=t.endLineNumberExclusive?[]:t.endLineNumberExclusive<e.endLineNumberExclusive?[new Lo(Math.max(t.endLineNumberExclusive,e.startLineNumber),e.endLineNumberExclusive)]:[new Lo(e.startLineNumber,Math.min(t.startLineNumber,e.endLineNumberExclusive))]:[e]}static joinMany(e){if(e.length===0)return[];let t=e[0];for(let i=1;i<e.length;i++)t=this.join(t,e[i]);return t}static join(e,t){if(e.length===0)return t;if(t.length===0)return e;const i=[];let n=0,s=0,r=null;for(;n<e.length||s<t.length;){let a=null;if(n<e.length&&s<t.length){const l=e[n],d=t[s];l.startLineNumber<d.startLineNumber?(a=l,n++):(a=d,s++)}else n<e.length?(a=e[n],n++):(a=t[s],s++);r===null?r=a:r.endLineNumberExclusive>=a.startLineNumber?r=new Lo(r.startLineNumber,Math.max(r.endLineNumberExclusive,a.endLineNumberExclusive)):(i.push(r),r=a)}return r!==null&&i.push(r),i}static ofLength(e,t){return new Lo(e,e+t)}static deserialize(e){return new Lo(e[0],e[1])}constructor(e,t){if(e>t)throw new Mi(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){re
`).length<=10||_.push(S)}const v=MR.createOfSorted(e,C=>C.originalRange.endLineNumberExclusive,Ul);return _=_.filter(C=>{const w=v.findLastItemBeforeOrEqual(C.original.startLineNumber)||new ho(new mt(1,1),new mt(1,1),[]),S=C.modified.startLineNumber-w.modifiedRange.endLineNumberExclusive,k=C.original.startLineNumber-w.originalRange.endLineNumberExclusive;return S!==k}),_.map(C=>{const w=this.refineDiff(t,i,new Bs(C.original.toOffsetRange(),C.modified.toOffsetRange()),r,a),S=wP(w.mappings,t,i,!0);return new Eb(C,S)})}refineDiff(e,t,i,n,s){const r=new LP(e,i.seq1Range,s),a=new LP(t,i.seq2Range,s),l=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,n):this.myersDiffingAlgorithm.compute(r,a,n);let d=l.diffs;return d=pP(r,a,d),d=BK(r,a,d),d=EK(r,a,d),d=NK(r,a,d),{mappings:d.map(h=>new Ic(r.translateRange(h.seq1Range),a.translateRange(h.seq2Range))),hitTimeout:l.hitTimeout}}}class MR{static createOfSorted(e,t,i){return new MR(e,t,i)}constructor(e,t,i){this._items=e,this._itemToDomain=t,this._domainComparator=i,this._currentIdx=0,this._lastValue=void 0,this._hasLastValue=!1}findLastItemBeforeOrEqual(e){if(this._hasLastValue&&gu.isLessThan(this._domainComparator(e,this._lastValue)))throw new Mi;for(this._lastValue=e,this._hasLastValue=!0;this._currentIdx<this._items.length&&gu.isLessThanOrEqual(this._domainComparator(this._itemToDomain(this._items[this._currentIdx]),e));)this._currentIdx++;return this._currentIdx===0?void 0:this._items[this._currentIdx-1]}}function FK(o,e){const t=[];let i=0,n=0;for(;i<o.length&&n<e.length;){const s=o[i],r=e[n],a=s.intersect(r);a&&!a.isEmpty&&t.push(a),s.endLineNumberExclusive<r.endLineNumberExclusive?i++:n++}return t}class bP{constructor(){this._normalizedRanges=[]}addRange(e){const t=CP(this._normalizedRanges.findIndex(n=>n.endLineNumberExclusive>=e.startLineNumber),this._normalizedRanges.length),i=qx(this._normalizedRanges,n=>n.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const n=this._normalizedRanges[t];this._normalizedRanges[t]=n.join(e)}else{const n=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,n)}}subtractFrom(e){const t=CP(this._normalizedRanges.findIndex(r=>r.endLineNumberExclusive>=e.startLineNumber),this._normalizedRanges.length),i=qx(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return[e];const n=[];let s=e.startLineNumber;for(let r=t;r<i;r++){const a=this._normalizedRanges[r];a.startLineNumber>s&&n.push(new mt(s,a.startLineNumber)),s=a.endLineNumberExclusive}return s<e.endLineNumberExclusive&&n.push(new mt(s,e.endLineNumberExclusive)),n}}function CP(o,e){return o===-1?e:o}function BK(o,e,t){const i=[];let n;function s(){if(!n)return;const a=n.s1Range.length-n.deleted;n.s2Range.length-n.added,Math.max(n.deleted,n.added)+(n.count-1)>a&&i.push(new Bs(n.s1Range,n.s2Range)),n=void 0}for(const a of t){let l=function(g,f){var p,_,v,b;if(!n||!n.s1Range.containsRange(g)||!n.s2Range.containsRange(f))if(n&&!(n.s1Range.endExclusive<g.start&&n.s2Range.endExclusive<f.start)){const S=dt.tryCreate(n.s1Range.endExclusive,g.start),k=dt.tryCreate(n.s2Range.endExclusive,f.start);n.deleted+=(p=S?.length)!==null&&p!==void 0?p:0,n.added+=(_=k?.length)!==null&&_!==void 0?_:0,n.s1Range=n.s1Range.join(g),n.s2Range=n.s2Range.join(f)}else s(),n={added:0,deleted:0,count:0,s1Range:g,s2Range:f};const C=g.intersect(a.seq1Range),w=f.intersect(a.seq2Range);n.count++,n.deleted+=(v=C?.length)!==null&&v!==void 0?v:0,n.added+=(b=w?.length)!==null&&b!==void 0?b:0};const d=o.findWordContaining(a.seq1Range.start-1),c=e.findWordContaining(a.seq2Range.start-1),h=o.findWordContaining(a.seq1Range.endExclusive),u=e.findWordContaining(a.seq2Range.endExclusive);d&&h&&c&&u&&d.equals(h)&&c.equals(u)?l(d,c):(d&&c&&l(d,c),h&&u&&l(h,u))}return s(),WK(t,i)}function WK(o,e){const t=[];for(;o.length>0||e.length>0;){const i=o[0],n=e[0];let s;i&&(!n||i.seq1Range.start<n.seq1Range.start)?s=o.shift():s=e.shift(),t.length>0&&t[t.length-1].seq1Range.endExclusive>=s.seq1Ran
`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function yP(o){let e=0;for(;e<o.length&&(o.charCodeAt(e)===32||o.charCodeAt(e)===9);)e++;return e}class LP{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLineMinusOne=[],this.additionalOffsetByLine=[];let n=!1;t.start>0&&t.endExclusive>=e.length&&(t=new dt(t.start-1,t.endExclusive),n=!0),this.lineRange=t;for(let s=this.lineRange.start;s<this.lineRange.endExclusive;s++){let r=e[s],a=0;if(n)a=r.length,r="",n=!1;else if(!i){const l=r.trimStart();a=r.length-l.length,r=l.trimEnd()}this.additionalOffsetByLine.push(a);for(let l=0;l<r.length;l++)this.elements.push(r.charCodeAt(l));s<e.length-1&&(this.elements.push(`
`.charCodeAt(0)),this.firstCharOffsetByLineMinusOne[s-this.lineRange.start]=this.elements.length)}this.additionalOffsetByLine.push(0)}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new dt(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(t=>String.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=xP(e>0?this.elements[e-1]:-1),i=xP(e<this.elements.length?this.elements[e]:-1);if(t===6&&i===7)return 0;let n=0;return t!==i&&(n+=10,i===1&&(n+=1)),n+=DP(t),n+=DP(i),n}translateOffset(e){if(this.lineRange.isEmpty)return new W(this.lineRange.start+1,1);let t=0,i=this.firstCharOffsetByLineMinusOne.length;for(;t<i;){const s=Math.floor((t+i)/2);this.firstCharOffsetByLineMinusOne[s]>e?i=s:t=s+1}const n=t===0?0:this.firstCharOffsetByLineMinusOne[t-1];return new W(this.lineRange.start+t+1,e-n+1+this.additionalOffsetByLine[t])}translateRange(e){return D.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!nD(this.elements[e]))return;let t=e;for(;t>0&&nD(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&nD(this.elements[i]);)i++;return new dt(t,i)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,t){return this.elements[e]===this.elements[t]}extendToFullLines(e){var t,i;const n=(t=UK(this.firstCharOffsetByLineMinusOne,r=>r<=e.start))!==null&&t!==void 0?t:0,s=(i=jK(this.firstCharOffsetByLineMinusOne,r=>e.endExclusive<=r))!==null&&i!==void 0?i:this.elements.length;return new dt(n,s)}}function zK(o,e){let t=0,i=o.length;for(;t<i;){const n=Math.floor((t+i)/2);e(o[n])?t=n+1:i=n}return t-1}function UK(o,e){const t=zK(o,e);return t===-1?void 0:o[t]}function $K(o,e){let t=0,i=o.length;for(;t<i;){const n=Math.floor((t+i)/2);e(o[n])?i=n:t=n+1}return t}function jK(o,e){const t=$K(o,e);return t===o.length?void 0:o[t]}function nD(o){return o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57}const KK={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function DP(o){return KK[o]}function xP(o){return o===10?7:o===13?6:qK(o)?5:o>=97&&o<=122?0:o>=65&&o<=90?1:o>=48&&o<=57?2:o===-1?3:4}function qK(o){return o===32||o===9}const sD=new Map;function kP(o){let e=sD.get(o);return e===void 0&&(e=sD.size,sD.set(o,e)),e}class IP{constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let n=0;for(let s=e.startLineNumber-1;s<e.endLineNumberExclusive-1;s++){const r=t[s];for(let l=0;l<r.length;l++){n++;const d=r[l],c=kP(d);this.histogram[c]=(this.histogram[c]||0)+1}n++;const a=kP(`
`);this.histogram[a]=(this.histogram[a]||0)+1}this.totalCount=n}computeSimilarity(e){var t,i;let n=0;const s=Math.max(this.histogram.length,e.histogram.length);for(let r=0;r<s;r++)n+=Math.abs(((t=this.histogram[r])!==null&&t!==void 0?t:0)-((i=e.histogram[r])!==null&&i!==void 0?i:0));return 1-n/(this.totalCount+e.totalCount)}}const EP={getLegacy:()=>new yK,getAdvanced:()=>new r7};function rc(o,e){const t=Math.pow(10,e);return Math.round(o*t)/t}class st{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=rc(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class er{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=rc(Math.max(Math.min(1,t),0),3),this.l=rc(Math.max(Math.min(1,i),0),3),this.a=rc(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,s=e.a,r=Math.max(t,i,n),a=Math.min(t,i,n);let l=0,d=0;const c=(a+r)/2,h=r-a;if(h>0){switch(d=Math.min(c<=.5?h/(2*c):h/(2-2*c),1),r){case t:l=(i-n)/h+(i<n?6:0);break;case i:l=(n-t)/h+2;break;case n:l=(t-i)/h+4;break}l*=60,l=Math.round(l)}return new er(l,d,c,s)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:n,a:s}=e;let r,a,l;if(i===0)r=a=l=n;else{const d=n<.5?n*(1+i):n+i-n*i,c=2*n-d;r=er._hue2rgb(c,d,t+1/3),a=er._hue2rgb(c,d,t),l=er._hue2rgb(c,d,t-1/3)}return new st(Math.round(r*255),Math.round(a*255),Math.round(l*255),s)}}class Ma{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=rc(Math.max(Math.min(1,t),0),3),this.v=rc(Math.max(Math.min(1,i),0),3),this.a=rc(Math.max(Math.min(1,n),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,n=e.b/255,s=Math.max(t,i,n),r=Math.min(t,i,n),a=s-r,l=s===0?0:a/s;let d;return a===0?d=0:s===t?d=((i-n)/a%6+6)%6:s===i?d=(n-t)/a+2:d=(t-i)/a+4,new Ma(Math.round(d*60),l,s,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:s}=e,r=n*i,a=r*(1-Math.abs(t/60%2-1)),l=n-r;let[d,c,h]=[0,0,0];return t<60?(d=r,c=a):t<120?(d=a,c=r):t<180?(c=r,h=a):t<240?(c=a,h=r):t<300?(d=a,h=r):t<=360&&(d=r,h=a),d=Math.round((d+l)*255),c=Math.round((c+l)*255),h=Math.round((h+l)*255),new st(d,c,h,s)}}class z{static fromHex(e){return z.Format.CSS.parseHex(e)||z.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:er.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Ma.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof st)this.rgba=e;else if(e instanceof er)this._hsla=e,this.rgba=er.toRGBA(e);else if(e instanceof Ma)this._hsva=e,this.rgba=Ma.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&st.equals(this.rgba,e.rgba)&&er.equals(this.hsla,e.hsla)&&Ma.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=z._relativeLuminanceForComponent(this.rgba.r),t=z._relativeLuminanceForComponent(this.rgba.g),i=z._relativeLuminanceForComponent(this.rgba.b),n=.2126*e+.7152*t+.0722*i;return rc(n,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t<i}lighten(e){return new z(new er(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new z(new er(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:i,b:n,a:s}=this.rgba;return new z(new st(t,i,n,s*e))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new z(new st(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,t
`:e,l=a.length;let d=i.embeddedLanguageData,c=i.stack,h=0,u=null,g=!0;for(;g||h<l;){const f=h,p=c.depth,_=u?u.groups.length:0,v=c.state;let b=null,C=null,w=null,S=null,k=null;if(u){b=u.matches;const I=u.groups.shift();C=I.matched,w=I.action,S=u.rule,u.groups.length===0&&(u=null)}else{if(!g&&h>=l)break;g=!1;let I=this._lexer.tokenizer[v];if(!I&&(I=S0(this._lexer,v),!I))throw Ut(this._lexer,"tokenizer state is not defined: "+v);const M=a.substr(h);for(const P of I)if((h===0||!P.matchOnlyAtLineStart)&&(b=M.match(P.regex),b)){C=b[0],w=P.action;break}}if(b||(b=[""],C=""),w||(h<l&&(b=[a.charAt(h)],C=b[0]),w=this._lexer.defaultToken),C===null)break;for(h+=C.length;Sq(w)&&FP(w)&&w.test;)w=w.test(C,b,v,h===l);let L=null;if(typeof w=="string"||Array.isArray(w))L=w;else if(w.group)L=w.group;else if(w.token!==null&&w.token!==void 0){if(w.tokenSubst?L=Vd(this._lexer,w.token,C,b,v):L=w.token,w.nextEmbedded)if(w.nextEmbedded==="@pop"){if(!d)throw Ut(this._lexer,"cannot pop embedded language if not inside one");d=null}else{if(d)throw Ut(this._lexer,"cannot enter embedded language from within an embedded language");k=Vd(this._lexer,w.nextEmbedded,C,b,v)}if(w.goBack&&(h=Math.max(0,h-w.goBack)),w.switchTo&&typeof w.switchTo=="string"){let I=Vd(this._lexer,w.switchTo,C,b,v);if(I[0]==="@"&&(I=I.substr(1)),S0(this._lexer,I))c=c.switchTo(I);else throw Ut(this._lexer,"trying to switch to a state '"+I+"' that is undefined in rule: "+this._safeRuleName(S))}else{if(w.transform&&typeof w.transform=="function")throw Ut(this._lexer,"action.transform not supported");if(w.next)if(w.next==="@push"){if(c.depth>=this._lexer.maxStack)throw Ut(this._lexer,"maximum tokenizer stack size reached: ["+c.state+","+c.parent.state+",...]");c=c.push(v)}else if(w.next==="@pop"){if(c.depth<=1)throw Ut(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));c=c.pop()}else if(w.next==="@popall")c=c.popall();else{let I=Vd(this._lexer,w.next,C,b,v);if(I[0]==="@"&&(I=I.substr(1)),S0(this._lexer,I))c=c.push(I);else throw Ut(this._lexer,"trying to set a next state '"+I+"' that is undefined in rule: "+this._safeRuleName(S))}}w.log&&typeof w.log=="string"&&yq(this._lexer,this._lexer.languageId+": "+Vd(this._lexer,w.log,C,b,v))}if(L===null)throw Ut(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const x=I=>{const M=this._languageService.getLanguageIdByLanguageName(I)||this._languageService.getLanguageIdByMimeType(I)||I,P=this._getNestedEmbeddedLanguageData(M);if(h<l){const F=e.substr(h);return this._nestedTokenize(F,t,Hd.create(c,P),n+h,s)}else return Hd.create(c,P)};if(Array.isArray(L)){if(u&&u.groups.length>0)throw Ut(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(b.length!==L.length+1)throw Ut(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let I=0;for(let M=1;M<b.length;M++)I+=b[M].length;if(I!==C.length)throw Ut(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(S));u={rule:S,matches:b,groups:[]};for(let M=0;M<L.length;M++)u.groups[M]={action:L[M],matched:b[M+1]};h-=C.length;continue}else{if(L==="@rematch"&&(h-=C.length,C="",b=null,L="",k!==null))return x(k);if(C.length===0){if(l===0||p!==c.depth||v!==c.state||(u?u.groups.length:0)!==_)continue;throw Ut(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(S))}let I=null;if(p7(L)&&L.indexOf("@brackets")===0){const M=L.substr(9),P=Iq(this._lexer,C);if(!P)throw Ut(this._lexer,"@brackets token returned but no bracket defined as: "+C);I=BP(P.token+M)}else{const M=L===""?"":L+this._lexer.tokenPostfix;I=BP(M)}f<r&&s.emit(f+n,I)}if(k!==null)return x(k)}return Hd.create(c,d)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new ef(e,im);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),ei.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=ei.get(e);return t?new ef(e,t.getInitialState()):new ef(e,im)}};rv=oI=Dq([xq(4,ot)],rv);function Iq(o,e){if(!e)ret
`+zi),_n&&(zi=xr(zi,P," "),zi=xr(zi,F," "),zi=xr(zi,O," ")),C&&wo?C.createHTML(zi):zi},e.setConfig=function(Xe){Lr(Xe),qo=!0},e.clearConfig=function(){Oi=null,qo=!1},e.isValidAttribute=function(Xe,G,we){Oi||Lr({});const Pe=St(Xe),gi=St(G);return SA(Pe,gi,we)},e.addHook=function(Xe,G){typeof G=="function"&&(M[Xe]=M[Xe]||[],bp(M[Xe],G))},e.removeHook=function(Xe){if(M[Xe])return zP(M[Xe])},e.removeHooks=function(Xe){M[Xe]&&(M[Xe]=[])},e.removeAllHooks=function(){M={}},e}var dl=w7();dl.version;dl.isSupported;const S7=dl.sanitize;dl.setConfig;dl.clearConfig;dl.isValidAttribute;const y7=dl.addHook,L7=dl.removeHook;dl.removeHooks;dl.removeAllHooks;var qe;(function(o){o.inMemory="inmemory",o.vscode="vscode",o.internal="private",o.walkThrough="walkThrough",o.walkThroughSnippet="walkThroughSnippet",o.http="http",o.https="https",o.file="file",o.mailto="mailto",o.untitled="untitled",o.data="data",o.command="command",o.vscodeRemote="vscode-remote",o.vscodeRemoteResource="vscode-remote-resource",o.vscodeManagedRemoteResource="vscode-managed-remote-resource",o.vscodeUserData="vscode-userdata",o.vscodeCustomEditor="vscode-custom-editor",o.vscodeNotebookCell="vscode-notebook-cell",o.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",o.vscodeNotebookCellOutput="vscode-notebook-cell-output",o.vscodeInteractiveInput="vscode-interactive-input",o.vscodeSettings="vscode-settings",o.vscodeWorkspaceTrust="vscode-workspace-trust",o.vscodeTerminal="vscode-terminal",o.vscodeChatSesssion="vscode-chat-editor",o.webviewPanel="webview-panel",o.vscodeWebview="vscode-webview",o.extension="extension",o.vscodeFileResource="vscode-file",o.tmp="tmp",o.vsls="vsls",o.vscodeSourceControl="vscode-scm"})(qe||(qe={}));const aG="tkn";class lG{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${qe.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return Ve(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const n=this._ports[t],s=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof s=="string"&&(r+=`&${aG}=${encodeURIComponent(s)}`),Ie.from({scheme:Gc?this._preferredWebSchema:qe.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:r})}}const D7=new lG;class av{uriToBrowserUri(e){return e.scheme===qe.vscodeRemote?D7.rewrite(e):e.scheme===qe.file&&(qr||Ez&&ar.origin===`${qe.vscodeFileResource}://${av.FALLBACK_AUTHORITY}`)?e.with({scheme:qe.vscodeFileResource,authority:e.authority||av.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}av.FALLBACK_AUTHORITY="vscode-app";const x7=new av;var GP;(function(o){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);o.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(s){let r;typeof s=="string"?r=new URL(s).searchParams:s instanceof URL?r=s.searchParams:Ie.isUri(s)&&(r=new URL(s.toString(!0)).searchParams);const a=r?.get(t);if(a)return e.get(a)}o.getHeadersFromQuery=i;function n(s,r,a){if(!globalThis.crossOriginIsolated)return;const l=r&&a?"3":a?"2":"1";s instanceof URLSearchParams?s.set(t,l):s[t]=l}o.addSearchParam=n})(GP||(GP={}));function Gi(o){for(;o.firstChild;)o.firstChild.remove()}function HR(o){var e;return(e=o?.isConnected)!==null&&e!==void 0?e:!1}class dG{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function $(o,e,t,i){return new dG(o,e,t,i)}function k7(o){return function(e){return o(new No(e))}}function cG(o){return function(e){return o(new Vt
`)}}const YS=new ZG;si.add(H7.ColorContribution,YS);function N(o,e,t,i,n){return YS.registerColor(o,e,t,i,n)}const ne=N("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},m("foreground","Overall foreground color. This color is only used if not overridden by a component."));N("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},m("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const YG=N("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},m("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));N("descriptionForeground",{light:"#717171",dark:Se(ne,.7),hcDark:Se(ne,.7),hcLight:Se(ne,.7)},m("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const qd=N("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},m("iconForeground","The default color for icons in the workbench.")),no=N("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},m("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),it=N("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},m("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),$t=N("contrastActiveBorder",{light:null,dark:null,hcDark:no,hcLight:no},m("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));N("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},m("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."));N("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:z.black,hcLight:"#292929"},m("textSeparatorForeground","Color for text separators."));const XG=N("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkForeground","Foreground color for links in text."));N("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));N("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},m("textPreformatForeground","Foreground color for preformatted text segments."));N("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},m("textBlockQuoteBackground","Background color for block quotes in text."));N("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:z.white,hcLight:"#292929"},m("textBlockQuoteBorder","Border color for block quotes in text."));N("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:z.black,hcLight:"#F2F2F2"},m("textCodeBlockBackground","Background color for code blocks in text."));const Aa=N("widget.shadow",{dark:Se(z.black,.36),light:Se(z.black,.16),hcDark:null,hcLight:null},m("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),KR=N("widget.border",{dark:null,light:null,hcDark:it,hcLight:it},m("widgetBorder","Border color of widgets such as find/replace inside the editor.")),z7=N("input.background",{dark:"#3C3C3C",light:z.white,hcDark:z.black,hcLight:z.white},m("inputBoxBackground","Input box background.")),U7=N("input.foreground",{dark:ne,light:ne,hcDark:ne,hcLight:ne},m("inputBoxForeground","Input box foreground.")),$7=N("input.border",{dark:null,light:null,hcDark:it,hcLight:it},m("inputBoxBorder","Input box border.")),qR=N("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:it,hcLight:it},m("inputBoxActiveOptionBorder","Border color of activated options in input fields."));N("inputOption.hoverBackground",{dark:"#5a5d
${a}: ${r};`}return i+=`
}`,i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function EY(o){return o.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class Mb extends H{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,n=e.length;i<n;i++){const s=e[i];switch(s.type){case 0:this.onCompositionStart(s)&&(t=!0);break;case 1:this.onCompositionEnd(s)&&(t=!0);break;case 2:this.onConfigurationChanged(s)&&(t=!0);break;case 3:this.onCursorStateChanged(s)&&(t=!0);break;case 4:this.onDecorationsChanged(s)&&(t=!0);break;case 5:this.onFlushed(s)&&(t=!0);break;case 6:this.onFocusChanged(s)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(s)&&(t=!0);break;case 8:this.onLineMappingChanged(s)&&(t=!0);break;case 9:this.onLinesChanged(s)&&(t=!0);break;case 10:this.onLinesDeleted(s)&&(t=!0);break;case 11:this.onLinesInserted(s)&&(t=!0);break;case 12:this.onRevealRangeRequest(s)&&(t=!0);break;case 13:this.onScrollChanged(s)&&(t=!0);break;case 15:this.onTokensChanged(s)&&(t=!0);break;case 14:this.onThemeChanged(s)&&(t=!0);break;case 16:this.onTokensColorsChanged(s)&&(t=!0);break;case 17:this.onZonesChanged(s)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(s)}}t&&(this._shouldRender=!0)}}class zs extends Mb{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class Qa{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){const i=[];let n=0;for(;e&&e!==document.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[n++]=this.read(e)),e=e.parentElement;const s=new Uint8Array(n);for(let r=0;r<n;r++)s[r]=i[n-r-1];return s}}class TY{constructor(e,t){this._restrictedRenderingContextBrand=void 0,this._viewLayout=e,this.viewportData=t,this.scrollWidth=this._viewLayout.getScrollWidth(),this.scrollHeight=this._viewLayout.getScrollHeight(),this.visibleRange=this.viewportData.visibleRange,this.bigNumbersDelta=this.viewportData.bigNumbersDelta;const i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class NY extends TY{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class RY{constructor(e,t,i,n){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=n}}class JS{static from(e){const t=new Array(e.length);for(let i=0,n=e.length;i<n;i++){const s=e[i];t[i]=new JS(s.left,s.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class iu
target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?Fi.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return Kn.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return Kn.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return Kn.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return Kn.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return Kn.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return Kn.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return Kn.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return Kn.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return Kn.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new e2(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const gO={isAfterLines:!0};function _D(o){return{isAfterLines:!1,horizontalDistanceToText:o}}class bn{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=Qa.collect(t,this._viewHelper.viewDomNode);return!!(js.isChildOfContentWidgets(i)||js.isChildOfOverflowingContentWidgets(i)||js.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,n,s){const r=new dm(this._context,this._viewHelper,e),a=new e2(r,t,i,n,s);try{const l=bn._createMouseTarget(r,a,!1);if(l.type===6&&r.stickyTabStops&&l.position!==null){const d=bn._snapToSoftTabBoundary(l.position,r.viewModel),c=D.fromPositions(d,d).plusRange(l.range);return a.fulfillContentText(d,c,l.detail)}return l}catch{return a.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(t.target===null){if(i)return t.fulfillUnknown();const r=bn._doHitTest(e,t);return r.type===1?bn.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}const n=t;let s=null;return!js.isChildOfOverflowGuard(t.targetPath)&&!js.isChildOfOverflowingContentWidgets(t.targetPath)&&(s=s||t.fulfillUnknown()),s=s||bn._hitTestContentWidget(e,n),s=s||bn._hitTestOverlayWidget(e,n),s=s||bn._hitTestMinimap(e,n),s=s||bn._hitTestScrollbarSlider(e,n),s=s||bn._hitTestViewZone(e,n),s=s||bn._hitTestMargin(e,n),s=s||bn._hitTestViewCursor(e,n),s=s||bn._hitTestTextArea(e,n),s=s||bn._hitTestViewLines(e,n,i),s=s||bn._hitTestScrollbar(e,n),s||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(js.isChildOfContentWidgets(t.targetPath)||js.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(js.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,s=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<=s&&s<=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 js.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText
`,s+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(pu(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(T1(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-s);const r=t.value.substring(n,t.value.length-s),a=e.selectionStart-n,l=e.selectionEnd-n,d=t.selectionStart-n,c=t.selectionEnd-n;if(d===c){const u=e.selectionStart-n;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=l-a;return{text:r,replacePrevCharCnt:h,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(pu(e.value,t.value),e.selectionEnd),n=Math.min(T1(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),r=t.value.substring(i,t.value.length-n);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-r.length}}}ln.EMPTY=new ln("",0,0,null,void 0);class df{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,n=i+1,s=i+t;return new D(n,1,s+1,1)}static fromEditorSelection(e,t,i,n){const r=df._getPageOfLine(t.startLineNumber,i),a=df._getRangeForPage(r,i),l=df._getPageOfLine(t.endLineNumber,i),d=df._getRangeForPage(l,i);let c=a.intersectRanges(new D(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(c,1)>500){const v=e.modifyPosition(c.getEndPosition(),-500);c=D.fromPositions(v,c.getEndPosition())}const h=e.getValueInRange(c,1),u=e.getLineCount(),g=e.getLineMaxColumn(u);let f=d.intersectRanges(new D(t.endLineNumber,t.endColumn,u,g));if(n&&e.getValueLengthInRange(f,1)>500){const v=e.modifyPosition(f.getStartPosition(),500);f=D.fromPositions(f.getStartPosition(),v)}const p=e.getValueInRange(f,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=d.intersectRanges(t);_=e.getValueInRange(v,1)+String.fromCharCode(8230)+e.getValueInRange(b,1)}return n&&_.length>2*500&&(_=_.substring(0,500)+String.fromCharCode(8230)+_.substring(_.length-500,_.length)),new ln(h+_+p,h.length,h.length+_.length,t,c.endLineNumber-c.startLineNumber)}}var X1;(function(o){o.Tap="-monaco-textarea-synthetic-tap"})(X1||(X1={}));const _I={forceCopyWithSyntaxHighlighting:!1};class mv{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)}}mv.INSTANCE=new mv;class iX{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 nX extends H{get textAreaState(){return this._textAreaState}constructor(e,t,i,n){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._onFocus=this._register(new B),this.onFocus=this._onFocus.event,this._onBlur=this._register(new B),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new B),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new B),this.onCut=this._onCut.event,this._onPaste=this._register(new B),this.onPaste=this._onPaste.event,this._onType=this._register(new B),this.onType=this._onType.event,this._onCompositionStart=this._register(new B),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new B),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new B),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new B),this.onSelectionChang
`):t.text,i),e.preventDefault(),e.clipboardData&&vI.setTextData(e.clipboardData,t.text,t.html,i)}}const vI={getTextData(o){const e=o.getData(vi.text);let t=null;const i=o.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&o.files.length>0?[Array.prototype.slice.call(o.files,0).map(s=>s.name).join(`
`),null]:[e,t]},setTextData(o,e,t,i){o.setData(vi.text,e),typeof t=="string"&&o.setData("text/html",t),o.setData("vscode-editor-data",JSON.stringify(i))}};class sX extends H{constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Je(this._actual,"keydown")).event,this.onKeyUp=this._register(new Je(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Je(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Je(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Je(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Je(this._actual,"beforeinput")).event,this.onInput=this._register(new Je(this._actual,"input")).event,this.onCut=this._register(new Je(this._actual,"cut")).event,this.onCopy=this._register(new Je(this._actual,"copy")).event,this.onPaste=this._register(new Je(this._actual,"paste")).event,this.onFocus=this._register(new Je(this._actual,"focus")).event,this.onBlur=this._register(new Je(this._actual,"blur")).event,this._onSyntheticTap=this._register(new B),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>Zd.onKeyDown())),this._register(this.onBeforeInput(()=>Zd.onBeforeInput())),this._register(this.onInput(()=>Zd.onInput())),this._register(this.onKeyUp(()=>Zd.onKeyUp())),this._register($(this._actual,X1.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Cu(this._actual);return e?e.activeElement===this._actual:HR(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 s=null;const r=Cu(n);r?s=r.activeElement:s=document.activeElement;const a=s===n,l=n.selectionStart,d=n.selectionEnd;if(a&&l===t&&d===i){Fo&&window.parent!==window&&n.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),Fo&&window.parent!==window&&n.focus();return}try{const c=vG(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),bG(n,c)}catch{}}}class oX extends n2{constructor(e,t,i){super(e,t,i),this._register(Rt.addTarget(this.viewHelper.linesContentDomNode)),this._register($(this.viewHelper.linesContentDomNode,Mt.Tap,s=>this.onTap(s))),this._register($(this.viewHelper.linesContentDomNode,Mt.Change,s=>this.onChange(s))),this._register($(this.viewHelper.linesContentDomNode,Mt.Contextmenu,s=>this._onContextMenu(new Nc(s,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register($(this.viewHelper.linesContentDomNode,"pointerdown",s=>{const r=s.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new xY(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,s=>this._onMouseMove(s))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,(s,r)=>this._onMouseDown(s,r)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Nc(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,
`),C=v.substring(b+1),w=C.lastIndexOf(" "),S=C.length-w-1,k=g.getStartPosition(),L=Math.min(k.column-1,S),x=k.column-1-L,I=C.substring(0,C.length-L),{tabSize:M}=this._context.viewModel.model.getOptions(),P=KX(I,this._fontInfo,M);return{distanceToModelLineStart:x,widthOfHiddenTextBefore:P}})(),{distanceToModelLineEnd:_}=(()=>{const v=u.value.substring(Math.max(u.selectionStart,u.selectionEnd)),b=v.indexOf(`
`),C=b===-1?v:v.substring(0,b),w=C.indexOf(" "),S=w===-1?C.length:C.length-w-1,k=g.getEndPosition(),L=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,S);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-L}})();this._context.viewModel.revealRange("keyboard",!0,D.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new jX(this._context,g.startLineNumber,f,p,_),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${nu} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(h=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${nu}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(b_.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=Bo(t);let s=!0,r=e.column,a=!0,l=e.column,d=0;for(;d<50&&(s||a);){if(s&&r<=1&&(s=!1),s){const c=i.charCodeAt(r-2);n.get(c)!==0?s=!1:r--}if(a&&l>i.length&&(a=!1),a){const c=i.charCodeAt(l-1);n.get(c)!==0?a=!1:l++}d++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Bo(this._context.configuration.options.get(128));let n=e.column,s=0;for(;n>1;){const r=t.charCodeAt(n-2);if(i.get(r)!==0||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!$i(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,n;if(e.get(2)===1){const r=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(n=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||n===void 0?void 0:n.getAriaLabel(),d=m("accessibilityModeOff","The editor is not accessible at this time.");return r?m("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",d,r):a?m("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",d,a):l?m("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",d,l):d}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===mr.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const n=e.get(142).wrappingColumn;if(n!==-1&&this._accessibilitySupport!==1){const s=e.get(49);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(n*s.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=bD?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(142);this._setAccessibilityOptio
`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:bD?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;qi(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?z.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(56)?i.setClassName("monaco-editor-background textAreaCover "+Su.OUTER_CLASS_NAME):n.get(66).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+Fb.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};bI=UX([$X(3,Tt)],bI);function KX(o,e,t){if(o.length===0)return 0;const i=document.createElement("div");i.style.position="absolute",i.style.top="-50000px",i.style.width="50000px";const n=document.createElement("span");qi(n,e),n.style.whiteSpace="pre",n.style.tabSize=`${t*e.spaceWidth}px`,n.append(o),i.appendChild(n),document.body.appendChild(i);const s=n.offsetWidth;return document.body.removeChild(i),s}function qX(o,e,t){let i=0;for(let s=0;s<o.length;s++)o.charAt(s)===" "?i=Fi.nextIndentTabStop(i,e):i++;let n="";if(!t){const s=Math.floor(i/e);i=i%e;for(let r=0;r<s;r++)n+=" "}for(let s=0;s<i;s++)n+=" ";return n}function J1(o,e,t){let i=Zn(o);return i===-1&&(i=o.length),qX(o.substring(0,i),e,t)+o.substring(i)}const GX=()=>!0,ZX=()=>!1,YX=o=>o===" "||o===" ";class Lg{static shouldRecreate(e){return e.hasChanged(142)||e.hasChanged(128)||e.hasChanged(36)||e.hasChanged(75)||e.hasChanged(77)||e.hasChanged(78)||e.hasChanged(6)||e.hasChanged(10)||e.hasChanged(8)||e.hasChanged(9)||e.hasChanged(13)||e.hasChanged(126)||e.hasChanged(49)||e.hasChanged(89)}constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,r=s.get(142),a=s.get(49);this.readOnly=s.get(89),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(114),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=s.get(126),this.wordSeparators=s.get(128),this.emptySelectionClipboard=s.get(36),this.copyWithSyntaxHighlighting=s.get(24),this.multiCursorMergeOverlapping=s.get(75),this.multiCursorPaste=s.get(77),this.multiCursorLimit=s.get(78),this.autoClosingBrackets=s.get(6),this.autoClosingQuotes=s.get(10),this.autoClosingDelete=s.get(8),this.autoClosingOvertype=s.get(9),this.autoSurround=s.get(13),this.autoIndent=s.get(11),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const l=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(l)for(const d of l)this.surroundingPairs[d.open]=d.close}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=OS(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return s?s.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return J1(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return YX;case"languageDefined":return t
* '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}}}}]},o.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"},o.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case o.RawDirection.Left:n=0;break;case o.RawDirection.Right:n=1;break;case o.RawDirection.Up:n=2;break;case o.RawDirection.Down:n=3;break;case o.RawDirection.PrevBlankLine:n=4;break;case o.RawDirection.NextBlankLine:n=5;break;case o.RawDirection.WrappedLineStart:n=6;break;case o.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case o.RawDirection.WrappedLineColumnCenter:n=8;break;case o.RawDirection.WrappedLineEnd:n=9;break;case o.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case o.RawDirection.ViewPortTop:n=11;break;case o.RawDirection.ViewPortBottom:n=13;break;case o.RawDirection.ViewPortCenter:n=12;break;case o.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let s=0;switch(i.by){case o.RawUnit.Line:s=1;break;case o.RawUnit.WrappedLine:s=2;break;case o.RawUnit.Character:s=3;break;case o.RawUnit.HalfLine:s=4;break}return{direction:n,unit:s,select:!!i.select,value:i.value||1}}o.parse=t})(ew||(ew={}));function Af(o,e,t,i){const n=kf(e,t.startLineNumber,t.startColumn),s=i.getLanguageConfiguration(n.languageId);if(!s)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=kf(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-n.firstCharOffset);let d="";if(t.startLineNumber>1&&n.firstCharOffset===0){const p=kf(e,t.startLineNumber-1);p.languageId===n.languageId&&(d=p.getLineContent())}const c=s.onEnter(o,d,a,l);if(!c)return null;const h=c.indentAction;let u=c.appendText;const g=c.removeText||0;u?h===ki.Indent&&(u=" "+u):h===ki.Indent||h===ki.IndentOutdent?u=" ":u="";let f=Y9(e,t.startLineNumber,t.startColumn);return g&&(f=f.substring(0,f.length-g)),{indentAction:h,appendText:u,removeText:g,indentation:f}}var eQ=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},tQ=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},QC;const wD=Object.create(null);function hh(o,e){if(e<=0)return"";wD[o]||(wD[o]=["",o]);const t=wD[o];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+o;return t[e]}let To=QC=class{static unshiftIndent(e,t,i,n,s){const r=Fi.visibleColumnFromColumn(e,t,i);if(s){const a=hh(" ",n),d=Fi.prevIndentTabStop(r,n)/n;return hh(a,d)}else{const a=" ",d=Fi.prevRenderTabStop(r,i)/i;return hh(a,d)}}static shiftIndent(e,t,i,n,s){const r=Fi.visibleColumnFromColumn(e,t,i);if(s){const a=hh(" ",n),d=Fi.nextIndentTabStop(r,n)/n;return hh(a,d)}else{const a=" ",d=Fi.nextRenderTabStop(r,i)/i;return hh(a,d)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._select
`)!==n.length-1&&(s=!1),s){const h=new D(c.lineNumber,1,c.lineNumber,1);r[a]=new s2(h,n,d,!0)}else r[a]=new Cn(d,n)}return new ps(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,n,s){if(n||t.length===1)return null;if(s&&s.length===t.length)return s;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=Ya(i);if(r.length===t.length)return r}return null}static paste(e,t,i,n,s,r){const a=this._distributePasteToCursors(e,i,n,s,r);return a?(i=i.sort(D.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,s)}static _goodIndentForLine(e,t,i){let n=null,s="";const r=iy(e.autoIndent,t,i,!1,e.languageConfigurationService);if(r)n=r.action,s=r.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const c=t.getLineContent(a);if(Zr(c)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),d=Af(e.autoIndent,t,new D(a,l,a,l),e.languageConfigurationService);d&&(s=d.indentation+d.appendText)}return n&&(n===ki.Indent&&(s=Xt.shiftIndent(e,s)),n===ki.Outdent&&(s=Xt.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,d=l-a%l;for(let c=0;c<d;c++)s+=" "}else s=" ";return new Cn(i,s,n)}static tab(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++){const a=i[s];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let d=this._goodIndentForLine(e,t,a.startLineNumber);d=d||" ";const c=e.normalizeIndentation(d);if(!l.startsWith(c)){n[s]=new Cn(new D(a.startLineNumber,1,a.startLineNumber,l.length+1),c,!0);continue}}n[s]=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[s]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}n[s]=new To(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,s,r,a,l){const d=n.map(c=>this._compositionType(i,c,s,r,a,l));return new ps(4,d,{shouldPushStackElementBefore:A0(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-n),d=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+s),c=new D(a.lineNumber,l,a.lineNumber,d);return e.getValueInRange(c)===i&&r===0?null:new XC(c,i,0,r)}static _typeCommand(e,t,i){return i?new R0(e,t,!0):new Cn(e,t,!0)}static _enter(e,t,i,n){if(e.autoIndent===0)return Xt._typeCommand(n,`
`,i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),d=Et(l).substring(0,n.startColumn-1);return Xt._typeCommand(n,`
`+e.normalizeIndentation(d),i)}const s=Af(e.autoIndent,t,n,e.languageConfigurationService);if(s){if(s.indentAction===ki.None)return Xt._typeCommand(n,`
`+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===ki.Indent)return Xt._typeCommand(n,`
`+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===ki.IndentOutdent){const l=e.normalizeIndentation(s.indentation),d=e.normalizeIndentation(s.indentation+s.appendText),c=`
`+d+`
`+l;return i?new R0(n,c,!0):new XC(n,c,-1,d.length-l.length,!0)}else if(s.indentAction===ki.Outdent){const l=Xt.unshiftIndent(e,s.indentation);return Xt._typeCommand(n,`
`+e.normalizeIndentation(l+s.appendText),i)}}const r=t.getLineContent(n.startLineNumber),a=Et(r).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=oQ(e.autoIndent,t,n,{unshiftIndent:d=>Xt.unshiftIndent(e,d),shiftIndent:d=>Xt.shiftIndent(e,d),normalizeIndentation:d=>e.normalizeIndentation(d)},e.languageConfigurationService);if(l){let d=e.visibleColumnFromColumn(t,n.getEndPosition());const c=n.endColumn,h=t.getLineContent(n.endLineNumber),u=Zn(h);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 R0(n,`
`+e.normalizeIndentation(l.afterEnter),!0);{let g=0;return c<=u+1&&(e.insertSpaces||(d=Math.ceil(d/e.indentSize)),g=Math.min(d+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new XC(n,`
`+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return Xt._typeCommand(n,`
`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,s=i.length;n<s;n++)if(!t.tokenization.isCheapToTokenize(i[n].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const s=Y9(t,i.startLineNumber,i.startColumn),r=rQ(e.autoIndent,t,i,n,{shiftIndent:a=>Xt.shiftIndent(e,a),unshiftIndent:a=>Xt.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(s)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Xt._typeCommand(new D(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+n,!1):Xt._typeCommand(new D(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,s){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(s))return!1;for(let r=0,a=i.length;r<a;r++){const l=i[r];if(!l.isEmpty())return!1;const d=l.getPosition(),c=t.getLineContent(d.lineNumber);if(c.charAt(d.column-1)!==s)return!1;const u=Md(s);if((d.column>2?c.charCodeAt(d.column-2):0)===92&&u)return!1;if(e.autoClosingOvertype==="auto"){let f=!1;for(let p=0,_=n.length;p<_;p++){const v=n[p];if(d.lineNumber===v.startLineNumber&&d.column===v.startColumn){f=!0;break}}if(!f)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,s){const r=[];for(let a=0,l=n.length;a<l;a++){const c=n[a].getPosition(),h=new D(c.lineNumber,c.column,c.lineNumber,c.column+1);r[a]=new Cn(h,s)}return new ps(4,r,{shouldPushStackElementBefore:A0(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),n=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],s=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],r=n.some(l=>t.startsWith(l.open)),a=s.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,n){const s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!s)return null;let r=null;for(const a of s)if(r===null||a.open.length>r.open.length){let l=!0;for(const d of i)if(t.getValueInRange(new D(d.lineNumber,d.column-a.open.length+1,d.lineNumber,d.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 s=null;for(const r of n)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!s||r.open.length>s.open.length)&&(s=r);return s}static _getAutoClosingPairClose(e,t,i,n,s){const r=Md(n),a=r?e.autoClosingQuotes:e.autoClosingBrackets,l=r?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;if(a==="never")return null;for(const f of i)if(!f.isEmpty())return null;const d=i.map(f=>{const p=f.getPosition();return s?{lineNumber:p.lineNumber,beforeColumn:p.column-n.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),c=this._findAutoClosingPairOpen(e,t,d.map(f=>new W(f.lineNumber,f.beforeColumn)),n);if(!c)return null;const h=this._findContainedAutoClosingPair(e,c),u=h?h.close:"";let g=!0;for(const f of d){const{lineNumber:p,beforeColumn:_,afterColumn:v}=f,b=t.getLineContent(p),C=b.substring(0,_-1),w=b.substring(v-1);if(w.startsWith(u)||(g=!1),w.length>0){const x=w.charAt(0);if(!Xt._isBeforeClosingBrace(e,w)&&!l(x))return null}if(c.open.length===1&&(n==="'"||n==='"')&&a!=="always"){const x=Bo(e.wordSeparators);if(C.length>0){const I=C.charCodeAt(C.length-1);if(x.get(I)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const S=t.tokenization.getLineTokens(p),k=OS(S,_-1);if(!c.shouldAutoClose(k,_-k.firstCharOffset))return null;const L=c.findNeutralCharacter();if(L){const x=t.tokenization.getTokenTypeIfInsertingCharacter(p,_,L);if(!c.isOK(x))return null}}return g?c.close.substring(0,c.close.length-u.length):c.close}static _runAutoClosingOpenCharType(e,t,i,n,s,r,a){const l=[];for(let d=0,c=n.len
`){const c=[];for(let h=0,u=s.length;h<u;h++)c[h]=Xt._enter(i,n,!1,s[h]);return new ps(4,c,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,n,s)){const c=[];let h=!1;for(let u=0,g=s.length;u<g;u++)if(c[u]=this._runAutoIndentType(i,n,s[u],a),!c[u]){h=!0;break}if(!h)return new ps(4,c,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,n,s,r,a))return this._runAutoClosingOvertype(t,i,n,s,a);if(!e){const c=this._getAutoClosingPairClose(i,n,s,a,!1);if(c)return this._runAutoClosingOpenCharType(t,i,n,s,a,!1,c)}if(!e&&this._isSurroundSelectionType(i,n,s,a))return this._runSurroundSelectionType(t,i,n,s,a);if(!e&&this._isTypeInterceptorElectricChar(i,n,s)){const c=this._typeInterceptorElectricChar(t,i,n,s[0],a);if(c)return c}const l=[];for(let c=0,h=s.length;c<h;c++)l[c]=new Cn(s[c],a);const d=SD(a,t);return new ps(d,l,{shouldPushStackElementBefore:A0(t,d),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,s){const r=[];for(let l=0,d=n.length;l<d;l++)r[l]=new Cn(n[l],s);const a=SD(s,e);return new ps(a,r,{shouldPushStackElementBefore:A0(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;s<r;s++){let a=i[s].positionLineNumber;if(a===1)n[s]=new R0(new D(1,1,1,1),`
`);else{a--;const l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new D(a,l,a,l))}}return n}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,r=i.length;s<r;s++){const a=i[s].positionLineNumber,l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new D(a,l,a,l))}return n}static lineBreakInsert(e,t,i){const n=[];for(let s=0,r=i.length;s<r;s++)n[s]=this._enter(e,t,!0,i[s]);return n}}class w8 extends XC{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 D(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new D(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}}class aQ{constructor(e,t,i,n,s,r){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=n,this.insertedSelectionStart=s,this.insertedSelectionEnd=r}}function SD(o,e){return o===" "?e===5||e===6?6:5:4}function A0(o,e){return vO(o)&&!vO(e)?!0:o===5?!1:_O(o)!==_O(e)}function _O(o){return o===6||o===5?"space":o}function vO(o){return o===4||o===5||o===6}var T;(function(o){o.editorSimpleInput=new de("editorSimpleInput",!1,!0),o.editorTextFocus=new de("editorTextFocus",!1,m("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),o.focus=new de("editorFocus",!1,m("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),o.textInputFocus=new de("textInputFocus",!1,m("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),o.readOnly=new de("editorReadonly",!1,m("editorReadonly","Whether the editor is read-only")),o.inDiffEditor=new de("inDiffEditor",!1,m("inDiffEditor","Whether the context is a diff editor")),o.isEmbeddedDiffEditor=new de("isEmbeddedDiffEditor",!1,m("isEmbeddedDiffEditor","Whether the context is an embedded diff editor")),o.comparingMovedCode=new de("comparingMovedCode",!1,m("comparingMovedCode","Whether a moved code block is selected for comparison")),o.accessibleDiffViewerVisible=new de("accessibleDiffViewerVisible",!1,m("accessibleDiffViewerVisible","Whether the accessible diff viewer is visible")),o.diffEditorRenderSideBySideInlineBreakpointReached=new de("diffEditorRenderSideBySideInlineBreakpointReached",!1,m("diffEditorRenderSideBySideInlineBreakpointReached","Whether the diff editor render side by side inline breakpoint is reached")),o.columnSelection=new de("editorColumnSelection",!1,m("editorColumnSelection","Whether `editor.columnSelection` is enabled")),o.writable=o.readOnly.toNegated(),o.hasNonEmptySelection=new de("editorHasSelection",!1,m("editorHasSelection","Whether the editor has text selected")),o.hasOnlyEmptySelection=o.hasNonEmptySelection.toNegated(),o.hasMultipleSelections=new de("editorHasMultipleSelections",!1,m("editorHasMultipleSelections","Whether the editor has multiple selections")),o.hasSingleSelection=o.hasMultipleSelections.toNegated(),o.tabMovesFocus=new de("editorTabMovesFocus",!1,m("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),o.tabDoesNotMoveFocus=o.tabMovesFocus.toNegated(),o.isInWalkThroughSnippet=new de("isInEmbeddedEditor",!1,!0),o.canUndo=new de("canUndo",!1,!0),o.canRedo=new de("canRedo",!1,!0),o.hoverVisible=new de("editorHoverVisible",!1,m("editorHoverVisible","Whether the editor hover is visible")),o.hoverFocused=new de("editorHoverFocused",!1,m("editorHoverFocused","Whether the editor hover is focused")),o.stickyScrollFocused=new de("stickyScrollFocused",!1,m("stickyScrollFocused","Whether the sticky scroll is focused")),o.stickyScrollVisible=new de("stickyScrollVisible",!1,m("stickyScrollVisible","Whether the sticky scroll is visible")),o.standaloneColorPickerVisible=new de("standaloneColorPickerVisible",!1,m("standaloneColorPickerVisible","Whether the standalone color
`,"gi"):null,s=[];let r,a=0,l=0,d=0,c=0;const h=[];for(let f=0;f<60;f++)h.push(new Ud(wi(0,f),0,-1,Ni.getEmpty(),new Mh(wi(0,f))));const u=[];for(let f=0;f<60;f++)u.push(new Ud(wi(1,f),0,-1,Ni.getEmpty(),new Mh(wi(1,f))));if(n)for(n.lastIndex=0;(r=n.exec(e))!==null;){const f=r.index,p=r[0];if(p===`
`)a++,l=f+1;else{if(d!==f){let _;if(c===a){const v=f-d;if(v<h.length)_=h[v];else{const b=wi(0,v);_=new Ud(b,0,-1,Ni.getEmpty(),new Mh(b))}}else{const v=a-c,b=f-l;if(v===1&&b<u.length)_=u[b];else{const C=wi(v,b);_=new Ud(C,0,-1,Ni.getEmpty(),new Mh(C))}}s.push(_)}s.push(t.getToken(p)),d=f+p.length,c=a}}const g=e.length;if(d!==g){const f=c===a?wi(0,g-d):wi(a-c,g-l);s.push(new Ud(f,0,-1,Ni.getEmpty(),new Mh(f)))}this.length=wi(a,g-l),this.tokens=s}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new kU}}class d2{static createFromLanguage(e,t){function i(s){return t.getKey(`${s.languageId}:::${s.bracketText}`)}const n=new Map;for(const s of e.bracketsNew.openingBrackets){const r=wi(0,s.bracketText.length),a=i(s),l=Ni.getEmpty().add(a,RO);n.set(s.bracketText,new Ud(r,1,a,l,ow.create(r,s,l)))}for(const s of e.bracketsNew.closingBrackets){const r=wi(0,s.bracketText.length);let a=Ni.getEmpty();const l=s.getOpeningBrackets();for(const d of l)a=a.add(i(d),RO);n.set(s.bracketText,new Ud(r,2,i(l[0]),a,ow.create(r,s,a)))}return new d2(n)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>_J(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 _J(o){let e=uo(o);return/^[\w ]+/.test(o)&&(e=`\\b${e}`),/[\w ]+$/.test(o)&&(e=`${e}\\b`),e}class M8{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=d2.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function vJ(o){if(o.length===0)return null;if(o.length===1)return o[0];let e=0;function t(){if(e>=o.length)return null;const r=e,a=o[r].listHeight;for(e++;e<o.length&&o[e].listHeight===a;)e++;return e-r>=2?A8(r===0&&e===o.length?o:o.slice(r,e),!1):o[r]}let i=t(),n=t();if(!n)return i;for(let r=t();r;r=t())MO(i,n)<=MO(n,r)?(i=xD(i,n),n=r):n=xD(n,r);return xD(i,n)}function A8(o,e=!1){if(o.length===0)return null;if(o.length===1)return o[0];let t=o.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const s=n<<1;o[n]=Ja.create23(o[s],o[s+1],s+3===t?o[s+2]:null,e)}t=i}return Ja.create23(o[0],o[1],t>=3?o[2]:null,e)}function MO(o,e){return Math.abs(o.listHeight-e.listHeight)}function xD(o,e){return o.listHeight===e.listHeight?Ja.create23(o,e,null,!1):o.listHeight>e.listHeight?bJ(o,e):CJ(e,o)}function bJ(o,e){o=o.toMutable();let t=o;const i=[];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 s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=Ja.create23(r.unappendChild(),n,null,!1):(r.appendChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Ja.create23(o,n,null,!1):o}function CJ(o,e){o=o.toMutable();let t=o;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let s=i.length-1;s>=0;s--){const r=i[s];n?r.childrenLength>=3?n=Ja.create23(n,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(n),n=void 0):r.handleChildrenChanged()}return n?Ja.create23(n,o,null,!1):o}class wJ{constructor(e){this.lastOffset=ds,this.nextNodes=[e],this.offsets=[ds],this.idxs=[]}readLongestNodeAt(e,t){if(Of(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=yp(this.nextNodes);if(!i)return;const n=yp(this.offsets);if(Of(e,n))return;if(Of(n,e))if(ii(n,i.length)<=e)this.nextNodeAfterCurre
`?0:1}function Rl(o){return o?o instanceof V8||o instanceof FJ:!1}class h2{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Rl(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Rl(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Rl(i)&&i.canAppend(this._model))return i;const n=new V8(m("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(n,t),n}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],II(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const s=this._getOrCreateEditStackElement(e,n),r=this._model.applyEdits(t,!0),a=h2._computeCursorState(i,r),l=r.map((d,c)=>({index:c,textChange:d.textChange}));return l.sort((d,c)=>d.textChange.oldPosition===c.textChange.oldPosition?d.index-c.index:d.textChange.oldPosition-c.textChange.oldPosition),s.append(this._model,l.map(d=>d.textChange),II(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Ve(i),null}}}class BJ{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function WJ(o,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let s;for(s=0;s<e&&s<i;s++){const u=o.charCodeAt(s),g=t.charCodeAt(s);if(u!==g)break}let r=0,a=0;for(let u=s;u<e;u++)o.charCodeAt(u)===32?r++:a++;let l=0,d=0;for(let u=s;u<i;u++)t.charCodeAt(u)===32?l++:d++;if(r>0&&a>0||l>0&&d>0)return;const c=Math.abs(a-d),h=Math.abs(r-l);if(c===0){n.spacesDiff=h,h>0&&0<=l-1&&l-1<o.length&&l<t.length&&t.charCodeAt(l)!==32&&o.charCodeAt(l-1)===32&&o.charCodeAt(o.length-1)===44&&(n.looksLikeAlignment=!0);return}if(h%c===0){n.spacesDiff=h/c;return}}function WO(o,e,t){const i=Math.min(o.getLineCount(),1e4);let n=0,s=0,r="",a=0;const l=[2,4,6,8,3,5,7],d=8,c=[0,0,0,0,0,0,0,0,0],h=new BJ;for(let f=1;f<=i;f++){const p=o.getLineLength(f),_=o.getLineContent(f),v=p<=65536;let b=!1,C=0,w=0,S=0;for(let L=0,x=p;L<x;L++){const I=v?_.charCodeAt(L):o.getLineCharCode(f,L);if(I===9)S++;else if(I===32)w++;else{b=!0,C=L;break}}if(!b||(S>0?n++:w>1&&s++,WJ(r,a,_,C,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const k=h.spacesDiff;k<=d&&c[k]++,r=_,a=C}let u=t;n!==s&&(u=n<s);let g=e;if(u){let f=u?0:.1*i;l.forEach(p=>{const _=c[p];_>f&&(f=_,g=p)}),g===4&&c[4]>0&&c[2]>0&&c[2]>=c[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function _s(o){return(o.metadata&1)>>>0}function zt(o,e){o.metadata=o.metadata&254|e<<0}function xn(o){return(o.metadata&2)>>>1===1}function Bt(o,e){o.metadata=o.metadata&253|(e?1:0)<<1}function H8(o){return(o.metadata&4)>>>2===1}function VO(o,e){o.metadata=o.metadata&251|(e?1:0)<<2}function z8(o){return(o.metadata&64)>>>6===1}function HO(o,e){o.metadata=o.metadata&191|(e?1:0)<<6}function VJ(o){return(o.metadata&24)>>>3}function zO(o,e){o.metadata=o.metadata&231|e<<3}function HJ(o){return(o.metadata&32)>>>5===1}function UO(o,e){o.metadata=o.metadata&223|(e?1:0)<<5}class U8{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,zt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,VO(this,!1),HO(this,!1),zO(this,1),UO(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Bt(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;VO(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),HO(this,this.options.glyphMarginClassName!==null),zO(this,this.options.stickiness),UO(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}deta
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,s-1)===13){const p=this.positionInBuffer(n,s-1);this.deleteNodeTail(n,p),t="\r"+t,n.piece.length===0&&c.push(n)}else this.deleteNodeTail(n,d);else this.deleteNodeTail(n,d);const u=this.createNewPieces(t);h.length>0&&this.rbInsertRight(n,h);let g=n;for(let f=0;f<u.length;f++)g=this.rbInsertRight(g,u[f]);this.deleteNodes(c)}else this.insertContentToNodeRight(t,n)}else{const n=this.createNewPieces(t);let s=this.rbInsertLeft(null,n[0]);for(let r=1;r<n.length;r++)s=this.rbInsertRight(s,n[r])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===He)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),s=i.node,r=n.node;if(s===r){const u=this.positionInBuffer(s,i.remainder),g=this.positionInBuffer(s,n.remainder);if(i.nodeStartOffset===e){if(t===s.piece.length){const f=s.next();B0(this,s),this.validateCRLFWithPrevNode(f),this.computeBufferMetadata();return}this.deleteNodeHead(s,g),this._searchCache.validate(e),this.validateCRLFWithPrevNode(s),this.computeBufferMetadata();return}if(i.nodeStartOffset+s.piece.length===e+t){this.deleteNodeTail(s,u),this.validateCRLFWithNextNode(s),this.computeBufferMetadata();return}this.shrinkNode(s,u,g),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(s,i.remainder);this.deleteNodeTail(s,l),this._searchCache.validate(e),s.piece.length===0&&a.push(s);const d=this.positionInBuffer(r,n.remainder);this.deleteNodeHead(r,d),r.piece.length===0&&a.push(r);const c=s.next();for(let u=c;u!==He&&u!==r;u=u.next())a.push(u);const h=s.piece.length===0?s.prev():s;this.deleteNodes(a),this.validateCRLFWithNextNode(h),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 Is(r.bufferIndex,a,r.end,this.getLineFeedCnt(r.bufferIndex,a,r.end),r.length-1);t.piece=l,e+=`
`,Ll(this,t,-1,-1),t.piece.length===0&&i.push(t)}const n=this.createNewPieces(e);let s=this.rbInsertLeft(t,n[n.length-1]);for(let r=n.length-2;r>=0;r--)s=this.rbInsertLeft(s,n[r]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
`);const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let r=1;r<i.length;r++)s=this.rbInsertRight(s,i[r]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,s=e.piece.bufferIndex,r=this._buffers[s].lineStarts,l=r[n.start.line]+n.start.column+t;let d=n.start.line,c=n.end.line,h=0,u=0,g=0;for(;d<=c&&(h=d+(c-d)/2|0,g=r[h],h!==c);)if(u=r[h+1],l<g)c=h-1;else if(l>=u)d=h+1;else break;return i?(i.line=h,i.column=l-g,null):{line:h,column:l-g}}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 s=n[i.line+1],r=n[i.line]+i.column;if(s>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++)B0(this,e[t])}createNewPieces(e){if(e.length>ml){const c=[];for(;e.length>ml;){const u=e.charCodeAt(ml-1);let g;u===13||u>=55296&&u<=56319?(g=e.substring(0,ml-1),e=e.substring(ml-1)):(g=e.substring(0,ml),e=e.substring(ml));const f=Dl(g);c.push(new Is(this._buffers.length,{line:0,column:0},{line:f.length-1,column:g.length-f[f.length-1]},f.length-1,g.length)),this._buffers.push(new Ah(g,f))}const h=Dl(e);return c.push(new Is(this._buffers.length,{line:0,column:0},{line:h.length-1,column:e.length-h[h.length-1]},h.length-1,e.length)),this._buffers.push(new Ah(e,h)),c}let t=this._buffers[0].buffer.length;const i=Dl(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 c=0;c<i.length;c++)i[c]+=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 c=0;c<i.length;c++)i[c]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const s=this._buffers[0].buffer.length,r=this._buffers[0].lineStarts.length-1,a=s-this._buffers[0].lineStarts[r],l={line:r,column:a},d=new Is(0,n,l,this.getLineFeedCnt(0,n,l),s-t);return this._lastChangeBufferPos=l,[d]}getLineRawContent(e,t=0){let i=this.root,n="";const s=this._searchCache.get2(e);if(s){i=s.node;const r=this.getAccumulatedValue(i,e-s.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(s.nodeStartLineNumber+i.piece.lineFeedCnt===e)n=a.substring(l+r,l+i.piece.length);else{const d=this.getAccumulatedValue(i,e-s.nodeStartLineNumber);return a.substring(l+r,l+d-t)}}else{let r=0;const a=e;for(;i!==He;)if(i.left!==He&&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),d=this.getAccumulatedValue(i,e-i.lf_left-1),c=this._buffers[i.piece.bufferIndex].buffer,h=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)}),c.substring(h+l,h+d-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),d=this._buffers[i.piece.bufferIndex].buffer,c=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=d.substring(c+l,c+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!==He;){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!==He;)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 s=Dl(t,!1);for(let g=0;g<s.length;g++)s[g]+=n;if(i){const g=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:n-g}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(s.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},d=e.piece.length+t.length,c=e.piece.lineFeedCnt,h=this.getLineFeedCnt(0,e.piece.start,l),u=h-c;e.piece=new Is(e.piece.bufferIndex,e.piece.start,l,h,d),this._lastChangeBufferPos=l,Ll(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!==He;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){n+=t.size_left;const s={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(s),s}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!==He;)if(i.left!==He&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,r),nodeStartOffset:n}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}else e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==He;){if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:r}}else if(i.piece.length>=t-1){const s=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:s}}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===He||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;return n===i.length-1||i[n+1]>s+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(s)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===He||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 s;e.piece.end.column===0?s={line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:s={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 Is(e.piece.bufferIndex,e.piece.start,s,a,r),Ll(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},d=t.piece.length-1,c=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Is(t.piece.bufferIndex,l,t.piece.end,c,d),Ll(this,t,-1,-1),t.piece.length===0&&i.push(t);const h=this.createNewPieces(`\r
`);this.rbInsertRight(e,h[0]);for(let u=0;u<i.length;u++)B0(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)B0(this,i);else{const n=i.piece,s={line:n.start.line+1,column:0},r=n.length-1,a=this.getLineFeedCnt(n.bufferIndex,s,n.end);i.piece=new Is(n.bufferIndex,s,n.end,a,r),Ll(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===He)return t(He);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===He)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,n=this.offsetInBuffer(i.bufferIndex,i.start),s=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(n,s)}getPieceContent(e){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 EI(t,1);if(i.left=He,i.right=He,i.parent=He,i.size_left=0,i.lf_left=0,this.root===He)this.root=i,i.color=0;else if(e.right===He)e.right=i,i.parent=e;else{const s=u2(e.right);s.left=i,i.parent=s}return KO(this,i),i}rbInsertLeft(e,t){const i=new EI(t,1);if(i.left=He,i.right=He,i.parent=He,i.size_left=0,i.lf_left=0,this.root===He)this.root=i,i.color=0;else if(e.left===He)e.left=i,i.parent=e;else{const n=j8(e.left);n.right=i,i.parent=n}return KO(this,i),i}}class Bf extends H{constructor(e,t,i,n,s,r,a){super(),this._onDidChangeContent=this._register(new B),this._BOM=t,this._mightContainNonBasicASCII=!r,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._pieceTree=new nee(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),s=this.getPositionAt(i);return new D(n.lineNumber,n.column,s.lineNumber,s.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),n=this.getOffsetAt(e.endLineNumber,e.endColumn);let s=0;const r=this._getEndOfLine(t),a=this.getEOL();if(r.length!==a.length){const l=r.length-a.length,d=e.endLineNumber-e.startLineNumber;s=l*d}return n-i+s}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,s=e.endLineNumber;for(let r=n;r<=s;r++){const a=this.getLineContent(r),l=r===n?e.startColumn-1:0,d=r===s?e.endColumn-1:a.length;for(let c=l;c<d;c++)$i(a.charCodeAt(c))?(i=i+1,c=c+1):i=i+1}return i+=this._getEndOfLine(t).length*(s-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=Zn(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Zr(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,s=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let p=0;p<e.length;p++){const _=e[p];a&&_._isTracked&&(a=!1);const v=_.range;if(_.text){let k=!0;r||(k=!Db(_.text),r=k),!n&&k&&(n=Jf(_.text)),!s&&k&&(s=N9(_.text))}let b="",C=0,w=0,S=0;if(_.text){let k;[C,w,S,k]=Rc(_.text);const L=this.getEOL();k===0||k===(L===`\r
`?2:1)?b=_.text:b=_.text.replace(/\r\n|\r|\n/g,L)}l[p]={sortIndex:p,identifier:_.identifier||null,range:v,rangeOffset:this.getOffsetAt(v.startLineNumber,v.startColumn),rangeLength:this.getValueLengthInRange(v),text:b,eolCount:C,firstLineLength:w,lastLineLength:S,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}l.sort(Bf._sortOpsAscending);let d=!1;for(let p=0,_=l.length-1;p<_;p++){const v=l[p].range.getEndPosition(),b=l[p+1].range.getStartPosition();if(b.isBeforeOrEqual(v)){if(b.isBefore(v))throw new Error("Overlapping ranges are not allowed!");d=!0}}a&&(l=this._reduceOperations(l));const c=i||t?Bf._getInverseEditRanges(l):[],h=[];if(t)for(let p=0;p<l.length;p++){const _=l[p],v=c[p];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let b=v.startLineNumber;b<=v.endLineNumber;b++){let C="";b===v.startLineNumber&&(C=this.getLineContent(_.range.startLineNumber),Zn(C)!==-1)||h.push({lineNumber:b,oldContent:C})}}let u=null;if(i){let p=0;u=[];for(let _=0;_<l.length;_++){const v=l[_],b=c[_],C=this.getValueInRange(v.range),w=v.rangeOffset+p;p+=v.text.length-C.length,u[_]={sortIndex:v.sortIndex,identifier:v.identifier,range:b,text:C,textChange:new wn(v.rangeOffset,C,w,v.text)}}d||u.sort((_,v)=>_.sortIndex-v.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=r;const g=this._doApplyEdits(l);let f=null;if(t&&h.length>0){h.sort((p,_)=>_.lineNumber-p.lineNumber),f=[];for(let p=0,_=h.length;p<_;p++){const v=h[p].lineNumber;if(p>0&&h[p-1].lineNumber===v)continue;const b=h[p].oldContent,C=this.getLineContent(v);C.length===0||C===b||Zn(C)!==-1||f.push(v)}}return this._onDidChangeContent.fire(),new tj(u,g,f)}_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,s=new D(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,f=e.length;g<f;g++){const p=e[g],_=p.range;t=t||p.forceMoveMarkers,l.push(this.getValueInRange(new D(r,a,_.startLineNumber,_.startColumn))),p.text.length>0&&l.push(p.text),r=_.endLineNumber,a=_.endColumn}const d=l.join(""),[c,h,u]=Rc(d);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:d,eolCount:c,firstLineLength:h,lastLineLength:u,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Bf._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],s=n.range.startLineNumber,r=n.range.startColumn,a=n.range.endLineNumber,l=n.range.endColumn;if(s===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 d=new D(s,r,a,l);t.push({range:d,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,s=null;for(let r=0,a=e.length;r<a;r++){const l=e[r];let d,c;s?s.range.endLineNumber===l.range.startLineNumber?(d=i,c=n+(l.range.startColumn-s.range.endColumn)):(d=i+(l.range.startLineNumber-s.range.endLineNumber),c=l.range.startColumn):(d=l.range.startLineNumber,c=l.range.startColumn);let h;if(l.text.length>0){const u=l.eolCount+1;u===1?h=new D(d,c,d,c+l.firstLineLength):h=new D(d,c,d+u-1,l.lastLineLength+1)}else h=new D(d,c,d,c);i=h.endLineNumber,n=h.endColumn,t.push(h),s=l}return t}static _sortOpsAscending(e,t){const i=D.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=D.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class see{constructor(e,t,i,n,s,r,a,l,d){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._
`:`\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 s=0,r=i.length;s<r;s++){const a=i[s].buffer.replace(/\r\n|\r|\n/g,t),l=Dl(a);i[s]=new Ah(a,l)}const n=new Bf(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class q8{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&&SR(e)&&(this.BOM=w$,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=eee(this._tmpLineStarts,e);this.chunks.push(new Ah(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Jf(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=N9(e)))}finish(e=!0){return this._finish(),new see(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=Dl(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class oee{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const n=this._store.slice(0,e),s=this._store.slice(e+t),r=ree(i,this._default);this._store=n.concat(r,s)}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=LS(this._store,e,i)}}function ree(o,e){const t=[];for(let i=0;i<o;i++)t[i]=e;return t}class aee{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class TI{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 aee(e,[t]))}finalize(){return this._tokens}}class lee{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new NI(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class dee extends lee{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const s=this._textModel.getLineContent(n.lineNumber),r=Lp(this._languageIdCodec,i,this.tokenizationSupport,s,!0,n.startState);e.add(n.lineNumber,r.tokens),this.store.setEndState(n.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),r=s.substring(0,e.column-1)+t+s.substring(e.column-1),a=Lp(this._languageIdCodec,n,this.tokenizationSupport,r,!0,i),l=new Bi(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const d=l.findTokenIndexAtO
`,!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 ru(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw Ao();const{textBuffer:t,disposable:i}=ZO(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,s,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:s,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new YO,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Wf([new mee],this._versionId,!1,!1),this._createContentChanged2(new D(1,1,s,r),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r
`:`
`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),r=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Wf([new vee],this._versionId,!1,!1),this._createContentChanged2(new D(1,1,s,r),0,n,this.getValue(),!1,!1,!1,!0))}_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 s=t[i],r=s.range,a=s.cachedAbsoluteStart-s.start,l=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),d=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);s.cachedAbsoluteStart=l,s.cachedAbsoluteEnd=d,s.cachedVersionId=e,s.start=l-a,s.end=d-a,Ac(s)}}onBeforeAttached(){return this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}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 s=this._buffer.getLineLength(n);s>=yee?t+=s:e+=s}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.originalIndentSize,n=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,s=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new HC({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,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=WO(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),J1(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(T9.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)}_incr
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Mi("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Mi("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Mi("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(s<1)s=1,r=1;else if(s>t)s=t,r=this.getLineMaxColumn(s);else if(r<=1)r=1;else{const h=this.getLineMaxColumn(s);r>=h&&(r=h)}const a=e.endLineNumber,l=e.endColumn;let d=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),c=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(d<1)d=1,c=1;else if(d>t)d=t,c=this.getLineMaxColumn(d);else if(c<=1)c=1;else{const h=this.getLineMaxColumn(d);c>=h&&(c=h)}return i===s&&n===r&&a===d&&l===c&&e instanceof D&&!(e instanceof ve)?e:new D(s,r,d,c)}_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 s=this.getLineMaxColumn(e);if(t>s)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if($i(r))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),s=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(n<1)return new W(1,1);if(n>r)return new W(r,this.getLineMaxColumn(r));if(s<=1)return new W(n,1);const a=this.getLineMaxColumn(n);if(s>=a)return new W(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,s-2);if($i(l))return new W(n,s-1)}return new W(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof W&&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,s=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(s,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(s)?this._buffer.getLineCharCode(s,r-2):0,d=$i(a),c=$i(l);return!d&&!c}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof D&&!(e instanceof ve)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),n=this._validatePosition(e.endLineNumber,e.endColumn,0),s=i.lineNumber,r=i.column,a=n.lineNumber,l=n.column;{const d=r>1?this._buffer.getLineCharCode(s,r-2):0,c=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=$i(d),u=$i(c);return!h&&!u?new D(s,r,a,l):s===a&&r===l?new D(s,r-1,a,l-1):h&&u?new D(s,r-1,a,l+1):h?new D(s,r-1,a,l):new D(s,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 D(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,r,a=See){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>D.isIRange(h))&&(l=t.map(h=>this.validateRange(h)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((h,u)=>h.startLineNumber-u.startLineNumber||h.startColumn-u.startColumn);const d=[];d.push(l.reduce((h,u)=>D.areIntersecting(h,u)?h.plusRange(u):(d.push(h),u)));let c;if(!i&&e.indexOf(`
`)<0){const u=new Ch(e,i,n,s).parseSearchRequest();if(!u)return[];c=g=>this.findMatchesLineByLine(g,u,r,a)}else c=h=>w0.findMatches(this,new Ch(e,i,n,s),h,r,a);return d.map(c).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(`
`)<0){const d=new Ch(e,i,n,s).parseSearchRequest();if(!d)return null;const c=this.getLineCount();let h=new D(a.lineNumber,a.column,c,this.getLineMaxColumn(c)),u=this.findMatchesLineByLine(h,d,r,1);return w0.findNextMatch(this,new Ch(e,i,n,s),a,r),u.length>0||(h=new D(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,d,r,1),u.length>0)?u[0]:null}return w0.findNextMatch(this,new Ch(e,i,n,s),a,r)}findPreviousMatch(e,t,i,n,s,r){this._assertNotDisposed();const a=this.validatePosition(t);return w0.findPreviousMatch(this,new Ch(e,i,n,s),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 qL?e:new qL(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,n){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,n)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,n){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const s=t.map(a=>({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,l=e.length;a<l;a++){const d=e[a];let c=!1;for(let h=0,u=s.length;h<u;h++){const g=s[h].range,f=g.startLineNumber>d.endLineNumber,p=d.startLineNumber>g.endLineNumber;if(!f&&!p){c=!0;break}}if(!c){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;a<l;a++){const d=this._trimAutoWhitespaceLines[a],c=this.getLineMaxColumn(d);let h=!0;for(let u=0,g=s.length;u<g;u++){const f=s[u].range,p=s[u].text;if(!(d<f.startLineNumber||d>f.endLineNumber)&&!(d===f.startLineNumber&&f.startColumn===c&&f.isEmpty()&&p&&p.length>0&&p.charAt(0)===`
`)&&!(d===f.startLineNumber&&f.startColumn===1&&f.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)===`
`)){h=!1;break}}if(h){const u=new D(d,1,d,c);t.push(new qL(null,u,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new D(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new D(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!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),s=this._buffer.getLineCount(),r=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,r.length!==0){for(let d=0,c=r.length;d<c;d++){const h=r[d];this._decorationsTree.acceptReplace(h.rangeOffset,h.rangeLength,h.text.length,h.forceMoveMarkers)}const a=[];this._increaseVersionId();let l=i;for(let d=0,c=r.length;d<c;d++){const h=r[d],[u]=Rc(h.text);this._onDidChangeDecorations.fire();const g=h.range.startLineNumber,f=h.range.endLineNumber,p=f-g,_=u,v=Math.min(p,_),b=_-p,C=s-l-b+g,w=C,S=C+_,k=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new W(w,1)),this.getOffsetAt(new W(S,this.getLineMaxColumn(S))),0),L=ea.fromDecorations(k),x=new dd(L);for(let I=v;I>=0;I--){const M=g+I,P=C+I;x.takeFromEndWhile(O=>O.lineNumber>P);const F=x.takeFromEndWhile(O=>O.lineNumber===P);a.push(new GO(M,this.getLineContent(P),F))}if(v<p){const I=g+v;a.push(new pee(I+1,f))}if(v<_){const I=new dd(L),M=g+v,P=_-v,F=s-l-P+M+1,O=[],K=[];for(let oe=0;oe<P;oe++){const ge=F+oe;K[oe]=this.getLineContent(ge),I.takeWhile(ye=>ye.lineNumber<ge),O[oe]=I.takeWhile(ye=>ye.lineNumber===ge)}a.push(new _ee(M+1,g+_,K,O))}l+=b}this._emitContentChangedEvent(new Wf(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,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 GO(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new G8(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:(s,r)=>this._deltaDecorationsImpl(e,[],[{range:s,options:r}])[0],changeDecoration:(s,r)=>{this._changeDecorationImpl(s,r)},changeDecorationOptions:(s,r)=>{this._changeDecorationOptionsImpl(s,QO(r))},removeDecoration:s=>{this._deltaDecorationsImpl(e,[s],[])},deltaDecorations:(s,r)=>s.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,s,r)};let n=null;try{n=t(i)}catch(s){Ve(s)}return i.addDecoration=Dp,i.changeDecoration=Dp,i.changeDecorationOptions=Dp,i.removeDecora
`)>=0)return null;const r=s.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 d=l[0].open,c=s.text.length-r[2].length-1,h=s.text.lastIndexOf(d,c-1);if(h===-1)return null;t.push([h,c])}return t}executeEdits(e,t,i,n){let s=null;t==="snippet"&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,d=>{if(s)for(let h=0,u=s.length;h<u;h++){const[g,f]=s[h],p=d[h],_=p.range.startLineNumber,v=p.range.startColumn-1+g,b=p.range.startColumn-1+f;r.push(new D(_,b+1,_,b+2)),a.push(new D(_,v+1,_,b+2))}const c=n(d);return c&&(this._isHandling=!0),c});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 s=I_.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){Ve(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return t4.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new E_(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(Xt.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 s=0;for(;s<n;){const r=CR(t,s),a=t.substr(s,r);this._executeEditOperation(Xt.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),s+=r}}else this._executeEditOperation(Xt.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,s,r){if(t.length===0&&i===0&&n===0){if(s!==0){const a=this.getSelections().map(l=>{const d=l.getPosition();return new ve(d.lineNumber,d.column+s,d.lineNumber,d.column+s)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Xt.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s))},e,r)}paste(e,t,i,n,s){this._executeEdit(()=>{this._executeEditOperation(Xt.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,s,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(yu.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new ps(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new ps(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class I_{static from(e,t){return new I_(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.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 t4{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClosedEnclosingDecorations=this.
`:this.model.getEOL();e=e.slice(0),e.sort(D.compareRangesUsingStarts);let s=!1,r=!1;for(const l of e)l.isEmpty()?s=!0:r=!0;if(!r){if(!t)return"";const l=e.map(c=>c.startLineNumber);let d="";for(let c=0;c<l.length;c++)c>0&&l[c-1]===l[c]||(d+=this.model.getLineContent(l[c])+n);return d}if(s&&t){const l=[];let d=0;for(const c of e){const h=c.startLineNumber;c.isEmpty()?h!==d&&l.push(this.model.getLineContent(h)):l.push(this.model.getValueInRange(c,i?2:0)),d=h}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===co||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const c=n.startLineNumber;n=new D(c,this.model.getLineMinColumn(c),c,this.model.getLineMaxColumn(c))}const s=this._configuration.options.get(49),r=this._getColorMap(),l=/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===Fs.fontFamily;let d;return l?d=Fs.fontFamily:(d=s.fontFamily,d=d.replace(/"/g,"'"),/[,']/.test(d)||/[+ ]/.test(d)&&(d=`'${d}'`),d=`${d}, ${Fs.fontFamily}`),{mode:i,html:`<div style="color: ${r[1]};background-color: ${r[2]};font-family: ${d};font-weight: ${s.fontWeight};font-size: ${s.fontSize}px;line-height: ${s.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,r)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let d=i;d<=s;d++){const c=this.model.tokenization.getLineTokens(d),h=c.getLineContent(),u=d===i?n-1:0,g=d===s?r-1:h.length;h===""?l+="<br>":l+=rte(h,c.inflate(),t,u,g,a,kn)}return l}_getColorMap(){const e=ei.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=z.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 Gee);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,s){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,n,s))}paste(e,t,i,n){this._executeCursorEdit(s=>this._cursor.paste(s,e,t,i,n))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}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 D(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new e1(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new
`?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 s={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(s),this._postDetachModelCleanup(n),this._contributions.onAfterModelAttached()}_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 s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?wh._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?wh._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?wh._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(n=>D.lift(n)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Fi.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(!W.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(!D.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,r,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new D(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(!W.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new D(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=ve.isISelection(e),n=D.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t
`:`
`),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(uo(t),"g");return e.replace(i,(n,s)=>e.charAt(s-1)!=="\\"?`\\${n}`:n)}}function fm(o){return hc(o)?!o.value:Array.isArray(o)?o.every(fm):!0}function hc(o){return o instanceof un?!0:o&&typeof o=="object"?typeof o.value=="string"&&(typeof o.isTrusted=="boolean"||typeof o.isTrusted=="object"||o.isTrusted===void 0)&&(typeof o.supportThemeIcons=="boolean"||o.supportThemeIcons===void 0):!1}function Sie(o,e){return o===e?!0:!o||!e?!1:o.value===e.value&&o.isTrusted===e.isTrusted&&o.supportThemeIcons===e.supportThemeIcons&&o.supportHtml===e.supportHtml&&(o.baseUri===e.baseUri||!!o.baseUri&&!!e.baseUri&&c2(Ie.from(o.baseUri),Ie.from(e.baseUri)))}function yie(o){return o.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function j0(o){return o.replace(/"/g,"&quot;")}function zD(o){return o&&o.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function Lie(o){const e=[],t=o.split("|").map(n=>n.trim());o=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),s=/width=(\d+)/.exec(i),r=n?n[1]:"",a=s?s[1]:"",l=isFinite(parseInt(a)),d=isFinite(parseInt(r));l&&e.push(`width="${a}"`),d&&e.push(`height="${r}"`)}return{href:o,dimensions:e}}class fr{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new fr(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const n=e.getVisibleRanges();if(n.length>0){t=n[0].getStartPosition();const s=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-s}return new fr(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=s}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}const xv={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:vi.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};var UI=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};function Die(o,e){cs(e)?o.title=M2(e):e?.markdownNotSupportedFallback?o.title=e.markdownNotSupportedFallback:o.removeAttribute("title")}class xie{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var n;return UI(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(e===void 0||cs(e)||e instanceof HTMLElement)s=e;else if(!G_(e.markdown))s=(n=e.markdown)!==null&&n!==void 0?n:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(m("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Ei;const r=this._cancellationTokenSource.token;if(s=yield e.markdown(r),s===void 0&&(s=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(s,t,i)})}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const s=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,s
`)n.type===2&&(n=s.pop()),n.children.push({type:8});else if(n.type!==2){const d={type:2,content:a};n.children.push(d),s.push(n),n=d}else n.content+=a}return n.type===2&&(n=s.pop()),t}function Nie(o,e){return $I(o,e)!==0}function $I(o,e){switch(o){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const Rie=new RegExp(`(\\\\)?\\$\\((${be.iconNameExpression}(?:${be.iconModifierExpression})?)\\)`,"g");function uc(o){const e=new Array;let t,i=0,n=0;for(;(t=Rie.exec(o))!==null;){n=t.index||0,i<n&&e.push(o.substring(i,n)),i=(t.index||0)+t[0].length;const[,s,r]=t;e.push(s?`$(${r})`:jI({id:r}))}return i<o.length&&e.push(o.substring(i)),e}function jI(o){const e=ee("span");return e.classList.add(...be.asClassNameArray(o)),e}class P2{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const KI=new P2("id#");let gs={};(function(){function o(e,t){t(gs)}o.amd=!0,function(e,t){typeof o=="function"&&o.amd?o(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){function t(Q,q){for(var j=0;j<q.length;j++){var R=q[j];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(Q,R.key,R)}}function i(Q,q,j){return q&&t(Q.prototype,q),j&&t(Q,j),Object.defineProperty(Q,"prototype",{writable:!1}),Q}function n(Q,q){if(Q){if(typeof Q=="string")return s(Q,q);var j=Object.prototype.toString.call(Q).slice(8,-1);if(j==="Object"&&Q.constructor&&(j=Q.constructor.name),j==="Map"||j==="Set")return Array.from(Q);if(j==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(j))return s(Q,q)}}function s(Q,q){(q==null||q>Q.length)&&(q=Q.length);for(var j=0,R=new Array(q);j<q;j++)R[j]=Q[j];return R}function r(Q,q){var j=typeof Symbol<"u"&&Q[Symbol.iterator]||Q["@@iterator"];if(j)return(j=j.call(Q)).next.bind(j);if(Array.isArray(Q)||(j=n(Q))||q&&Q&&typeof Q.length=="number"){j&&(Q=j);var R=0;return function(){return R>=Q.length?{done:!0}:{done:!1,value:Q[R++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.defaults=a();function l(Q){e.defaults=Q}var d=/[&<>"']/,c=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},f=function(q){return g[q]};function p(Q,q){if(q){if(d.test(Q))return Q.replace(c,f)}else if(h.test(Q))return Q.replace(u,f);return Q}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(Q){return Q.replace(_,function(q,j){return j=j.toLowerCase(),j==="colon"?":":j.charAt(0)==="#"?j.charAt(1)==="x"?String.fromCharCode(parseInt(j.substring(2),16)):String.fromCharCode(+j.substring(1)):""})}var b=/(^|[^\[])\^/g;function C(Q,q){Q=typeof Q=="string"?Q:Q.source,q=q||"";var j={replace:function(A,U){return U=U.source||U,U=U.replace(b,"$1"),Q=Q.replace(A,U),j},getRegex:function(){return new RegExp(Q,q)}};return j}var w=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(Q,q,j){if(Q){var R;try{R=decodeURIComponent(v(j)).replace(w,"").toLowerCase()}catch{return null}if(R.indexOf("javascript:")===0||R.indexOf("vbscript:")===0||R.indexOf("data:")===0)return null}q&&!S.test(j)&&(j=P(q,j));try{j=encodeURI(j).replace(/%25/g,"%")}catch{return null}return j}var L={},x=/^[^:]+:\/*[^/]*$/,I=/^([^:]+:)[\s\S]*$/,M=/^([^:]+:\/*[^/]*)[\s\S]*$/;function P(Q,q){L[" "+Q]||(x.test(Q)?L[" "+Q]=Q+"/":L[" "+Q]=oe(Q,"/",!0)),Q=L[" "+Q];var j=Q.indexOf(":")===-1;return q.substring(0,2)==="//"?j?q:Q.replace(I,"$1")+q:q.charAt(0)==="/"?j?q:Q.replace(M,"$1")+q:Q+q}var F={exec:function(){}};function O(Q){for(var q=1,j,R;q<arguments.length;q++){j=arguments[q];for(R in j)Object.prototype.hasOwnProperty.call(j,R)&&(Q[R]=j[R])}return Q}function K(Q,q){var j=Q.replace(/\|/g,function(U,V,J){for(var he=!1,ke=V;--ke>=0&&J[ke]==="\\";)he=!he;return he?"|":" |"}),R=j.split(/ \|/),A=0;if(R[0].trim()||R.shift(),R.length>0&&!R[R.length-1].trim()&&R.pop(),R.length>q)R.splice(q);else for(;R.length<q;)R.push("");for(;A<R.length;A++)R[A]=R[A].trim().replace(/\\\|/g,"|");return R}function oe(Q,q,j){var R=Q.length;if(R===0)return"";for(var A=0;A<R;){var U=Q.charAt(R-A-1);if(U===q&&!j)A++;else if(U!==q&&j)A++;else break}return Q.slice(0,R-A)}function ge(Q,q){if(Q.indexOf(q[1])===-1)return-1;for(var j=Q.length,R=0,A=0;A<j;A++)if(Q[A]==="\\")A++;else if(Q[A]===q[0])R++;else if(Q[A]===q[1]&&(R--,R<0))return A;return-1}function ye(Q){Q&&Q.sanitize&&!Q.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Ee(Q,q){if(q<1)return"";for(var j="";q>1;)q&1&&(j+=Q),q>>=1,Q+=Q;return j+Q}function fe(Q,q,j,R){var A=q.href,U=q.title?p(q.title):null,V=Q[1].replace(/\\([\[\]])/g,"$1");if(Q[0].charAt(0)!=="!"){R.state.inLink=!0;var J={type:"link",raw:j,href:A,title:U,text:V,tokens:R.inlineTokens(V)};return R.state.inLink=!1,J}return{type:"image",raw:j,href:A,title:U,text:p(V)}}function Fe(Q,q){var j=Q.match(/^(\s+)(?:```)/);if(j===null)return q;var R=j[1];return q.split(`
`).map(function(A){var U=A.match(/^\s+/);if(U===null)return A;var V=U[0];return V.length>=R.length?A.slice(R.length):A}).join(`
`)}var xe=function(){function Q(j){this.options=j||e.defaults}var q=Q.prototype;return q.space=function(R){var A=this.rules.block.newline.exec(R);if(A&&A[0].length>0)return{type:"space",raw:A[0]}},q.code=function(R){var A=this.rules.block.code.exec(R);if(A){var U=A[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:A[0],codeBlockStyle:"indented",text:this.options.pedantic?U:oe(U,`
`)}}},q.fences=function(R){var A=this.rules.block.fences.exec(R);if(A){var U=A[0],V=Fe(U,A[3]||"");return{type:"code",raw:U,lang:A[2]?A[2].trim():A[2],text:V}}},q.heading=function(R){var A=this.rules.block.heading.exec(R);if(A){var U=A[2].trim();if(/#$/.test(U)){var V=oe(U,"#");(this.options.pedantic||!V||/ $/.test(V))&&(U=V.trim())}return{type:"heading",raw:A[0],depth:A[1].length,text:U,tokens:this.lexer.inline(U)}}},q.hr=function(R){var A=this.rules.block.hr.exec(R);if(A)return{type:"hr",raw:A[0]}},q.blockquote=function(R){var A=this.rules.block.blockquote.exec(R);if(A){var U=A[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:A[0],tokens:this.lexer.blockTokens(U,[]),text:U}}},q.list=function(R){var A=this.rules.block.list.exec(R);if(A){var U,V,J,he,ke,Te,Ke,Ue,Ot,It,We,hi,ui=A[1].trim(),Go=ui.length>1,St={type:"list",raw:"",ordered:Go,start:Go?+ui.slice(0,-1):"",loose:!1,items:[]};ui=Go?"\\d{1,9}\\"+ui.slice(-1):"\\"+ui,this.options.pedantic&&(ui=Go?ui:"[*+-]");for(var Oi=new RegExp("^( {0,3}"+ui+")((?:[ ][^\\n]*)?(?:\\n|$))");R&&(hi=!1,!(!(A=Oi.exec(R))||this.rules.block.hr.test(R)));){if(U=A[0],R=R.substring(U.length),Ue=A[2].split(`
`,1)[0],Ot=R.split(`
`,1)[0],this.options.pedantic?(he=2,We=Ue.trimLeft()):(he=A[2].search(/[^ ]/),he=he>4?1:he,We=Ue.slice(he),he+=A[1].length),Te=!1,!Ue&&/^ *$/.test(Ot)&&(U+=Ot+`
`,R=R.substring(Ot.length+1),hi=!0),!hi)for(var rh=new RegExp("^ {0,"+Math.min(3,he-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),ah=new RegExp("^ {0,"+Math.min(3,he-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Lr=new RegExp("^ {0,"+Math.min(3,he-1)+"}(?:```|~~~)"),Cd=new RegExp("^ {0,"+Math.min(3,he-1)+"}#");R&&(It=R.split(`
`,1)[0],Ue=It,this.options.pedantic&&(Ue=Ue.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Lr.test(Ue)||Cd.test(Ue)||rh.test(Ue)||ah.test(R)));){if(Ue.search(/[^ ]/)>=he||!Ue.trim())We+=`
`+Ue.slice(he);else if(!Te)We+=`
`+Ue;else break;!Te&&!Ue.trim()&&(Te=!0),U+=It+`
`,R=R.substring(It.length+1)}St.loose||(Ke?St.loose=!0:/\n *\n *$/.test(U)&&(Ke=!0)),this.options.gfm&&(V=/^\[[ xX]\] /.exec(We),V&&(J=V[0]!=="[ ] ",We=We.replace(/^\[[ xX]\] +/,""))),St.items.push({type:"list_item",raw:U,task:!!V,checked:J,loose:!1,text:We}),St.raw+=U}St.items[St.items.length-1].raw=U.trimRight(),St.items[St.items.length-1].text=We.trimRight(),St.raw=St.raw.trimRight();var lh=St.items.length;for(ke=0;ke<lh;ke++){this.lexer.state.top=!1,St.items[ke].tokens=this.lexer.blockTokens(St.items[ke].text,[]);var dh=St.items[ke].tokens.filter(function(ch){return ch.type==="space"}),vg=dh.every(function(ch){for(var BL=ch.raw.split(""),da=0,dp=r(BL),cp;!(cp=dp()).done;){var g0=cp.value;if(g0===`
`&&(da+=1),da>1)return!0}return!1});!St.loose&&dh.length&&vg&&(St.loose=!0,St.items[ke].loose=!0)}return St}},q.html=function(R){var A=this.rules.block.html.exec(R);if(A){var U={type:"html",raw:A[0],pre:!this.options.sanitizer&&(A[1]==="pre"||A[1]==="script"||A[1]==="style"),text:A[0]};if(this.options.sanitize){var V=this.options.sanitizer?this.options.sanitizer(A[0]):p(A[0]);U.type="paragraph",U.text=V,U.tokens=this.lexer.inline(V)}return U}},q.def=function(R){var A=this.rules.block.def.exec(R);if(A){A[3]&&(A[3]=A[3].substring(1,A[3].length-1));var U=A[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:U,raw:A[0],href:A[2],title:A[3]}}},q.table=function(R){var A=this.rules.block.table.exec(R);if(A){var U={type:"table",header:K(A[1]).map(function(Ke){return{text:Ke}}),align:A[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:A[3]&&A[3].trim()?A[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(U.header.length===U.align.length){U.raw=A[0];var V=U.align.length,J,he,ke,Te;for(J=0;J<V;J++)/^ *-+: *$/.test(U.align[J])?U.align[J]="right":/^ *:-+: *$/.test(U.align[J])?U.align[J]="center":/^ *:-+ *$/.test(U.align[J])?U.align[J]="left":U.align[J]=null;for(V=U.rows.length,J=0;J<V;J++)U.rows[J]=K(U.rows[J],U.header.length).map(function(Ke){return{text:Ke}});for(V=U.header.length,he=0;he<V;he++)U.header[he].tokens=this.lexer.inline(U.header[he].text);for(V=U.rows.length,he=0;he<V;he++)for(Te=U.rows[he],ke=0;ke<Te.length;ke++)Te[ke].tokens=this.lexer.inline(Te[ke].text);return U}}},q.lheading=function(R){var A=this.rules.block.lheading.exec(R);if(A)return{type:"heading",raw:A[0],depth:A[2].charAt(0)==="="?1:2,text:A[1],tokens:this.lexer.inline(A[1])}},q.paragraph=function(R){var A=this.rules.block.paragraph.exec(R);if(A){var U=A[1].charAt(A[1].length-1)===`
`?A[1].slice(0,-1):A[1];return{type:"paragraph",raw:A[0],text:U,tokens:this.lexer.inline(U)}}},q.text=function(R){var A=this.rules.block.text.exec(R);if(A)return{type:"text",raw:A[0],text:A[0],tokens:this.lexer.inline(A[0])}},q.escape=function(R){var A=this.rules.inline.escape.exec(R);if(A)return{type:"escape",raw:A[0],text:p(A[1])}},q.tag=function(R){var A=this.rules.inline.tag.exec(R);if(A)return!this.lexer.state.inLink&&/^<a /i.test(A[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(A[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(A[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(A[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:A[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(A[0]):p(A[0]):A[0]}},q.link=function(R){var A=this.rules.inline.link.exec(R);if(A){var U=A[2].trim();if(!this.options.pedantic&&/^</.test(U)){if(!/>$/.test(U))return;var V=oe(U.slice(0,-1),"\\");if((U.length-V.length)%2===0)return}else{var J=ge(A[2],"()");if(J>-1){var he=A[0].indexOf("!")===0?5:4,ke=he+A[1].length+J;A[2]=A[2].substring(0,J),A[0]=A[0].substring(0,ke).trim(),A[3]=""}}var Te=A[2],Ke="";if(this.options.pedantic){var Ue=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Te);Ue&&(Te=Ue[1],Ke=Ue[3])}else Ke=A[3]?A[3].slice(1,-1):"";return Te=Te.trim(),/^</.test(Te)&&(this.options.pedantic&&!/>$/.test(U)?Te=Te.slice(1):Te=Te.slice(1,-1)),fe(A,{href:Te&&Te.replace(this.rules.inline._escapes,"$1"),title:Ke&&Ke.replace(this.rules.inline._escapes,"$1")},A[0],this.lexer)}},q.reflink=function(R,A){var U;if((U=this.rules.inline.reflink.exec(R))||(U=this.rules.inline.nolink.exec(R))){var V=(U[2]||U[1]).replace(/\s+/g," ");if(V=A[V.toLowerCase()],!V||!V.href){var J=U[0].charAt(0);return{type:"text",raw:J,text:J}}return fe(U,V,U[0],this.lexer)}},q.emStrong=function(R,A,U){U===void 0&&(U="");var V=this.rules.inline.emStrong.lDelim.exec(R);if(V&&!(V[3]&&U.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\
]`).replace("lheading",Le.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var le={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:F,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:F,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};le._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",le.punctuation=C(le.punctuation).replace(/punctuation/g,le._punctuation).getRegex(),le.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,le.escapedEmSt=/\\\*|\\_/g,le._comment=C(Le._comment).replace("(?:-->|$)","-->").getRegex(),le.emStrong.lDelim=C(le.emStrong.lDelim).replace(/punct/g,le._punctuation).getRegex(),le.emStrong.rDelimAst=C(le.emStrong.rDelimAst,"g").replace(/punct/g,le._punctuation).getRegex(),le.emStrong.rDelimUnd=C(le.emStrong.rDelimUnd,"g").replace(/punct/g,le._punctuation).getRegex(),le._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,le._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,le._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,le.autolink=C(le.autolink).replace("scheme",le._scheme).replace("email",le._email).getRegex(),le._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,le.tag=C(le.tag).replace("comment",le._comment).replace("attribute",le._attribute).getRegex(),le._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,le._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,le._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,le.link=C(le.link).replace("label",le._label).replace("href",le._href).replace("title",le._title).getRegex(),le.reflink=C(le.reflink).replace("label",le._label).replace("ref",Le._label).getRegex(),le.nolink=C(le.nolink).replace("ref",Le._label).getRegex(),le.reflinkSearch=C(le.reflinkSearch,"g").replace("reflink",le.reflink).replace("nolink",le.nolink).getRegex(),le.normal=O({},le),le.pedantic=O({},le.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:C(/^!?\[(label)\]\((.*?)\)/).replace("label",le._label).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le._label).getRegex()}),le.gfm=O({},le.normal,{escape:C(le.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),le.gfm.url=C(le.gfm.url,"i").replace("email",le.gfm._extended_email).getRegex(),le.breaks=O({},le.gfm,{br
`),this.blockTokens(R,this.tokens);for(var A;A=this.inlineQueue.shift();)this.inlineTokens(A.src,A.tokens);return this.tokens},q.blockTokens=function(R,A){var U=this;A===void 0&&(A=[]),this.options.pedantic?R=R.replace(/\t/g," ").replace(/^ +$/gm,""):R=R.replace(/^( *)(\t+)/gm,function(Ke,Ue,Ot){return Ue+" ".repeat(Ot.length)});for(var V,J,he,ke;R;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Ke){return(V=Ke.call({lexer:U},R,A))?(R=R.substring(V.raw.length),A.push(V),!0):!1}))){if(V=this.tokenizer.space(R)){R=R.substring(V.raw.length),V.raw.length===1&&A.length>0?A[A.length-1].raw+=`
`:A.push(V);continue}if(V=this.tokenizer.code(R)){R=R.substring(V.raw.length),J=A[A.length-1],J&&(J.type==="paragraph"||J.type==="text")?(J.raw+=`
`+V.raw,J.text+=`
`+V.text,this.inlineQueue[this.inlineQueue.length-1].src=J.text):A.push(V);continue}if(V=this.tokenizer.fences(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.heading(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.hr(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.blockquote(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.list(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.html(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.def(R)){R=R.substring(V.raw.length),J=A[A.length-1],J&&(J.type==="paragraph"||J.type==="text")?(J.raw+=`
`+V.raw,J.text+=`
`+V.raw,this.inlineQueue[this.inlineQueue.length-1].src=J.text):this.tokens.links[V.tag]||(this.tokens.links[V.tag]={href:V.href,title:V.title});continue}if(V=this.tokenizer.table(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.lheading(R)){R=R.substring(V.raw.length),A.push(V);continue}if(he=R,this.options.extensions&&this.options.extensions.startBlock&&function(){var Ke=1/0,Ue=R.slice(1),Ot=void 0;U.options.extensions.startBlock.forEach(function(It){Ot=It.call({lexer:this},Ue),typeof Ot=="number"&&Ot>=0&&(Ke=Math.min(Ke,Ot))}),Ke<1/0&&Ke>=0&&(he=R.substring(0,Ke+1))}(),this.state.top&&(V=this.tokenizer.paragraph(he))){J=A[A.length-1],ke&&J.type==="paragraph"?(J.raw+=`
`+V.raw,J.text+=`
`+V.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=J.text):A.push(V),ke=he.length!==R.length,R=R.substring(V.raw.length);continue}if(V=this.tokenizer.text(R)){R=R.substring(V.raw.length),J=A[A.length-1],J&&J.type==="text"?(J.raw+=`
`+V.raw,J.text+=`
`+V.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=J.text):A.push(V);continue}if(R){var Te="Infinite loop on byte: "+R.charCodeAt(0);if(this.options.silent){console.error(Te);break}else throw new Error(Te)}}return this.state.top=!0,A},q.inline=function(R,A){return A===void 0&&(A=[]),this.inlineQueue.push({src:R,tokens:A}),A},q.inlineTokens=function(R,A){var U=this;A===void 0&&(A=[]);var V,J,he,ke=R,Te,Ke,Ue;if(this.tokens.links){var Ot=Object.keys(this.tokens.links);if(Ot.length>0)for(;(Te=this.tokenizer.rules.inline.reflinkSearch.exec(ke))!=null;)Ot.includes(Te[0].slice(Te[0].lastIndexOf("[")+1,-1))&&(ke=ke.slice(0,Te.index)+"["+Ee("a",Te[0].length-2)+"]"+ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Te=this.tokenizer.rules.inline.blockSkip.exec(ke))!=null;)ke=ke.slice(0,Te.index)+"["+Ee("a",Te[0].length-2)+"]"+ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Te=this.tokenizer.rules.inline.escapedEmSt.exec(ke))!=null;)ke=ke.slice(0,Te.index)+"++"+ke.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;R;)if(Ke||(Ue=""),Ke=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(We){return(V=We.call({lexer:U},R,A))?(R=R.substring(V.raw.length),A.push(V),!0):!1}))){if(V=this.tokenizer.escape(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.tag(R)){R=R.substring(V.raw.length),J=A[A.length-1],J&&V.type==="text"&&J.type==="text"?(J.raw+=V.raw,J.text+=V.text):A.push(V);continue}if(V=this.tokenizer.link(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.reflink(R,this.tokens.links)){R=R.substring(V.raw.length),J=A[A.length-1],J&&V.type==="text"&&J.type==="text"?(J.raw+=V.raw,J.text+=V.text):A.push(V);continue}if(V=this.tokenizer.emStrong(R,ke,Ue)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.codespan(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.br(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.del(R)){R=R.substring(V.raw.length),A.push(V);continue}if(V=this.tokenizer.autolink(R,En)){R=R.substring(V.raw.length),A.push(V);continue}if(!this.state.inLink&&(V=this.tokenizer.url(R,En))){R=R.substring(V.raw.length),A.push(V);continue}if(he=R,this.options.extensions&&this.options.extensions.startInline&&function(){var We=1/0,hi=R.slice(1),ui=void 0;U.options.extensions.startInline.forEach(function(Go){ui=Go.call({lexer:this},hi),typeof ui=="number"&&ui>=0&&(We=Math.min(We,ui))}),We<1/0&&We>=0&&(he=R.substring(0,We+1))}(),V=this.tokenizer.inlineText(he,Yt)){R=R.substring(V.raw.length),V.raw.slice(-1)!=="_"&&(Ue=V.raw.slice(-1)),Ke=!0,J=A[A.length-1],J&&J.type==="text"?(J.raw+=V.raw,J.text+=V.text):A.push(V);continue}if(R){var It="Infinite loop on byte: "+R.charCodeAt(0);if(this.options.silent){console.error(It);break}else throw new Error(It)}}return A},i(Q,null,[{key:"rules",get:function(){return{block:Le,inline:le}}}]),Q}(),wt=function(){function Q(j){this.options=j||e.defaults}var q=Q.prototype;return q.code=function(R,A,U){var V=(A||"").match(/\S*/)[0];if(this.options.highlight){var J=this.options.highlight(R,V);J!=null&&J!==R&&(U=!0,R=J)}return R=R.replace(/\n$/,"")+`
`,V?'<pre><code class="'+this.options.langPrefix+p(V,!0)+'">'+(U?R:p(R,!0))+`</code></pre>
`:"<pre><code>"+(U?R:p(R,!0))+`</code></pre>
`},q.blockquote=function(R){return`<blockquote>
`+R+`</blockquote>
`},q.html=function(R){return R},q.heading=function(R,A,U,V){if(this.options.headerIds){var J=this.options.headerPrefix+V.slug(U);return"<h"+A+' id="'+J+'">'+R+"</h"+A+`>
`}return"<h"+A+">"+R+"</h"+A+`>
`},q.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},q.list=function(R,A,U){var V=A?"ol":"ul",J=A&&U!==1?' start="'+U+'"':"";return"<"+V+J+`>
`+R+"</"+V+`>
`},q.listitem=function(R){return"<li>"+R+`</li>
`},q.checkbox=function(R){return"<input "+(R?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},q.paragraph=function(R){return"<p>"+R+`</p>
`},q.table=function(R,A){return A&&(A="<tbody>"+A+"</tbody>"),`<table>
<thead>
`+R+`</thead>
`+A+`</table>
`},q.tablerow=function(R){return`<tr>
`+R+`</tr>
`},q.tablecell=function(R,A){var U=A.header?"th":"td",V=A.align?"<"+U+' align="'+A.align+'">':"<"+U+">";return V+R+("</"+U+`>
`)},q.strong=function(R){return"<strong>"+R+"</strong>"},q.em=function(R){return"<em>"+R+"</em>"},q.codespan=function(R){return"<code>"+R+"</code>"},q.br=function(){return this.options.xhtml?"<br/>":"<br>"},q.del=function(R){return"<del>"+R+"</del>"},q.link=function(R,A,U){if(R=k(this.options.sanitize,this.options.baseUrl,R),R===null)return U;var V='<a href="'+p(R)+'"';return A&&(V+=' title="'+A+'"'),V+=">"+U+"</a>",V},q.image=function(R,A,U){if(R=k(this.options.sanitize,this.options.baseUrl,R),R===null)return U;var V='<img src="'+R+'" alt="'+U+'"';return A&&(V+=' title="'+A+'"'),V+=this.options.xhtml?"/>":">",V},q.text=function(R){return R},Q}(),Hi=function(){function Q(){}var q=Q.prototype;return q.strong=function(R){return R},q.em=function(R){return R},q.codespan=function(R){return R},q.del=function(R){return R},q.html=function(R){return R},q.text=function(R){return R},q.link=function(R,A,U){return""+U},q.image=function(R,A,U){return""+U},q.br=function(){return""},Q}(),Ko=function(){function Q(){this.seen={}}var q=Q.prototype;return q.serialize=function(R){return R.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},q.getNextSafeSlug=function(R,A){var U=R,V=0;if(this.seen.hasOwnProperty(U)){V=this.seen[R];do V++,U=R+"-"+V;while(this.seen.hasOwnProperty(U))}return A||(this.seen[R]=V,this.seen[U]=0),U},q.slug=function(R,A){A===void 0&&(A={});var U=this.serialize(R);return this.getNextSafeSlug(U,A.dryrun)},Q}(),_n=function(){function Q(j){this.options=j||e.defaults,this.options.renderer=this.options.renderer||new wt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Hi,this.slugger=new Ko}Q.parse=function(R,A){var U=new Q(A);return U.parse(R)},Q.parseInline=function(R,A){var U=new Q(A);return U.parseInline(R)};var q=Q.prototype;return q.parse=function(R,A){A===void 0&&(A=!0);var U="",V,J,he,ke,Te,Ke,Ue,Ot,It,We,hi,ui,Go,St,Oi,rh,ah,Lr,Cd,lh=R.length;for(V=0;V<lh;V++){if(We=R[V],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[We.type]&&(Cd=this.options.extensions.renderers[We.type].call({parser:this},We),Cd!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(We.type))){U+=Cd||"";continue}switch(We.type){case"space":continue;case"hr":{U+=this.renderer.hr();continue}case"heading":{U+=this.renderer.heading(this.parseInline(We.tokens),We.depth,v(this.parseInline(We.tokens,this.textRenderer)),this.slugger);continue}case"code":{U+=this.renderer.code(We.text,We.lang,We.escaped);continue}case"table":{for(Ot="",Ue="",ke=We.header.length,J=0;J<ke;J++)Ue+=this.renderer.tablecell(this.parseInline(We.header[J].tokens),{header:!0,align:We.align[J]});for(Ot+=this.renderer.tablerow(Ue),It="",ke=We.rows.length,J=0;J<ke;J++){for(Ke=We.rows[J],Ue="",Te=Ke.length,he=0;he<Te;he++)Ue+=this.renderer.tablecell(this.parseInline(Ke[he].tokens),{header:!1,align:We.align[he]});It+=this.renderer.tablerow(Ue)}U+=this.renderer.table(Ot,It);continue}case"blockquote":{It=this.parse(We.tokens),U+=this.renderer.blockquote(It);continue}case"list":{for(hi=We.ordered,ui=We.start,Go=We.loose,ke=We.items.length,It="",J=0;J<ke;J++)Oi=We.items[J],rh=Oi.checked,ah=Oi.task,St="",Oi.task&&(Lr=this.renderer.checkbox(rh),Go?Oi.tokens.length>0&&Oi.tokens[0].type==="paragraph"?(Oi.tokens[0].text=Lr+" "+Oi.tokens[0].text,Oi.tokens[0].tokens&&Oi.tokens[0].tokens.length>0&&Oi.tokens[0].tokens[0].type==="text"&&(Oi.tokens[0].tokens[0].text=Lr+" "+Oi.tokens[0].tokens[0].text)):Oi.tokens.unshift({type:"text",text:Lr}):St+=Lr),St+=this.parse(Oi.tokens,Go),It+=this.renderer.listitem(St,ah,rh);U+=this.renderer.list(It,hi,ui);continue}case"html":{U+=this.renderer.html(We.text);continue}case"paragraph":{U+=this.renderer.paragraph(this.parseInline(We.tokens));continue}case"text":{for(It=We.tokens?this.parseInline(We.tokens):We.text;V+1<lh&&R[V+1].type==="text";)We=R[++V],It+=`
`+(We.tokens?this.parseInline(We.tokens):We.text);U+=A?this.renderer.paragraph(It):It;continue}default:{var dh='Token with "'+We.type+'" type was not found.';if(this.options.silent){console.error(dh);return}else throw new Error(dh)}}}return U},q.parseInline=function(R,A){A=A||this.renderer;var U="",V,J,he,ke=R.length;for(V=0;V<ke;V++){if(J=R[V],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[J.type]&&(he=this.options.extensions.renderers[J.type].call({parser:this},J),he!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(J.type))){U+=he||"";continue}switch(J.type){case"escape":{U+=A.text(J.text);break}case"html":{U+=A.html(J.text);break}case"link":{U+=A.link(J.href,J.title,this.parseInline(J.tokens,A));break}case"image":{U+=A.image(J.href,J.title,J.text);break}case"strong":{U+=A.strong(this.parseInline(J.tokens,A));break}case"em":{U+=A.em(this.parseInline(J.tokens,A));break}case"codespan":{U+=A.codespan(J.text);break}case"br":{U+=A.br();break}case"del":{U+=A.del(this.parseInline(J.tokens,A));break}case"text":{U+=A.text(J.text);break}default:{var Te='Token with "'+J.type+'" type was not found.';if(this.options.silent){console.error(Te);return}else throw new Error(Te)}}}return U},Q}();function ze(Q,q,j){if(typeof Q>"u"||Q===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Q!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Q)+", string expected");if(typeof q=="function"&&(j=q,q=null),q=O({},ze.defaults,q||{}),ye(q),j){var R=q.highlight,A;try{A=Pi.lex(Q,q)}catch(ke){return j(ke)}var U=function(Te){var Ke;if(!Te)try{q.walkTokens&&ze.walkTokens(A,q.walkTokens),Ke=_n.parse(A,q)}catch(Ue){Te=Ue}return q.highlight=R,Te?j(Te):j(null,Ke)};if(!R||R.length<3||(delete q.highlight,!A.length))return U();var V=0;ze.walkTokens(A,function(ke){ke.type==="code"&&(V++,setTimeout(function(){R(ke.text,ke.lang,function(Te,Ke){if(Te)return U(Te);Ke!=null&&Ke!==ke.text&&(ke.text=Ke,ke.escaped=!0),V--,V===0&&U()})},0))}),V===0&&U();return}function J(ke){if(ke.message+=`
Please report this to https://github.com/markedjs/marked.`,q.silent)return"<p>An error occurred:</p><pre>"+p(ke.message+"",!0)+"</pre>";throw ke}try{var he=Pi.lex(Q,q);if(q.walkTokens){if(q.async)return Promise.all(ze.walkTokens(he,q.walkTokens)).then(function(){return _n.parse(he,q)}).catch(J);ze.walkTokens(he,q.walkTokens)}return _n.parse(he,q)}catch(ke){J(ke)}}ze.options=ze.setOptions=function(Q){return O(ze.defaults,Q),l(ze.defaults),ze},ze.getDefaults=a,ze.defaults=e.defaults,ze.use=function(){for(var Q=arguments.length,q=new Array(Q),j=0;j<Q;j++)q[j]=arguments[j];var R=O.apply(void 0,[{}].concat(q)),A=ze.defaults.extensions||{renderers:{},childTokens:{}},U;q.forEach(function(V){if(V.extensions&&(U=!0,V.extensions.forEach(function(he){if(!he.name)throw new Error("extension name required");if(he.renderer){var ke=A.renderers?A.renderers[he.name]:null;ke?A.renderers[he.name]=function(){for(var Te=arguments.length,Ke=new Array(Te),Ue=0;Ue<Te;Ue++)Ke[Ue]=arguments[Ue];var Ot=he.renderer.apply(this,Ke);return Ot===!1&&(Ot=ke.apply(this,Ke)),Ot}:A.renderers[he.name]=he.renderer}if(he.tokenizer){if(!he.level||he.level!=="block"&&he.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");A[he.level]?A[he.level].unshift(he.tokenizer):A[he.level]=[he.tokenizer],he.start&&(he.level==="block"?A.startBlock?A.startBlock.push(he.start):A.startBlock=[he.start]:he.level==="inline"&&(A.startInline?A.startInline.push(he.start):A.startInline=[he.start]))}he.childTokens&&(A.childTokens[he.name]=he.childTokens)})),V.renderer&&function(){var he=ze.defaults.renderer||new wt,ke=function(Ue){var Ot=he[Ue];he[Ue]=function(){for(var It=arguments.length,We=new Array(It),hi=0;hi<It;hi++)We[hi]=arguments[hi];var ui=V.renderer[Ue].apply(he,We);return ui===!1&&(ui=Ot.apply(he,We)),ui}};for(var Te in V.renderer)ke(Te);R.renderer=he}(),V.tokenizer&&function(){var he=ze.defaults.tokenizer||new xe,ke=function(Ue){var Ot=he[Ue];he[Ue]=function(){for(var It=arguments.length,We=new Array(It),hi=0;hi<It;hi++)We[hi]=arguments[hi];var ui=V.tokenizer[Ue].apply(he,We);return ui===!1&&(ui=Ot.apply(he,We)),ui}};for(var Te in V.tokenizer)ke(Te);R.tokenizer=he}(),V.walkTokens){var J=ze.defaults.walkTokens;R.walkTokens=function(he){var ke=[];return ke.push(V.walkTokens.call(this,he)),J&&(ke=ke.concat(J.call(this,he))),ke}}U&&(R.extensions=A),ze.setOptions(R)})},ze.walkTokens=function(Q,q){for(var j=[],R=function(){var J=U.value;switch(j=j.concat(q.call(ze,J)),J.type){case"table":{for(var he=r(J.header),ke;!(ke=he()).done;){var Te=ke.value;j=j.concat(ze.walkTokens(Te.tokens,q))}for(var Ke=r(J.rows),Ue;!(Ue=Ke()).done;)for(var Ot=Ue.value,It=r(Ot),We;!(We=It()).done;){var hi=We.value;j=j.concat(ze.walkTokens(hi.tokens,q))}break}case"list":{j=j.concat(ze.walkTokens(J.items,q));break}default:ze.defaults.extensions&&ze.defaults.extensions.childTokens&&ze.defaults.extensions.childTokens[J.type]?ze.defaults.extensions.childTokens[J.type].forEach(function(ui){j=j.concat(ze.walkTokens(J[ui],q))}):J.tokens&&(j=j.concat(ze.walkTokens(J.tokens,q)))}},A=r(Q),U;!(U=A()).done;)R();return j},ze.parseInline=function(Q,q){if(typeof Q>"u"||Q===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof Q!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(Q)+", string expected");q=O({},ze.defaults,q||{}),ye(q);try{var j=Pi.lexInline(Q,q);return q.walkTokens&&ze.walkTokens(j,q.walkTokens),_n.parseInline(j,q)}catch(R){if(R.message+=`
Please report this to https://github.com/markedjs/marked.`,q.silent)return"<p>An error occurred:</p><pre>"+p(R.message+"",!0)+"</pre>";throw R}},ze.Parser=_n,ze.parser=_n.parse,ze.Renderer=wt,ze.TextRenderer=Hi,ze.Lexer=Pi,ze.lexer=Pi.lex,ze.Tokenizer=xe,ze.Slugger=Ko,ze.parse=ze;var qo=ze.options,Sr=ze.setOptions,yr=ze.use,Zi=ze.walkTokens,wo=ze.parseInline,h0=ze,u0=_n.parse,FL=Pi.lex;e.Lexer=Pi,e.Parser=_n,e.Renderer=wt,e.Slugger=Ko,e.TextRenderer=Hi,e.Tokenizer=xe,e.getDefaults=a,e.lexer=FL,e.marked=ze,e.options=qo,e.parse=h0,e.parseInline=wo,e.parser=u0,e.setOptions=Sr,e.use=yr,e.walkTokens=Zi,Object.defineProperty(e,"__esModule",{value:!0})})})();gs.Lexer||exports.Lexer;gs.Parser||exports.Parser;gs.Renderer||exports.Renderer;gs.Slugger||exports.Slugger;gs.TextRenderer||exports.TextRenderer;gs.Tokenizer||exports.Tokenizer;gs.getDefaults||exports.getDefaults;gs.lexer||exports.lexer;var Ea=gs.marked||exports.marked;gs.options||exports.options;gs.parse||exports.parse;gs.parseInline||exports.parseInline;gs.parser||exports.parser;gs.setOptions||exports.setOptions;gs.use||exports.use;gs.walkTokens||exports.walkTokens;function Mie(o){return JSON.stringify(o,Aie)}function qI(o){let e=JSON.parse(o);return e=GI(e),e}function Aie(o,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function GI(o,e=0){if(!o||e>200)return o;if(typeof o=="object"){switch(o.$mid){case 1:return Ie.revive(o);case 2:return new RegExp(o.source,o.flags);case 16:return new Date(o.source)}if(o instanceof FS||o instanceof Uint8Array)return o;if(Array.isArray(o))for(let t=0;t<o.length;++t)o[t]=GI(o[t],e+1);else for(const t in o)Object.hasOwnProperty.call(o,t)&&(o[t]=GI(o[t],e+1))}return o}const UD=Object.freeze({image:(o,e,t)=>{let i=[],n=[];return o&&({href:o,dimensions:i}=Lie(o),n.push(`src="${j0(o)}"`)),t&&n.push(`alt="${j0(t)}"`),e&&n.push(`title="${j0(e)}"`),i.length&&(n=n.concat(i)),"<img "+n.join(" ")+">"},paragraph:o=>`<p>${o}</p>`,link:(o,e,t)=>typeof o!="string"?"":(o===t&&(t=zD(t)),e=typeof e=="string"?j0(zD(e)):"",o=zD(o),o=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),`<a href="${o}" title="${e||o}">${t}</a>`)});function hy(o,e={},t={}){var i,n;const s=new X;let r=!1;const a=A2(e),l=function(v){let b;try{b=qI(decodeURIComponent(v))}catch{}return b?(b=J3(b,C=>{if(o.uris&&o.uris[C])return Ie.revive(o.uris[C])}),encodeURIComponent(JSON.stringify(b))):v},d=function(v,b){const C=o.uris&&o.uris[v];let w=Ie.revive(C);return b?v.startsWith(qe.data+":")?v:(w||(w=Ie.parse(v)),x7.uriToBrowserUri(w).toString(!0)):!w||Ie.parse(v).toString()===w.toString()?v:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},c=new Ea.Renderer;c.image=UD.image,c.link=UD.link,c.paragraph=UD.paragraph;const h=[],u=[];if(e.codeBlockRendererSync?c.code=(v,b)=>{const C=KI.nextId(),w=e.codeBlockRendererSync(b4(b),v);return u.push([C,w]),`<div class="code" data-code="${C}">${E1(v)}</div>`}:e.codeBlockRenderer&&(c.code=(v,b)=>{const C=KI.nextId(),w=e.codeBlockRenderer(b4(b),v);return h.push(w.then(S=>[C,S])),`<div class="code" data-code="${C}">${E1(v)}</div>`}),e.actionHandler){const v=function(w){let S=w.target;if(!(S.tagName!=="A"&&(S=S.parentElement,!S||S.tagName!=="A")))try{let k=S.dataset.href;k&&(o.baseUri&&(k=$D(Ie.from(o.baseUri),k)),e.actionHandler.callback(k,w))}catch(k){Ve(k)}finally{w.preventDefault()}},b=e.actionHandler.disposables.add(new Je(a,"click")),C=e.actionHandler.disposables.add(new Je(a,"auxclick"));e.actionHandler.disposables.add(pe.any(b.event,C.event)(w=>{const S=new No(w);!S.leftButton&&!S.middleButton||v(S)})),e.actionHandler.disposables.add($(a,"keydown",w=>{const S=new Vt(w);!S.equals(10)&&!S.equals(3)||v(S)}))}o.supportHtml||(t.sanitizer=v=>(o.isTrusted?v.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?v:"",t.sanitize=!0,t.silent=!0),t.renderer=c;let g=(i=o.value)!==null&&i!==void 0?i:"";g.length>1e5&&(g=`${g.substr(0,1e5)}…`),o.supportThemeIcons&&(g=bie(g));let f;if(e.fillInIncompleteTokens){const v=Object.assign(Object.assign({},Ea.defaults),t),b=Ea.lexer(g,v),
`,o.hr=()=>"",o.list=(e,t)=>e,o.listitem=e=>e+`
`,o.paragraph=e=>e+`
`,o.table=(e,t)=>e+t+`
`,o.tablerow=e=>e,o.tablecell=(e,t)=>e+" ",o.strong=e=>e,o.em=e=>e,o.codespan=e=>e,o.br=()=>`
`,o.del=e=>e,o.image=(e,t,i)=>"",o.text=e=>e,o.link=(e,t,i)=>i,o});function O2(o){let e="";return o.forEach(t=>{e+=t.raw}),e}function Hie(o){for(const e of o.tokens)if(e.type==="text"){const t=e.raw.split(`
`),i=t[t.length-1];if(i.includes("`"))return $ie(o);if(i.includes("**"))return Zie(o);if(i.match(/\*\w/))return jie(o);if(i.match(/(^|\s)__\w/))return Yie(o);if(i.match(/(^|\s)_\w/))return Kie(o);if(i.match(/(^|\s)\[.*\]\(\w*/))return qie(o);if(i.match(/(^|\s)\[\w/))return Gie(o)}}function zie(o){let e,t;for(e=0;e<o.length;e++){const i=o[e];if(i.type==="paragraph"&&i.raw.match(/(\n|^)```/)){t=Uie(o.slice(e));break}if(i.type==="paragraph"&&i.raw.match(/(\n|^)\|/)){t=Xie(o.slice(e));break}if(e===o.length-1&&i.type==="paragraph"){const n=Hie(i);if(n){t=[n];break}}}if(t){const i=[...o.slice(0,e),...t];return i.links=o.links,i}return o}function Uie(o){const e=O2(o);return Ea.lexer(e+"\n```")}function $ie(o){return og(o,"`")}function jie(o){return og(o,"*")}function Kie(o){return og(o,"_")}function qie(o){return og(o,")")}function Gie(o){return og(o,"](about:blank)")}function Zie(o){return og(o,"**")}function Yie(o){return og(o,"__")}function og(o,e){const t=O2(Array.isArray(o)?o:[o]);return Ea.lexer(t+e)[0]}function Xie(o){const e=O2(o),t=e.split(`
`);let i,n=!1;for(let s=0;s<t.length;s++){const r=t[s].trim();if(typeof i>"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(s!==t.length-1)return;n=!0}else return}if(typeof i=="number"&&i>0){const s=n?t.slice(0,-1).join(`
`):e,r=!!s.match(/\|\s*$/),a=s+(r?"":"|")+`
|${" --- |".repeat(i)}`;return Ea.lexer(a)}}class Qie{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}function Ns(o,e,t){return Math.min(Math.max(o,e),t)}class pB{constructor(){this._n=1,this._val=0}update(e){return this._val=this._val+(e-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class Jie{constructor(e){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(e),this._values.fill(0,0,e)}update(e){const t=this._values[this._index];return this._values[this._index]=e,this._index=(this._index+1)%this._values.length,this._sum-=t,this._sum+=e,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}class Eg extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}var Tn;(function(o){function e(s,r){if(s.start>=r.end||r.start>=s.end)return{start:0,end:0};const a=Math.max(s.start,r.start),l=Math.min(s.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}o.intersect=e;function t(s){return s.end-s.start<=0}o.isEmpty=t;function i(s,r){return!t(e(s,r))}o.intersects=i;function n(s,r){const a=[],l={start:s.start,end:Math.min(r.start,s.end)},d={start:Math.max(r.end,s.start),end:s.end};return t(l)||a.push(l),t(d)||a.push(d),a}o.relativeComplement=n})(Tn||(Tn={}));function C4(o,e){const t=[];for(const i of e){if(o.start>=i.range.end)continue;if(o.end<i.range.start)break;const n=Tn.intersect(o,i.range);Tn.isEmpty(n)||t.push({range:n,size:i.size})}return t}function YI({start:o,end:e},t){return{start:o+t,end:e+t}}function ene(o){const e=[];let t=null;for(const i of o){const n=i.range.start,s=i.range.end,r=i.size;if(t&&r===t.size){t.range.end=s;continue}t={range:{start:n,end:s},size:r},e.push(t)}return e}function tne(...o){return ene(o.reduce((e,t)=>e.concat(t),[]))}class w4{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,s=C4({start:0,end:e},this.groups),r=C4({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:YI(l.range,n),size:l.size})),a=i.map((l,d)=>({range:{start:e+d,end:e+d+1},size:l.size}));this.groups=tne(s,a,r),this._size=this._paddingTop+this.groups.reduce((l,d)=>l+d.size*(d.range.end-d.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;if(e<this._paddingTop)return 0;let t=0,i=this._paddingTop;for(const n of this.groups){const s=n.range.end-n.range.start,r=i+s*n.size;if(e<r)return t+Math.floor((e-i)/n.size);t+=s,i=r}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const n of this.groups){const s=n.range.end-n.range.start,r=i+s;if(e<r)return this._paddingTop+t+(e-i)*n.size;t+=s*n.size,i=r}return-1}}function ine(o){var e;try{(e=o.parentElement)===null||e===void 0||e.removeChild(o)}catch{}}class nne{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const n=ee(".monaco-list-row"),r=this.getRenderer(e).renderTemplate(n);t={domNode:n,templateId:e,templateData:r}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const t of this.transactionNodesPendingRemoval)this.doRemoveNode(t);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(i).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),ine(e)}getTemplateCache(e){let t=this.cache.get(e);
.monaco-drag-image,
.monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
`),e.listFocusAndSelectionForeground&&s.push(`
.monaco-drag-image,
.monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
`),e.listInactiveFocusForeground&&(s.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),s.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&s.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(s.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),s.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(s.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),s.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&s.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&s.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&s.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const r=Jh(e.listFocusAndSelectionOutline,Jh(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&s.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&s.push(`
.monaco-drag-image,
.monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
`);const a=Jh(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&s.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&s.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&s.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&s.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&s.push(`
.monaco-list${n}.drop-target,
.monaco-list${n} .monaco-list-rows.drop-target,
.monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }
`),e.tableColumnsBorder&&s.push(`
.monaco-table > .monaco-split-view2,
.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,
.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,
.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
border-color: ${e.tableColumnsBorder};
}
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {
border-color: transparent;
}
`),e.tableOddRowsBackgroundColor&&s.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=s.join(`
`)}}const fne={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:z.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:z.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:z.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},mne={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function pne(o,e){const t=o.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&o[n]===e-(t-n);)i.push(o[n--]);for(i.reverse(),n=t;n<o.length&&o[n]===e+(n-t);)i.push(o[n++]);return i}function XI(o,e){const t=[];let i=0,n=0;for(;i<o.length||n<e.length;)if(i>=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){t.push(o[i]),i++,n++;continue}else o[i]<e[n]?t.push(o[i++]):t.push(e[n++]);return t}function _ne(o,e){const t=[];let i=0,n=0;for(;i<o.length||n<e.length;)if(i>=o.length)t.push(e[n++]);else if(n>=e.length)t.push(o[i++]);else if(o[i]===e[n]){i++,n++;continue}else o[i]<e[n]?t.push(o[i++]):n++;return t}const L4=(o,e)=>o-e;class vne{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,n){let s=0;for(const r of this.renderers)r.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){var s;let r=0;for(const a of this.renderers)(s=a.disposeElement)===null||s===void 0||s.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 bne{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 s=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof s=="number"?i.setAttribute("aria-level",`${s}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class Cne{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 s,r;(r=(s=this.dnd).onDragLeave)===null||r===void 0||r.call(s,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 br{get onDidChangeFocus(){return pe.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return pe.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.
`)}styleSelectElement(){var e,t,i;const n=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",s=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",r=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=s,this.selectElement.style.borderColor=r}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",n=Jh(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const s=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=s,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const n=document.createElement("option");return n.value=e,n.text=e,n.disabled=!!i,n}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Si(this.selectElement),i=getComputedStyle(this.selectElement),n=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),s=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),r=t.top-Na.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),d=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let c=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const h=this._hasDetails?this._cachedMaxDetailsHeight:0,u=c+n+h,g=Math.floor((s-n-h)/this.getHeight()),f=Math.floor((r-n-h)/this.getHeight());if(e)return t.top+t.height>window.innerHeight-22||t.top<Na.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||g<1&&f<1?!1:(g<Na.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&f>g&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selection
`)}}const ag=new kne;si.add(xne.IconContribution,ag);function qt(o,e,t,i){return ag.registerIcon(o,e,t,i)}function LB(){return ag}function Ine(){const o=y9();for(const e in o){const t="\\"+o[e].toString(16);ag.registerIcon(e,{fontCharacter:t})}}Ine();const DB="vscode://schemas/icons",xB=si.as(VS.JSONContribution);xB.registerSchema(DB,ag.getIconSchema());const k4=new kt(()=>xB.notifySchemaChanged(DB),200);ag.onDidChange(()=>{k4.isScheduled()||k4.schedule()});const kB=qt("widget-close",se.close,m("widgetClose","Icon for the close action in widgets."));qt("goto-previous-location",se.arrowUp,m("previousChangeIcon","Icon for goto previous editor location."));qt("goto-next-location",se.arrowDown,m("nextChangeIcon","Icon for goto next editor location."));be.modify(se.sync,"spin");be.modify(se.loading,"spin");var Ene=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},KD=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},Tne=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},Pd;const K0=3;class xp{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 qD{constructor(e){this.entries=e}}const Nne=qt("diff-review-insert",se.add,m("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),Rne=qt("diff-review-remove",se.remove,m("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),Mne=qt("diff-review-close",se.close,m("diffReviewCloseIcon","Icon for 'Close' in diff review."));let Qd=Pd=class extends H{constructor(e,t,i,n){super(),this._languageService=t,this._audioCueService=i,this._configurationService=n,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=ut(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=ut(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new fo(this.actionBarContainer.domNode)),this._actionBar.push(new mn("diffreview.close",m("label.close","Close"),"close-diff-review "+be.asClassName(Mne),!0,()=>Tne(this,void 0,void 0,function*(){return this.hide()})),{label:!1,icon:!0}),this.domNode=ut(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=ut(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new qm(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(Qt(this.domNode.domNode,"click",s=>{s.preventDefault();const r=E7(s.target,"diff-review-row");r&&this._goToRow(r)})),this._register(Qt(this.domNode.domNode,"keydown",s=>{(s.equals(18)||s.equals(2066)||s.equals(530))&&(s.preventDefault(),this._goToRow(this._getNextRow(),"next")),(s.equals(16)||s.equals(2064)||s.equals(528))&&(s.preventDefault(),this._goToRow(this._getPrevRow(),"previous")),(s.equals(9)||s.equals(2057)||s.equals(521)||s.equals(1033)||s.equals(10)||s.equals(3))&&(s.preventDefault(),this.accept())})),this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("accessibility.verbosity.diffEditor")&&this._diffEditor.u
`:`\r
`)}else yield this._clipboardService.writeText(_)})),d.push(u)),i.getOption(89)||d.push(new mn("diff.inline.revertChange",m("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>GD(this,void 0,void 0,function*(){const _=new D(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),v=n.originalModel.getValueInRange(_);if(n.modifiedEndLineNumber===0){const b=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new D(n.modifiedStartLineNumber,b,n.modifiedStartLineNumber,b),text:l+v}])}else{const b=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new D(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,b),text:v}])}})));const f=i.getOption(125)&&!hr,p=(_,v)=>{var b;this._contextMenuService.showContextMenu({domForShadowRoot:f&&(b=i.getDomNode())!==null&&b!==void 0?b:void 0,getAnchor:()=>({x:_,y:v}),getActions:()=>(u&&(u.label=c?m("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+h):m("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.originalStartLineNumber+h)),d),autoSelectFirstItem:!0})};this._register(Qt(this._diffActions,"mousedown",_=>{const{top:v,height:b}=Si(this._diffActions),C=Math.floor(a/3);_.preventDefault(),p(_.posx,v+b+C)})),this._register(i.onMouseMove(_=>{_.target.type===8||_.target.type===5?_.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,h=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(),h=this._updateLightBulbPosition(this._marginDomNode,_.event.browserEvent.y,a),p(_.event.posx,_.event.posy+a))}))}_updateLightBulbPosition(e,t,i){const{top:n}=Si(e),s=t-n,r=Math.floor(s/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this.diff.viewLineCounts){let l=0;for(let d=0;d<this.diff.viewLineCounts.length;d++)if(l+=this.diff.viewLineCounts[d],r<l)return d}return r}}const Cr=tt("editorWorkerService");var Pne=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},I4=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},One=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},Sh;let kv=Sh=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new B,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}computeDiff(e,t,i,n){var s,r;return One(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,n);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new ho(new mt(1,2),new mt(1,t.getLineCount()+1),[new Ic(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),d=Sh.diffCache.get(a);if(d&&d.context===l)return d.result;const c=Bn.create(),h=yield this.editorWorkerSe
.monaco-editor .diagonal-fill {
background-image: linear-gradient(
-45deg,
${t} 12.5%,
#0000 12.5%, #0000 50%,
${t} 50%, ${t} 62.5%,
#0000 62.5%, #0000 100%
);
background-size: 8px 8px;
}
`)});var Kne=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qne=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},Gne=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};let JI=class extends H{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new B),this._onCodeEditorAdd=this._register(new B),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new B),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new B),this._onDiffEditorAdd=this._register(new B),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new B),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new rs,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;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 s;this._modelProperties.has(n)?s=this._modelProperties.get(n):(s=new Map,this._modelProperties.set(n,s)),s.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 Gne(this,void 0,void 0,function*(){for(const n of this._codeEditorOpenHandlers){const s=yield n(e,t,i);if(s!==null)return s}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Oe(t)}};JI=Kne([qne(0,Vi)],JI);var Zne=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},A4=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},Yne=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};let vw=class extends JI{constructor(e,t){super(t),this.onCodeEditorAdd(()=>this._checkContextKey()),this.onCodeEditorRemove(()=>this._checkContextKey()),this._editorIsOpen=e.creat
`)}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 Qne{constructor(e,t,i,n,s,r,a){this.id=++OB,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new F4),this.removedResources.has(t)||this.removedResources.set(t,new O4(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 F4),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new O4(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class FB{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 Z8(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let a=0,l=this._past.length;a<l;a++,n++){const d=this._past[a];i&&(n>=t||d.id!==e.elements[n])&&(i=!1,s=0),!i&&d.type===1&&d.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)}s!==-1&&(this._past=this._past.slice(0,s)),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 ZD{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 BB=new FB("","");BB.locked=!0;let tE=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=gm.None,i=Ia.None){if(e.type===0){const n=G0(e.resource),s=this.getUriComparisonKey(e.resource);this._pushElement(new Z0(e,n,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,s=[],r=[];for(const a of e.resources){const l=G0(a),d=this.getUriComparisonKey(a);n.has(d)||(n.add(d),s.push(l),r.push(d))}s.length===1?this._pushElement(new Z0(e,s[0],r[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new Qne(e,s,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],s=e.strResources[t];let r;this._editStacks.has(s)?r=this._editStacks.get(s):(r=new FB(n,s),this._editStacks.set(s,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 s of i){const r=G0(s.resource),a=this.getUriComparisonKey(s.resource),l=new Z0(s,r,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).splitPastWorkspaceElement(e,n)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),n=new Map;for(const s of i){const r=G0(s.resource),a=this.getUriComparisonKey(s.resource),l=new Z0(s,r,a,0,0,0,0);n.set(l.strResource,l)}for(const s of e.strResources){if(t&&t.has(s))continue;this._editStacks.get(s).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 Z8(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,s]of this._editStacks){const r=s.getClosestPastElement();r&&r.sourceId===e&&(!t||r.sourceOrder>t.sourceOrder)&&(t=r,i=n)}return[t,i]}canUndo(e){if(e instanceof Ia){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){Ve(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,s){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(),s()),l=>(r(),n.dispose(),this._onError(l,e))):(r(),n.dispose(),s())}_invokeWorkspacePrepare(e){return q0(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?dR(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)||BB);return new ZD(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new Y0(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(n),new Y0}_checkWorkspa
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const s of e.keys)this.affectedKeys.add(s);for(const[,s]of e.overrides)for(const r of s)this.affectedKeys.add(r);this._affectsConfigStr=this._marker;for(const s of this.affectedKeys)this._affectsConfigStr+=s+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=gy.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,s=this._affectsConfigStr.indexOf(n);if(s<0)return!1;const r=s+n.length;if(r>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(r);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,d=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!ao(l,d)}return!0}}const yw={kind:0},Ese={kind:1};function Tse(o,e,t){return{kind:2,commandId:o,commandArgs:e,isBubble:t}}class M_{constructor(e,t,i){var n;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const s of e){const r=s.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=M_.handleRemovals([].concat(e).concat(t));for(let s=0,r=this._keybindings.length;s<r;s++){const a=this._keybindings[s];if(a.chords.length===0)continue;const l=(n=a.when)===null||n===void 0?void 0:n.substituteConstants();l&&l.type===0||this._addKeyPress(a.chords[0],a)}}static _isTargetedForRemoval(e,t,i){if(t){for(let n=0;n<t.length;n++)if(t[n]!==e.chords[n])return!1}return!(i&&i.type!==1&&(!e.when||!Y$(i,e.when)))}static handleRemovals(e){const t=new Map;for(let n=0,s=e.length;n<s;n++){const r=e[n];if(r.command&&r.command.charAt(0)==="-"){const a=r.command.substring(1);t.has(a)?t.get(a).push(r):t.set(a,[r])}}if(t.size===0)return e;const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];if(!r.command||r.command.length===0){i.push(r);continue}if(r.command.charAt(0)==="-")continue;const a=t.get(r.command);if(!a||!r.isDefault){i.push(r);continue}let l=!1;for(const d of a){const c=d.when;if(this._isTargetedForRemoval(r,d.chords,c)){l=!0;break}}if(!l){i.push(r);continue}}return i}_addKeyPress(e,t){const i=this._map.get(e);if(typeof i>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let n=i.length-1;n>=0;n--){const s=i[n];if(s.command===t.command)continue;let r=!0;for(let a=1;a<s.chords.length&&a<t.chords.length;a++)if(s.chords[a]!==t.chords[a]){r=!1;break}r&&M_.whenIsEntirelyIncluded(s.when,t.when)&&this._removeFromLookupMap(s)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);typeof t>"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,n=t.length;i<n;i++)if(t[i]===e){t.splice(i,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:qk(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let n=i.length-1;n>=0;n--){const s=i[n];if(t.contextMatchesRules(s.when))return s}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const s=this._map.get(n[0]);if(s===void 0)return this._log("\\ No keybinding entries."),yw;let r=null;if(n.length<2)r=s;else{r=[];for(let l=0,d=s.length;l<d;l++){const c=s[l];if(n.length>c.chords.length)continue;let h=!0;for(let u=1;u<n.length;u++)if(c.chords[u]!==n[u]){h=!1;break}h&&r.push(c)}}const a=this._findCommand(e,r);return a?n.length<a.chords.length?(this._log(`\\ From ${r.length} keybinding entries, awaiting ${a.chords.length-n.length} more chord(s), when: ${Y4(a.when)}, source: ${X4(a)}.`),Ese):(this._log(`\\ From ${r.length} keybinding entri
:host {
all: initial; /* 1st rule so subsequent properties are reset. */
}
.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 Xse=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Qse=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let uE=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 _m(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=Oe(()=>{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)}};uE=Xse([Qse(0,Xm)],uE);let vm=[],U2=[],GB=[];function eC(o,e=!1){Jse(o,!1,e)}function Jse(o,e,t){const i=eoe(o,e);vm.push(i),i.userConfigured?GB.push(i):U2.push(i),t&&!i.userConfigured&&vm.forEach(n=>{n.mime===i.mime||n.userConfigured||(i.extension&&n.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&n.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&n.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&n.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function eoe(o,e){return{id:o.id,mime:o.mime,filename:o.filename,extension:o.extension,filepattern:o.filepattern,firstline:o.firstline,userConfigured:e,filenameLowercase:o.filename?o.filename.toLowerCase():void 0,extensionLowercase:o.extension?o.extension.toLowerCase():void 0,filepatternLowercase:o.filepattern?HB(o.filepattern.toLowerCase()):void 0,filepatternOnPath:o.filepattern?o.filepattern.indexOf(Ri.sep)>=0:!1}}function toe(){vm=vm.filter(o=>o.userConfigured),U2=[]}function ioe(o,e){return noe(o,e).map(t=>t.id)}function noe(o,e){let t;if(o)switch(o.scheme){case qe.file:t=o.fsPath;break;case qe.data:{t=Mc.parseMetaData(o).get(Mc.META_DATA_LABEL);break}case qe.vscodeNotebookCell:t=void 0;break;default:t=o.path}if(!t)return[{id:"unknown",mime:vi.unknown}];t=t.toLowerCase();const i=oc(t),n=J4(t,i,GB);if(n)return[n,{id:co,mime:vi.text}];const s=J4(t,i,U2);if(s)return[s,{id:co,mime:vi.text}];if(e){const r=soe(e);if(r)return[r,{id:co,mime:vi.text}]}return[{id:"unknown",mime:vi.unknown}]}function J4(o,e,t){var i;let n,s,r;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){n=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){const d=l.filepatternOnPath?o:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,d)&&(s=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}if(n)return n;if(s)return s;if(r)return r}function soe(o){if(SR(o)&&(o=o.substr(1)),o.length>0)for(let e=vm.length-1;e>=0;e--){const t=vm[e];if(!t.firstline)continue;const i=o.match(t.firstline);if(i&&i.length>0)return t}}const tC=Object.prototype.hasOwnProperty,eF="vs.editor.nullLanguage";class ooe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(eF,0),this._register(co,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;con
[{1}] {2}`,s,z2.modifierLabels[io].altKey,d)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&loe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(n)if(be.isThemeIcon(n)){const s=be.asClassNameArray(n);i.classList.add(...s),this._itemClassDispose.value=Oe(()=>{i.classList.remove(...s)})}else i.style.backgroundImage=lm(this._themeService.getColorTheme().type)?Tc(n.dark):Tc(n.light),i.classList.add("icon"),this._itemClassDispose.value=lr(Oe(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};ku=py([ws(2,Tt),ws(3,bi),ws(4,Re),ws(5,Vi),ws(6,Co),ws(7,rl)],ku);let gE=class extends kw{constructor(e,t,i,n,s){var r,a,l;const d=Object.assign(Object.assign({},t),{menuAsChild:(r=t?.menuAsChild)!==null&&r!==void 0?r:!1,classNames:(a=t?.classNames)!==null&&a!==void 0?a:be.isThemeIcon(e.item.icon)?be.asClassName(e.item.icon):void 0,keybindingProvider:(l=t?.keybindingProvider)!==null&&l!==void 0?l:c=>i.lookupKeybinding(c.id)});super(e,{getActions:()=>e.actions},n,d),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),xt(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!be.isThemeIcon(i)){this.element.classList.add("icon");const n=()=>{this.element&&(this.element.style.backgroundImage=lm(this._themeService.getColorTheme().type)?Tc(i.dark):Tc(i.light))};n(),this._register(this._themeService.onDidColorThemeChange(()=>{n()}))}}};gE=py([ws(2,Tt),ws(3,Co),ws(4,Vi)],gE);let fE=class extends Br{constructor(e,t,i,n,s,r,a,l){var d,c,h;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let u;const g=t?.persistLastActionId?l.get(this._storageKey,1):void 0;g&&(u=e.actions.find(p=>g===p.id)),u||(u=e.actions[0]),this._defaultAction=this._instaService.createInstance(ku,u,{keybinding:this._getDefaultActionKeybindingLabel(u)});const f=Object.assign(Object.assign({keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id)},t),{menuAsChild:(d=t?.menuAsChild)!==null&&d!==void 0?d:!0,classNames:(c=t?.classNames)!==null&&c!==void 0?c:["codicon","codicon-chevron-down"],actionRunner:(h=t?.actionRunner)!==null&&h!==void 0?h:new sm});this._dropdown=new kw(e,e.actions,this._contextMenuService,f),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof gr&&this.update(p.action)})}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(ku,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends sm{runAction(i,n){return YB(this,void 0,void 0,function*(){yield i.run(void 0)})}},this._container&&this._defaultAction.render(M7(this._container,ee(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const n=this._keybindingService.lookupKeybinding(e.id);n&&(i=`(${n.getLabel()})`)}return i}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=ee(".action-container");this._defaultAction.render(Z(this._container,t)),this._register($(t,ae.KEY_DOWN,n=>{const s=new Vt(n);s.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())}));const i=ee(".dropdown-action-con
.monaco-menu {
font-size: 13px;
border-radius: 5px;
min-width: 160px;
}
${sF(se.menuSelection)}
${sF(se.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;
margin: 0 4px;
border-radius: 4px;
}
.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: 4px 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=o.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=o.scrollbarSliderBackground;n&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider {
background: ${n};
}
`);const s=o.scrollbarSliderHoverBackground;s&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider:hover {
background: ${s};
}
`);const r=o.scrollbarSliderActiveBackground;r&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider.active {
background: ${r};
}
`)}return t}class Soe{constructor(e,t,i,n){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i;const n=R7(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:s=>{var r;this.lastContainer=s;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(s.className+=" "+a),this.options.blockMouse&&(this.block=s.appendChild(ee(".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",(r=this.blockDisposable)===null||r===void 0||r.dispose(),this.blockDisposable=$(this.block,ae.MOUSE_DOWN,c=>c.stopPropagation()));const l=new X,d=e.actionRunner||new sm;return d.onWillRun(c=>this.onActionRun(c,!e.skipTelemetry),this,l),d.onDidRun(this.onDidActionRun,this,l),i=new Uf(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:d,getKeyBinding:e.getKeyBinding?e.getKeyBinding:c=>this.keybindingService.lookupKeybinding(c.id)},_oe),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add($(window,ae.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add($(window,ae.MOUSE_DOWN,c=>{if(c.defaultPrevented)return;const h=new No(c);let u=h.target;if(!h.rightButton){for(;u;){if(u===s)return;u=u.parentElement}this.contextViewService.hideContextView(!0)}})),lr(l,i)},focus:()=>{i?.focus(!!e.autoSelectFirstItem)},onHide:s=>{var r,a,l;(r=e.onHide)===null||r===void 0||r.call(e,!!s),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(dc()===this.lastContainer||An(dc(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},n,!!n)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!sa(e.error)&&this.notificationService.error(e.error)}}var yoe=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tg=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let _E=class extends H{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Soe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new B),this._onDidHideContextMenu=this._store.add(new B)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=vE.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}})),Kl.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};_E=yoe([Tg(0,bo),Tg(1,bi),Tg(2,_d),Tg(3,Tt),Tg(4,cl),Tg(5,Re)],_E);var vE;(function(o){function e(i){return i&&i.menuId ins
`?a=2:l===`
`&&(a=1);let d=Mn.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(d=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=Mn.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let h=Mn.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(h=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let u=Mn.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:s,insertSpaces:r,detectIndentation:c,defaultEOL:a,trimAutoWhitespace:d,largeFileOptimizations:h,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:io===3||io===2?`
`:`\r
`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const n=typeof e=="string"?e:e.languageId;let s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){const r=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),a=this._getEOL(t,n);s=Ug._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,s=i.length;n<s;n++){const r=i[n],a=this._models[r],l=a.model.getLanguageId(),d=a.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:l,resource:d})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:l,resource:d}))continue;const c=t[l+d],h=this.getCreationOptions(l,d,a.model.isForSimpleWidget);Ug._setModelOptionsForModel(a.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&&ao(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(fh(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(fh(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(fh(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 s=this.getCreationOptions(t,i,n),r=new ud(e,t,s,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(fh(i))){const d=this._removeDisposedModel(i),c=this._undoRedoService.getElements(i),h=rF(r)===d.sha1;if(h||d.sharesUndoRedoStack){for(const u of c.past)Rl(u)&&u.matchesResource(i)&&u.setModel(r);for(const u of c.future)Rl(u)&&u.matchesResource(i)&&u.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,u=>Rl(u)&&u.matchesResource(i)),h&&(r._overwriteVersionId(d.versionId),r._overwriteAlternativeVersionId(d.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(d.initialUndoRedoSnapshot))}else d.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(d.initialUndoRedoSnapshot)}const a=fh(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new koe(r,d=>this._onWillDispose(d),(d,c)=>this._onDidChangeLanguage(d,c));return this._models[a]=l,l}createModel(e,t,i,n=!1){let s;return t?s=this._createModelData(e,t,i,n):s=this._createModelData(e,co,i,n),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const s=t[i];e.push(this._models[s].model)}return e}getModel(e){const t=fh(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===qe.file||e.scheme===qe.vscodeRemote||e.scheme===qe.vscodeUserData||e.scheme===qe.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=fh(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();l
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()}}_y.InstanceCount=0;class Jm extends _r{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...be.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 2+2+2+16}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const Woe=m("caseDescription","Match Case"),Voe=m("wordsDescription","Match Whole Word"),Hoe=m("regexDescription","Use Regular Expression");class iW extends Jm{constructor(e){super({icon:se.caseSensitive,title:Woe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class nW extends Jm{constructor(e){super({icon:se.wholeWord,title:Voe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class sW extends Jm{constructor(e){super({icon:se.regex,title:Hoe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class zoe{constructor(e,t=0,i=e.length,n=t-1){this.items=e,this.start=t,this.end=i,this.index=n}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class Uoe{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.curr
`),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)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map(s=>this.model.getNode(s));this.selection.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-1);this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(s=>this.model.getNode(s));this.focus.set(i,t);const n=e.map(s=>this.model.getListIndex(s)).filter(s=>s>-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),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}dispose(){Ct(this.disposables),this.view.dispose()}}class G2{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Koe(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,s){return i.sorter.compare(n.element,s.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=Qe.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=Qe.empty(),i){const n=new Set,s=new Set,r=l=>{var d;if(l.element===null)return;const c=l;if(n.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const h=this.identityProvider.getId(c.element).toString();s.add(h),this.nodesByIdentity.set(h,c)}(d=i.onDidCreateNode)===null||d===void 0||d.call(i,c)},a=l=>{var d;if(l.element===null)return;const c=l;if(n.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const h=this.identityProvider.getId(c.element).toString();s.has(h)||this.nodesByIdentity.delete(h)}(d=i.onDidDeleteNode)===null||d===void 0||d.call(i,c)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:a}))}preserveCollapseState(e=Qe.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Qe.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){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===va.Collapsed||t.collapsed===va.PreserveOrCollapsed?r=!0:t.collapsed===va.Expanded||t.collapsed===va.PreserveOrExpanded?r=!1:r=!!t.collapsed,Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:r})}const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let s;return typeof t.collapsed>"u"||t.c
`?-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 dx{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 Vw extends H{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new dx(Z(e,ee(".monaco-icon-label")))),this.labelContainer=Z(this.domNode.element,ee(".monaco-icon-label-container"));const i=Z(this.labelContainer,ee("span.monaco-icon-name-container"));t?.supportHighlights||t?.supportIcons?this.nameNode=new Pre(i,!!t.supportIcons):this.nameNode=new Mre(i),this.hoverDelegate=t?.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],s=["monaco-icon-label-container"];let r="";if(i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&(r+=i.title)),this.domNode.className=n.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=s.join(" "),this.setupHover(i?.descriptionTitle?this.labelContainer:this.element,i?.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof fc?(a.set(t||"",i?i.descriptionMatches:void 0,void 0,i?.labelEscapeNewLines),this.setupHover(a.element,i?.descriptionTitle)):(a.textContent=t&&i?.labelEscapeNewLines?fc.escapeNewLines(t,[]):t||"",this.setupHover(a.element,i?.descriptionTitle||""),a.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)Die(e,t);else{const n=fB(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()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new dx(Z(this.labelContainer,ee("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new fc(Z(t.element,ee("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new dx(Z(t.element,ee("span.label-description"))))}return this.descriptionNode}}class Mre{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&ao(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,ee("a.label-name",{id: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],s=t?.domId&&`${t?.domId}_${i}`;Z(this.container,ee("a.label-name",{id:s,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},n)),i<e.length-1&&Z(this.container,ee("span.label-separator",void 0,t?.separator||"/"))}}}}function Are(o,e,t){if(!t)return;let i=0;return o.map(n=>{const s={start:i,end:i+n.length},r=t.map(a=>Tn.intersect(s,a)).filter(a=>!Tn.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=s.end+e.length,r})}class Pre{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&ao(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 fc(Z(this.container,ee("a.label-name",{id:t?.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t?.matche
`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}Dy.MAX_WIDTH=600;var Xre=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nC=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let AE=class extends dX{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(EE))),this._quickAccess}constructor(e,t,i,n){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this._onShow=this._register(new B),this._onHide=this._register(new B),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:s=>this.setContextKey(s),linkOpenerDelegate:s=>{this.instantiationService.invokeFunction(r=>{r.get(Us).open(s,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(s,r,a,l,d)=>this.instantiationService.createInstance(xE,s,r,a,l,d),styles:this.computeStyles()},n=this._register(new Dy(Object.assign(Object.assign({},i),t),this.themeService));return n.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(s=>n.layout(s,e.offset.quickPickTop))),this._register(n.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(n.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),n}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new de(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t?.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=Ye.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ce(iO),quickInputForeground:ce(bZ),quickInputTitleBackground:ce(CZ),widgetBorder:ce(KR),widgetShadow:ce(Aa)},inputBox:Tw,toggle:Ew,countBadge:ZB,button:goe,progressBar:foe,keybindingLabel:uoe,list:Qm({listBackground:iO,listFocusBackground:$h,listFocusForeground:Uh,listInactiveFocusForeground:Uh,listInactiveSelectionIconForeground:sf,listInactiveFocusBackground:$h,listFocusOutline:$t,listInactiveFocusOutline:$t}),pickerGroup:{pickerGroupBorder:ce(wZ),pickerGroupForeground:ce(j7)}}}};AE=Xre([nC(0,Ae),nC(1,Re),nC(2,Vi),nC(3,Xm)],AE);var LW=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_f=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let PE=class extends AE{constructor(e,t,i,n,s){super(t,i,n,new eE(e.getContainerDomNode(),s)),this.host=void 0;const r=bm.get(e);if(r){const a=r.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return a.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};PE=LW([_f(1,Ae),_f(2,Re),_f(3,Vi),_f(4,gt)],PE);let OE=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw
`)}const aae={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:{[ji]:"#FFFFFE",[ir]:"#000000",[K7]:"#E5EBF1",[Pb]:"#D3D3D3",[Ob]:"#939393",[ZR]:"#ADD6FF4D"}},lae={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:{[ji]:"#1E1E1E",[ir]:"#D4D4D4",
`)}}}class xW{getIcon(e){const t=LB();let i=e.defaults;for(;be.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const zl="vs",$f="vs-dark",au="hc-black",lu="hc-light",kW=si.as(H7.ColorContribution),uae=si.as(l8.ThemingContribution);class IW{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(d1(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,z.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=FE(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,z.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=kW.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case zl:return Ro.LIGHT;case au:return Ro.HIGH_CONTRAST_DARK;case lu:return Ro.HIGH_CONTRAST_LIGHT;default:return Ro.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const s=FE(this.themeData.base);e=s.rules,s.encodedTokensColors&&(t=s.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const s={token:""};i&&(s.foreground=i),n&&(s.background=n),e.push(s)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=DW.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const s=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Ln.getForeground(s),a=Ln.getFontStyle(s);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function d1(o){return o===zl||o===$f||o===au||o===lu}function FE(o){switch(o){case zl:return aae;case $f:return lae;case au:return dae;case lu:return cae}}function sC(o){const e=FE(o);return new IW(o,e)}class gae extends H{constructor(){super(),this._onColorThemeChange=this._register(new B),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new B),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new xW,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(zl,sC(zl)),this._knownThemes.set($f,sC($f)),this._knownThemes.set(au,sC(au)),this._knownThemes.set(lu,sC(lu));const e=hae(this);this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(zl),this._onOSSchemeChanged(),e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}),A9("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return U1(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Vo(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),H.None}_registerShadowDomContainer(e){const t=Vo(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return 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(!d1(t.base)&&!d1(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new IW(e,t)),d1(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(zl),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!==$a(this._theme.type)){let t;lm(this._theme.type)?t=e?au:$f:t=e?lu:zl,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)}};uae.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const n=[];for(const r of kW.getColors()){const a=this._theme.getColor(r.id,!0);a&&n.push(`${jR(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor { ${n.join(`
`)} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(rae(s)),this._themeCSS=e.join(`
`),this._updateCSS(),ei.setColorMap(s),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 $s=tt("themeService");var fae=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hx=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let BE=class extends H{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new B,this._onDidChangeReducedMotion=new B,this._accessibilityModeEnabledContext=kb.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 s=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(s)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register($(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}};BE=fae([hx(0,Re),hx(1,Xm),hx(2,ot)],BE);var ky=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Tu=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},$g,Od;let WE=class{constructor(e,t){this._commandService=e,this._hiddenStates=new Hw(t)}createMenu(e,t,i){return new HE(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};WE=ky([Tu(0,ci),Tu(1,wr)],WE);let Hw=$g=class{constructor(e){this._storageService=e,this._disposables=new X,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get($g._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,$g._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get($g._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this
(-> incoming)[${[...i.incoming.keys()].join(", ")}]
(outgoing ->)[${[...i.outgoing.keys()].join(",")}]
`);return e.join(`
`)}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 s=this._findCycle(n,t);if(s)return s;t.delete(i)}}}const kae=!1;class EF 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 zw{constructor(e=new Wb,t=!1,i,n=kae){var s;this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._activeInstantiations=new Set,this._services.set(Ae,this),this._globalGraph=n?(s=i?._globalGraph)!==null&&s!==void 0?s:new IF(r=>r):void 0}createChild(e){return new zw(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=bs.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:r=>{if(n)throw lR("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 Sa?(i=bs.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=bs.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=$r.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];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),s.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 Reflect.construct(e,t.concat(s))}_setServiceInstance(e,t){if(this._services.get(e)instanceof Sa)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){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof Sa?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){var n;const s=new IF(l=>l.id.toString());let r=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(s.lookupOrInsertNode(l),r++>1e3)throw new EF(s);for(const d of $r.getServiceDependencies(l.desc.ctor)){const c=this._getServiceInstanceOrDescriptor(d.id);if(c||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),(n=this._globalGraph)===null||n===void 0||n.insertEdge(String(l.id),String(d.id)),c instanceof Sa){const h={id:d.id,desc:c,_trace:l._trace.branch(d.id,!0)};s.insertEdge(l,h),a.push(h)}}}for(;;){const l=s.roots();if(l.length===0){if(!s.isEmpty())throw new EF(s);break}for(const{data:d}of l){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Sa){const h=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setServiceInstance(d.id,h)}s.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e)instanceof Sa)return this._createServiceInstance(e,t,i,n,s);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,s);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,s){if(n){const r=new zw(void 0,this._strict,this,this._enableTracing);r._globalGraphImplicitDependency=String(e);const a=new Map,l=new UC(()=>{const d=r._createInstance(t,i,s);for(const[c,h]of a){const u=d[c];if(typeof u=="function")for(const g of h)u.apply(d,g)}return a.clear(),d});return new Proxy(Object.create(null),{g
`).slice(3,4).join(`
`)):bs._None}static traceCreation(e,t){return e?new bs(1,t.name):bs._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new bs(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;bs._totals+=e;let t=!1;function i(s,r){const a=[],l=new Array(s+1).join(" ");for(const[d,c,h]of r._dep)if(c&&h){t=!0,a.push(`${l}CREATES -> ${d}`);const u=i(s+1,h);u&&a.push(u)}else a.push(`${l}uses -> ${d}`);return a.join(`
`)}const n=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${bs._totals.toFixed(2)}ms)`];(e>2||t)&&bs.all.add(n.join(`
`))}}bs.all=new Set;bs._None=new class extends bs{constructor(){super(0,null)}stop(){}branch(){return this}};bs._totals=0;const Iae=new Set([qe.inMemory,qe.vscodeSourceControl,qe.walkThrough,qe.walkThroughSnippet]);class Eae{constructor(){this._byResource=new Gn,this._byOwner=new Map}set(e,t,i){let n=this._byResource.get(e);n||(n=new Map,this._byResource.set(e,n)),n.set(t,i);let s=this._byOwner.get(t);s||(s=new Gn,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){const i=this._byResource.get(e);return i?.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.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,s;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:Qe.empty():Ie.isUri(e)?(s=(n=this._byResource.get(e))===null||n===void 0?void 0:n.values())!==null&&s!==void 0?s:Qe.empty():Qe.map(Qe.concat(...this._byOwner.values()),r=>r[1])}}class Tae{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Gn,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(Iae.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===ni.Error?t.errors+=1:i===ni.Warning?t.warnings+=1:i===ni.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 Bd{constructor(){this._onMarkerChanged=new g9({delay:0,merge:Bd._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new Eae,this._stats=new Tae(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(j3(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const s of i){const r=Bd._toMarker(e,t,s);r&&n.push(r)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:d,endLineNumber:c,endColumn:h,relatedInformation:u,tags:g}=i;if(r)return l=l>0?l:1,d=d>0?d:1,c=c>=l?c:l,h=h>0?h:d,{resource:t,owner:e,code:n,severity:s,message:r,source:a,startLineNumber:l,startColumn:d,endLineNumber:c,endColumn:h,relatedInformation:u,tags:g}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const s of n){const r=Qe.first(s);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(Fn(t)){const s=new Gn;for(const{resource:r,marker:a}of t){const l=Bd._toMarker(e,r,a);if(!l)continue;const d=s.get(r);d?d.push(l):(s.set(r,[l]),i.push(r))}for(const[r,a]of s)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:s}=e;if((!s||s<0)&&(s=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(Bd._accept(l,n)){const d=a.push(l);if(s>0&&d===s)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(Bd._accept(l,n)){const d=r.push(l);if(s>0&&d===s)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const d of l)if(Bd._accept(d,n)){const c=a.push(d);if(s>0&&c===s)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Gn;for(const i of e)for(const n of i)t.set(n,!0);return Array.from(t.keys())}}class Nae extends H{constructor(){super(...arguments),this._configurationModel=new Nn}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=
`+t),window.confirm(i)}prompt(e){var t,i;return jf(this,void 0,void 0,function*(){let n;if(this.doConfirm(e.message,e.detail)){const r=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&r.push(e.cancelButton),n=yield(i=r[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1})}return{result:n}})}error(e,t){return jf(this,void 0,void 0,function*(){yield this.prompt({type:_i.Error,message:e,detail:t})})}}class Hv{info(e){return this.notify({severity:_i.Info,message:e})}warn(e){return this.notify({severity:_i.Warning,message:e})}error(e){return this.notify({severity:_i.Error,message:e})}notify(e){switch(e.severity){case _i.Error:console.error(e.message);break;case _i.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Hv.NO_OP}prompt(e,t,i,n){return Hv.NO_OP}status(e,t){return H.None}}Hv.NO_OP=new Lte;let jE=class{constructor(e){this._onWillExecuteCommand=new B,this._onDidExecuteCommand=new B,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)}}};jE=eh([gn(0,Ae)],jE);let wm=class extends Rse{constructor(e,t,i,n,s,r){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const f=new X;f.add($(g,ae.KEY_DOWN,p=>{const _=new Vt(p);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),f.add($(g,ae.KEY_UP,p=>{const _=new Vt(p);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new Bae(g,f))},l=g=>{for(let f=0;f<this._domNodeListeners.length;f++){const p=this._domNodeListeners[f];p.domNode===g&&(this._domNodeListeners.splice(f,1),p.dispose())}},d=g=>{g.getOption(60)||a(g.getContainerDomNode())},c=g=>{g.getOption(60)||l(g.getContainerDomNode())};this._register(r.onCodeEditorAdd(d)),this._register(r.onCodeEditorRemove(c)),r.listCodeEditors().forEach(d);const h=g=>{a(g.getContainerDomNode())},u=g=>{l(g.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return lr(rt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map(i=>{var n;return{keybinding:rI(i.keybinding,io),command:(n=i.command)!==null&&n!==void 0?n:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Oe(()=>{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(Ls.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new M_(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const r=s.when||void 0,a=s.keybinding;if(!a)i[n++]=new Q4(void 0,s.command,s.commandArgs,r,t,null,!1);else{const l=Ev.resolveKeybinding(a,io);for(const d of l)i[n++]=new Q4(d,s.command,s.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new hd(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Ev([t],io)}};wm=eh([gn(0,Re),gn(1,ci),gn(2,bo),gn(3,bi),gn(4,vo),gn(5,gt)],wm);class Bae extends H{constructor(e,t){super(),this.domNode=e,this._register(t)}}function TF(o){return o&&typeof o=="object"&
`:`\r
`}};qE=eh([gn(0,ot)],qE);class Wae{publicLog2(){}}class zv{constructor(){const e=Ie.from({scheme:zv.SCHEME,authority:"model",path:"/"});this.workspace={id:KB,folders:[new qse({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===zv.SCHEME?this.workspace.folders[0]:null}}zv.SCHEME="inmemory";function Sm(o,e,t){if(!e||!(o instanceof NW))return;const i=[];Object.keys(e).forEach(n=>{yse(n)&&i.push([`editor.${n}`,e[n]]),t&&Lse(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&o.updateValues(i)}let GE=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return jf(this,void 0,void 0,function*(){const i=Array.isArray(e)?e:V2.convert(e),n=new Map;for(const a of i){if(!(a instanceof nd))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let d=n.get(l);d||(d=[],n.set(l,d)),d.push(Gt.replaceMove(D.lift(a.textEdit.range),a.textEdit.text))}let s=0,r=0;for(const[a,l]of n)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,s+=l.length;return{ariaSummary:mu(hE.bulkEditServiceSummary,s,r),isApplied:s>0}})}};GE=eh([gn(0,Zt)],GE);class Vae{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Ho(e)}}let ZE=class extends uE{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)}};ZE=eh([gn(0,Xm),gn(1,gt)],ZE);class Hae{constructor(){this._neverEmitter=new B,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class zae extends Rv{constructor(){super()}}class Uae extends Rae{constructor(){super(new QK)}}let YE=class extends _E{constructor(e,t,i,n,s,r){super(e,t,i,n,s,r),this.configure({blockMouse:!1})}};YE=eh([gn(0,bo),gn(1,bi),gn(2,_d),gn(3,Tt),gn(4,cl),gn(5,Re)],YE);class $ae{playAudioCue(e,t){return jf(this,void 0,void 0,function*(){})}}ct(ot,NW,0);ct(PR,KE,0);ct(l7,qE,0);ct(xu,zv,0);ct(pm,Vae,0);ct(bo,Wae,0);ct(Ub,Fae,0);ct(F2,Oae,0);ct(bi,Hv,0);ct(gl,Bd,0);ct(Kt,zae,0);ct($s,gae,0);ct(vo,Uae,0);ct(Zt,Pw,0);ct(zR,SE,0);ct(Re,UE,0);ct(IB,Pae,0);ct(ul,Ey,0);ct(wr,coe,0);ct(Cr,nI,0);ct($b,GE,0);ct(qB,Hae,0);ct(ks,$E,0);ct(rl,BE,0);ct(jo,vre,0);ct(ci,jE,0);ct(Tt,wm,0);ct(aa,OE,0);ct(_d,ZE,0);ct(Us,wE,0);ct(ra,zE,0);ct(Co,YE,0);ct(cl,WE,0);ct(Yu,$ae,0);var Ne;(function(o){const e=new Wb;for(const[l,d]of XA())e.set(l,d);const t=new zw(e,!0);e.set(Ae,t);function i(l){n||r({});const d=e.get(l);if(!d)throw new Error("Missing service "+l);return d instanceof Sa?t.invokeFunction(c=>c.get(l)):d}o.get=i;let n=!1;const s=new B;function r(l){if(n)return t;n=!0;for(const[c,h]of XA())e.get(c)||e.set(c,h);for(const c in l)if(l.hasOwnProperty(c)){const h=tt(c);e.get(h)instanceof Sa&&e.set(h,l[c])}const d=Mae();for(const c of d)try{t.createInstance(c)}catch(h){Ve(h)}return s.fire(),t}o.initialize=r;function a(l){if(n)return l();const d=new X,c=d.add(s.event(()=>{c.dispose(),d.add(l())}));return d}o.withServices=a})(Ne||(Ne={}));let jae;function sd(){return jae}let RW;function Kae(o){RW=o}class MW{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e){return RW(t=>e(this.read(t),t),()=>{const t=ep(e);if(t!==void 0)return t;const n=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(e.toString());return n?`${this.debugName}.${n[2]}`:`${this.debugName} (mapped)`})}}class Yb extends MW{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemo
`:`\r
`),yield this._clipboardService.writeText(w)}))),i.getOption(89)||v.push(new mn("diff.inline.revertChange",m("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>ux(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),v},autoSelectFirstItem:!0})};this._register(Qt(this._diffActions,"mousedown",f=>{const{top:p,height:_}=Si(this._diffActions),v=Math.floor(c/3);f.preventDefault(),g(f.posx,p+_+v)})),this._register(i.onMouseMove(f=>{(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()?(h=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,c),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(f=>{f.event.rightButton&&(f.target.type===8||f.target.type===5)&&f.target.detail.viewZoneId===this._getViewZoneId()&&(f.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,f.event.browserEvent.y,c),g(f.event.posx,f.event.posy+c))}))}_updateLightBulbPosition(e,t,i){const{top:n}=Si(e),s=t-n,r=Math.floor(s/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let d=0;d<this._viewLineCounts.length;d++)if(l+=this._viewLineCounts[d],r<l)return d}return r}}const VF=QI;function xle(o,e,t,i){qi(i,e.fontInfo);const n=t.length>0,s=new eg(1e4);let r=0,a=0;const l=[];for(let u=0;u<o.lineTokens.length;u++){const g=u+1,f=o.lineTokens[u],p=o.lineBreakData[u],_=ls.filter(t,g,1,Number.MAX_SAFE_INTEGER);if(p){let v=0;for(const b of p.breakOffsets){const C=f.sliceAndInflate(v,b,0);r=Math.max(r,HF(a,C,ls.extractWrapped(_,v,b),n,o.mightContainNonBasicASCII,o.mightContainRTL,e,s)),a++,v=b}l.push(p.breakOffsets.length)}else l.push(1),r=Math.max(r,HF(a,f,_,n,o.mightContainNonBasicASCII,o.mightContainRTL,e,s)),a++}r+=e.scrollBeyondLastColumn;const d=s.build(),c=VF?VF.createHTML(d):d;i.innerHTML=c;const h=r*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:h,viewLineCounts:l}}class kle{constructor(e,t,i,n){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=n}}class _M{static fromEditor(e){var t;const i=e.getOptions(),n=i.get(49),s=i.get(142);return new _M(((t=e.getModel())===null||t===void 0?void 0:t.getOptions().tabSize)||0,n,i.get(32),n.typicalHalfwidthCharacterWidth,i.get(102),i.get(65),s.decorationsWidth,i.get(115),i.get(97),i.get(92),i.get(50))}constructor(e,t,i,n,s,r,a,l,d,c,h){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=n,this.scrollBeyondLastColumn=s,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=d,this.renderControlCharacters=c,this.fontLigatures=h}}function HF(o,e,t,i,n,s,r,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(o*r.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),d=Xn.isBasicASCII(l,n),c=Xn.containsRTL(l,d,s),h=Um(new ll(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,d,c,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Ss.OFF,null),a);return a.appendString("</div>"),h.characterMapping.getHorizontalOffset(h.characterMapping.length)}var Ile=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zF=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let iT=class extends H{constructor(e,t,i,n,s,r,a){super(),this._editors=e,this._diffModel=t,this._options=i,this._diffEditorWidget=n,this._canIgnoreViewZoneUpdateEvent=s,this._clipboardService=r,this._contextMenuService=a,this._originalTopPadding=Wt("originalT
`);let r=t;return s!==-1&&(r=t.substring(0,s)),YF(o,t,e.createByFilepathOrFirstLine(n||null,r),n)}return YF(o,t,e.createById(i),n)}function YF(o,e,t,i){return o.createModel(e,t,i)}var $W=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};function Hle(o,e,t){return Ne.initialize(t||{}).createInstance(aT,o,e)}function zle(o){return Ne.get(gt).onCodeEditorAdd(t=>{o(t)})}function Ule(o){return Ne.get(gt).onDiffEditorAdd(t=>{o(t)})}function $le(){return Ne.get(gt).listCodeEditors()}function jle(){return Ne.get(gt).listDiffEditors()}function Kle(o,e,t){var i;const n=Ne.initialize(t||{});return!((i=e?.experimental)===null||i===void 0)&&i.useVersion2?n.createInstance(dT,o,e):n.createInstance(lT,o,e)}function qle(o,e){return Ne.initialize({}).createInstance(M1,o,e)}function Gle(o){if(typeof o.id!="string"||typeof o.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return rt.registerCommand(o.id,o.run)}function Zle(o){if(typeof o.id!="string"||typeof o.label!="string"||typeof o.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Y.deserialize(o.precondition),t=(n,...s)=>sn.runEditorCommand(n,s,e,(r,a,l)=>Promise.resolve(o.run(a,...l))),i=new X;if(i.add(rt.registerCommand(o.id,t)),o.contextMenuGroupId){const n={command:{id:o.id,title:o.label},when:e,group:o.contextMenuGroupId,order:o.contextMenuOrder||0};i.add(On.appendMenuItem(E.EditorContext,n))}if(Array.isArray(o.keybindings)){const n=Ne.get(Tt);if(!(n instanceof wm))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const s=Y.and(e,Y.deserialize(o.keybindingContext));i.add(n.addDynamicKeybindings(o.keybindings.map(r=>({keybinding:r,command:o.id,when:s}))))}}return i}function Yle(o){return jW([o])}function jW(o){const e=Ne.get(Tt);return e instanceof wm?e.addDynamicKeybindings(o.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Y.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),H.None)}function Xle(o,e,t){const i=Ne.get(Kt),n=i.getLanguageIdByMimeType(e)||e;return UW(Ne.get(Zt),i,o,n,t)}function Qle(o,e){const t=Ne.get(Kt),i=t.getLanguageIdByMimeType(e)||e||co;o.setLanguage(t.createById(i))}function Jle(o,e,t){o&&Ne.get(gl).changeOne(e,o.uri,t)}function ede(o){Ne.get(gl).changeAll(o,[])}function tde(o){return Ne.get(gl).read(o)}function ide(o){return Ne.get(gl).onMarkerChanged(o)}function nde(o){return Ne.get(Zt).getModel(o)}function sde(){return Ne.get(Zt).getModels()}function ode(o){return Ne.get(Zt).onModelAdded(o)}function rde(o){return Ne.get(Zt).onModelRemoved(o)}function ade(o){return Ne.get(Zt).onModelLanguageChanged(t=>{o({model:t.model,oldLanguage:t.oldLanguageId})})}function lde(o){return oq(Ne.get(Zt),Ne.get(Pt),o)}function dde(o,e){const t=Ne.get(Kt),i=Ne.get($s);return WR.colorizeElement(i,t,o,e).then(()=>{i.registerEditorContainer(o)})}function cde(o,e,t){const i=Ne.get(Kt);return Ne.get($s).registerEditorContainer(document.body),WR.colorize(i,o,e,t)}function hde(o,e,t=4){return Ne.get($s).registerEditorContainer(document.body),WR.colorizeModelLine(o,e,t)}function ude(o){const e=ei.get(o);return e||{getInitialState:()=>im,tokenize:(t,i,n)=>kR(o,n)}}function gde(o,e){ei.getOrCreate(e);const t=ude(e),i=Ya(o),n=[];let s=t.getInitialState();for(let r=0,a=i.length;r<a;r++){const l=i[r],d=t.tokenize(l,!0,s);n[r]=d.tokens,s=d.endState}return n}function fde(o,e){Ne.get($s).defineTheme(o,e)}function mde(o){Ne.get($s).setTheme(o)}function pde(){jk.clearAllFontInfos()}function _de(o,e){return rt.registerCommand({id:o,handler:e})}function vde(o){return Ne.get(Us).registerOpener({open(t){return $W(th
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")s.push({token:a.token+t.tokenPostfix,open:lc(t,a.open),close:lc(t,a.close)});else throw Ut(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=s,t.noThrow=!0,t}var xde=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};function kde(o){tm.registerLanguage(o)}function Ide(){let o=[];return o=o.concat(tm.getLanguages()),o}function Ede(o){return Ne.get(Kt).languageIdCodec.encodeLanguageId(o)}function Tde(o,e){return Ne.withServices(()=>{const i=Ne.get(Kt).onDidRequestRichLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function Nde(o,e){return Ne.withServices(()=>{const i=Ne.get(Kt).onDidRequestBasicLanguageFeatures(n=>{n===o&&(i.dispose(),e())});return i})}function Rde(o,e){if(!Ne.get(Kt).isRegisteredLanguageId(o))throw new Error(`Cannot set configuration for unknown language ${o}`);return Ne.get(Pt).register(o,e,100)}class Mde{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return Kv.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 xS(n.tokens,n.endState)}}class Kv{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,r=e.length;s<r;s++){const a=e[s];let l=a.startIndex;s===0?l=0:l<n&&(l=n),i[s]=new Y_(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const s=t.tokenize(i,n),r=Kv._toClassicTokens(s.tokens,e);let a;return s.endState.equals(n)?a=n:a=s.endState,new mR(r,a)}tokenize(e,t,i){return Kv.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let r=0,a=0;for(let d=0,c=t.length;d<c;d++){const h=t[d],u=n.match(i,h.scopes)|1024;if(r>0&&s[r-1]===u)continue;let g=h.startIndex;d===0?g=0:g<a&&(g=a),s[r++]=g,s[r++]=u,a=g}const l=new Uint32Array(r);for(let d=0;d<r;d++)l[d]=s[d];return l}tokenizeEncoded(e,t,i){const n=this._actual.tokenize(e,i),s=this._toBinaryTokens(this._languageService.languageIdCodec,n.tokens);let r;return n.endState.equals(i)?r=i:r=n.endState,new xS(s,r)}}function Ade(o){return typeof o.getInitialState=="function"}function Pde(o){return"tokenizeEncoded"in o}function qW(o){return o&&typeof o.then=="function"}function Ode(o){const e=Ne.get($s);if(o){const t=[null];for(let i=1,n=o.length;i<n;i++)t[i]=z.fromHex(o[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function GW(o,e){return Pde(e)?new Mde(o,e):new Kv(o,e,Ne.get(Kt),Ne.get($s))}function vM(o,e){const t=new c$(()=>xde(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?Ade(i)?GW(o,i):new rv(Ne.get(Kt),Ne.get($s),o,KW(o,i),Ne.get(ot)):null}));return ei.registerFactory(o,t)}function Fde(o,e){if(!Ne.get(Kt).isRegisteredLanguageId(o))throw new Error(`Cannot set tokens provider for unknown language ${o}`);return qW(e)?vM(o,{create:()=>e}):ei.register(o,GW(o,e))}function Bde(o,e){const t=i=>new rv(Ne.get(Kt),Ne.get($s),o,KW(o,i),Ne.get(ot));return qW(e)?vM(o,{create:()=>e}):ei.register(o,t(e))}function Wde(o,e){return Ne.get(me).referenceProvider.register(o,e)}function Vde(o,e){return Ne.get(me).renameProvider.register(o,e)}function Hde(o,e){return Ne.get(me).signatureHelpProvider.register(o,e)}function zde(o,e){return Ne.get(me).hoverProvider.register(o,{provideHover:(i
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.43.0(94c055bcbdd49f04a0fa15515e848542a79fb948)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Rce=Object.defineProperty,Mce=Object.getOwnPropertyDescriptor,Ace=Object.getOwnPropertyNames,Pce=Object.prototype.hasOwnProperty,e5=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ace(e))!Pce.call(o,n)&&n!==t&&Rce(o,n,{get:()=>e[n],enumerable:!(i=Mce(e,n))||i.enumerable});return o},Oce=(o,e,t)=>(e5(o,e,"default"),t&&e5(t,e,"default")),r_={};Oce(r_,Xb);var i6={},fx={},n6=class{static getOrCreate(o){return fx[o]||(fx[o]=new n6(o)),fx[o]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(o){this._languageId=o,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,i6[this._languageId].loader().then(o=>this._lazyLoadPromiseResolve(o),o=>this._lazyLoadPromiseReject(o))),this._lazyLoadPromise}};function De(o){const e=o.id;i6[e]=o,r_.languages.register(o);const t=n6.getOrCreate(e);r_.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),r_.languages.onLanguageEncountered(e,async()=>{const i=await t.load();r_.languages.setLanguageConfiguration(e,i.conf)})}De({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Ce(()=>import("./chunk-b90a1f1e.js"),[])});De({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Ce(()=>import("./chunk-7aadd462.js"),[])});De({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Ce(()=>import("./chunk-23a1b956.js"),[])});De({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Ce(()=>import("./chunk-2c82a72d.js"),[])});De({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Ce(()=>import("./chunk-338bfe58.js"),[])});De({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Ce(()=>import("./chunk-1c616f6f.js"),[])});De({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Ce(()=>import("./chunk-9bb82a82.js"),[])});De({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Ce(()=>import("./chunk-ec486f98.js"),[])});De({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Ce(()=>import("./chunk-98740ad6.js"),[])});De({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Ce(()=>import("./chunk-98740ad6.js"),[])});De({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Ce(()=>import("./chunk-d2941385.js"),[])});De({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Ce(()=>import("./chunk-aed6305a.js"),[])});De({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Ce(()=>import("./chunk-a82dd746.js"),[])});De({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Ce(()=>import("./chunk-3ffc0570.js"),[])});De({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Ce(()=>import("./chunk-68bf5326.js"),[])});De({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Ce(()=>import("./chunk-c55b64af.js"),[])});De({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Ce(()=>import("./chunk-e008be52.js"),[])});De({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Ce(()=>import("./chunk-932a57fd.js"),[])});De({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Ce(()=>import("./chunk-d862b93b.js"),[])});De({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Ce(()=>import("./chunk-f2bb837e.js"),[])});De({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Ce(()=>im
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.43.0(94c055bcbdd49f04a0fa15515e848542a79fb948)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Fce=Object.defineProperty,Bce=Object.getOwnPropertyDescriptor,Wce=Object.getOwnPropertyNames,Vce=Object.prototype.hasOwnProperty,t5=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Wce(e))!Vce.call(o,n)&&n!==t&&Fce(o,n,{get:()=>e[n],enumerable:!(i=Bce(e,n))||i.enumerable});return o},Hce=(o,e,t)=>(t5(o,e,"default"),t&&t5(t,e,"default")),tp={};Hce(tp,Xb);var SM=class{_onDidChange=new tp.Emitter;_options;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},yM={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},LM={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},s6=new SM("css",yM,LM),o6=new SM("scss",yM,LM),r6=new SM("less",yM,LM);tp.languages.css={cssDefaults:s6,lessDefaults:r6,scssDefaults:o6};function DM(){return Ce(()=>import("./chunk-c4fc0f40.js"),["assets/chunks/chunk-c4fc0f40.js","assets/chunks/chunk-a740628f.js","assets/chunks/chunk-449c23a2.js","assets/static/c-button.1b70e3dc.css","assets/static/lodash.af515ca7.css","assets/chunks/chunk-cf010ec4.js"])}tp.languages.onLanguage("less",()=>{DM().then(o=>o.setupMode(r6))});tp.languages.onLanguage("scss",()=>{DM().then(o=>o.setupMode(o6))});tp.languages.onLanguage("css",()=>{DM().then(o=>o.setupMode(s6))});/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.43.0(94c055bcbdd49f04a0fa15515e848542a79fb948)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var zce=Object.defineProperty,Uce=Object.getOwnPropertyDescriptor,$ce=Object.getOwnPropertyNames,jce=Object.prototype.hasOwnProperty,i5=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of $ce(e))!jce.call(o,n)&&n!==t&&zce(o,n,{get:()=>e[n],enumerable:!(i=Uce(e,n))||i.enumerable});return o},Kce=(o,e,t)=>(i5(o,e,"default"),t&&i5(t,e,"default")),Fy={};Kce(Fy,Xb);var qce=class{_onDidChange=new Fy.Emitter;_options;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Gce={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},By={format:Gce,suggest:{},data:{useDefaultDataProvider:!0}};function Wy(o){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:o===O_,documentFormattingEdits:o===O_,documentRangeFormattingEdits:o===O_}}var O_="html",n5="handlebars",s5="razor",a6=Vy(O_,By,Wy(O_)),Zce=a6.defaults,l6=Vy(n5,By,Wy(n5)),Yce=l6.defaults,d6=Vy(s5,By,Wy(s5)),Xce=d6.defaults;Fy.languages.html={htmlDefaults:Zce,razorDefaults:Xce,handlebarDefaults:Yce,htmlLanguageService:a6,handlebarLanguageService:l6,razorLanguageService:d6,registerHTMLLanguageService:Vy};function Qce(){return Ce(()=>import("./chunk-94bee2a4.js"),["assets/chunks/chunk-94bee2a4.js","assets/chunks/chunk-a740628f.js","assets/chunks/chunk-449c23a2.js","assets/static/c-button.1b70e3dc.css","assets/static/lodash.af515ca7.css","assets/chunks/chunk-cf010ec4.js"])}function Vy(o,e=By,t=Wy(o)){const i=new qce(o,e,t);let n;const s=Fy.languages.onLanguage(o,async()=>{n=(await Qce()).setupMode(i)});return{defaults:i,dispose(){s.dispose(),n?.dispose(),n=void 0}}}/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.43.0(94c055bcbdd49f04a0fa15515e848542a79fb948)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Jce=Object.defineProperty,ehe=Object.getOwnPropertyDescriptor,the=Object.getOwnPropertyNames,ihe=Object.prototype.hasOwnProperty,o5=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of the(e))!ihe.call(o,n)&&n!==t&&Jce(o,n,{get:()=>e[n],enumerable:!(i=ehe(e,n))||i.enumerable});return o},nhe=(o,e,t)=>(o5(o,e,"default"),t&&o5(t,e,"default")),Qb={};nhe(Qb,Xb);var she=class{_onDidChange=new Qb.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},ohe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},rhe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},c6=new she("json",ohe,rhe);Qb.languages.json={jsonDefaults:c6};function ahe(){return Ce(()=>import("./chunk-5a6fa067.js"),["assets/chunks/chunk-5a6fa067.js","assets/chunks/chunk-a740628f.js","assets/chunks/chunk-449c23a2.js","assets/static/c-button.1b70e3dc.css","assets/static/lodash.af515ca7.css","assets/chunks/chunk-cf010ec4.js"])}Qb.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Qb.languages.onLanguage("json",()=>{ahe().then(o=>o.setupMode(c6))});/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.43.0(94c055bcbdd49f04a0fa15515e848542a79fb948)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var lhe=Object.defineProperty,dhe=Object.getOwnPropertyDescriptor,che=Object.getOwnPropertyNames,hhe=Object.prototype.hasOwnProperty,r5=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of che(e))!hhe.call(o,n)&&n!==t&&lhe(o,n,{get:()=>e[n],enumerable:!(i=dhe(e,n))||i.enumerable});return o},uhe=(o,e,t)=>(r5(o,e,"default"),t&&r5(t,e,"default")),ghe="5.0.2",Lm={};uhe(Lm,Xb);var h6=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(h6||{}),u6=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(u6||{}),g6=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(g6||{}),f6=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(f6||{}),m6=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(m6||{}),p6=class{_onDidChange=new Lm.Emitter;_onDidExtraLibsChange=new Lm.Emitter;_extraLibs;_removedExtraLibs;_eagerModelSync;_compilerOptions;_diagnosticsOptions;_workerOptions;_onDidExtraLibsChangeTimeout;_inlayHintsOptions;_modeConfiguration;constructor(o,e,t,i,n){this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(o,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===o)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:o,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},fhe=ghe,_6={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentH
`),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const n=Il._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return n.supported?this._executeLineComments(e,t,n,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new ve(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let n=0,s=e.length;n<s;n++){const r=e[n];r.ignore||i.push(Gt.delete(new D(t+n,r.commentStrOffset+1,t+n,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],n=this._insertSpace?" ":"";for(let s=0,r=e.length;s<r;s++){const a=e[s];a.ignore||i.push(Gt.insert(new W(t+s,a.commentStrOffset+1),a.commentStr+n))}return i}static nextVisibleColumn(e,t,i,n){return i?e+(t-e%t):e+n}static _normalizeInsertionPoint(e,t,i,n){let s=1073741824,r,a;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(let u=0,g=t[l].commentStrOffset;h<s&&u<g;u++)h=Il.nextVisibleColumn(h,n,c.charCodeAt(u)===9,1);h<s&&(s=h)}s=Math.floor(s/n)*n;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;const c=e.getLineContent(i+l);let h=0;for(r=0,a=t[l].commentStrOffset;h<s&&r<a;r++)h=Il.nextVisibleColumn(h,n,c.charCodeAt(r)===9,1);h>s?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class HM extends ue{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Pt);if(!t.hasModel())return;const n=t.getModel(),s=[],r=n.getOptions(),a=t.getOption(22),l=t.getSelections().map((c,h)=>({selection:c,index:h,ignoreFirstLine:!1}));l.sort((c,h)=>D.compareRangesUsingStarts(c.selection,h.selection));let d=l[0];for(let c=1;c<l.length;c++){const h=l[c];d.selection.endLineNumber===h.selection.startLineNumber&&(d.index<h.index?h.ignoreFirstLine=!0:(d.ignoreFirstLine=!0,d=h))}for(const c of l)s.push(new Il(i,c.selection,r.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,c.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class dfe extends HM{constructor(){super(0,{id:"editor.action.commentLine",label:m("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:E.MenubarEditMenu,group:"5_insert",title:m({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class cfe extends HM{constructor(){super(1,{id:"editor.action.addCommentLine",label:m("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2081),weight:100}})}}class hfe extends HM{constructor(){super(2,{id:"editor.action.removeCommentLine",label:m("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2099),weight:100}})}}class ufe extends ue{constructor(){super({id:"editor.action.blockComment",label:m("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:E.MenubarEditMenu,group:"5_insert",title:m({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(Pt);if(!t.hasModel())return;const n=t.getOption(22),s=[],r=t.getSelections();for(const a of r)s.push(new tc(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}te(dfe);te(cfe);te(hfe);te(ufe);var gfe=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.g
`),split:o=>o.split(`\r
`),parse:o=>tL.split(o).filter(e=>!e.startsWith("#"))}),P5={EDITORS:"CodeEditors",FILES:"CodeFiles"};class bfe{}const Cfe={DragAndDropContribution:"workbench.contributions.dragAndDrop"};si.add(Cfe.DragAndDropContribution,new bfe);class Qv{constructor(){}static getInstance(){return Qv.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}Qv.INSTANCE=new Qv;var wfe=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};function yV(o){const e=new CV;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,zM(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,Sfe(n))}}return e}function Sfe(o){const e=o.path?Ie.parse(o.path):void 0;return vfe(o.name,e,()=>wfe(this,void 0,void 0,function*(){return new Uint8Array(yield o.arrayBuffer())}))}const yfe=Object.freeze([P5.EDITORS,P5.FILES,xv.RESOURCES,xv.INTERNAL_URI_LIST]);function LV(o,e=!1){const t=yV(o),i=t.get(xv.INTERNAL_URI_LIST);if(i)t.replace(vi.uriList,i);else if(e||!t.has(vi.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(Ie.file(a).toString()):n.push(Ie.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(vi.uriList,zM(tL.create(n)))}for(const n of yfe)t.delete(n);return t}function Lfe(o,e,t){var i,n;return{edits:[...e.map(s=>new nd(o,typeof t.insertText=="string"?{range:s,text:t.insertText,insertAsSnippet:!1}:{range:s,text:t.insertText.snippet,insertAsSnippet:!0})),...(n=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&n!==void 0?n:[]]}}function DV(o){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const i=new Map;for(const a of o)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const d of o)if(d!==a&&t(l,d)){let c=i.get(a);c||(c=[],i.set(a,c)),c.push(d)}if(!i.size)return Array.from(o);const n=new Set,s=[];function r(a){if(!a.length)return[];const l=a[0];if(s.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(n.has(l))return r(a.slice(1));let d=[];const c=i.get(l);return c&&(s.push(l),d=r(c),s.pop()),n.add(l),[...d,l,...r(a.slice(1))]}return r(Array.from(o))}var Dfe=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},xfe=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},kfe=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})};const Ife=Me.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:M9,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class iL extends H{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=ee(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ee("span.icon");this.domNode.append(t),t.classList.add(...be.asClassNameArray(se.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(65);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${
`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(s===36){if(i++,i>=n)break;const r=o.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1<n){const l=o.charCodeAt(i+1);if(48<=l&&l<=57){i++,a=a*10+(l-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const bd=new de("findWidgetVisible",!1);bd.toNegated();const nL=new de("findInputFocussed",!1),KM=new de("replaceInputFocussed",!1),bC={primary:545,mac:{primary:2593}},CC={primary:565,mac:{primary:2613}},wC={primary:560,mac:{primary:2608}},SC={primary:554,mac:{primary:2602}},yC={primary:558,mac:{primary:2606}},Ft={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",GoToMatchFindAction:"editor.action.goToMatchFindAction",NextSelectionMatchFindAction:"editor.action.nextSelectionMatchFindAction",PreviousSelectionMatchFindAction:"editor.action.previousSelectionMatchFindAction",StartFindReplaceAction:"editor.action.startFindReplaceAction",CloseFindWidgetCommand:"closeFindWidget",ToggleCaseSensitiveCommand:"toggleFindCaseSensitive",ToggleWholeWordCommand:"toggleFindWholeWord",ToggleRegexCommand:"toggleFindRegex",ToggleSearchScopeCommand:"toggleFindInSelection",TogglePreserveCaseCommand:"togglePreserveCase",ReplaceOneAction:"editor.action.replaceOne",ReplaceAllAction:"editor.action.replaceAll",SelectAllMatchesAction:"editor.action.selectAllMatches"},ic=19999,Ofe=240;class W_{constructor(e,t){this._toDispose=new X,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new pr,this._decorations=new jn(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new kt(()=>this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Ct(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},Ofe)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new D(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const n=this._findMatches(i,!1,ic);this._decorations.set(n,i);const s=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(s);if(r===0&&n.length>0){const a=$3(n.map(l=>l.range),l=>D.compareRangesUsingStarts(l,s)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._edito
`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return G5(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return Z5(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(q5|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{kn&&qr&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(m("ctrlEnter.keybindingChanged","Ctrl+Enter now inserts line break instead of replacing all. You can modify the keybinding for editor.action.replaceAll to override this behavior.")),this._ctrlEnterReplaceAllWarningPrompted=!0,this._storageService.store(K5,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(`
`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return G5(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return Z5(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new JT(null,this._contextViewProvider,{width:dme,label:Zfe,placeholder:Yfe,appendCaseSensitiveLabel:this._keybindingLabelFor(Ft.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Ft.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Ft.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(d){return{content:d.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>z5(this._keybindingService),inputBoxStyles:Tw,toggleStyles:Ew},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Yn&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new Pg({label:Xfe+this._keybindingLabelFor(Ft.PreviousMatchFindAction),icon:Kfe,onTrigger:()=>{Bh(this._codeEditor.getAction(Ft.PreviousMatchFindAction)).run().then(void 0,Ve)}})),this._nextBtn=this._register(new Pg({label:Qfe+this._keybindingLabelFor(Ft.NextMatchFindAction),icon:qfe,onTrigger:()=>{Bh(this._codeEditor.getAction(Ft.NextMatchFindAction)).run().then(void 0,Ve)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const n=document.createElement("div");n.className="find-actions",i.appendChild(n),n.appendChild(this._matchesCount),n.appendChild(this._prevBtn.domNode),n.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Jm({icon:Ufe,title:Jfe+this._keybindingLabelFor(Ft.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:ce(Hh),inputActiveOptionBorder:ce(qR),inputActiveOptionForeground:ce(GR)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const l=this._codeEditor.getSelections();l.map(d=>(d.endColumn===1&&d.endLineNumber>d.startLineNumber&&(d=d.setEndPosition(d.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(d.endLineNumber-1))),d.isEmpty()?null:d)).filter(d=>!!d),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),n.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new Pg({label:eme+this._keybindingLabelFor(Ft.CloseFindWidgetCommand),icon:kB,onTrigger:()=>{
.monaco-editor .find-widget .button:not(.disabled):hover,
.monaco-editor .find-widget .codicon-find-selection:hover {
background-color: ${g} !important;
}
`);const f=o.getColor(no);f&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${f}; }`)});var zV=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ca=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},Vu=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},tN;const hme=524288;function iN(o,e="single",t=!1){if(!o.hasModel())return null;const i=o.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=o.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(o.getModel().getValueLengthInRange(i)<hme)return o.getModel().getValueInRange(i)}return null}let us=tN=class extends H{get editor(){return this._editor}static get(e){return e.getContribution(tN.ID)}constructor(e,t,i,n){super(),this._editor=e,this._findWidgetVisible=bd.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._updateHistoryDelayer=new Qr(500),this._state=this._register(new Ffe),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(s=>this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),s&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(40).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!nL.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._stat
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:m("actions.find.wholeWordOverride",`Overrides "Match Whole Word" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:m("actions.find.matchCaseOverride",`Overrides "Math Case" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:m("actions.find.preserveCaseOverride",`Overrides "Preserve Case" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},findInSelection:{type:"boolean"}}}}]};class fme extends ue{constructor(){super({id:Ft.StartFindWithArgs,label:m("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:gme})}run(e,t,i){return Vu(this,void 0,void 0,function*(){const n=us.get(t);if(n){const s=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};yield n.start({forceRevealReplace:!1,seedSearchStringFromSelection:n.getState().searchString.length===0&&t.getOption(40).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(40).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:i?.findInSelection||!1,loop:t.getOption(40).loop},s),n.setGlobalBufferTerm(n.getState().searchString)}})}}class mme extends ue{constructor(){super({id:Ft.StartFindWithSelection,label:m("startFindWithSelectionAction","Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return Vu(this,void 0,void 0,function*(){const i=us.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(40).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class UV extends ue{run(e,t){return Vu(this,void 0,void 0,function*(){const i=us.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(40).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(40).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(40).loop}),this._run(i))})}}class pme extends UV{constructor(){super({id:Ft.NextMatchFindAction,label:m("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:T.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Y.and(T.focus,nL),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class _me extends UV{constructor(){super({id:Ft.PreviousMatchFindAction,label:m("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:T.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Y.and(T.focus,nL),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class vme extends ue{constructor(){super({id:Ft.GoToMatchFindAction,label:m("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:bd}),this._highlightDecorations=[]}run(e,t,i){const n=us.get(t);if(!n)return;const s=n.getState().matchesCount;if(s<1){e.get(bi).notify({severity:ly.Warning,message:m("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(aa).createInputBox();a.placeholder=m("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",s);const l=c=>{const h=parseInt(c);if(isNaN(h))return;const u=n.getState().matchesCount;if(h>0&&h<=u)return h-1;if(h<0&&h>=-u)return u+h},d=c=>{const h=l(c);if(typeof h=="number"){a.validationMessage=void 0,n.goToMatch(h);const u=n.getState().currentMatch;u&&this.addDecorations(t,u)}else a.validationMessage=m("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(c=>{d(c)}),a.onDidAccept(()=>{const c=l(a.value);typeof c=="number"?(n.goToMatch(c),a.hide()):a.validationMessage=m("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",n.getState().mat
* 'levels': Number of levels to unfold. If not set, defaults to 1.
* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used.
`,constraint:XV,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=n&&n.levels||1,r=this.getLineNumbers(n,i);n&&n.direction==="up"?KV(t,!1,s,r):ip(t,!1,s,r)}}class Kme extends Qn{constructor(){super({id:"editor.unfoldRecursively",label:m("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2142),weight:100}})}invoke(e,t,i,n){ip(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class qme extends Qn{constructor(){super({id:"editor.fold",label:m("foldAction.label","Fold"),alias:"Fold",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument:
* 'levels': Number of levels to fold.
* 'direction': If 'up', folds given number of levels up otherwise folds down.
* 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used.
If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.
`,constraint:XV,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){const s=this.getLineNumbers(n,i),r=n&&n.levels,a=n&&n.direction;typeof r!="number"&&typeof a!="string"?Dme(t,!0,s):a==="up"?KV(t,!0,r||1,s):ip(t,!0,r||1,s)}}class Gme extends Qn{constructor(){super({id:"editor.toggleFold",label:m("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2090),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);jV(t,1,n)}}class Zme extends Qn{constructor(){super({id:"editor.foldRecursively",label:m("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);ip(t,!0,Number.MAX_VALUE,n)}}class Yme extends Qn{constructor(){super({id:"editor.foldAllBlockComments",label:m("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2138),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())YM(t,as.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+uo(a.blockCommentStartToken));ZM(t,l,!0)}}}}class Xme extends Qn{constructor(){super({id:"editor.foldAllMarkerRegions",label:m("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())YM(t,as.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);ZM(t,l,!0)}}}}class Qme extends Qn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:m("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())YM(t,as.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=s.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);ZM(t,l,!1)}}}}class Jme extends Qn{constructor(){super({id:"editor.foldAllExcept",label:m("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2136),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);qV(t,!0,n)}}class epe extends Qn{constructor(){super({id:"editor.unfoldAllExcept",label:m("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2134),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);qV(t,!1,n)}}class tpe extends Qn{constructor(){super({id:"editor.foldAll",label:m("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2069),weight:100}})}invoke(e,t,i){ip(t,!0)}}class ipe extends Qn{constructor(){super({id:"editor.unfoldAll",label:m("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2088),weight:100}})}invoke(e,t,i){ip(t,!1)}}class Hu extends Qn{getFoldingLevel(){return parseInt(this.id.substr(Hu.ID_PREFIX.length))}invoke(e,t,i){xme(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}Hu.ID_PREFIX="editor.foldLevel";Hu.ID=o=>Hu.ID_PREFIX+o;class npe extends Qn{constructor(){super({id:"editor.gotoParentFold",label:m("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Vn,kbOpts:{kbExpr:T.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const s=kme(n[0],t);s!==null&&i.setSelec
`&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}const vpe=[];function bpe(){return vpe}class Cpe{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Mi(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new D(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function wpe(o,e){const t=new X,i=o.createDecorationsCollection();return t.add(uM({debugName:()=>`Apply decorations from ${e.debugName}`},n=>{const s=e.read(n);i.set(s)})),t.add({dispose:()=>{i.clear()}}),t}function rN(o,e){return new W(o.lineNumber+e.lineNumber-1,e.lineNumber===1?o.column+e.column-1:e.column)}function aN(o){let e=1,t=1;for(const i of o)i===`
`?(e++,t=1):t++;return new W(e,t)}class uS{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return ppe(i,this.parts.map(s=>({range:{startLineNumber:1,endLineNumber:1,startColumn:s.column,endColumn:s.column},text:s.lines.join(`
`)}))).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class lN{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class dN{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.newLines=i,this.additionalReservedLineCount=n,this.parts=[new lN(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join(`
`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function J5(o,e){return o===e?!0:!o||!e?!1:o instanceof uS&&e instanceof uS||o instanceof dN&&e instanceof dN?o.equals(e):!1}var Spe=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ype=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let cN=class extends H{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Wt("isDisposed",!1),this.currentTextModel=fn(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=lt(n=>{if(this.isDisposed.read(n))return;const s=this.currentTextModel.read(n);if(s!==this.model.targetTextModel.read(n))return;const r=this.model.ghostText.read(n);if(!r)return;const a=r instanceof dN?r.columnRange:void 0,l=[],d=[];function c(p,_){if(d.length>0){const v=d[d.length-1];_&&v.decorations.push(new ls(v.content.length+1,v.content.length+1+p[0].length,_,0)),v.content+=p[0],p=p.slice(1)}for(const v of p)d.push({content:v,decorations:_?[new ls(1,v.length+1,_,0)]:[]})}const h=s.getLineContent(r.lineNumber);let u,g=0;for(const p of r.parts){let _=p.lines;u===void 0?(l.push({column:p.column,text:_[0],preview:p.preview}),_=_.slice(1)):c([h.substring(g,p.column-1)],void 0),_.length>0&&(c(_,"ghost-text"),u===void 0&&p.column<=h.length&&(u=p.column)),g=p.column-1}u!==void 0&&c([h.substring(g)],void 0);const f=u!==void 0?new Cpe(u,h.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:d,hiddenRange:f,lineNumber:r.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(n),targetTextModel:s}}),this.decorations=lt(n=>{const s=this.uiState.read(n);if(!s)return[];const r=[];s.replacedRange&&r.push({range:s.replacedRange.toRange(s.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),s.hiddenRange&&r.push({range:s.hiddenRange.toRange(s.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of s.inlineTexts)r.push({range:D.fromPositions(new W(s.lineNumber,a.column)),options:{description:"ghost-text",after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:jr.Left},showIfCollapsed:!0}});return r}),this.additionalLinesWidget=this._register(new Lpe(this.editor,this.languageService.languageIdCodec,lt(n=>{const s=this.uiState.read(n);return s?{lineNumber:s.lineNumber,additionalLines:s.additionalLines,minReservedLineCount:s.additionalReservedLineCount,targetTextModel:s.targetTextModel}:void 0}))),this._register(Oe(()=>{this.isDisposed.set(!0,void 0)})),this._register(wpe(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};cN=Spe([ype(2,Kt)],cN);class Lpe extends H{get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=eo("editorOptionChanged",pe.filter(this.editor.onDidChangeConfiguration,n=>n.hasChanged(32)||n.hasChanged(115)||n.hasChanged(97)||n.hasChanged(92)||n.hasChanged(50)||n.hasChanged(49)||n.hasChanged(65))),this._register(At(n=>{const s=this.lines.read(n);this.editorOptionsChanged.read(n),s?this.updateLines(s.lineNumber,s.additionalLines,s.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateL
`),n=e.replace(/\r\n|\r/g,`
`)}withRange(e){return new gS(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function Npe(o,e){const t=e.getWordAtPosition(o),i=e.getLineMaxColumn(o.lineNumber);return t?new D(o.lineNumber,t.startColumn,o.lineNumber,i):D.fromPositions(o,o.with(void 0,i))}function i3(o,e,t,i){const s=t.getLineContent(e.lineNumber).substring(0,e.column-1)+o,r=t.tokenization.tokenizeLineWithEdit(e,s.length-(e.column-1),o),a=r?.sliceAndInflate(e.column-1,s.length,0);return a?xpe(a,i):o}class Am{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const i=t?this.range.intersectRanges(t):this.range;if(!i)return this;const n=e.getValueInRange(i,1),s=pu(n,this.text),r=rN(this.range.getStartPosition(),aN(n.substring(0,s))),a=this.text.substring(s),l=D.fromPositions(r,this.range.getEndPosition());return new Am(l,a)}augments(e){return this.text.startsWith(e.text)&&Rpe(this.range,e.range)}computeGhostText(e,t,i,n=0){let s=this.removeCommonPrefix(e);if(s.range.endLineNumber!==s.range.startLineNumber)return;const r=e.getLineContent(s.range.startLineNumber),a=Et(r).length;if(s.range.startColumn-1<=a){const f=Et(s.text).length,p=r.substring(s.range.startColumn-1,a),[_,v]=[s.range.getStartPosition(),s.range.getEndPosition()],b=_.column+p.length<=v.column?_.delta(0,p.length):v,C=D.fromPositions(b,v),w=s.text.startsWith(p)?s.text.substring(p.length):s.text.substring(f);s=new Am(C,w)}const d=e.getValueInRange(s.range),c=Mpe(d,s.text);if(!c)return;const h=s.range.startLineNumber,u=new Array;if(t==="prefix"){const f=c.filter(p=>p.originalLength===0);if(f.length>1||f.length===1&&f[0].originalStart!==d.length)return}const g=s.text.length-n;for(const f of c){const p=s.range.startColumn+f.originalStart+f.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===s.range.startLineNumber&&p<i.column||f.originalLength>0)return;if(f.modifiedLength===0)continue;const _=f.modifiedStart+f.modifiedLength,v=Math.max(f.modifiedStart,Math.min(_,g)),b=s.text.substring(f.modifiedStart,v),C=s.text.substring(v,Math.max(f.modifiedStart,_));if(b.length>0){const w=Ya(b);u.push(new lN(p,w,!1))}if(C.length>0){const w=Ya(C);u.push(new lN(p,w,!0))}}return new uS(h,u)}}function Rpe(o,e){return e.getStartPosition().equals(o.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(o.getEndPosition())}let ga;function Mpe(o,e){if(ga?.originalValue===o&&ga?.newValue===e)return ga?.changes;{let t=s3(o,e,!0);if(t){const i=n3(t);if(i>0){const n=s3(o,e,!1);n&&n3(n)<i&&(t=n)}}return ga={originalValue:o,newValue:e,changes:t},t}}function n3(o){let e=0;for(const t of o)e+=t.originalLength;return e}function s3(o,e,t){if(o.length>5e3||e.length>5e3)return;function i(d){let c=0;for(let h=0,u=d.length;h<u;h++){const g=d.charCodeAt(h);g>c&&(c=g)}return c}const n=Math.max(i(o),i(e));function s(d){if(d<0)throw new Error("unexpected");return n+d+1}function r(d){let c=0,h=0;const u=new Int32Array(d.length);for(let g=0,f=d.length;g<f;g++)if(t&&d[g]==="("){const p=h*100+c;u[g]=s(2*p),c++}else if(t&&d[g]===")"){c=Math.max(c-1,0);const p=h*100+c;u[g]=s(2*p+1),c===0&&h++}else u[g]=d.charCodeAt(g);return u}const a=r(o),l=r(e);return new xa({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var Ape=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},o3=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},Ppe=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).the
`),d=t(a,l);if(d===l.length&&n.parts.length===1){this.accept(e);return}const c=l.substring(0,d);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Gt.replace(D.fromPositions(a),c)]);const h=aN(c);e.setPosition(rN(a,h))}finally{this._isAcceptingPartially=!1}if(s.source.provider.handlePartialAccept){const h=D.fromPositions(s.range.getStartPosition(),rN(a,aN(c))),u=e.getModel().getValueInRange(h,1);s.source.provider.handlePartialAccept(s.source.inlineCompletions,s.sourceInlineCompletion,u.length)}})}handleSuggestAccepted(e){var t,i;const n=e.toSingleTextEdit().removeCommonPrefix(this.textModel),s=this._computeAugmentedCompletion(n,void 0);if(!s)return;const r=s.completion.inlineCompletion;(i=(t=r.source.provider).handlePartialAccept)===null||i===void 0||i.call(t,r.source.inlineCompletions,r.sourceInlineCompletion,n.text.length)}};uN=e_e([Rx(9,Ae),Rx(10,ci),Rx(11,Pt)],uN);var t_e=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},_3=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}},c_;class sA{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const n=i[0].score[0];for(let s=0;s<i.length;s++){const{score:r,completion:a}=i[s];if(r[0]!==n)break;if(a.preselect)return s}return 0}}class tH extends sA{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class i_e extends sA{constructor(){super("recentlyUsed"),this._cache=new Jc(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const s=i[0].score[0];let r=-1,a=-1,l=-1;for(let d=0;d<i.length&&i[d].score[0]===s;d++){const c=`${e.getLanguageId()}/${i[d].textLabel}`,h=this._cache.peek(c);if(h&&h.touch>l&&h.type===i[d].completion.kind&&h.insertText===i[d].completion.insertText&&(l=h.touch,a=d),i[d].completion.preselect&&r===-1)return r=d}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,n]of e)n.touch=t,n.type=typeof n.type=="number"?n.type:X_.fromString(n.type),this._cache.set(i,n);this._seq=this._cache.size}}class n_e extends sA{constructor(){super("recentlyUsedByPrefix"),this._trie=Hf.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),s=`${e.getLanguageId()}/${n}`;this._trie.set(s,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:n}=e.getWordUntilPosition(t);if(!n)return super.select(e,t,i);const s=`${e.getLanguageId()}/${n}`;let r=this._trie.get(s);if(r||(r=this._trie.findSubstr(s)),r)for(let a=0;a<i.length;a++){const{kind:l,insertText:d}=i[a].completion;if(l===r.type&&d===r.insertText)return a}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:X_.fromString(i.type),this._trie.set(t,i)}}}let sb=c_=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new X,this._persistSoon=new kt(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===Iw.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var i;const n=this._configService.getValue("editor.s
`,a+=`prefix: ${(i=e.word)!==null&&i!==void 0?i:"(no prefix)"}
`,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}
`,a+=`distance: ${e.distance} (localityBonus-setting)
`,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}
`,a+=`commit_chars: ${(n=e.completion.commitCharacters)===null||n===void 0?void 0:n.join("")}
`,r=new un().appendCodeblock("empty",a),s=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!rA(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),s){const a=s.length>1e5?`${s.substr(0,1e5)}`:s;this._type.textContent=a,this._type.title=a,As(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Gi(this._type),this._type.title="",is(this._type),this.domNode.classList.add("no-type");if(Gi(this._docs),typeof r=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=r;else if(r){this._docs.classList.add("markdown-docs"),Gi(this._docs);const a=this._markdownRenderer.render(r);this._docs.appendChild(a.element),this._renderDisposeable.add(a),this._renderDisposeable.add(this._markdownRenderer.onDidRenderAsync(()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}))}this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new pt(e,t);pt.equals(i,this._size)||(this._size=i,gG(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}set borderWidth(e){this._borderWidth=e}get borderWidth(){return this._borderWidth}};_N=p_e([__e(1,Ae)],_N);class v_e{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new X,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new FM,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,n,s=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,n=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&n){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=n.width-a.dimension.width,l=!0),a.north&&(s=n.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+s,left:i.left+r})}a.done&&(i=void 0,n=void 0,s=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a:this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){var i;const n=e.getBoundingClientRect();this._anchorBox=n,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(i=this._userSize)!==null&&i!==void 0?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var n;const s=$m(document.body),r=this.widget.getLayoutInfo(),a=new pt(220,2*r.lineHeight),l=e.top,d=function(){const C=s.width-(e.left+e.width+r.borderWidth+r.horizontalPadding),w=-r.borderWidth+e.left+e.width,S=new pt(C,s.height-e.top-r.borderHeight-r.verticalPadding),k=S.with(void 0,e.top+e.height-r.borderHeight-r.verticalPadding);return{top:l,left:w,fit:C-t.width,maxSizeTop:S,maxSizeBottom:k,minSize:a.with(Math.min(C,a.width))}}(),c=function(){const C=e.left-r.borderWidth-r.horizontalPadding,w=Math.max(r.horizontalPadding,e.left
`);s===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new D(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
`):this._isCopyingDown?t.addEditOperation(new D(i.startLineNumber,1,i.startLineNumber,1),s+`
`):t.addEditOperation(new D(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),`
`+s),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let n=i.startLineNumber,s=i.startColumn,r=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(n=n+this._startLineNumberDelta,s=1),this._endLineNumberDelta!==0&&(r=r+this._endLineNumberDelta,a=1),i=ve.createWithDirection(n,s,r,a,this._selectionDirection)}return i}}var dve=globalThis&&globalThis.__decorate||function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},cve=globalThis&&globalThis.__param||function(o,e){return function(t,i){e(t,i,o)}};let LN=class{constructor(e,t,i,n){this._languageConfigurationService=n,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let n=this._selection;n.startLineNumber<n.endLineNumber&&n.endColumn===1&&(this._moveEndPositionDown=!0,n=n.setEndPosition(n.endLineNumber-1,e.getLineMaxColumn(n.endLineNumber-1)));const{tabSize:s,indentSize:r,insertSpaces:a}=e.getOptions(),l=this.buildIndentConverter(s,r,a),d={tokenization:{getLineTokens:c=>e.tokenization.getLineTokens(c),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(c,h)=>e.getLanguageIdAtPosition(c,h)},getLineContent:null};if(n.startLineNumber===n.endLineNumber&&e.getLineMaxColumn(n.startLineNumber)===1){const c=n.startLineNumber,h=this._isMovingDown?c+1:c-1;e.getLineMaxColumn(h)===1?t.addEditOperation(new D(1,1,1,1),null):(t.addEditOperation(new D(c,1,c,1),e.getLineContent(h)),t.addEditOperation(new D(h,1,h,e.getLineMaxColumn(h)),null)),n=new ve(h,1,h,1)}else{let c,h;if(this._isMovingDown){c=n.endLineNumber+1,h=e.getLineContent(c),t.addEditOperation(new D(c-1,e.getLineMaxColumn(c-1),c,e.getLineMaxColumn(c)),null);let u=h;if(this.shouldAutoIndent(e,n)){const g=this.matchEnterRule(e,l,s,c,n.startLineNumber-1);if(g!==null){const p=Et(e.getLineContent(c)),_=g+Ts(p,s);u=z_(_,s,a)+this.trimStart(h)}else{d.getLineContent=_=>_===n.startLineNumber?e.getLineContent(c):e.getLineContent(_);const p=C_(this._autoIndent,d,e.getLanguageIdAtPosition(c,1),n.startLineNumber,l,this._languageConfigurationService);if(p!==null){const _=Et(e.getLineContent(c)),v=Ts(p,s),b=Ts(_,s);v!==b&&(u=z_(v,s,a)+this.trimStart(h))}}t.addEditOperation(new D(n.startLineNumber,1,n.startLineNumber,1),u+`
`);const f=this.matchEnterRuleMovingDown(e,l,s,n.startLineNumber,c,u);if(f!==null)f!==0&&this.getIndentEditsOfMovingBlock(e,t,n,s,a,f);else{d.getLineContent=_=>_===n.startLineNumber?u:_>=n.startLineNumber+1&&_<=n.endLineNumber+1?e.getLineContent(_-1):e.getLineContent(_);const p=C_(this._autoIndent,d,e.getLanguageIdAtPosition(c,1),n.startLineNumber+1,l,this._languageConfigurationService);if(p!==null){const _=Et(e.getLineContent(n.startLineNumber)),v=Ts(p,s),b=Ts(_,s);if(v!==b){const C=v-b;this.getIndentEditsOfMovingBlock(e,t,n,s,a,C)}}}}else t.addEditOperation(new D(n.startLineNumber,1,n.startLineNumber,1),u+`
`)}else if(c=n.startLineNumber-1,h=e.getLineContent(c),t.addEditOperation(new D(c,1,c+1,1),null),t.addEditOperation(new D(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),`
`+h),this.shouldAutoIndent(e,n)){d.getLineContent=g=>g===c?e.getLineContent(n.startLineNumber):e.getLineContent(g);const u=this.matchEnterRule(e,l,s,n.startLineNumber,n.startLineNumber-2);if(u!==null)u!==0&&this.getIndentEditsOfMovingBlock(e,t,n,s,a,u);else{const g=C_(this._autoIndent,d,e.getLanguageIdAtPosition(n.startLineNumber,1),c,l,this._languageConfigurationService);if(g!==null){const f=Et(e.getLineContent(n.startLineNumber)),p=Ts(g,s),_=Ts(f,s);if(p!==_){const v=p-_;this.getIndentEditsOfMovingBlock(e,t,n,s,a,v)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>To.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>To.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let r=s.indentation;s.indentAction===ki.None||s.indentAction===ki.Indent?r=s.indentation+s.appendText:s.indentAction===ki.IndentOutdent?r=s.indentation:s.indentAction===ki.Outdent&&(r=t.unshiftIndent(s.indentation)+s.appendText);const a=e.getLineContent(n);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=Et(e.getLineContent(n));let d=Et(r);const c=C8(e,n,this._languageConfigurationService);c!==null&&c&2&&(d=t.unshiftIndent(d));const h=Ts(d,i),u=Ts(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,s,r){if(Zr(r)>=0){const a=e.getLineMaxColumn(s),l=Af(this._autoIndent,e,new D(s,a,s,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){const c=e.getLineContent(a);if(Zr(c)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),d=Af(this._autoIndent,e,new D(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,d)}}matchEnterRule(e,t,i,n,s,r){let a=s;for(;a>=1;){let c;if(a===s&&r!==void 0?c=r:c=e.getLineContent(a),Zr(c)>=0)break;a--}if(a<1||n>e.getLineCount())return null;const l=e.getLineMaxColumn(a),d=Af(this._autoIndent,e,new D(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,d)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,n,s,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),d=Et(l),h=Ts(d,n)+r,u=z_(h,n,s);u!==d&&(t.addEditOperation(new D(a,1,a,d.length+1),u),a===i.endLineNumber&&i.endColumn<=d.length+1&&u===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};LN=dve([cve(3,Pt)],LN);class Cc{static getCollator(){return Cc._COLLATOR||(Cc._COLLATOR=new Intl.Collator),Cc._COLLATOR}constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=hve(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(e===null)return!1;const n=dH(e,t,i);if(!n)return!1;for(let s=0,r=n.before.length;s<r;s++)if(n.before[s]!==n.after[s])return!0;return!1}}Cc._COLLATOR=null;function dH(o,e,t){const i=e.startLineNumber;let n=e.endLineNumber;if(e.endColumn===1&&n--,i>=n)return null;const s=[];for(let a=i;a<=n;a++)s.push(o.getLineContent(a));let r=s.slice(0);return r.sort(Cc.getCollator().compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:n,before:s,after:r}}function hve(o,e,t){const i=dH(o,e,t);return i?Gt.replace(new D(i.startLineNumber,1,i.endLineNumber,o.getLineMaxColumn(i.endLineNumber)),i.after.join(`
`)):null}class cH extends ue{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>D.compareRangesUsingStarts(r.selection,a.selection));let n=i[0];for(let r=1;r<i.length;r++){const a=i[r];n.selection.endLineNumber===a.selection.startLineNumber&&(n.index<a.index?a.ignore=!0:(n.ignore=!0,n=a))}const s=[];for(const r of i)s.push(new lH(r.selection,this.down,r.ignore));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class uve extends cH{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:m("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"2_line",title:m({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class gve extends cH{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:m("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"2_line",title:m({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class fve extends ue{constructor(){super({id:"editor.action.duplicateSelection",label:m("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:T.writable,menuOpts:{menuId:E.MenubarSelectionMenu,group:"2_line",title:m({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],s=t.getSelections(),r=t.getModel();for(const a of s)if(a.isEmpty())n.push(new lH(a,!0));else{const l=new ve(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);n.push(new JX(l,r.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class hH extends ue{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(Pt),n=[],s=t.getSelections()||[],r=t.getOption(11);for(const a of s)n.push(new LN(a,this.down,r,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class mve extends hH{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:m("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"2_line",title:m({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class pve extends hH{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:m("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:E.MenubarSelectionMenu,group:"2_line",title:m({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class uH extends ue{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const s of i)if(!Cc.canRun(t.getModel(),s,this.descending))return;const n=[];for(let s=0,r=i.length;s<r;s++)n[s]=new Cc(i[s],this.descending);t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class _ve extends uH{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:m("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:T.writable})}}class vve extends uH{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:m("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:T.writable})}}class bve extends ue{constructor(){super({id:"editor.action.removeDuplicateLines",label:m("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:T.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;const n=[],s=[];let r=0;for(const a of t.getSe
`))),s.push(u),r+=a.endLineNumber-a.startLineNumber+1-d.length}t.pushUndoStop(),t.executeEdits(this.id,n,s),t.pushUndoStop()}}class yL extends ue{constructor(){super({id:yL.ID,label:m("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:Ai(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(a=>new W(a.positionLineNumber,a.positionColumn)));const s=t.getSelection();if(s===null)return;const r=new ave(s,n);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop()}}yL.ID="editor.action.trimTrailingWhitespace";class Cve extends ue{constructor(){super({id:"editor.action.deleteLines",label:m("lines.delete","Delete Line"),alias:"Delete Line",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s=0;const r=[],a=[];for(let l=0,d=i.length;l<d;l++){const c=i[l];let h=c.startLineNumber,u=c.endLineNumber,g=1,f=n.getLineMaxColumn(u);u<n.getLineCount()?(u+=1,f=1):h>1&&(h-=1,g=n.getLineMaxColumn(h)),r.push(Gt.replace(new ve(h,g,u,f),"")),a.push(new ve(h-s,c.positionColumn,h-s,c.positionColumn)),s+=c.endLineNumber-c.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(s=>{let r=s.endLineNumber;return s.startLineNumber<s.endLineNumber&&s.endColumn===1&&(r-=1),{startLineNumber:s.startLineNumber,selectionStartColumn:s.selectionStartColumn,endLineNumber:r,positionColumn:s.positionColumn}});t.sort((s,r)=>s.startLineNumber===r.startLineNumber?s.endLineNumber-r.endLineNumber:s.startLineNumber-r.startLineNumber);const i=[];let n=t[0];for(let s=1;s<t.length;s++)n.endLineNumber+1>=t[s].startLineNumber?n.endLineNumber=t[s].endLineNumber:(i.push(n),n=t[s]);return i.push(n),i}}class wve extends ue{constructor(){super({id:"editor.action.indentLines",label:m("lines.indent","Indent Line"),alias:"Indent Line",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Xt.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class Sve extends ue{constructor(){super({id:"editor.action.outdentLines",label:m("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2140,weight:100}})}run(e,t){Pf.Outdent.runEditorCommand(e,t,null)}}class yve extends ue{constructor(){super({id:"editor.action.insertLineBefore",label:m("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Xt.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class Lve extends ue{constructor(){super({id:"editor.action.insertLineAfter",label:m("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:T.writable,kbOpts:{kbExpr:T.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Xt.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class gH extends ue{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),s=[];for(let l=0,d=n.length-1;l<d;l++){const c=n[l],h=n[l+1];D.intersectRanges(c,h)===null?s.push(c):n[l+1]=D.plusRange(c,h)}s.push(n[n.length-1]);const r=this._getEndCursorState(i,s),a=s.map(l=>Gt.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class Dve extends gH{constructor(){super({id:"deleteAllLeft",label:m("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:T.writable,kbOpts:{kbExpr:T.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];let s=0;return t.forEach(r=>{le
`);return new hb(e,t,n,d,s,r,c)}constructor(e,t,i,n,s,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=s,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new PC(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new PC(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(128):null,!1);return i?new ve(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new PC(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new PC(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const n=this.currentMatch;return this.currentMatch=null,n}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(128):null,!1);return i?new ve(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(128):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(128):null,!1,1073741824)}}class $u extends H{static get(e){return e.getContribution($u.ID)}constructor(e){super(),this._sessionDispose=this._register(new X),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=hb.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(n=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(n=>{(n.matchCase||n.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new ve(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const
`):void 0}:{range:D.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
`):void 0}})}provideRenameEdits(e,t){return hu(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,n){return hu(this,void 0,void 0,function*(){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join(`
`)};const r=yield s.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(m("no result","No result.")),n);return r})}}function wbe(o,e,t,i){return hu(this,void 0,void 0,function*(){const n=new hA(e,t,o),s=yield n.resolveRenameLocation(Ye.None);return s?.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,Ye.None)})}let qu=RN=class{static get(e){return e.getContribution(RN.ID)}constructor(e,t,i,n,s,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new X,this._cts=new Ei,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(NN,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return hu(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new Ei,!this.editor.hasModel())return;const i=this.editor.getPosition(),n=new hA(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!n.hasProvider())return;const s=new Fc(this.editor,5,void 0,this._cts.token);let r;try{const f=n.resolveRenameLocation(s.token);this._progressService.showWhile(f,250),r=yield f}catch(f){(e=Ws.get(this.editor))===null||e===void 0||e.showMessage(f||m("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}finally{s.dispose()}if(!r)return;if(r.rejectReason){(t=Ws.get(this.editor))===null||t===void 0||t.showMessage(r.rejectReason,i);return}if(s.token.isCancellationRequested)return;const a=new Fc(this.editor,5,r.range,this._cts.token),l=this.editor.getSelection();let d=0,c=r.text.length;!D.isEmpty(l)&&!D.spansMultipleLines(l)&&D.containsRange(r.range,l)&&(d=Math.max(0,l.startColumn-r.range.startColumn),c=Math.min(r.range.endColumn,l.endColumn)-r.range.startColumn);const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=yield this._renameInputField.getInput(r.range,r.text,d,c,h,a.token);if(typeof u=="boolean"){u&&this.editor.focus(),a.dispose();return}this.editor.focus();const g=zS(n.provideRenameEdits(u.newName,a.token),a.token).then(f=>hu(this,void 0,void 0,function*(){if(!(!f||!this.editor.hasModel())){if(f.rejectReason){this._notificationService.info(f.rejectReason);return}this.editor.setSelection(D.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(f,{editor:this.editor,showPreview:u.wantsPreview,label:m("label","Renaming '{0}' to '{1}'",r?.text,u.newName),code:"undoredo.rename",quotableLabel:m("quotableLabel","Renaming {0} to {1}",r?.text,u.newName),respectAutoSaveConfig:!0}).then(p=>{p.ariaSummary&&Pn(m("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,u.newName,p.ariaSummary))}).catch(p=>{this._notificationService.error(m("rename.failedApply","Rename failed to apply edits")),this._logService.error(p)})}}),f=>{this._notificationService.error(m("rename.failed","Rename failed to compute edits")),this._logService.error(f)}).finally(()=>{a.dispose()});return this._progressService.showWhile(g,250),g})}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};qu.ID="editor.contrib.renameController";qu=RN=Cbe([vh(1,Ae),vh(2,bi),vh(3,$b),vh(4,ul),vh(5,vo),vh(6,PR),vh(7,me)],qu);class Sbe extends ue{constructor(){super({id:"editor.action.rename",label:m("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:Y.and(T.writable,T.hasRenameProvider),kbOpts:{kbExpr:T.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(gt),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return Ie.isUri(n)&&W.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(s
`):o}function V3(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?m("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function KH(o=null,e=!1){if(!o)return m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=qa(o),i=KH(t[0],e);return t.length>1?m("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(cs(o))return o;if(o.detail){const t=o.detail;if(t.error)return Ux(t.error,e);if(t.exception)return Ux(t.exception,e)}return o.stack?Ux(o,e):o.message?o.message:m("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var Up=globalThis&&globalThis.__awaiter||function(o,e,t,i){function n(s){return s instanceof t?s:new t(function(r){r(s)})}return new(t||(t=Promise))(function(s,r){function a(c){try{d(i.next(c))}catch(h){r(h)}}function l(c){try{d(i.throw(c))}catch(h){r(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(o,e||[])).next())})},Sf;(function(o){o[o.NO_ACTION=0]="NO_ACTION",o[o.CLOSE_PICKER=1]="CLOSE_PICKER",o[o.REFRESH_PICKER=2]="REFRESH_PICKER",o[o.REMOVE_ITEM=3]="REMOVE_ITEM"})(Sf||(Sf={}));function $x(o){const e=o;return Array.isArray(e.items)}function H3(o){const e=o;return!!e.picks&&e.additionalPicks instanceof Promise}class gCe extends H{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var n;const s=new X;e.canAcceptInBackground=!!(!((n=this.options)===null||n===void 0)&&n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r;const a=s.add(new In),l=()=>Up(this,void 0,void 0,function*(){const d=a.value=new X;r?.dispose(!0),e.busy=!1,r=new Ei(t);const c=r.token,h=e.value.substr(this.prefix.length).trim(),u=this._getPicks(h,d,c,i),g=(p,_)=>{var v;let b,C;if($x(p)?(b=p.items,C=p.active):b=p,b.length===0){if(_)return!1;(h.length>0||e.hideInput)&&(!((v=this.options)===null||v===void 0)&&v.noResultsPick)&&(G_(this.options.noResultsPick)?b=[this.options.noResultsPick(h)]:b=[this.options.noResultsPick])}return e.items=b,C&&(e.activeItems=[C]),!0},f=p=>Up(this,void 0,void 0,function*(){let _=!1,v=!1;yield Promise.all([(()=>Up(this,void 0,void 0,function*(){typeof p.mergeDelay=="number"&&(yield xc(p.mergeDelay),c.isCancellationRequested)||v||(_=g(p.picks,!0))}))(),(()=>Up(this,void 0,void 0,function*(){e.busy=!0;try{const b=yield p.additionalPicks;if(c.isCancellationRequested)return;let C,w;$x(p.picks)?(C=p.picks.items,w=p.picks.active):C=p.picks;let S,k;if($x(b)?(S=b.items,k=b.active):S=b,S.length>0||!_){let L;if(!w&&!k){const x=e.activeItems[0];x&&C.indexOf(x)!==-1&&(L=x)}g({items:[...C,...S],active:w||k||L})}}finally{c.isCancellationRequested||(e.busy=!1),v=!0}}))()])});if(u!==null)if(H3(u))yield f(u);else if(!(u instanceof Promise))g(u);else{e.busy=!0;try{const p=yield u;if(c.isCancellationRequested)return;H3(p)?yield f(p):g(p)}finally{c.isCancellationRequested||(e.busy=!1)}}});return s.add(e.onDidChangeValue(()=>l())),l(),s.add(e.onDidAccept(d=>{const[c]=e.selectedItems;typeof c?.accept=="function"&&(d.inBackground||e.hide(),c.accept(e.keyMods,d))})),s.add(e.onDidTriggerItemButton(({button:d,item:c})=>Up(this,void 0,void 0,function*(){var h,u;if(typeof c.trigger=="function"){const g=(u=(h=c.buttons)===null||h===void 0?void 0:h.indexOf(d))!==null&&u!==void 0?u:-1;if(g>=0){const f=c.trigger(g,e.keyMods),p=typeof f=="number"?f:yield f;if(t.isCancellationRequested)return;switch(p){case Sf.NO_ACTION:break;case Sf.CLOSE_PICKER:e.hide();break;case Sf.REFRESH_PICKER:l();break;case Sf.REMOVE_ITEM:{const _=e.items.indexOf(c);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),C=e.activeItems.filter(S=>S!==b[0]),w=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,C&&(e.activeItems=C),e.keepScrollPosition=w}break}}}}}))),s}}var qH=