goview_vue/dist/static/js/EditorWorker-43e8cbc4.js

777 lines
2.3 MiB
JavaScript
Raw Normal View History

2023-06-06 13:24:29 +08:00
var IW=Object.defineProperty;var II=Object.getOwnPropertySymbols;var EW=Object.prototype.hasOwnProperty,TW=Object.prototype.propertyIsEnumerable;var JC=(r,e,t)=>e in r?IW(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,EI=(r,e)=>{for(var t in e||(e={}))EW.call(e,t)&&JC(r,t,e[t]);if(II)for(var t of II(e))TW.call(e,t)&&JC(r,t,e[t]);return r};var zt=(r,e,t)=>(JC(r,typeof e!="symbol"?e+"":e,t),t);var Ac=(r,e,t)=>new Promise((i,n)=>{var s=l=>{try{a(t.next(l))}catch(d){n(d)}},o=l=>{try{a(t.throw(l))}catch(d){n(d)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(r,e)).next())});import{O as NW,j as RW,cB as MW,ad as AW,d as OW,m as PW,J as FW,o as BW,c as WW,n as VW,au as HW,b as zW,u as $W,F as UW,h as jW,ae as de}from"./index-4ec2ce15.js";import{i as Ji,U as KW,a as He,e as oa,b as is,D as V,E as A,m as ga,R as S,c as Zi,d as lR,f as qW,g as Co,h as sl,o as Te,t as Ue,j as ht,k as GW,l as ZW,T as ED,n as M_,p as ov,C as ji,q as Su,r as ge,s as dR,u as dy,v as Zl,w as Pn,S as Ks,x as YW,y as TI,z as TD,A as ew,B as tt,F as X,G as XW,H as $i,I as wn,J as Qr,K as ol,L as ND,M as rv,N as Ot,O as RD,P as ra,Q as po,V as mo,W as pg,X as QW,Y as yn,Z as xe,_ as cc,$ as JW,a0 as wo,a1 as eV,a2 as ho,a3 as nt,a4 as tV,a5 as iV,a6 as nV,a7 as sV,a8 as cR,a9 as qs,aa as So,ab as An,ac as fs,ad as On,ae as mt,af as P,ag as Ia,ah as hs,ai as hR,aj as uR,ak as NI,al as RI,am as ae,an as Bh,ao as A_,ap as Gs,aq as oV,ar as gR,as as rV,at as ih,au as Ea,av as Jn,aw as fR,ax as Ed,ay as ne,az as aV,aA as Wh,aB as lV,aC as dV,aD as pR,aE as rl,aF as _o,aG as cV,aH as hV,aI as Jm,aJ as uV,aK as Qo,aL as MD,aM as mR,aN as gV,aO as an,aP as Fs,aQ as AD,aR as rr,aS as OD,aT as fV,aU as sf,aV as _R,aW as pV,aX as mV,aY as nh,aZ as MI,a_ as _V,a$ as bV,b0 as bR,b1 as vR,b2 as vV,b3 as CV,b4 as PD,b5 as e_,b6 as za,b7 as wV,b8 as qp,b9 as Ul,ba as tw,bb as AI,bc as Io,bd as SV,be as Pa,bf as yV,bg as CR,bh as cy,bi as FD,bj as wR,bk as SR,bl as hy,bm as LV,bn as DV,bo as BD,bp as xV,bq as gd,br as kV,bs as IV,bt as hc,bu as yR,bv as EV,bw as LR,bx as TV,by as kl,bz as Ye,bA as wi,bB as NV,bC as _s,bD as nn,bE as RV,bF as Oo,bG as WD,bH as VD,bI as iw,bJ as Gp,bK as DR,bL as OI,bM as MV,bN as PI,bO as FI,bP as uy,bQ as AV,bR as OV,bS as xR,bT as PV,bU as FV,bV as BV,bW as WV,bX as VV,bY as HV,bZ as zV,b_ as $V,b$ as UV,c0 as jV,c1 as KV,c2 as qV,c3 as GV,c4 as ZV,c5 as YV,c6 as XV,c7 as QV,c8 as JV,c9 as eH,ca as tH,cb as iH,cc as nH,cd as sH,ce as oH,cf as rH,cg as aH,ch as lH,ci as dH,cj as cH,ck as hH,cl as uH,cm as gH,cn as fH,co as pH,cp as mH,cq as gp,cr as HD,cs as _H,ct as Ei,cu as O_,cv as kR,cw as bH,cx as vH,cy as CH,cz as wH,cA as IR,cB as SH,cC as sh,cD as lo,cE as BI,cF as zD,cG as yH,cH as LH,cI as DH,cJ as xH,cK as WI,cL as $a,cM as Zp,cN as kH,cO as ER,cP as TR,cQ as gy,cR as IH,cS as EH,cT as TH}from"./editorWorker-43a98755.js";function NH(r,e){let t;return e.length===0?t=r:t=r.replace(/\{(\d+)\}/g,function(i,n){const s=n[0];return typeof e[s]!="undefined"?e[s]:i}),t}function f(r,e,...t){return NH(e,t)}const Yi={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!1}},Da=8;class NR{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class RR{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class fi{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return av(e,t)}compute(e,t,i){return i}}class xg{constructor(e,t){this.newValue=e,this.didChange=t}}function av(r,e){if(typeof r!="object"||typeof e!="object"||!r||!e)return new xg(e,r!==e);if(Array.isArray(r)||Array.isArray(e)){const i=Array.isArray(r)&&Array.isArray(e)&&is(r,e);return new xg(e,i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const n=av(r[i],e[i]);n.didChange&&(r[i]=n.newValue,t=!0)}return new xg(r,t)}class yu{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t)
2023-06-06 11:55:37 +08:00
- 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 qH extends fi{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",renderCharacters:!0,maxColumn:120,scale:1};super(65,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:f("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[f("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),f("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),f("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:f("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:f("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:f("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:f("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:f("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:f("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:ve(t.enabled,this.defaultValue.enabled),size:vn(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:vn(t.side,this.defaultValue.side,["right","left"]),showSlider:vn(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:ve(t.renderCharacters,this.defaultValue.renderCharacters),scale:It.clampedInt(t.scale,1,1,3),maxColumn:It.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function GH(r){return r==="ctrlCmd"?He?"metaKey":"ctrlKey":"altKey"}class ZH extends fi{constructor(){super(75,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:f("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:f("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:It.clampedInt(t.top,0,0,1e3),bottom:It.clampedInt(t.bottom,0,0,1e3)}}}class YH extends fi{constructor(){const e={enabled:!0,cycle:!1};super(76,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:f("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:f("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:ve(t.enabled,this.defaultValue.enabled),cycle:ve(t.cycle,this.defaultValue.cycle)}}}class XH extends yu{constructor(){super(129)}compute(e,t,i){return e.pixelRatio}}class QH extends fi{constructor(){const e={other:!0,comments:!1,strings:!1};super(79,"quickSuggestions",e,{anyOf:[{type:"boolean"},{type:"object",properties:{strings:{type:"boolean",default:e.strings,description:f("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{type:"boolean",default:e.comments,description:f("quickSuggesti
`;function zI(r){return r.filter(([e,t])=>e!==""&&t!=="")}const $I=typeof Buffer!="undefined";let ow;class dv{constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}static wrap(e){return $I&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new dv(e)}toString(){return $I?this.buffer.toString():(ow||(ow=new TextDecoder),ow.decode(this.buffer))}}function E2(r,e){return r[e+0]<<0>>>0|r[e+1]<<8>>>0}function T2(r,e,t){r[t+0]=e&255,e=e>>>8,r[t+1]=e&255}function io(r,e){return r[e]*Math.pow(2,24)+r[e+1]*Math.pow(2,16)+r[e+2]*Math.pow(2,8)+r[e+3]}function no(r,e,t){r[t+3]=e,e=e>>>8,r[t+2]=e,e=e>>>8,r[t+1]=e,e=e>>>8,r[t]=e}function UI(r,e){return r[e]}function jI(r,e,t){r[t]=e}let rw;function PR(){return rw||(rw=new TextDecoder("UTF-16LE")),rw}let aw;function N2(){return aw||(aw=new TextDecoder("UTF-16BE")),aw}let lw;function FR(){return lw||(lw=lR()?PR():N2()),lw}const BR=typeof TextDecoder!="undefined";let Td,by;BR?(Td=r=>new M2(r),by=R2):(Td=r=>new A2,by=WR);function R2(r,e,t){const i=new Uint16Array(r.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?WR(r,e,t):PR().decode(i)}function WR(r,e,t){const i=[];let n=0;for(let s=0;s<t;s++){const o=E2(r,e);e+=2,i[n++]=String.fromCharCode(o)}return i.join("")}class M2{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 FR().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}write1(e){const t=this._capacity-this._bufferLength;t<=1&&(t===0||Zi(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCII(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIIString(e){const t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class A2{constructor(){this._pieces=[],this._piecesLen=0}reset(){this._pieces=[],this._piecesLen=0}build(){return this._pieces.join("")}write1(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCII(e){this._pieces[this._piecesLen++]=String.fromCharCode(e)}appendASCIIString(e){this._pieces[this._piecesLen++]=e}}class B_{constructor(e,t,i,n,s,o){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=n,this.forwardRegex=s,this.reversedRegex=o,this._openSet=B_._toSet(this.open),this._closeSet=B_._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 O2(r){const e=r.length;r=r.map(o=>[o[0].toLowerCase(),o[1].toLowerCase()]);const t=[];for(let o=0;o<e;o++)t[o]=o;const i=(o,a)=>{const[l,d]=o,[c,h]=a;return l===c||l===h||d===c||d===h},n=(o,a)=>{const l=Math.min(o,a),d=Math.max(o,a);for(let c=0;c<e;c++)t[c]===d&&(t[c]=l)};for(let o=0;o<e;o++){const a=r[o];for(let l=o+1;l<e;l++){const d=r[l];i(a,d)&&n(t[o],t[l])}}const s=[];for(let o=0;o<e;o++){const a=[],l=[];for(let d=0;d<e;d++)if(t[d]===o){const[c,h]=r[d];a.push(c),l.push(h)}a.length>0&&s.push({open:a,close:l})}return s}class P2{constructor(e,t){this._richEditBracketsBrand=void 0;const i=O2(t);this.brackets=i.map((n,s)=>new B_(e,s,n.open,n.close,F2(n.open,n.close,i,s),B2(n.open,n.close,i,s))),this.forwardRegex=W2(this.brackets),this.reversedRegex=V2(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);f
`:e,l=a.length;let d=i.embeddedLanguageData,c=i.stack,h=0,u=null,g=!0;for(;g||h<l;){const p=h,m=c.depth,_=u?u.groups.length:0,b=c.state;let v=null,C=null,w=null,L=null,E=null;if(u){v=u.matches;const R=u.groups.shift();C=R.matched,w=R.action,L=u.rule,u.groups.length===0&&(u=null)}else{if(!g&&h>=l)break;g=!1;let R=this._lexer.tokenizer[b];if(!R&&(R=Xp(this._lexer,b),!R))throw St(this._lexer,"tokenizer state is not defined: "+b);let W=a.substr(h);for(const B of R)if((h===0||!B.matchOnlyAtLineStart)&&(v=W.match(B.regex),v)){C=v[0],w=B.action;break}}if(v||(v=[""],C=""),w||(h<l&&(v=[a.charAt(h)],C=v[0]),w=this._lexer.defaultToken),C===null)break;for(h+=C.length;Tz(w)&&sE(w)&&w.test;)w=w.test(C,v,b,h===l);let y=null;if(typeof w=="string"||Array.isArray(w))y=w;else if(w.group)y=w.group;else if(w.token!==null&&w.token!==void 0){if(w.tokenSubst?y=Ra(this._lexer,w.token,C,v,b):y=w.token,w.nextEmbedded)if(w.nextEmbedded==="@pop"){if(!d)throw St(this._lexer,"cannot pop embedded language if not inside one");d=null}else{if(d)throw St(this._lexer,"cannot enter embedded language from within an embedded language");E=Ra(this._lexer,w.nextEmbedded,C,v,b)}if(w.goBack&&(h=Math.max(0,h-w.goBack)),w.switchTo&&typeof w.switchTo=="string"){let R=Ra(this._lexer,w.switchTo,C,v,b);if(R[0]==="@"&&(R=R.substr(1)),Xp(this._lexer,R))c=c.switchTo(R);else throw St(this._lexer,"trying to switch to a state '"+R+"' that is undefined in rule: "+this._safeRuleName(L))}else{if(w.transform&&typeof w.transform=="function")throw St(this._lexer,"action.transform not supported");if(w.next)if(w.next==="@push"){if(c.depth>=this._lexer.maxStack)throw St(this._lexer,"maximum tokenizer stack size reached: ["+c.state+","+c.parent.state+",...]");c=c.push(b)}else if(w.next==="@pop"){if(c.depth<=1)throw St(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(L));c=c.pop()}else if(w.next==="@popall")c=c.popall();else{let R=Ra(this._lexer,w.next,C,v,b);if(R[0]==="@"&&(R=R.substr(1)),Xp(this._lexer,R))c=c.push(R);else throw St(this._lexer,"trying to set a next state '"+R+"' that is undefined in rule: "+this._safeRuleName(L))}}w.log&&typeof w.log=="string"&&Nz(this._lexer,this._lexer.languageId+": "+Ra(this._lexer,w.log,C,v,b))}if(y===null)throw St(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(L));const D=R=>{const W=this._languageService.getLanguageIdByLanguageName(R)||this._languageService.getLanguageIdByMimeType(R)||R,B=this._getNestedEmbeddedLanguageData(W);if(h<l){const te=e.substr(h);return this._nestedTokenize(te,t,Ma.create(c,B),n+h,s)}else return Ma.create(c,B)};if(Array.isArray(y)){if(u&&u.groups.length>0)throw St(this._lexer,"groups cannot be nested: "+this._safeRuleName(L));if(v.length!==y.length+1)throw St(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(L));let R=0;for(let W=1;W<v.length;W++)R+=v[W].length;if(R!==C.length)throw St(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(L));u={rule:L,matches:v,groups:[]};for(let W=0;W<y.length;W++)u.groups[W]={action:y[W],matched:v[W+1]};h-=C.length;continue}else{if(y==="@rematch"&&(h-=C.length,C="",v=null,y="",E!==null))return D(E);if(C.length===0){if(l===0||m!==c.depth||b!==c.state||(u?u.groups.length:0)!==_)continue;throw St(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(L))}let R=null;if(tM(y)&&y.indexOf("@brackets")===0){const W=y.substr(9),B=Az(this._lexer,C);if(!B)throw St(this._lexer,"@brackets token returned but no bracket defined as: "+C);R=oE(B.token+W)}else{const W=y===""?"":y+this._lexer.tokenPostfix;R=oE(W)}p<o&&s.emit(p+n,R)}if(E!==null)return D(E)}return Ma.create(c,d)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new ah(e,Hh);e!==this._languageId&&(Ot.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=Ot.get(e);return t?new ah(e,t.getInitialState()):new ah(e,Hh)}}function Az(r,e){if(!e)return null;e=Ka(r,e);const t=r.brackets;for(const i of t){if(i.open===e)return{to
`)}}const kv=new V3;ti.add(TM.ColorContribution,kv);function I(r,e,t,i,n){return kv.registerColor(r,e,t,i,n)}const oe=I("foreground",{dark:"#CCCCCC",light:"#616161",hc:"#FFFFFF"},f("foreground","Overall foreground color. This color is only used if not overridden by a component.")),H3=I("errorForeground",{dark:"#F48771",light:"#A1260D",hc:"#F48771"},f("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));I("descriptionForeground",{light:"#717171",dark:Se(oe,.7),hc:Se(oe,.7)},f("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const vw=I("icon.foreground",{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},f("iconForeground","The default color for icons in the workbench.")),ar=I("focusBorder",{dark:"#007FD4",light:"#0090F1",hc:"#F38518"},f("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Rt=I("contrastBorder",{light:null,dark:null,hc:"#6FC3DF"},f("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),en=I("contrastActiveBorder",{light:null,dark:null,hc:ar},f("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));I("selection.background",{light:null,dark:null,hc:null},f("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));I("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hc:F.black},f("textSeparatorForeground","Color for text separators."));const Iv=I("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},f("textLinkForeground","Foreground color for links in text.")),Ev=I("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hc:"#3794FF"},f("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));I("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hc:"#D7BA7D"},f("textPreformatForeground","Foreground color for preformatted text segments."));I("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hc:null},f("textBlockQuoteBackground","Background color for block quotes in text."));I("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hc:F.white},f("textBlockQuoteBorder","Border color for block quotes in text."));const NM=I("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hc:F.black},f("textCodeBlockBackground","Background color for code blocks in text.")),ul=I("widget.shadow",{dark:Se(F.black,.36),light:Se(F.black,.16),hc:null},f("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),gx=I("input.background",{dark:"#3C3C3C",light:F.white,hc:F.black},f("inputBoxBackground","Input box background.")),fx=I("input.foreground",{dark:oe,light:oe,hc:oe},f("inputBoxForeground","Input box foreground.")),px=I("input.border",{dark:null,light:null,hc:Rt},f("inputBoxBorder","Input box border.")),Ay=I("inputOption.activeBorder",{dark:"#007ACC00",light:"#007ACC00",hc:Rt},f("inputBoxActiveOptionBorder","Border color of activated options in input fields."));I("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hc:null},f("inputOption.hoverBackground","Background color of activated options in input fields."));const Oy=I("inputOption.activeBackground",{dark:Se(ar,.4),light:Se(ar,.2),hc:F.transparent},f("inputOption.activeBackground","Background hover color of options in input fields.")),Py=I("inputOption.activeForeground",{dark:F.white,light:F.black,hc:null},f("inputOption.activeForeground","Foreground color of activated options in input fields."));I("input.placeholderForeground",{light:Se(oe,.5),dark:Se(oe,.5),hc:Se(oe,.7)},f("inputPlaceholderForeground","Input box foreground color for placeholder text."));const RM=I("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hc:F.black},f("inputValidationInfoBackground","Input validati
${a}: ${o};`}return i+=`
}`,i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function _U(r){return r.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class Cp extends V{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 Ds extends Cp{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class cr{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 o=0;o<n;o++)s[o]=i[n-o-1];return s}}class bU{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){return this._viewLayout.getVerticalOffsetForLineNumber(e)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class vU extends bU{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 CU{constructor(e,t,i){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i}}class Rv{constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}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 Rv(s.left,s.width)}return t}toString(){return`[${this.left},${this.width}]`}}class kh{constructor(e,t){this._floatHorizontalRangeBrand=void 0,this.left=e,this.width=t}toString(){return`[${this.left},${this.width}]`}sta
target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?hi.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return _n.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return _n.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,n){return _n.createMargin(e,this.target,this._getMouseColumn(t),t,i,n)}fulfillViewZone(e,t,i){return _n.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return _n.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return _n.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return _n.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return _n.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return _n.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new Dx(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const DE={isAfterLines:!0};function yw(r){return{isAfterLines:!1,horizontalDistanceToText:r}}class Bi{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=cr.collect(t,this._viewHelper.viewDomNode);return!!(Ns.isChildOfContentWidgets(i)||Ns.isChildOfOverflowingContentWidgets(i)||Ns.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,n,s){const o=new qh(this._context,this._viewHelper,e),a=new Dx(o,t,i,n,s);try{return Bi._createMouseTarget(o,a,!1)}catch(l){return a.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(t.target===null){if(i)return t.fulfillUnknown();const o=Bi._doHitTest(e,t);return o.type===1?Bi.createMouseTargetFromHitTestPosition(e,t,o.spanNode,o.position,o.injectedText):this._createMouseTarget(e,t.withTarget(o.hitTarget),!0)}const n=t;let s=null;return s=s||Bi._hitTestContentWidget(e,n),s=s||Bi._hitTestOverlayWidget(e,n),s=s||Bi._hitTestMinimap(e,n),s=s||Bi._hitTestScrollbarSlider(e,n),s=s||Bi._hitTestViewZone(e,n),s=s||Bi._hitTestMargin(e,n),s=s||Bi._hitTestViewCursor(e,n),s=s||Bi._hitTestTextArea(e,n),s=s||Bi._hitTestViewLines(e,n,i),s=s||Bi._hitTestScrollbar(e,n),s||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(Ns.isChildOfContentWidgets(t.targetPath)||Ns.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(Ns.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 o of i){if(n<o.contentLeft||n>o.contentLeft+o.width)continue;const a=e.getVerticalOffsetForLineNumber(o.position.lineNumber);if(a<=s&&s<=a+o.height)return t.fulfillContentText(o.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 Ns.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),n=i.range.getStartPosition();let s=Math.abs(t.relativePos.x);const o={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMargin
`,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(Bh(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(A_(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(n,e.value.length-s);const o=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:o,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}const h=l-a;return{text:o,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(Bh(e.value,t.value),e.selectionEnd),n=Math.min(A_(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),o=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:o,replacePrevCharCnt:a,replaceNextCharCnt:s.length-a,positionDelta:l-o.length}}}Vi.EMPTY=new Vi("",0,0,null,null);class dh{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 S(n,1,s+1,1)}static fromEditorSelection(e,t,i,n,s){const o=dh._getPageOfLine(i.startLineNumber,n),a=dh._getRangeForPage(o,n),l=dh._getPageOfLine(i.endLineNumber,n),d=dh._getRangeForPage(l,n),c=a.intersectRanges(new S(1,1,i.startLineNumber,i.startColumn));let h=t.getValueInRange(c,1);const u=t.getLineCount(),g=t.getLineMaxColumn(u),p=d.intersectRanges(new S(i.endLineNumber,i.endColumn,u,g));let m=t.getValueInRange(p,1),_;if(o===l||o+1===l)_=t.getValueInRange(i,1);else{const b=a.intersectRanges(i),v=d.intersectRanges(i);_=t.getValueInRange(b,1)+String.fromCharCode(8230)+t.getValueInRange(v,1)}return s&&(h.length>500&&(h=h.substring(h.length-500,h.length)),m.length>500&&(m=m.substring(0,500)),_.length>2*500&&(_=_.substring(0,500)+String.fromCharCode(8230)+_.substring(_.length-500,_.length))),new Vi(h+_+m,h.length,h.length+_.length,new P(i.startLineNumber,i.startColumn),new P(i.endLineNumber,i.endColumn))}}var Q_;(function(r){r.Tap="-monaco-textarea-synthetic-tap"})(Q_||(Q_={}));const zy={forceCopyWithSyntaxHighlighting:!1};class ff{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)}}ff.INSTANCE=new ff;class NU{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 RU extends V{constructor(e,t,i,n){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._onFocus=this._register(new A),this.onFocus=this._onFocus.event,this._onBlur=this._register(new A),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new A),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new A),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new A),this.onCut=this._onCut.event,this._onPaste=this._register(new A),this.onPaste=this._onPaste.event,this._onType=this._register(new A),this.onType=this._onType.event,this._onCompositionStart=this._register(new A),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new A),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new A),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new A),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new gt(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new gt(()=>th
`):t.text,i),e.preventDefault(),e.clipboardData&&xE.setTextData(e.clipboardData,t.text,t.html,i)}}class xE{static getTextData(e){const t=e.getData(co.text);let i=null;const n=e.getData("vscode-editor-data");if(typeof n=="string")try{i=JSON.parse(n),i.version!==1&&(i=null)}catch(s){}return[t,i]}static setTextData(e,t,i,n){e.setData(co.text,t),typeof i=="string"&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}}class MU extends V{constructor(e){super(),this._actual=e,this.onKeyDown=this._register(to(this._actual,"keydown")).event,this.onKeyUp=this._register(to(this._actual,"keyup")).event,this.onCompositionStart=this._register(to(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(to(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(to(this._actual,"compositionend")).event,this.onInput=this._register(to(this._actual,"input")).event,this.onCut=this._register(to(this._actual,"cut")).event,this.onCopy=this._register(to(this._actual,"copy")).event,this.onPaste=this._register(to(this._actual,"paste")).event,this.onFocus=this._register(to(this._actual,"focus")).event,this.onBlur=this._register(to(this._actual,"blur")).event,this._onSyntheticTap=this._register(new A),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(Z(this._actual,Q_.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=ll(this._actual);return e?e.activeElement===this._actual:nx(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 o=ll(n);o?s=o.activeElement:s=document.activeElement;const a=s===n,l=n.selectionStart,d=n.selectionEnd;if(a&&l===t&&d===i){os&&window.parent!==window&&n.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),os&&window.parent!==window&&n.focus();return}try{const c=s3(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),o3(n,c)}catch(c){}}}class AU extends Fd{constructor(e,t,i){super(e,t,i),this._register(ct.addTarget(this.viewHelper.linesContentDomNode)),this._register(Z(this.viewHelper.linesContentDomNode,Lt.Tap,s=>this.onTap(s))),this._register(Z(this.viewHelper.linesContentDomNode,Lt.Change,s=>this.onChange(s))),this._register(Z(this.viewHelper.linesContentDomNode,Lt.Contextmenu,s=>this._onContextMenu(new Pd(s,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(Z(this.viewHelper.linesContentDomNode,"pointerdown",s=>{const o=s.pointerType;if(o==="mouse"){this._lastPointerType="mouse";return}else o==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const n=new fU(this.viewHelper.viewDomNode);this._register(n.onPointerMoveThrottled(this.viewHelper.viewDomNode,s=>this._onMouseMove(s),X_(this.mouseTargetFactory),Fd.MOUSE_MOVE_MINIMUM_TIME)),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=>this._onMouseDown(s)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new Pd(e,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:
`),b=m.substring(_+1),v=b.lastIndexOf(" "),C=b.length-v-1,w=h.getStartPosition(),L=Math.min(w.column-1,C),E=w.column-1-L,y=b.substring(0,b.length-L),D=v4(y,this._fontInfo);return{distanceToModelLineStart:E,widthOfHiddenTextBefore:D}})(),{distanceToModelLineEnd:p}=(()=>{const m=c.value.substring(Math.max(c.selectionStart,c.selectionEnd)),_=m.indexOf(`
`),b=_===-1?m:m.substring(0,_),v=b.indexOf(" "),C=v===-1?b.length:b.length-v-1,w=h.getEndPosition(),L=Math.min(this._context.viewModel.model.getLineMaxColumn(w.lineNumber)-w.column,C);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(w.lineNumber)-w.column-L}})();this._context.viewModel.revealRange("keyboard",!0,S.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new _4(this._context,h.startLineNumber,u,g,p),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${wd} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(d=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this._render(),this.textArea.setClassName(`inputarea ${wd}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)}))}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),n=Gs(t);let s=!0,o=e.column,a=!0,l=e.column,d=0;for(;d<50&&(s||a);){if(s&&o<=1&&(s=!1),s){const c=i.charCodeAt(o-2);n.get(c)!==0?s=!1:o--}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(o-1,l-1),e.column-o]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Gs(this._context.configuration.options.get(117));let n=e.column,s=0;for(;n>1;){const o=t.charCodeAt(n-2);if(i.get(o)!==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(!Zi(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){return e.get(2)===1?f("accessibilityOffAriaLabel","The editor is not accessible at this time. Press {0} for options.",Ji?"Shift+Alt+F1":"Alt+F1"):e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===Eo.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(131);return this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(44),this._lineHeight=t.get(59),this._emptySelectionClipboard=t.get(32),this._copyWithSyntaxHighlighting=t.get(21),this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("tabindex",String(t.get(112))),(e.hasChanged(30)||e.hasChanged(81))&&(t.get(30)&&t.get(81)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","fals
`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:Gu?0:1,height:Gu?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Ui(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?F.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(50)?i.setClassName("monaco-editor-background textAreaCover "+Bd.OUTER_CLASS_NAME):n.get(60).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+Gh.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}}function v4(r,e){if(r.length===0)return 0;const t=document.createElement("div");t.style.position="absolute",t.style.top="-50000px",t.style.width="50000px";const i=document.createElement("span");Ui(i,e),i.style.whiteSpace="pre",i.append(r),t.appendChild(i),document.body.appendChild(t);const n=i.offsetWidth;return document.body.removeChild(t),n}function C4(r,e,t){let i=0;for(let s=0;s<r.length;s++)r.charAt(s)===" "?i+=e:i++;let n="";if(!t){const s=Math.floor(i/e);i=i%e;for(let o=0;o<s;o++)n+=" "}for(let s=0;s<i;s++)n+=" ";return n}function J_(r,e,t){let i=wn(r);return i===-1&&(i=r.length),C4(r.substring(0,i),e,t)+r.substring(i)}const w4=()=>!0,S4=()=>!1,y4=r=>r===" "||r===" ";class Pc{constructor(e,t,i,n){this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,o=s.get(131);this.readOnly=s.get(81),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(104),this.lineHeight=s.get(59),this.pageSize=Math.max(1,Math.floor(o.height/this.lineHeight)-2),this.useTabStops=s.get(116),this.wordSeparators=s.get(117),this.emptySelectionClipboard=s.get(32),this.copyWithSyntaxHighlighting=s.get(21),this.multiCursorMergeOverlapping=s.get(69),this.multiCursorPaste=s.get(71),this.autoClosingBrackets=s.get(5),this.autoClosingQuotes=s.get(8),this.autoClosingDelete=s.get(6),this.autoClosingOvertype=s.get(7),this.autoSurround=s.get(11),this.autoIndent=s.get(9),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const a=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(a)for(const l of a)this.surroundingPairs[l.open]=l.close}static shouldRecreate(e){return e.hasChanged(131)||e.hasChanged(117)||e.hasChanged(32)||e.hasChanged(69)||e.hasChanged(71)||e.hasChanged(5)||e.hasChanged(8)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(116)||e.hasChanged(59)||e.hasChanged(81)}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=F_(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return s?s.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return J_(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t){switch(t){case"beforeWhitespace":return y4;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e);case"always":return w4;case"never":return S4}}_getLanguageDefinedShouldAutoClose(e){const t=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet();return i=>t.indexOf(i)!
* '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}}}}]},r.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"},r.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let n;switch(i.to){case r.RawDirection.Left:n=0;break;case r.RawDirection.Right:n=1;break;case r.RawDirection.Up:n=2;break;case r.RawDirection.Down:n=3;break;case r.RawDirection.PrevBlankLine:n=4;break;case r.RawDirection.NextBlankLine:n=5;break;case r.RawDirection.WrappedLineStart:n=6;break;case r.RawDirection.WrappedLineFirstNonWhitespaceCharacter:n=7;break;case r.RawDirection.WrappedLineColumnCenter:n=8;break;case r.RawDirection.WrappedLineEnd:n=9;break;case r.RawDirection.WrappedLineLastNonWhitespaceCharacter:n=10;break;case r.RawDirection.ViewPortTop:n=11;break;case r.RawDirection.ViewPortBottom:n=13;break;case r.RawDirection.ViewPortCenter:n=12;break;case r.RawDirection.ViewPortIfOutside:n=14;break;default:return null}let s=0;switch(i.by){case r.RawUnit.Line:s=1;break;case r.RawUnit.WrappedLine:s=2;break;case r.RawUnit.Character:s=3;break;case r.RawUnit.HalfLine:s=4;break}return{direction:n,unit:s,select:!!i.select,value:i.value||1}}r.parse=t})(eb||(eb={}));const kw=Object.create(null);function Bl(r,e){if(e<=0)return"";kw[r]||(kw[r]=["",r]);const t=kw[r];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+r;return t[e]}class Xn{constructor(e,t){this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}static unshiftIndent(e,t,i,n,s){const o=hi.visibleColumnFromColumn(e,t,i);if(s){const a=Bl(" ",n),d=hi.prevIndentTabStop(o,n)/n;return Bl(a,d)}else{const a=" ",d=hi.prevRenderTabStop(o,i)/i;return Bl(a,d)}}static shiftIndent(e,t,i,n,s){const o=hi.visibleColumnFromColumn(e,t,i);if(s){const a=Bl(" ",n),d=hi.nextIndentTabStop(o,n)/n;return Bl(a,d)}else{const a=" ",d=hi.nextRenderTabStop(o,i)/i;return Bl(a,d)}}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let n=this._selection.endLineNumber;this._selection.endColumn===1&&i!==n&&(n=n-1);const{tabSize:s,indentSize:o,insertSpaces:a}=this._opts,l=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let d=0,c=0;for(let h=i;h<=n;h++,d=c){c=0;const u=e.getLineContent(h);let g=wn(u);if(this._opts.isUnshift&&(u.length===0||g===0)||!l&&!this._opts.isUnshift&&u.length===0)continue;if(g===-1&&(g=u.length),h>1&&hi.visibleColumnFromColumn(u,g+1,s)%o!==0&&e.isCheapToTokenize(h-1)){const _=oi.getEnterAction(this._opts.autoIndent,e,new S(h-1,e.getLineMaxColumn(h-1),h-1,e.getLineMaxColumn(h-1)));if(_){if(c=d,_.appendText)for(let b=0,v=_.appendText.length;b<v&&c<o&&_.appendText.charCodeAt(b)===32;b++)c++;_.removeText&&(c=Math.max(0,c-_.removeText));for(let b=0;b<c&&!(g===0||u.charCodeAt(g-1)!==32);b++)g--}}if(this._opts.isUnshift&&g===0)continue;let p;this._opts.isUnshift?p=Xn.unshiftIndent(u,g+1,s,o,a):p=Xn.shiftIndent(u,g+1,s,o,a),this._addEditOperation(t,n
`)!==n.length-1&&(s=!1),s){const h=new S(c.lineNumber,1,c.lineNumber,1);o[a]=new xx(h,n,d,!0)}else o[a]=new Ti(d,n)}return new En(0,o,{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 o=ra(i);if(o.length===t.length)return o}return null}static paste(e,t,i,n,s,o){const a=this._distributePasteToCursors(e,i,n,s,o);return a?(i=i.sort(S.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,n,s)}static _goodIndentForLine(e,t,i){let n=null,s="";const o=oi.getInheritIndentForLine(e.autoIndent,t,i,!1);if(o)n=o.action,s=o.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const c=t.getLineContent(a);if(Qr(c)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),d=oi.getEnterAction(e.autoIndent,t,new S(a,l,a,l));d&&(s=d.indentation+d.appendText)}return n&&(n===Qt.Indent&&(s=Mt.shiftIndent(e,s)),n===Qt.Outdent&&(s=Mt.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const o=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,o),l=e.indentSize,d=l-a%l;for(let c=0;c<d;c++)s+=" "}else s=" ";return new Ti(i,s,n)}static tab(e,t,i){const n=[];for(let s=0,o=i.length;s<o;s++){const a=i[s];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.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 Ti(new S(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 Xn(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent})}}return n}static compositionType(e,t,i,n,s,o,a,l){const d=n.map(c=>this._compositionType(i,c,s,o,a,l));return new En(4,d,{shouldPushStackElementBefore:tm(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,o){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 S(a.lineNumber,l,a.lineNumber,d);return e.getValueInRange(c)===i&&o===0?null:new l_(c,i,0,o)}static _typeCommand(e,t,i){return i?new Jp(e,t,!0):new Ti(e,t,!0)}static _enter(e,t,i,n){if(e.autoIndent===0)return Mt._typeCommand(n,`
`,i);if(!t.isCheapToTokenize(n.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(n.startLineNumber),d=ht(l).substring(0,n.startColumn-1);return Mt._typeCommand(n,`
`+e.normalizeIndentation(d),i)}const s=oi.getEnterAction(e.autoIndent,t,n);if(s){if(s.indentAction===Qt.None)return Mt._typeCommand(n,`
`+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Qt.Indent)return Mt._typeCommand(n,`
`+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Qt.IndentOutdent){const l=e.normalizeIndentation(s.indentation),d=e.normalizeIndentation(s.indentation+s.appendText),c=`
`+d+`
`+l;return i?new Jp(n,c,!0):new l_(n,c,-1,d.length-l.length,!0)}else if(s.indentAction===Qt.Outdent){const l=Mt.unshiftIndent(e,s.indentation);return Mt._typeCommand(n,`
`+e.normalizeIndentation(l+s.appendText),i)}}const o=t.getLineContent(n.startLineNumber),a=ht(o).substring(0,n.startColumn-1);if(e.autoIndent>=4){const l=oi.getIndentForEnter(e.autoIndent,t,n,{unshiftIndent:d=>Mt.unshiftIndent(e,d),shiftIndent:d=>Mt.shiftIndent(e,d),normalizeIndentation:d=>e.normalizeIndentation(d)});if(l){let d=e.visibleColumnFromColumn(t,n.getEndPosition());const c=n.endColumn,h=t.getLineContent(n.endLineNumber),u=wn(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 Jp(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 l_(n,`
`+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return Mt._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.isCheapToTokenize(i[n].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,n){const s=oi.getIndentationAtPosition(t,i.startLineNumber,i.startColumn),o=oi.getIndentActionForType(e.autoIndent,t,i,n,{shiftIndent:a=>Mt.shiftIndent(e,a),unshiftIndent:a=>Mt.unshiftIndent(e,a)});if(o===null)return null;if(o!==e.normalizeIndentation(s)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?Mt._typeCommand(new S(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+n,!1):Mt._typeCommand(new S(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+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 o=0,a=i.length;o<a;o++){const l=i[o];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=Xc(s);if((d.column>2?c.charCodeAt(d.column-2):0)===92&&u)return!1;if(e.autoClosingOvertype==="auto"){let p=!1;for(let m=0,_=n.length;m<_;m++){const b=n[m];if(d.lineNumber===b.startLineNumber&&d.column===b.startColumn){p=!0;break}}if(!p)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,n,s){const o=[];for(let a=0,l=n.length;a<l;a++){const c=n[a].getPosition(),h=new S(c.lineNumber,c.column,c.lineNumber,c.column+1);o[a]=new Ti(h,s)}return new En(4,o,{shouldPushStackElementBefore:tm(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)||[],o=n.some(l=>t.startsWith(l.open)),a=s.some(l=>t.startsWith(l.close));return!o&&a}static _findAutoClosingPairOpen(e,t,i,n){const s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!s)return null;let o=null;for(const a of s)if(o===null||a.open.length>o.open.length){let l=!0;for(const d of i)if(t.getValueInRange(new S(d.lineNumber,d.column-a.open.length+1,d.lineNumber,d.column))+n!==a.open){l=!1;break}l&&(o=a)}return o}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 o of n)o.open!==t.open&&t.open.includes(o.open)&&t.close.endsWith(o.close)&&(!s||o.open.length>s.open.length)&&(s=o);return s}static _getAutoClosingPairClose(e,t,i,n,s){const o=Xc(n),a=o?e.autoClosingQuotes:e.autoClosingBrackets,l=o?e.shouldAutoCloseBefore.quote:e.shouldAutoCloseBefore.bracket;if(a==="never")return null;for(const p of i)if(!p.isEmpty())return null;const d=i.map(p=>{const m=p.getPosition();return s?{lineNumber:m.lineNumber,beforeColumn:m.column-n.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),c=this._findAutoClosingPairOpen(e,t,d.map(p=>new P(p.lineNumber,p.beforeColumn)),n);if(!c)return null;const h=this._findContainedAutoClosingPair(e,c),u=h?h.close:"";let g=!0;for(const p of d){const{lineNumber:m,beforeColumn:_,afterColumn:b}=p,v=t.getLineContent(m),C=v.substring(0,_-1),w=v.substring(b-1);if(w.startsWith(u)||(g=!1),w.length>0){const D=w.charAt(0);if(!Mt._isBeforeClosingBrace(e,w)&&!l(D))return null}if(c.open.length===1&&(n==="'"||n==='"')&&a!=="always"){const D=Gs(e.wordSeparators);if(C.length>0){const R=C.charCodeAt(C.length-1);if(D.get(R)===0)return null}}if(!t.isCheapToTokenize(m))return null;t.forceTokenization(m);const L=t.getLineTokens(m),E=F_(L,_-1);if(!c.shouldAutoClose(E,_-E.firstCharOffset))return null;const y=c.findNeutralCharacter();if(y){const D=t.getTokenTypeIfInsertingCharacter(m,_,y);if(!c.isOK(D))return null}}return g?c.close.substring(0,c.close.length-u.length):c.close}static _runAutoClosingOpenCharType(e,t,i,n,s,o,a){const l=[];for(let d=0,c=n.length;d<c;d++){const h=n[d];l[d]=new dA(h,s,!o,a)}
`){const c=[];for(let h=0,u=s.length;h<u;h++)c[h]=Mt._enter(i,n,!1,s[h]);return new En(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 En(4,c,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoClosingOvertype(i,n,s,o,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(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 Ti(s[c],a);const d=Iw(a,t);return new En(d,l,{shouldPushStackElementBefore:tm(t,d),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,n,s){const o=[];for(let l=0,d=n.length;l<d;l++)o[l]=new Ti(n[l],s);const a=Iw(s,e);return new En(a,o,{shouldPushStackElementBefore:tm(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,o=i.length;s<o;s++){let a=i[s].positionLineNumber;if(a===1)n[s]=new Jp(new S(1,1,1,1),`
`);else{a--;const l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new S(a,l,a,l))}}return n}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const n=[];for(let s=0,o=i.length;s<o;s++){const a=i[s].positionLineNumber,l=t.getLineMaxColumn(a);n[s]=this._enter(e,t,!1,new S(a,l,a,l))}return n}static lineBreakInsert(e,t,i){const n=[];for(let s=0,o=i.length;s<o;s++)n[s]=this._enter(e,t,!0,i[s]);return n}}class dA extends l_{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 S(n.startLineNumber,n.endColumn-this._closeCharacter.length,n.endLineNumber,n.endColumn),this.enclosingRange=new S(n.startLineNumber,n.endColumn-this._openCharacter.length-this._closeCharacter.length,n.endLineNumber,n.endColumn),super.computeCursorState(e,t)}}function Iw(r,e){return r===" "?e===5||e===6?6:5:4}function tm(r,e){return EE(r)&&!EE(e)?!0:r===5?!1:IE(r)!==IE(e)}function IE(r){return r===6||r===5?"space":r}function EE(r){return r===4||r===5||r===6}var k;(function(r){r.editorSimpleInput=new se("editorSimpleInput",!1,!0),r.editorTextFocus=new se("editorTextFocus",!1,f("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),r.focus=new se("editorFocus",!1,f("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),r.textInputFocus=new se("textInputFocus",!1,f("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),r.readOnly=new se("editorReadonly",!1,f("editorReadonly","Whether the editor is read only")),r.inDiffEditor=new se("inDiffEditor",!1,f("inDiffEditor","Whether the context is a diff editor")),r.columnSelection=new se("editorColumnSelection",!1,f("editorColumnSelection","Whether `editor.columnSelection` is enabled")),r.writable=r.readOnly.toNegated(),r.hasNonEmptySelection=new se("editorHasSelection",!1,f("editorHasSelection","Whether the editor has text selected")),r.hasOnlyEmptySelection=r.hasNonEmptySelection.toNegated(),r.hasMultipleSelections=new se("editorHasMultipleSelections",!1,f("editorHasMultipleSelections","Whether the editor has multiple selections")),r.hasSingleSelection=r.hasMultipleSelections.toNegated(),r.tabMovesFocus=new se("editorTabMovesFocus",!1,f("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),r.tabDoesNotMoveFocus=r.tabMovesFocus.toNegated(),r.isInWalkThroughSnippet=new se("isInEmbeddedEditor",!1,!0),r.canUndo=new se("canUndo",!1,!0),r.canRedo=new se("canRedo",!1,!0),r.hoverVisible=new se("editorHoverVisible",!1,f("editorHoverVisible","Whether the editor hover is visible")),r.inCompositeEditor=new se("inCompositeEditor",void 0,f("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),r.notInCompositeEditor=r.inCompositeEditor.toNegated(),r.languageId=new se("editorLangId","",f("editorLangId","The language identifier of the editor")),r.hasCompletionItemProvider=new se("editorHasCompletionItemProvider",!1,f("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),r.hasCodeActionsProvider=new se("editorHasCodeActionsProvider",!1,f("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),r.hasCodeLensProvider=new se("editorHasCodeLensProvider",!1,f("editorHasCodeLensProvider","Whether the editor has a code lens provider")),r.hasDefinitionProvider=new se("editorHasDefinitionProvider",!1,f("editorHasDefinitionProvider","Whether the editor has a definition provider")),r.hasDeclarationProvider=new se("editorHasDeclarationProvider",!1,f("editorHasDeclarationProvider","Whether the editor has a declaration provider")),r.hasImplementationProvider=new se("editorHasImplementationProvider",!1,f("editorHasImplementationProvider","Whether the editor has an implementation provider")),r.hasTypeDefinitionProvider=new se("editorHasTypeDefinitionProvider",!1,f("editorHasTypeDefinitionProvider","Whether the editor ha
.monaco-scrollable-element > .shadow.top {
box-shadow: ${t} 0 6px 6px -6px inset;
}
.monaco-scrollable-element > .shadow.left {
box-shadow: ${t} 6px 0 6px -6px inset;
}
.monaco-scrollable-element > .shadow.top.left {
box-shadow: ${t} 6px 6px 6px -6px inset;
}
`);const i=r.getColor(yh);i&&e.addRule(`
.monaco-scrollable-element > .scrollbar > .slider {
background: ${i};
}
`);const n=r.getColor(Lh);n&&e.addRule(`
.monaco-scrollable-element > .scrollbar > .slider:hover {
background: ${n};
}
`);const s=r.getColor(Dh);s&&e.addRule(`
.monaco-scrollable-element > .scrollbar > .slider.active {
background: ${s};
}
`)});class nb{constructor(e,t,i){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i)}}class Ex extends Eu{_render(e,t,i){const n=[];for(let a=e;a<=t;a++){const l=a-e;n[l]=[]}if(i.length===0)return n;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.className<l.className?-1:1);let s=null,o=0;for(let a=0,l=i.length;a<l;a++){const d=i[a],c=d.className;let h=Math.max(d.startLineNumber,e)-e;const u=Math.min(d.endLineNumber,t)-e;s===c?(h=Math.max(o+1,h),o=Math.max(o,u)):(s=c,o=u);for(let g=h;g<=o;g++)n[g].push(s)}return n}}class X4 extends Ex{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(131);this._lineHeight=t.get(59),this._glyphMargin=t.get(50),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(131);return this._lineHeight=t.get(59),this._glyphMargin=t.get(50),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let n=0;for(let s=0,o=t.length;s<o;s++){const a=t[s],l=a.options.glyphMarginClassName;l&&(i[n++]=new nb(a.range.startLineNumber,a.range.endLineNumber,l))}return i}prepareRender(e){if(!this._glyphMargin){this._renderResult=null;return}const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,n=this._render(t,i,this._getDecorations(e)),s=this._lineHeight.toString(),o=this._glyphMarginLeft.toString(),a=this._glyphMarginWidth.toString(),l='" style="left:'+o+"px;width:"+a+"px;height:"+s+'px;"></div>',d=[];for(let c=t;c<=i;c++){const h=c-t,u=n[h];u.length===0?d[h]="":d[h]='<div class="cgmr codicon '+u.join(" ")+l}this._renderResult=d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Q4{constructor(){this._isDisposed=!1}dispose(){this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function Bv(r,e){let t=0,i=0;const n=r.length;for(;i<n;){const s=r.charCodeAt(i);if(s===32)t++;else if(s===9)t=t-t%e+e;else break;i++}return i===n?-1:t}var Sd;(function(r){r[r.Disabled=0]="Disabled",r[r.EnabledForActive=1]="EnabledForActive",r[r.Enabled=2]="Enabled"})(Sd||(Sd={}));class hh{constructor(e,t,i){this.visibleColumn=e,this.className=t,this.horizontalLine=i}}class jy{constructor(e,t){this.top=e,this.endColumn=t}}class J4 extends Q4{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return Bv(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const n=this.textModel.getLineCount();if(e<1||e>n)throw new Error("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=!!(s&&s.offSide);let a=-2,l=-1,d=-2,c=-1;const h=y=>{if(a!==-1&&(a===-2||a>y-1)){a=-1,l=-1;for(let D=y-2;D>=0;D--){const R=this._computeIndentLevel(D);if(R>=0){a=D,l=R;break}}}if(d===-2){d=-1,c=-1;for(let D=y;D<n;D++){const R=this._computeIndentLevel(D);if(R>=0){d=D,c=R;break}}}};let u=-2,g=-1,p=-2,m=-1;const _=y=>{if(u===-2){u=-1,g=-1;for(let D=y-2;D>=0;D--){const R=this._computeIndentLevel(D);if(R>=0){u=D,g=R;break}}}if(p!==-1&&(p===-2||p<y-1)){p=-1,m=-1;for(let D=y;D<n;D++){const R=this._computeIndentLevel(D);if(R>=0){p=D,m=R;break}}}};let b=0,v=!0,C=0,w=!0,L=0,E=0;for(let y=0;v||w;y++){const D=e-y,R=e+y;y>1&&(
`)>=0)return null;const o=s.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!o)return null;const a=o[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-o[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 o=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,d=>{if(s)for(let h=0,u=s.length;h<u;h++){const[g,p]=s[h],m=d[h],_=m.range.startLineNumber,b=m.range.startColumn-1+g,v=m.range.startColumn-1+p;o.push(new S(_,v+1,_,v+2)),a.push(new S(_,b+1,_,v+2))}const c=n(d);return c&&(this._isHandling=!0),c});l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),o.length>0&&this._pushAutoClosedAction(o,a)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const s=Wg.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(o){Te(o)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}setIsDoingComposition(e){this._isDoingComposition=e}getAutoClosedCharacters(){return KE.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._selectionsWhenCompositionStarted=this.getSelections().slice(0)}endComposition(e,t){this._executeEdit(()=>{t==="keyboard"&&(this._executeEditOperation(Mt.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this._selectionsWhenCompositionStarted,this.getSelections(),this.getAutoClosedCharacters())),this._selectionsWhenCompositionStarted=null)},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const n=t.length;let s=0;for(;s<n;){const o=gR(t,s),a=t.substr(s,o);this._executeEditOperation(Mt.typeWithInterceptors(this._isDoingComposition,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),s+=o}}else this._executeEditOperation(Mt.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,n,s,o){if(t.length===0&&i===0&&n===0){if(s!==0){const a=this.getSelections().map(l=>{const d=l.getPosition();return new ae(d.lineNumber,d.column+s,d.lineNumber,d.column+s)});this.setSelections(e,o,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(Mt.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s))},e,o)}paste(e,t,i,n,s){this._executeEdit(()=>{this._executeEditOperation(Mt.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))},e,s,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Wd.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new En(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new En(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}Yh.MAX_CURSOR_COUNT=1e4;class Wg{constructor(e,t){this.modelVersionId=e,this.cursorState=t}static from(e,t){return new Wg(e.getVersionId(),t.getCursorStates())}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class KE{constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}dispose(){this._autoClosedCharactersDecorations=this._model.deltaDecorations(this._autoClosedCharactersDecorations,[]),this._autoClo
`,"g"):null,s=[];let o,a=0,l=0,d=0,c=0;const h=new Array;for(let p=0;p<60;p++)h.push(new Oa(Yt(0,p),0,-1,ri.getEmpty(),new Qc(Yt(0,p))));const u=new Array;for(let p=0;p<60;p++)u.push(new Oa(Yt(1,p),0,-1,ri.getEmpty(),new Qc(Yt(1,p))));if(n)for(n.lastIndex=0;(o=n.exec(e))!==null;){const p=o.index,m=o[0];if(m===`
`)a++,l=p+1;else{if(d!==p){let _;if(c===a){const b=p-d;if(b<h.length)_=h[b];else{const v=Yt(0,b);_=new Oa(v,0,-1,ri.getEmpty(),new Qc(v))}}else{const b=a-c,v=p-l;if(b===1&&v<u.length)_=u[v];else{const C=Yt(b,v);_=new Oa(C,0,-1,ri.getEmpty(),new Qc(C))}}s.push(_)}s.push(t.getToken(m)),d=p+m.length,c=a}}const g=e.length;if(d!==g){const p=c===a?Yt(0,g-d):Yt(a-c,g-l);s.push(new Oa(p,0,-1,ri.getEmpty(),new Qc(p)))}this.length=Yt(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 gV}}class hb{constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}static createFromLanguage(e,t){function i(l,d){return t.getKey(`${l}:::${d}`)}const n=e.characterPair.getColorizedBrackets(),s=new Map,o=new Set;for(const[l,d]of n){o.add(l);let c=s.get(d);const h=i(e.languageId,l);c||(c={openingBrackets:ri.getEmpty(),first:h},s.set(d,c)),c.openingBrackets=c.openingBrackets.add(h,QE)}const a=new Map;for(const[l,d]of s){const c=Yt(0,l.length);a.set(l,new Oa(c,2,d.first,d.openingBrackets,cb.create(c,e.languageId,d.openingBrackets)))}for(const l of o){const d=Yt(0,l.length),c=i(e.languageId,l),h=ri.getEmpty().add(c,QE);a.set(l,new Oa(d,1,c,h,cb.create(d,e.languageId,h)))}return new hb(a)}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>Lj(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"g"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e)}findClosingTokenText(e){for(const[t,i]of this.map)if(i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Lj(r){const e=Co(r);return/^[\w ]+$/.test(r)?`\\b${e}\\b`:e}class xA{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){const t=this.languageIdToBracketTokens.get(e);if(!t)return!1;const i=hb.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider).getRegExpStr();return t.getRegExpStr()!==i}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=hb.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Dj(r){if(r.length===0)return null;if(r.length===1)return r[0];let e=0;function t(){if(e>=r.length)return null;const o=e,a=r[o].listHeight;for(e++;e<r.length&&r[e].listHeight===a;)e++;return e-o>=2?kA(o===0&&e===r.length?r:r.slice(o,e),!1):r[o]}let i=t(),n=t();if(!n)return i;for(let o=t();o;o=t())JE(i,n)<=JE(n,o)?(i=Mw(i,n),n=o):n=Mw(n,o);return Mw(i,n)}function kA(r,e=!1){if(r.length===0)return null;if(r.length===1)return r[0];let t=r.length;for(;t>3;){const i=t>>1;for(let n=0;n<i;n++){const s=n<<1;r[n]=ur.create23(r[s],r[s+1],s+3===t?r[s+2]:null,e)}t=i}return ur.create23(r[0],r[1],t>=3?r[2]:null,e)}function JE(r,e){return Math.abs(r.listHeight-e.listHeight)}function Mw(r,e){return r.listHeight===e.listHeight?ur.create23(r,e,null,!1):r.listHeight>e.listHeight?xj(r,e):kj(e,r)}function xj(r,e){r=r.toMutable();let t=r;const i=new Array;let n;for(;;){if(e.listHeight===t.listHeight){n=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let s=i.length-1;s>=0;s--){const o=i[s];n?o.childrenLength>=3?n=ur.create23(o.unappendChild(),n,null,!1):(o.appendChildOfSameHeight(n),n=void 0):o.handleChildrenChanged()}return n?ur.create23(r,n,null,!1):r}function kj(r,e){r=r.toMutable();let t=r;const i=new Array;for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let n=e;for(let s=i.length-1;s>=0;s--){const o=i[s];n?o.childrenLength>=3?n=ur.create23(n,o.unprependChild(),null,!1):(o.prependChildOfSameHeight(n),n=void 0):o.handleChildrenChanged()}return n?ur.create23(n,r,null,!1):r}class Ij{constructor(e){this.lastOffset=hr,this.nextNodes=[e],this.offsets=[hr],this.idxs=[]}readLongestNodeAt(e,t){if(c_(e,this.lastOffse
`?0:1}function Hr(r){return r?r instanceof AA||r instanceof $j:!1}class Vx{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Hr(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Hr(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e){const t=this._undoRedoService.getLastElement(this._model.uri);if(Hr(t)&&t.canAppend(this._model))return t;const i=new AA(this._model,e);return this._undoRedoService.pushElement(i),i}pushEOL(e){const t=this._getOrCreateEditStackElement(null);this._model.setEOL(e),t.append(this._model,[],Qy(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i){const n=this._getOrCreateEditStackElement(e),s=this._model.applyEdits(t,!0),o=Vx._computeCursorState(i,s),a=s.map((l,d)=>({index:d,textChange:l.textChange}));return a.sort((l,d)=>l.textChange.oldPosition===d.textChange.oldPosition?l.index-d.index:l.textChange.oldPosition-d.textChange.oldPosition),n.append(this._model,a.map(l=>l.textChange),Qy(this._model),this._model.getAlternativeVersionId(),o),o}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return Te(i),null}}}class Uj{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function jj(r,e,t,i,n){n.spacesDiff=0,n.looksLikeAlignment=!1;let s;for(s=0;s<e&&s<i;s++){const u=r.charCodeAt(s),g=t.charCodeAt(s);if(u!==g)break}let o=0,a=0;for(let u=s;u<e;u++)r.charCodeAt(u)===32?o++:a++;let l=0,d=0;for(let u=s;u<i;u++)t.charCodeAt(u)===32?l++:d++;if(o>0&&a>0||l>0&&d>0)return;const c=Math.abs(a-d),h=Math.abs(o-l);if(c===0){n.spacesDiff=h,h>0&&0<=l-1&&l-1<r.length&&l<t.length&&t.charCodeAt(l)!==32&&r.charCodeAt(l-1)===32&&r.charCodeAt(r.length-1)===44&&(n.looksLikeAlignment=!0);return}if(h%c===0){n.spacesDiff=h/c;return}}function sT(r,e,t){const i=Math.min(r.getLineCount(),1e4);let n=0,s=0,o="",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 Uj;for(let p=1;p<=i;p++){const m=r.getLineLength(p),_=r.getLineContent(p),b=m<=65536;let v=!1,C=0,w=0,L=0;for(let y=0,D=m;y<D;y++){const R=b?_.charCodeAt(y):r.getLineCharCode(p,y);if(R===9)L++;else if(R===32)w++;else{v=!0,C=y;break}}if(!v||(L>0?n++:w>1&&s++,jj(o,a,_,C,h),h.looksLikeAlignment&&!(t&&e===h.spacesDiff)))continue;const E=h.spacesDiff;E<=d&&c[E]++,o=_,a=C}let u=t;n!==s&&(u=n<s);let g=e;if(u){let p=u?0:.1*i;l.forEach(m=>{const _=c[m];_>p&&(p=_,g=m)}),g===4&&c[4]>0&&c[2]>0&&c[2]>=c[4]/2&&(g=2)}return{insertSpaces:u,tabSize:g}}function pn(r){return(r.metadata&1)>>>0}function wt(r,e){r.metadata=r.metadata&254|e<<0}function Ai(r){return(r.metadata&2)>>>1===1}function vt(r,e){r.metadata=r.metadata&253|(e?1:0)<<1}function OA(r){return(r.metadata&4)>>>2===1}function oT(r,e){r.metadata=r.metadata&251|(e?1:0)<<2}function Kj(r){return(r.metadata&24)>>>3}function rT(r,e){r.metadata=r.metadata&231|e<<3}function qj(r){return(r.metadata&32)>>>5===1}function aT(r,e){r.metadata=r.metadata&223|(e?1:0)<<5}class PA{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,wt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,oT(this,!1),rT(this,1),aT(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,vt(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;oT(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),rT(this,this.options.stickiness),aT(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const Re=new PA(null,0,0);Re.parent=Re;Re.left=Re;Re.right=Re;wt(Re,0);class Pw{constructor(){this.root=Re,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,s){retu
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,s-1)===13){const m=this.positionInBuffer(n,s-1);this.deleteNodeTail(n,m),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 p=0;p<u.length;p++)g=this.rbInsertRight(g,u[p]);this.deleteNodes(c)}else this.insertContentToNodeRight(t,n)}else{const n=this.createNewPieces(t);let s=this.rbInsertLeft(null,n[0]);for(let o=1;o<n.length;o++)s=this.rbInsertRight(s,n[o])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===De)return;const i=this.nodeAt(e),n=this.nodeAt(e+t),s=i.node,o=n.node;if(s===o){const u=this.positionInBuffer(s,i.remainder),g=this.positionInBuffer(s,n.remainder);if(i.nodeStartOffset===e){if(t===s.piece.length){const p=s.next();hm(this,s),this.validateCRLFWithPrevNode(p),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(o,n.remainder);this.deleteNodeHead(o,d),o.piece.length===0&&a.push(o);const c=s.next();for(let u=c;u!==De&&u!==o;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 o=t.piece,a={line:o.start.line+1,column:0},l=new In(o.bufferIndex,a,o.end,this.getLineFeedCnt(o.bufferIndex,a,o.end),o.length-1);t.piece=l,e+=`
`,Mr(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 o=n.length-2;o>=0;o--)s=this.rbInsertLeft(s,n[o]);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 o=1;o<i.length;o++)s=this.rbInsertRight(s,i[o]);this.validateCRLFWithPrevNode(n)}positionInBuffer(e,t,i){const n=e.piece,s=e.piece.bufferIndex,o=this._buffers[s].lineStarts,l=o[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=o[h],h!==c);)if(u=o[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],o=n[i.line]+i.column;if(s>o+1)return i.line-t.line;const a=o-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++)hm(this,e[t])}createNewPieces(e){if(e.length>xr){const c=[];for(;e.length>xr;){const u=e.charCodeAt(xr-1);let g;u===13||u>=55296&&u<=56319?(g=e.substring(0,xr-1),e=e.substring(xr-1)):(g=e.substring(0,xr),e=e.substring(xr));const p=Or(g);c.push(new In(this._buffers.length,{line:0,column:0},{line:p.length-1,column:g.length-p[p.length-1]},p.length-1,g.length)),this._buffers.push(new ed(g,p))}const h=Or(e);return c.push(new In(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 ed(e,h)),c}let t=this._buffers[0].buffer.length;const i=Or(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,o=this._buffers[0].lineStarts.length-1,a=s-this._buffers[0].lineStarts[o],l={line:o,column:a},d=new In(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 o=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+o,l+i.piece.length);else{const d=this.getAccumulatedValue(i,e-s.nodeStartLineNumber);return a.substring(l+o,l+d-t)}}else{let o=0;const a=e;for(;i!==De;)if(i.left!==De&&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 o+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:o,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,o+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==De;){const o=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+=o.substring(l,l+a-t),n}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=o.substr(a,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==De;)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=Or(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 o=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[o],l={line:o,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 In(e.piece.bufferIndex,e.piece.start,l,h,d),this._lastChangeBufferPos=l,Mr(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!==De;)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!==De;)if(i.left!==De&&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),o=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,o),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!==De;){if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),o=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,s),nodeStartOffset:o}}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===De||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===De||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 o=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new In(e.piece.bufferIndex,e.piece.start,s,a,o),Mr(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 In(t.piece.bufferIndex,l,t.piece.end,c,d),Mr(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++)hm(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)hm(this,i);else{const n=i.piece,s={line:n.start.line+1,column:0},o=n.length-1,a=this.getLineFeedCnt(n.bufferIndex,s,n.end);i.piece=new In(n.bufferIndex,s,n.end,a,o),Mr(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===De)return t(De);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===De)return"";const t=this._buffers[e.piece.bufferIndex];let i;const n=e.piece,s=this.offsetInBuffer(n.bufferIndex,n.start),o=this.offsetInBuffer(n.bufferIndex,n.end);return i=t.buffer.substring(s,o),i}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 Jy(t,1);if(i.left=De,i.right=De,i.parent=De,i.size_left=0,i.lf_left=0,this.root===De)this.root=i,i.color=0;else if(e.right===De)e.right=i,i.parent=e;else{const s=Hx(e.right);s.left=i,i.parent=s}return cT(this,i),i}rbInsertLeft(e,t){const i=new Jy(t,1);if(i.left=De,i.right=De,i.parent=De,i.size_left=0,i.lf_left=0,this.root===De)this.root=i,i.color=0;else if(e.left===De)e.left=i,i.parent=e;else{const n=BA(e.left);n.right=i,i.parent=n}return cT(this,i),i}}function Vd(r){let e=0,t=0,i=0,n=0;for(let s=0,o=r.length;s<o;s++){const a=r.charCodeAt(s);a===13?(e===0&&(t=s),e++,s+1<o&&r.charCodeAt(s+1)===10?(n|=2,s++):n|=3,i=s+1):a===10&&(n|=1,e===0&&(t=s),e++,i=s+1)}return e===0&&(t=r.length),[e,t,r.length-i,n]}class Th extends V{constructor(e,t,i,n,s,o,a){super(),this._onDidChangeContent=this._register(new A),this._BOM=t,this._mightContainNonBasicASCII=!o,this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._pieceTree=new dK(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 S(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);return this.getOffsetAt(e.endLineNumber,e.endColumn)-i}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const n=e.startLineNumber,s=e.endLineNumber;for(let o=n;o<=s;o++){const a=this.getLineContent(o),l=o===n?e.startColumn-1:0,d=o===s?e.endColumn-1:a.length;for(let c=l;c<d;c++)Zi(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=wn(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Qr(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,o=this._mightContainNonBasicASCII,a=!0,l=[];for(let m=0;m<e.length;m++){const _=e[m];a&&_._isTracked&&(a=!1);const b=_.range;if(_.text){let E=!0;o||(E=!ND(_.text),o=E),!n&&E&&(n=rv(_.text)),!s&&E&&(s=vR(_.text))}let v="",C=0,w=0,L=0;if(_.text){let E;[C,w,L,E]=Vd(_.text);const y=this.getEOL();E===0||E===(y===`\r
`?2:1)?v=_.text:v=_.text.replace(/\r\n|\r|\n/g,y)}l[m]={sortIndex:m,identifier:_.identifier||null,range:b,rangeOffset:this.getOffsetAt(b.startLineNumber,b.startColumn),rangeLength:this.getValueLengthInRange(b),text:v,eolCount:C,firstLineLength:w,lastLineLength:L,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}l.sort(Th._sortOpsAscending);let d=!1;for(let m=0,_=l.length-1;m<_;m++){const b=l[m].range.getEndPosition(),v=l[m+1].range.getStartPosition();if(v.isBeforeOrEqual(b)){if(v.isBefore(b))throw new Error("Overlapping ranges are not allowed!");d=!0}}a&&(l=this._reduceOperations(l));const c=i||t?Th._getInverseEditRanges(l):[],h=[];if(t)for(let m=0;m<l.length;m++){const _=l[m],b=c[m];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let v=b.startLineNumber;v<=b.endLineNumber;v++){let C="";v===b.startLineNumber&&(C=this.getLineContent(_.range.startLineNumber),wn(C)!==-1)||h.push({lineNumber:v,oldContent:C})}}let u=null;if(i){let m=0;u=[];for(let _=0;_<l.length;_++){const b=l[_],v=c[_],C=this.getValueInRange(b.range),w=b.rangeOffset+m;m+=b.text.length-C.length,u[_]={sortIndex:b.sortIndex,identifier:b.identifier,range:v,text:C,textChange:new Ni(b.rangeOffset,C,w,b.text)}}d||u.sort((_,b)=>_.sortIndex-b.sortIndex)}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=o;const g=this._doApplyEdits(l);let p=null;if(t&&h.length>0){h.sort((m,_)=>_.lineNumber-m.lineNumber),p=[];for(let m=0,_=h.length;m<_;m++){const b=h[m].lineNumber;if(m>0&&h[m-1].lineNumber===b)continue;const v=h[m].oldContent,C=this.getLineContent(b);C.length===0||C===v||wn(C)!==-1||p.push(b)}}return this._onDidChangeContent.fire(),new vV(u,g,p)}_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 S(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let o=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,p=e.length;g<p;g++){const m=e[g],_=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new S(o,a,_.startLineNumber,_.startColumn))),m.text.length>0&&l.push(m.text),o=_.endLineNumber,a=_.endColumn}const d=l.join(""),[c,h,u]=Vd(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(Th._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const n=e[i],s=n.range.startLineNumber,o=n.range.startColumn,a=n.range.endLineNumber,l=n.range.endColumn;if(s===a&&o===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 S(s,o,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 o=0,a=e.length;o<a;o++){const l=e[o];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 S(d,c,d,c+l.firstLineLength):h=new S(d,c,d+u-1,l.lastLineLength+1)}else h=new S(d,c,d,c);i=h.endLineNumber,n=h.endColumn,t.push(h),s=l}return t}static _sortOpsAscending(e,t){const i=S.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=S.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class cK{constructor(e,t,i,n,s,o,a,l,d){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=o,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._n
`:`\r
`:i>t/2?`\r
`:`
`}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r
`&&(this._cr>0||this._lf>0)||t===`
`&&(this._cr>0||this._crlf>0)))for(let s=0,o=i.length;s<o;s++){const a=i[s].buffer.replace(/\r\n|\r|\n/g,t),l=Or(a);i[s]=new ed(a,l)}const n=new Th(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:n,disposable:n}}}class hK{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&&RD(e)&&(this.BOM=CV,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=rK(this._tmpLineStarts,e);this.chunks.push(new ed(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,this.isBasicASCII&&(this.isBasicASCII=t.isBasicASCII),!this.isBasicASCII&&!this.containsRTL&&(this.containsRTL=rv(e)),!this.isBasicASCII&&!this.containsUnusualLineTerminators&&(this.containsUnusualLineTerminators=vR(e))}finish(e=!0){return this._finish(),new cK(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=Or(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class uK{constructor(e,t){this._startLineNumber=e,this._tokens=t}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class Ww{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 uK(e,[t]))}finalize(){return this._tokens}}class hT{constructor(e){this._default=e,this._store=[]}get(e){return e<this._store.length?this._store[e]:this._default}set(e,t){for(;e>=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let n=0;n<t;n++)i[n]=this._default;this._store=PD(this._store,e,i)}}class gK{constructor(e,t){this.tokenizationSupport=e,this.initialState=t,this._lineBeginState=new hT(null),this._lineNeedsTokenization=new hT(!0),this._firstLineNeedsTokenization=0,this._lineBeginState.set(0,this.initialState)}get invalidLineStartIndex(){return this._firstLineNeedsTokenization}markMustBeTokenized(e){this._lineNeedsTokenization.set(e,!0),this._firstLineNeedsTokenization=Math.min(this._firstLineNeedsTokenization,e)}getBeginState(e){return this._lineBeginState.get(e)}setEndState(e,t,i){if(this._lineNeedsTokenization.set(t,!1),this._firstLineNeedsTokenization=t+1,t===e-1)return;const n=this._lineBeginState.get(t+1);if(n===null||!i.equals(n)){this._lineBeginState.set(t+1,i),this.markMustBeTokenized(t+1);return}let s=t+1;for(;s<e&&!this._lineNeedsTokenization.get(s);)s++;this._firstLineNeedsTokenization=s}applyEdits(e,t){this.markMustBeTokenized(e.startLineNumber-1),this._lineBeginState.delete(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineNeedsTokenization.delete(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineBeginState.insert(e.startLineNumber,t),this._lineNeedsTokenization.insert(e.startLineNumber,t)}}class fK extends V{constructor(e,t){super(),this._textModel=e,this._languageIdCodec=t,this._isScheduled=!1,this._isDisposed=!1,this._tokenizationStateStore=null,this._register(Ot.onDidChange(i=
`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=V.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this._isDisposing||(this._bracketPairColorizer.handleDidChangeContent(t),this._tokenization.handleDidChangeContent(t),this._eventEmitter.fire(new ab(e,t)))}setValue(e){if(this._assertNotDisposed(),e===null)return;const{textBuffer:t,disposable:i}=gT(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,s,o,a){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:s,isRedoing:o,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._tokens.flush(),this._semanticTokens.flush(),this._decorations=Object.create(null),this._decorationsTree=new fT,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new yd([new E5],this._versionId,!1,!1),this._createContentChanged2(new S(1,1,s,o),0,n,this.getValue(),!1,!1,!0))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r
`:`
`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new yd([new R5],this._versionId,!1,!1),this._createContentChanged2(new S(1,1,s,o),0,n,this.getValue(),!1,!1,!1))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,n=t.length;i<n;i++){const s=t[i],o=s.range,a=s.cachedAbsoluteStart-s.start,l=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),d=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);s.cachedAbsoluteStart=l,s.cachedAbsoluteEnd=d,s.cachedVersionId=e,s.start=l-a,s.end=d-a,pl(s)}}onBeforeAttached(){this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenization.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}onBeforeDetached(){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenization.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0))}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let n=1;n<=i;n++){const s=this._buffer.getLineLength(n);s>=CK?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!="undefined"?e.tabSize:this._options.tabSize,i=typeof e.indentSize!="undefined"?e.indentSize:this._options.indentSize,n=typeof e.insertSpaces!="undefined"?e.insertSpaces:this._options.insertSpaces,s=typeof e.trimAutoWhitespace!="undefined"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=typeof e.bracketColorizationOptions!="undefined"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new e_({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:o});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairColorizer.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=sT(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),J_(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(wV.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alter
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Error("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),o=Math.floor(typeof n=="number"&&!isNaN(n)?n:1);if(s<1)s=1,o=1;else if(s>t)s=t,o=this.getLineMaxColumn(s);else if(o<=1)o=1;else{const h=this.getLineMaxColumn(s);o>=h&&(o=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===o&&a===d&&l===c&&e instanceof S&&!(e instanceof ae)?e:new S(s,o,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 o=this._buffer.getLineCharCode(e,t-2);if(Zi(o))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),o=this._buffer.getLineCount();if(n<1)return new P(1,1);if(n>o)return new P(o,this.getLineMaxColumn(o));if(s<=1)return new P(n,1);const a=this.getLineMaxColumn(n);if(s>=a)return new P(n,a);if(i===1){const l=this._buffer.getLineCharCode(n,s-2);if(Zi(l))return new P(n,s-1)}return new P(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof P&&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,o=e.endColumn;if(!this._isValidPosition(i,n,0)||!this._isValidPosition(s,o,0))return!1;if(t===1){const a=n>1?this._buffer.getLineCharCode(i,n-2):0,l=o>1&&o<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,o-2):0,d=Zi(a),c=Zi(l);return!d&&!c}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof S&&!(e instanceof ae)&&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,o=i.column,a=n.lineNumber,l=n.column;{const d=o>1?this._buffer.getLineCharCode(s,o-2):0,c=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,h=Zi(d),u=Zi(c);return!h&&!u?new S(s,o,a,l):s===a&&o===l?new S(s,o-1,a,l-1):h&&u?new S(s,o-1,a,l+1):h?new S(s,o-1,a,l):new S(s,o,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 S(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,o,a=vK){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(h=>S.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)=>S.areIntersecting(h,u)?h.plusRange(u):(d.push(h),u)));let c;if(!i&&e.indexOf(`
`)<0){const u=new Ul(e,i,n,s).parseSearchRequest();if(!u)return[];c=g=>this.findMatchesLineByLine(g,u,o,a)}else c=h=>qp.findMatches(this,new Ul(e,i,n,s),h,o,a);return d.map(c).reduce((h,u)=>h.concat(u),[])}findNextMatch(e,t,i,n,s,o){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(`
`)<0){const d=new Ul(e,i,n,s).parseSearchRequest();if(!d)return null;const c=this.getLineCount();let h=new S(a.lineNumber,a.column,c,this.getLineMaxColumn(c)),u=this.findMatchesLineByLine(h,d,o,1);return qp.findNextMatch(this,new Ul(e,i,n,s),a,o),u.length>0||(h=new S(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),u=this.findMatchesLineByLine(h,d,o,1),u.length>0)?u[0]:null}return qp.findNextMatch(this,new Ul(e,i,n,s),a,o)}findPreviousMatch(e,t,i,n,s,o){this._assertNotDisposed();const a=this.validatePosition(t);return qp.findPreviousMatch(this,new Ul(e,i,n,s),a,o)}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 tw?e:new tw(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,n=e.length;i<n;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const n=t.map(o=>({range:this.validateRange(o.range),text:o.text}));let s=!0;if(e)for(let o=0,a=e.length;o<a;o++){const l=e[o];let d=!1;for(let c=0,h=n.length;c<h;c++){const u=n[c].range,g=u.startLineNumber>l.endLineNumber,p=l.startLineNumber>u.endLineNumber;if(!g&&!p){d=!0;break}}if(!d){s=!1;break}}if(s)for(let o=0,a=this._trimAutoWhitespaceLines.length;o<a;o++){const l=this._trimAutoWhitespaceLines[o],d=this.getLineMaxColumn(l);let c=!0;for(let h=0,u=n.length;h<u;h++){const g=n[h].range,p=n[h].text;if(!(l<g.startLineNumber||l>g.endLineNumber)&&!(l===g.startLineNumber&&g.startColumn===d&&g.isEmpty()&&p&&p.length>0&&p.charAt(0)===`
`)&&!(l===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)===`
`)){c=!1;break}}if(c){const h=new S(l,1,l,d);t.push(new tw(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i)}_applyUndo(e,t,i,n){const s=e.map(o=>{const a=this.getPositionAt(o.newPosition),l=this.getPositionAt(o.newEnd);return{range:new S(a.lineNumber,a.column,l.lineNumber,l.column),text:o.oldText}});this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map(o=>{const a=this.getPositionAt(o.oldPosition),l=this.getPositionAt(o.oldEnd);return{range:new S(a.lineNumber,a.column,l.lineNumber,l.column),text:o.newText}});this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,o){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(o),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(),o=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,o.length!==0){for(let d=0,c=o.length;d<c;d++){const h=o[d],[u,g,p]=Vd(h.text);this._tokens.acceptEdit(h.range,u,g),this._semanticTokens.acceptEdit(h.range,u,g,p,h.text.length>0?h.text.charCodeAt(0):0),this._decorationsTree.acceptReplace(h.rangeOffset,h.rangeLength,h.text.length,h.forceMoveMarkers)}const a=[];this._increaseVersionId();let l=i;for(let d=0,c=o.length;d<c;d++){const h=o[d],[u]=Vd(h.text);this._onDidChangeDecorations.fire();const g=h.range.startLineNumber,p=h.range.endLineNumber,m=p-g,_=u,b=Math.min(m,_),v=_-m,C=s-l-v+g,w=C,L=C+_,E=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new P(w,1)),this.getOffsetAt(new P(L,this.getLineMaxColumn(L))),0),y=Lo.fromDecorations(E),D=new Wh(y);for(let R=b;R>=0;R--){const W=g+R,B=C+R;D.takeFromEndWhile(K=>K.lineNumber>B);const te=D.takeFromEndWhile(K=>K.lineNumber===B);a.push(new UE(W,this.getLineContent(B),te))}if(b<m){const R=g+b;a.push(new T5(R+1,p))}if(b<_){const R=new Wh(y),W=g+b,B=_-b,te=s-l-B+W+1,K=[],he=[];for(let ce=0;ce<B;ce++){const we=te+ce;he[ce]=this.getLineContent(we),R.takeWhile(Ie=>Ie.lineNumber<we),K[ce]=R.takeWhile(Ie=>Ie.lineNumber===we)}a.push(new N5(W+1,g+_,he,K))}l+=v}this._emitContentChangedEvent(new yd(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,eol:this._buffer.getEOL(),versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return n.reverseEdits===null?void 0:n.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=[...e].map(n=>new UE(n,this.getLineContent(n),this._getInjectedTextInLine(n)));this._onDidChangeInjectedText.fire(new _A(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,o)=>this._deltaDecorationsImpl(e,[],[{range:s,options:o}])[0],changeDecoration:(s,o)=>{this._changeDecorationImpl(s,o)},changeDecorationOptions:(s,o)=>{this._changeDecorationOptionsImpl(s,mT(o))},removeDecoration:s=>{this._deltaDecorationsImpl(e,[s],[])},deltaDecorations:(s,o)=>s.length===0&&o.length===0?[]:this._deltaDecorationsImpl(e,s,o)};let n
`:this.model.getEOL();e=e.slice(0),e.sort(S.compareRangesUsingStarts);let s=!1,o=!1;for(const l of e)l.isEmpty()?s=!0:o=!0;if(!o){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===vr||e.length!==1)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const c=n.startLineNumber;n=new S(c,this.model.getLineMinColumn(c),c,this.model.getLineMaxColumn(c))}const s=this._configuration.options.get(44),o=this._getColorMap(),l=/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===Qi.fontFamily;let d;return l?d=Qi.fontFamily:(d=s.fontFamily,d=d.replace(/"/g,"'"),/[,']/.test(d)||/[+ ]/.test(d)&&(d=`'${d}'`),d=`${d}, ${Qi.fontFamily}`),{mode:i,html:`<div style="color: ${o[1]};background-color: ${o[2]};font-family: ${d};font-weight: ${s.fontWeight};font-size: ${s.fontSize}px;line-height: ${s.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(n,o)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn,a=this.getTabSize();let l="";for(let d=i;d<=s;d++){const c=this.model.getLineTokens(d),h=c.getLineContent(),u=d===i?n-1:0,g=d===s?o-1:h.length;h===""?l+="<br>":l+=nj(h,c.inflate(),t,u,g,a,yn)}return l}_getColorMap(){const e=Ot.getColorMap(),t=["#000000"];if(e)for(let i=1,n=e.length;i<n;i++)t[i]=F.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 K5);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(n=>this._cursor.executeEdits(n,e,t,i))}startComposition(){this._cursor.setIsDoingComposition(!0),this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._cursor.setIsDoingComposition(!1),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(o=>this._cursor.compositionType(o,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 S(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(n=>n.emitViewEvent(new d_(e,!1,i,null,0,!0,0)))}revealBottomMostCu
`?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)}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(let e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(let i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetForPosition(e,t,i){const n=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(n);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber)}getTopForLineNumber(e){return this._modelData?u_._getVerticalOffsetForPosition(this._modelData,e,1):-1}getTopForPosition(e,t){return this._modelData?u_._getVerticalOffsetForPosition(this._modelData,e,t):-1}setHiddenAreas(e){this._modelData&&this._modelData.viewModel.setHiddenAreas(e.map(t=>S.lift(t)))}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return hi.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(!P.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(!S.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),o=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,o,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 S(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(!P.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new S(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=ae.isISelection(e),n=S.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const s={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(s,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new ae(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCe
`)}}const vc=new l8;ti.add(a8.IconContribution,vc);function pi(r,e,t,i){return vc.registerIcon(r,e,t,i)}function jA(){return vc}function d8(){for(const r of ne.getAll())vc.registerIcon(r.id,r.definition,r.description)}d8();const KA="vscode://schemas/icons";let qA=ti.as(xv.JSONContribution);qA.registerSchema(KA,vc.getIconSchema());const kT=new gt(()=>qA.notifySchemaChanged(KA),200);vc.onDidChange(()=>{kT.isScheduled()||kT.schedule()});const GA=pi("widget-close",ne.close,f("widgetClose","Icon for the close action in widgets."));pi("goto-previous-location",ne.arrowUp,f("previousChangeIcon","Icon for goto previous editor location."));pi("goto-next-location",ne.arrowDown,f("nextChangeIcon","Icon for goto next editor location."));_t.modify(ne.sync,"spin");_t.modify(ne.loading,"spin");var c8=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},h8=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}},u8=globalThis&&globalThis.__awaiter||function(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{d(i.next(c))}catch(h){o(h)}}function l(c){try{d(i.throw(c))}catch(h){o(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(r,e||[])).next())})},Zw;const fm=3;class eg{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 Yw{constructor(e){this.entries=e}}const g8=pi("diff-review-insert",ne.add,f("diffReviewInsertIcon","Icon for 'Insert' in diff review.")),f8=pi("diff-review-remove",ne.remove,f("diffReviewRemoveIcon","Icon for 'Remove' in diff review.")),p8=pi("diff-review-close",ne.close,f("diffReviewCloseIcon","Icon for 'Close' in diff review."));let _b=class Kl extends V{constructor(e,t){super(),this._languageService=t,this._width=0,this._diffEditor=e,this._isVisible=!1,this.shadow=Je(document.createElement("div")),this.shadow.setClassName("diff-review-shadow"),this.actionBarContainer=Je(document.createElement("div")),this.actionBarContainer.setClassName("diff-review-actions"),this._actionBar=this._register(new gr(this.actionBarContainer.domNode)),this._actionBar.push(new Fn("diffreview.close",f("label.close","Close"),"close-diff-review "+_t.asClassName(p8),!0,()=>u8(this,void 0,void 0,function*(){return this.hide()})),{label:!1,icon:!0}),this.domNode=Je(document.createElement("div")),this.domNode.setClassName("diff-review monaco-editor-background"),this._content=Je(document.createElement("div")),this._content.setClassName("diff-review-content"),this._content.setAttribute("role","code"),this.scrollbar=this._register(new Sp(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(ki(this.domNode.domNode,"click",i=>{i.preventDefault();const n=cM(i.target,"diff-review-row");n&&this._goToRow(n)})),this._register(ki(this.domNode.domNode,"keydown",i=>{(i.equals(18)||i.equals(2066)||i.equals(530))&&(i.preventDefault(),this._goToRow(this._getNextRow())),(i.equals(16)||i.equals(2064)||i.equals(528))&&(i.preventDefault(),this._goToRow(this._getPrevRow())),(i.equals(9)||i.equals(2057)||i.equals(521)||i.equals(1033))&&(i.preventDefault(),this.hide()),(i.equals(10)||i.equals(3))&&(i.preventDefault(),this.accept())})),this._diffs=[],this._currentDiff=null}prev(){let e=0;if(this._isVisible||(this._diffs=this._compute()),this._isVisible){let i=-1;for(let n=0,s=this._diffs.length;n<s;n++)if(this._diffs[n]===this._currentDiff){i=n;break}e=t
`:`\r
`)}else yield this._clipboardService.writeText(m)})),d.push(u)),i.getOption(81)||d.push(new Fn("diff.inline.revertChange",f("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>Xw(this,void 0,void 0,function*(){const m=new S(n.originalStartLineNumber,1,n.originalEndLineNumber,n.originalModel.getLineMaxColumn(n.originalEndLineNumber)),_=n.originalModel.getValueInRange(m);if(n.modifiedEndLineNumber===0){const b=i.getModel().getLineMaxColumn(n.modifiedStartLineNumber);i.executeEdits("diffEditor",[{range:new S(n.modifiedStartLineNumber,b,n.modifiedStartLineNumber,b),text:l+_}])}else{const b=i.getModel().getLineMaxColumn(n.modifiedEndLineNumber);i.executeEdits("diffEditor",[{range:new S(n.modifiedStartLineNumber,1,n.modifiedEndLineNumber,b),text:_}])}})));const p=(m,_)=>{this._contextMenuService.showContextMenu({getAnchor:()=>({x:m,y:_}),getActions:()=>(u&&(u.label=c?f("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",n.originalStartLineNumber+h):f("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",n.originalStartLineNumber+h)),d),autoSelectFirstItem:!0})};this._register(ki(this._diffActions,"mousedown",m=>{const{top:_,height:b}=Ri(this._diffActions),v=Math.floor(a/3);m.preventDefault(),p(m.posx,_+b+v)})),this._register(i.onMouseMove(m=>{m.target.type===8||m.target.type===5?m.target.detail.viewZoneId===this._viewZoneId?(this.visibility=!0,h=this._updateLightBulbPosition(this._marginDomNode,m.event.browserEvent.y,a)):this.visibility=!1:this.visibility=!1})),this._register(i.onMouseDown(m=>{m.event.rightButton&&(m.target.type===8||m.target.type===5)&&m.target.detail.viewZoneId===this._viewZoneId&&(m.event.preventDefault(),h=this._updateLightBulbPosition(this._marginDomNode,m.event.browserEvent.y,a),p(m.event.posx,m.event.posy+a))}))}get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,e?this._diffActions.style.visibility="visible":this._diffActions.style.visibility="hidden")}_updateLightBulbPosition(e,t,i){const{top:n}=Ri(e),s=t-n,o=Math.floor(s/i),a=o*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],o<l)return d}return o}}const Cc=Ge("clipboardService");class wc{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}}wc.None=Object.freeze({report(){}});const El=Ge("editorProgressService");var C8=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Ir=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}},Qw;class IT{constructor(e,t){this._contextMenuService=e,this._clipboardService=t,this._zones=[],this._inlineDiffMargins=[],this._zonesMap={},this._decorations=[]}getForeignViewZones(e){return e.filter(t=>!this._zonesMap[String(t.id)])}clean(e){this._zones.length>0&&e.changeViewZones(t=>{for(const i of this._zones)t.removeZone(i)}),this._zones=[],this._zonesMap={},this._decorations=e.deltaDecorations(this._decorations,[])}apply(e,t,i,n){const s=n?ml.capture(e):null;e.changeViewZones(o=>{var a;for(const l of this._zones)o.removeZone(l);for(const l of this._inlineDiffMargins)l.dispose();this._zones=[],this._zonesMap={},this._inlineDiffMargins=[];for(let l=0,d=i.zones.length;l<d;l++){const c=i.zones[l];c.suppressMouseDown=!0;const h=o.addZone(c);this._zones.push(h),this._zonesMap[String(h)]=!0,i.zones[l].diff&&c.marginDomNode&&(c.suppressMouseDown=!1,((a=i.zones[l].diff)===null||a===void 0?void 0:a.originalModel.getValueLength())!==0&&this._inlineDiffMargins.push(new v8(h,c.marginDomNode,e,i.zones[l].diff,this._contextMenuService,this._clipboardService)))}}),s&&s.restore(e),this._decorations=e.deltaDecorations(this._decorations,i.decorations),t&&t.setZones(i.overview
.monaco-diff-editor .diffViewport {
background: ${u};
}
`);const g=r.getColor(Lh);g&&e.addRule(`
.monaco-diff-editor .diffViewport:hover {
background: ${g};
}
`);const p=r.getColor(Dh);p&&e.addRule(`
.monaco-diff-editor .diffViewport:active {
background: ${p};
}
`);const m=r.getColor(I$);e.addRule(`
.monaco-editor .diagonal-fill {
background-image: linear-gradient(
-45deg,
${m} 12.5%,
#0000 12.5%, #0000 50%,
${m} 50%, ${m} 62.5%,
#0000 62.5%, #0000 100%
);
background-size: 8px 8px;
}
`)});var k8=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},I8=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}};let s0=class extends V{constructor(e){super(),this._themeService=e,this._onCodeEditorAdd=this._register(new A),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new A),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onDiffEditorAdd=this._register(new A),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new A),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}removeDiffEditor(e){delete this._diffEditors[e.getId()]&&this._onDiffEditorRemove.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorations(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)}};s0=k8([I8(0,Nt)],s0);var E8=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},MT=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}};let bb=class extends s0{constructor(e,t){super(t),this.onCodeEditorAdd(()=>this._checkContextKey()),this.onCodeEditorRemove(()=>this._checkContextKey()),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}openCodeEditor(e,t,i){return t?Promise.resolve(this.doOpenEditor(t,e)):Promise.resolve(null)}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const s=t.resource.scheme;if(s===Me.http||s===Me.https)return pM(t.resource.toString()),e}return null}const n=t.options?t.options.selection:null;if(n)if(typeof n.endLineNumber=="number"&&typeof n.endColumn=="number")e.setSelection(n),e.revealRangeInCenter(n,1);else{const s={lineNumber:n.startLineNumber,column:n.startColumn};e.setPosition(s),e.revealPositionInCenter(s,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};bb=E8([MT(0,ke),MT(1,Nt)],bb);et(lt,bb);const Dp=Ge("layoutService");var JA=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,
`)}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 N8{constructor(e,t,i,n,s,o,a){this.id=++tO,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=o,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 PT),this.removedResources.has(t)||this.removedResources.set(t,new OT(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 PT),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new OT(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class iO{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(){let e=[];e.push(`* ${this.strResource}:`);for(let t=0;t<this._past.length;t++)e.push(` * [UNDO] ${this._past[t]}`);for(let t=this._future.length-1;t>=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(`
`)}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 VA(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 o=-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,o=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}s!==-1&&(this._past=this._past.slice(0,s)),o!==-1&&(this._future=this._future.slice(o+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 Jw{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 nO=new iO("","");nO.locked=!0;let r0=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}: `);let t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(`
`))}pushElement(e,t=Qh.None,i=tr.None){if(e.type===0){const n=mm(e.resource),s=this.getUriComparisonKey(e.resource);this._pushElement(new _m(e,n,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const n=new Set,s=[],o=[];for(const a of e.resources){const l=mm(a),d=this.getUriComparisonKey(a);n.has(d)||(n.add(d),s.push(l),o.push(d))}s.length===1?this._pushElement(new _m(e,s[0],o[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new N8(e,s,o,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 o;this._editStacks.has(s)?o=this._editStacks.get(s):(o=new iO(n,s),this._editStacks.set(s,o)),o.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 o=mm(s.resource),a=this.getUriComparisonKey(s.resource),l=new _m(s,o,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 o=mm(s.resource),a=this.getUriComparisonKey(s.resource),l=new _m(s,o,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 VA(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 o=s.getClosestPastElement();o&&o.sourceId===e&&(!t||o.sourceOrder>t.sourceOrder)&&(t=o,i=n)}return[t,i]}canUndo(e){if(e instanceof tr){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){Te(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 o=this._acquireLocks(i);let a;try{a=t()}catch(l){return o(),n.dispose(),this._onError(l,e)}return a?a.then(()=>(o(),n.dispose(),s()),l=>(o(),n.dispose(),this._onError(l,e))):(o(),n.dispose(),s())}_invokeWorkspacePrepare(e){return pm(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo=="undefined")return V.None;const t=e.actual.prepareUndoRedo();return typeof t=="undefined"?V.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo=="undefined")return t(V.None);const i=e.actual.prepareUndoRedo();return i?FD(i)?t(i):i.then(n=>t(n)):t(V.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||nO);return new Jw(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new bm(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.wa
:host {
all: initial; /* 1st rule so subsequent properties are reset. */
}
@font-face {
font-family: "codicon";
font-display: block;
src: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype");
}
.codicon[class*='codicon-'] {
font: normal normal normal 16px/1 codicon;
display: inline-block;
text-decoration: none;
text-rendering: auto;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
:host {
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
}
:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; }
:host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
`;var a6=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},l6=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}};let f0=class extends V{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=V.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Jh(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.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.contextView.show(e);const n=Ue(()=>{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)}};f0=a6([l6(0,Dp)],f0);const eS="**",$T="/",g_="[/\\\\]",f_="[^/\\\\]",d6=/\//g;function UT(r){switch(r){case 0:return"";case 1:return`${f_}*?`;default:return`(?:${g_}|${f_}+${g_}|${g_}${f_}+)*?`}}function jT(r,e){if(!r)return[];const t=[];let i=!1,n=!1,s="";for(const o of r){switch(o){case e:if(!i&&!n){t.push(s),s="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":n=!0;break;case"]":n=!1;break}s+=o}return s&&t.push(s),t}function dO(r){if(!r)return"";let e="";const t=jT(r,$T);if(t.every(i=>i===eS))e=".*";else{let i=!1;t.forEach((n,s)=>{if(n===eS){i||(e+=UT(2),i=!0);return}let o=!1,a="",l=!1,d="";for(const c of n){if(c!=="}"&&o){a+=c;continue}if(l&&(c!=="]"||!d)){let h;c==="-"?h=c:(c==="^"||c==="!")&&!d?h="^":c===$T?h="":h=Co(c),d+=h;continue}switch(c){case"{":o=!0;continue;case"[":l=!0;continue;case"}":{const u=`(?:${jT(a,",").map(g=>dO(g)).join("|")})`;e+=u,o=!1,a="";break}case"]":e+="["+d+"]",l=!1,d="";break;case"?":e+=f_;continue;case"*":e+=UT(1);continue;default:e+=Co(c)}}s<t.length-1&&(t[s+1]!==eS||s+2<t.length)&&(e+=g_),i=!1})}return e}const c6=/^\*\*\/\*\.[\w\.-]+$/,h6=/^\*\*\/([\w\.-]+)\/?$/,u6=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,g6=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,f6=/^\*\*((\/[\w\.-]+)+)\/?$/,p6=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,KT=new Tl(1e4),qT=function(){return!1},lr=function(){return null};function Xx(r,e){if(!r)return lr;let t;typeof r!="string"?t=r.pattern:t=r,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let n=KT.get(i);if(n)return GT(n,r);let s;if(c6.test(t)){const o=t.substr(4);n=function(a,l){return typeof a=="string"&&a.endsWith(o)?t:null}}else(s=h6.exec(tS(t,e)))?n=m6(s[1],t):(e.trimForExclusions?g6:u6).test(t)?n=_6(t,e):(s=f6.exec(tS(t,e)))?n=ZT(s[1].substr(1),t,!0):(s=p6.exec(tS(t,e)))?n=ZT(s[1],t,!1):n=b6(t);return KT.set(i,n),GT(n,r)}function GT(r,e){return typeof e=="string"?r:function(t,i){return Xy(t,e.base,!Ji)?r(t.substr(e.base.length+1),i):null}}function tS(r,e){return e.trimForExclusions&&r.endsWith("/**")?r.substr(0,r.length-2):r}function m6(r,e){const t=`/${r}`,i=`\\${r}`,n=function(o,a){return typeof o!="string"?null:a?a===r?e:null:o===r||o.endsWith(t)||o.endsWith(i)?e:null},s=[r];return n.basenames=s,n.patterns=[e],n.allBasenames=s,n}function _6(r,e){const t=hO(r.slice(1,-1).split(",").map(a=>Xx(a,e)).filter(a=>a!==lr),r),i=t.length;if(!i)return lr;if(i===1)return t[0];const n=function(a,l){for(let d=0,c=t.length;d<c;d++)if(t[d](a,l))return r;return null},s=t.find(a=>!!a.allBasenames);s&&(n.allBasenames=s.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(n.allPaths=o),n}function ZT(r,e,t){const i=rr===Fs.sep,n=i?r:r.replace(d6,rr),s=rr+n,o=Fs.sep+r,a=t?function(l,d){return typeof l=="string"&&(
.monaco-menu {
font-size: 13px;
}
${QT(ne.menuSelection)}
${QT(ne.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 {
opacity: 0.4;
}
/* 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 #bbb;
padding-top: 1px;
margin-left: .8em;
margin-right: .8em;
}
.monaco-menu .secondary-actions .monaco-action-bar .action-label {
margin-left: 6px;
}
/* Action Items */
.monaco-menu .monaco-action-bar .action-item.select-container {
overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
flex: 1;
max-width: 170px;
min-width: 60px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
}
.monaco-menu .monaco-action-bar.vertical {
margin-left: 0;
overflow: visible;
}
.monaco-menu .monaco-action-bar.vertical .actions-container {
display: block;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
padding: 0;
transform: none;
display: flex;
}
.monaco-menu .monaco-action-bar.vertical .action-item.active {
transform: none;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
flex: 1 1 auto;
display: flex;
height: 2em;
align-items: center;
position: relative;
}
.monaco-menu .monaco-action-bar.vertical .action-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 {
padding: 0.5em 0 0 0;
margin-bottom: 0.5em;
width: 100%;
height: 0px !important;
margin-left: .8em !important;
margin-right: .8em !important;
}
.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;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
border: thin solid transparent; /* prevents jumping behaviour on hover or focus */
}
/* High Contrast Theming */
:host-context(.hc-black) .context-view.monaco-menu-container {
box-shadow: none;
}
:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
background: none;
}
/* Vertical Action Bar Styles */
.monaco-menu .monaco-action-bar.vertical {
padding: .5em 0;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
height: 1.8em;
}
.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;
padding: 0.2em 0 0 0;
margin-bottom: 0.2em;
}
: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;
}
: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=r.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=r.scrollbarSliderBackground;n&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider {
background: ${n};
}
`);const s=r.scrollbarSliderHoverBackground;s&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider:hover {
background: ${s};
}
`);const o=r.scrollbarSliderActiveBackground;o&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider.active {
background: ${o};
}
`)}return t}function oo(r,e){const t=Object.create(null);for(let i in e){const n=e[i];n&&(t[i]=Ar(n,r))}return t}function rk(r,e,t){function i(){const n=oo(r.getColorTheme(),e);typeof t=="function"?t(n):t.style(n)}return i(),r.onDidColorThemeChange(i)}function e9(r,e,t){return rk(e,{badgeBackground:(t==null?void 0:t.badgeBackground)||Ng,badgeForeground:(t==null?void 0:t.badgeForeground)||Rg,badgeBorder:Rt},r)}function zd(r,e,t){return rk(e,Object.assign(Object.assign({},Zv),t||{}),r)}const Zv={listFocusBackground:E$,listFocusForeground:T$,listFocusOutline:N$,listActiveSelectionBackground:Qa,listActiveSelectionForeground:Ja,listActiveSelectionIconForeground:s_,listFocusAndSelectionBackground:Qa,listFocusAndSelectionForeground:Ja,listInactiveSelectionBackground:R$,listInactiveSelectionIconForeground:A$,listInactiveSelectionForeground:M$,listInactiveFocusBackground:O$,listInactiveFocusOutline:P$,listHoverBackground:F$,listHoverForeground:B$,listDropBackground:W$,listSelectionOutline:en,listHoverOutline:en,listFilterWidgetBackground:V$,listFilterWidgetOutline:H$,listFilterWidgetNoMatchesOutline:z$,listMatchesShadow:ul,treeIndentGuidesStroke:$$,tableColumnsBorder:U$,tableOddRowsBackgroundColor:j$},t9={shadowColor:ul,borderColor:K$,foregroundColor:q$,backgroundColor:G$,selectionForegroundColor:Z$,selectionBackgroundColor:Y$,selectionBorderColor:X$,separatorColor:Q$,scrollbarShadow:ku,scrollbarSliderBackground:yh,scrollbarSliderHoverBackground:Lh,scrollbarSliderActiveBackground:Dh};function i9(r,e,t){return rk(e,Object.assign(Object.assign({},t9),t),r)}class n9{constructor(e,t,i,n,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=n,this.themeService=s,this.focusToReturn=null,this.block=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i,n=gM(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:s=>{let o=e.getMenuClassName?e.getMenuClassName():"";o&&(s.className+=" "+o),this.options.blockMouse&&(this.block=s.appendChild(q(".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",Z(this.block,_e.MOUSE_DOWN,d=>d.stopPropagation()));const a=new X,l=e.actionRunner||new Uh;return l.onBeforeRun(this.onActionRun,this,a),l.onDidRun(this.onDidActionRun,this,a),i=new yO(s,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)}),a.add(i9(i,this.themeService)),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a),a.add(Z(window,_e.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(Z(window,_e.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;let c=new bs(d),h=c.target;if(!c.rightButton){for(;h;){if(h===s)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),za(a,i)},focus:()=>{i&&i.focus(!!e.autoSelectFirstItem)},onHide:s=>{e.onHide&&e.onHide(!!s),this.block&&(this.block.remove(),this.block=null),this.focusToReturn&&this.focusToReturn.focus()}},n,!!n)}onActionRun(e){this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1),this.focusToReturn&&this.focusToReturn.focus()}onDidActionRun(e){e.error&&!kl(e.error)&&this.notificationService.error(e.error)}}var s9=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.le
`?a=2:l===`
`&&(a=1);let d=Yi.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace!="undefined"&&(d=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=Yi.detectIndentation;e.editor&&typeof e.editor.detectIndentation!="undefined"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let h=Yi.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations!="undefined"&&(h=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let u=Yi.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(u={enabled:!!e.editor.bracketPairColorization.enabled}),{isForSimpleWidget:t,tabSize:n,indentSize:s,insertSpaces:o,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:fs===3||fs===2?`
`:`\r
`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){let n=this._modelCreationOptionsByLanguageAndResource[e+t];if(!n){const s=this._configurationService.getValue("editor",{overrideIdentifier:e,resource:t}),o=this._getEOL(t,e);n=vg._readModelOptions({editor:s,eol:o},i),this._modelCreationOptionsByLanguageAndResource[e+t]=n}return n}_updateModelOptions(){const e=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const s=t[i],o=this._models[s],a=o.model.getLanguageId(),l=o.model.uri,d=e[a+l],c=this.getCreationOptions(a,l,o.model.isForSimpleWidget);vg._setModelOptionsForModel(o.model,c,d)}}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&&oa(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(Sa(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(Sa(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(Sa(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),o=new la(e,t,s,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Sa(i))){const d=this._removeDisposedModel(i),c=this._undoRedoService.getElements(i),h=aN(o)===d.sha1;if(h||d.sharesUndoRedoStack){for(const u of c.past)Hr(u)&&u.matchesResource(i)&&u.setModel(o);for(const u of c.future)Hr(u)&&u.matchesResource(i)&&u.setModel(o);this._undoRedoService.setElementsValidFlag(i,!0,u=>Hr(u)&&u.matchesResource(i)),h&&(o._overwriteVersionId(d.versionId),o._overwriteAlternativeVersionId(d.alternativeVersionId),o._overwriteInitialUndoRedoSnapshot(d.initialUndoRedoSnapshot))}else d.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(d.initialUndoRedoSnapshot)}const a=Sa(o.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new v9(o,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.languageId,i,n),this.setMode(s.model,t)):s=this._createModelData(e,vr,i,n),this._onModelAdded.fire(s.model),s.model}setMode(e,t){if(!t)return;const i=this._models[Sa(e.uri)];i&&i.setLanguage(t)}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i<n;i++){const s=t[i];e.push(this._models[s].model)}return e}getModel(e){const t=Sa(e),i=this._models[t];return i?i.model:null}getSemanticTokensProviderStyling(e){return this._semanticStyling.get(e)}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Me.file||e.scheme===Me.vscodeRemote||e.scheme===Me.userData||e.scheme===Me.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=Sa(e.uri),i=this._models[t],n=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let s=!1,o=0;if(n||this._
`)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 A9(r,e){return A0(r,e)!==0}function A0(r,e){switch(r){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}class O9{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 P9{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._currentPosition()!==this._elements.length-1?this._navigator.next():null}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new O9(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const ig=q,F9={inputBackground:F.fromHex("#3C3C3C"),inputForeground:F.fromHex("#CCCCCC"),inputValidationInfoBorder:F.fromHex("#55AAFF"),inputValidationInfoBackground:F.fromHex("#063B49"),inputValidationWarningBorder:F.fromHex("#B89500"),inputValidationWarningBackground:F.fromHex("#352A05"),inputValidationErrorBorder:F.fromHex("#BE1100"),inputValidationErrorBackground:F.fromHex("#5A1D1D")};class AO extends Xs{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new A),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new A),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i||Object.create(null),ga(this.options,F9,!1),this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(n=this.options.tooltip)!==null&&n!==void 0?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.inputBackground=this.options.inputBackground,this.inputForeground=this.options.inputForeground,this.inputBorder=this.options.inputBorder,this.inputValidationInfoBorder=this.options.inputValidationInfoBorder,this.inputValidationInfoBackground=this.options.inputValidationInfoBackground,this.inputValidationInfoForeground=this.options.inputValidationInfoForeground,this.inputValidationWarningBorder=this.options.inputValidationWarningBorder,this.inputValidationWarningBackground=this.options.inputValidationWarningBackground,this.inputValidationWarningForeground=this.options.inputValidationWarningForeground,this.inputValidationErrorBorder=this.options.inputValidationErrorBorder,this.inputValidationErrorBackground=this.options.inputValidationErrorBackground,this.inputValidationErrorForeground=this.options.inputValidationErrorForeground,this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=$(e,ig(".monaco-inputbox.idle"));let s=this.options.flexibleHeight?"textarea":"input",o=$(this.element,ig(".ibwrapper"));if(this.input=$(o,ig(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remov
`?-1:0,o+=i;for(const a of t)a.end<=o||(a.start>=o&&(a.start+=n),a.end>=o&&(a.end+=n));return i+=n,"⏎"})}}class Qn{constructor(e="",t=!1){var i,n,s;if(this.value=e,typeof this.value!="string")throw mo("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=(i=t.isTrusted)!==null&&i!==void 0?i:void 0,this.supportThemeIcons=(n=t.supportThemeIcons)!==null&&n!==void 0?n:!1,this.supportHtml=(s=t.supportHtml)!==null&&s!==void 0?s:!1)}appendText(e,t=0){return this.value+=V9(this.supportThemeIcons?q6(e):e).replace(/([ \t]+)/g,(i,n)=>"&nbsp;".repeat(n.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\
`:`
`),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}}function iu(r){return PO(r)?!r.value:Array.isArray(r)?r.every(iu):!0}function PO(r){return r instanceof Qn?!0:r&&typeof r=="object"?typeof r.value=="string"&&(typeof r.isTrusted=="boolean"||r.isTrusted===void 0)&&(typeof r.supportThemeIcons=="boolean"||r.supportThemeIcons===void 0):!1}function V9(r){return r.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")}function lS(r){return r&&r.replace(/\\([\\`*_{}[\]()#+\-.!])/g,"$1")}function H9(r){const e=[],t=r.split("|").map(n=>n.trim());r=t[0];const i=t[1];if(i){const n=/height=(\d+)/.exec(i),s=/width=(\d+)/.exec(i),o=n?n[1]:"",a=s?s[1]:"",l=isFinite(parseInt(a)),d=isFinite(parseInt(o));l&&e.push(`width="${a}"`),d&&e.push(`height="${o}"`)}return{href:r,dimensions:e}}var O0=globalThis&&globalThis.__awaiter||function(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{d(i.next(c))}catch(h){o(h)}}function l(c){try{d(i.throw(c))}catch(h){o(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(r,e||[])).next())})};function z9(r,e){qs(e)?r.title=ok(e):e!=null&&e.markdownNotSupportedFallback?r.title=e.markdownNotSupportedFallback:r.removeAttribute("title")}class $9{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t){var i;return O0(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let n;if(e===void 0||qs(e)||e instanceof HTMLElement)n=e;else if(!cy(e.markdown))n=(i=e.markdown)!==null&&i!==void 0?i:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(f("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new ji;const s=this._cancellationTokenSource.token;if(n=yield e.markdown(s),n===void 0&&(n=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(n,t)})}show(e,t){const i=this._hoverWidget;if(this.hasContent(e)){const n={content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!i};this._hoverWidget=this.hoverDelegate.showHover(n,t)}i==null||i.dispose()}hasContent(e){return e?PO(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function U9(r,e,t){let i,n;const s=(c,h)=>{var u;c&&(n==null||n.dispose(),n=void 0),h&&(i==null||i.dispose(),i=void 0),(u=r.onDidHideHover)===null||u===void 0||u.call(r)},o=(c,h,u)=>new Hn(()=>O0(this,void 0,void 0,function*(){(!n||n.isDisposed)&&(n=new $9(r,u||e,c>0),yield n.update(t,h))}),c),a=()=>{if(i)return;const c=new X,h=p=>s(!1,p.fromElement===e);c.add(Z(e,_e.MOUSE_LEAVE,h,!0));const u=()=>s(!0,!0);c.add(Z(e,_e.MOUSE_DOWN,u,!0));const g={targetElements:[e],dispose:()=>{}};if(r.placement===void 0||r.placement==="mouse"){const p=m=>g.x=m.x+10;c.add(Z(e,_e.MOUSE_MOVE,p,!0))}c.add(o(r.delay,!1,g)),i=c},l=Z(e,_e.MOUSE_OVER,a,!0);return{show:c=>{s(!1,!0),o(0,c)},hide:()=>{s(!0,!0)},update:c=>O0(this,void 0,void 0,function*(){t=c,yield n==null?void 0:n.update(t)}),dispose:()=>{l.dispose(),s(!0,!0)}}}class dS{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 Rb extends V{constructor(e,t){super(),this.customHovers=new Map,this.domNode=this._register(new dS($(e,q(".monaco-icon-label")))),this.labelContainer=$(this.domNode.element,q(".monaco-icon-label-container"));const i=$(this.labelContainer,q("span.monaco-icon-name-container"));this.descriptionContainer
`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}}Jv.MAX_WIDTH=600;class iq{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(n=>n.splice(e,t,i))}}class Vl extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function fN(r,e){const t=[];for(let i of e){if(r.start>=i.range.end)continue;if(r.end<i.range.start)break;const n=Wi.intersect(r,i.range);Wi.isEmpty(n)||t.push({range:n,size:i.size})}return t}function F0({start:r,end:e},t){return{start:r+t,end:e+t}}function nq(r){const e=[];let t=null;for(let i of r){const n=i.range.start,s=i.range.end,o=i.size;if(t&&o===t.size){t.range.end=s;continue}t={range:{start:n,end:s},size:o},e.push(t)}return e}function sq(...r){return nq(r.reduce((e,t)=>e.concat(t),[]))}class pN{constructor(){this.groups=[],this._size=0}splice(e,t,i=[]){const n=i.length-t,s=fN({start:0,end:e},this.groups),o=fN({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:F0(l.range,n),size:l.size})),a=i.map((l,d)=>({range:{start:e+d,end:e+d+1},size:l.size}));this.groups=sq(s,a,o),this._size=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;let t=0,i=0;for(let n of this.groups){const s=n.range.end-n.range.start,o=i+s*n.size;if(e<o)return t+Math.floor((e-i)/n.size);t+=s,i=o}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(let n of this.groups){const s=n.range.end-n.range.start,o=i+s;if(e<o)return t+(e-i)*n.size;t+=s*n.size,i=o}return-1}}function oq(r){try{r.parentElement&&r.parentElement.removeChild(r)}catch(e){}}class rq{constructor(e){this.renderers=e,this.cache=new Map}alloc(e){let t=this.getTemplateCache(e).pop();if(!t){const i=q(".monaco-list-row"),s=this.getRenderer(e).renderTemplate(i);t={domNode:i,templateId:e,templateData:s}}return t}release(e){e&&this.releaseRow(e)}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(t.classList.remove("scrolling"),oq(t)),this.getTemplateCache(i).push(e)}getTemplateCache(e){let t=this.cache.get(e);return t||(t=[],this.cache.set(e,t)),t}dispose(){this.cache.forEach((e,t)=>{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var Sc=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};const Po={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(r){return[r]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class Ep{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class aq{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class lq{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;t<e.files.length;t++){const i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}function dq(r,e){return Array.isArray(r)&&Array.isArray(e)?is(r,e):r===e}class cq{constructor(e){e!=null&&e.getSetSize?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(t,i,n)=>n,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class To{constructor(e,t,i,n=Po){if(this.virtualDelegate=t,this.d
.monaco-drag-image,
.monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
`),e.listFocusAndSelectionForeground&&i.push(`
.monaco-drag-image,
.monaco-list${t}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
`),e.listInactiveFocusForeground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&i.push(`.monaco-list${t} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(i.push(`.monaco-list${t} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(i.push(`.monaco-list${t} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),i.push(`.monaco-list${t} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&i.push(`.monaco-list${t} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&i.push(`.monaco-list${t}:not(.drop-target) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&i.push(`.monaco-list${t} .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`),e.listSelectionOutline&&i.push(`.monaco-list${t} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listFocusOutline&&i.push(`
.monaco-drag-image,
.monaco-list${t}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
.monaco-workbench.context-menu-visible .monaco-list${t}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
`),e.listInactiveFocusOutline&&i.push(`.monaco-list${t} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&i.push(`.monaco-list${t} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&i.push(`
.monaco-list${t}.drop-target,
.monaco-list${t} .monaco-list-rows.drop-target,
.monaco-list${t} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }
`),e.listFilterWidgetBackground&&i.push(`.monaco-list-type-filter { background-color: ${e.listFilterWidgetBackground} }`),e.listFilterWidgetOutline&&i.push(`.monaco-list-type-filter { border: 1px solid ${e.listFilterWidgetOutline}; }`),e.listFilterWidgetNoMatchesOutline&&i.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${e.listFilterWidgetNoMatchesOutline}; }`),e.listMatchesShadow&&i.push(`.monaco-list-type-filter { box-shadow: 1px 1px 1px ${e.listMatchesShadow}; }`),e.tableColumnsBorder&&i.push(`
.monaco-table:hover > .monaco-split-view2,
.monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
border-color: ${e.tableColumnsBorder};
}`),e.tableOddRowsBackgroundColor&&i.push(`
.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,
.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,
.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {
background-color: ${e.tableOddRowsBackgroundColor};
}
`),this.styleElement.textContent=i.join(`
`)}}const mq={listFocusBackground:F.fromHex("#7FB0D0"),listActiveSelectionBackground:F.fromHex("#0E639C"),listActiveSelectionForeground:F.fromHex("#FFFFFF"),listActiveSelectionIconForeground:F.fromHex("#FFFFFF"),listFocusAndSelectionBackground:F.fromHex("#094771"),listFocusAndSelectionForeground:F.fromHex("#FFFFFF"),listInactiveSelectionBackground:F.fromHex("#3F3F46"),listInactiveSelectionIconForeground:F.fromHex("#FFFFFF"),listHoverBackground:F.fromHex("#2A2D2E"),listDropBackground:F.fromHex("#383B3D"),treeIndentGuidesStroke:F.fromHex("#a9a9a9"),tableColumnsBorder:F.fromHex("#cccccc").transparent(.2),tableOddRowsBackgroundColor:F.fromHex("#cccccc").transparent(.04)},_q={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){}}};function bq(r,e){const t=r.indexOf(e);if(t===-1)return[];const i=[];let n=t-1;for(;n>=0&&r[n]===e-(t-n);)i.push(r[n--]);for(i.reverse(),n=t;n<r.length&&r[n]===e+(n-t);)i.push(r[n++]);return i}function B0(r,e){const t=[];let i=0,n=0;for(;i<r.length||n<e.length;)if(i>=r.length)t.push(e[n++]);else if(n>=e.length)t.push(r[i++]);else if(r[i]===e[n]){t.push(r[i]),i++,n++;continue}else r[i]<e[n]?t.push(r[i++]):t.push(e[n++]);return t}function vq(r,e){const t=[];let i=0,n=0;for(;i<r.length||n<e.length;)if(i>=r.length)t.push(e[n++]);else if(n>=e.length)t.push(r[i++]);else if(r[i]===e[n]){i++,n++;continue}else r[i]<e[n]?t.push(r[i++]):n++;return t}const bN=(r,e)=>r-e;class Cq{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 o of this.renderers)o.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){let s=0;for(const o of this.renderers)o.disposeElement&&o.disposeElement(e,t,i[s],n),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class wq{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 Sq{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){this.dnd.onDragStart&&this.dnd.onDragStart(e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var s,o;(o=(s=this.dnd).onDragLeave)===null||o===void 0||o.call(s,e,t,i,n)}onDragEnd(e){this.dnd.onDragEnd&&this.dnd.onDragEnd(e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}}class Cr{constructor(e,t,i,n,s=_q){var o;this.user=e,this._options=s,this.focus=new Mb("focused"),this.anchor=new Mb("anchor"),this.eventBufferer=new VD,this._ariaLabel="",this.disposables=new X,this._onDidDispose=new A,this.onDidDispose=this._onDidDispose.event;const a=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(o=this._options.accessibilityProvider)===null||o===void 0?void 0:o.getWidgetRole():"list";this.selection=new uq(a!=="listbox"),ga(s,mq,!1);const l=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(l.push(new wq(this.accessibilityProvider)),this.accessibilityProvider.onDidChangeActiveDescendant&&this.accessibilityProvider.onDidChangeActiveDescendant(this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map(c=>new Cq(c.templateId,[...l,c]));const d=Object.assign(Object.assign({},s),{dnd:s.dnd&&new Sq(this,s.dnd)});if(this.view=new To(t,i,n,d),this.view.domNode.setAttribute("role",a),s.styleController)this.styleController=s.styleController(this.view.domId);else{const c=Ss(this.view.domNode
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()}}eC.InstanceCount=0;var Zg;(function(r){r[r.Unknown=0]="Unknown",r[r.Twistie=1]="Twistie",r[r.Element=2]="Element"})(Zg||(Zg={}));class ms extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class pk{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function mk(r){return typeof r=="object"&&"visibility"in r&&"data"in r}function Ff(r){switch(r){case!0:return 1;case!1:return 0;default:return r}}function hS(r){return typeof r.collapsible=="boolean"}class Rq{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new VD,this._onDidChangeCollapseState=new A,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new A,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new A,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new dr(qR),this.collapseByDefault=typeof n.collapseByDefault=="undefined"?!1:n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=typeof n.autoExpandSingleChildren=="undefined"?!1:n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=nt.empty(),n={}){if(e.length===0)throw new ms(this.user,"Invalid tree location");n.diffIdentityProvider?this.spliceSmart(n.diffIdentityProvider,e,t,i,n):this.spliceSimple(e,t,i,n)}spliceSmart(e,t,i,n,s,o){var a;n===void 0&&(n=nt.empty()),o===void 0&&(o=(a=s.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,n,s);const d=[...n],c=t[t.length-1],h=new DR({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,c),...d,...l.children.slice(c+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(h.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,d,s);const u=t.slice(0,-1),g=(_,b,v)=>{if(o>0)for(let C=0;C<v;C++)_--,b--,this.spliceSmart(e,[...u,_,0],Number.MAX_SAFE_INTEGER,d[b].children,s,o-1)};let p=Math.min(l.children.length,c+i),m=d.length;for(const _ of h.changes.sort((b,v)=>v.originalStart-b.originalStart))g(p,m,p-(_.originalStart+_.originalLength)),p=_.originalStart,m=_.modifiedStart-c,this.spliceSimple([...u,p],_.originalLength,nt.slice(d,m,m+_.modifiedLength),s);g(p,m,p)}spliceSimple(e,t,i=nt.empty(),{onDidCreateNode:n,onDidDeleteNode:s,diffIdentityProvider:o}){const{parentNode:a,listIndex:l,revealed:d,visible:c}=this.getParentNodeWithListIndex(e),h=[],u=nt.map(i,y=>this.createTreeNode(y,a,a.visible?1:0,d,h,n)),g=e[e.length-1],p=a.children.length>0;let m=0;for(let y=g;y>=0&&y<a.children.length;y--){const D=a.children[y];if(D.visible){m=D.visibleChildIndex;break}}const _=[];let b=0,v=0;for(const y of u)_.push(y),v+=y.renderNodeCount,y.visible&&(y.visibleChildIndex=m+b++);const C=OI(a.children,g,t,_);o?a.lastDiffIds?OI(a.lastDiffIds,g,t,_.map(y=>o.getId(y.element).toString())):a.lastDiffIds=a.children.map(y=>o.getId(y.element).toString()):a.lastDiffIds=void 0;let w=0;for(const y of C)y.visible&&w++;if(w!==0)for(let y=g+_.length;y<a.children.length;y++){const D=a.children[y];D.visible&&(D.visibleChildIndex-=w)}if(a.visibleChildrenCount+=b-w,d&&c){const y=C.reduce((D,R)=>D+(R.visible?R.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,v-y),this.list.splice(l,y,h)}if(C.length>0&&s){const y=D=>{s(D),D.children.forEach(y)};C.forEach(y)}this._onDidSplice.fire({insertedNodes:_,deletedNodes:C});const L=a.children.length>0;p!==L&&this.setCollapsible(e.slice(0,-1),L);let E=a;for(;E;){if(E.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}E=E.parent}}rerender(e){if(e.length===0)throw new
`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map(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)}focusNext(e=1,t=!1,i,n=this.focusNavigationFilter){this.view.focusNext(e,t,i,n)}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)}getRelativeTop(e){const t=this.model.getListIndex(e);return t===-1?null:this.view.getRelativeTop(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 o=this.model.getParentNodeLocation(n);if(!o)return;const a=this.model.getListIndex(o);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[o]=this.view.getFocus(),a=o+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(){tt(this.disposables),this.view.dispose()}}class bk{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new Rq(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=nt.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=nt.empty(),i){const n=new Set,s=new Set,o=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:o,onDidDeleteNode:a}))}preserveCollapseState(e=nt.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),nt.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const o=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(o)}if(!i)return Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children)});const n=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible,s=typeof t.collapsed!="undefined"?t.collapsed:i.collapsed;return Object.assign(Object.assign({},t),{collapsible:n,collapsed:s,children:this.preserveCollapseState(t.children)})})}rerender(e)
`)}const y7={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:{[Sn]:"#FFFFFE",[Za]:"#000000",[_x]:"#E5EBF1",[Av]:"#D3D3D3",[Ov]:"#939393",[bx]:"#ADD6FF4D"}},L7={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:{[Sn]:"#1E1E1E",[Za]:"#D4D4D4",[_
`)}}}class oP{getIcon(e){const t=jA();let i=e.defaults;for(;_t.isThemeIcon(i);){const n=t.getIcon(i.id);if(!n)return;i=n.defaults}return i}}const ud="vs",Bb="vs-dark",Ah="hc-black",rP=ti.as(TM.ColorContribution),k7=ti.as(vM.ThemingContribution);class aP{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(C_(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(let t in this.themeData.colors)e.set(t,F.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=X0(this.themeData.base);for(let i in t.colors)e.has(i)||e.set(i,F.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=rP.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return Object.prototype.hasOwnProperty.call(this.getColors(),e)}get type(){switch(this.base){case ud:return zs.LIGHT;case Ah:return zs.HIGH_CONTRAST;default:return zs.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const s=X0(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=sP.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const s=this.tokenTheme._match([e].concat(t).join(".")).metadata,o=$i.getForeground(s),a=$i.getFontStyle(s);return{foreground:o,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function C_(r){return r===ud||r===Bb||r===Ah}function X0(r){switch(r){case ud:return y7;case Bb:return L7;case Ah:return D7}}function mS(r){const e=X0(r);return new aP(r,e)}class I7 extends V{constructor(){super(),this._onColorThemeChange=this._register(new A),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new A),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new oP,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(ud,mS(ud)),this._knownThemes.set(Bb,mS(Bb)),this._knownThemes.set(Ah,mS(Ah));const e=x7(this);this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(ud),e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}),c3("(forced-colors: active)",()=>{this._updateActualTheme()})}registerEditorContainer(e){return df(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Ss(),this._globalStyleElement.className="monaco-colors",this._globalStyleElement.textContent=this._allCSS,this._styleElements.push(this._globalStyleElement)),V.None}_registerShadowDomContainer(e){const t=Ss(e);return t.className="monaco-colors",t.textContent=this._allCSS,this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!C_(t.base)&&!C_(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new aP(e,t)),C_(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(ud),this._desiredTheme=t,this._updateActualTheme()}_updateActualTheme(){const e=this._autoDetectHighContrast&&window.matchMedia("(forced-colors: active)").matches?this._knownThemes.get(Ah):this._desiredTheme;this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._updateActualTheme()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:o=>{t[o]||(e.push(o),t[o]=!0)}};k7.getThemingParticipants().forEach(o=>o(this._theme,i,this._environment));const n=[];for(const o of rP.getColors()){const a=this._theme.getColor(o.id,!0);a&&n.push(`${EM(o.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor { ${n.join(`
`)} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(S7(s)),this._themeCSS=e.join(`
`),this._updateCSS(),Ot.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 ds=Ge("themeService");var E7=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},TN=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}};let Q0=class extends V{constructor(e,t){super(),this._contextKeyService=e,this._configurationService=t,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new A,this._accessibilityModeEnabledContext=bp.bindTo(this._contextKeyService);const i=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(n=>{n.affectsConfiguration("editor.accessibilitySupport")&&(i(),this._onDidChangeScreenReaderOptimized.fire())})),i(),this.onDidChangeScreenReaderOptimized(()=>i())}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}getAccessibilitySupport(){return this._accessibilitySupport}};Q0=E7([TN(0,ke),TN(1,bt)],Q0);var lP=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},w_=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}};let J0=class{constructor(e){this._commandService=e}createMenu(e,t,i){return new eL(e,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t,this)}};J0=lP([w_(0,ei)],J0);let eL=class Jc{constructor(e,t,i,n,s){this._id=e,this._options=t,this._commandService=i,this._contextKeyService=n,this._menuService=s,this._disposables=new X,this._menuGroups=[],this._contextKeys=new Set,this._build();const o=new gt(()=>{this._build(),this._onDidChange.fire(this)},t.eventDebounceDelay);this._disposables.add(o),this._disposables.add(ns.onDidChangeMenu(d=>{d.has(e)&&o.schedule()}));const a=this._disposables.add(new X),l=()=>{const d=new gt(()=>this._onDidChange.fire(this),t.eventDebounceDelay);a.add(d),a.add(n.onDidChangeContext(c=>{c.affectsSome(this._contextKeys)&&d.schedule()}))};this._onDidChange=new A({onFirstListenerAdd:l,onLastListenerRemove:a.clear.bind(a)}),this.onDidChange=this._onDidChange.event}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}_build(){this._menuGroups.length=0,this._contextKeys.clear();const e=ns.getMenuItems(this._id);let t;e.sort(Jc._compareMenuItems);for(const i of e){const n=i.group||"";(!t||t[0]!==n)&&(t=[n,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(Jc._fillInKbExprKeys(e.when,this._contextKeys),lh(e)){if(e.command.precondition&&Jc._fillInKbExprKeys(e.command.precondition,this._contextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Jc._fillInKbExprKeys(t,this._contextKeys)}}else this._options.emitEventsForSubmenuChanges&&ns.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}getActions(e){const t=[];for(let i of this._menuGroups){const[n,s]=i,o=[];for(const a of s)if(this._contextKeyService.contextMatchesRules(a.when)){const l=lh(a)?new hl(a.command,a.alt,e,this._contextKeyService,this._commandService):new ux(a,this._menuService,this._contextKeyService,e);o.push(l)}o.length>0&&t.push([n,o])}return t}static _fillInKbExprKeys(e,t){if(e)for
`)}findCycleSlow(){for(let[e,t]of this._nodes){const i=new Set([e]),n=this._findCycle(t,i);if(n)return n}}_findCycle(e,t){for(let[i,n]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const s=this._findCycle(n,t);if(s)return s;t.delete(i)}}}class AN 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 Mk{constructor(e=new zv,t=!1,i){this._activeInstantiations=new Set,this._services=e,this._strict=t,this._parent=i,this._services.set(ze,this)}createChild(e){return new Mk(e,this._strict,this)}invokeFunction(e,...t){let i=Bs.traceInvocation(e),n=!1;try{return e({get:o=>{if(n)throw AV("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(o,i);if(!a)throw new Error(`[invokeFunction] unknown service '${o}'`);return a}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof qo?(i=Bs.traceCreation(e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Bs.traceCreation(e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){let n=uo.getServiceDependencies(e).sort((a,l)=>a.index-l.index),s=[];for(const a of n){let l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),s.push(l)}let o=n.length>0?n[0].index:t.length;if(t.length!==o){console.warn(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);let a=o-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,o)}return new e(...t,...s)}_setServiceInstance(e,t){if(this._services.get(e)instanceof qo)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){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){let i=this._getServiceInstanceOrDescriptor(e);return i instanceof qo?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){const n=new B7(a=>a.id.toString());let s=0;const o=[{id:e,desc:t,_trace:i}];for(;o.length;){const a=o.pop();if(n.lookupOrInsertNode(a),s++>1e3)throw new AN(n);for(let l of uo.getServiceDependencies(a.desc.ctor)){let d=this._getServiceInstanceOrDescriptor(l.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${l.id} which is NOT registered.`,!0),d instanceof qo){const c={id:l.id,desc:d,_trace:a._trace.branch(l.id,!0)};n.insertEdge(a,c),o.push(c)}}}for(;;){const a=n.roots();if(a.length===0){if(!n.isEmpty())throw new AN(n);break}for(const{data:l}of a){if(this._getServiceInstanceOrDescriptor(l.id)instanceof qo){const c=this._createServiceInstanceWithOwner(l.id,l.desc.ctor,l.desc.staticArguments,l.desc.supportsDelayedInstantiation,l._trace);this._setServiceInstance(l.id,c)}n.removeNode(l)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e)instanceof qo)return this._createServiceInstance(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){if(i){const s=new ja(()=>this._createInstance(e,t,n));return new Proxy(Object.create(null),{get(o,a){if(a in o)return o[a];let l=s.value,d=l[a];return typeof d!="function"||(d=d.bind(l),o[a]=d),d},set(o,a,l){return s.value[a]=l,!0}})}else return this._createInstance(e,t,n)}_throwIfStrict(e,t){if(t&&console.warn(t),this._strict)throw new Error(e)}}class Bs{constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}static traceInvocation(e){return Bs._None}static traceCreation(e){return Bs._None}branch(e,t){let i=new Bs(2,e.toString());return this._dep.push([e,t,i]),i}stop(){let e=Date.now()-this._start;Bs._totals+=e;let t=!1;function i(s,o){let a=[],l=new Array(s+1).join(" ");for(const[d,c,h]of o._dep)if(c&&h){t=!0,a.push(`${l}CREATES -> ${d}`);let u=
`)}let n=[`${this.type===0?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Bs._totals.toFixed(2)}ms)`];(e>2||t)&&console.log(n.join(`
`))}}Bs._None=new class extends Bs{constructor(){super(-1,null)}stop(){}branch(){return this}};Bs._totals=0;class W7{constructor(){this._byResource=new on,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 on,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){let i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,n=!1,s=this._byResource.get(e);s&&(i=s.delete(t));let o=this._byOwner.get(t);if(o&&(n=o.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:nt.empty():xe.isUri(e)?(s=(n=this._byResource.get(e))===null||n===void 0?void 0:n.values())!==null&&s!==void 0?s:nt.empty():nt.map(nt.concat(...this._byOwner.values()),o=>o[1])}}class V7{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new on,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const n=this._resourceStats(t);this._add(n),this._data.set(t,n)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(e.scheme===Me.inMemory||e.scheme===Me.walkThrough||e.scheme===Me.walkThroughSnippet)return t;for(const{severity:i}of this._service.read({resource:e}))i===Pt.Error?t.errors+=1:i===Pt.Warning?t.warnings+=1:i===Pt.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 nd{constructor(){this._onMarkerChanged=new OV({delay:0,merge:nd._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new W7,this._stats=new V7(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(xR(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const n=[];for(const s of i){const o=nd._toMarker(e,t,s);o&&n.push(o)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:o,source:a,startLineNumber:l,startColumn:d,endLineNumber:c,endColumn:h,relatedInformation:u,tags:g}=i;if(o)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:o,source:a,startLineNumber:l,startColumn:d,endLineNumber:c,endColumn:h,relatedInformation:u,tags:g}}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const o=this._data.get(i,t);if(o){const a=[];for(const l of o)if(nd._accept(l,n)){const d=a.push(l);if(s>0&&d===s)break}return a}else return[]}else if(!t&&!i){const o=[];for(let a of this._data.values())for(let l of a)if(nd._accept(l,n)){const d=o.push(l);if(s>0&&d===s)return o}return o}else{const o=this._data.values(i!=null?i:t),a=[];for(const l of o)for(const d of l)if(nd._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 on;for(let i of e)for(let n of i)t.set(n,!0);return Array.from(t.keys())}}var Cg=globalThis&&globalThis.__awaiter||function(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{d(i.next(c))}catch(h){o(h)}}function l(c){try{d(i.throw(c))}catch(h){o(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(r,e||[])).next())})},mh;(function(r){r[r.None=0]="None",r[r.Initialized=1]="Initialized",r[r.Closed=2]="Closed"})(mh||(mh={}));class zf extends V{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new A),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=mh.None,this.cache=new Map,this.flushDelayer=new ez(zf.DEFAULT_FLUSH_DELAY),this.pe
`+e.detail),Promise.resolve(window.confirm(t))}show(e,t,i,n){return Promise.resolve({choice:0})}}class dC{info(e){return this.notify({severity:At.Info,message:e})}warn(e){return this.notify({severity:At.Warning,message:e})}error(e){return this.notify({severity:At.Error,message:e})}notify(e){switch(e.severity){case At.Error:console.error(e.message);break;case At.Warning:console.warn(e.message);break;default:console.log(e.message);break}return dC.NO_OP}status(e,t){return V.None}}dC.NO_OP=new PK;let sL=class{constructor(e){this._onWillExecuteCommand=new A,this._onDidExecuteCommand=new A,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Xe.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)}}};sL=Nl([Xi(0,ze)],sL);let Vb=class extends J8{constructor(e,t,i,n,s,o){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const p=new X;p.add(Z(g,_e.KEY_DOWN,m=>{const _=new Tt(m);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),p.add(Z(g,_e.KEY_UP,m=>{const _=new Tt(m);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new j7(g,p))},l=g=>{for(let p=0;p<this._domNodeListeners.length;p++){const m=this._domNodeListeners[p];m.domNode===g&&(this._domNodeListeners.splice(p,1),m.dispose())}},d=g=>{g.getOption(54)||a(g.getContainerDomNode())},c=g=>{g.getOption(54)||l(g.getContainerDomNode())};this._register(o.onCodeEditorAdd(d)),this._register(o.onCodeEditorRemove(c)),o.listCodeEditors().forEach(d);const h=g=>{a(g.getContainerDomNode())},u=g=>{l(g.getContainerDomNode())};this._register(o.onDiffEditorAdd(h)),this._register(o.onDiffEditorRemove(u)),o.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){const s=Dy(t,fs),o=new X;return s&&(this._dynamicKeybindings.push({keybinding:s.parts,command:e,when:n,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}),o.add(Ue(()=>{for(let a=0;a<this._dynamicKeybindings.length;a++)if(this._dynamicKeybindings[a].command===e){this._dynamicKeybindings.splice(a,1),this.updateResolver({source:1});return}}))),o.add(Xe.registerCommand(e,i)),this.updateResolver({source:1}),o}updateResolver(e){this._cachedResolver=null,this._onDidUpdateKeybindings.fire(e)}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(ln.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new Kg(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 o=s.when||void 0,a=s.keybinding;if(!a)i[n++]=new HT(void 0,s.command,s.commandArgs,o,t,null,!1);else{const l=Tf.resolveUserBinding(a,fs);for(const d of l)i[n++]=new HT(d,s.command,s.commandArgs,o,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Rd(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode).toChord();return new Tf(t,fs)}};Vb=Nl([Xi(0,ke),Xi(1,ei),Xi(2,_r),Xi(3,ii),Xi(4,Ys),Xi(5,lt)],Vb);class j7 extends V{constructor(e,t){super(),this.domNode=e,this._register(t)}}function PN(r){return r&&typeof r=="object"&&(!r.overrideIdentifier||typeof r.overrideIdentifier=="string")&&(!r.resource||r.resource instanceof xe)}class gP{constructor(){this._onDidChangeConfiguration=new A,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configuration=new Uv(new Y8,new gs)}getValue(e,t){const i=typeof e=="string"?e:void 0,n=PN(e)?e:PN(t)?t:{};return this._configuration.getValue(i,n,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const n of e){const[s,o]=n;this.getValue(s)!==o&&(this._configura
`:`\r
`}};rL=Nl([Xi(0,bt)],rL);class K7{publicLog(e,t){return Promise.resolve(void 0)}publicLog2(e,t){return this.publicLog(e,t)}}class cC{constructor(){const e=xe.from({scheme:cC.SCHEME,authority:"model",path:"/"});this.workspace={id:"4064f6ec-cb38-4ad0-af64-ee6467e63c82",folders:[new o6({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}}cC.SCHEME="inmemory";function Hb(r,e,t){if(!e||!(r instanceof gP))return;const i=[];Object.keys(e).forEach(n=>{q8(n)&&i.push([`editor.${n}`,e[n]]),t&&G8(n)&&i.push([`diffEditor.${n}`,e[n]])}),i.length>0&&r.updateValues(i)}let aL=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return uP(this,void 0,void 0,function*(){const i=new Map;for(let o of e){if(!(o instanceof oO))throw new Error("bad edit - only text edits are supported");const a=this._modelService.getModel(o.resource);if(!a)throw new Error("bad edit - model not found");if(typeof o.versionId=="number"&&a.getVersionId()!==o.versionId)throw new Error("bad state - model changed in the meantime");let l=i.get(a);l||(l=[],i.set(a,l)),l.push(Kt.replaceMove(S.lift(o.textEdit.range),o.textEdit.text))}let n=0,s=0;for(const[o,a]of i)o.pushStackElement(),o.pushEditOperations([],a,()=>[]),o.pushStackElement(),s+=1,n+=a.length;return{ariaSummary:_s(g0.bulkEditServiceSummary,n,s)}})}};aL=Nl([Xi(0,Bt)],aL);class q7{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}}let lL=class extends f0{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)}};lL=Nl([Xi(0,Dp),Xi(1,lt)],lL);class G7{constructor(){this._neverEmitter=new A,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class Z7 extends Mf{constructor(){super()}}class Y7 extends lz{constructor(){super(new az)}}let dL=class extends S0{constructor(e,t,i,n,s){super(e,t,i,n,s),this.configure({blockMouse:!1})}};dL=Nl([Xi(0,_r),Xi(1,ii),Xi(2,Lp),Xi(3,qt),Xi(4,Nt)],dL);et(bt,gP);et(QD,oL);et(ZR,rL);et(aO,cC);et(kp,q7);et(_r,K7);et(xp,U7);et(ii,dC);et(fa,nd);et(Ft,Z7);et(ds,I7);et(Ys,Y7);et(Bt,Nb);et(lx,I0);et(ke,iL);et(El,lC);et(Sr,H7);et(xs,yy);et(Zx,aL);et(lO,G7);et(Dn,nL);et(zn,Q0);et(Es,z0);et(ei,sL);et(qt,Vb);et(pa,Y0);et(Lp,lL);et(Is,k0);et(Cc,tL);et(Il,dL);et(pc,J0);var Ee;(function(r){const e=new zv;for(const[o,a]of qI())e.set(o,a);const t=new Mk(e,!0);e.set(ze,t);function i(o){const a=e.get(o);if(!a)throw new Error("Missing service "+o);return a instanceof qo?t.invokeFunction(l=>l.get(o)):a}r.get=i;let n=!1;function s(o){if(n)return t;n=!0;for(const[a,l]of qI())e.get(a)||e.set(a,l);for(const a in o)if(o.hasOwnProperty(a)){const l=Ge(a);e.get(l)instanceof qo&&e.set(l,o[a])}return t}r.initialize=s})(Ee||(Ee={}));var Ak=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Et=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}};let X7=0,FN=!1;function Q7(r){if(!r){if(FN)return;FN=!0}h3(r||document.body)}let zb=class extends kf{constructor(e,t,i,n,s,o,a,l,d,c,h,u){const g=Object.assign({},t);g.ariaLabel=g.ariaLabel||Lb.editorViewAccessibleLabel,g.ariaLabel=g.ariaLabel+";"+Lb.accessibilityHelpMessage,super(e,g,{},i,n,s,o,l,d,c,h,u),a instanceof Vb?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,Q7(g.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const n="DYNAMIC_"+ ++X7,s=ie.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,s),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addA
`);let o=t;return s!==-1&&(o=t.substring(0,s)),BN(r,t,e.createByFilepathOrFirstLine(n||null,o),n)}return BN(r,t,e.createById(i),n)}function BN(r,e,t,i){return r.createModel(e,t,i)}function J7(r,e,t){return Ee.initialize(t||{}).createInstance(cL,r,e)}function eG(r){return Ee.get(lt).onCodeEditorAdd(t=>{r(t)})}function tG(r,e,t){return Ee.initialize(t||{}).createInstance(hL,r,e)}function iG(r,e){return new x2(r,e)}function nG(r,e,t){const i=Ee.get(Ft),n=i.getLanguageIdByMimeType(e)||e;return fP(Ee.get(Bt),i,r,n,t)}function sG(r,e){const t=Ee.get(Ft);Ee.get(Bt).setMode(r,t.createById(e))}function oG(r,e,t){r&&Ee.get(fa).changeOne(e,r.uri,t)}function rG(r){return Ee.get(fa).read(r)}function aG(r){return Ee.get(fa).onMarkerChanged(r)}function lG(r){return Ee.get(Bt).getModel(r)}function dG(){return Ee.get(Bt).getModels()}function cG(r){return Ee.get(Bt).onModelAdded(r)}function hG(r){return Ee.get(Bt).onModelRemoved(r)}function uG(r){return Ee.get(Bt).onModelLanguageChanged(t=>{r({model:t.model,oldLanguage:t.oldLanguageId})})}function gG(r){return gz(Ee.get(Bt),Ee.get(qi),r)}function fG(r,e){const t=Ee.get(Ft),i=Ee.get(ds);return i.registerEditorContainer(r),ix.colorizeElement(i,t,r,e)}function pG(r,e,t){const i=Ee.get(Ft);return Ee.get(ds).registerEditorContainer(document.body),ix.colorize(i,r,e,t)}function mG(r,e,t=4){return Ee.get(ds).registerEditorContainer(document.body),ix.colorizeModelLine(r,e,t)}function _G(r){const e=Ot.get(r);return e||{getInitialState:()=>Hh,tokenize:(t,i,n)=>KR(r,n)}}function bG(r,e){Ot.getOrCreate(e);const t=_G(e),i=ra(r),n=[];let s=t.getInitialState();for(let o=0,a=i.length;o<a;o++){const l=i[o],d=t.tokenize(l,!0,s);n[o]=d.tokens,s=d.endState}return n}function vG(r,e){Ee.get(ds).defineTheme(r,e)}function CG(r){Ee.get(ds).setTheme(r)}function wG(){_y.clearAllFontInfos()}function SG(r,e){return Xe.registerCommand({id:r,handler:e})}function yG(){return{create:J7,onDidCreateEditor:eG,createDiffEditor:tG,createDiffNavigator:iG,createModel:nG,setModelLanguage:sG,setModelMarkers:oG,getModelMarkers:rG,onDidChangeMarkers:aG,getModels:dG,getModel:lG,onDidCreateModel:cG,onWillDisposeModel:hG,onDidChangeModelLanguage:uG,createWebWorker:gG,colorizeElement:fG,colorize:pG,colorizeModelLine:mG,tokenize:bG,defineTheme:vG,setTheme:CG,remeasureFonts:wG,registerCommand:SG,AccessibilitySupport:BV,ContentWidgetPositionPreference:WV,CursorChangeReason:VV,DefaultEndOfLine:HV,EditorAutoIndentStrategy:zV,EditorOption:$V,EndOfLinePreference:UV,EndOfLineSequence:jV,MinimapPosition:KV,MouseTargetType:qV,OverlayWidgetPositionPreference:GV,OverviewRulerLane:ZV,RenderLineNumbersType:YV,RenderMinimap:XV,ScrollbarVisibility:QV,ScrollType:JV,TextEditorCursorBlinkingStyle:eH,TextEditorCursorStyle:tH,TrackedRangeStickiness:iH,WrappingIndent:nH,InjectedTextCursorStops:sH,PositionAffinity:oH,ConfigurationChangedEvent:NR,BareFontInfo:fd,FontInfo:my,TextModelResolvedOptions:e_,FindMatch:bR,ApplyUpdateResult:xg,EditorType:fp,EditorOptions:Eo}}function LG(r,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!r(t))return!1;return!0}function Em(r,e){return typeof r=="boolean"?r:e}function WN(r,e){return typeof r=="string"?r:e}function DG(r){const e={};for(const t of r)e[t]=!0;return e}function VN(r,e=!1){e&&(r=r.map(function(i){return i.toLowerCase()}));const t=DG(r);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function uL(r,e){e=e.replace(/@@/g,"");let t=0,i;do i=!1,e=e.replace(/@(\w+)/g,function(s,o){i=!0;let a="";if(typeof r[o]=="string")a=r[o];else if(r[o]&&r[o]instanceof RegExp)a=r[o].source;else throw r[o]===void 0?St(r,"language definition does not contain attribute '"+o+"', used at: "+e):St(r,"attribute reference '"+o+"' must be a string, used at: "+e);return Yc(a)?"":"(?:"+a+")"}),t++;while(i&&t<5);e=e.replace(/\x01/g,"@");const n=(r.ignoreCase?"i":"")+(r.unicode?"u":"");return new RegExp(e,n)}function xG(r,e,t,i){if(i<0)return r;if(i<e.length)return e[i];if(i>=100){i=i-100;const n=t.split(".");if(n.unshift(t),i<n.length)r
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:Ka(t,a.open),close:Ka(t,a.close)});else throw St(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 EG=globalThis&&globalThis.__awaiter||function(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{d(i.next(c))}catch(h){o(h)}}function l(c){try{d(i.throw(c))}catch(h){o(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(r,e||[])).next())})};function TG(r){Xh.registerLanguage(r)}function NG(){let r=[];return r=r.concat(Xh.getLanguages()),r}function RG(r){return Ee.get(Ft).languageIdCodec.encodeLanguageId(r)}function MG(r,e){const i=Ee.get(Ft).onDidEncounterLanguage(n=>{n===r&&(i.dispose(),e())});return i}function AG(r,e){if(!Ee.get(Ft).isRegisteredLanguageId(r))throw new Error(`Cannot set configuration for unknown language ${r}`);return oi.register(r,e,100)}class OG{constructor(e,t){this._languageId=e,this._actual=t}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return $f.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 ov(n.tokens,n.endState)}}class $f{constructor(e,t,i,n){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=n}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let n=0;for(let s=0,o=e.length;s<o;s++){const a=e[s];let l=a.startIndex;s===0?l=0:l<n&&(l=n),i[s]=new M_(l,a.scopes,t),n=l}return i}static adaptTokenize(e,t,i,n){const s=t.tokenize(i,n),o=$f._toClassicTokens(s.tokens,e);let a;return s.endState.equals(n)?a=n:a=s.endState,new ED(o,a)}tokenize(e,t,i){return $f.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),n=this._standaloneThemeService.getColorTheme().tokenTheme,s=[];let o=0,a=0;for(let d=0,c=t.length;d<c;d++){const h=t[d],u=n.match(i,h.scopes);if(o>0&&s[o-1]===u)continue;let g=h.startIndex;d===0?g=0:g<a&&(g=a),s[o++]=g,s[o++]=u,a=g}const l=new Uint32Array(o);for(let d=0;d<o;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 o;return n.endState.equals(i)?o=i:o=n.endState,new ov(s,o)}}function PG(r){return typeof r.getInitialState=="function"}function FG(r){return"tokenizeEncoded"in r}function mP(r){return r&&typeof r.then=="function"}function BG(r){const e=Ee.get(ds);if(r){const t=[null];for(let i=1,n=r.length;i<n;i++)t[i]=F.fromHex(r[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function _P(r,e){return FG(e)?new OG(r,e):new $f(r,e,Ee.get(Ft),Ee.get(ds))}function Ok(r,e){const t={createTokenizationSupport:()=>EG(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?PG(i)?_P(r,i):new mp(Ee.get(Ft),Ee.get(ds),r,pP(r,i)):null})};return Ot.registerFactory(r,t)}function WG(r,e){if(!Ee.get(Ft).isRegisteredLanguageId(r))throw new Error(`Cannot set tokens provider for unknown language ${r}`);return mP(e)?Ok(r,{create:()=>e}):Ot.register(r,_P(r,e))}function VG(r,e){const t=i=>new mp(Ee.get(Ft),Ee.get(ds),r,pP(r,i));return mP(e)?Ok(r,{create:()=>e}):Ot.register(r,t(e))}function HG(r,e){return Ee.get(le).referenceProvider.register(r,e)}function zG(r,e){return Ee.get(le).renameProvider.register(r,e)}function $G(r,e){return Ee.get(le).signatureHelpProvider.register(r,e)}function UG(r,e){return Ee.get(le).hoverProvider.register(r,{provideHover:(i,n,s)=>{const o=i.getWordAtPosition(n);return Promise.resolve(e.provideHover(i,n,s)).then(a=>{if(a)return!a.range&&o&&(a.range=new S(n.lineNumber,o.startColumn,n.lineNumber,o.endColumn)),a.range||(a.range=new S(n.lineNumber,n.column,n.lin
${l||d}`:l||d;n(h)};return PW(()=>{const l=o(t.editorOptions);l.onDidChangeModelContent(()=>{e("update:modelValue",l.getValue())}),l.onDidBlurEditorText(()=>{e("blur")}),a()}),FW(()=>t.modelValue,l=>{var d;l!==((d=s())==null?void 0:d.getValue())&&a(l)}),(l,d)=>(BW(),WW(UW,null,[VW("div",{ref_key:"el",ref:i,class:"go-editor-area",style:HW({width:r.width,height:r.height})},null,4),zW($W(Cre))],64))}});const kae=jW(MZ,[["__scopeId","data-v-685236f8"]]);/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
2023-06-06 13:24:29 +08:00
*-----------------------------------------------------------------------------*/var AZ=Object.defineProperty,OZ=Object.getOwnPropertyDescriptor,PZ=Object.getOwnPropertyNames,FZ=Object.prototype.hasOwnProperty,BZ=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of PZ(e))!FZ.call(r,n)&&(t||n!=="default")&&AZ(r,n,{get:()=>e[n],enumerable:!(i=OZ(e,n))||i.enumerable});return r},wg={};BZ(wg,Rp);var DP={},vS={},xP=class{constructor(r){zt(this,"_languageId");zt(this,"_loadingTriggered");zt(this,"_lazyLoadPromise");zt(this,"_lazyLoadPromiseResolve");zt(this,"_lazyLoadPromiseReject");this._languageId=r,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(r){return vS[r]||(vS[r]=new xP(r)),vS[r]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,DP[this._languageId].loader().then(r=>this._lazyLoadPromiseResolve(r),r=>this._lazyLoadPromiseReject(r))),this._lazyLoadPromise}};function ue(r){const e=r.id;DP[e]=r,wg.languages.register(r);const t=xP.getOrCreate(e);wg.languages.registerTokensProviderFactory(e,{create:()=>Ac(this,null,function*(){return(yield t.load()).language})}),wg.languages.onLanguage(e,()=>Ac(this,null,function*(){const i=yield t.load();wg.languages.setLanguageConfiguration(e,i.conf)}))}ue({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>de(()=>import("./abap-77a14c14.js"),[],import.meta.url)});ue({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>de(()=>import("./apex-cf1d9eb5.js"),[],import.meta.url)});ue({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>de(()=>import("./azcli-a95010c9.js"),[],import.meta.url)});ue({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>de(()=>import("./bat-8c58a836.js"),[],import.meta.url)});ue({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>de(()=>import("./bicep-4bed18f6.js"),[],import.meta.url)});ue({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>de(()=>import("./cameligo-0f51c89b.js"),[],import.meta.url)});ue({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>de(()=>import("./clojure-01e3da3e.js"),[],import.meta.url)});ue({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>de(()=>import("./coffee-4ddce41a.js"),[],import.meta.url)});ue({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>de(()=>import("./cpp-313d1644.js"),[],import.meta.url)});ue({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>de(()=>import("./cpp-313d1644.js"),[],import.meta.url)});ue({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>de(()=>import("./csharp-b6341ee5.js"),[],import.meta.url)});ue({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>de(()=>import("./csp-dc3d4f56.js"),[],import.meta.url)});ue({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>de(()=>import("./css-5b4b9c57.js"),[],import.meta.url)});ue({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>de(()=>import("./dart-6ea6deb2.js"),[],import.meta.url)});ue({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>de(()=>import("./dockerfile-7d35970e.js"),[],import.meta.url)});ue({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>de(()=>import("./ecl-b20b9471.js"),[],import.meta.url)});ue({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>de(()=>import("./elixir-1d976b08.js"),[],import.meta.url)});ue({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>de(()=>import("./flow9-9da3058c.js"),[],import.meta.url)});ue({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#"
2023-06-06 11:55:37 +08:00
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
2023-06-06 13:24:29 +08:00
*-----------------------------------------------------------------------------*/var WZ=Object.defineProperty,VZ=Object.getOwnPropertyDescriptor,HZ=Object.getOwnPropertyNames,zZ=Object.prototype.hasOwnProperty,$Z=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of HZ(e))!zZ.call(r,n)&&(t||n!=="default")&&WZ(r,n,{get:()=>e[n],enumerable:!(i=VZ(e,n))||i.enumerable});return r},Ru={};$Z(Ru,Rp);var Wk=class{constructor(e,t,i){zt(this,"_onDidChange",new Ru.Emitter);zt(this,"_options");zt(this,"_modeConfiguration");zt(this,"_languageId");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)}},Vk={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}},Hk={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},kP=new Wk("css",Vk,Hk),IP=new Wk("scss",Vk,Hk),EP=new Wk("less",Vk,Hk);Ru.languages.css={cssDefaults:kP,lessDefaults:EP,scssDefaults:IP};function zk(){return de(()=>import("./cssMode-2c4825fd.js"),["./cssMode-2c4825fd.js","./index-4ec2ce15.js","../css/index-9c2eb289.css","./editorWorker-43a98755.js"],import.meta.url)}Ru.languages.onLanguage("less",()=>{zk().then(r=>r.setupMode(EP))});Ru.languages.onLanguage("scss",()=>{zk().then(r=>r.setupMode(IP))});Ru.languages.onLanguage("css",()=>{zk().then(r=>r.setupMode(kP))});/*!-----------------------------------------------------------------------------
2023-06-06 11:55:37 +08:00
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
2023-06-06 13:24:29 +08:00
*-----------------------------------------------------------------------------*/var UZ=Object.defineProperty,jZ=Object.getOwnPropertyDescriptor,KZ=Object.getOwnPropertyNames,qZ=Object.prototype.hasOwnProperty,GZ=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of KZ(e))!qZ.call(r,n)&&(t||n!=="default")&&UZ(r,n,{get:()=>e[n],enumerable:!(i=jZ(e,n))||i.enumerable});return r},hC={};GZ(hC,Rp);var ZZ=class{constructor(e,t,i){zt(this,"_onDidChange",new hC.Emitter);zt(this,"_options");zt(this,"_modeConfiguration");zt(this,"_languageId");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)}},YZ={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"},uC={format:YZ,suggest:{},data:{useDefaultDataProvider:!0}};function gC(r){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:r===Xg,documentFormattingEdits:r===Xg,documentRangeFormattingEdits:r===Xg}}var Xg="html",HN="handlebars",zN="razor",TP=fC(Xg,uC,gC(Xg)),XZ=TP.defaults,NP=fC(HN,uC,gC(HN)),QZ=NP.defaults,RP=fC(zN,uC,gC(zN)),JZ=RP.defaults;hC.languages.html={htmlDefaults:XZ,razorDefaults:JZ,handlebarDefaults:QZ,htmlLanguageService:TP,handlebarLanguageService:NP,razorLanguageService:RP,registerHTMLLanguageService:fC};function eY(){return de(()=>import("./htmlMode-c8355c7d.js"),["./htmlMode-c8355c7d.js","./index-4ec2ce15.js","../css/index-9c2eb289.css","./editorWorker-43a98755.js"],import.meta.url)}function fC(r,e=uC,t=gC(r)){const i=new ZZ(r,e,t);let n;const s=hC.languages.onLanguage(r,()=>Ac(this,null,function*(){n=(yield eY()).setupMode(i)}));return{defaults:i,dispose(){s.dispose(),n==null||n.dispose(),n=void 0}}}/*!-----------------------------------------------------------------------------
2023-06-06 11:55:37 +08:00
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
2023-06-06 13:24:29 +08:00
*-----------------------------------------------------------------------------*/var tY=Object.defineProperty,iY=Object.getOwnPropertyDescriptor,nY=Object.getOwnPropertyNames,sY=Object.prototype.hasOwnProperty,oY=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of nY(e))!sY.call(r,n)&&(t||n!=="default")&&tY(r,n,{get:()=>e[n],enumerable:!(i=iY(e,n))||i.enumerable});return r},Mp={};oY(Mp,Rp);var rY=class{constructor(e,t,i){zt(this,"_onDidChange",new Mp.Emitter);zt(this,"_diagnosticsOptions");zt(this,"_modeConfiguration");zt(this,"_languageId");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)}},aY={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},lY={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},MP=new rY("json",aY,lY);Mp.languages.json={jsonDefaults:MP};function dY(){return de(()=>import("./jsonMode-39dee7e4.js"),["./jsonMode-39dee7e4.js","./index-4ec2ce15.js","../css/index-9c2eb289.css","./editorWorker-43a98755.js"],import.meta.url)}Mp.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});Mp.languages.onLanguage("json",()=>{dY().then(r=>r.setupMode(MP))});/*!-----------------------------------------------------------------------------
2023-06-06 11:55:37 +08:00
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.33.0(4b1abad427e58dbedc1215d99a0902ffc885fcd4)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
2023-06-06 13:24:29 +08:00
*-----------------------------------------------------------------------------*/var cY=Object.defineProperty,hY=Object.getOwnPropertyDescriptor,uY=Object.getOwnPropertyNames,gY=Object.prototype.hasOwnProperty,fY=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of uY(e))!gY.call(r,n)&&(t||n!=="default")&&cY(r,n,{get:()=>e[n],enumerable:!(i=hY(e,n))||i.enumerable});return r},pY="4.5.5",ru={};fY(ru,Rp);var AP=(r=>(r[r.None=0]="None",r[r.CommonJS=1]="CommonJS",r[r.AMD=2]="AMD",r[r.UMD=3]="UMD",r[r.System=4]="System",r[r.ES2015=5]="ES2015",r[r.ESNext=99]="ESNext",r))(AP||{}),OP=(r=>(r[r.None=0]="None",r[r.Preserve=1]="Preserve",r[r.React=2]="React",r[r.ReactNative=3]="ReactNative",r[r.ReactJSX=4]="ReactJSX",r[r.ReactJSXDev=5]="ReactJSXDev",r))(OP||{}),PP=(r=>(r[r.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",r[r.LineFeed=1]="LineFeed",r))(PP||{}),FP=(r=>(r[r.ES3=0]="ES3",r[r.ES5=1]="ES5",r[r.ES2015=2]="ES2015",r[r.ES2016=3]="ES2016",r[r.ES2017=4]="ES2017",r[r.ES2018=5]="ES2018",r[r.ES2019=6]="ES2019",r[r.ES2020=7]="ES2020",r[r.ESNext=99]="ESNext",r[r.JSON=100]="JSON",r[r.Latest=99]="Latest",r))(FP||{}),BP=(r=>(r[r.Classic=1]="Classic",r[r.NodeJs=2]="NodeJs",r))(BP||{}),WP=class{constructor(r,e,t,i){zt(this,"_onDidChange",new ru.Emitter);zt(this,"_onDidExtraLibsChange",new ru.Emitter);zt(this,"_extraLibs");zt(this,"_removedExtraLibs");zt(this,"_eagerModelSync");zt(this,"_compilerOptions");zt(this,"_diagnosticsOptions");zt(this,"_workerOptions");zt(this,"_onDidExtraLibsChangeTimeout");zt(this,"_inlayHintsOptions");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(r),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(r,e){let t;if(typeof e=="undefined"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===r)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:r,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(r){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),r&&r.length>0)for(const e of r){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(r){this._compilerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(r){this._workerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(r){this._inlayHintsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(r){}setEagerModelSync(r){this._eagerModelSync=r}getEagerModelSync(){return this._eagerModelSync}},mY=pY,VP=new WP({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{}),HP=new WP({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible
2023-06-06 11:55:37 +08:00
.monaco-editor .contentWidgets ${ne.lightBulb.cssSelector} {
color: ${n};
background-color: ${i};
}`);const s=r.getColor(b$);s&&e.addRule(`
.monaco-editor .contentWidgets ${ne.lightbulbAutofix.cssSelector} {
color: ${s};
background-color: ${i};
}`)});var XY=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},QY=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}},SS=globalThis&&globalThis.__awaiter||function(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{d(i.next(c))}catch(h){o(h)}}function l(c){try{d(i.throw(c))}catch(h){o(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(r,e||[])).next())})},JY=globalThis&&globalThis.__classPrivateFieldSet||function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},eX=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},S_;let bL=class extends V{constructor(e,t,i,n,s){super(),this._editor=e,this.delegate=n,this._activeCodeActions=this._register(new an),S_.set(this,!1),this._codeActionWidget=new O_(()=>this._register(s.createInstance(_L,this._editor,{onSelectCodeAction:o=>SS(this,void 0,void 0,function*(){this.delegate.applyCodeAction(o,!0)})}))),this._lightBulbWidget=new O_(()=>{const o=this._register(s.createInstance($b,this._editor,t,i));return this._register(o.onClick(a=>this.showCodeActionList(a.trigger,a.actions,a,{includeDisabledActions:!1}))),o})}dispose(){JY(this,S_,!0,"f"),super.dispose()}update(e){var t,i,n,s,o;return SS(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let a;try{a=yield e.actions}catch(l){Te(l);return}if(!eX(this,S_,"f"))if(this._lightBulbWidget.getValue().update(a,e.trigger,e.position),e.trigger.type===1){if(!((i=e.trigger.filter)===null||i===void 0)&&i.include){const d=this.tryGetValidActionToApply(e.trigger,a);if(d){try{this._lightBulbWidget.getValue().hide(),yield this.delegate.applyCodeAction(d,!1)}finally{a.dispose()}return}if(e.trigger.context){const c=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,a);if(c&&c.action.disabled){(n=ls.get(this._editor))===null||n===void 0||n.showMessage(c.action.disabled,e.trigger.context.position),a.dispose();return}}}const l=!!(!((s=e.trigger.filter)===null||s===void 0)&&s.include);if(e.trigger.context&&(!a.allActions.length||!l&&!a.validActions.length)){(o=ls.get(this._editor))===null||o===void 0||o.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=a,a.dispose();return}this._activeCodeActions.value=a,this._codeActionWidget.getValue().show(e.trigger,a,e.position,{includeDisabledActions:l})}else this._codeActionWidget.getValue().isVisible?a.dispose():this._activeCodeActions.value=a})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,i,n){return SS(this,void 0,void 0,function*(){this._codeActionWidget.getValue().show(e,t,i,n)})}};S_=new WeakMap;bL=XY([QY(4,ze)],bL);var yS=globalThis&&globalThis.__classPrivateFieldGet||function(r,e,t,i){if(t==="a"
.monaco-editor .codelens-decoration.${this._styleClassName} { line-height: ${e}px; font-size: ${t}px; padding-right: ${Math.round(t*.5)}px; font-feature-settings: var(${o}) }
.monaco-editor .codelens-decoration.${this._styleClassName} span.codicon { line-height: ${e}px; font-size: ${t}px; }
`;i&&(a+=`.monaco-editor .codelens-decoration.${this._styleClassName} { font-family: var(${s}), ${Qi.fontFamily}}`),this._styleElement.textContent=a,this._editor.getContainerDomNode().style.setProperty(s,i!=null?i:"inherit"),this._editor.getContainerDomNode().style.setProperty(o,n.fontFeatureSettings),this._editor.changeViewZones(l=>{for(let d of this._lenses)d.updateHeight(e,l)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(14))return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add(Nd(()=>{const n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const n of this._languageFeaturesService.codeLensProvider.all(e))if(typeof n.onDidChange=="function"){let s=n.onDidChange(()=>i.schedule());this._localToDispose.add(s)}const i=new gt(()=>{var n;const s=Date.now();(n=this._getCodeLensModelPromise)===null||n===void 0||n.cancel(),this._getCodeLensModelPromise=Ii(o=>tF(this._languageFeaturesService.codeLensProvider,e,o)),this._getCodeLensModelPromise.then(o=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=o,this._codeLensCache.put(e,o);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(o),this._resolveCodeLensesInViewportSoon()},Te)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Ue(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(n=>{this._editor.changeViewZones(s=>{let o=[],a=-1;this._lenses.forEach(d=>{!d.isValid()||a===d.getLineNumber()?o.push(d):(d.update(s),a=d.getLineNumber())});let l=new LS;o.forEach(d=>{d.dispose(l,s),this._lenses.splice(this._lenses.indexOf(d),1)}),l.commit(n)})}),i.schedule()})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidScrollChange(n=>{n.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Ue(()=>{if(this._editor.getModel()){const n=ml.capture(this._editor);this._editor.changeDecorations(s=>{this._editor.changeViewZones(o=>{this._disposeAllLenses(s,o)})}),n.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(n=>{if(n.target.type!==9)return;let s=n.target.element;if((s==null?void 0:s.tagName)==="SPAN"&&(s=s.parentElement),(s==null?void 0:s.tagName)==="A")for(const o of this._lenses){let a=o.getCommand(s);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new LS;for(const n of this._lenses)n.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t=this._editor.getModel().getLineCount(),i=[],n;for(let a of e.lenses){let l=a.symbol.range.startLineNumber;l<1||l>t||(n&&n[n.length-1].symbol.range.startLineNumber===l?n.push(a):(n=[a],i.push(n)))}const s=ml.capture(this._editor),o=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const d=new LS;let c=0,h=0;for(;h<i.length&&c<this._lenses.length;){let u=i[h][0].symbol.range.startLineNumber,g=this._lenses[c].getLineNumber();g<u?(this._lenses[c].dispose(d,l),this._lenses.splice(c,1)):g===u?(this._lenses[c].updateCodeLensSymbols(i[h
[${Yx.modifierLabels[fs].altKey}] ${l}`}this.label.title=n}}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){var t;this._itemClassDispose.value=void 0;const{element:i,label:n}=this;if(!i||!n)return;const s=this._commandAction.checked&&(!((t=e.toggled)===null||t===void 0)&&t.icon)?e.toggled.icon:e.icon;if(s)if(_t.isThemeIcon(s)){const o=_t.asClassNameArray(s);n.classList.add(...o),this._itemClassDispose.value=Ue(()=>{n.classList.remove(...o)})}else s.light&&n.style.setProperty("--menu-entry-icon-light",Md(s.light)),s.dark&&n.style.setProperty("--menu-entry-icon-dark",Md(s.dark)),n.classList.add("icon"),this._itemClassDispose.value=Ue(()=>{n.classList.remove("icon"),n.style.removeProperty("--menu-entry-icon-light"),n.style.removeProperty("--menu-entry-icon-dark")})}};lu=Xk([Yo(2,qt),Yo(3,ii),Yo(4,ke)],lu);let yL=class extends rF{constructor(e,t,i){var n,s;const o=Object.assign({},t!=null?t:Object.create(null),{menuAsChild:(n=t==null?void 0:t.menuAsChild)!==null&&n!==void 0?n:!1,classNames:(s=t==null?void 0:t.classNames)!==null&&s!==void 0?s:_t.isThemeIcon(e.item.icon)?_t.asClassName(e.item.icon):void 0});super(e,{getActions:()=>e.actions},i,o)}render(e){if(super.render(e),this.element){e.classList.add("menu-entry");const{icon:t}=this._action.item;t&&!_t.isThemeIcon(t)&&(this.element.classList.add("icon"),t.light&&this.element.style.setProperty("--menu-entry-icon-light",Md(t.light)),t.dark&&this.element.style.setProperty("--menu-entry-icon-dark",Md(t.dark)))}}};yL=Xk([Yo(2,Il)],yL);let LL=class extends Zo{constructor(e,t,i,n,s,o,a,l){var d,c,h;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=o,this._instaService=a,this._storageService=l,this._container=null,this._storageKey=`${e.item.submenu._debugName}_lastActionId`;let u,g=l.get(this._storageKey,1);g&&(u=e.actions.find(m=>g===m.id)),u||(u=e.actions[0]),this._defaultAction=this._instaService.createInstance(lu,u,void 0);const p=Object.assign({},t!=null?t:Object.create(null),{menuAsChild:(d=t==null?void 0:t.menuAsChild)!==null&&d!==void 0?d:!0,classNames:(c=t==null?void 0:t.classNames)!==null&&c!==void 0?c:["codicon","codicon-chevron-down"],actionRunner:(h=t==null?void 0:t.actionRunner)!==null&&h!==void 0?h:new Uh});this._dropdown=new rF(e,e.actions,this._contextMenuService,p),this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof hl&&this.update(m.action)})}update(e){this._storageService.store(this._storageKey,e.id,1,0),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(lu,e,void 0),this._defaultAction.actionRunner=new class extends Uh{runAction(t,i){return aF(this,void 0,void 0,function*(){yield t.run(void 0)})}},this._container&&this._defaultAction.render(r3(this._container,q(".action-container")))}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=q(".action-container");this._defaultAction.render($(this._container,t)),this._register(Z(t,_e.KEY_DOWN,n=>{const s=new Tt(n);s.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),s.stopPropagation())}));const i=q(".dropdown-action-container");this._dropdown.render($(this._container,i)),this._register(Z(i,_e.KEY_DOWN,n=>{var s;const o=new Tt(n);o.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(s=this._defaultAction.element)===null||s===void 0||s.focus(),o.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,t
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{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(j){e.defaults=j}var d=/[&<>"']/,c=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},p=function(H){return g[H]};function m(j,H){if(H){if(d.test(j))return j.replace(c,p)}else if(h.test(j))return j.replace(u,p);return j}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function b(j){return j.replace(_,function(H,z){return z=z.toLowerCase(),z==="colon"?":":z.charAt(0)==="#"?z.charAt(1)==="x"?String.fromCharCode(parseInt(z.substring(2),16)):String.fromCharCode(+z.substring(1)):""})}var v=/(^|[^\[])\^/g;function C(j,H){j=j.source||j,H=H||"";var z={replace:function(T,O){return O=O.source||O,O=O.replace(v,"$1"),j=j.replace(T,O),z},getRegex:function(){return new RegExp(j,H)}};return z}var w=/[^\w:]/g,L=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(j,H,z){if(j){var x;try{x=decodeURIComponent(b(z)).replace(w,"").toLowerCase()}catch(T){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}H&&!L.test(z)&&(z=B(H,z));try{z=encodeURI(z).replace(/%25/g,"%")}catch(T){return null}return z}var y={},D=/^[^:]+:\/*[^/]*$/,R=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function B(j,H){y[" "+j]||(D.test(j)?y[" "+j]=j+"/":y[" "+j]=ce(j,"/",!0)),j=y[" "+j];var z=j.indexOf(":")===-1;return H.substring(0,2)==="//"?z?H:j.replace(R,"$1")+H:H.charAt(0)==="/"?z?H:j.replace(W,"$1")+H:j+H}var te={exec:function(){}};function K(j){for(var H=1,z,x;H<arguments.length;H++){z=arguments[H];for(x in z)Object.prototype.hasOwnProperty.call(z,x)&&(j[x]=z[x])}return j}function he(j,H){var z=j.replace(/\|/g,function(O,M,G){for(var ee=!1,Ce=M;--Ce>=0&&G[Ce]==="\\";)ee=!ee;return ee?"|":" |"}),x=z.split(/ \|/),T=0;if(x[0].trim()||x.shift(),x[x.length-1].trim()||x.pop(),x.length>H)x.splice(H);else for(;x.length<H;)x.push("");for(;T<x.length;T++)x[T]=x[T].trim().replace(/\\\|/g,"|");return x}function ce(j,H,z){var x=j.length;if(x===0)return"";for(var T=0;T<x;){var O=j.charAt(x-T-1);if(O===H&&!z)T++;else if(O!==H&&z)T++;else break}return j.substr(0,x-T)}function we(j,H){if(j.indexOf(H[1])===-1)return-1;for(var z=j.length,x=0,T=0;T<z;T++)if(j[T]==="\\")T++;else if(j[T]===H[0])x++;else if(j[T]===H[1]&&(x--,x<0))return T;return-1}function Ie(j){j&&j.sanitize&&!j.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 Le(j,H){if(H<1)return"";for(var z="";H>1;)H&1&&(z+=j),H>>=1,j+=j;return z+j}function Pe(j,H,z,x){var T=H.href,O=H.title?m(H.title):null,M=j[1].replace(/\\([\[\]])/g,"$1");if(j[0].charAt(0)!=="!"){x.state.inLink=!0;var G={type:"link",raw:z,href:T,title:O,text:M,tokens:x.inlineTokens(M,[])};return x.state.inLink=!1,G}else return{type:"image",raw:z,href:T,title:O,text:m(M)}}function Wt(j,H){var z=j.match(/^(\s+)(?:```)/);if(z===null)return H;var x=z[1];return H.split(`
`).map(function(T){var O=T.match(/^\s+/);if(O===null)return T;var M=O[0];return M.length>=x.length?T.slice(x.length):T}).join(`
`)}var Ct=function(){function j(z){this.options=z||e.defaults}var H=j.prototype;return H.space=function(x){var T=this.rules.block.newline.exec(x);if(T&&T[0].length>0)return{type:"space",raw:T[0]}},H.code=function(x){var T=this.rules.block.code.exec(x);if(T){var O=T[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:T[0],codeBlockStyle:"indented",text:this.options.pedantic?O:ce(O,`
`)}}},H.fences=function(x){var T=this.rules.block.fences.exec(x);if(T){var O=T[0],M=Wt(O,T[3]||"");return{type:"code",raw:O,lang:T[2]?T[2].trim():T[2],text:M}}},H.heading=function(x){var T=this.rules.block.heading.exec(x);if(T){var O=T[2].trim();if(/#$/.test(O)){var M=ce(O,"#");(this.options.pedantic||!M||/ $/.test(M))&&(O=M.trim())}var G={type:"heading",raw:T[0],depth:T[1].length,text:O,tokens:[]};return this.lexer.inline(G.text,G.tokens),G}},H.hr=function(x){var T=this.rules.block.hr.exec(x);if(T)return{type:"hr",raw:T[0]}},H.blockquote=function(x){var T=this.rules.block.blockquote.exec(x);if(T){var O=T[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:T[0],tokens:this.lexer.blockTokens(O,[]),text:O}}},H.list=function(x){var T=this.rules.block.list.exec(x);if(T){var O,M,G,ee,Ce,be,Fe,Be,kt,ot,ye,li,Gt=T[1].trim(),cs=Gt.length>1,Vt={type:"list",raw:"",ordered:cs,start:cs?+Gt.slice(0,-1):"",loose:!1,items:[]};Gt=cs?"\\d{1,9}\\"+Gt.slice(-1):"\\"+Gt,this.options.pedantic&&(Gt=cs?Gt:"[*+-]");for(var Si=new RegExp("^( {0,3}"+Gt+")((?: [^\\n]*)?(?:\\n|$))");x&&(li=!1,!(!(T=Si.exec(x))||this.rules.block.hr.test(x)));){if(O=T[0],x=x.substring(O.length),Be=T[2].split(`
`,1)[0],kt=x.split(`
`,1)[0],this.options.pedantic?(ee=2,ye=Be.trimLeft()):(ee=T[2].search(/[^ ]/),ee=ee>4?1:ee,ye=Be.slice(ee),ee+=T[1].length),be=!1,!Be&&/^ *$/.test(kt)&&(O+=kt+`
`,x=x.substring(kt.length+1),li=!0),!li)for(var Fl=new RegExp("^ {0,"+Math.min(3,ee-1)+"}(?:[*+-]|\\d{1,9}[.)])");x&&(ot=x.split(`
`,1)[0],Be=ot,this.options.pedantic&&(Be=Be.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!Fl.test(Be));){if(Be.search(/[^ ]/)>=ee||!Be.trim())ye+=`
`+Be.slice(ee);else if(!be)ye+=`
`+Be;else break;!be&&!Be.trim()&&(be=!0),O+=ot+`
`,x=x.substring(ot.length+1)}Vt.loose||(Fe?Vt.loose=!0:/\n *\n *$/.test(O)&&(Fe=!0)),this.options.gfm&&(M=/^\[[ xX]\] /.exec(ye),M&&(G=M[0]!=="[ ] ",ye=ye.replace(/^\[[ xX]\] +/,""))),Vt.items.push({type:"list_item",raw:O,task:!!M,checked:G,loose:!1,text:ye}),Vt.raw+=O}Vt.items[Vt.items.length-1].raw=O.trimRight(),Vt.items[Vt.items.length-1].text=ye.trimRight(),Vt.raw=Vt.raw.trimRight();var Un=Vt.items.length;for(Ce=0;Ce<Un;Ce++){this.lexer.state.top=!1,Vt.items[Ce].tokens=this.lexer.blockTokens(Vt.items[Ce].text,[]);var Js=Vt.items[Ce].tokens.filter(function(Lr){return Lr.type==="space"}),ba=Js.every(function(Lr){for(var Mc=Lr.raw.split(""),va=0,eo=o(Mc),$u;!($u=eo()).done;){var Kp=$u.value;if(Kp===`
`&&(va+=1),va>1)return!0}return!1});!Vt.loose&&Js.length&&ba&&(Vt.loose=!0,Vt.items[Ce].loose=!0)}return Vt}},H.html=function(x){var T=this.rules.block.html.exec(x);if(T){var O={type:"html",raw:T[0],pre:!this.options.sanitizer&&(T[1]==="pre"||T[1]==="script"||T[1]==="style"),text:T[0]};return this.options.sanitize&&(O.type="paragraph",O.text=this.options.sanitizer?this.options.sanitizer(T[0]):m(T[0]),O.tokens=[],this.lexer.inline(O.text,O.tokens)),O}},H.def=function(x){var T=this.rules.block.def.exec(x);if(T){T[3]&&(T[3]=T[3].substring(1,T[3].length-1));var O=T[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:O,raw:T[0],href:T[2],title:T[3]}}},H.table=function(x){var T=this.rules.block.table.exec(x);if(T){var O={type:"table",header:he(T[1]).map(function(Fe){return{text:Fe}}),align:T[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:T[3]?T[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(O.header.length===O.align.length){O.raw=T[0];var M=O.align.length,G,ee,Ce,be;for(G=0;G<M;G++)/^ *-+: *$/.test(O.align[G])?O.align[G]="right":/^ *:-+: *$/.test(O.align[G])?O.align[G]="center":/^ *:-+ *$/.test(O.align[G])?O.align[G]="left":O.align[G]=null;for(M=O.rows.length,G=0;G<M;G++)O.rows[G]=he(O.rows[G],O.header.length).map(function(Fe){return{text:Fe}});for(M=O.header.length,ee=0;ee<M;ee++)O.header[ee].tokens=[],this.lexer.inlineTokens(O.header[ee].text,O.header[ee].tokens);for(M=O.rows.length,ee=0;ee<M;ee++)for(be=O.rows[ee],Ce=0;Ce<be.length;Ce++)be[Ce].tokens=[],this.lexer.inlineTokens(be[Ce].text,be[Ce].tokens);return O}}},H.lheading=function(x){var T=this.rules.block.lheading.exec(x);if(T){var O={type:"heading",raw:T[0],depth:T[2].charAt(0)==="="?1:2,text:T[1],tokens:[]};return this.lexer.inline(O.text,O.tokens),O}},H.paragraph=function(x){var T=this.rules.block.paragraph.exec(x);if(T){var O={type:"paragraph",raw:T[0],text:T[1].charAt(T[1].length-1)===`
`?T[1].slice(0,-1):T[1],tokens:[]};return this.lexer.inline(O.text,O.tokens),O}},H.text=function(x){var T=this.rules.block.text.exec(x);if(T){var O={type:"text",raw:T[0],text:T[0],tokens:[]};return this.lexer.inline(O.text,O.tokens),O}},H.escape=function(x){var T=this.rules.inline.escape.exec(x);if(T)return{type:"escape",raw:T[0],text:m(T[1])}},H.tag=function(x){var T=this.rules.inline.tag.exec(x);if(T)return!this.lexer.state.inLink&&/^<a /i.test(T[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(T[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(T[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(T[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:T[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):m(T[0]):T[0]}},H.link=function(x){var T=this.rules.inline.link.exec(x);if(T){var O=T[2].trim();if(!this.options.pedantic&&/^</.test(O)){if(!/>$/.test(O))return;var M=ce(O.slice(0,-1),"\\");if((O.length-M.length)%2===0)return}else{var G=we(T[2],"()");if(G>-1){var ee=T[0].indexOf("!")===0?5:4,Ce=ee+T[1].length+G;T[2]=T[2].substring(0,G),T[0]=T[0].substring(0,Ce).trim(),T[3]=""}}var be=T[2],Fe="";if(this.options.pedantic){var Be=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(be);Be&&(be=Be[1],Fe=Be[3])}else Fe=T[3]?T[3].slice(1,-1):"";return be=be.trim(),/^</.test(be)&&(this.options.pedantic&&!/>$/.test(O)?be=be.slice(1):be=be.slice(1,-1)),Pe(T,{href:be&&be.replace(this.rules.inline._escapes,"$1"),title:Fe&&Fe.replace(this.rules.inline._escapes,"$1")},T[0],this.lexer)}},H.reflink=function(x,T){var O;if((O=this.rules.inline.reflink.exec(x))||(O=this.rules.inline.nolink.exec(x))){var M=(O[2]||O[1]).replace(/\s+/g," ");if(M=T[M.toLowerCase()],!M||!M.href){var G=O[0].charAt(0);return{type:"text",raw:G,text:G}}return Pe(O,M,O[0],this.lexer)}},H.emStrong=function(x,T,O){O===void 0&&(O="");var M=this.rules.inline.emStrong.lDelim.exec(x);if(M&&!(M[3]&&O.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-\u
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var fe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:te,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:te,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};fe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",fe.punctuation=C(fe.punctuation).replace(/punctuation/g,fe._punctuation).getRegex(),fe.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,fe.escapedEmSt=/\\\*|\\_/g,fe._comment=C(pe._comment).replace("(?:-->|$)","-->").getRegex(),fe.emStrong.lDelim=C(fe.emStrong.lDelim).replace(/punct/g,fe._punctuation).getRegex(),fe.emStrong.rDelimAst=C(fe.emStrong.rDelimAst,"g").replace(/punct/g,fe._punctuation).getRegex(),fe.emStrong.rDelimUnd=C(fe.emStrong.rDelimUnd,"g").replace(/punct/g,fe._punctuation).getRegex(),fe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,fe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,fe._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])?)+(?![-_])/,fe.autolink=C(fe.autolink).replace("scheme",fe._scheme).replace("email",fe._email).getRegex(),fe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,fe.tag=C(fe.tag).replace("comment",fe._comment).replace("attribute",fe._attribute).getRegex(),fe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,fe._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,fe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,fe.link=C(fe.link).replace("label",fe._label).replace("href",fe._href).replace("title",fe._title).getRegex(),fe.reflink=C(fe.reflink).replace("label",fe._label).replace("ref",pe._label).getRegex(),fe.nolink=C(fe.nolink).replace("ref",pe._label).getRegex(),fe.reflinkSearch=C(fe.reflinkSearch,"g").replace("reflink",fe.reflink).replace("nolink",fe.nolink).getRegex(),fe.normal=K({},fe),fe.pedantic=K({},fe.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",fe._label).getRegex(),reflink:C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",fe._label).getRegex()}),fe.gfm=K({},fe.normal,{escape:C(fe.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),fe.gfm.url=C(fe.gfm.url,"i").replace("email",fe.gfm._extended_email).getRegex(),fe.breaks=K({},fe.gfm,{br:C(fe.br).replace("{2,}","
`).replace(/\t/g," "),this.blockTokens(x,this.tokens);for(var T;T=this.inlineQueue.shift();)this.inlineTokens(T.src,T.tokens);return this.tokens},H.blockTokens=function(x,T){var O=this;T===void 0&&(T=[]),this.options.pedantic&&(x=x.replace(/^ +$/gm,""));for(var M,G,ee,Ce;x;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Fe){return(M=Fe.call({lexer:O},x,T))?(x=x.substring(M.raw.length),T.push(M),!0):!1}))){if(M=this.tokenizer.space(x)){x=x.substring(M.raw.length),M.raw.length===1&&T.length>0?T[T.length-1].raw+=`
`:T.push(M);continue}if(M=this.tokenizer.code(x)){x=x.substring(M.raw.length),G=T[T.length-1],G&&(G.type==="paragraph"||G.type==="text")?(G.raw+=`
`+M.raw,G.text+=`
`+M.text,this.inlineQueue[this.inlineQueue.length-1].src=G.text):T.push(M);continue}if(M=this.tokenizer.fences(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.heading(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.hr(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.blockquote(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.list(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.html(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.def(x)){x=x.substring(M.raw.length),G=T[T.length-1],G&&(G.type==="paragraph"||G.type==="text")?(G.raw+=`
`+M.raw,G.text+=`
`+M.raw,this.inlineQueue[this.inlineQueue.length-1].src=G.text):this.tokens.links[M.tag]||(this.tokens.links[M.tag]={href:M.href,title:M.title});continue}if(M=this.tokenizer.table(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.lheading(x)){x=x.substring(M.raw.length),T.push(M);continue}if(ee=x,this.options.extensions&&this.options.extensions.startBlock&&function(){var Fe=1/0,Be=x.slice(1),kt=void 0;O.options.extensions.startBlock.forEach(function(ot){kt=ot.call({lexer:this},Be),typeof kt=="number"&&kt>=0&&(Fe=Math.min(Fe,kt))}),Fe<1/0&&Fe>=0&&(ee=x.substring(0,Fe+1))}(),this.state.top&&(M=this.tokenizer.paragraph(ee))){G=T[T.length-1],Ce&&G.type==="paragraph"?(G.raw+=`
`+M.raw,G.text+=`
`+M.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=G.text):T.push(M),Ce=ee.length!==x.length,x=x.substring(M.raw.length);continue}if(M=this.tokenizer.text(x)){x=x.substring(M.raw.length),G=T[T.length-1],G&&G.type==="text"?(G.raw+=`
`+M.raw,G.text+=`
`+M.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=G.text):T.push(M);continue}if(x){var be="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(be);break}else throw new Error(be)}}return this.state.top=!0,T},H.inline=function(x,T){this.inlineQueue.push({src:x,tokens:T})},H.inlineTokens=function(x,T){var O=this;T===void 0&&(T=[]);var M,G,ee,Ce=x,be,Fe,Be;if(this.tokens.links){var kt=Object.keys(this.tokens.links);if(kt.length>0)for(;(be=this.tokenizer.rules.inline.reflinkSearch.exec(Ce))!=null;)kt.includes(be[0].slice(be[0].lastIndexOf("[")+1,-1))&&(Ce=Ce.slice(0,be.index)+"["+Le("a",be[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(be=this.tokenizer.rules.inline.blockSkip.exec(Ce))!=null;)Ce=Ce.slice(0,be.index)+"["+Le("a",be[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(be=this.tokenizer.rules.inline.escapedEmSt.exec(Ce))!=null;)Ce=Ce.slice(0,be.index)+"++"+Ce.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;x;)if(Fe||(Be=""),Fe=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(ye){return(M=ye.call({lexer:O},x,T))?(x=x.substring(M.raw.length),T.push(M),!0):!1}))){if(M=this.tokenizer.escape(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.tag(x)){x=x.substring(M.raw.length),G=T[T.length-1],G&&M.type==="text"&&G.type==="text"?(G.raw+=M.raw,G.text+=M.text):T.push(M);continue}if(M=this.tokenizer.link(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.reflink(x,this.tokens.links)){x=x.substring(M.raw.length),G=T[T.length-1],G&&M.type==="text"&&G.type==="text"?(G.raw+=M.raw,G.text+=M.text):T.push(M);continue}if(M=this.tokenizer.emStrong(x,Ce,Be)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.codespan(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.br(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.del(x)){x=x.substring(M.raw.length),T.push(M);continue}if(M=this.tokenizer.autolink(x,kn)){x=x.substring(M.raw.length),T.push(M);continue}if(!this.state.inLink&&(M=this.tokenizer.url(x,kn))){x=x.substring(M.raw.length),T.push(M);continue}if(ee=x,this.options.extensions&&this.options.extensions.startInline&&function(){var ye=1/0,li=x.slice(1),Gt=void 0;O.options.extensions.startInline.forEach(function(cs){Gt=cs.call({lexer:this},li),typeof Gt=="number"&&Gt>=0&&(ye=Math.min(ye,Gt))}),ye<1/0&&ye>=0&&(ee=x.substring(0,ye+1))}(),M=this.tokenizer.inlineText(ee,ft)){x=x.substring(M.raw.length),M.raw.slice(-1)!=="_"&&(Be=M.raw.slice(-1)),Fe=!0,G=T[T.length-1],G&&G.type==="text"?(G.raw+=M.raw,G.text+=M.text):T.push(M);continue}if(x){var ot="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(ot);break}else throw new Error(ot)}}return T},i(j,null,[{key:"rules",get:function(){return{block:pe,inline:fe}}}]),j}(),Qs=function(){function j(z){this.options=z||e.defaults}var H=j.prototype;return H.code=function(x,T,O){var M=(T||"").match(/\S*/)[0];if(this.options.highlight){var G=this.options.highlight(x,M);G!=null&&G!==x&&(O=!0,x=G)}return x=x.replace(/\n$/,"")+`
`,M?'<pre><code class="'+this.options.langPrefix+m(M,!0)+'">'+(O?x:m(x,!0))+`</code></pre>
`:"<pre><code>"+(O?x:m(x,!0))+`</code></pre>
`},H.blockquote=function(x){return`<blockquote>
`+x+`</blockquote>
`},H.html=function(x){return x},H.heading=function(x,T,O,M){return this.options.headerIds?"<h"+T+' id="'+this.options.headerPrefix+M.slug(O)+'">'+x+"</h"+T+`>
`:"<h"+T+">"+x+"</h"+T+`>
`},H.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},H.list=function(x,T,O){var M=T?"ol":"ul",G=T&&O!==1?' start="'+O+'"':"";return"<"+M+G+`>
`+x+"</"+M+`>
`},H.listitem=function(x){return"<li>"+x+`</li>
`},H.checkbox=function(x){return"<input "+(x?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},H.paragraph=function(x){return"<p>"+x+`</p>
`},H.table=function(x,T){return T&&(T="<tbody>"+T+"</tbody>"),`<table>
<thead>
`+x+`</thead>
`+T+`</table>
`},H.tablerow=function(x){return`<tr>
`+x+`</tr>
`},H.tablecell=function(x,T){var O=T.header?"th":"td",M=T.align?"<"+O+' align="'+T.align+'">':"<"+O+">";return M+x+"</"+O+`>
`},H.strong=function(x){return"<strong>"+x+"</strong>"},H.em=function(x){return"<em>"+x+"</em>"},H.codespan=function(x){return"<code>"+x+"</code>"},H.br=function(){return this.options.xhtml?"<br/>":"<br>"},H.del=function(x){return"<del>"+x+"</del>"},H.link=function(x,T,O){if(x=E(this.options.sanitize,this.options.baseUrl,x),x===null)return O;var M='<a href="'+m(x)+'"';return T&&(M+=' title="'+T+'"'),M+=">"+O+"</a>",M},H.image=function(x,T,O){if(x=E(this.options.sanitize,this.options.baseUrl,x),x===null)return O;var M='<img src="'+x+'" alt="'+O+'"';return T&&(M+=' title="'+T+'"'),M+=this.options.xhtml?"/>":">",M},H.text=function(x){return x},j}(),Mo=function(){function j(){}var H=j.prototype;return H.strong=function(x){return x},H.em=function(x){return x},H.codespan=function(x){return x},H.del=function(x){return x},H.html=function(x){return x},H.text=function(x){return x},H.link=function(x,T,O){return""+O},H.image=function(x,T,O){return""+O},H.br=function(){return""},j}(),Pl=function(){function j(){this.seen={}}var H=j.prototype;return H.serialize=function(x){return x.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},H.getNextSafeSlug=function(x,T){var O=x,M=0;if(this.seen.hasOwnProperty(O)){M=this.seen[x];do M++,O=x+"-"+M;while(this.seen.hasOwnProperty(O))}return T||(this.seen[x]=M,this.seen[O]=0),O},H.slug=function(x,T){T===void 0&&(T={});var O=this.serialize(x);return this.getNextSafeSlug(O,T.dryrun)},j}(),Ao=function(){function j(z){this.options=z||e.defaults,this.options.renderer=this.options.renderer||new Qs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Mo,this.slugger=new Pl}j.parse=function(x,T){var O=new j(T);return O.parse(x)},j.parseInline=function(x,T){var O=new j(T);return O.parseInline(x)};var H=j.prototype;return H.parse=function(x,T){T===void 0&&(T=!0);var O="",M,G,ee,Ce,be,Fe,Be,kt,ot,ye,li,Gt,cs,Vt,Si,Fl,Un,Js,ba,Lr=x.length;for(M=0;M<Lr;M++){if(ye=x[M],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[ye.type]&&(ba=this.options.extensions.renderers[ye.type].call({parser:this},ye),ba!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(ye.type))){O+=ba||"";continue}switch(ye.type){case"space":continue;case"hr":{O+=this.renderer.hr();continue}case"heading":{O+=this.renderer.heading(this.parseInline(ye.tokens),ye.depth,b(this.parseInline(ye.tokens,this.textRenderer)),this.slugger);continue}case"code":{O+=this.renderer.code(ye.text,ye.lang,ye.escaped);continue}case"table":{for(kt="",Be="",Ce=ye.header.length,G=0;G<Ce;G++)Be+=this.renderer.tablecell(this.parseInline(ye.header[G].tokens),{header:!0,align:ye.align[G]});for(kt+=this.renderer.tablerow(Be),ot="",Ce=ye.rows.length,G=0;G<Ce;G++){for(Fe=ye.rows[G],Be="",be=Fe.length,ee=0;ee<be;ee++)Be+=this.renderer.tablecell(this.parseInline(Fe[ee].tokens),{header:!1,align:ye.align[ee]});ot+=this.renderer.tablerow(Be)}O+=this.renderer.table(kt,ot);continue}case"blockquote":{ot=this.parse(ye.tokens),O+=this.renderer.blockquote(ot);continue}case"list":{for(li=ye.ordered,Gt=ye.start,cs=ye.loose,Ce=ye.items.length,ot="",G=0;G<Ce;G++)Si=ye.items[G],Fl=Si.checked,Un=Si.task,Vt="",Si.task&&(Js=this.renderer.checkbox(Fl),cs?Si.tokens.length>0&&Si.tokens[0].type==="paragraph"?(Si.tokens[0].text=Js+" "+Si.tokens[0].text,Si.tokens[0].tokens&&Si.tokens[0].tokens.length>0&&Si.tokens[0].tokens[0].type==="text"&&(Si.tokens[0].tokens[0].text=Js+" "+Si.tokens[0].tokens[0].text)):Si.tokens.unshift({type:"text",text:Js}):Vt+=Js),Vt+=this.parse(Si.tokens,cs),ot+=this.renderer.listitem(Vt,Un,Fl);O+=this.renderer.list(ot,li,Gt);continue}case"html":{O+=this.renderer.html(ye.text);continue}case"paragraph":{O+=this.renderer.paragraph(this.parseInline(ye.tokens));continue}case"text":{for(ot=ye.tokens?this.parseInline(ye.tokens):ye.text;M+1<Lr&&x[M+1].type==="text";)ye=x[++M],ot+=`
`+(ye.tokens?this.parseInline(ye.tokens):ye.text);O+=T?this.renderer.paragraph(ot):ot;continue}default:{var Mc='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(Mc);return}else throw new Error(Mc)}}}return O},H.parseInline=function(x,T){T=T||this.renderer;var O="",M,G,ee,Ce=x.length;for(M=0;M<Ce;M++){if(G=x[M],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[G.type]&&(ee=this.options.extensions.renderers[G.type].call({parser:this},G),ee!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(G.type))){O+=ee||"";continue}switch(G.type){case"escape":{O+=T.text(G.text);break}case"html":{O+=T.html(G.text);break}case"link":{O+=T.link(G.href,G.title,this.parseInline(G.tokens,T));break}case"image":{O+=T.image(G.href,G.title,G.text);break}case"strong":{O+=T.strong(this.parseInline(G.tokens,T));break}case"em":{O+=T.em(this.parseInline(G.tokens,T));break}case"codespan":{O+=T.codespan(G.text);break}case"br":{O+=T.br();break}case"del":{O+=T.del(this.parseInline(G.tokens,T));break}case"text":{O+=T.text(G.text);break}default:{var be='Token with "'+G.type+'" type was not found.';if(this.options.silent){console.error(be);return}else throw new Error(be)}}}return O},j}();function Ae(j,H,z){if(typeof j=="undefined"||j===null)throw new Error("marked(): input parameter is undefined or null");if(typeof j!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(j)+", string expected");if(typeof H=="function"&&(z=H,H=null),H=K({},Ae.defaults,H||{}),Ie(H),z){var x=H.highlight,T;try{T=hn.lex(j,H)}catch(ee){return z(ee)}var O=function(Ce){var be;if(!Ce)try{H.walkTokens&&Ae.walkTokens(T,H.walkTokens),be=Ao.parse(T,H)}catch(Fe){Ce=Fe}return H.highlight=x,Ce?z(Ce):z(null,be)};if(!x||x.length<3||(delete H.highlight,!T.length))return O();var M=0;Ae.walkTokens(T,function(ee){ee.type==="code"&&(M++,setTimeout(function(){x(ee.text,ee.lang,function(Ce,be){if(Ce)return O(Ce);be!=null&&be!==ee.text&&(ee.text=be,ee.escaped=!0),M--,M===0&&O()})},0))}),M===0&&O();return}try{var G=hn.lex(j,H);return H.walkTokens&&Ae.walkTokens(G,H.walkTokens),Ao.parse(G,H)}catch(ee){if(ee.message+=`
Please report this to https://github.com/markedjs/marked.`,H.silent)return"<p>An error occurred:</p><pre>"+m(ee.message+"",!0)+"</pre>";throw ee}}Ae.options=Ae.setOptions=function(j){return K(Ae.defaults,j),l(Ae.defaults),Ae},Ae.getDefaults=a,Ae.defaults=e.defaults,Ae.use=function(){for(var j=arguments.length,H=new Array(j),z=0;z<j;z++)H[z]=arguments[z];var x=K.apply(void 0,[{}].concat(H)),T=Ae.defaults.extensions||{renderers:{},childTokens:{}},O;H.forEach(function(M){if(M.extensions&&(O=!0,M.extensions.forEach(function(ee){if(!ee.name)throw new Error("extension name required");if(ee.renderer){var Ce=T.renderers?T.renderers[ee.name]:null;Ce?T.renderers[ee.name]=function(){for(var be=arguments.length,Fe=new Array(be),Be=0;Be<be;Be++)Fe[Be]=arguments[Be];var kt=ee.renderer.apply(this,Fe);return kt===!1&&(kt=Ce.apply(this,Fe)),kt}:T.renderers[ee.name]=ee.renderer}if(ee.tokenizer){if(!ee.level||ee.level!=="block"&&ee.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");T[ee.level]?T[ee.level].unshift(ee.tokenizer):T[ee.level]=[ee.tokenizer],ee.start&&(ee.level==="block"?T.startBlock?T.startBlock.push(ee.start):T.startBlock=[ee.start]:ee.level==="inline"&&(T.startInline?T.startInline.push(ee.start):T.startInline=[ee.start]))}ee.childTokens&&(T.childTokens[ee.name]=ee.childTokens)})),M.renderer&&function(){var ee=Ae.defaults.renderer||new Qs,Ce=function(Be){var kt=ee[Be];ee[Be]=function(){for(var ot=arguments.length,ye=new Array(ot),li=0;li<ot;li++)ye[li]=arguments[li];var Gt=M.renderer[Be].apply(ee,ye);return Gt===!1&&(Gt=kt.apply(ee,ye)),Gt}};for(var be in M.renderer)Ce(be);x.renderer=ee}(),M.tokenizer&&function(){var ee=Ae.defaults.tokenizer||new Ct,Ce=function(Be){var kt=ee[Be];ee[Be]=function(){for(var ot=arguments.length,ye=new Array(ot),li=0;li<ot;li++)ye[li]=arguments[li];var Gt=M.tokenizer[Be].apply(ee,ye);return Gt===!1&&(Gt=kt.apply(ee,ye)),Gt}};for(var be in M.tokenizer)Ce(be);x.tokenizer=ee}(),M.walkTokens){var G=Ae.defaults.walkTokens;x.walkTokens=function(ee){M.walkTokens.call(this,ee),G&&G.call(this,ee)}}O&&(x.extensions=T),Ae.setOptions(x)})},Ae.walkTokens=function(j,H){for(var z=function(){var M=T.value;switch(H.call(Ae,M),M.type){case"table":{for(var G=o(M.header),ee;!(ee=G()).done;){var Ce=ee.value;Ae.walkTokens(Ce.tokens,H)}for(var be=o(M.rows),Fe;!(Fe=be()).done;)for(var Be=Fe.value,kt=o(Be),ot;!(ot=kt()).done;){var ye=ot.value;Ae.walkTokens(ye.tokens,H)}break}case"list":{Ae.walkTokens(M.items,H);break}default:Ae.defaults.extensions&&Ae.defaults.extensions.childTokens&&Ae.defaults.extensions.childTokens[M.type]?Ae.defaults.extensions.childTokens[M.type].forEach(function(li){Ae.walkTokens(M[li],H)}):M.tokens&&Ae.walkTokens(M.tokens,H)}},x=o(j),T;!(T=x()).done;)z()},Ae.parseInline=function(j,H){if(typeof j=="undefined"||j===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof j!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(j)+", string expected");H=K({},Ae.defaults,H||{}),Ie(H);try{var z=hn.lexInline(j,H);return H.walkTokens&&Ae.walkTokens(z,H.walkTokens),Ao.parseInline(z,H)}catch(x){if(x.message+=`
Please report this to https://github.com/markedjs/marked.`,H.silent)return"<p>An error occurred:</p><pre>"+m(x.message+"",!0)+"</pre>";throw x}},Ae.Parser=Ao,Ae.parser=Ao.parse,Ae.Renderer=Qs,Ae.TextRenderer=Mo,Ae.Lexer=hn,Ae.lexer=hn.lex,Ae.Tokenizer=Ct,Ae.Slugger=Pl,Ae.parse=Ae;var ma=Ae.options,Hu=Ae.setOptions,zu=Ae.use,_a=Ae.walkTokens,Nc=Ae.parseInline,Up=Ae,Rc=Ao.parse,jp=hn.lex;e.Lexer=hn,e.Parser=Ao,e.Renderer=Qs,e.Slugger=Pl,e.TextRenderer=Mo,e.Tokenizer=Ct,e.getDefaults=a,e.lexer=jp,e.marked=Ae,e.options=ma,e.parse=Up,e.parseInline=Nc,e.parser=Rc,e.setOptions=Hu,e.use=zu,e.walkTokens=_a,Object.defineProperty(e,"__esModule",{value:!0})})})();var f1=ZF||exports;function JQ(r,e={},t={}){var i;const n=new X;let s=!1;const o=n.add(new ji),a=uk(e),l=function(b){let v;try{v=y0(decodeURIComponent(b))}catch(C){}return v?(v=CH(v,C=>{if(r.uris&&r.uris[C])return xe.revive(r.uris[C])}),encodeURIComponent(JSON.stringify(v))):b},d=function(b,v){const C=r.uris&&r.uris[b];let w=xe.revive(C);return v?b.startsWith(Me.data+":")?b:(w||(w=xe.parse(b)),sM.asBrowserUri(w).toString(!0)):!w||xe.parse(b).toString()===w.toString()?b:(w.query&&(w=w.with({query:l(w.query)})),w.toString())};let c;const h=new Promise(b=>c=b),u=new f1.Renderer;if(u.image=(b,v,C)=>{let w=[],L=[];return b&&({href:b,dimensions:w}=H9(b),L.push(`src="${b}"`)),C&&L.push(`alt="${C}"`),v&&L.push(`title="${v}"`),w.length&&(L=L.concat(w)),"<img "+L.join(" ")+">"},u.link=(b,v,C)=>typeof b!="string"?"":(b===C&&(C=lS(C)),b=d(b,!1),r.baseUri&&(b=$S(xe.from(r.baseUri),b)),v=typeof v=="string"?lS(v):"",b=lS(b),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!r.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b)?C:(b=b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),`<a data-href="${b}" title="${v||b}">${C}</a>`)),u.paragraph=b=>`<p>${b}</p>`,e.codeBlockRenderer&&(u.code=(b,v)=>{const C=e.codeBlockRenderer(v!=null?v:"",b),w=NO.nextId();return YD(Promise.all([C,h]),o.token).then(L=>{var E;if(!s&&L){const y=a.querySelector(`div[data-code="${w}"]`);y&&dl(y,L[0]),(E=e.asyncRenderCallback)===null||E===void 0||E.call(e)}}).catch(()=>{}),`<div class="code" data-code="${w}">${MD(b)}</div>`}),e.actionHandler){const b=e.actionHandler.disposables.add(new ut(a,"click")),v=e.actionHandler.disposables.add(new ut(a,"auxclick"));e.actionHandler.disposables.add(ge.any(b.event,v.event)(C=>{const w=new bs(C);if(!w.leftButton&&!w.middleButton)return;let L=w.target;if(!(L.tagName!=="A"&&(L=L.parentElement,!L||L.tagName!=="A")))try{let E=L.dataset.href;E&&(r.baseUri&&(E=$S(xe.from(r.baseUri),E)),e.actionHandler.callback(E,w))}catch(E){Te(E)}finally{w.preventDefault()}}))}r.supportHtml||(t.sanitizer=b=>(r.isTrusted?b.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?b:"",t.sanitize=!0,t.silent=!0),t.renderer=u;let g=(i=r.value)!==null&&i!==void 0?i:"";g.length>1e5&&(g=`${g.substr(0,1e5)}…`),r.supportThemeIcons&&(g=Z6(g));let p=f1.parse(g,t);r.supportThemeIcons&&(p=Ld(p).map(v=>typeof v=="string"?v:v.outerHTML).join(""));const _=new DOMParser().parseFromString(p1(r,p),"text/html");if(_.body.querySelectorAll("img").forEach(b=>{const v=b.getAttribute("src");if(v){let C=v;try{r.baseUri&&(C=$S(xe.from(r.baseUri),C))}catch(w){}b.src=d(C,!0)}}),a.innerHTML=p1(r,_.body.innerHTML),c(),e.asyncRenderCallback)for(const b of a.getElementsByTagName("img")){const v=n.add(Z(b,"load",()=>{v.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{s=!0,o.cancel(),n.dispose()}}}function $S(r,e){return/^\w[\w\d+.-]*:/.test(e)?e:r.path.endsWith("/")?tT(r,e).toString():tT(Vv(r),e).toString()}function p1(r,e){const{config:t,allowedSchemes:i}=eJ(r);u1("uponSanitizeAttribute",(s,o)=>{if(o.attrName==="style"||o.attrName==="class"){if(s.tagName==="SPAN"){if(o.attrName==="style"){o.keepAttr=/^(color\:#[0-9a-fA-F]+;)?(background-color\:#[0-9a-fA-F]+;)?$/.test(o.attrValue);return}else if(o.attrName==="class"){o.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(o.attrValue);return}}o.keepAttr=!1;return}});const
.monaco-editor .zone-widget ${s},
.markers-panel .marker-icon${s},
.text-search-provider-messages .providerMessage ${s},
.extensions-viewlet > .extensions ${s} {
color: ${t};
}
`)}const i=r.getColor(aU);if(i){const s=ne.warning.cssSelector;e.addRule(`
.monaco-editor .zone-widget ${s},
.markers-panel .marker-icon${s},
.extensions-viewlet > .extensions ${s},
.extension-editor ${s},
.text-search-provider-messages .providerMessage ${s},
.preferences-editor ${s} {
color: ${i};
}
`)}const n=r.getColor(lU);if(n){const s=ne.info.cssSelector;e.addRule(`
.monaco-editor .zone-widget ${s},
.markers-panel .marker-icon${s},
.extensions-viewlet > .extensions ${s},
.text-search-provider-messages .providerMessage ${s},
.extension-editor ${s} {
color: ${n};
}
`)}});var cJ=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Hc=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}};class hJ{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new X,this._editor=t;const o=document.createElement("div");o.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),o.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),o.appendChild(this._relatedBlock),this._disposables.add(ki(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new pA(o,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{o.style.left=`-${a.scrollLeft}px`,o.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){tt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let o=((t==null?void 0:t.length)||0)+2;s&&(typeof s=="string"?o+=s.length:o+=s.value.length);const a=ra(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+o,this._longestLineLength);gi(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||s){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),u.appendChild(g)}if(s)if(typeof s=="string"){const g=document.createElement("span");g.innerText=`(${s})`,g.classList.add("code"),u.appendChild(g)}else{this._codeLink=q("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=p=>{this._openerService.open(s.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()};const g=$(this._codeLink,q("span"));g.innerText=s.value,u.appendChild(this._codeLink)}}if(gi(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Pn(n)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(59)*.66)}px`,this._lines+=1;for(const g of n){let p=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${gF(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,m.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(m,g);let _=document.createElement("span");_.innerText=g.message,p.appendChild(m),p.appendChild(_),this._lines+=1,u.appendChild(p)}}const d=this._editor.getOption(44),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Pt.Error:t=f("Error","Error");break;case Pt.Warning:t=f("Warning","Warning");break;case Pt.Info:t=f("Info","Info");break;case Pt.Hint:t=f("Hint","Hint");break}let i=f("marker aria","{0} at {1}. ",t,e.startLineN
`),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=Wr._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 ae(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){let i=[];for(let n=0,s=e.length;n<s;n++){const o=e[n];o.ignore||i.push(Kt.delete(new S(t+n,o.commentStrOffset+1,t+n,o.commentStrOffset+o.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){let i=[];const n=this._insertSpace?" ":"";for(let s=0,o=e.length;s<o;s++){const a=e[s];a.ignore||i.push(Kt.insert(new P(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,o,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=Wr.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(o=0,a=t[l].commentStrOffset;h<s&&o<a;o++)h=Wr.nextVisibleColumn(h,n,c.charCodeAt(o)===9,1);h>s?t[l].commentStrOffset=o-1:t[l].commentStrOffset=o}}}class rI extends re{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(qi);if(!t.hasModel())return;const n=t.getModel(),s=[],o=n.getOptions(),a=t.getOption(19),l=t.getSelections().map((c,h)=>({selection:c,index:h,ignoreFirstLine:!1}));l.sort((c,h)=>S.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 Wr(i,c.selection,o.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,c.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class DJ extends rI{constructor(){super(0,{id:"editor.action.commentLine",label:f("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:2133,weight:100},menuOpts:{menuId:N.MenubarEditMenu,group:"5_insert",title:f({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class xJ extends rI{constructor(){super(1,{id:"editor.action.addCommentLine",label:f("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2081),weight:100}})}}class kJ extends rI{constructor(){super(2,{id:"editor.action.removeCommentLine",label:f("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2099),weight:100}})}}class IJ extends re{constructor(){super({id:"editor.action.blockComment",label:f("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:N.MenubarEditMenu,group:"5_insert",title:f({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(qi);if(!t.hasModel())return;const n=t.getOption(19),s=[],o=t.getSelections();for(const a of o)s.push(new Va(a,n.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}J(DJ);J(xJ);J(kJ);J(IJ);var EJ=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnProper
`,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(o));break}continue}if(s===36){if(i++,i>=n)break;let o=r.charCodeAt(i);if(o===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(o===48||o===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=o&&o<=57){let a=o-48;if(i+1<n){let l=r.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 Rl=new se("findWidgetVisible",!1);Rl.toNegated();const EC=new se("findInputFocussed",!1),aI=new se("replaceInputFocussed",!1),Bm={primary:545,mac:{primary:2593}},Wm={primary:565,mac:{primary:2613}},Vm={primary:560,mac:{primary:2608}},Hm={primary:554,mac:{primary:2602}},zm={primary:558,mac:{primary:2606}},yt={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",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"},Ha=19999,BJ=240;class ef{constructor(e,t){this._toDispose=new X,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new Hn,this._decorations=new Gi(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new gt(()=>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,tt(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)},BJ)):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!="undefined"?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 S(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));let n=this._findMatches(i,!1,Ha);this._decorations.set(n,i);const s=this._editor.getSelection();let o=this._decorations.getCurrentMatchesPosition(s);if(o===0&&n.length>0){const a=IR(n.map(l=>l.range),l=>S.compareRangesUsingStarts(l,s)>=0);o=a>0?a-1+1:o}this._state.changeMatchInfo(o,this._decorations.getCount(),void 0),e&&this._editor.getOption(35).cursorMoveOnType&&this._moveToNextMatch
`),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 M1(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return A1(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(R1|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{yn&&po&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(f("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(N1,!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 M1(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return A1(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){let t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new PL(null,this._contextViewProvider,{width:ree,label:KJ,placeholder:qJ,appendCaseSensitiveLabel:this._keybindingLabelFor(yt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(yt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(yt.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,showHistoryHint:()=>k1(this._keybindingService)},this._contextKeyService,!0)),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()})),Ji&&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 $c({label:GJ+this._keybindingLabelFor(yt.PreviousMatchFindAction),icon:UJ,onTrigger:()=>{this._codeEditor.getAction(yt.PreviousMatchFindAction).run().then(void 0,Te)}})),this._nextBtn=this._register(new $c({label:ZJ+this._keybindingLabelFor(yt.NextMatchFindAction),icon:jJ,onTrigger:()=>{this._codeEditor.getAction(yt.NextMatchFindAction).run().then(void 0,Te)}}));let 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 Hp({icon:HJ,title:YJ+this._keybindingLabelFor(yt.ToggleSearchScopeCommand),isChecked:!1})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let 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 $c({label:XJ+this._keybindingLabelFor(yt.CloseFindWidgetCommand),icon:GA,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.
.monaco-editor .find-widget .button:not(.disabled):hover,
.monaco-editor .find-widget .codicon-find-selection:hover {
background-color: ${u} !important;
}
`);const g=r.getColor(ar);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var rB=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},jo=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}},Qd=globalThis&&globalThis.__awaiter||function(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{d(i.next(c))}catch(h){o(h)}}function l(c){try{d(i.throw(c))}catch(h){o(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(r,e||[])).next())})};const lee=524288;function GL(r,e="single",t=!1){if(!r.hasModel())return null;const i=r.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const n=r.getConfiguredWordAtPosition(i.getStartPosition());if(n&&t===!1)return n.word}else if(r.getModel().getValueLengthInRange(i)<lee)return r.getModel().getValueInRange(i)}return null}let Vn=class aB extends V{constructor(e,t,i,n){super(),this._editor=e,this._findWidgetVisible=Rl.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._updateHistoryDelayer=new dr(500),this._state=this._register(new WJ),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(s=>this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{let 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(35).loop})}))}get editor(){return this._editor}static get(e){return e.getContribution(aB.ID)}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,0),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,0),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,0),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,0)}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!!EC.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._state.isRe
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:f("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:f("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:f("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 hee extends re{constructor(){super({id:yt.StartFindWithArgs,label:f("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:cee})}run(e,t,i){return Qd(this,void 0,void 0,function*(){const n=Vn.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(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(35).loop},s),n.setGlobalBufferTerm(n.getState().searchString)}})}}class uee extends re{constructor(){super({id:yt.StartFindWithSelection,label:f("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 Qd(this,void 0,void 0,function*(){const i=Vn.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class lB extends re{run(e,t){return Qd(this,void 0,void 0,function*(){const i=Vn.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(35).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),this._run(i))})}}class gee extends lB{constructor(){super({id:yt.NextMatchFindAction,label:f("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:k.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:ie.and(k.focus,EC),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class fee extends lB{constructor(){super({id:yt.PreviousMatchFindAction,label:f("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:k.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:ie.and(k.focus,EC),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class dB extends re{run(e,t){return Qd(this,void 0,void 0,function*(){const i=Vn.get(t);if(!i)return;const n=t.getOption(35).seedSearchStringFromSelection==="selection";let s=null;t.getOption(35).seedSearchStringFromSelection!=="never"&&(s=GL(t,"single",n)),s&&i.setSearchString(s),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getOption(35).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:n,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(35).loop}),this._run(i))})}}class pee extends dB{constructor(){super({id:yt.NextSelectionMatchFindAction,label:f("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:k.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class mee extends dB{constructor(){super({id:yt.PreviousSelectionMatchFindAction,label:f("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:k.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const _ee=LM(new yM({id:yt.StartFindReplaceAct
* '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': 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:mB,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){let s=n&&n.levels||1,o=this.getLineNumbers(n,i);n&&n.direction==="up"?cB(t,!1,s,o):Ou(t,!1,s,o)}}class Vee extends xn{constructor(){super({id:"editor.unfoldRecursively",label:f("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2137),weight:100}})}invoke(e,t,i,n){Ou(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class Hee extends xn{constructor(){super({id:"editor.fold",label:f("foldAction.label","Fold"),alias:"Fold",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:3159,mac:{primary:2647},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': 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:mB,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,n){let s=this.getLineNumbers(n,i);const o=n&&n.levels,a=n&&n.direction;typeof o!="number"&&typeof a!="string"?wee(t,!0,s):a==="up"?cB(t,!0,o||1,s):Ou(t,!0,o||1,s)}}class zee extends xn{constructor(){super({id:"editor.toggleFold",label:f("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2090),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);Cee(t,1,n)}}class $ee extends xn{constructor(){super({id:"editor.foldRecursively",label:f("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2135),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);Ou(t,!0,Number.MAX_VALUE,n)}}class Uee extends xn{constructor(){super({id:"editor.foldAllBlockComments",label:f("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2133),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())dI(t,gp.Comment.value,!0);else{const o=i.getModel();if(!o)return;const a=s.getLanguageConfiguration(o.getLanguageId()).comments;if(a&&a.blockCommentStartToken){let l=new RegExp("^\\s*"+Co(a.blockCommentStartToken));lI(t,l,!0)}}}}class jee extends xn{constructor(){super({id:"editor.foldAllMarkerRegions",label:f("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())dI(t,gp.Region.value,!0);else{const o=i.getModel();if(!o)return;const a=s.getLanguageConfiguration(o.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){let l=new RegExp(a.markers.start);lI(t,l,!0)}}}}class Kee extends xn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:f("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())dI(t,gp.Region.value,!1);else{const o=i.getModel();if(!o)return;const a=s.getLanguageConfiguration(o.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){let l=new RegExp(a.markers.start);lI(t,l,!1)}}}}class qee extends xn{constructor(){super({id:"editor.foldAllExcept",label:f("foldAllExcept.label","Fold All Regions Except Selected"),alias:"Fold All Regions Except Selected",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2131),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);hB(t,!0,n)}}class Gee extends xn{constructor(){super({id:"editor.unfoldAllExcept",label:f("unfoldAllExcept.label","Unfold All Regions Except Selected"),alias:"Unfold All Regions Except Selected",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2129),weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);hB(t,!1,n)}}class Zee extends xn{constructor(){super({id:"editor.foldAll",label:f("foldAllAction.label","Fold All"),alias:"Fold All",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2069),weight:100}})}invoke(e,t,i){Ou(t,!0)}}class Yee extends xn{constructor(){super({id:"editor.unfoldAll",label:f("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2088),weight:100}})}invoke(e,t,i){Ou(t,!1)}}class Jd extends xn{getFoldingLevel(){return parseInt(this.id.substr(Jd.ID_PREFIX.length))}invoke(e,t,i){See(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}Jd.ID_PREFIX="editor.foldLevel";Jd.ID=r=>Jd.ID_PREFIX+r;class Xee extends xn{constructor(){super({id:"editor.gotoParentFold",label:f("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:cn,kbOpts:{kbExpr:k.editorTextFocus,weight:100}})}invoke(e,t,i){let n=this.getSelectedLines(i);if(n.length>0){let s=yee(n[0],t);s
.monaco-editor .cldr${_t.asCSSSelector(cI)},
.monaco-editor .cldr${_t.asCSSSelector(hI)} {
color: ${i} !important;
}
`)});class ite extends re{constructor(){super({id:"editor.action.fontZoomIn",label:f("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){aa.setZoomLevel(aa.getZoomLevel()+1)}}class nte extends re{constructor(){super({id:"editor.action.fontZoomOut",label:f("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){aa.setZoomLevel(aa.getZoomLevel()-1)}}class ste extends re{constructor(){super({id:"editor.action.fontZoomReset",label:f("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){aa.setZoomLevel(0)}}J(ite);J(nte);J(ste);var _B=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Qb=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}},uI=globalThis&&globalThis.__awaiter||function(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{d(i.next(c))}catch(h){o(h)}}function l(c){try{d(i.throw(c))}catch(h){o(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(r,e||[])).next())})};let Jf=class{constructor(e,t,i){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._disposables=new X,this._sessionDisposables=new X,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(n=>{n.hasChanged(49)&&this._update()}))}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(49)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;let i=new sh;for(let n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(n=>{let s=n.charCodeAt(n.length-1);i.has(s)&&this._trigger(String.fromCharCode(s))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=new ji,s=this._editor.onDidChangeModelContent(o=>{if(o.isFlush){n.cancel(),s.dispose();return}for(let a=0,l=o.changes.length;a<l;a++)if(o.changes[a].range.endLineNumber<=i.lineNumber){n.cancel(),s.dispose();return}});LP(this._workerService,this._languageFeaturesService,t,i,e,t.getFormattingOptions(),n.token).then(o=>{n.token.isCancellationRequested||Pn(o)&&(ou.execute(this._editor,o,!0),Bk(o))}).finally(()=>{s.dispose()})}};Jf.ID="editor.contrib.autoFormat";Jf=_B([Qb(1,le),Qb(2,xs)],Jf);let ep=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new X,this._callOnModel=new X,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(48)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(yP,this.editor
`)}))).substring(this.parts[0].column-1)}}class hte{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)e.charAt(t)===`
`&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}function ute(r,e){const t=new hte(r),i=e.map(n=>{const s=S.lift(n.range);return{startOffset:t.getOffset(s.getStartPosition()),endOffset:t.getOffset(s.getEndPosition()),text:n.text}});i.sort((n,s)=>s.startOffset-n.startOffset);for(const n of i)r=r.substring(0,n.startOffset)+n.text+r.substring(n.endOffset);return r}class W1{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}}class CB extends V{constructor(e){super(),this.editor=e,this._expanded=void 0,this.onDidChangeEmitter=new A,this.onDidChange=this.onDidChangeEmitter.event,this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(106)&&this._expanded===void 0&&this.onDidChangeEmitter.fire()}))}setExpanded(e){this._expanded=!0,this.onDidChangeEmitter.fire()}}function gte(r,e){return r===e?!0:!r||!e?!1:r.range.equalsRange(e.range)&&r.text===e.text&&r.command===e.command}function wB(r,e,t,i,n=0){if(r.range.startLineNumber!==r.range.endLineNumber)return;const s=e.getLineContent(r.range.startLineNumber),o=ht(s).length;if(r.range.startColumn-1<=o){const g=ht(r.text).length,p=s.substring(r.range.startColumn-1,o),m=S.fromPositions(r.range.getStartPosition().delta(0,p.length),r.range.getEndPosition()),_=r.text.startsWith(p)?r.text.substring(p.length):r.text.substring(g);r={range:m,text:_,command:r.command}}const l=e.getValueInRange(r.range),d=fte(l,r.text);if(!d)return;const c=r.range.startLineNumber,h=new Array;if(t==="prefix"){const g=d.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==l.length)return}const u=r.text.length-n;for(const g of d){const p=r.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===r.range.startLineNumber&&p<i.column||g.originalLength>0)return;if(g.modifiedLength===0)continue;const m=g.modifiedStart+g.modifiedLength,_=Math.max(g.modifiedStart,Math.min(m,u)),b=r.text.substring(g.modifiedStart,_),v=r.text.substring(_,Math.max(g.modifiedStart,m));if(b.length>0){const C=ra(b);h.push(new W1(p,C,!1))}if(v.length>0){const C=ra(v);h.push(new W1(p,C,!0))}}return new vB(c,h,0)}let Wo;function fte(r,e){if((Wo==null?void 0:Wo.originalValue)===r&&(Wo==null?void 0:Wo.newValue)===e)return Wo==null?void 0:Wo.changes;{const t=pte(r,e);return Wo={originalValue:r,newValue:e,changes:t},t}}function pte(r,e){if(r.length>5e3||e.length>5e3)return;function t(l){let d=0;for(let c=0,h=l.length;c<h;c++){const u=l.charCodeAt(c);u>d&&(d=u)}return d}const i=Math.max(t(r),t(e));function n(l){if(l<0)throw new Error("unexpected");return i+l+1}function s(l){let d=0,c=0;const h=new Int32Array(l.length);for(let u=0,g=l.length;u<g;u++){const p=c*100+d;l[u]==="("?(h[u]=n(2*p),d++):l[u]===")"?(h[u]=n(2*p+1),d===1&&c++,d=Math.max(d-1,0)):h[u]=l.charCodeAt(u)}return h}const o=s(r),a=s(e);return new DR({getElements:()=>o},{getElements:()=>a}).ComputeDiff(!1).changes}function mte(r,e){const t=new LA,i=new xA(t,d=>e.getLanguageConfiguration(d)),n=new DA(new _te([r]),i),s=Zy(n,[],void 0,!0);let o="";const a=r.getLineContent();function l(d,c){if(d.kind===2)if(l(d.openingBracket,c),c=ai(c,d.openingBracket.length),d.child&&(l(d.child,c),c=ai(c,d.child.length)),d.closingBracket)l(d.closingBracket,c),c=ai(c,d.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(d.openingBracket.languageId).findClosingTokenText(d.openingBracket.bracketIds);o+=u}else if(d.kind!==3){if(d.kind===0||d.kind===1)o+=a.substring(c,ai(c,d.length));else if(d.kind===4)for(const h of d.children)l(h,c),c=ai(c,h.length)}}return l(s,hr),o}class _te{constructor(e){this.lines=e}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}getLineTokens(e){return this.lines[e-1]}}var bte=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s)
${ne.symbolValue.cssSelector},${ne.symbolEnum.cssSelector} { color: ${d}; }`);const c=r.getColor(tie);c&&e.addRule(`${ne.symbolEnumMember.cssSelector} { color: ${c}; }`);const h=r.getColor(iie);h&&e.addRule(`${ne.symbolEvent.cssSelector} { color: ${h}; }`);const u=r.getColor(nie);u&&e.addRule(`${ne.symbolField.cssSelector} { color: ${u}; }`);const g=r.getColor(sie);g&&e.addRule(`${ne.symbolFile.cssSelector} { color: ${g}; }`);const p=r.getColor(oie);p&&e.addRule(`${ne.symbolFolder.cssSelector} { color: ${p}; }`);const m=r.getColor(rie);m&&e.addRule(`${ne.symbolFunction.cssSelector} { color: ${m}; }`);const _=r.getColor(aie);_&&e.addRule(`${ne.symbolInterface.cssSelector} { color: ${_}; }`);const b=r.getColor(lie);b&&e.addRule(`${ne.symbolKey.cssSelector} { color: ${b}; }`);const v=r.getColor(die);v&&e.addRule(`${ne.symbolKeyword.cssSelector} { color: ${v}; }`);const C=r.getColor(hie);C&&e.addRule(`${ne.symbolModule.cssSelector} { color: ${C}; }`);const w=r.getColor(uie);w&&e.addRule(`${ne.symbolNamespace.cssSelector} { color: ${w}; }`);const L=r.getColor(gie);L&&e.addRule(`${ne.symbolNull.cssSelector} { color: ${L}; }`);const E=r.getColor(fie);E&&e.addRule(`${ne.symbolNumber.cssSelector} { color: ${E}; }`);const y=r.getColor(pie);y&&e.addRule(`${ne.symbolObject.cssSelector} { color: ${y}; }`);const D=r.getColor(mie);D&&e.addRule(`${ne.symbolOperator.cssSelector} { color: ${D}; }`);const R=r.getColor(_ie);R&&e.addRule(`${ne.symbolPackage.cssSelector} { color: ${R}; }`);const W=r.getColor(bie);W&&e.addRule(`${ne.symbolProperty.cssSelector} { color: ${W}; }`);const B=r.getColor(vie);B&&e.addRule(`${ne.symbolReference.cssSelector} { color: ${B}; }`);const te=r.getColor(Cie);te&&e.addRule(`${ne.symbolSnippet.cssSelector} { color: ${te}; }`);const K=r.getColor(wie);K&&e.addRule(`${ne.symbolString.cssSelector} { color: ${K}; }`);const he=r.getColor(Sie);he&&e.addRule(`${ne.symbolStruct.cssSelector} { color: ${he}; }`);const ce=r.getColor(yie);ce&&e.addRule(`${ne.symbolText.cssSelector} { color: ${ce}; }`);const we=r.getColor(Lie);we&&e.addRule(`${ne.symbolTypeParameter.cssSelector} { color: ${we}; }`);const Ie=r.getColor(Die);Ie&&e.addRule(`${ne.symbolUnit.cssSelector} { color: ${Ie}; }`);const Le=r.getColor(xie);Le&&e.addRule(`${ne.symbolVariable.cssSelector} { color: ${Le}; }`)});class IB{constructor(){this._onDidWillResize=new A,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new A,this.onDidResize=this._onDidResize.event,this._sashListener=new X,this._size=new pt(0,0),this._minSize=new pt(0,0),this._maxSize=new pt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Hi(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Hi(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Hi(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:pb.North}),this._southSash=new Hi(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:pb.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(ge.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(ge.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(n=>{e&&(i=n.currentX-n.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(n=>{e&&(i=-(n.currentX-n.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sash
`,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("")}
`,o=new Qn().appendCodeblock("empty",a),s=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!pI(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,Yn(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else gi(this._type),this._type.title="",Cn(this._type),this.domNode.classList.add("no-type");if(gi(this._docs),typeof o=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=o;else if(o){this._docs.classList.add("markdown-docs"),gi(this._docs);const a=this._markdownRenderer.render(o);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,t3(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}};tD=kie([Iie(1,ze)],tD);class Eie{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new X,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new IB,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,o=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&&(o=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+o})}a.done&&(i=void 0,n=void 0,s=0,o=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=mv(document.body),o=this.widget.getLayoutInfo(),a=new pt(220,2*o.lineHeight),l=e.top,d=function(){const C=s.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),w=-o.borderWidth+e.left+e.width,L=new pt(C,s.height-e.top-o.borderHeight-o.verticalPadding),E=L.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:l,left:w,fit:C-t.width,maxSizeTop:L,maxSizeBottom:E,minSize:a.with(Math.min(C,a.width))}}(),c=function(){const C=e.left-o.borderWidth-o.horizontalPadding,w=Math.max(o.horizontalPadding,e.left
`);s===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new S(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
`):this._isCopyingDown?t.addEditOperation(new S(i.startLineNumber,1,i.startLineNumber,1),s+`
`):t.addEditOperation(new S(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,o=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(n=n+this._startLineNumberDelta,s=1),this._endLineNumberDelta!==0&&(o=o+this._endLineNumberDelta,a=1),i=ae.createWithDirection(n,s,o,a,this._selectionDirection)}return i}}class Nne{constructor(e,t,i){this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){let 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:o,insertSpaces:a}=e.getOptions();let l=this.buildIndentConverter(s,o,a),d={getLineTokens:c=>e.getLineTokens(c),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(c,h)=>e.getLanguageIdAtPosition(c,h),getLineContent:null};if(n.startLineNumber===n.endLineNumber&&e.getLineMaxColumn(n.startLineNumber)===1){let c=n.startLineNumber,h=this._isMovingDown?c+1:c-1;e.getLineMaxColumn(h)===1?t.addEditOperation(new S(1,1,1,1),null):(t.addEditOperation(new S(c,1,c,1),e.getLineContent(h)),t.addEditOperation(new S(h,1,h,e.getLineMaxColumn(h)),null)),n=new ae(h,1,h,1)}else{let c,h;if(this._isMovingDown){c=n.endLineNumber+1,h=e.getLineContent(c),t.addEditOperation(new S(c-1,e.getLineMaxColumn(c-1),c,e.getLineMaxColumn(c)),null);let u=h;if(this.shouldAutoIndent(e,n)){let g=this.matchEnterRule(e,l,s,c,n.startLineNumber-1);if(g!==null){let m=ht(e.getLineContent(c)),_=g+Tn(m,s);u=tf(_,s,a)+this.trimLeft(h)}else{d.getLineContent=_=>_===n.startLineNumber?e.getLineContent(c):e.getLineContent(_);let m=oi.getGoodIndentForLine(this._autoIndent,d,e.getLanguageIdAtPosition(c,1),n.startLineNumber,l);if(m!==null){let _=ht(e.getLineContent(c)),b=Tn(m,s),v=Tn(_,s);b!==v&&(u=tf(b,s,a)+this.trimLeft(h))}}t.addEditOperation(new S(n.startLineNumber,1,n.startLineNumber,1),u+`
`);let p=this.matchEnterRuleMovingDown(e,l,s,n.startLineNumber,c,u);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,n,s,a,p);else{d.getLineContent=_=>_===n.startLineNumber?u:_>=n.startLineNumber+1&&_<=n.endLineNumber+1?e.getLineContent(_-1):e.getLineContent(_);let m=oi.getGoodIndentForLine(this._autoIndent,d,e.getLanguageIdAtPosition(c,1),n.startLineNumber+1,l);if(m!==null){const _=ht(e.getLineContent(n.startLineNumber)),b=Tn(m,s),v=Tn(_,s);if(b!==v){const C=b-v;this.getIndentEditsOfMovingBlock(e,t,n,s,a,C)}}}}else t.addEditOperation(new S(n.startLineNumber,1,n.startLineNumber,1),u+`
`)}else if(c=n.startLineNumber-1,h=e.getLineContent(c),t.addEditOperation(new S(c,1,c+1,1),null),t.addEditOperation(new S(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);let 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{let g=oi.getGoodIndentForLine(this._autoIndent,d,e.getLanguageIdAtPosition(n.startLineNumber,1),c,l);if(g!==null){let p=ht(e.getLineContent(n.startLineNumber)),m=Tn(g,s),_=Tn(p,s);if(m!==_){let b=m-_;this.getIndentEditsOfMovingBlock(e,t,n,s,a,b)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>Xn.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>Xn.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let o=s.indentation;s.indentAction===Qt.None||s.indentAction===Qt.Indent?o=s.indentation+s.appendText:s.indentAction===Qt.IndentOutdent?o=s.indentation:s.indentAction===Qt.Outdent&&(o=t.unshiftIndent(s.indentation)+s.appendText);let a=e.getLineContent(n);if(this.trimLeft(a).indexOf(this.trimLeft(o))>=0){let l=ht(e.getLineContent(n)),d=ht(o),c=oi.getIndentMetadata(e,n);c!==null&&c&2&&(d=t.unshiftIndent(d));let h=Tn(d,i),u=Tn(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,n,s,o){if(Qr(o)>=0){let a=e.getLineMaxColumn(s),l=oi.getEnterAction(this._autoIndent,e,new S(s,a,s,a));return this.parseEnterResult(e,t,i,n,l)}else{let a=n-1;for(;a>=1;){let c=e.getLineContent(a);if(Qr(c)>=0)break;a--}if(a<1||n>e.getLineCount())return null;let l=e.getLineMaxColumn(a),d=oi.getEnterAction(this._autoIndent,e,new S(a,l,a,l));return this.parseEnterResult(e,t,i,n,d)}}matchEnterRule(e,t,i,n,s,o){let a=s;for(;a>=1;){let c;if(a===s&&o!==void 0?c=o:c=e.getLineContent(a),Qr(c)>=0)break;a--}if(a<1||n>e.getLineCount())return null;let l=e.getLineMaxColumn(a),d=oi.getEnterAction(this._autoIndent,e,new S(a,l,a,l));return this.parseEnterResult(e,t,i,n,d)}trimLeft(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.isCheapToTokenize(t.startLineNumber))return!1;let i=e.getLanguageIdAtPosition(t.startLineNumber,1),n=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==n||oi.getIndentRulesSupport(i)===null)}getIndentEditsOfMovingBlock(e,t,i,n,s,o){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){let l=e.getLineContent(a),d=ht(l),h=Tn(d,n)+o,u=tf(h,n,s);u!==d&&(t.addEditOperation(new S(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}}class il{constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}static getCollator(){return il._COLLATOR||(il._COLLATOR=new Intl.Collator),il._COLLATOR}getEditOperations(e,t){let i=Rne(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;let n=VB(e,t,i);if(!n)return!1;for(let s=0,o=n.before.length;s<o;s++)if(n.before[s]!==n.after[s])return!0;return!1}}il._COLLATOR=null;function VB(r,e,t){let i=e.startLineNumber,n=e.endLineNumber;if(e.endColumn===1&&n--,i>=n)return null;let s=[];for(let a=i;a<=n;a++)s.push(r.getLineContent(a));let o=s.slice(0);return o.sort(il.getCollator().compare),t===!0&&(o=o.reverse()),{startLineNumber:i,endLineNumber:n,before:s,after:o}}function Rne(r,e,t){let i=VB(r,e,t);return i?Kt.replace(new S(i.startLineNumber,1,i.endLineNumber,r.getLineMaxColumn(i.endLineNumber)),i.after.join(`
`)):null}class HB extends re{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((o,a)=>({selection:o,index:a,ignore:!1}));i.sort((o,a)=>S.compareRangesUsingStarts(o.selection,a.selection));let n=i[0];for(let o=1;o<i.length;o++){const a=i[o];n.selection.endLineNumber===a.selection.startLineNumber&&(n.index<a.index?a.ignore=!0:(n.ignore=!0,n=a))}const s=[];for(const o of i)s.push(new WB(o.selection,this.down,o.ignore));t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}class Mne extends HB{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:f("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:N.MenubarSelectionMenu,group:"2_line",title:f({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class Ane extends HB{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:f("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:N.MenubarSelectionMenu,group:"2_line",title:f({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class One extends re{constructor(){super({id:"editor.action.duplicateSelection",label:f("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:k.writable,menuOpts:{menuId:N.MenubarSelectionMenu,group:"2_line",title:f({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],s=t.getSelections(),o=t.getModel();for(const a of s)if(a.isEmpty())n.push(new WB(a,!0));else{const l=new ae(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);n.push(new x4(l,o.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class zB extends re{constructor(e,t){super(t),this.down=e}run(e,t){let i=[],n=t.getSelections()||[];const s=t.getOption(9);for(const o of n)i.push(new Nne(o,this.down,s));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class Pne extends zB{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:f("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:N.MenubarSelectionMenu,group:"2_line",title:f({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class Fne extends zB{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:f("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:N.MenubarSelectionMenu,group:"2_line",title:f({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class $B extends re{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const s of i)if(!il.canRun(t.getModel(),s,this.descending))return;let n=[];for(let s=0,o=i.length;s<o;s++)n[s]=new il(i[s],this.descending);t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}class Bne extends $B{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:f("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:k.writable})}}class Wne extends $B{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:f("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:k.writable})}}class Vne extends re{constructor(){super({id:"editor.action.removeDuplicateLines",label:f("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:k.writable})}run(e,t){if(!t.hasModel())return;let i=t.getModel();if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;let n=[],s=[],o=0;for(let a of t.getSelections()){let l=new
`))),s.push(u),o+=a.endLineNumber-a.startLineNumber+1-d.length}t.pushUndoStop(),t.executeEdits(this.id,n,s),t.pushUndoStop()}}class HC extends re{constructor(){super({id:HC.ID,label:f("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:Ei(2089,2102),weight:100}})}run(e,t,i){let n=[];i.reason==="auto-save"&&(n=(t.getSelections()||[]).map(a=>new P(a.positionLineNumber,a.positionColumn)));let s=t.getSelection();if(s===null)return;let o=new Ene(s,n);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop()}}HC.ID="editor.action.trimTrailingWhitespace";class Hne extends re{constructor(){super({id:"editor.action.deleteLines",label:f("lines.delete","Delete Line"),alias:"Delete Line",precondition:k.writable,kbOpts:{kbExpr:k.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;let i=this._getLinesToRemove(t),n=t.getModel();if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s=0,o=[],a=[];for(let l=0,d=i.length;l<d;l++){const c=i[l];let h=c.startLineNumber,u=c.endLineNumber,g=1,p=n.getLineMaxColumn(u);u<n.getLineCount()?(u+=1,p=1):h>1&&(h-=1,g=n.getLineMaxColumn(h)),o.push(Kt.replace(new ae(h,g,u,p),"")),a.push(new ae(h-s,c.positionColumn,h-s,c.positionColumn)),s+=c.endLineNumber-c.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,o,a),t.pushUndoStop()}_getLinesToRemove(e){let t=e.getSelections().map(s=>{let o=s.endLineNumber;return s.startLineNumber<s.endLineNumber&&s.endColumn===1&&(o-=1),{startLineNumber:s.startLineNumber,selectionStartColumn:s.selectionStartColumn,endLineNumber:o,positionColumn:s.positionColumn}});t.sort((s,o)=>s.startLineNumber===o.startLineNumber?s.endLineNumber-o.endLineNumber:s.startLineNumber-o.startLineNumber);let i=[],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 zne extends re{constructor(){super({id:"editor.action.indentLines",label:f("lines.indent","Indent Line"),alias:"Indent Line",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:2137,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Mt.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class $ne extends re{constructor(){super({id:"editor.action.outdentLines",label:f("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:2135,weight:100}})}run(e,t){Eh.Outdent.runEditorCommand(e,t,null)}}class Une extends re{constructor(){super({id:"editor.action.insertLineBefore",label:f("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Mt.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class jne extends re{constructor(){super({id:"editor.action.insertLineAfter",label:f("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:k.writable,kbOpts:{kbExpr:k.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Mt.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class UB extends re{run(e,t){if(!t.hasModel())return;const i=t.getSelection();let n=this._getRangesToDelete(t),s=[];for(let l=0,d=n.length-1;l<d;l++){let c=n[l],h=n[l+1];S.intersectRanges(c,h)===null?s.push(c):n[l+1]=S.plusRange(c,h)}s.push(n[n.length-1]);let o=this._getEndCursorState(i,s),a=s.map(l=>Kt.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,o),t.pushUndoStop()}}class Kne extends UB{constructor(){super({id:"deleteAllLeft",label:f("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:k.writable,kbOpts:{kbExpr:k.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null,n=[],s=0;return t.forEach(o=>{let a;if(o.endColumn===1&&s>0){l
`);return new ap(e,t,n,d,s,o,c)}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Ym(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 Ym(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(117):null,!1);return i?new ae(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 Ym(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 Ym(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(117):null,!1);return i?new ae(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(){return this._editor.hasModel()?(this.findController.highlightFindOptions(),this._editor.getModel().findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(117):null,!1,1073741824)):[]}}class ic extends V{constructor(e){super(),this._sessionDispose=this._register(new X),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}static get(e){return e.getContribution(ic.ID)}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=ap.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 ae(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 n=e.getState().matchCase;if(!XB(this._editor.getModel(),t,n)){const o=this._editor.getModel();let a=[];for(let l=0,d=t.length;l<d;l++)a[l]=this._expandEmptyToWord(o,t[l]);this._editor.setSelections(a);return}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNe
`):void 0}:{range:S.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
`):void 0}})}provideRenameEdits(e,t){return Id(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,n){return Id(this,void 0,void 0,function*(){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join(`
`)};const o=yield s.provideRenameEdits(this.model,this.position,e,n);if(o){if(o.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(f("no result","No result.")),n);return o})}}function Rse(r,e,t,i){return Id(this,void 0,void 0,function*(){const n=new CI(e,t,r),s=yield n.resolveRenameLocation(Ye.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,Ye.None)})}let rc=class iW{constructor(e,t,i,n,s,o,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=o,this._configService=a,this._languageFeaturesService=l,this._dispoableStore=new X,this._cts=new ji,this._renameInputField=this._dispoableStore.add(new ja(()=>this._dispoableStore.add(this._instaService.createInstance(_D,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))))}static get(e){return e.getContribution(iW.ID)}dispose(){this._dispoableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return Id(this,void 0,void 0,function*(){if(this._cts.dispose(!0),!this.editor.hasModel())return;const i=this.editor.getPosition(),n=new CI(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!n.hasProvider())return;this._cts=new Uf(this.editor,5);let s;try{const u=n.resolveRenameLocation(this._cts.token);this._progressService.showWhile(u,250),s=yield u}catch(u){(e=ls.get(this.editor))===null||e===void 0||e.showMessage(u||f("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}if(!s)return;if(s.rejectReason){(t=ls.get(this.editor))===null||t===void 0||t.showMessage(s.rejectReason,i);return}if(this._cts.token.isCancellationRequested)return;this._cts.dispose(),this._cts=new Uf(this.editor,5,s.range);let o=this.editor.getSelection(),a=0,l=s.text.length;!S.isEmpty(o)&&!S.spansMultipleLines(o)&&S.containsRange(s.range,o)&&(a=Math.max(0,o.startColumn-s.range.startColumn),l=Math.min(s.range.endColumn,o.endColumn)-s.range.startColumn);const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),c=yield this._renameInputField.value.getInput(s.range,s.text,a,l,d,this._cts.token);if(typeof c=="boolean"){c&&this.editor.focus();return}this.editor.focus();const h=YD(n.provideRenameEdits(c.newName,this._cts.token),this._cts.token).then(u=>Id(this,void 0,void 0,function*(){if(!(!u||!this.editor.hasModel())){if(u.rejectReason){this._notificationService.info(u.rejectReason);return}this.editor.setSelection(S.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply($v.convert(u),{editor:this.editor,showPreview:c.wantsPreview,label:f("label","Renaming '{0}'",s==null?void 0:s.text),quotableLabel:f("quotableLabel","Renaming {0}",s==null?void 0:s.text)}).then(g=>{g.ariaSummary&&Mi(f("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,c.newName,g.ariaSummary))}).catch(g=>{this._notificationService.error(f("rename.failedApply","Rename failed to apply edits")),this._logService.error(g)})}}),u=>{this._notificationService.error(f("rename.failed","Rename failed to compute edits")),this._logService.error(u)});return this._progressService.showWhile(h,250),h})}acceptRenameInput(e){this._renameInputField.value.acceptInput(e)}cancelRenameInput(){this._renameInputField.value.cancelInput(!0)}};rc.ID="editor.contrib.renameController";rc=Nse([$l(1,ze),$l(2,ii),$l(3,Zx),$l(4,El),$l(5,Ys),$l(6,QD),$l(7,le)],rc);class Mse extends re{constructor(){super({id:"editor.action.rename",label:f("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:ie.and(k.writable,k.hasRenameProvider),kbOpts:{kbExpr:k.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(lt),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return xe.isUri(n)&&P.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(o=>{o&&(o.setPosition(s),o.invokeWithinContext(a=>(this.rep
- `+s;break;case 2:n+=`
- `+si.auto_on;break;case 1:n+=`
- `+si.auto_off,n+=" "+s;break}e.get(130)?n+=`
- `+this._descriptionForCommand(_u.ID,si.tabFocusModeOnMsg,si.tabFocusModeOnMsgNoKb):n+=`
- `+this._descriptionForCommand(_u.ID,si.tabFocusModeOffMsg,si.tabFocusModeOffMsgNoKb);const o=He?si.openDocMac:si.openDocWinLinux;n+=`
- `+o,n+=`
`+si.outroMsg,this._contentDomNode.domNode.appendChild(RO(n)),this._contentDomNode.domNode.setAttribute("aria-label",n)}hide(){this._isVisible&&(this._isVisible=!1,this._isVisibleKey.reset(),this._domNode.setDisplay("none"),this._domNode.setAttribute("aria-hidden","true"),this._contentDomNode.domNode.tabIndex=-1,gi(this._contentDomNode.domNode),this._editor.focus())}_layout(){const e=this._editor.getLayoutInfo(),t=Math.max(5,Math.min(T_.WIDTH,e.width-40)),i=Math.max(5,Math.min(T_.HEIGHT,e.height-40));this._domNode.setWidth(t),this._domNode.setHeight(i);const n=Math.round((e.height-i)/2);this._domNode.setTop(n);const s=Math.round((e.width-t)/2);this._domNode.setLeft(s)}};Cu.ID="editor.contrib.accessibilityHelpWidget";Cu.WIDTH=500;Cu.HEIGHT=300;Cu=mW([E_(1,ke),E_(2,qt),E_(3,Is)],Cu);class Koe extends re{constructor(){super({id:"editor.action.showAccessibilityHelp",label:si.showAccessibilityHelpAction,alias:"Show Accessibility Help",precondition:void 0,kbOpts:{primary:571,weight:100,linux:{primary:1595,secondary:[571]}}})}run(e,t){const i=lc.get(t);i&&i.show()}}rt(lc.ID,lc);J(Koe);const qoe=Pi.bindToContribution(lc.get);Q(new qoe({id:"closeAccessibilityHelp",precondition:_W,handler:r=>r.hide(),kbOpts:{weight:100+100,kbExpr:k.focus,primary:9,secondary:[1033]}}));xt((r,e)=>{const t=r.getColor(rn);t&&e.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${t}; }`);const i=r.getColor(ta);i&&e.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${i}; }`);const n=r.getColor(ul);n&&e.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${n}; }`);const s=r.getColor(Rt);s&&e.addRule(`.monaco-editor .accessibilityHelpWidget { border: 2px solid ${s}; }`)});class LD extends V{constructor(e){super(),this.editor=e,this.widget=null,wo&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(81);!this.widget&&e?this.widget=new ZC(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}LD.ID="editor.contrib.iPadShowKeyboard";class ZC extends V{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(Z(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(Z(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return ZC.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}ZC.ID="editor.contrib.ShowKeyboardWidget";rt(LD.ID,LD);var Goe=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eR=globalThis&&globalThis.__param||function(r,e){return function(t,i){e(t,i,r)}};let wu=class vW extends V{constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(Ot.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}static get(e){return e.getContribution(vW.ID)}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new YC(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};wu.ID="editor.contrib.inspectTokens";wu=Goe([eR(1,ds),eR(2,Ft)],wu);class Zoe extends re{constructor(){super({id:"editor.action.inspectTokens",label:c0.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=wu.get(t);i&&i.launch()}}function Yoe(r){let e="";for(let t=0,i=r.length;t<i;t++){const n=r.charCodeAt(t);switch(n){case
`):r}function rR(r){return typeof r.code=="string"&&typeof r.errno=="number"&&typeof r.syscall=="string"?f("nodeExceptionMessage","A system error occurred ({0})",r.message):r.message||f("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function LW(r=null,e=!1){if(!r)return f("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(r)){const t=hc(r),i=LW(t[0],e);return t.length>1?f("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(qs(r))return r;if(r.detail){const t=r.detail;if(t.error)return ay(t.error,e);if(t.exception)return ay(t.exception,e)}return r.stack?ay(r,e):r.message?r.message:f("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var Qm=globalThis&&globalThis.__awaiter||function(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{d(i.next(c))}catch(h){o(h)}}function l(c){try{d(i.throw(c))}catch(h){o(h)}}function d(c){c.done?s(c.value):n(c.value).then(a,l)}d((i=i.apply(r,e||[])).next())})},bh;(function(r){r[r.NO_ACTION=0]="NO_ACTION",r[r.CLOSE_PICKER=1]="CLOSE_PICKER",r[r.REFRESH_PICKER=2]="REFRESH_PICKER",r[r.REMOVE_ITEM=3]="REMOVE_ITEM"})(bh||(bh={}));function ly(r){const e=r;return Array.isArray(e.items)}function dre(r){const e=r;return!!e.picks&&e.additionalPicks instanceof Promise}class QC extends V{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t){var i;const n=new X;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const o=n.add(new an),a=()=>Qm(this,void 0,void 0,function*(){const l=o.value=new X;s==null||s.dispose(!0),e.busy=!1,s=new ji(t);const d=s.token,c=e.value.substr(this.prefix.length).trim(),h=this._getPicks(c,l,d),u=(g,p)=>{var m;let _,b;if(ly(g)?(_=g.items,b=g.active):_=g,_.length===0){if(p)return!1;c.length>0&&(!((m=this.options)===null||m===void 0)&&m.noResultsPick)&&(_=[this.options.noResultsPick])}return e.items=_,b&&(e.activeItems=[b]),!0};if(h!==null)if(dre(h)){let g=!1,p=!1;yield Promise.all([(()=>Qm(this,void 0,void 0,function*(){yield al(QC.FAST_PICKS_RACE_DELAY),!d.isCancellationRequested&&(p||(g=u(h.picks,!0)))}))(),(()=>Qm(this,void 0,void 0,function*(){e.busy=!0;try{const m=yield h.additionalPicks;if(d.isCancellationRequested)return;let _,b;ly(h.picks)?(_=h.picks.items,b=h.picks.active):_=h.picks;let v,C;if(ly(m)?(v=m.items,C=m.active):v=m,v.length>0||!g){let w;if(!b&&!C){const L=e.activeItems[0];L&&_.indexOf(L)!==-1&&(w=L)}u({items:[..._,...v],active:b||C||w})}}finally{d.isCancellationRequested||(e.busy=!1),p=!0}}))()])}else if(!(h instanceof Promise))u(h);else{e.busy=!0;try{const g=yield h;if(d.isCancellationRequested)return;u(g)}finally{d.isCancellationRequested||(e.busy=!1)}}});return n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(l=>{const[d]=e.selectedItems;typeof(d==null?void 0:d.accept)=="function"&&(l.inBackground||e.hide(),d.accept(e.keyMods,l))})),n.add(e.onDidTriggerItemButton(({button:l,item:d})=>Qm(this,void 0,void 0,function*(){var c,h;if(typeof d.trigger=="function"){const u=(h=(c=d.buttons)===null||c===void 0?void 0:c.indexOf(l))!==null&&h!==void 0?h:-1;if(u>=0){const g=d.trigger(u,e.keyMods),p=typeof g=="number"?g:yield g;if(t.isCancellationRequested)return;switch(p){case bh.NO_ACTION:break;case bh.CLOSE_PICKER:e.hide();break;case bh.REFRESH_PICKER:a();break;case bh.REMOVE_ITEM:{const m=e.items.indexOf(d);if(m!==-1){const _=e.items.slice(),b=_.splice(m,1),v=e.activeItems.filter(w=>w!==b[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=_,v&&(e.activeItems=v),e.keepScrollPosition=C}break}}}}}))),n}}QC.FAST_PICKS_RACE_DELAY=200;var DW=globalThis&&globalThis.__decorate||function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var a=r.length-1