@arcgis/coding-components 4.32.0-next.25 → 4.32.0-next.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/arcgis-coding-components/{JIYPI2Z3.js → 2GM3S77W.js} +3 -3
  2. package/dist/arcgis-coding-components/{LV7EVO7H.js → 2K26ZBC4.js} +2 -2
  3. package/dist/arcgis-coding-components/{NC3PN2NR.js → 4DYSWZFJ.js} +2 -2
  4. package/dist/arcgis-coding-components/{WLD6MFDT.js → 4MCCKOVD.js} +2 -2
  5. package/dist/arcgis-coding-components/{6YVXIZ7U.js → 6ACWHUXK.js} +2 -2
  6. package/dist/arcgis-coding-components/{NHA4D3BI.js → 6CGLND5B.js} +2 -2
  7. package/dist/arcgis-coding-components/{FOC2DNVY.js → 6OGS5H5Q.js} +2 -2
  8. package/dist/arcgis-coding-components/{EZBUVQRS.js → AP4REIB2.js} +1 -1
  9. package/dist/arcgis-coding-components/{OAEZNZNN.js → APEX2ZKJ.js} +2 -2
  10. package/dist/arcgis-coding-components/{A472BR5Q.js → BBB627PF.js} +2 -2
  11. package/dist/arcgis-coding-components/{OQ2BKV5O.js → BHWJGQJR.js} +2 -2
  12. package/dist/arcgis-coding-components/{Y5FMMVG7.js → DZJKFYWO.js} +2 -2
  13. package/dist/arcgis-coding-components/{VZ5QREO7.js → GB5IRZSF.js} +2 -2
  14. package/dist/arcgis-coding-components/{GDOMACPT.js → GLESNFVO.js} +2 -2
  15. package/dist/arcgis-coding-components/{Y63SEDWY.js → GLQTWXTY.js} +2 -2
  16. package/dist/arcgis-coding-components/{EPHSATFN.js → IHB5F7HJ.js} +2 -2
  17. package/dist/arcgis-coding-components/{X5XMNTF3.js → KKSMXQMN.js} +1 -1
  18. package/dist/arcgis-coding-components/{HFBNY3ZZ.js → LB3V3VCM.js} +1 -1
  19. package/dist/arcgis-coding-components/{FZLNQLY5.js → LXKAY3SY.js} +2 -2
  20. package/dist/arcgis-coding-components/{WQMOBCBC.js → MQFLOGVR.js} +2 -2
  21. package/dist/arcgis-coding-components/{MMUON6QW.js → MXDKQ4RZ.js} +2 -2
  22. package/dist/arcgis-coding-components/{ACYNEB2A.js → MXLXQXRR.js} +2 -2
  23. package/dist/arcgis-coding-components/{GBD5KEMW.js → OY4R7FE6.js} +2 -2
  24. package/dist/arcgis-coding-components/{MFRGI6YL.js → OZT67VHV.js} +2 -2
  25. package/dist/arcgis-coding-components/{VIUXAXQM.js → R7L3NSTG.js} +2 -2
  26. package/dist/arcgis-coding-components/{ZWJVQOGA.js → SAVSDVAN.js} +2 -2
  27. package/dist/arcgis-coding-components/{5MCVJSAI.js → SO6LKGBJ.js} +1 -1
  28. package/dist/arcgis-coding-components/{3WFDPDKQ.js → TBN4ZWJN.js} +2 -2
  29. package/dist/arcgis-coding-components/{64DP7IOJ.js → TMENAJDV.js} +2 -2
  30. package/dist/arcgis-coding-components/{5XCCTH27.js → UVUHHWFK.js} +2 -2
  31. package/dist/arcgis-coding-components/{BEBA4ZHU.js → WALNSZAP.js} +2 -2
  32. package/dist/arcgis-coding-components/{Y6FGFD3R.js → WJQCH5MH.js} +2 -2
  33. package/dist/arcgis-coding-components/{PHUJOJZX.js → XXO3TXD5.js} +2 -2
  34. package/dist/arcgis-coding-components/{A5H3ENJV.js → YBU23HBJ.js} +2 -2
  35. package/dist/arcgis-coding-components/{JCRSUHVS.js → ZD727B66.js} +2 -2
  36. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  37. package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +1 -1
  38. package/dist/chunks/arcade-defaults.js +1 -1
  39. package/dist/chunks/arcade-executor.js +1 -1
  40. package/dist/chunks/arcade-mode.js +1 -1
  41. package/dist/chunks/arcade-service-accessors.js +1 -1
  42. package/dist/chunks/fields.js +1 -1
  43. package/dist/chunks/language-defaults-base.js +1 -1
  44. package/dist/chunks/markdown.js +1 -1
  45. package/dist/chunks/monaco-importer.js +1 -1
  46. package/dist/chunks/runtime.js +1 -1
  47. package/dist/chunks/sql-expr-defaults.js +1 -1
  48. package/dist/chunks/sql-expr-mode.js +1 -1
  49. package/dist/chunks/useT9n.js +1 -1
  50. package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
  51. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  52. package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
  53. package/dist/components/arcgis-code-editor/customElement.js +1 -1
  54. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  55. package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
  56. package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
  57. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  58. package/dist/docs/api.json +2 -2
  59. package/dist/docs/docs.json +2 -2
  60. package/dist/docs/web-types.json +1 -1
  61. package/dist/index.js +1 -1
  62. package/dist/loader.js +1 -1
  63. package/package.json +7 -7
@@ -1,9 +1,9 @@
1
1
  /*!
2
2
  * All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  * See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
- * v4.32.0-next.25
4
+ * v4.32.0-next.26
5
5
  */
6
- import{n as Yy}from"./5MCVJSAI.js";import{$ as me,$a as Cx,$b as Px,$c as cl,$d as Dr,$e as go,$f as Hh,$g as Pf,$h as Wn,$i as Yf,$j as uL,A as F,Aa as ne,Ab as Ms,Ac as Bo,Ad as w,Ae as cI,Af as Ah,Ag as Ll,Ah as rt,Ai as jf,Aj as At,B as Ln,Ba as pt,Bb as B,Bc as dl,Bd as Cf,Be as hI,Bf as RI,Bg as Kh,Bh as Yh,Bi as O0,Bj as oL,C as Gt,Ca as R,Cb as Et,Cc as ao,Cd as Xx,Ce as IM,Cf as Mf,Cg as An,Ch as Nl,Ci as A0,Cj as Jf,D as rx,Da as ke,Db as ge,Dc as De,Dd as W,De as Os,Df as TI,Dg as Nr,Dh as p0,Di as F0,Dj as vo,E as Dn,Ea as b,Eb as _e,Ec as Ch,Ed as Z,Ee as LM,Ef as PI,Eg as qh,Eh as Fn,Ei as nu,Ej as Ol,F as sh,Fa as q,Fb as Rt,Fc as Zt,Fd as Ts,Fe as uI,Ff as OI,Fg as Gh,Fh as Zh,Fi as ru,Fj as li,G as il,Ga as V,Gb as ze,Gc as zx,Gd as ul,Ge as DM,Gf as AI,Gg as _,Gh as El,Gi as W0,Gj as e_,H as sx,Ha as ut,Hb as Ri,Hc as fe,Hd as SM,He as ml,Hf as FI,Hg as we,Hh as ye,Hi as en,Hj as nL,I as ah,Ia as $,Ib as gt,Ic as yt,Id as Jx,Ie as kh,If as WI,Ig as Hs,Ih as Zo,Ii as it,Ij as Vt,J as ax,Ja as Nt,Jb as ro,Jc as Rs,Jd as wM,Je as Mh,Jf as zI,Jg as Dl,Jh as m0,Ji as tn,Jj as rL,K as $t,Ka as sl,Kb as so,Kc as Sh,Kd as Lh,Ke as nt,Kf as HI,Kg as ZI,Kh as Ai,Ki as su,Kj as sL,L as gi,La as no,Lb as Sr,Lc as Hx,Ld as eI,Le as jo,Lf as mo,Lg as QI,Lh as Qo,Li as ft,Lj as aL,M as ol,Ma as px,Mb as pf,Mc as Vo,Md as se,Me as gI,Mf as Cl,Mg as NM,Mh as f0,Mi as Kf,Mj as gu,N as lh,Na as Vi,Nb as Rx,Nc as ii,Nd as at,Ne as Lf,Nf as Sl,Ng as XI,Nh as Xo,Ni as Tl,Nj as qi,O as lx,Oa as al,Ob as Ns,Oc as ce,Od as tt,Oe as As,Of as wl,Og as Bs,Oh as zf,Oi as qf,Oj as lL,P as dx,Pa as mx,Pb as le,Pc as wi,Pd as Ti,Pe as fl,Pf as yl,Pg as EM,Ph as _0,Pi as on,Pj as pu,Q as kn,Qa as fx,Qb as ti,Qc as Bx,Qd as Pt,Qe as pI,Qf as BI,Qg as JI,Qh as v0,Qi as Gf,Qj as dL,R as dh,Ra as _x,Rb as Ne,Rc as Vx,Rd as Uo,Re as mI,Rf as Fh,Rg as RM,Rh as Hf,Ri as z0,Rj as bo,S as oo,Sa as xs,Sb as ae,Sc as wh,Sd as lt,Se as Nh,Sf as Fs,Sg as e0,Sh as b0,Si as au,Sj as Al,T as ch,Ta as vx,Tb as Ue,Tc as _f,Td as Sf,Te as Df,Tf as Nf,Tg as TM,Th as C0,Ti as H0,Tj as cL,U as nl,Ua as lf,Ub as x,Uc as Ux,Ud as Lr,Ue as uo,Uf as xl,Ug as t0,Uh as Bf,Ui as B0,Uj as mu,V as ee,Va as Is,Vb as Tx,Vc as Rn,Vd as wf,Ve as z,Vf as Qt,Vg as PM,Vh as S0,Vi as V0,Vj as Co,W as pe,Wa as Ht,Wb as X,Wc as be,Wd as Ps,We as A,Wf as Wh,Wg as i0,Wh as Vf,Wi as U0,Wj as hL,X as Ei,Xa as bx,Xb as G,Xc as jx,Xd as yf,Xe as fI,Xf as Lt,Xg as OM,Xh as Qh,Xi as j0,Xj as Tr,Y as hh,Ya as _M,Yb as re,Yc as Kx,Yd as he,Ye as _l,Yf as zh,Yg as o0,Yh as w0,Yi as Pl,Yj as t_,Z as bi,Za as Ls,Zb as mf,Zc as et,Zd as It,Ze as _I,Zf as Go,Zg as AM,Zh as Er,Zi as $f,Zj as fu,_ as rl,_a as df,_b as vM,_c as oi,_d as tI,_e as Oi,_f as Ef,_g as n0,_h as y0,_i as lu,_j as _u,a as ui,aa as uh,ab as Ds,ac as bM,ad as qx,ae as xf,af as Eh,ag as VI,ah as $h,ai as fo,aj as Zf,ak as i_,b as br,ba as cx,bb as Wo,bc as wt,bd as Gx,be as Tn,bf as Rh,bg as UI,bh as r0,bi as Xh,bj as Qf,bk as gL,c as Zy,ca as gh,cb as Sx,cc as zo,cd as yh,ce as yM,cf as vI,cg as kM,ch as Xt,ci as x0,cj as K0,ck as pL,d as of,da as $e,db as wx,dc as Ci,dd as $x,de as si,df as bI,dg as $o,dh as s0,di as I0,dj as _o,e as zt,ea as sf,eb as Cr,ec as ff,ed as hl,ee as lo,ef as CI,eg as jI,eh as Vs,ei as L0,ej as q0,f as Qy,fa as xe,fb as ll,fc as Ox,fd as Yx,fe as kr,ff as Th,fg as Ws,fh as a0,fi as D0,fj as Ot,g as Ge,ga as L,gb as Ze,gc as O,gd as vf,ge as Pn,gf as Ko,gg as Bh,gh as l0,gi as k0,gj as G0,h as Xy,ha as I,hb as ks,hc as Ho,hd as Pe,he as iI,hf as Ph,hg as Rf,hh as kl,hi as M0,hj as $0,i as oh,ia as Ye,ib as cf,ic as Yt,id as xr,ie as xM,if as SI,ig as KI,ih as yi,ii as Rr,ij as Y0,j as Jy,ja as hx,jb as yx,jc as Ax,jd as Ui,je as If,jf as wI,jg as qI,jh as d0,ji as Jo,jj as du,k as ex,ka as E,kb as hf,kc as wr,kd as T,ke as oI,kf as yI,kg as dt,kh as FM,ki as Jh,kj as Z0,l as Fe,la as st,lb as uf,lc as Tt,ld as Ir,le as Dh,lf as xI,lg as Ae,lh as Of,li as eu,lj as cu,m as nh,ma as Ao,mb as Mn,mc as ve,md as P,me as nI,mf as vl,mg as On,mh as Us,mi as N0,n as rh,na as Me,nb as xx,nc as Je,nd as Zx,ne as rI,nf as II,ng as Dt,nh as te,ni as E0,nj as Ve,o as nf,oa as K,ob as Ix,oc as pi,od as Bt,oe as gl,of as bl,og as Vh,oh as mt,oi as Qe,oj as hu,p as tl,pa as af,pb as Lx,pc as yr,pd as xt,pe as Pi,pf as po,pg as GI,ph as c0,pi as zn,pj as Q0,q as tx,qa as Ie,qb as Dx,qc as Nn,qd as Qx,qe as co,qf as qo,qg as Ce,qh as Af,qi as tu,qj as X0,r as ue,ra as Y,rb as mh,rc as vh,rd as xh,re as sI,rf as LI,rg as Tf,rh as Ff,ri as R0,rj as J0,rk as Bn,s as In,sa as We,sb as kx,sc as bh,sd as de,se as ji,sf as Mr,sg as MM,sh as Wf,si as T0,sj as eL,t as ix,ta as Te,tb as fh,tc as Fx,td as Ih,te as pl,tf as DI,tg as $I,th as Ml,ti as P0,tj as uu,u as St,ua as Ee,ub as gf,uc as Wx,ud as je,ue as ie,uf as kf,ug as Yo,uh as js,ui as iu,uj as Xf,v as ox,va as Fo,vb as Be,vc as CM,vd as k,ve as ho,vf as kI,vg as YI,vh as He,vi as ou,vj as Ki,w as ws,wa as ux,wb as Mx,wc as Se,wd as bf,we as aI,wf as MI,wg as Uh,wh as h0,wi as Rl,wj as tL,x as rf,xa as ys,xb as Nx,xc as En,xd as ni,xe as N,xf as Oh,xg as jh,xh as Ks,xi as ai,xj as iL,y as h,ya as ph,yb as Ex,yc as Si,yd as ri,ye as lI,yf as NI,yg as zs,yh as u0,yi as qs,yj as Hn,z as nx,za as gx,zb as _h,zc as Es,zd as H,ze as dI,zf as EI,zg as Il,zh as g0,zi as Uf}from"./OAEZNZNN.js";import{a as tf,b as Gy,d as $y}from"./HFBNY3ZZ.js";var nm,Dk=tf(()=>{ut();nm=class{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){let o=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new V(o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn),o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn)):new V(o.endLineNumber,o.endColumn-this._text.length,o.endLineNumber,o.endColumn)}}});var kk=tf(()=>{});var Mk=Gy(bc=>{fe();me();Tr();Z();q();ut();we();mt();su();F();Dk();kk();var lT=bc&&bc.__decorate||function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},dT=bc&&bc.__param||function(s,e){return function(t,i){e(t,i,s)}},rm,lr=rm=class{static get(e){return e.getContribution(rm.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var i;(i=this.currentRequest)===null||i===void 0||i.cancel();let o=this.editor.getSelection(),n=this.editor.getModel();if(!n||!o)return;let r=o;if(r.startLineNumber!==r.endLineNumber)return;let a=new mu(this.editor,5),l=n.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Se(d=>this.editorWorkerService.navigateValueSet(l,r,t)),this.currentRequest.then(d=>{var c;if(!d||!d.range||!d.value||!a.validate(this.editor))return;let u=b.lift(d.range),g=d.range,p=d.value.length-(r.endColumn-r.startColumn);g={startLineNumber:g.startLineNumber,startColumn:g.startColumn,endLineNumber:g.endLineNumber,endColumn:g.startColumn+d.value.length},p>1&&(r=new V(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+p-1));let m=new nm(u,r,d.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,m),this.editor.pushUndoStop(),this.decorations.set([{range:g,options:rm.DECORATION}]),(c=this.decorationRemover)===null||c===void 0||c.cancel(),this.decorationRemover=Es(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(ee)}).catch(ee)):Promise.resolve(void 0)}};lr.ID="editor.contrib.inPlaceReplaceController";lr.DECORATION=te.register({description:"in-place-replace",className:"valueSetReplacement"});lr=rm=lT([dT(1,tn)],lr);var bS=class extends k{constructor(){super({id:"editor.action.inPlaceReplace.up",label:h("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:_.writable,kbOpts:{kbExpr:_.editorTextFocus,primary:3159,weight:100}})}run(e,t){let i=lr.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}},CS=class extends k{constructor(){super({id:"editor.action.inPlaceReplace.down",label:h("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:_.writable,kbOpts:{kbExpr:_.editorTextFocus,primary:3161,weight:100}})}run(e,t){let i=lr.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}};W(lr.ID,lr,4);w(bS);w(CS)});var tM=tf(()=>{});var oM=Gy(Gc=>{tM();de();ho();E();Z();Ht();LM();IM();Ti();Xf();Er();var dP=Gc&&Gc.__decorate||function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},iM=Gc&&Gc.__param||function(s,e){return function(t,i){e(t,i,s)}},Py,$a=Py=class extends I{static get(e){return e.getContribution(Py.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(o=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(o=>this.stop())),this._register(Is.onDidChange(o=>this.stop())),this._register(this._editor.onKeyUp(o=>o.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new Ym(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};$a.ID="editor.contrib.inspectTokens";$a=Py=dP([iM(1,uu),iM(2,tt)],$a);var Oy=class extends k{constructor(){super({id:"editor.action.inspectTokens",label:C0.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){let i=$a.get(t);i?.launch()}};function cP(s){let e="";for(let t=0,i=s.length;t<i;t++){let o=s.charCodeAt(t);switch(o){case 9:e+="\u2192";break;case 32:e+="\xB7";break;default:e+=String.fromCharCode(o)}}return e}function hP(s,e){let t=Is.get(e);if(t)return t;let i=s.encodeLanguageId(e);return{getInitialState:()=>dI,tokenize:(o,n,r)=>cI(e,r),tokenizeEncoded:(o,n,r)=>hI(i,r)}}var Ym=class s extends I{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=hP(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return s._ID}_compute(e){let t=this._getTokensAtLine(e.lineNumber),i=0;for(let l=t.tokens1.length-1;l>=0;l--){let d=t.tokens1[l];if(e.column-1>=d.offset){i=l;break}}let o=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){o=l;break}let n=this._model.getLineContent(e.lineNumber),r="";if(i<t.tokens1.length){let l=t.tokens1[i].offset,d=i+1<t.tokens1.length?t.tokens1[i+1].offset:n.length;r=n.substring(l,d)}Ir(this._domNode,P("h2.tm-token",void 0,cP(r),P("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),T(this._domNode,P("hr.tokens-inspect-separator",{style:"clear:both"}));let a=(o<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(o<<1)+1]):null;T(this._domNode,P("table.tm-metadata-table",void 0,P("tbody",void 0,P("tr",void 0,P("td.tm-metadata-key",void 0,"language"),P("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),P("tr",void 0,P("td.tm-metadata-key",void 0,"token type"),P("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),P("tr",void 0,P("td.tm-metadata-key",void 0,"font style"),P("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),P("tr",void 0,P("td.tm-metadata-key",void 0,"foreground"),P("td.tm-metadata-value",void 0,`${a?ie.Format.CSS.formatHex(a.foreground):"-?-"}`)),P("tr",void 0,P("td.tm-metadata-key",void 0,"background"),P("td.tm-metadata-value",void 0,`${a?ie.Format.CSS.formatHex(a.background):"-?-"}`))))),T(this._domNode,P("hr.tokens-inspect-separator")),i<t.tokens1.length&&T(this._domNode,P("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){let t=Is.getColorMap(),i=Os.getLanguageId(e),o=Os.getTokenType(e),n=Os.getFontStyle(e),r=Os.getForeground(e),a=Os.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:o,fontStyle:n,foreground:t[r],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){let t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),o=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:o.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};Ym._ID="editor.contrib.inspectTokensWidget";W($a.ID,$a,4);w(Oy)});var WM=Object.defineProperty,zM=Object.getOwnPropertyDescriptor,HM=Object.getOwnPropertyNames,BM=Object.prototype.hasOwnProperty,mL=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of HM(e))!BM.call(s,o)&&o!==t&&WM(s,o,{get:()=>e[o],enumerable:!(i=zM(e,o))||i.enumerable});return s},VM=(s,e,t)=>(mL(s,e,"default"),t&&mL(t,e,"default")),Fl={};VM(Fl,Bn);var fL={},o_={},_L=class{static getOrCreate(s){return o_[s]||(o_[s]=new _L(s)),o_[s]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(s){this._languageId=s,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,fL[this._languageId].loader().then(s=>this._lazyLoadPromiseResolve(s),s=>this._lazyLoadPromiseReject(s))),this._lazyLoadPromise}};function Vn(s){let e=s.id;fL[e]=s,Fl.languages.register(s);let t=_L.getOrCreate(e);Fl.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Fl.languages.onLanguageEncountered(e,async()=>{let i=await t.load();Fl.languages.setLanguageConfiguration(e,i.conf)})}Vn({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>import("./WLD6MFDT.js")});Vn({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>import("./EPHSATFN.js")});Vn({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>import("./Y63SEDWY.js")});Vn({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>import("./A5H3ENJV.js")});var UM=Object.defineProperty,jM=Object.getOwnPropertyDescriptor,KM=Object.getOwnPropertyNames,qM=Object.prototype.hasOwnProperty,vL=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of KM(e))!qM.call(s,o)&&o!==t&&UM(s,o,{get:()=>e[o],enumerable:!(i=jM(e,o))||i.enumerable});return s},GM=(s,e,t)=>(vL(s,e,"default"),t&&vL(t,e,"default")),Gs={};GM(Gs,Bn);var n_=class{_onDidChange=new Gs.Emitter;_options;_modeConfiguration;_languageId;constructor(s,e,t){this._languageId=s,this.setOptions(e),this.setModeConfiguration(t)}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(s){this._options=s||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(s){this.setOptions(s)}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(this)}},r_={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},s_={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},bL=new n_("css",r_,s_),CL=new n_("scss",r_,s_),SL=new n_("less",r_,s_);Gs.languages.css={cssDefaults:bL,lessDefaults:SL,scssDefaults:CL};function a_(){return import("./FZLNQLY5.js")}Gs.languages.onLanguage("less",()=>{a_().then(s=>s.setupMode(SL))});Gs.languages.onLanguage("scss",()=>{a_().then(s=>s.setupMode(CL))});Gs.languages.onLanguage("css",()=>{a_().then(s=>s.setupMode(bL))});var $M=Object.defineProperty,YM=Object.getOwnPropertyDescriptor,ZM=Object.getOwnPropertyNames,QM=Object.prototype.hasOwnProperty,wL=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ZM(e))!QM.call(s,o)&&o!==t&&$M(s,o,{get:()=>e[o],enumerable:!(i=YM(e,o))||i.enumerable});return s},XM=(s,e,t)=>(wL(s,e,"default"),t&&wL(t,e,"default")),vu={};XM(vu,Bn);var JM=class{_onDidChange=new vu.Emitter;_options;_modeConfiguration;_languageId;constructor(s,e,t){this._languageId=s,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(s){this._options=s||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(this)}},eN={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"},bu={format:eN,suggest:{},data:{useDefaultDataProvider:!0}};function Cu(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===Wl,documentFormattingEdits:s===Wl,documentRangeFormattingEdits:s===Wl}}var Wl="html",yL="handlebars",xL="razor",IL=Su(Wl,bu,Cu(Wl)),tN=IL.defaults,LL=Su(yL,bu,Cu(yL)),iN=LL.defaults,DL=Su(xL,bu,Cu(xL)),oN=DL.defaults;vu.languages.html={htmlDefaults:tN,razorDefaults:oN,handlebarDefaults:iN,htmlLanguageService:IL,handlebarLanguageService:LL,razorLanguageService:DL,registerHTMLLanguageService:Su};function nN(){return import("./ZWJVQOGA.js")}function Su(s,e=bu,t=Cu(s)){let i=new JM(s,e,t),o,n=vu.languages.onLanguage(s,async()=>{o=(await nN()).setupMode(i)});return{defaults:i,dispose(){n.dispose(),o?.dispose(),o=void 0}}}var rN=Object.defineProperty,sN=Object.getOwnPropertyDescriptor,aN=Object.getOwnPropertyNames,lN=Object.prototype.hasOwnProperty,kL=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of aN(e))!lN.call(s,o)&&o!==t&&rN(s,o,{get:()=>e[o],enumerable:!(i=sN(e,o))||i.enumerable});return s},dN=(s,e,t)=>(kL(s,e,"default"),t&&kL(t,e,"default")),zl={};dN(zl,Bn);var cN=class{_onDidChange=new zl.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(s,e,t){this._languageId=s,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(s){this._diagnosticsOptions=s||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(this)}},hN={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},uN={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},ML=new cN("json",hN,uN);zl.languages.json={jsonDefaults:ML};function gN(){return import("./Y6FGFD3R.js")}zl.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});zl.languages.onLanguage("json",()=>{gN().then(s=>s.setupMode(ML))});de();Nt();Z();Rt();we();F();Je();Ue();at();re();var l_=class extends Tt{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:h("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:$.map,toggled:x.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:x.has("isInDiffEditor"),menu:{when:x.has("isInDiffEditor"),id:O.EditorTitle,order:22,group:"navigation"}})}run(e,...t){let i=e.get(se),o=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}};ve(l_);var wu=class extends Tt{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:h("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:x.has("isInDiffEditor")})}run(e,...t){let i=e.get(se),o=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",o)}};ve(wu);var yu=class extends Tt{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:h("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:x.has("isInDiffEditor")})}run(e,...t){let i=e.get(se),o=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}};ve(yu);Yt.appendMenuItem(O.EditorTitle,{command:{id:new yu().desc.id,title:h("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:x.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:x.has("isInDiffEditor")},order:11,group:"1_diff",when:x.and(_.diffEditorRenderSideBySideInlineBreakpointReached,x.has("isInDiffEditor"))});Yt.appendMenuItem(O.EditorTitle,{command:{id:new wu().desc.id,title:h("showMoves","Show Moved Code Blocks"),icon:$.move,toggled:Tx.create("config.diffEditor.experimental.showMoves",!0),precondition:x.has("isInDiffEditor")},order:10,group:"1_diff",when:x.has("isInDiffEditor")});var xu={value:h("diffEditor","Diff Editor"),original:"Diff Editor"},d_=class extends ni{constructor(){super({id:"diffEditor.switchSide",title:{value:h("switchSide","Switch Side"),original:"Switch Side"},icon:$.arrowSwap,precondition:x.has("isInDiffEditor"),f1:!0,category:xu})}runEditorCommand(e,t,i){let o=Ys(e);if(o instanceof Al){if(i&&i.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}};ve(d_);var c_=class extends ni{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:h("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:$.close,precondition:_.comparingMovedCode,f1:!1,category:xu,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){let o=Ys(e);o instanceof Al&&o.exitCompareMove()}};ve(c_);var h_=class extends ni{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:h("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:$.fold,precondition:x.has("isInDiffEditor"),f1:!0,category:xu})}runEditorCommand(e,t,...i){let o=Ys(e);o instanceof Al&&o.collapseAllUnchangedRegions()}};ve(h_);var u_=class extends ni{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:h("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:$.unfold,precondition:x.has("isInDiffEditor"),f1:!0,category:xu})}runEditorCommand(e,t,...i){let o=Ys(e);o instanceof Al&&o.showAllUnchangedRegions()}};ve(u_);var NL={value:h("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"},$s=class s extends Tt{constructor(){super({id:s.id,title:{value:h("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:NL,precondition:x.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){let t=Ys(e);t?.accessibleDiffViewerNext()}};$s.id="editor.action.accessibleDiffViewer.next";Yt.appendMenuItem(O.EditorTitle,{command:{id:$s.id,title:h("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:x.has("isInDiffEditor")},order:10,group:"2_diff",when:x.and(_.accessibleDiffViewerVisible.negate(),x.has("isInDiffEditor"))});var Hl=class s extends Tt{constructor(){super({id:s.id,title:{value:h("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:NL,precondition:x.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){let t=Ys(e);t?.accessibleDiffViewerPrev()}};Hl.id="editor.action.accessibleDiffViewer.prev";function Ys(s){var e;let t=s.get(_e),i=t.listDiffEditors(),o=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!o)return null;for(let r=0,a=i.length;r<a;r++){let l=i[r];if(l.getModifiedEditor().getId()===o.getId()||l.getOriginalEditor().getId()===o.getId())return l}let n=yh();if(n)for(let r of i){let a=r.getContainerDomNode();if(pN(a,n))return r}return null}function pN(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}ae.registerCommandAlias("editor.action.diffReview.next",$s.id);ve($s);ae.registerCommandAlias("editor.action.diffReview.prev",Hl.id);ve(Hl);Fo();Z();ut();we();F();re();var mN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},fN=function(s,e){return function(t,i){e(t,i,s)}},g_,Iu=new X("selectionAnchorSet",!1),nn=g_=class{static get(e){return e.getContribution(g_.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Iu.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){let e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(V.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Qe().appendText(h("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),nt(h("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){let t=this.editor.getPosition();this.editor.setSelection(V.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){let e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};nn.ID="editor.contrib.selectionAnchorController";nn=g_=mN([fN(1,G)],nn);var p_=class extends k{constructor(){super({id:"editor.action.setSelectionAnchor",label:h("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:_.editorTextFocus,primary:Ee(2089,2080),weight:100}})}async run(e,t){var i;(i=nn.get(t))===null||i===void 0||i.setSelectionAnchor()}},m_=class extends k{constructor(){super({id:"editor.action.goToSelectionAnchor",label:h("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Iu})}async run(e,t){var i;(i=nn.get(t))===null||i===void 0||i.goToSelectionAnchor()}},f_=class extends k{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:h("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Iu,kbOpts:{kbExpr:_.editorTextFocus,primary:Ee(2089,2089),weight:100}})}async run(e,t){var i;(i=nn.get(t))===null||i===void 0||i.selectFromAnchorToCursor()}},__=class extends k{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:h("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Iu,kbOpts:{kbExpr:_.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=nn.get(t))===null||i===void 0||i.cancelSelectionAnchor()}};W(nn.ID,nn,4);w(p_);w(m_);w(f_);w(__);fe();E();Z();ke();q();ut();we();Pn();mt();F();Je();Lt();Dt();var _N=z("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},h("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets.")),v_=class extends k{constructor(){super({id:"editor.action.jumpToBracket",label:h("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:_.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=So.get(t))===null||i===void 0||i.jumpToBracket()}},b_=class extends k{constructor(){super({id:"editor.action.selectToBracket",label:h("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:nx("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var o;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(o=So.get(t))===null||o===void 0||o.selectToBracket(n)}},C_=class extends k{constructor(){super({id:"editor.action.removeBrackets",label:h("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:_.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=So.get(t))===null||i===void 0||i.removeBrackets(this.id)}},S_=class{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}},So=class s extends I{static get(e){return e.getContribution(s.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new De(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;let e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{let o=i.getStartPosition(),n=e.bracketPairs.matchBracket(o),r=null;if(n)n[0].containsPosition(o)&&!n[1].containsPosition(o)?r=n[1].getStartPosition():n[1].containsPosition(o)&&(r=n[0].getStartPosition());else{let a=e.bracketPairs.findEnclosingBrackets(o);if(a)r=a[1].getStartPosition();else{let l=e.bracketPairs.findNextBracket(o);l&&l.range&&(r=l.range.getStartPosition())}}return r?new V(r.lineNumber,r.column,r.lineNumber,r.column):new V(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;let t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(o=>{let n=o.getStartPosition(),r=t.bracketPairs.matchBracket(n);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(n),!r)){let d=t.bracketPairs.findNextBracket(n);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(b.compareRangesUsingStarts);let[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(n)){let u=a;a=l,l=u}}a&&l&&i.push(new V(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(i=>{let o=i.getPosition(),n=t.bracketPairs.matchBracket(o);n||(n=t.bracketPairs.findEnclosingBrackets(o)),n&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:n[0],text:""},{range:n[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();let e=[],t=0;for(let i of this._lastBracketsData){let o=i.brackets;o&&(e[t++]={range:o[0],options:i.options},e[t++]={range:o[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getModel(),i=t.getVersionId(),o=[];this._lastVersionId===i&&(o=this._lastBracketsData);let n=[],r=0;for(let u=0,g=e.length;u<g;u++){let p=e[u];p.isEmpty()&&(n[r++]=p.getStartPosition())}n.length>1&&n.sort(R.compare);let a=[],l=0,d=0,c=o.length;for(let u=0,g=n.length;u<g;u++){let p=n[u];for(;d<c&&o[d].position.isBefore(p);)d++;if(d<c&&o[d].position.equals(p))a[l++]=o[d];else{let m=t.bracketPairs.matchBracket(p,20),f=s._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(p,20),f=s._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new S_(p,m,f)}}this._lastBracketsData=a,this._lastVersionId=i}};So.ID="editor.contrib.bracketMatchingController";So._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=te.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Ae(_N),position:si.Center}});So._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=te.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});W(So.ID,So,1);w(b_);w(v_);w(C_);Yt.appendMenuItem(O.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:h({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});Z();we();q();ut();var Lu=class{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;let i=this._selection.startLineNumber,o=this._selection.startColumn,n=this._selection.endColumn;if(!(this._isMovingLeft&&o===1)&&!(!this._isMovingLeft&&n===e.getLineMaxColumn(i)))if(this._isMovingLeft){let r=new b(i,o-1,i,o),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new b(i,n,i,n),a)}else{let r=new b(i,n,i,n+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new b(i,o,i,o),a)}}computeCursorState(e,t){return this._isMovingLeft?new V(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new V(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}};F();var Du=class extends k{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let i=[],o=t.getSelections();for(let n of o)i.push(new Lu(n,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}},w_=class extends Du{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:h("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:_.writable})}},y_=class extends Du{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:h("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:_.writable})}};w(w_);w(y_);Z();q();we();F();var x_=class extends k{constructor(){super({id:"editor.action.transposeLetters",label:h("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:_.writable,kbOpts:{kbExpr:_.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let i=t.getModel(),o=[],n=t.getSelections();for(let r of n){if(!r.isEmpty())continue;let a=r.startLineNumber,l=r.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;let c=l===d?r.getPosition():jh.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),u=jh.leftPosition(i,c),g=jh.leftPosition(i,u),p=i.getValueInRange(b.fromPositions(g,u)),m=i.getValueInRange(b.fromPositions(u,c)),f=b.fromPositions(g,c);o.push(new Yo(f,m+p))}o.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop())}};w(x_);Ex();de();$t();Z();Rt();we();F();Je();re();var Pr="9_cutcopypaste",vN=Dn||document.queryCommandSupported("cut"),EL=Dn||document.queryCommandSupported("copy"),bN=typeof navigator.clipboard>"u"||Nx?document.queryCommandSupported("paste"):!0;function D_(s){return s.register(),s}var CN=vN?D_(new Ih({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Dn?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:O.MenubarEditMenu,group:"2_ccp",title:h({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:O.EditorContext,group:Pr,title:h("actions.clipboard.cutLabel","Cut"),when:_.writable,order:1},{menuId:O.CommandPalette,group:"",title:h("actions.clipboard.cutLabel","Cut"),order:1},{menuId:O.SimpleEditorContext,group:Pr,title:h("actions.clipboard.cutLabel","Cut"),when:_.writable,order:1}]})):void 0,SN=EL?D_(new Ih({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Dn?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:O.MenubarEditMenu,group:"2_ccp",title:h({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:O.EditorContext,group:Pr,title:h("actions.clipboard.copyLabel","Copy"),order:2},{menuId:O.CommandPalette,group:"",title:h("actions.clipboard.copyLabel","Copy"),order:1},{menuId:O.SimpleEditorContext,group:Pr,title:h("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Yt.appendMenuItem(O.MenubarEditMenu,{submenu:O.MenubarCopy,title:{value:h("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});Yt.appendMenuItem(O.EditorContext,{submenu:O.EditorContextCopy,title:{value:h("copy as","Copy As"),original:"Copy As"},group:Pr,order:3});Yt.appendMenuItem(O.EditorContext,{submenu:O.EditorContextShare,title:{value:h("share","Share"),original:"Share"},group:"11_share",order:-1,when:x.and(x.notEquals("resourceScheme","output"),_.editorTextFocus)});Yt.appendMenuItem(O.EditorTitleContext,{submenu:O.EditorTitleContextShare,title:{value:h("share","Share"),original:"Share"},group:"11_share",order:-1});Yt.appendMenuItem(O.ExplorerContext,{submenu:O.ExplorerContextShare,title:{value:h("share","Share"),original:"Share"},group:"11_share",order:-1});var I_=bN?D_(new Ih({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Dn?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:O.MenubarEditMenu,group:"2_ccp",title:h({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:O.EditorContext,group:Pr,title:h("actions.clipboard.pasteLabel","Paste"),when:_.writable,order:4},{menuId:O.CommandPalette,group:"",title:h("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:O.SimpleEditorContext,group:Pr,title:h("actions.clipboard.pasteLabel","Paste"),when:_.writable,order:4}]})):void 0,L_=class extends k{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:h("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:_.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(Rf.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),Rf.forceCopyWithSyntaxHighlighting=!1)}};function RL(s,e){s&&(s.addImplementation(1e4,"code-editor",(t,i)=>{let o=t.get(_e).getFocusedCodeEditor();if(o&&o.hasTextFocus()){let n=o.getOption(37),r=o.getSelection();return r&&r.isEmpty()&&!n||o.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),s.addImplementation(0,"generic-dom",(t,i)=>(hl().execCommand(e),!0)))}RL(CN,"cut");RL(SN,"copy");I_&&(I_.addImplementation(1e4,"code-editor",(s,e)=>{let t=s.get(_e),i=s.get(Ki),o=t.getFocusedCodeEditor();return o&&o.hasTextFocus()?!o.getContainerDomNode().ownerDocument.execCommand("paste")&&sh?(async()=>{let r=await i.readText();if(r!==""){let a=KI.INSTANCE.get(r),l=!1,d=null,c=null;a&&(l=o.getOption(37)&&!!a.isFromEmptySelection,d=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),o.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:d,mode:c})}})():!0:!1}),I_.addImplementation(0,"generic-dom",(s,e)=>(hl().execCommand("paste"),!0)));EL&&w(L_);Z();Be();Z();we();Fe();Te();me();E();pt();q();ut();Ri();Tr();F();Ue();yr();me();var U=class s{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+s.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new s(this.value+s.sep+e)}};U.sep=".";U.None=new U("@@none@@");U.Empty=new U("");U.QuickFix=new U("quickfix");U.Refactor=new U("refactor");U.RefactorExtract=U.Refactor.append("extract");U.RefactorInline=U.Refactor.append("inline");U.RefactorMove=U.Refactor.append("move");U.RefactorRewrite=U.Refactor.append("rewrite");U.Notebook=new U("notebook");U.Source=new U("source");U.SourceOrganizeImports=U.Source.append("organizeImports");U.SourceFixAll=U.Source.append("fixAll");U.SurroundWith=U.Refactor.append("surround");var _t;(function(s){s.Refactor="refactor",s.RefactorPreview="refactor preview",s.Lightbulb="lightbulb",s.Default="other (default)",s.SourceAction="source action",s.QuickFix="quick fix action",s.FixAll="fix all",s.OrganizeImports="organize imports",s.AutoFix="auto fix",s.QuickFixHover="quick fix hover window",s.OnSave="save participants",s.ProblemsView="problems view"})(_t||(_t={}));function TL(s,e){return!(s.include&&!s.include.intersects(e)||s.excludes&&s.excludes.some(t=>OL(e,t,s.include))||!s.includeSourceActions&&U.Source.contains(e))}function PL(s,e){let t=e.kind?new U(e.kind):void 0;return!(s.include&&(!t||!s.include.contains(t))||s.excludes&&t&&s.excludes.some(i=>OL(t,i,s.include))||!s.includeSourceActions&&t&&U.Source.contains(t)||s.onlyIncludePreferredActions&&!e.isPreferred)}function OL(s,e,t){return!(!e.contains(s)||t&&e.contains(t))}var jn=class s{static fromUser(e,t){return!e||typeof e!="object"?new s(t.kind,t.apply,!1):new s(s.getKindFromUser(e,t.kind),s.getApplyFromUser(e,t.apply),s.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new U(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}},ku=class{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(o){pe(o)}i&&(this.action.edit=i.edit)}return this}};var Mu="editor.action.codeAction",Zs="editor.action.quickFix",Nu="editor.action.autoFix",Eu="editor.action.refactor",Ru="editor.action.sourceAction",Vl="editor.action.organizeImports",Ul="editor.action.fixAll",k_=class s extends I{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Ge(e.diagnostics)?Ge(t.diagnostics)?s.codeActionsPreferredComparator(e,t):-1:Ge(t.diagnostics)?1:s.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(s.codeActionsComparator),this.validActions=this.allActions.filter(({action:o})=>!o.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&U.QuickFix.contains(new U(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}},AL={actions:[],documentation:void 0};async function Or(s,e,t,i,o,n){var r;let a=i.filter||{},l={...a,excludes:[...a.excludes||[],U.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new hL(e,n),u=i.type===2,g=wN(s,e,u?l:a),p=new L,m=g.map(async C=>{try{o.report(C);let v=await C.provideCodeActions(e,t,d,c.token);if(v&&p.add(v),c.token.isCancellationRequested)return AL;let S=(v?.actions||[]).filter(D=>D&&PL(a,D)),y=xN(C,S,a.include);return{actions:S.map(D=>new ku(D,C)),documentation:y}}catch(v){if(Ei(v))throw v;return pe(v),AL}}),f=s.onDidChange(()=>{let C=s.all(e);ui(C,g)||c.cancel()});try{let C=await Promise.all(m),v=C.map(y=>y.actions).flat(),S=[...zt(C.map(y=>y.documentation)),...yN(s,e,i,v)];return new k_(v,S,p)}finally{f.dispose(),c.dispose()}}function wN(s,e,t){return s.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(o=>TL(t,new U(o))):!0)}function*yN(s,e,t,i){var o,n,r;if(e&&i.length)for(let a of s.all(e))a._getAdditionalMenuItems&&(yield*(o=a._getAdditionalMenuItems)===null||o===void 0?void 0:o.call(a,{trigger:t.type,only:(r=(n=t.filter)===null||n===void 0?void 0:n.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function xN(s,e,t){if(!s.documentation)return;let i=s.documentation.map(o=>({kind:new U(o.kind),command:o.command}));if(t){let o;for(let n of i)n.kind.contains(t)&&(o?o.kind.contains(n.kind)&&(o=n):o=n);if(o)return o?.command}for(let o of e)if(o.kind){for(let n of i)if(n.kind.contains(new U(o.kind)))return n.command}}var Bl;(function(s){s.OnSave="onSave",s.FromProblemsView="fromProblemsView",s.FromCodeActions="fromCodeActions"})(Bl||(Bl={}));async function FL(s,e,t,i,o=Y.None){var n;let r=s.get(Fn),a=s.get(Ne),l=s.get(pi),d=s.get(He);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(o),!o.isCancellationRequested&&!(!((n=e.action.edit)===null||n===void 0)&&n.edits.length&&!(await r.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Bl.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){let u=IN(c);d.error(typeof u=="string"?u:h("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function IN(s){return typeof s=="string"?s:s instanceof Error&&typeof s.message=="string"?s.message:void 0}ae.registerCommand("_executeCodeActionProvider",async function(s,e,t,i,o){if(!(e instanceof ne))throw bi();let{codeActionProvider:n}=s.get(N),r=s.get(ze).getModel(e);if(!r)throw bi();let a=V.isISelection(t)?V.liftSelection(t):b.isIRange(t)?r.validateRange(t):void 0;if(!a)throw bi();let l=typeof i=="string"?new U(i):void 0,d=await Or(n,r,a,{type:1,triggerAction:_t.Default,filter:{includeSourceActions:!0,include:l}},Ai.None,Y.None),c=[],u=Math.min(d.validActions.length,typeof o=="number"?o:0);for(let g=0;g<u;g++)c.push(d.validActions[g].resolve(Y.None));try{return await Promise.all(c),d.validActions.map(g=>g.action)}finally{setTimeout(()=>d.dispose(),100)}});F();re();de();me();df();E();ke();mt();df();var LN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},DN=function(s,e){return function(t,i){e(t,i,s)}},M_,jl=M_=class{constructor(e){this.keybindingService=e}getResolver(){let e=new Ls(()=>this.keybindingService.getKeybindings().filter(t=>M_.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Vl?i={kind:U.SourceOrganizeImports.value}:t.command===Ul&&(i={kind:U.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...jn.fromUser(i,{kind:U.None,apply:"never"})}}));return t=>{if(t.kind){let i=this.bestKeybindingForCodeAction(t,e.value);return i?.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;let i=new U(e.kind);return t.filter(o=>o.kind.contains(i)).filter(o=>o.preferred?e.isPreferred:!0).reduceRight((o,n)=>o?o.kind.contains(n.kind)?n:o:n,void 0)}};jl.codeActionCommands=[Eu,Mu,Ru,Vl,Ul];jl=M_=LN([DN(0,Ce)],jl);Nt();F();Lt();var P1=z("symbolIcon.arrayForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),O1=z("symbolIcon.booleanForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),A1=z("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},h("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),F1=z("symbolIcon.colorForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),W1=z("symbolIcon.constantForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),z1=z("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},h("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),H1=z("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},h("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),B1=z("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},h("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),V1=z("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},h("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),U1=z("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},h("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),j1=z("symbolIcon.fileForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),K1=z("symbolIcon.folderForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),q1=z("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},h("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),G1=z("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},h("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),$1=z("symbolIcon.keyForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Y1=z("symbolIcon.keywordForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Z1=z("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},h("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Q1=z("symbolIcon.moduleForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),X1=z("symbolIcon.namespaceForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),J1=z("symbolIcon.nullForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),eA=z("symbolIcon.numberForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),tA=z("symbolIcon.objectForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),iA=z("symbolIcon.operatorForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),oA=z("symbolIcon.packageForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),nA=z("symbolIcon.propertyForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),rA=z("symbolIcon.referenceForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),sA=z("symbolIcon.snippetForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),aA=z("symbolIcon.stringForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),lA=z("symbolIcon.structForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),dA=z("symbolIcon.textForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),cA=z("symbolIcon.typeParameterForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),hA=z("symbolIcon.unitForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),uA=z("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},h("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F();var WL=Object.freeze({kind:U.Empty,title:h("codeAction.widget.id.more","More Actions...")}),kN=Object.freeze([{kind:U.QuickFix,title:h("codeAction.widget.id.quickfix","Quick Fix")},{kind:U.RefactorExtract,title:h("codeAction.widget.id.extract","Extract"),icon:$.wrench},{kind:U.RefactorInline,title:h("codeAction.widget.id.inline","Inline"),icon:$.wrench},{kind:U.RefactorRewrite,title:h("codeAction.widget.id.convert","Rewrite"),icon:$.wrench},{kind:U.RefactorMove,title:h("codeAction.widget.id.move","Move"),icon:$.wrench},{kind:U.SurroundWith,title:h("codeAction.widget.id.surround","Surround With"),icon:$.symbolSnippet},{kind:U.Source,title:h("codeAction.widget.id.source","Source Action"),icon:$.symbolFile},WL]);function zL(s,e,t){if(!e)return s.map(n=>{var r;return{kind:"action",item:n,group:WL,disabled:!!n.action.disabled,label:n.action.disabled||n.action.title,canPreview:!!(!((r=n.action.edit)===null||r===void 0)&&r.edits.length)}});let i=kN.map(n=>({group:n,actions:[]}));for(let n of s){let r=n.action.kind?new U(n.action.kind):U.None;for(let a of i)if(a.group.kind.contains(r)){a.actions.push(n);break}}let o=[];for(let n of i)if(n.actions.length){o.push({kind:"header",group:n.group});for(let r of n.actions){let a=n.group;o.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:$.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return o}de();Nt();Ie();E();ti();ZI();F();Ue();var MN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},HL=function(s,e){return function(t,i){e(t,i,s)}},N_,Qs;(function(s){s.Hidden={type:0};class e{constructor(i,o,n,r){this.actions=i,this.trigger=o,this.editorPosition=n,this.widgetPosition=r,this.type=1}}s.Showing=e})(Qs||(Qs={}));var rn=N_=class extends I{constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new K),this.onClick=this._onClick.event,this._state=Qs.Hidden,this._iconClasses=[],this._domNode=P("div.lightBulbWidget"),this._register(Nh.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(o=>{let n=this._editor.getModel();(this.state.type!==1||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide()})),this._register(Bx(this._domNode,o=>{var n;if(this.state.type!==1)return;let r=this._editor.getOption(64).experimental.showAiIcon;if((r===kn.On||r===kn.OnCode)&&this.state.actions.allAIFixes&&this.state.actions.validActions.length===1){let u=this.state.actions.validActions[0].action;if(!((n=u.command)===null||n===void 0)&&n.id){i.executeCommand(u.command.id,...u.command.arguments||[]),o.preventDefault();return}}this._editor.focus(),o.preventDefault();let{top:a,height:l}=et(this._domNode),d=this._editor.getOption(66),c=Math.floor(d/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(c+=d),this._onClick.fire({x:o.posx,y:a+l+c,actions:this.state.actions,trigger:this.state.trigger})})),this._register(ce(this._domNode,"mouseenter",o=>{(o.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(64)&&(this._editor.getOption(64).enabled||this.hide(),this._updateLightBulbTitleAndIcon())})),this._register(Me.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var o,n,r,a;this._preferredKbLabel=(n=(o=this._keybindingService.lookupKeybinding(Nu))===null||o===void 0?void 0:o.getLabel())!==null&&n!==void 0?n:void 0,this._quickFixKbLabel=(a=(r=this._keybindingService.lookupKeybinding(Zs))===null||r===void 0?void 0:r.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();let o=this._editor.getOptions();if(!o.get(64).enabled)return this.hide();let n=this._editor.getModel();if(!n)return this.hide();let{lineNumber:r,column:a}=n.validatePosition(i),l=n.getOptions().tabSize,d=o.get(50),c=n.getLineContent(r),u=Dl(c,l),g=d.spaceWidth*u>22,p=f=>f>2&&this._editor.getTopForLineNumber(f)===this._editor.getTopForLineNumber(f-1),m=r;if(!g){if(r>1&&!p(r-1))m-=1;else if(!p(r+1))m+=1;else if(a*d.spaceWidth<22)return this.hide()}this.state=new Qs.Showing(e,t,i,{position:{lineNumber:m,column:n.getLineContent(m).match(/^\S\s*$/)?2:1},preference:N_._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==Qs.Hidden&&(this.state=Qs.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){var e,t,i;if(this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],this.state.type!==1)return;let o=()=>{this._preferredKbLabel&&(this.title=h("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel))},n=()=>{this._quickFixKbLabel?this.title=h("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=h("codeAction","Show Code Actions")},r,a=this._editor.getOption(64).experimental.showAiIcon;if(a===kn.On||a===kn.OnCode)if(a===kn.On&&this.state.actions.allAIFixes)if(r=$.sparkleFilled,this.state.actions.allAIFixes&&this.state.actions.validActions.length===1)if(((e=this.state.actions.validActions[0].action.command)===null||e===void 0?void 0:e.id)==="inlineChat.start"){let l=(i=(t=this._keybindingService.lookupKeybinding("inlineChat.start"))===null||t===void 0?void 0:t.getLabel())!==null&&i!==void 0?i:void 0;this.title=l?h("codeActionStartInlineChatWithKb","Start Inline Chat ({0})",l):h("codeActionStartInlineChat","Start Inline Chat")}else this.title=h("codeActionTriggerAiAction","Trigger AI Action");else n();else this.state.actions.hasAutoFix?(this.state.actions.hasAIFix?r=$.lightbulbSparkleAutofix:r=$.lightbulbAutofix,o()):this.state.actions.hasAIFix?(r=$.lightbulbSparkle,n()):(r=$.lightBulb,n());else this.state.actions.hasAutoFix?(r=$.lightbulbAutofix,o()):(r=$.lightBulb,n());this._iconClasses=le.asClassNameArray(r),this._domNode.classList.add(...this._iconClasses)}set title(e){this._domNode.title=e}};rn.ID="editor.contrib.lightbulbWidget";rn._posPref=[0];rn=N_=MN([HL(1,Ce),HL(2,Ne)],rn);Ie();E();Z();q();me();Ie();E();Ti();yf();var NN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},BL=function(s,e){return function(t,i){e(t,i,s)}},E_,di=E_=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new K,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};let o=new L,n=o.add(iu(e,{...this._getRenderOptions(e,o),...t},i));return n.element.classList.add("rendered-markdown"),{element:n.element,dispose:()=>o.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,o)=>{var n,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(n=this._options.editor.getModel())===null||n===void 0?void 0:n.getLanguageId()),l||(l=Ps);let d=await c0(this._languageService,o,l),c=document.createElement("span");if(c.innerHTML=(a=(r=E_._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){let u=this._options.editor.getOption(50);_h(c,u)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>R_(this._openerService,i,e.isTrusted),disposables:t}}}};di._ttpTokenizer=Ts("tokenizeToString",{createHTML(s){return s}});di=E_=NN([BL(1,tt),BL(2,it)],di);async function R_(s,e,t){try{return await s.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:EN(t)})}catch(i){return ee(i),!1}}function EN(s){return s===!0?!0:s&&Array.isArray(s.enabledCommands)?s.enabledCommands:!1}F();re();de();var RN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},VL=function(s,e){return function(t,i){e(t,i,s)}},Tu,kt=Tu=class{static get(e){return e.getContribution(Tu.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Ye,this._messageListeners=new L,this._mouseOverMessage=!1,this._editor=e,this._visible=Tu.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){nt(tu(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=tu(e)?iu(e,{actionHandler:{callback:o=>R_(this._openerService,o,tu(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Pu(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Me.debounce(this._editor.onDidBlurEditorText,(o,n)=>n,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&qx(yh(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(ce(this._messageWidget.value.getDomNode(),Pe.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ce(this._messageWidget.value.getDomNode(),Pe.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(o=>{o.target.position&&(i?i.containsPosition(o.target.position)||this.closeMessage():i=new b(t.lineNumber-3,1,o.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Pu.fadeOut(this._messageWidget.value))}};kt.ID="editor.contrib.messageController";kt.MESSAGE_VISIBLE=new X("messageVisible",!1,h("messageVisible","Whether the editor is currently showing an inline message"));kt=Tu=RN([VL(1,G),VL(2,it)],kt);var TN=je.bindToContribution(kt.get);H(new TN({id:"leaveEditorMessage",precondition:kt.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:130,primary:9}}));var Pu=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},o){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";let n=document.createElement("div");n.classList.add("anchor","top"),this._domNode.appendChild(n);let r=document.createElement("div");typeof o=="string"?(r.classList.add("message"),r.textContent=o):(o.classList.add("message"),r.appendChild(o)),this._domNode.appendChild(r);let a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};W(kt.ID,kt,4);F();de();E();F();de();Te();Nt();E();$t();ti();F();Lt();var UL=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},T_=function(s,e){return function(t,i){e(t,i,s)}},F_="acceptSelectedCodeAction",W_="previewSelectedCodeAction",P_=class{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");let t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var o,n;i.text.textContent=(n=(o=e.group)===null||o===void 0?void 0:o.title)!==null&&n!==void 0?n:""}disposeTemplate(e){}},O_=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);let t=document.createElement("div");t.className="icon",e.append(t);let i=document.createElement("span");i.className="title",e.append(i);let o=new cu(e,ah);return{container:e,icon:t,text:i,keybinding:o}}renderElement(e,t,i){var o,n,r;if(!((o=e.group)===null||o===void 0)&&o.icon?(i.icon.className=le.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=uo(e.group.icon.color.id))):(i.icon.className=le.asClassName($.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=jL(e.label),i.keybinding.set(e.keybinding),Zx(!!e.keybinding,i.keybinding.element);let a=(n=this._keybindingService.lookupKeybinding(F_))===null||n===void 0?void 0:n.getLabel(),l=(r=this._keybindingService.lookupKeybinding(W_))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=h({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=h({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};O_=UL([T_(1,Ce)],O_);var A_=class extends UIEvent{constructor(){super("acceptSelectedAction")}},Ou=class extends UIEvent{constructor(){super("previewSelectedAction")}};function PN(s){if(s.kind==="action")return s.label}var Au=class extends I{constructor(e,t,i,o,n,r){super(),this._delegate=o,this._contextViewService=n,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new We),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");let a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new ou(e,this.domNode,a,[new O_(t,this._keybindingService),new P_],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:PN},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?jL(l?.label):"";return l.disabled&&(d=h({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",d,l.disabled)),d}return null},getWidgetAriaLabel:()=>h({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(A0),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){let t=this._allMenuItems.filter(l=>l.kind==="header").length,o=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(o);let n=e;if(this._allMenuItems.length>=50)n=380;else{let l=this._allMenuItems.map((d,c)=>{let u=this.domNode.ownerDocument.getElementById(this._list.getElementID(c));if(u){u.style.width="auto";let g=u.getBoundingClientRect().width;return u.style.width="",g}return 0});n=Math.max(...l,e)}let a=Math.min(o,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,n),this.domNode.style.height=`${a}px`,this._list.domFocus(),n}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){let t=this._list.getFocus();if(t.length===0)return;let i=t[0],o=this._list.element(i);if(!this.focusCondition(o))return;let n=e?new Ou:new A_;this._list.setSelection([i],n)}onListSelection(e){if(!e.elements.length)return;let t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof Ou):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();let i=this._list.getFocus();if(i.length===0)return;let o=i[0],n=this._list.element(o);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,n.item)}async onListHover(e){let t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){let i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Au=UL([T_(4,Wn),T_(5,Ce)],Au);function jL(s){return s.replace(/\r\n|\r|\n/g," ")}Je();re();Uo();ge();Lt();var ON=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},z_=function(s,e){return function(t,i){e(t,i,s)}};z("actionBar.toggledBackground",{dark:Ko,light:Ko,hcDark:Ko,hcLight:Ko},h("actionBar.toggledBackground","Background color for toggled action items in action bar."));var Ar={Visible:new X("codeActionMenuVisible",!1,h("codeActionMenuVisible","Whether the action widget list is visible"))},Kn=Et("actionWidgetService"),Fr=class extends I{get isVisible(){return Ar.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Ye)}show(e,t,i,o,n,r,a){let l=Ar.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(Au,e,t,i,o);this._contextViewService.showContextView({getAnchor:()=>n,render:c=>(l.set(!0),this._renderWidget(c,d,a??[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var o;let n=document.createElement("div");if(n.classList.add("action-widget"),e.appendChild(n),this._list.value=t,this._list.value)n.appendChild(this._list.value.domNode);else throw new Error("List has no value");let r=new L,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(ce(l,Pe.MOUSE_DOWN,m=>m.stopPropagation()));let d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add(ce(c,Pe.POINTER_MOVE,()=>c.remove())),r.add(ce(c,Pe.MOUSE_DOWN,()=>c.remove()));let u=0;if(i.length){let m=this._createActionBar(".action-widget-action-bar",i);m&&(n.appendChild(m.getContainer().parentElement),r.add(m),u=m.getContainer().offsetWidth)}let g=(o=this._list.value)===null||o===void 0?void 0:o.layout(u);n.style.width=`${g}px`;let p=r.add(Ui(e));return r.add(p.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;let i=P(e),o=new en(i);return o.push(t,{icon:!1,label:!0}),o}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};Fr=ON([z_(0,Wn),z_(1,G),z_(2,B)],Fr);Pt(Kn,Fr,1);var Kl=1100;ve(class extends Tt{constructor(){super({id:"hideCodeActionWidget",title:{value:h("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:Ar.Visible,keybinding:{weight:Kl,primary:9,secondary:[1033]}})}run(s){s.get(Kn).hide()}});ve(class extends Tt{constructor(){super({id:"selectPrevCodeAction",title:{value:h("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:Ar.Visible,keybinding:{weight:Kl,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(s){let e=s.get(Kn);e instanceof Fr&&e.focusPrevious()}});ve(class extends Tt{constructor(){super({id:"selectNextCodeAction",title:{value:h("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:Ar.Visible,keybinding:{weight:Kl,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(s){let e=s.get(Kn);e instanceof Fr&&e.focusNext()}});ve(class extends Tt{constructor(){super({id:F_,title:{value:h("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:Ar.Visible,keybinding:{weight:Kl,primary:3,secondary:[2137]}})}run(s){let e=s.get(Kn);e instanceof Fr&&e.acceptSelected()}});ve(class extends Tt{constructor(){super({id:W_,title:{value:h("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:Ar.Visible,keybinding:{weight:Kl,primary:2051}})}run(s){let e=s.get(Kn);e instanceof Fr&&e.acceptSelected(!0)}});Ue();at();re();ge();Lt();Hh();Dt();fe();me();Ie();E();yi();ke();ut();re();var B_=new X("supportedCodeAction",""),H_=class extends I{constructor(e,t,i,o=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=o,this._autoTriggerTimer=this._register(new ao),this._register(this._markerService.onMarkerChanged(n=>this._onMarkerChanges(n))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){let t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){let t=this._editor.getModel();t&&e.some(i=>$h(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:_t.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){var t;if(!this._editor.hasModel())return;let i=this._editor.getModel(),o=this._editor.getSelection();if(o.isEmpty()&&e.type===2){let{lineNumber:n,column:r}=o.getPosition(),a=i.getLineContent(n);if(a.length===0){if(!(((t=this._editor.getOption(64).experimental)===null||t===void 0?void 0:t.showAiIcon)===kn.On))return}else if(r===1){if(/\s/.test(a[0]))return}else if(r===i.getLineMaxColumn(n)){if(/\s/.test(a[a.length-1]))return}else if(/\s/.test(a[r-2])&&/\s/.test(a[r-1]))return}return o}},Wr;(function(s){s.Empty={type:0};class e{constructor(i,o,n){this.trigger=i,this.position=o,this._cancellablePromise=n,this.type=1,this.actions=n.catch(r=>{if(Ei(r))return KL;throw r})}cancel(){this._cancellablePromise.cancel()}}s.Triggered=e})(Wr||(Wr={}));var KL=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1}),Fu=class extends I{constructor(e,t,i,o,n,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=n,this._configurationService=r,this._codeActionOracle=this._register(new Ye),this._state=Wr.Empty,this._onDidChangeState=this._register(new K),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=B_.bindTo(o),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Wr.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;let t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Wr.Empty);let e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){let t=this._registry.all(e).flatMap(i=>{var o;return(o=i.providedCodeActionKinds)!==null&&o!==void 0?o:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new H_(this._editor,this._markerService,i=>{var o;if(!i){this.setState(Wr.Empty);return}let n=i.selection.getStartPosition(),r=Se(async a=>{var l,d,c,u,g,p;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===_t.QuickFix||!((d=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(U.QuickFix))){let m=await Or(this._registry,e,i.selection,i.trigger,Ai.None,a),f=[...m.allActions];if(a.isCancellationRequested)return KL;if(!((c=m.validActions)===null||c===void 0?void 0:c.some(v=>v.action.kind?U.QuickFix.contains(new U(v.action.kind)):!1))){let v=this._markerService.read({resource:e.uri});if(v.length>0){let S=i.selection.getPosition(),y=S,D=Number.MAX_VALUE,M=[...m.validActions];for(let j of v){let Re=j.endColumn,qe=j.endLineNumber,ht=j.startLineNumber;if(qe===S.lineNumber||ht===S.lineNumber){y=new R(qe,Re);let Ni={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((u=i.trigger.filter)===null||u===void 0)&&u.include?(g=i.trigger.filter)===null||g===void 0?void 0:g.include:U.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((p=i.trigger.context)===null||p===void 0?void 0:p.notAvailableMessage)||"",position:y}},ih=new V(y.lineNumber,y.column,y.lineNumber,y.column),el=await Or(this._registry,e,ih,Ni,Ai.None,a);if(el.validActions.length!==0){for(let qy of el.validActions)qy.highlightRange=qy.action.isPreferred;m.allActions.length===0&&f.push(...el.allActions),Math.abs(S.column-Re)<D?M.unshift(...el.validActions):M.push(...el.validActions)}D=Math.abs(S.column-Re)}}let J=M.filter((j,Re,qe)=>qe.findIndex(ht=>ht.action.title===j.action.title)===Re);return J.sort((j,Re)=>j.action.isPreferred&&!Re.action.isPreferred?-1:!j.action.isPreferred&&Re.action.isPreferred||j.action.isAI&&!Re.action.isAI?1:!j.action.isAI&&Re.action.isAI?-1:0),{validActions:J,allActions:f,documentation:m.documentation,hasAutoFix:m.hasAutoFix,hasAIFix:m.hasAIFix,allAIFixes:m.allAIFixes,dispose:()=>{m.dispose()}}}}}return Or(this._registry,e,i.selection,i.trigger,Ai.None,a)});i.trigger.type===1&&((o=this._progressService)===null||o===void 0||o.showWhile(r,250)),this.setState(new Wr.Triggered(i.trigger,n,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:_t.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}};var FN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},sn=function(s,e){return function(t,i){e(t,i,s)}},Wu,WN="quickfix-edit-highlight",Gi=Wu=class extends I{static get(e){return e.getContribution(Wu.ID)}constructor(e,t,i,o,n,r,a,l,d,c){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=d,this._instantiationService=c,this._activeCodeActions=this._register(new Ye),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Fu(this._editor,n.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Ls(()=>{let u=this._editor.getContribution(rn.ID);return u&&this._register(u.onClick(g=>this.showCodeActionList(g.actions,g,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=o.createInstance(jl),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,o){var n;if(!this._editor.hasModel())return;(n=kt.get(this._editor))===null||n===void 0||n.closeMessage();let r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:o,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i){try{await this._instantiationService.invokeFunction(FL,e,Bl.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:_t.QuickFix,filter:{}})}}async update(e){var t,i,o,n,r,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let d;try{d=await e.actions}catch(c){ee(c);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(d,e.trigger,e.position),e.trigger.type===1){if(!((o=e.trigger.filter)===null||o===void 0)&&o.include){let u=this.tryGetValidActionToApply(e.trigger,d);if(u){try{(n=this._lightBulbWidget.value)===null||n===void 0||n.hide(),await this._applyCodeAction(u,!1,!1)}finally{d.dispose()}return}if(e.trigger.context){let g=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(g&&g.action.disabled){(r=kt.get(this._editor))===null||r===void 0||r.showMessage(g.action.disabled,e.trigger.context.position),d.dispose();return}}}let c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!d.allActions.length||!c&&!d.validActions.length)){(l=kt.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=d,d.dispose();return}this._activeCodeActions.value=d,this.showCodeActionList(d,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?d.dispose():this._activeCodeActions.value=d}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]}async showCodeActionList(e,t,i){let o=this._editor.createDecorationsCollection(),n=this._editor.getDomNode();if(!n)return;let r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;let a=R.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(d,c)=>{this._applyCodeAction(d,!0,!!c),this._actionWidgetService.hide(),o.clear()},onHide:()=>{var d;(d=this._editor)===null||d===void 0||d.focus(),o.clear()},onHover:async(d,c)=>{var u;if(await d.resolve(c),!c.isCancellationRequested)return{canPreview:!!(!((u=d.action.edit)===null||u===void 0)&&u.edits.length)}},onFocus:d=>{var c,u;if(d&&d.highlightRange&&d.action.diagnostics){let g=[{range:d.action.diagnostics[0],options:Wu.DECORATION}];o.set(g);let p=d.action.diagnostics[0],m=(u=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:p.startLineNumber,column:p.startColumn}))===null||u===void 0?void 0:u.word;jo(h("editingNewSelection","Context: {0} at line {1} and column {2}.",m,p.startLineNumber,p.startColumn))}else o.clear()}};this._actionWidgetService.show("codeActionWidget",!0,zL(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,n,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();let t=this._editor.getScrolledVisiblePosition(e),i=et(this._editor.getDomNode()),o=i.left+t.left,n=i.top+t.top+t.height;return{x:o,y:n}}_shouldShowHeaders(){var e;let t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];let o=e.documentation.map(n=>{var r;return{id:n.id,label:n.title,tooltip:(r=n.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(n.id,...(a=n.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&o.push(this._showDisabled?{id:"hideMoreActions",label:h("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:h("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),o}};Gi.ID="editor.contrib.codeActionController";Gi.DECORATION=te.register({description:"quickfix-highlight",className:WN});Gi=Wu=FN([sn(1,Tl),sn(2,G),sn(3,B),sn(4,N),sn(5,Qo),sn(6,Ne),sn(7,se),sn(8,Kn),sn(9,B)],Gi);On((s,e)=>{((o,n)=>{n&&e.addRule(`.monaco-editor ${o} { background-color: ${n}; }`)})(".quickfix-edit-highlight",s.getColor(Oh));let i=s.getColor(Ah);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Go(s.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function ql(s){return x.regex(B_.keys()[0],new RegExp("(\\s|^)"+Wo(s.value)+"\\b"))}var V_={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:h("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:h("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[h("args.schema.apply.first","Always apply the first returned code action."),h("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),h("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:h("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function zr(s,e,t,i,o=_t.Default){if(s.hasModel()){let n=Gi.get(s);n?.manualTriggerAtCurrentPosition(e,o,t,i)}}var zu=class extends k{constructor(){super({id:Zs,label:h("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:x.and(_.writable,_.hasCodeActionsProvider),kbOpts:{kbExpr:_.textInputFocus,primary:2137,weight:100}})}run(e,t){return zr(t,h("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,_t.QuickFix)}},Hu=class extends je{constructor(){super({id:Mu,precondition:x.and(_.writable,_.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:V_}]}})}runEditorCommand(e,t,i){let o=jn.fromUser(i,{kind:U.Empty,apply:"ifSingle"});return zr(t,typeof i?.kind=="string"?o.preferred?h("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):h("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):o.preferred?h("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):h("editor.action.codeAction.noneMessage","No code actions available"),{include:o.kind,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply)}},Bu=class extends k{constructor(){super({id:Eu,label:h("refactor.label","Refactor..."),alias:"Refactor...",precondition:x.and(_.writable,_.hasCodeActionsProvider),kbOpts:{kbExpr:_.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:x.and(_.writable,ql(U.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:V_}]}})}run(e,t,i){let o=jn.fromUser(i,{kind:U.Refactor,apply:"never"});return zr(t,typeof i?.kind=="string"?o.preferred?h("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):h("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):o.preferred?h("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):h("editor.action.refactor.noneMessage","No refactorings available"),{include:U.Refactor.contains(o.kind)?o.kind:U.None,onlyIncludePreferredActions:o.preferred},o.apply,_t.Refactor)}},Vu=class extends k{constructor(){super({id:Ru,label:h("source.label","Source Action..."),alias:"Source Action...",precondition:x.and(_.writable,_.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:x.and(_.writable,ql(U.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:V_}]}})}run(e,t,i){let o=jn.fromUser(i,{kind:U.Source,apply:"never"});return zr(t,typeof i?.kind=="string"?o.preferred?h("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):h("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):o.preferred?h("editor.action.source.noneMessage.preferred","No preferred source actions available"):h("editor.action.source.noneMessage","No source actions available"),{include:U.Source.contains(o.kind)?o.kind:U.None,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply,_t.SourceAction)}},Uu=class extends k{constructor(){super({id:Vl,label:h("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:x.and(_.writable,ql(U.SourceOrganizeImports)),kbOpts:{kbExpr:_.textInputFocus,primary:1581,weight:100}})}run(e,t){return zr(t,h("editor.action.organize.noneMessage","No organize imports action available"),{include:U.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",_t.OrganizeImports)}},ju=class extends k{constructor(){super({id:Ul,label:h("fixAll.label","Fix All"),alias:"Fix All",precondition:x.and(_.writable,ql(U.SourceFixAll))})}run(e,t){return zr(t,h("fixAll.noneMessage","No fix all action available"),{include:U.SourceFixAll,includeSourceActions:!0},"ifSingle",_t.FixAll)}},Ku=class extends k{constructor(){super({id:Nu,label:h("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:x.and(_.writable,ql(U.QuickFix)),kbOpts:{kbExpr:_.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return zr(t,h("editor.action.autoFix.noneMessage","No auto fixes available"),{include:U.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",_t.AutoFix)}};F();wf();zo();W(Gi.ID,Gi,3);W(rn.ID,rn,4);w(zu);w(Bu);w(Vu);w(Uu);w(Ku);w(ju);H(new Hu);wt.as(Lr.Configuration).registerConfiguration({...El,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:h("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});wt.as(Lr.Configuration).registerConfiguration({...El,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:h("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});fe();me();E();Z();we();Te();me();E();St();pt();Ri();Ue();var Xs=class{constructor(){this.lenses=[],this._disposables=new L}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(let i of e.lenses)this.lenses.push({symbol:i,provider:t})}};async function U_(s,e,t){let i=s.ordered(e),o=new Map,n=new Xs,r=i.map(async(a,l)=>{o.set(a,l);try{let d=await Promise.resolve(a.provideCodeLenses(e,t));d&&n.add(d,a)}catch(d){pe(d)}});return await Promise.all(r),n.lenses=n.lenses.sort((a,l)=>a.symbol.range.startLineNumber<l.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>l.symbol.range.startLineNumber?1:o.get(a.provider)<o.get(l.provider)?-1:o.get(a.provider)>o.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),n}ae.registerCommand("_executeCodeLensProvider",function(s,...e){let[t,i]=e;ue(ne.isUri(t)),ue(typeof i=="number"||!i);let{codeLensProvider:o}=s.get(N),n=s.get(ze).getModel(t);if(!n)throw bi();let r=[],a=new L;return U_(o,n,Y.None).then(l=>{a.add(l);let d=[];for(let c of l.lenses)i==null||c.symbol.command?r.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&d.push(Promise.resolve(c.provider.resolveCodeLens(n,c.symbol,Y.None)).then(u=>r.push(u||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});Ie();q();Uo();ge();_M();de();var zN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},HN=function(s,e){return function(t,i){e(t,i,s)}},K_=Et("ICodeLensCache"),qu=class{constructor(e,t){this.lineCount=e,this.data=t}},j_=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new co(20,.75);let t="codelens/cache";Vx(bx,()=>e.remove(t,1));let i="codelens/cache2",o=e.get(i,1,"{}");this._deserialize(o),Me.once(e.onWillSaveState)(n=>{n.reason===qs.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){let i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),o=new Xs;o.add({lenses:i,dispose:()=>{}},this._fakeProvider);let n=new qu(e.getLineCount(),o);this._cache.set(e.uri.toString(),n)}get(e){let t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){let e=Object.create(null);for(let[t,i]of this._cache){let o=new Set;for(let n of i.data.lenses)o.add(n.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...o.values()]}}return JSON.stringify(e)}_deserialize(e){try{let t=JSON.parse(e);for(let i in t){let o=t[i],n=[];for(let a of o.lines)n.push({range:new b(a,1,a,11)});let r=new Xs;r.add({lenses:n,dispose(){}},this._fakeProvider),this._cache.set(i,new qu(o.lineCount,r))}}catch{}}};j_=zN([HN(0,ai)],j_);Pt(K_,j_,1);de();q();mt();var q_=class{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}},Gu=class s{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${s._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();let i=[],o=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r&&(o=!0,r.command)){let a=R0(r.command.title.trim());r.command.id?(i.push(P("a",{id:String(n),title:r.command.tooltip,role:"button"},...a)),this._commands.set(String(n),r.command)):i.push(P("span",{title:r.command.tooltip},...a)),n+1<e.length&&i.push(P("span",void 0,"\xA0|\xA0"))}}o?(Ir(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):Ir(this._domNode,P("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){let t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}};Gu._idPool=0;var Js=class{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){let t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,o=t.length;i<o;i++)this._addDecorationsCallbacks[i](t[i])}},qL=te.register({collapseOnReplaceEdit:!0,description:"codelens"}),Gl=class{constructor(e,t,i,o,n,r){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a,l=[];this._data.forEach((d,c)=>{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:qL},u=>this._decorationIds[c]=u),a?a=b.plusRange(a,d.symbol.range):a=b.lift(d.symbol.range)}),this._viewZone=new q_(a.startLineNumber-1,n,r),this._viewZoneId=o.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new Gu(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{let i=this._editor.getModel().getDecorationRange(e),o=this._data[t].symbol;return!!(i&&b.isEmpty(o.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,o)=>{t.addDecoration({range:i.symbol.range,options:qL},n=>this._decorationIds[o]=n)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){let i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){let i=e[t];if(i){let{symbol:o}=this._data[t];o.command=i.command||o.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?void 0:t.getCommand(e)}getLineNumber(){let e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){let t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}};F();Ue();var BN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},$l=function(s,e){return function(t,i){e(t,i,s)}},ea=class{constructor(e,t,i,o,n,r){this._editor=e,this._languageFeaturesService=t,this._commandService=o,this._notificationService=n,this._codeLensCache=r,this._disposables=new L,this._localToDispose=new L,this._lenses=[],this._oldCodeLensModels=new L,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new De(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){let e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52)),t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){let{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),o=this._editor.getOption(50),{style:n}=this._editor.getContainerDomNode();n.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),n.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),n.setProperty("--vscode-editorCodeLens-fontFeatureSettings",o.fontFeatureSettings),i&&(n.setProperty("--vscode-editorCodeLens-fontFamily",i),n.setProperty("--vscode-editorCodeLens-fontFamilyDefault",ch.fontFamily)),this._editor.changeViewZones(r=>{for(let a of this._lenses)a.updateHeight(e,r)})}_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();let e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;let t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&Bo(()=>{let o=this._codeLensCache.get(e);t===o&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(let o of this._languageFeaturesService.codeLensProvider.all(e))if(typeof o.onDidChange=="function"){let n=o.onDidChange(()=>i.schedule());this._localToDispose.add(n)}let i=new De(()=>{var o;let n=Date.now();(o=this._getCodeLensModelPromise)===null||o===void 0||o.cancel(),this._getCodeLensModelPromise=Se(r=>U_(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);let a=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},ee)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(xe(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var o;this._editor.changeDecorations(n=>{this._editor.changeViewZones(r=>{let a=[],l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(r),l=c.getLineNumber())});let d=new Js;a.forEach(c=>{c.dispose(d,r),this._lenses.splice(this._lenses.indexOf(c),1)}),d.commit(n)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(o=this._resolveCodeLensesPromise)===null||o===void 0||o.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(o=>{o.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(xe(()=>{if(this._editor.getModel()){let o=bo.capture(this._editor);this._editor.changeDecorations(n=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(n,r)})}),o.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(o=>{if(o.target.type!==9)return;let n=o.target.element;if(n?.tagName==="SPAN"&&(n=n.parentElement),n?.tagName==="A")for(let r of this._lenses){let a=r.getCommand(n);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){let i=new Js;for(let o of this._lenses)o.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=[],o;for(let a of e.lenses){let l=a.symbol.range.startLineNumber;l<1||l>t||(o&&o[o.length-1].symbol.range.startLineNumber===l?o.push(a):(o=[a],i.push(o)))}if(!i.length&&!this._lenses.length)return;let n=bo.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{let d=new Js,c=0,u=0;for(;u<i.length&&c<this._lenses.length;){let g=i[u][0].symbol.range.startLineNumber,p=this._lenses[c].getLineNumber();p<g?(this._lenses[c].dispose(d,l),this._lenses.splice(c,1)):p===g?(this._lenses[c].updateCodeLensSymbols(i[u],d),u++,c++):(this._lenses.splice(c,0,new Gl(i[u],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),c++,u++)}for(;c<this._lenses.length;)this._lenses[c].dispose(d,l),this._lenses.splice(c,1);for(;u<i.length;)this._lenses.push(new Gl(i[u],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),u++;d.commit(a)})}),n.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;let t=this._editor.getModel();if(!t)return;let i=[],o=[];if(this._lenses.forEach(a=>{let l=a.computeIfNecessary(t);l&&(i.push(l),o.push(a))}),i.length===0)return;let n=Date.now(),r=Se(a=>{let l=i.map((d,c)=>{let u=new Array(d.length),g=d.map((p,m)=>!p.symbol.command&&typeof p.provider.resolveCodeLens=="function"?Promise.resolve(p.provider.resolveCodeLens(t,p.symbol,a)).then(f=>{u[m]=f},pe):(u[m]=p.symbol,Promise.resolve(void 0)));return Promise.all(g).then(()=>{!a.isCancellationRequested&&!o[c].isDisposed()&&o[c].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{let a=this._resolveCodeLensesDebounce.update(t,Date.now()-n);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{ee(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};ea.ID="css.editor.codeLens";ea=BN([$l(1,N),$l(2,rt),$l(3,Ne),$l(4,He),$l(5,K_)],ea);W(ea.ID,ea,1);w(class extends k{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:_.hasCodeLensProvider,label:h("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;let i=e.get(Ot),o=e.get(Ne),n=e.get(He),r=t.getSelection().positionLineNumber,a=t.getContribution(ea.ID);if(!a)return;let l=await a.getModel();if(!l)return;let d=[];for(let g of l.lenses)g.symbol.command&&g.symbol.range.startLineNumber===r&&d.push({label:g.symbol.command.title,command:g.symbol.command});if(d.length===0)return;let c=await i.pick(d,{canPickMany:!1,placeHolder:h("placeHolder","Select a command")});if(!c)return;let u=c.command;if(l.isDisposed){let g=await a.getModel(),p=g?.lenses.find(m=>{var f;return m.symbol.range.startLineNumber===r&&((f=m.symbol.command)===null||f===void 0?void 0:f.title)===u.title});if(!p||!p.symbol.command)return;u=p.symbol.command}try{await o.executeCommand(u.id,...u.arguments||[])}catch(g){n.error(g)}}});E();Z();q();fe();ho();me();Ie();E();Ao();Be();Z();q();mt();Te();me();pt();q();Ri();Ue();ho();Ri();It();E();var VN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},G_=function(s,e){return function(t,i){e(t,i,s)}},Hr=class{constructor(e,t){this._editorWorkerClient=new lI(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){let o=t.range,n=t.color,r=n.alpha,a=new ie(new ji(Math.round(255*n.red),Math.round(255*n.green),Math.round(255*n.blue),r)),l=r?ie.Format.CSS.formatRGB(a):ie.Format.CSS.formatRGBA(a),d=r?ie.Format.CSS.formatHSL(a):ie.Format.CSS.formatHSLA(a),c=r?ie.Format.CSS.formatHex(a):ie.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:o,text:l}}),u.push({label:d,textEdit:{range:o,text:d}}),u.push({label:c,textEdit:{range:o,text:c}}),u}},$_=class extends I{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new Hr(e,t)))}};$_=VN([G_(0,ze),G_(1,he),G_(2,N)],$_);Hn($_);at();async function $u(s,e,t,i=!0){return J_(new Y_,s,e,t,i)}function X_(s,e,t,i){return Promise.resolve(t.provideColorPresentations(s,e,i))}var Y_=class{constructor(){}async compute(e,t,i,o){let n=await e.provideDocumentColors(t,i);if(Array.isArray(n))for(let r of n)o.push({colorInfo:r,provider:e});return Array.isArray(n)}},Z_=class{constructor(){}async compute(e,t,i,o){let n=await e.provideDocumentColors(t,i);if(Array.isArray(n))for(let r of n)o.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(n)}},Q_=class{constructor(e){this.colorInfo=e}async compute(e,t,i,o){let n=await e.provideColorPresentations(t,this.colorInfo,Y.None);return Array.isArray(n)&&o.push(...n),Array.isArray(n)}};async function J_(s,e,t,i,o){let n=!1,r,a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){let c=l[d];if(c instanceof Hr)r=c;else try{await s.compute(c,t,i,a)&&(n=!0)}catch(u){pe(u)}}return n?a:r&&o?(await s.compute(r,t,i,a),a):[]}function GL(s,e){let{colorProvider:t}=s.get(N),i=s.get(ze).getModel(e);if(!i)throw bi();let o=s.get(se).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:o}}ae.registerCommand("_executeDocumentColorProvider",function(s,...e){let[t]=e;if(!(t instanceof ne))throw bi();let{model:i,colorProviderRegistry:o,isDefaultColorDecoratorsEnabled:n}=GL(s,t);return J_(new Z_,o,i,Y.None,n)});ae.registerCommand("_executeColorPresentationProvider",function(s,...e){let[t,i]=e,{uri:o,range:n}=i;if(!(o instanceof ne)||!Array.isArray(t)||t.length!==4||!b.isIRange(n))throw bi();let{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=GL(s,o),[d,c,u,g]=t;return J_(new Q_({range:n,color:{red:d,green:c,blue:u,alpha:g}}),a,r,Y.None,l)});at();var UN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},ev=function(s,e){return function(t,i){e(t,i,s)}},tv,ov=Object.create({}),an=tv=class extends I{constructor(e,t,i,o){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new L),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new zh(this._editor),this._decoratorLimitReporter=new iv,this._colorDecorationClassRefs=this._register(new L),this._debounceInformation=o.for(i.colorProvider,"Document Colors",{min:tv.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(n=>{let r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);let a=r!==this._isColorDecoratorsEnabled||n.hasChanged(21),l=n.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){let e=this._editor.getModel();if(!e)return!1;let t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){let o=i.colorDecorators;if(o&&o.enable!==void 0&&!o.enable)return o.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;let e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new ao,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Se(async e=>{let t=this._editor.getModel();if(!t)return[];let i=new st(!1),o=await $u(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),o});try{let e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){ee(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){let t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:te.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((o,n)=>this._colorDatas.set(o,e[n]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();let t=[],i=this._editor.getOption(21);for(let n=0;n<e.length&&t.length<i;n++){let{red:r,green:a,blue:l,alpha:d}=e[n].colorInfo.color,c=new ji(Math.round(r*255),Math.round(a*255),Math.round(l*255),d),u=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,g=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:u}));t.push({range:{startLineNumber:e[n].colorInfo.range.startLineNumber,startColumn:e[n].colorInfo.range.startColumn,endLineNumber:e[n].colorInfo.range.endLineNumber,endColumn:e[n].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:fh,inlineClassName:`${g.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:ov}}})}let o=i<e.length?i:!1;this._decoratorLimitReporter.update(e.length,o),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){let t=this._editor.getModel();if(!t)return null;let i=t.getDecorationsInRange(b.fromPositions(e,e)).filter(o=>this._colorDatas.has(o.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};an.ID="editor.contrib.colorDetector";an.RECOMPUTE_TIME=1e3;an=tv=UN([ev(1,se),ev(2,N),ev(3,rt)],an);var iv=class{constructor(){this._onDidChange=new K,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}};W(an.ID,an,1);fe();Te();ho();E();q();Ie();var Yu=class{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new K,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new K,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new K,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let o=0;o<this.colorPresentations.length;o++)if(t.toLowerCase()===this.colorPresentations[o].label){i=o;break}if(i===-1){let o=t.split("(")[0].toLowerCase();for(let n=0;n<this.colorPresentations.length;n++)if(this.colorPresentations[n].label.toLowerCase().startsWith(o)){i=n;break}}i!==-1&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}};Ex();de();Nt();ho();Ie();E();ti();F();Lt();var mi=P,nv=class extends I{constructor(e,t,i,o=!1){super(),this.model=t,this.showingStandaloneColorPicker=o,this._closeButton=null,this._domNode=mi(".colorpicker-header"),T(e,this._domNode),this._pickedColorNode=T(this._domNode,mi(".picked-color")),T(this._pickedColorNode,mi("span.codicon.codicon-color-mode")),this._pickedColorPresentation=T(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");let n=h("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",n),this._originalColorNode=T(this._domNode,mi(".original-color")),this._originalColorNode.style.backgroundColor=ie.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(Mf)||ie.white,this._register(i.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor(Mf)||ie.white})),this._register(ce(this._pickedColorNode,Pe.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ce(this._originalColorNode,Pe.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=ie.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new rv(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=ie.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}},rv=class extends I{constructor(e){super(),this._onClicked=this._register(new K),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),T(e,this._button);let t=document.createElement("div");t.classList.add("close-button-inner-div"),T(this._button,t),T(t,mi(".button"+le.asCSSSelector(Ve("color-picker-close",$.close,h("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}},sv=class extends I{constructor(e,t,i,o=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=mi(".colorpicker-body"),T(e,this._domNode),this._saturationBox=new av(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new lv(this._domNode,this.model,o),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new dv(this._domNode,this.model,o),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),o&&(this._insertButton=this._register(new cv(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){let i=this.model.color.hsva;this.model.color=new ie(new pl(i.h,e,t,i.a))}onDidOpacityChange(e){let t=this.model.color.hsva;this.model.color=new ie(new pl(t.h,t.s,t.v,e))}onDidHueChange(e){let t=this.model.color.hsva,i=(1-e)*360;this.model.color=new ie(new pl(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}},av=class extends I{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new K,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new K,this.onColorFlushed=this._onColorFlushed.event,this._domNode=mi(".saturation-wrap"),T(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",T(this._domNode,this._canvas),this.selection=mi(".saturation-selection"),T(this._domNode,this.selection),this.layout(),this._register(ce(this._domNode,Pe.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new Df);let t=et(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangePosition(o.pageX-t.left,o.pageY-t.top),()=>null);let i=ce(e.target.ownerDocument,Pe.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){let i=Math.max(0,Math.min(1,e/this.width)),o=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,o),this._onDidChange.fire({s:i,v:o})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();let e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){let e=this.model.color.hsva,t=new ie(new pl(e.h,1,1,1)),i=this._canvas.getContext("2d"),o=i.createLinearGradient(0,0,this._canvas.width,0);o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),o.addColorStop(1,"rgba(255, 255, 255, 0)");let n=i.createLinearGradient(0,0,0,this._canvas.height);n.addColorStop(0,"rgba(0, 0, 0, 0)"),n.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=ie.Format.CSS.format(t),i.fill(),i.fillStyle=o,i.fill(),i.fillStyle=n,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();let t=e.hsva;this.paintSelection(t.s,t.v)}},Zu=class extends I{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new K,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new K,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=T(e,mi(".standalone-strip")),this.overlay=T(this.domNode,mi(".standalone-overlay"))):(this.domNode=T(e,mi(".strip")),this.overlay=T(this.domNode,mi(".overlay"))),this.slider=T(this.domNode,mi(".slider")),this.slider.style.top="0px",this._register(ce(this.domNode,Pe.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;let e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){let t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._register(new Df),i=et(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangeTop(n.pageY-i.top),()=>null);let o=ce(e.target.ownerDocument,Pe.POINTER_UP,()=>{this._onColorFlushed.fire(),o.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){let t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}},lv=class extends Zu{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);let{r:t,g:i,b:o}=e.rgba,n=new ie(new ji(t,i,o,1)),r=new ie(new ji(t,i,o,0));this.overlay.style.background=`linear-gradient(to bottom, ${n} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}},dv=class extends Zu{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}},cv=class extends I{constructor(e){super(),this._onClicked=this._register(new K),this.onClicked=this._onClicked.event,this._button=T(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}},Qu=class extends $o{constructor(e,t,i,o,n=!1){super(),this.model=t,this.pixelRatio=i,this._register(Mx.onDidChange(()=>this.layout()));let r=mi(".colorpicker-widget");e.appendChild(r),this.header=this._register(new nv(r,this.model,o,n)),this.body=this._register(new sv(r,this.model,this.pixelRatio,n))}layout(){this.body.layout()}};Dt();de();var $L=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},YL=function(s,e){return function(t,i){e(t,i,s)}},hv=class{constructor(e,t,i,o){this.owner=e,this.range=t,this.model=i,this.provider=o,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}},Yl=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Zt.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];let o=an.get(this._editor);if(!o)return[];for(let n of t){if(!o.isColorDecoration(n))continue;let r=o.getColorData(n.range.getStartPosition());if(r)return[await ZL(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return QL(this,this._editor,this._themeService,t,e)}};Yl=$L([YL(1,dt)],Yl);var uv=class{constructor(e,t,i,o){this.owner=e,this.range=t,this.model=i,this.provider=o}},ta=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!an.get(this._editor))return null;let n=await $u(i,this._editor.getModel(),Y.None),r=null,a=null;for(let u of n){let g=u.colorInfo;b.containsRange(g.range,e.range)&&(r=g,a=u.provider)}let l=r??e,d=a??t,c=!!r;return{colorHover:await ZL(this,this._editor.getModel(),l,d),foundInEditor:c}}async updateEditorModel(e){if(!this._editor.hasModel())return;let t=e.model,i=new b(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await Xu(this._editor.getModel(),t,this._color,i,e),i=XL(this._editor,i,t))}renderHoverParts(e,t){return QL(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};ta=$L([YL(1,dt)],ta);async function ZL(s,e,t,i){let o=e.getValueInRange(t.range),{red:n,green:r,blue:a,alpha:l}=t.color,d=new ji(Math.round(n*255),Math.round(r*255),Math.round(a*255),l),c=new ie(d),u=await X_(e,t,i,Y.None),g=new Yu(c,[],0);return g.colorPresentations=u||[],g.guessColorPresentation(c,o),s instanceof Yl?new hv(s,b.lift(t.range),g,i):new uv(s,b.lift(t.range),g,i)}function QL(s,e,t,i,o){if(i.length===0||!e.hasModel())return I.None;if(o.setMinimumDimensions){let g=e.getOption(66)+8;o.setMinimumDimensions(new be(302,g))}let n=new L,r=i[0],a=e.getModel(),l=r.model,d=n.add(new Qu(o.fragment,l,e.getOption(141),t,s instanceof ta));o.setColorPicker(d);let c=!1,u=new b(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(s instanceof ta){let g=i[0].model.color;s.color=g,Xu(a,l,g,u,r),n.add(l.onColorFlushed(p=>{s.color=p}))}else n.add(l.onColorFlushed(async g=>{await Xu(a,l,g,u,r),c=!0,u=XL(e,u,l,o)}));return n.add(l.onDidChangeColor(g=>{Xu(a,l,g,u,r)})),n.add(e.onDidChangeModelContent(g=>{c?c=!1:(o.hide(),e.focus())})),n}function XL(s,e,t,i){let o,n;if(t.presentation.textEdit){o=[t.presentation.textEdit],n=new b(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);let r=s.getModel()._setTrackedRange(null,n,3);s.pushUndoStop(),s.executeEdits("colorpicker",o),n=s.getModel()._getTrackedRange(r)||n}else o=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],n=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),s.pushUndoStop(),s.executeEdits("colorpicker",o);return t.presentation.additionalTextEdits&&(o=[...t.presentation.additionalTextEdits],s.executeEdits("colorpicker",o),i&&i.hide()),s.pushUndoStop(),n}async function Xu(s,e,t,i,o){let n=await X_(s,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},o.provider,Y.None);e.colorPresentations=n||[]}Fo();E();Z();q();we();Ti();fe();me();E();Tr();Z();q();Ti();ro();Ie();E();$t();function gv(s,e){return!!s[e]}var Zl=class{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=gv(e.event,t.triggerModifier),this.hasSideBySideModifier=gv(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}},Ju=class{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=gv(e,t.triggerModifier)}},ia=class{constructor(e,t,i,o){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=o}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}};function JL(s){return s==="altKey"?Gt?new ia(57,"metaKey",6,"altKey"):new ia(5,"ctrlKey",6,"altKey"):Gt?new ia(6,"altKey",57,"metaKey"):new ia(6,"altKey",5,"ctrlKey")}var wo=class extends I{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new K),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new K),this.onExecute=this._onExecute.event,this._onCancel=this._register(new K),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t?.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:o=>o.target.position?o.target.position.lineNumber:0,this._opts=JL(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(o=>{if(o.hasChanged(77)){let n=JL(this._editor.getOption(77));if(this._opts.equals(n))return;this._opts=n,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(o=>this._onEditorMouseMove(new Zl(o,this._opts)))),this._register(this._editor.onMouseDown(o=>this._onEditorMouseDown(new Zl(o,this._opts)))),this._register(this._editor.onMouseUp(o=>this._onEditorMouseUp(new Zl(o,this._opts)))),this._register(this._editor.onKeyDown(o=>this._onEditorKeyDown(new Ju(o,this._opts)))),this._register(this._editor.onKeyUp(o=>this._onEditorKeyUp(new Ju(o,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(o=>this._onDidChangeCursorSelection(o))),this._register(this._editor.onDidChangeModel(o=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(o=>{(o.scrollTopChanged||o.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){let t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}};de();Ns();Nt();ti();ho();Ie();rf();Z();Rt();rf();Rt();It();Ue();re();ge();Dt();var jN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},ln=function(s,e){return function(t,i){e(t,i,s)}},xi=class extends h0{constructor(e,t,i,o,n,r,a,l,d,c,u,g,p){super(e,{...o.getRawOptions(),overflowWidgetsDomNode:o.getOverflowWidgetsDomNode()},i,n,r,a,l,d,c,u,g,p),this._parentEditor=o,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(o.onDidChangeConfiguration(m=>this._onParentConfigurationChanged(m)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){ws(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};xi=jN([ln(4,B),ln(5,_e),ln(6,Ne),ln(7,G),ln(8,dt),ln(9,He),ln(10,As),ln(11,he),ln(12,N)],xi);de();ho();E();rf();q();mt();var tD=new ie(new ji(0,122,204)),KN={showArrow:!0,showFrame:!0,className:"",frameColor:tD,arrowColor:tD,keepEditorSelection:!1},qN="vs.editor.contrib.zoneWidget",pv=class{constructor(e,t,i,o,n,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=o,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=n,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}},mv=class{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}},eg=class s{constructor(e){this._editor=e,this._ruleName=s._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),vf(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){vf(this._ruleName),Yx(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:b.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}};eg._IdGenerator=new T0(".arrow-decoration-");var tg=class{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new L,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=ox(t),ws(this.options,KN,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{let o=this._getWidth(i);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(o)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new eg(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){let e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){let e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){let i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;let o=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(o))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){let e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){let i=b.isIRange(e)?b.lift(e):b.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:te.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){let e=this.editor.getOption(66),t=0;if(this.options.showArrow){let i=Math.round(e/3);t+=2*i}if(this.options.showFrame){let i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){let i=e.getStartPosition(),o=this.editor.getLayoutInfo(),n=this._getWidth(o);this.domNode.style.width=`${n}px`,this.domNode.style.left=this._getLeft(o)+"px";let r=document.createElement("div");r.style.overflow="hidden";let a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){let g=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,g)}let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(g=>{this._viewZone&&g.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new pv(r,i.lineNumber,i.column,t,p=>this._onViewZoneTop(p),p=>this._onViewZoneHeight(p),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=g.addZone(this._viewZone),this._overlayWidget=new mv(qN+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){let g=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=g+"px",this.container.style.borderBottomWidth=g+"px"}let c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,n),this.options.keepEditorSelection||this.editor.setSelection(e);let u=this.editor.getModel();if(u){let g=u.validateRange(new b(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(g,g.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new on(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){let i=(t.currentY-e.startY)/this.editor.getOption(66),o=i<0?Math.ceil(i):Math.floor(i),n=e.heightInLines+o;n>5&&n<35&&this._relayout(n)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){let e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}};F();re();Uo();ge();Lt();var iD=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},oD=function(s,e){return function(t,i){e(t,i,s)}},fv=Et("IPeekViewService");Pt(fv,class{constructor(){this._widgets=new Map}addExclusiveWidget(s,e){let t=this._widgets.get(s);t&&(t.listener.dispose(),t.widget.dispose());let i=()=>{let o=this._widgets.get(s);o&&o.widget===e&&(o.listener.dispose(),this._widgets.delete(s))};this._widgets.set(s,{widget:e,listener:e.onDidClose(i)})}},1);var vt;(function(s){s.inPeekEditor=new X("inReferenceSearchEditor",!0,h("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),s.notInPeekEditor=s.inPeekEditor.toNegated()})(vt||(vt={}));var Ql=class{constructor(e,t){e instanceof xi&&vt.inPeekEditor.bindTo(t)}dispose(){}};Ql.ID="editor.contrib.referenceController";Ql=iD([oD(1,G)],Ql);W(Ql.ID,Ql,0);function nD(s){let e=s.get(_e).getFocusedCodeEditor();return e instanceof xi?e.getParentEditor():e}var GN={headerBackgroundColor:ie.white,primaryHeadingColor:ie.fromHex("#333333"),secondaryHeadingColor:ie.fromHex("#6c6c6cb3")},oa=class extends tg{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new K,this.onDidClose=this._onDidClose.event,ws(this.options,GN,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){let t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();let e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=P(".head"),this._bodyElement=P(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=P(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),wi(this._titleElement,"click",n=>this._onTitleClick(n))),T(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=P("span.filename"),this._secondaryHeading=P("span.dirname"),this._metaHeading=P("span.meta"),T(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);let i=P(".peekview-actions");T(this._headElement,i);let o=this._getActionBarOptions();this._actionbarWidget=new en(i,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new so("peekview.close",h("label.close","Close"),le.asClassName($.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:W0.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:ii(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Bt(this._metaHeading)):xt(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}let i=Math.ceil(this.editor.getOption(66)*1.2),o=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(o,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};oa=iD([oD(2,B)],oa);var rD=z("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:ie.black,hcLight:ie.white},h("peekViewTitleBackground","Background color of the peek view title area.")),ig=z("peekViewTitleLabel.foreground",{dark:ie.white,light:ie.black,hcDark:ie.white,hcLight:po},h("peekViewTitleForeground","Color of the peek view title.")),og=z("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},h("peekViewTitleInfoForeground","Color of the peek view title info.")),sD=z("peekView.border",{dark:vl,light:vl,hcDark:Oi,hcLight:Oi},h("peekViewBorder","Color of the peek view borders and arrow.")),aD=z("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ie.black,hcLight:ie.white},h("peekViewResultsBackground","Background color of the peek view result list.")),$2=z("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ie.white,hcLight:po},h("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),Y2=z("peekViewResult.fileForeground",{dark:ie.white,light:"#1E1E1E",hcDark:ie.white,hcLight:po},h("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),Z2=z("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},h("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),Q2=z("peekViewResult.selectionForeground",{dark:ie.white,light:"#6C6C6C",hcDark:ie.white,hcLight:po},h("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list.")),qn=z("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ie.black,hcLight:ie.white},h("peekViewEditorBackground","Background color of the peek view editor.")),X2=z("peekViewEditorGutter.background",{dark:qn,light:qn,hcDark:qn,hcLight:qn},h("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),J2=z("peekViewEditorStickyScroll.background",{dark:qn,light:qn,hcDark:qn,hcLight:qn},h("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor.")),eB=z("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},h("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),tB=z("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},h("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),iB=z("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:go,hcLight:go},h("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));F();re();fe();Fo();St();pt();Tr();Z();Rt();ke();q();we();Ht();fe();me();Fo();E();Rt();ke();q();F();Ue();at();re();ge();ff();me();Ie();E();yi();Be();q();F();var Ii=class{constructor(e,t,i,o){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=o,this.id=P0.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;let t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?h({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,Xt(this.uri),this.range.startLineNumber,this.range.startColumn):h("aria.oneReference","in {0} on line {1} at column {2}",Xt(this.uri),this.range.startLineNumber,this.range.startColumn)}},_v=class{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){let i=this._modelReference.object.textEditorModel;if(!i)return;let{startLineNumber:o,startColumn:n,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:o,column:n-t}),d=new b(o,l.startColumn,o,n),c=new b(r,a,r,1073741824),u=i.getValueInRange(d).replace(/^\s+/,""),g=i.getValueInRange(e),p=i.getValueInRange(c).replace(/\s+$/,"");return{value:u+g+p,highlight:{start:u.length,end:u.length+g.length}}}},dn=class{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Pi}dispose(){$e(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){let e=this.children.length;return e===1?h("aria.fileReferences.1","1 symbol in {0}, full path {1}",Xt(this.uri),this.uri.fsPath):h("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Xt(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(let t of this.children)if(!this._previews.has(t.uri))try{let i=await e.createModelReference(t.uri);this._previews.set(t.uri,new _v(i))}catch(i){ee(i)}return this}},Jt=class s{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new K,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;let[i]=e;e.sort(s._compareReferences);let o;for(let n of e)if((!o||!Pf.isEqual(o.uri,n.uri,!0))&&(o=new dn(this,n.uri),this.groups.push(o)),o.children.length===0||s._compareReferences(n,o.children[o.children.length-1])!==0){let r=new Ii(i===n,o,n,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),o.children.push(r)}}dispose(){$e(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new s(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?h("aria.result.0","No results found"):this.references.length===1?h("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?h("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):h("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:i}=e,o=i.children.indexOf(e),n=i.children.length,r=i.parent.groups.length;return r===1||t&&o+1<n||!t&&o>0?(t?o=(o+1)%n:o=(o+n-1)%n,i.children[o]):(o=i.parent.groups.indexOf(i),t?(o=(o+1)%r,i.parent.groups[o].children[0]):(o=(o+r-1)%r,i.parent.groups[o].children[i.parent.groups[o].children.length-1]))}nearestReference(e,t){let i=this.references.map((o,n)=>({idx:n,prefixLen:Mn(o.uri.toString(),e.toString()),offsetDist:Math.abs(o.range.startLineNumber-t.lineNumber)*100+Math.abs(o.range.startColumn-t.column)})).sort((o,n)=>o.prefixLen>n.prefixLen?-1:o.prefixLen<n.prefixLen?1:o.offsetDist<n.offsetDist?-1:o.offsetDist>n.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(let i of this.references)if(i.uri.toString()===e.toString()&&b.containsPosition(i.range,t))return i}firstReference(){for(let e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Pf.compare(e.uri,t.uri)||b.compareRangesUsingStarts(e.range,t.range)}};de();ho();Ie();E();Rs();yi();q();mt();It();yf();Ti();ro();de();E();yi();ro();F();ge();var dg=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},cg=function(s,e){return function(t,i){e(t,i,s)}},vv,ng=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Jt||e instanceof dn}getChildren(e){if(e instanceof Jt)return e.groups;if(e instanceof dn)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};ng=dg([cg(0,gt)],ng);var rg=class{getHeight(){return 23}getTemplateId(e){return e instanceof dn?na.id:ra.id}},sg=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Ii){let i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Xt(e.uri)}};sg=dg([cg(0,Ce)],sg);var ag=class{getId(e){return e instanceof Ii?e.id:e.uri}},bv=class extends I{constructor(e,t){super(),this._labelService=t;let i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new du(i,{supportHighlights:!0})),this.badge=new $0(T(i,P(".count")),{},O0),e.appendChild(i)}set(e,t){let i=Vs(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});let o=e.children.length;this.badge.setCount(o),o>1?this.badge.setTitleFormat(h("referencesCount","{0} references",o)):this.badge.setTitleFormat(h("referenceCount","{0} reference",o))}};bv=dg([cg(1,Zo)],bv);var na=vv=class{constructor(e){this._instantiationService=e,this.templateId=vv.id}renderTemplate(e){return this._instantiationService.createInstance(bv,e)}renderElement(e,t,i){i.set(e.element,Rr(e.filterData))}disposeTemplate(e){e.dispose()}};na.id="FileReferencesRenderer";na=vv=dg([cg(0,B)],na);var Cv=class{constructor(e){this.label=new Y0(e)}set(e,t){var i;let o=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!o||!o.value)this.label.set(`${Xt(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{let{value:n,highlight:r}=o;t&&!Jo.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(n,Rr(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(n,[r]))}}},ra=class s{constructor(){this.templateId=s.id}renderTemplate(e){return new Cv(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}};ra.id="OneReferenceRenderer";var lg=class{getWidgetAriaLabel(){return h("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}};F();ge();Dt();FM();var YN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},cn=function(s,e){return function(t,i){e(t,i,s)}},hg=class s{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new L,this._callOnModelChange=new L,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();let e=this._editor.getModel();if(e){for(let t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));let t=[],i=[];for(let o=0,n=e.children.length;o<n;o++){let r=e.children[o];this._decorationIgnoreSet.has(r.id)||r.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:r.range,options:s.DecorationOptions}),i.push(o))}this._editor.changeDecorations(o=>{let n=o.deltaDecorations([],t);for(let r=0;r<n.length;r++)this._decorations.set(n[r],e.children[i[r]])})}_onDecorationChanged(){let e=[],t=this._editor.getModel();if(t){for(let[i,o]of this._decorations){let n=t.getDecorationRange(i);if(!n)continue;let r=!1;if(!b.equalsRange(n,o.range)){if(b.spansMultipleLines(n))r=!0;else{let a=o.range.endColumn-o.range.startColumn,l=n.endColumn-n.startColumn;a!==l&&(r=!0)}r?(this._decorationIgnoreSet.add(o.id),e.push(i)):o.range=n}}for(let i=0,o=e.length;i<o;i++)this._decorations.delete(e[i]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}};hg.DecorationOptions=te.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});var ug=class{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{let o=JSON.parse(e);t=o.ratio,i=o.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}},Sv=class extends K0{},gg=class extends oa{constructor(e,t,i,o,n,r,a,l,d,c,u,g){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=n,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._undoRedoService=d,this._keybindingService=c,this._languageService=u,this._languageConfigurationService=g,this._disposeOnNewModel=new L,this._callOnDispose=new L,this._onDidSelectReference=new K,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new be(0,0),this._applyTheme(o.getColorTheme()),this._callOnDispose.add(o.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),$e(this._preview),$e(this._previewNotAvailableMessage),$e(this._tree),$e(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){let t=e.getColor(sD)||ie.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(rD)||ie.transparent,primaryHeadingColor:e.getColor(ig),secondaryHeadingColor:e.getColor(og)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=T(e,P("div.messages")),xt(this._messageContainer),this._splitView=new z0(e,{orientation:1}),this._previewContainer=T(e,P("div.preview.inline"));let t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(xi,this._previewContainer,t,{},this.editor),xt(this._previewContainer),this._previewNotAvailableMessage=new Of(h("missingPreviewMessage","no preview available"),Ps,Of.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=T(e,P("div.ref-tree.inline"));let i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new lg,keyboardNavigationLabelProvider:this._instantiationService.createInstance(sg),identityProvider:new ag,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:aD}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(wi(this._treeContainer,"keydown",n=>{n.equals(9)&&(this._keybindingService.dispatchEvent(n,n.target),n.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Sv,"ReferencesWidget",this._treeContainer,new rg,[this._instantiationService.createInstance(na),this._instantiationService.createInstance(ra)],this._instantiationService.createInstance(ng),i),this._splitView.addView({onDidChange:Me.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:n=>{this._preview.layout({height:this._dim.height,width:n})}},Gf.Distribute),this._splitView.addView({onDidChange:Me.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:n=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${n}px`,this._tree.layout(this._dim.height,n)}},Gf.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));let o=(n,r)=>{n instanceof Ii&&(r==="show"&&this._revealReference(n,!1),this._onDidSelectReference.fire({element:n,kind:r,source:"tree"}))};this._tree.onDidOpen(n=>{n.sideBySide?o(n.element,"side"):n.editorOptions.pinned?o(n.element,"goto"):o(n.element,"show")}),xt(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new be(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=h("noResults","No results"),Bt(this._messageContainer),Promise.resolve(void 0)):(xt(this._messageContainer),this._decorationsManager=new hg(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{let{event:t,target:i}=e;if(t.detail!==2)return;let o=this._getFocusedReference();o&&this._onDidSelectReference.fire({element:{uri:o.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Bt(this._treeContainer),Bt(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){let[e]=this._tree.getFocus();if(e instanceof Ii)return e;if(e instanceof dn&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==yt.inMemory?this.setTitle(r0(e.uri),this._uriLabel.getUriLabel(Vs(e.uri))):this.setTitle(h("peekView.alternateTitle","References"));let i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));let o=await i;if(!this._model){o.dispose();return}$e(this._previewModelReference);let n=o.object;if(n){let r=this._preview.getModel()===n.textEditorModel?0:1,a=b.lift(e.range).collapseToStart();this._previewModelReference=o,this._preview.setModel(n.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),o.dispose()}};gg=YN([cn(3,dt),cn(4,gt),cn(5,B),cn(6,fv),cn(7,Zo),cn(8,d0),cn(9,Ce),cn(10,tt),cn(11,he)],gg);var ZN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},sa=function(s,e){return function(t,i){e(t,i,s)}},pg,Br=new X("referenceSearchVisible",!1,h("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'")),xo=pg=class{static get(e){return e.getContribution(pg.ID)}constructor(e,t,i,o,n,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=o,this._notificationService=n,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new L,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Br.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let o;if(this._widget&&(o=this._widget.position),this.closeWidget(),o&&e.containsPosition(o))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));let n="peekViewLayout",r=ug.fromJSON(this._storageService.get(n,0,"{}"));this._widget=this._instantiationService.createInstance(gg,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(h("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(n,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{let{element:d,kind:c}=l;if(d)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(d,!1,!1);break;case"side":this.openReference(d,!0,!1);break;case"goto":i?this._gotoReference(d,!0):this.openReference(d,!1,!0);break}}));let a=++this._requestIdPool;t.then(l=>{var d;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(d=this._model)===null||d===void 0||d.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(h("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));let c=this._editor.getModel().uri,u=new R(e.startLineNumber,e.startColumn),g=this._model.nearestReference(c,u);if(g)return this._widget.setSelection(g).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;let t=this._widget.position;if(!t)return;let i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;let o=this._model.nextOrPreviousReference(i,e),n=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(o),await this._gotoReference(o,!1),n?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;let o=b.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:o,selectionSource:"code.jump",pinned:t}},this._editor).then(n=>{var r;if(this._ignoreModelChangeEvent=!1,!n||!this._widget){this.closeWidget();return}if(this._editor===n)this._widget.show(o),this._widget.focusOnReferenceTree();else{let a=pg.get(n),l=this._model.clone();this.closeWidget(),n.focus(),a?.toggleWidget(o,Se(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},n=>{this._ignoreModelChangeEvent=!1,ee(n)})}openReference(e,t,i){t||this.closeWidget();let{uri:o,range:n}=e;this._editorService.openCodeEditor({resource:o,options:{selection:n,selectionSource:"code.jump",pinned:i}},this._editor,t)}};xo.ID="editor.contrib.referencesController";xo=pg=ZN([sa(2,G),sa(3,_e),sa(4,He),sa(5,B),sa(6,ai),sa(7,se)],xo);function Vr(s,e){let t=nD(s);if(!t)return;let i=xo.get(t);i&&e(i)}Ci.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Ee(2089,60),when:x.or(Br,vt.inPeekEditor),handler(s){Vr(s,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Ci.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:x.or(Br,vt.inPeekEditor),handler(s){Vr(s,e=>{e.goToNextOrPreviousReference(!0)})}});Ci.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:x.or(Br,vt.inPeekEditor),handler(s){Vr(s,e=>{e.goToNextOrPreviousReference(!1)})}});ae.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");ae.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");ae.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");ae.registerCommand("closeReferenceSearch",s=>Vr(s,e=>e.closeWidget()));Ci.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:x.and(vt.inPeekEditor,x.not("config.editor.stablePeek"))});Ci.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:x.and(Br,x.not("config.editor.stablePeek"))});Ci.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:x.and(Br,Yf,Zf.negate(),Qf.negate()),handler(s){var e;let i=(e=s.get(lu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Ii&&Vr(s,o=>o.revealReference(i[0]))}});Ci.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:x.and(Br,Yf,Zf.negate(),Qf.negate()),handler(s){var e;let i=(e=s.get(lu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Ii&&Vr(s,o=>o.openReference(i[0],!0,!0))}});ae.registerCommand("openReference",s=>{var e;let i=(e=s.get(lu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Ii&&Vr(s,o=>o.openReference(i[0],!1,!0))});Ie();E();yi();Z();Rt();q();F();re();Uo();ge();ff();var lD=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Xl=function(s,e){return function(t,i){e(t,i,s)}},xv=new X("hasSymbols",!1,h("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),Jl=Et("ISymbolNavigationService"),wv=class{constructor(e,t,i,o){this._editorService=t,this._notificationService=i,this._keybindingService=o,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=xv.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){let t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();let i=new yv(this._editorService),o=i.onDidChange(n=>{if(this._ignoreEditorChange)return;let r=this._editorService.getActiveCodeEditor();if(!r)return;let a=r.getModel(),l=r.getPosition();if(!a||!l)return;let d=!1,c=!1;for(let u of t.references)if($h(u.uri,a.uri))d=!0,c=c||b.containsPosition(u.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=sf(i,o)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;let t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:b.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();let t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?h("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):h("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};wv=lD([Xl(0,G),Xl(1,_e),Xl(2,He),Xl(3,Ce)],wv);Pt(Jl,wv,1);H(new class extends je{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:xv,kbOpts:{weight:100,primary:70}})}runEditorCommand(s,e){return s.get(Jl).revealNext(e)}});Ci.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:xv,primary:9,handler(s){s.get(Jl).reset()}});var yv=class{constructor(e){this._listener=new Map,this._disposables=new L,this._onDidChange=new K,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),$e(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,sf(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};yv=lD([Xl(0,_e)],yv);F();Je();Ue();re();ge();Fe();Te();me();Z();async function ed(s,e,t,i){let n=t.ordered(s).map(a=>Promise.resolve(i(a,s,e)).then(void 0,l=>{pe(l)})),r=await Promise.all(n);return zt(r.flat())}function Ur(s,e,t,i){return ed(e,t,s,(o,n,r)=>o.provideDefinition(n,r,i))}function Iv(s,e,t,i){return ed(e,t,s,(o,n,r)=>o.provideDeclaration(n,r,i))}function Lv(s,e,t,i){return ed(e,t,s,(o,n,r)=>o.provideImplementation(n,r,i))}function Dv(s,e,t,i){return ed(e,t,s,(o,n,r)=>o.provideTypeDefinition(n,r,i))}function td(s,e,t,i,o){return ed(e,t,s,async(n,r,a)=>{let l=await n.provideReferences(r,a,{includeDeclaration:!0},o);if(!i||!l||l.length!==2)return l;let d=await n.provideReferences(r,a,{includeDeclaration:!1},o);return d&&d.length===1?d:l})}async function id(s){let e=await s(),t=new Jt(e,""),i=t.references.map(o=>o.link);return t.dispose(),i}ri("_executeDefinitionProvider",(s,e,t)=>{let i=s.get(N),o=Ur(i.definitionProvider,e,t,Y.None);return id(()=>o)});ri("_executeTypeDefinitionProvider",(s,e,t)=>{let i=s.get(N),o=Dv(i.typeDefinitionProvider,e,t,Y.None);return id(()=>o)});ri("_executeDeclarationProvider",(s,e,t)=>{let i=s.get(N),o=Iv(i.declarationProvider,e,t,Y.None);return id(()=>o)});ri("_executeReferenceProvider",(s,e,t)=>{let i=s.get(N),o=td(i.referenceProvider,e,t,!1,Y.None);return id(()=>o)});ri("_executeImplementationProvider",(s,e,t)=>{let i=s.get(N),o=Lv(i.implementationProvider,e,t,Y.None);return id(()=>o)});ol();var od,nd,rd,mg,fg,_g,vg,bg;Yt.appendMenuItem(O.EditorContext,{submenu:O.EditorContextPeek,title:h("peek.submenu","Peek"),group:"navigation",order:100});var jr=class s{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof s||R.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}},Fi=class s extends ni{static all(){return s._allSymbolNavigationCommands.values()}static _patchConfig(e){let t={...e,f1:!0};if(t.menu)for(let i of gi.wrap(t.menu))(i.id===O.EditorContext||i.id===O.EditorContextPeek)&&(i.when=x.and(e.precondition,i.when));return t}constructor(e,t){super(s._patchConfig(t)),this.configuration=e,s._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,o){if(!t.hasModel())return Promise.resolve(void 0);let n=e.get(He),r=e.get(_e),a=e.get(Qo),l=e.get(Jl),d=e.get(N),c=e.get(B),u=t.getModel(),g=t.getPosition(),p=jr.is(i)?i:new jr(u,g),m=new Co(t,5),f=En(this._getLocationModel(d,p.model,p.position,m.token),m.token).then(async C=>{var v;if(!C||m.token.isCancellationRequested)return;nt(C.ariaMessage);let S;if(C.referenceAt(u.uri,g)){let D=this._getAlternativeCommand(t);!s._activeAlternativeCommands.has(D)&&s._allSymbolNavigationCommands.has(D)&&(S=s._allSymbolNavigationCommands.get(D))}let y=C.references.length;if(y===0){if(!this.configuration.muteMessage){let D=u.getWordAtPosition(g);(v=kt.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(D),g)}}else if(y===1&&S)s._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(D=>S.runEditorCommand(D,t,i,o).finally(()=>{s._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,C,o)},C=>{n.error(C)}).finally(()=>{m.dispose()});return a.showWhile(f,250),f}async _onResult(e,t,i,o,n){let r=this._getGoToPreference(i);if(!(i instanceof xi)&&(this.configuration.openInPeek||r==="peek"&&o.references.length>1))this._openInPeek(i,o,n);else{let a=o.firstReference(),l=o.references.length>1&&r==="gotoAndPeek",d=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,o,n):o.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,o,n){let r;if(mx(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;let a=await t.openCodeEditor({resource:i.uri,options:{selection:b.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,o);if(a){if(n){let l=a.getModel(),d=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&d.clear()},350)}return a}}_openInPeek(e,t,i){let o=xo.get(e);o&&e.hasModel()?o.toggleWidget(i??e.getSelection(),Se(n=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};Fi._allSymbolNavigationCommands=new Map;Fi._activeAlternativeCommands=new Set;var hn=class extends Fi{async _getLocationModel(e,t,i,o){return new Jt(await Ur(e.definitionProvider,t,i,o),h("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?h("noResultWord","No definition found for '{0}'",e.word):h("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}};ve((od=class extends hn{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:od.id,title:{value:h("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:h({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:x.and(_.hasDefinitionProvider,_.isInWalkThroughSnippet.toNegated()),keybinding:[{when:_.editorTextFocus,primary:70,weight:100},{when:x.and(_.editorTextFocus,$f),primary:2118,weight:100}],menu:[{id:O.EditorContext,group:"navigation",order:1.1},{id:O.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),ae.registerCommandAlias("editor.action.goToDeclaration",od.id)}},od.id="editor.action.revealDefinition",od));ve((nd=class extends hn{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:nd.id,title:{value:h("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:x.and(_.hasDefinitionProvider,_.isInWalkThroughSnippet.toNegated()),keybinding:[{when:_.editorTextFocus,primary:Ee(2089,70),weight:100},{when:x.and(_.editorTextFocus,$f),primary:Ee(2089,2118),weight:100}]}),ae.registerCommandAlias("editor.action.openDeclarationToTheSide",nd.id)}},nd.id="editor.action.revealDefinitionAside",nd));ve((rd=class extends hn{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:rd.id,title:{value:h("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:x.and(_.hasDefinitionProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),keybinding:{when:_.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:O.EditorContextPeek,group:"peek",order:2}}),ae.registerCommandAlias("editor.action.previewDeclaration",rd.id)}},rd.id="editor.action.peekDefinition",rd));var Cg=class extends Fi{async _getLocationModel(e,t,i,o){return new Jt(await Iv(e.declarationProvider,t,i,o),h("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?h("decl.noResultWord","No declaration found for '{0}'",e.word):h("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}};ve((mg=class extends Cg{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:mg.id,title:{value:h("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:h({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:x.and(_.hasDeclarationProvider,_.isInWalkThroughSnippet.toNegated()),menu:[{id:O.EditorContext,group:"navigation",order:1.3},{id:O.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?h("decl.noResultWord","No declaration found for '{0}'",e.word):h("decl.generic.noResults","No declaration found")}},mg.id="editor.action.revealDeclaration",mg));ve(class extends Cg{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:h("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:x.and(_.hasDeclarationProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),menu:{id:O.EditorContextPeek,group:"peek",order:3}})}});var Sg=class extends Fi{async _getLocationModel(e,t,i,o){return new Jt(await Dv(e.typeDefinitionProvider,t,i,o),h("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?h("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):h("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}};ve((fg=class extends Sg{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:fg.ID,title:{value:h("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:h({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:x.and(_.hasTypeDefinitionProvider,_.isInWalkThroughSnippet.toNegated()),keybinding:{when:_.editorTextFocus,primary:0,weight:100},menu:[{id:O.EditorContext,group:"navigation",order:1.4},{id:O.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},fg.ID="editor.action.goToTypeDefinition",fg));ve((_g=class extends Sg{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:_g.ID,title:{value:h("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:x.and(_.hasTypeDefinitionProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),menu:{id:O.EditorContextPeek,group:"peek",order:4}})}},_g.ID="editor.action.peekTypeDefinition",_g));var wg=class extends Fi{async _getLocationModel(e,t,i,o){return new Jt(await Lv(e.implementationProvider,t,i,o),h("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?h("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):h("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}};ve((vg=class extends wg{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:vg.ID,title:{value:h("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:h({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:x.and(_.hasImplementationProvider,_.isInWalkThroughSnippet.toNegated()),keybinding:{when:_.editorTextFocus,primary:2118,weight:100},menu:[{id:O.EditorContext,group:"navigation",order:1.45},{id:O.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},vg.ID="editor.action.goToImplementation",vg));ve((bg=class extends wg{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:bg.ID,title:{value:h("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:x.and(_.hasImplementationProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),keybinding:{when:_.editorTextFocus,primary:3142,weight:100},menu:{id:O.EditorContextPeek,group:"peek",order:5}})}},bg.ID="editor.action.peekImplementation",bg));var yg=class extends Fi{_getNoResultFoundMessage(e){return e?h("references.no","No references found for '{0}'",e.word):h("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}};ve(class extends yg{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:h("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:h({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:x.and(_.hasReferenceProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),keybinding:{when:_.editorTextFocus,primary:1094,weight:100},menu:[{id:O.EditorContext,group:"navigation",order:1.45},{id:O.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,o){return new Jt(await td(e.referenceProvider,t,i,!0,o),h("ref.title","References"))}});ve(class extends yg{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:h("references.action.label","Peek References"),original:"Peek References"},precondition:x.and(_.hasReferenceProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),menu:{id:O.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,o){return new Jt(await td(e.referenceProvider,t,i,!1,o),h("ref.title","References"))}});var kv=class extends Fi{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:h("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:x.and(vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,o){return new Jt(this._references,h("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&h("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}};ae.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:ne},{name:"position",description:"The position at which to start",constraint:R.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(s,e,t,i,o,n,r)=>{ue(ne.isUri(e)),ue(R.isIPosition(t)),ue(Array.isArray(i)),ue(typeof o>"u"||typeof o=="string"),ue(typeof r>"u"||typeof r=="boolean");let a=s.get(_e),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(t_(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{let c=new class extends kv{_getNoResultFoundMessage(u){return n||super._getNoResultFoundMessage(u)}}({muteMessage:!n,openInPeek:!!r,openToSide:!1},i,o);d.get(B).invokeFunction(c.run.bind(c),l)})}});ae.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:ne},{name:"position",description:"The position at which to start",constraint:R.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:async(s,e,t,i,o)=>{s.get(Ne).executeCommand("editor.action.goToLocations",e,t,i,o,void 0,!0)}});ae.registerCommand({id:"editor.action.findReferences",handler:(s,e,t)=>{ue(ne.isUri(e)),ue(R.isIPosition(t));let i=s.get(N),o=s.get(_e);return o.openCodeEditor({resource:e},o.getFocusedCodeEditor()).then(n=>{if(!t_(n)||!n.hasModel())return;let r=xo.get(n);if(!r)return;let a=Se(d=>td(i.referenceProvider,n.getModel(),R.lift(t),!1,d).then(c=>new Jt(c,h("ref.title","References")))),l=new b(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});ae.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");mt();var QN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Mv=function(s,e){return function(t,i){e(t,i,s)}},sd,Gn=sd=class{constructor(e,t,i,o){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=o,this.toUnhook=new L,this.toUnhookForKeyboard=new L,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();let n=new wo(e);this.toUnhook.add(n),this.toUnhook.add(n.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(n.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{ee(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(n.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(sd.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}let i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();let i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;let o=new mu(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Se(a=>this.findDefinition(e,a));let n;try{n=await this.previousPromise}catch(a){ee(a);return}if(!n||!n.length||!o.validate(this.editor)){this.removeLinkDecorations();return}let r=n[0].originSelectionRange?b.lift(n[0].originSelectionRange):new b(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(n.length>1){let a=r;for(let{originSelectionRange:l}of n)l&&(a=b.plusRange(a,l));this.addDecoration(a,new Qe().appendText(h("multipleResults","Click to show {0} definitions.",n.length)))}else{let a=n[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}let{object:{textEditorModel:d}}=l,{startLineNumber:c}=a.range;if(c<1||c>d.getLineCount()){l.dispose();return}let u=this.getPreviewValue(d,c,a),g=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,u?new Qe().appendCodeblock(g||"",u):void 0),l.dispose()})}}getPreviewValue(e,t,i){let o=i.range;return o.endLineNumber-o.startLineNumber>=sd.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,o)}stripIndentationFromPreviewRange(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){let l=e.getLineFirstNonWhitespaceColumn(a);n=Math.min(n,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${n-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){let i=e.getLineFirstNonWhitespaceColumn(t),o=Math.min(e.getLineCount(),t+sd.MAX_SOURCE_PREVIEW_LINES),n=t+1;for(;n<o;n++){let r=e.getLineFirstNonWhitespaceColumn(n);if(i===r)break}return new b(t,1,n+1,1)}addDecoration(e,t){let i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){var i;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&e.target.type===6&&!(((i=e.target.detail.injectedText)===null||i===void 0?void 0:i.options)instanceof Us)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){let i=this.editor.getModel();return i?Ur(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{let o=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new hn({openToSide:t,openInPeek:o,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){let t=e.get(G);return vt.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Gn.ID="editor.contrib.gotodefinitionatposition";Gn.MAX_SOURCE_PREVIEW_LINES=8;Gn=sd=QN([Mv(1,gt),Mv(2,tt),Mv(3,N)],Gn);W(Gn.ID,Gn,2);de();de();Fx();E();F();var xg=P,aa=class extends I{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new Ws(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}},Ig=class s extends I{static render(e,t,i){return new s(e,t,i)}constructor(e,t,i){super(),this.actionContainer=T(e,xg("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=T(this.actionContainer,xg("a.action")),this.action.setAttribute("role","button"),t.iconClass&&T(this.action,xg(`span.icon.${t.iconClass}`));let o=T(this.action,xg("span"));o.textContent=i?`${t.label} (${i})`:t.label,this._register(ce(this.actionContainer,Pe.CLICK,n=>{n.stopPropagation(),n.preventDefault(),t.run(this.actionContainer)})),this._register(ce(this.actionContainer,Pe.KEY_DOWN,n=>{let r=new bh(n);(r.equals(3)||r.equals(10))&&(n.stopPropagation(),n.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}};function dD(s,e){return s&&e?h("acessibleViewHint","Inspect this in the accessible view with {0}.",e):s?h("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}Fe();E();ke();q();mt();Ht();fe();me();Ie();E();var Nv=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}},la=class extends I{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new K),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new De(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new De(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new De(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=zx(e=>this._computer.computeAsync(e)),(async()=>{try{for await(let e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){ee(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;let e=this._state===0,t=this._state===4;this._onResult.fire(new Nv(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}};var da=class{constructor(e,t,i,o){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=o,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}},$n=class{constructor(e,t,i,o,n,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=o,this.initialMousePosY=n,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}},Li=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};ge();fe();we();re();de();Ie();E();var Yn=class{constructor(){this._onDidWillResize=new K,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new K,this.onDidResize=this._onDidResize.event,this._sashListener=new L,this._size=new be(0,0),this._minSize=new be(0,0),this._maxSize=new be(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new on(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new on(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new on(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:qf.North}),this._southSash=new on(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:qf.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(Me.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(Me.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(o=>{e&&(i=o.currentX-o.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(o=>{e&&(i=-(o.currentX-o.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(o=>{e&&(t=-(o.currentY-o.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(o=>{e&&(t=o.currentY-o.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Me.any(this._eastSash.onDidReset,this._westSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Me.any(this._northSash.onDidReset,this._southSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,o){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=o?3:0}layout(e=this.size.height,t=this.size.width){let{height:i,width:o}=this._minSize,{height:n,width:r}=this._maxSize;e=Math.max(i,Math.min(n,e)),t=Math.max(o,Math.min(r,t));let a=new be(t,e);be.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}};E();ke();de();var XN=30,JN=24,Lg=class extends I{constructor(e,t=new be(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new Yn),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=be.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new be(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?R.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){let t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:et(t).top+i.top-XN}_availableVerticalSpaceBelow(e){let t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;let o=et(t),n=Rn(t.ownerDocument.body),r=o.top+i.top+i.height;return n.height-r-JN}_findPositionPreference(e,t){var i,o;let n=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((o=this._availableVerticalSpaceAbove(t))!==null&&o!==void 0?o:1/0,e),a=Math.min(Math.max(r,n),e),l=Math.min(e,a),d;return this._editor.getOption(60).above?d=l<=r?1:2:d=l<=n?2:1,d===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),d}_resize(e){this._resizableNode.layout(e.height,e.width)}};at();var Ov=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Kr=function(s,e){return function(t,i){e(t,i,s)}},Dg,Io,cD=P,ad=Dg=class extends I{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(un,this._editor)),this._participants=[];for(let o of Li.getAll())this._participants.push(this._instantiationService.createInstance(o,this._editor));this._participants.sort((o,n)=>o.hoverOrdinal-n.hoverOrdinal),this._computer=new Pv(this._editor,this._participants),this._hoverOperation=this._register(new la(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{if(!this._computer.anchor)return;let n=o.hasLoadingMessage?this._addLoadingMessage(o.value):o.value;this._withResult(new kg(this._computer.anchor,n,o.isComplete))})),this._register(wi(this._widget.getDomNode(),"keydown",o=>{o.equals(9)&&this.hide()})),this._register(Is.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;let t=[];for(let o of this._participants)if(o.suggestHoverAnchor){let n=o.suggestHoverAnchor(e);n&&t.push(n)}let i=e.target;if(i.type===6&&t.push(new da(0,i.range,e.event.posx,e.event.posy)),i.type===7){let o=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToText<o&&t.push(new da(0,i.range,e.event.posx,e.event.posy))}return t.length===0?this._startShowingOrUpdateHover(null,0,0,!1,e):(t.sort((o,n)=>n.priority-o.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,o){this._startShowingOrUpdateHover(new da(0,e,void 0,void 0),t,i,o,null)}_startShowingOrUpdateHover(e,t,i,o,n){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,o,!1),!0):!1:this._editor.getOption(60).sticky&&n&&this._widget.isMouseGettingCloser(n.event.posx,n.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,o,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,o,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,o,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,o,n){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=o,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=n,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(let t of this._participants)if(t.createLoadingMessage){let i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){let{showAtPosition:i,showAtSecondaryPosition:o,highlightRange:n}=Dg.computeHoverRanges(this._editor,e.range,t),r=new L,a=r.add(new ld(this._keybindingService)),l=document.createDocumentFragment(),d=null,c={fragment:l,statusBar:a,setColorPicker:g=>d=g,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:g=>this._widget.setMinimumDimensions(g),hide:()=>this.hide()};for(let g of this._participants){let p=t.filter(m=>m.owner===g);p.length>0&&r.add(g.renderHoverParts(c,p))}let u=t.some(g=>g.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(n){let g=this._editor.createDecorationsCollection();g.set([{range:n,options:Dg._DECORATION_OPTIONS}]),r.add(xe(()=>{g.clear()}))}this._widget.showAt(l,new Tv(d,i,o,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let o=1;if(e.hasModel()){let d=e._getViewModel(),c=d.coordinatesConverter,u=c.convertModelRangeToViewRange(t),g=new R(u.startLineNumber,d.getLineMinColumn(u.startLineNumber));o=c.convertViewPositionToModelPosition(g).column}let n=t.startLineNumber,r=t.startColumn,a=i[0].range,l=null;for(let d of i)a=b.plusRange(a,d.range),d.range.startLineNumber===n&&d.range.endLineNumber===n&&(r=Math.max(Math.min(r,d.range.startColumn),o)),d.forceShowAtRange&&(l=d.range);return{showAtPosition:l?l.getStartPosition():new R(n,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new R(n,r),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};ad._DECORATION_OPTIONS=te.register({description:"content-hover-highlight",className:"hoverHighlight"});ad=Dg=Ov([Kr(1,B),Kr(2,Ce)],ad);var kg=class{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){let t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new Rv(this,this.anchor,t,this.isComplete)}},Rv=class extends kg{constructor(e,t,i,o){super(t,i,o),this.original=e}filter(e){return this.original.filter(e)}},Tv=class{constructor(e,t,i,o,n,r,a,l,d,c){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=o,this.stoleFocus=n,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=d,this.disposables=c,this.closestMouseDistance=void 0}},hD=30,Ev=10,eE=6,un=Io=class extends Lg{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,o,n){let r=e.getOption(66)+8,a=150,l=new be(a,r);super(e,l),this._configurationService=i,this._accessibilityService=o,this._keybindingService=n,this._hover=this._register(new aa),this._minimumSize=l,this._hoverVisibleKey=_.hoverVisible.bindTo(t),this._hoverFocusedKey=_.hoverFocused.bindTo(t),T(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(50)&&this._updateFont()}));let d=this._register(Ui(this._resizableNode.domNode));this._register(d.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(d.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Io.ID}static _applyDimensions(e,t,i){let o=typeof t=="number"?`${t}px`:t,n=typeof i=="number"?`${i}px`:i;e.style.width=o,e.style.height=n}_setContentsDomNodeDimensions(e,t){let i=this._hover.contentsDomNode;return Io._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){let i=this._hover.containerDomNode;return Io._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){let o=typeof t=="number"?`${t}px`:t,n=typeof i=="number"?`${i}px`:i;e.style.maxWidth=o,e.style.maxHeight=n}_setHoverWidgetMaxDimensions(e,t){Io._applyMaxDimensions(this._hover.contentsDomNode,e,t),Io._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){let e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){let e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");let t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-Ev))}_updateResizableNodeMaxDimensions(){var e,t;let i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new be(i,o),this._setHoverWidgetMaxDimensions(i,o)}_resize(e){var t,i;Io._lastDimensions=new be(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;let t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){let e=this._findAvailableSpaceVertically();if(!e)return;let t=eE;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=Ev),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");let e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;let e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth<t?Rn(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;let i=et(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=uD(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));let o=uD(e,t,i.left,i.top,i.width,i.height);return o>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,o),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){let{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(n=>this._editor.applyFontInfo(n))}_updateContent(e){let t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){let e=Math.max(this._editor.getLayoutInfo().height/4,250,Io._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Io._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,o,n,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);let a=cl(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(o=t.colorPicker)===null||o===void 0||o.layout();let c=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&dD(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(n=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||n===void 0?void 0:n.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;let e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new be(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){let e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;let i=this._hover.containerDomNode,o=this._hover.contentsDomNode,n=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(oi(i),Math.min(n,e)),this._setContentsDomNodeDimensions(oi(o),Math.min(n,e-Ev))}setMinimumDimensions(e){this._minimumSize=new be(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){let e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new be(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();let t=this._hover.containerDomNode,i=cl(t),o=oi(t);if(this._resizableNode.layout(i,o),this._setHoverWidgetDimensions(o,i),i=cl(t),o=oi(t),this._contentWidth=o,this._updateMinimumWidth(),this._resizableNode.layout(i,o),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){let n=cl(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(n,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-hD})}scrollRight(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+hD})}pageUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};un.ID="editor.contrib.resizableContentHoverWidget";un._lastDimensions=new be(0,0);un=Io=Ov([Kr(1,G),Kr(2,se),Kr(3,As),Kr(4,Ce)],un);var ld=class extends I{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=cD("div.hover-row.status-bar"),this.actionsElement=T(this.hoverElement,cD("div.actions"))}addAction(e){let t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(Ig.render(this.actionsElement,e,i))}append(e){let t=T(this.actionsElement,e);return this._hasContent=!0,t}};ld=Ov([Kr(0,Ce)],ld);var Pv=class s{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];let i=e.getModel(),o=t.range.startLineNumber;if(o>i.getLineCount())return[];let n=i.getLineMaxColumn(o);return e.getLineDecorations(o).filter(r=>{if(r.options.isWholeLine)return!0;let a=r.range.startLineNumber===o?r.range.startColumn:1,l=r.range.endLineNumber===o?r.range.endColumn:n;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){let t=this._anchor;if(!this._editor.hasModel()||!t)return Zt.EMPTY;let i=s._getLineDecorations(this._editor,t);return Zt.merge(this._participants.map(o=>o.computeAsync?o.computeAsync(t,i,e):Zt.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];let e=s._getLineDecorations(this._editor,this._anchor),t=[];for(let i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return zt(t)}};function uD(s,e,t,i,o,n){let r=t+o/2,a=i+n/2,l=Math.max(Math.abs(s-r)-o/2,0),d=Math.max(Math.abs(e-a)-n/2,0);return Math.sqrt(l*l+d*d)}de();Fe();E();var gD=P,qr=class s extends I{constructor(e,t,i){super(),this._renderDisposeables=this._register(new L),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new aa),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new di({editor:this._editor},t,i)),this._computer=new Av(this._editor),this._hoverOperation=this._register(new la(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{this._withResult(o.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return s.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();let i=document.createDocumentFragment();for(let o of t){let n=gD("div.hover-row.markdown-hover"),r=T(n,gD("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(o.value));r.appendChild(a.element),i.appendChild(n)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));let t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),n=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-o-(r-n)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}};qr.ID="editor.contrib.modesGlyphHoverWidget";var Av=class{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){let e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(let o of t){if(!o.options.glyphMarginClassName)continue;let n=o.options.glyphMarginHoverMessage;!n||zn(n)||i.push(...oh(n).map(e))}return i}};ge();Lt();Dt();de();Fe();fe();E();ke();q();Ti();fe();Te();me();Z();var Fv=class{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}};async function tE(s,e,t,i,o){try{let n=await Promise.resolve(s.provideHover(t,i,o));if(n&&oE(n))return new Fv(s,n,e)}catch(n){pe(n)}}function dd(s,e,t,i){let n=s.ordered(e).map((r,a)=>tE(r,a,e,t,i));return Zt.fromPromises(n).coalesce()}function iE(s,e,t,i){return dd(s,e,t,i).map(o=>o.hover).toPromise()}ri("_executeHoverProvider",(s,e,t)=>{let i=s.get(N);return iE(i.hoverProvider,e,t,Y.None)});function oE(s){let e=typeof s.range<"u",t=typeof s.contents<"u"&&s.contents&&s.contents.length>0;return e&&t}F();at();var nE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Mg=function(s,e){return function(t,i){e(t,i,s)}},pD=P,ci=class{constructor(e,t,i,o,n){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=o,this.ordinal=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}},ca=class{constructor(e,t,i,o,n){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=o,this._languageFeaturesService=n,this.hoverOrdinal=3}createLoadingMessage(e){return new ci(this,e.range,[new Qe().appendText(h("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];let i=this._editor.getModel(),o=e.range.startLineNumber,n=i.getLineMaxColumn(o),r=[],a=1e3,l=i.getLineLength(o),d=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(116),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d}),g=!1;c>=0&&l>c&&e.range.startColumn>=c&&(g=!0,r.push(new ci(this,e.range,[{value:h("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!g&&typeof u=="number"&&l>=u&&r.push(new ci(this,e.range,[{value:h("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let p=!1;for(let m of t){let f=m.range.startLineNumber===o?m.range.startColumn:1,C=m.range.endLineNumber===o?m.range.endColumn:n,v=m.options.hoverMessage;if(!v||zn(v))continue;m.options.beforeContentClassName&&(p=!0);let S=new b(e.range.startLineNumber,f,e.range.startLineNumber,C);r.push(new ci(this,S,oh(v),p,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Zt.EMPTY;let o=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(o))return Zt.EMPTY;let n=new R(e.range.startLineNumber,e.range.startColumn);return dd(this._languageFeaturesService.hoverProvider,o,n,i).filter(r=>!zn(r.hover.contents)).map(r=>{let a=r.hover.range?b.lift(r.hover.range):e.range;return new ci(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return Wv(e,t,this._editor,this._languageService,this._openerService)}};ca=nE([Mg(1,tt),Mg(2,it),Mg(3,se),Mg(4,N)],ca);function Wv(s,e,t,i,o){e.sort((r,a)=>r.ordinal-a.ordinal);let n=new L;for(let r of e)for(let a of r.contents){if(zn(a))continue;let l=pD("div.hover-row.markdown-hover"),d=T(l,pD("div.hover-contents")),c=n.add(new di({editor:t},i,o));n.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",s.onContentsChanged()}));let u=n.add(c.render(a));d.appendChild(u.element),s.fragment.appendChild(l)}return n}de();Fe();fe();me();E();yi();q();Nt();E();Z();Rt();ke();q();we();Fe();Ie();E();lx();Be();pt();q();Uo();ge();at();var mD=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Ng=function(s,e){return function(t,i){e(t,i,s)}},Eg=class{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}},zv=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new K,this.onDidChange=this._onDidChange.event,this._dispoables=new L,this._markers=[],this._nextIdx=-1,ne.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);let o=this._configService.getValue("problems.sortOrder"),n=(a,l)=>{let d=cf(a.resource.toString(),l.resource.toString());return d===0&&(o==="position"?d=b.compareRangesUsingStarts(a,l)||ft.compare(a.severity,l.severity):d=ft.compare(a.severity,l.severity)||b.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:ne.isUri(e)?e:void 0,severities:ft.Error|ft.Warning|ft.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(n)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){let e=this._markers[this._nextIdx];return e&&new Eg(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let o=!1,n=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());n<0&&(n=br(this._markers,{resource:e.uri},(r,a)=>cf(r.resource.toString(),a.resource.toString())),n<0&&(n=~n));for(let r=n;r<this._markers.length;r++){let a=b.lift(this._markers[r]);if(a.isEmpty()){let l=e.getWordAtPosition(a.getStartPosition());l&&(a=new b(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=r,o=!0;break}if(this._markers[r].resource.toString()!==e.uri.toString())break}o||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;let o=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),o!==this._nextIdx}find(e,t){let i=this._markers.findIndex(o=>o.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(b.containsPosition(this._markers[i],t))return new Eg(this._markers[i],i+1,this._markers.length)}}};zv=mD([Ng(1,Tl),Ng(2,se)],zv);var Bv=Et("IMarkerNavigationService"),Hv=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new lh}getMarkerList(e){for(let t of this._provider){let i=t.getMarkerList(e);if(i)return i}return new zv(e,this._markerService,this._configService)}};Hv=mD([Ng(0,Tl),Ng(1,se)],Hv);Pt(Bv,Hv,1);F();Je();re();ge();de();Fe();ho();Ie();E();yi();Be();q();F();Je();re();ge();Nt();ti();var Rg;(function(s){function e(t){switch(t){case Ml.Ignore:return"severity-ignore "+le.asClassName($.info);case Ml.Info:return le.asClassName($.info);case Ml.Warning:return le.asClassName($.warning);case Ml.Error:return le.asClassName($.error);default:return""}}s.className=e})(Rg||(Rg={}));Lt();Dt();var rE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},ha=function(s,e){return function(t,i){e(t,i,s)}},Vv,Uv=class{constructor(e,t,i,o,n){this._openerService=o,this._labelService=n,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new L,this._editor=t;let r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(wi(this._relatedBlock,"click",a=>{a.preventDefault();let l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new jI(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){$e(this._disposables)}update(e){let{source:t,message:i,relatedInformation:o,code:n}=e,r=(t?.length||0)+2;n&&(typeof n=="string"?r+=n.length:r+=n.value.length);let a=Cr(i);this._lines=a.length,this._longestLineLength=0;for(let g of a)this._longestLineLength=Math.max(g.length+r,this._longestLineLength);ii(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(let g of a)l=document.createElement("div"),l.innerText=g,g===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||n){let g=document.createElement("span");if(g.classList.add("details"),l.appendChild(g),t){let p=document.createElement("span");p.innerText=t,p.classList.add("source"),g.appendChild(p)}if(n)if(typeof n=="string"){let p=document.createElement("span");p.innerText=`(${n})`,p.classList.add("code"),g.appendChild(p)}else{this._codeLink=P("a.code-link"),this._codeLink.setAttribute("href",`${n.target.toString()}`),this._codeLink.onclick=m=>{this._openerService.open(n.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()};let p=T(this._codeLink,P("span"));p.innerText=n.value,g.appendChild(this._codeLink)}}if(ii(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Ge(o)){let g=this._relatedBlock.appendChild(document.createElement("div"));g.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(let p of o){let m=document.createElement("div"),f=document.createElement("a");f.classList.add("filename"),f.innerText=`${this._labelService.getUriBasenameLabel(p.resource)}(${p.startLineNumber}, ${p.startColumn}): `,f.title=this._labelService.getUriLabel(p.resource),this._relatedDiagnostics.set(f,p);let C=document.createElement("span");C.innerText=p.message,m.appendChild(f),m.appendChild(C),this._lines+=1,g.appendChild(m)}}let d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:u})}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 ft.Error:t=h("Error","Error");break;case ft.Warning:t=h("Warning","Warning");break;case ft.Info:t=h("Info","Info");break;case ft.Hint:t=h("Hint","Hint");break}let i=h("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn),o=this._editor.getModel();return o&&e.startLineNumber<=o.getLineCount()&&e.startLineNumber>=1&&(i=`${o.getLineContent(e.startLineNumber)}, ${i}`),i}},Gr=Vv=class extends oa{constructor(e,t,i,o,n,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},n),this._themeService=t,this._openerService=i,this._menuService=o,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new L,this._onDidSelectRelatedInformation=new K,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ft.Warning,this._backgroundColor=ie.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(dE);let t=jv,i=sE;this._severity===ft.Warning?(t=Tg,i=aE):this._severity===ft.Info&&(t=Kv,i=lE);let o=e.getColor(t),n=e.getColor(i);this.style({arrowColor:o,frameColor:o,headerBackgroundColor:n,primaryHeadingColor:e.getColor(ig),secondaryHeadingColor:e.getColor(og)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(o=>this.editor.focus()));let t=[],i=this._menuService.createMenu(Vv.TitleMenu,this._contextKeyService);nu(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=T(e,P(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new Uv(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());let o=b.lift(e),n=this.editor.getPosition(),r=n&&o.containsPosition(n)?n:o.getStartPosition();super.show(r,this.computeRequiredHeight());let a=this.editor.getModel();if(a){let l=i>1?h("problems","{0} of {1} problems",t,i):h("change","{0} of {1} problem",t,i);this.setTitle(Xt(a.uri),l)}this._icon.className=`codicon ${Rg.className(ft.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Gr.TitleMenu=new O("gotoErrorTitleMenu");Gr=Vv=rE([ha(1,dt),ha(2,it),ha(3,Ho),ha(4,B),ha(5,G),ha(6,Zo)],Gr);var fD=Wh(SI,wI),_D=Wh(yI,xI),vD=Wh(vl,II),jv=z("editorMarkerNavigationError.background",{dark:fD,light:fD,hcDark:Oi,hcLight:Oi},h("editorMarkerNavigationError","Editor marker navigation widget error color.")),sE=z("editorMarkerNavigationError.headerBackground",{dark:Qt(jv,.1),light:Qt(jv,.1),hcDark:null,hcLight:null},h("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),Tg=z("editorMarkerNavigationWarning.background",{dark:_D,light:_D,hcDark:Oi,hcLight:Oi},h("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),aE=z("editorMarkerNavigationWarning.headerBackground",{dark:Qt(Tg,.1),light:Qt(Tg,.1),hcDark:"#0C141F",hcLight:Qt(Tg,.2)},h("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),Kv=z("editorMarkerNavigationInfo.background",{dark:vD,light:vD,hcDark:Oi,hcLight:Oi},h("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),lE=z("editorMarkerNavigationInfo.headerBackground",{dark:Qt(Kv,.1),light:Qt(Kv,.1),hcDark:null,hcLight:null},h("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),dE=z("editorMarkerNavigation.background",{dark:bl,light:bl,hcDark:bl,hcLight:bl},h("editorMarkerNavigationBackground","Editor marker navigation widget background."));var cE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Pg=function(s,e){return function(t,i){e(t,i,s)}},cd,gn=cd=class{static get(e){return e.getContribution(cd.ID)}constructor(e,t,i,o,n){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=o,this._instantiationService=n,this._sessionDispoables=new L,this._editor=e,this._widgetVisible=bD.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(Gr,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var o,n,r;(!(!((o=this._model)===null||o===void 0)&&o.selected)||!b.containsPosition((n=this._model)===null||n===void 0?void 0:n.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;let i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:b.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){let t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new R(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,o;if(this._editor.hasModel()){let n=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(n.move(e,this._editor.getModel(),this._editor.getPosition()),!n.selected)return;if(n.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();let r=await this._editorService.openCodeEditor({resource:n.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:n.selected.marker}},this._editor);r&&((i=cd.get(r))===null||i===void 0||i.close(),(o=cd.get(r))===null||o===void 0||o.nagivate(e,t))}else this._widget.showAtMarker(n.selected.marker,n.selected.index,n.selected.total)}}};gn.ID="editor.contrib.markerController";gn=cd=cE([Pg(1,Bv),Pg(2,G),Pg(3,_e),Pg(4,B)],gn);var ua=class extends k{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=gn.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))}},$r=class s extends ua{constructor(){super(!0,!1,{id:s.ID,label:s.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:578,weight:100},menuOpts:{menuId:Gr.TitleMenu,title:s.LABEL,icon:Ve("marker-navigation-next",$.arrowDown,h("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}};$r.ID="editor.action.marker.next";$r.LABEL=h("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");var hd=class s extends ua{constructor(){super(!1,!1,{id:s.ID,label:s.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:1602,weight:100},menuOpts:{menuId:Gr.TitleMenu,title:s.LABEL,icon:Ve("marker-navigation-previous",$.arrowUp,h("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}};hd.ID="editor.action.marker.prev";hd.LABEL=h("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");var qv=class extends ua{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:h("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:66,weight:100},menuOpts:{menuId:O.MenubarGoMenu,title:h({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}},Gv=class extends ua{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:h("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:1090,weight:100},menuOpts:{menuId:O.MenubarGoMenu,title:h({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}};W(gn.ID,gn,4);w($r);w(hd);w(qv);w(Gv);var bD=new X("markersNavigationVisible",!1),hE=je.bindToContribution(gn.get);H(new hE({id:"closeMarkersNavigation",precondition:bD,handler:s=>s.close(),kbOpts:{weight:150,kbExpr:_.focus,primary:9,secondary:[1033]}}));F();var uE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},$v=function(s,e){return function(t,i){e(t,i,s)}},Wi=P,Yv=class{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}},CD={type:1,filter:{include:U.QuickFix},triggerAction:_t.QuickFixHover},Og=class{constructor(e,t,i,o){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=o,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];let i=this._editor.getModel(),o=e.range.startLineNumber,n=i.getLineMaxColumn(o),r=[];for(let a of t){let l=a.range.startLineNumber===o?a.range.startColumn:1,d=a.range.endLineNumber===o?a.range.endColumn:n,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;let u=new b(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new Yv(this,u,c))}return r}renderHoverParts(e,t){if(!t.length)return I.None;let i=new L;t.forEach(n=>e.fragment.appendChild(this.renderMarkerHover(n,i)));let o=t.length===1?t[0]:t.sort((n,r)=>ft.compare(n.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,o,i),i}renderMarkerHover(e,t){let i=Wi("div.hover-row"),o=T(i,Wi("div.marker.hover-contents")),{source:n,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(o);let d=T(o,Wi("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,n||a)if(a&&typeof a!="string"){let c=Wi("span");if(n){let m=T(c,Wi("span"));m.innerText=n}let u=T(c,Wi("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(ce(u,"click",m=>{this._openerService.open(a.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()}));let g=T(u,Wi("span"));g.innerText=a.value;let p=T(o,c);p.style.opacity="0.6",p.style.paddingLeft="6px"}else{let c=T(o,Wi("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=n&&a?`${n}(${a})`:n||`(${a})`}if(Ge(l))for(let{message:c,resource:u,startLineNumber:g,startColumn:p}of l){let m=T(o,Wi("div"));m.style.marginTop="8px";let f=T(m,Wi("a"));f.innerText=`${Xt(u)}(${g}, ${p}): `,f.style.cursor="pointer",t.add(ce(f,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:g,startColumn:p}}}).catch(ee)}));let C=T(m,Wi("span"));C.innerText=c,this._editor.applyFontInfo(C)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===ft.Error||t.marker.severity===ft.Warning||t.marker.severity===ft.Info)&&e.statusBar.addAction({label:h("view problem","View Problem"),commandId:$r.ID,run:()=>{var o;e.hide(),(o=gn.get(this._editor))===null||o===void 0||o.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){let o=e.statusBar.append(Wi("div"));this.recentMarkerCodeActionsInfo&&(Kf.makeKey(this.recentMarkerCodeActionsInfo.marker)===Kf.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(o.textContent=h("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);let n=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?I.None:i.add(Bo(()=>o.textContent=h("checkingForQuickFixes","Checking for quick fixes..."),200));o.textContent||(o.textContent="\xA0");let r=this.getCodeActions(t.marker);i.add(xe(()=>r.cancel())),r.then(a=>{if(n.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),o.textContent=h("noQuickFixes","No quick fixes available");return}o.style.display="none";let l=!1;i.add(xe(()=>{l||a.dispose()})),e.statusBar.addAction({label:h("quick fixes","Quick Fix..."),commandId:Zs,run:d=>{l=!0;let c=Gi.get(this._editor),u=et(d);e.hide(),c?.showCodeActions(CD,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},ee)}}getCodeActions(e){return Se(t=>Or(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new b(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),CD,Ai.None,t))}};Og=uE([$v(1,gI),$v(2,it),$v(3,N)],Og);de();Ns();Fe();fe();Nt();E();$t();ti();ke();Ht();var Ag="editor.action.inlineSuggest.commit",Fg="editor.action.inlineSuggest.showPrevious",Wg="editor.action.inlineSuggest.showNext";F();Je();Ue();re();ge();yr();var Jv=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},$i=function(s,e){return function(t,i){e(t,i,s)}},zg,Hg=class extends I{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=qi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=li(this,o=>{var n,r,a;let l=(n=this.model.read(o))===null||n===void 0?void 0:n.ghostText.read(o);if(!this.alwaysShowToolbar.read(o)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;let d=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);let c=new R(l.lineNumber,Math.min(d,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(aL((o,n)=>{let r=this.model.read(o);if(!r||!this.alwaysShowToolbar.read(o))return;let a=n.add(this.instantiationService.createInstance(Yi,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var d;return(d=l?.inlineCompletion.source.inlineCompletions.commands)!==null&&d!==void 0?d:[]})));e.addContentWidget(a),n.add(xe(()=>e.removeContentWidget(a))),n.add(Vt(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==no.Explicit&&r.triggerExplicitly()}))}))}};Hg=Jv([$i(2,B)],Hg);var gE=Ve("inline-suggestion-hints-next",$.chevronRight,h("parameterHintsNextIcon","Icon for show next parameter hint.")),pE=Ve("inline-suggestion-hints-previous",$.chevronLeft,h("parameterHintsPreviousIcon","Icon for show previous parameter hint.")),Yi=zg=class extends I{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){let o=new so(e,t,i,!0,()=>this._commandService.executeCommand(e)),n=this.keybindingService.lookupKeybinding(e,this._contextKeyService),r=t;return n&&(r=h({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,n.getLabel())),o.tooltip=r,o}constructor(e,t,i,o,n,r,a,l,d,c,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=o,this._suggestionCount=n,this._extraCommands=r,this._commandService=a,this.keybindingService=d,this._contextKeyService=c,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${zg.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=xh("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[xh("div@toolBar")]),this.previousAction=this.createCommandAction(Fg,h("previous","Previous"),le.asClassName(pE)),this.availableSuggestionCountAction=new so("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(Wg,h("next","Next"),le.asClassName(gE)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(O.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new De(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new De(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(Xv,this.nodes.toolBar,O.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:g=>g.startsWith("primary")},actionViewItemProvider:(g,p)=>{if(g instanceof wr)return l.createInstance(Qv,g,void 0);if(g===this.availableSuggestionCountAction){let m=new Zv(void 0,g,{label:!0,icon:!1});return m.setClass("availableSuggestionCount"),m}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(g=>{zg._dropDownVisible=g})),this._register(Vt(g=>{this._position.read(g),this.editor.layoutContentWidget(this)})),this._register(Vt(g=>{let p=this._suggestionCount.read(g),m=this._currentSuggestionIdx.read(g);p!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${m+1}/${p}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),p!==void 0&&p>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Vt(g=>{let p=this._extraCommands.read(g);if(ui(this.lastCommands,p))return;this.lastCommands=p;let m=p.map(f=>({class:void 0,id:f.id,enabled:!0,tooltip:f.tooltip||"",label:f.title,run:C=>this._commandService.executeCommand(f.id)}));for(let[f,C]of this.inlineCompletionsActionsMenus.getActions())for(let v of C)v instanceof wr&&m.push(v);m.length>0&&m.unshift(new Sr),this.toolBar.setAdditionalSecondaryActions(m)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Yi._dropDownVisible=!1;Yi.id=0;Yi=zg=Jv([$i(6,Ne),$i(7,B),$i(8,Ce),$i(9,G),$i(10,Ho)],Yi);var Zv=class extends Rl{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}},Qv=class extends ru{updateLabel(){let e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){let t=xh("div.keybinding").root;new cu(t,ah,{disableTitle:!0,...Z0}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},Xv=class extends cL{constructor(e,t,i,o,n,r,a,l){super(e,{resetMenu:t,...i},o,n,r,a,l),this.menuId=t,this.options2=i,this.menuService=o,this.contextKeyService=n,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,o,n,r,a;let l=[],d=[];nu(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:d},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(n=(o=this.options2)===null||o===void 0?void 0:o.toolbarOptions)===null||n===void 0?void 0:n.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),d.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,d)}setPrependedPrimaryActions(e){ui(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){ui(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};Xv=Jv([$i(3,Ho),$i(4,G),$i(5,fo),$i(6,Ce),$i(7,pi)],Xv);F();fe();var mE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Bg=function(s,e){return function(t,i){e(t,i,s)}},eb,Vg=!1,Ut=eb=class extends I{static get(e){return e.getContribution(eb.ID)}constructor(e,t,i,o,n){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=o,this._keybindingService=n,this._toUnhook=new L,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new De(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())}))}_hookEvents(){let e=this._editor.getOption(60);this._isHoverEnabled=e.enabled,this._isHoverSticky=e.sticky,this._hidingDelay=e.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._toUnhook.add(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._toUnhook.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._toUnhook.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._toUnhook.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._toUnhook.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;let i=e.target;if(i.type===9&&i.detail===un.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===qr.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;this._cancelScheduler();let o=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(o)||Vg||this._hideWidgets()}_isMouseOverWidget(e){var t,i,o,n,r;let a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===un.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((n=(o=e.event.browserEvent.view)===null||o===void 0?void 0:o.getSelection())===null||n===void 0)&&n.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===un.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===qr.ID)}_onEditorMouseMove(e){var t,i,o,n;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((o=this._contentWidget)===null||o===void 0)&&o.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((n=this._contentWidget)===null||n===void 0)&&n.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,o;if(!e)return;let n=e.target,r=(t=n.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!Vg||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(n.type===2&&n.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._glyphWidget||(this._glyphWidget=new qr(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(n.position.lineNumber);return}Vg||this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;let i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),o=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!o&&this._hideWidgets()}_hideWidgets(){var e,t,i;Vg||this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||Yi.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(ad,this._editor)),this._contentWidget}showContentHover(e,t,i,o,n=!1){this._hoverActivatedByColorDecoratorClick=n,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,o)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};Ut.ID="editor.contrib.hover";Ut=eb=mE([Bg(1,B),Bg(2,it),Bg(3,tt),Bg(4,Ce)],Ut);var Zi;(function(s){s.NoAutoFocus="noAutoFocus",s.FocusIfVisible="focusIfVisible",s.AutoFocusImmediately="autoFocusImmediately"})(Zi||(Zi={}));var tb=class extends k{constructor(){super({id:"editor.action.showHover",label:h({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse."]},"Show or Focus Hover"),metadata:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[Zi.NoAutoFocus,Zi.FocusIfVisible,Zi.AutoFocusImmediately],enumDescriptions:[h("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),h("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),h("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Zi.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:_.editorTextFocus,primary:Ee(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;let o=Ut.get(t);if(!o)return;let n=i?.focus,r=Zi.FocusIfVisible;n in Zi?r=n:typeof n=="boolean"&&n&&(r=Zi.AutoFocusImmediately);let a=d=>{let c=t.getPosition(),u=new b(c.lineNumber,c.column,c.lineNumber,c.column);o.showContentHover(u,1,1,d)},l=t.getOption(2)===2;o.isHoverVisible?r!==Zi.NoAutoFocus?o.focus():a(l):a(l||r===Zi.AutoFocusImmediately)}},ib=class extends k{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:h({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){let i=Ut.get(t);if(!i)return;let o=t.getPosition();if(!o)return;let n=new b(o.lineNumber,o.column,o.lineNumber,o.column),r=Gn.get(t);if(!r)return;r.startFindDefinitionFromCursor(o).then(()=>{i.showContentHover(n,1,1,!0)})}},ob=class extends k{constructor(){super({id:"editor.action.scrollUpHover",label:h({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:16,weight:100}})}run(e,t){let i=Ut.get(t);i&&i.scrollUp()}},nb=class extends k{constructor(){super({id:"editor.action.scrollDownHover",label:h({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:18,weight:100}})}run(e,t){let i=Ut.get(t);i&&i.scrollDown()}},rb=class extends k{constructor(){super({id:"editor.action.scrollLeftHover",label:h({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:15,weight:100}})}run(e,t){let i=Ut.get(t);i&&i.scrollLeft()}},sb=class extends k{constructor(){super({id:"editor.action.scrollRightHover",label:h({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:17,weight:100}})}run(e,t){let i=Ut.get(t);i&&i.scrollRight()}},ab=class extends k{constructor(){super({id:"editor.action.pageUpHover",label:h({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){let i=Ut.get(t);i&&i.pageUp()}},lb=class extends k{constructor(){super({id:"editor.action.pageDownHover",label:h({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){let i=Ut.get(t);i&&i.pageDown()}},db=class extends k{constructor(){super({id:"editor.action.goToTopHover",label:h({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){let i=Ut.get(t);i&&i.goToTop()}},cb=class extends k{constructor(){super({id:"editor.action.goToBottomHover",label:h({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){let i=Ut.get(t);i&&i.goToBottom()}};W(Ut.ID,Ut,2);w(tb);w(ib);w(ob);w(nb);w(rb);w(sb);w(ab);w(lb);w(db);w(cb);Li.register(ca);Li.register(Og);On((s,e)=>{let t=s.getColor(TI);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});var ud=class extends I{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){let t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;let i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==ov||!i.range)return;let o=this._editor.getContribution(Ut.ID);if(o&&!o.isColorPickerVisible){let n=new b(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);o.showContentHover(n,1,0,!1,!0)}}};ud.ID="editor.contrib.colorContribution";W(ud.ID,ud,2);Li.register(Yl);Z();F();E();ge();Ie();Z();we();re();Ri();It();de();var wD=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Qi=function(s,e){return function(t,i){e(t,i,s)}},hb,ub,pn=hb=class extends I{constructor(e,t,i,o,n,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=o,this._instantiationService=n,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=_.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=_.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new Ug(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(hb.ID)}};pn.ID="editor.contrib.standaloneColorPickerController";pn=hb=wD([Qi(1,G),Qi(2,ze),Qi(3,Ce),Qi(4,B),Qi(5,N),Qi(6,he)],pn);W(pn.ID,pn,1);var SD=8,fE=22,Ug=ub=class extends I{constructor(e,t,i,o,n,r,a,l){var d;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=n,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new K),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=o.createInstance(ta,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;let c=this._editor.getSelection(),u=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},g=this._register(Ui(this._body));this._register(g.onDidBlur(p=>{this.hide()})),this._register(g.onDidFocus(p=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(p=>{var m;let f=(m=p.target.element)===null||m===void 0?void 0:m.classList;f&&f.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(p=>{this._render(p.value,p.foundInEditor)})),this._start(u),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return ub.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;let e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){let t=await this._computeAsync(e);t&&this._onResult.fire(new gb(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;let t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new Hr(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){let i=document.createDocumentFragment(),o=this._register(new ld(this._keybindingService)),n,r={fragment:i,statusBar:o,setColorPicker:f=>n=f,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),n===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),n.layout();let a=n.body,l=a.saturationBox.domNode.clientWidth,d=a.domNode.clientWidth-l-fE-SD,c=n.body.enterButton;c?.onClicked(()=>{this.updateEditor(),this.hide()});let u=n.header,g=u.pickedColorNode;g.style.width=l+SD+"px";let p=u.originalColorNode;p.style.width=d+"px";let m=n.header.closeButton;m?.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};Ug.ID="editor.contrib.standaloneColorPickerWidget";Ug=ub=wD([Qi(3,B),Qi(4,ze),Qi(5,Ce),Qi(6,N),Qi(7,he)],Ug);var gb=class{constructor(e,t){this.value=e,this.foundInEditor=t}};we();Je();var pb=class extends ni{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:h("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:h({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:O.CommandPalette}]})}runEditorCommand(e,t){var i;(i=pn.get(t))===null||i===void 0||i.showOrFocus()}},mb=class extends k{constructor(){super({id:"editor.action.hideColorPicker",label:h({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:_.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=pn.get(t))===null||i===void 0||i.hide()}},fb=class extends k{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:h({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:_.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=pn.get(t))===null||i===void 0||i.insertColor()}};w(mb);w(fb);ve(pb);Fo();Z();q();we();It();ke();q();ut();var mn=class s{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;let o=t.length,n=e.length;if(i+o>n)return!1;for(let r=0;r<o;r++){let a=e.charCodeAt(i+r),l=t.charCodeAt(r);if(a!==l&&!(a>=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,o,n,r){let a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,c=e.endColumn,u=n.getLineContent(a),g=n.getLineContent(d),p=u.lastIndexOf(t,l-1+t.length),m=g.indexOf(i,c-1-i.length);if(p!==-1&&m!==-1)if(a===d)u.substring(p+t.length,m).indexOf(i)>=0&&(p=-1,m=-1);else{let C=u.substring(p+t.length),v=g.substring(0,m);(C.indexOf(i)>=0||v.indexOf(i)>=0)&&(p=-1,m=-1)}let f;p!==-1&&m!==-1?(o&&p+t.length<u.length&&u.charCodeAt(p+t.length)===32&&(t=t+" "),o&&m>0&&g.charCodeAt(m-1)===32&&(i=" "+i,m-=1),f=s._createRemoveBlockCommentOperations(new b(a,p+t.length+1,d,m+1),t,i)):(f=s._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=f.length===1?i:null);for(let C of f)r.addTrackedEditOperation(C.range,C.text)}static _createRemoveBlockCommentOperations(e,t,i){let o=[];return b.isEmpty(e)?o.push(ye.delete(new b(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(o.push(ye.delete(new b(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),o.push(ye.delete(new b(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),o}static _createAddBlockCommentOperations(e,t,i,o){let n=[];return b.isEmpty(e)?n.push(ye.replace(new b(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(n.push(ye.insert(new R(e.startLineNumber,e.startColumn),t+(o?" ":""))),n.push(ye.insert(new R(e.endLineNumber,e.endColumn),(o?" ":"")+i))),n}getEditOperations(e,t){let i=this._selection.startLineNumber,o=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);let n=e.getLanguageIdAtPosition(i,o),r=this.languageConfigurationService.getLanguageConfiguration(n).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){let i=t.getInverseEditOperations();if(i.length===2){let o=i[0],n=i[1];return new V(o.range.endLineNumber,o.range.endColumn,n.range.startLineNumber,n.range.startColumn)}else{let o=i[0].range,n=this._usedEndToken?-this._usedEndToken.length-1:0;return new V(o.endLineNumber,o.endColumn+n,o.endLineNumber,o.endColumn+n)}}};Be();ke();q();ut();var jg=class s{constructor(e,t,i,o,n,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=o,this._insertSpace=n,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,o){e.tokenization.tokenizeIfCheap(t);let n=e.getLanguageIdAtPosition(t,1),r=o.getLanguageConfiguration(n).comments,a=r?r.lineCommentToken:null;if(!a)return null;let l=[];for(let d=0,c=i-t+1;d<c;d++)l[d]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,i,o,n,r,a,l){let d=!0,c;e===0?c=!0:e===1?c=!1:c=!0;for(let u=0,g=o.length;u<g;u++){let p=o[u],m=n+u;if(m===n&&a){p.ignore=!0;continue}let f=i.getLineContent(m),C=ll(f);if(C===-1){p.ignore=r,p.commentStrOffset=f.length;continue}if(d=!1,p.ignore=!1,p.commentStrOffset=C,c&&!mn._haystackHasNeedleAtOffset(f,p.commentStr,C)&&(e===0?c=!1:e===1||(p.ignore=!0)),c&&t){let v=C+p.commentStrLength;v<f.length&&f.charCodeAt(v)===32&&(p.commentStrLength+=1)}}if(e===0&&d){c=!1;for(let u=0,g=o.length;u<g;u++)o[u].ignore=!1}return{supported:!0,shouldRemoveComments:c,lines:o}}static _gatherPreflightData(e,t,i,o,n,r,a,l){let d=s._gatherPreflightCommentStrings(i,o,n,l);return d===null?{supported:!1}:s._analyzeLines(e,t,i,d,o,r,a,l)}_executeLineComments(e,t,i,o){let n;i.shouldRemoveComments?n=s._createRemoveLineCommentsOperations(i.lines,o.startLineNumber):(s._normalizeInsertionPoint(e,i.lines,o.startLineNumber,this._tabSize),n=this._createAddLineCommentsOperations(i.lines,o.startLineNumber));let r=new R(o.positionLineNumber,o.positionColumn);for(let a=0,l=n.length;a<l;a++)t.addEditOperation(n[a].range,n[a].text),b.isEmpty(n[a].range)&&b.getStartPosition(n[a].range).equals(r)&&e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(n[a].text||"").length);this._selectionId=t.trackSelection(o)}_attemptRemoveBlockComment(e,t,i,o){let n=t.startLineNumber,r=t.endLineNumber,a=o.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn),l=e.getLineContent(n).lastIndexOf(i,a-1),d=e.getLineContent(r).indexOf(o,t.endColumn-1-i.length);return l!==-1&&d===-1&&(d=e.getLineContent(n).indexOf(o,l+i.length),r=n),l===-1&&d!==-1&&(l=e.getLineContent(r).lastIndexOf(i,d),n=r),t.isEmpty()&&(l===-1||d===-1)&&(l=e.getLineContent(n).indexOf(i),l!==-1&&(d=e.getLineContent(n).indexOf(o,l+i.length))),l!==-1&&e.getLineContent(n).charCodeAt(l+i.length)===32&&(i+=" "),d!==-1&&e.getLineContent(r).charCodeAt(d-1)===32&&(o=" "+o,d-=1),l!==-1&&d!==-1?mn._createRemoveBlockCommentOperations(new b(n,l+i.length+1,r,d+1),i,o):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);let o=e.getLanguageIdAtPosition(i.startLineNumber,1),n=this.languageConfigurationService.getLanguageConfiguration(o).comments;if(!n||!n.blockCommentStartToken||!n.blockCommentEndToken)return;let r=n.blockCommentStartToken,a=n.blockCommentEndToken,l=this._attemptRemoveBlockComment(e,i,r,a);if(!l){if(i.isEmpty()){let d=e.getLineContent(i.startLineNumber),c=ll(d);c===-1&&(c=d.length),l=mn._createAddBlockCommentOperations(new b(i.startLineNumber,c+1,i.startLineNumber,d.length+1),r,a,this._insertSpace)}else l=mn._createAddBlockCommentOperations(new b(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),r,a,this._insertSpace);l.length===1&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(i);for(let d of l)t.addEditOperation(d.range,d.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new b(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
6
+ import{n as Yy}from"./SO6LKGBJ.js";import{$ as me,$a as Cx,$b as Px,$c as cl,$d as Dr,$e as go,$f as Hh,$g as Pf,$h as Wn,$i as Yf,$j as uL,A as F,Aa as ne,Ab as Ms,Ac as Bo,Ad as w,Ae as cI,Af as Ah,Ag as Ll,Ah as rt,Ai as jf,Aj as At,B as Ln,Ba as pt,Bb as B,Bc as dl,Bd as Cf,Be as hI,Bf as RI,Bg as Kh,Bh as Yh,Bi as O0,Bj as oL,C as Gt,Ca as R,Cb as Et,Cc as ao,Cd as Xx,Ce as IM,Cf as Mf,Cg as An,Ch as Nl,Ci as A0,Cj as Jf,D as rx,Da as ke,Db as ge,Dc as De,Dd as W,De as Os,Df as TI,Dg as Nr,Dh as p0,Di as F0,Dj as vo,E as Dn,Ea as b,Eb as _e,Ec as Ch,Ed as Z,Ee as LM,Ef as PI,Eg as qh,Eh as Fn,Ei as nu,Ej as Ol,F as sh,Fa as q,Fb as Rt,Fc as Zt,Fd as Ts,Fe as uI,Ff as OI,Fg as Gh,Fh as Zh,Fi as ru,Fj as li,G as il,Ga as V,Gb as ze,Gc as zx,Gd as ul,Ge as DM,Gf as AI,Gg as _,Gh as El,Gi as W0,Gj as e_,H as sx,Ha as ut,Hb as Ri,Hc as fe,Hd as SM,He as ml,Hf as FI,Hg as we,Hh as ye,Hi as en,Hj as nL,I as ah,Ia as $,Ib as gt,Ic as yt,Id as Jx,Ie as kh,If as WI,Ig as Hs,Ih as Zo,Ii as it,Ij as Vt,J as ax,Ja as Nt,Jb as ro,Jc as Rs,Jd as wM,Je as Mh,Jf as zI,Jg as Dl,Jh as m0,Ji as tn,Jj as rL,K as $t,Ka as sl,Kb as so,Kc as Sh,Kd as Lh,Ke as nt,Kf as HI,Kg as ZI,Kh as Ai,Ki as su,Kj as sL,L as gi,La as no,Lb as Sr,Lc as Hx,Ld as eI,Le as jo,Lf as mo,Lg as QI,Lh as Qo,Li as ft,Lj as aL,M as ol,Ma as px,Mb as pf,Mc as Vo,Md as se,Me as gI,Mf as Cl,Mg as NM,Mh as f0,Mi as Kf,Mj as gu,N as lh,Na as Vi,Nb as Rx,Nc as ii,Nd as at,Ne as Lf,Nf as Sl,Ng as XI,Nh as Xo,Ni as Tl,Nj as qi,O as lx,Oa as al,Ob as Ns,Oc as ce,Od as tt,Oe as As,Of as wl,Og as Bs,Oh as zf,Oi as qf,Oj as lL,P as dx,Pa as mx,Pb as le,Pc as wi,Pd as Ti,Pe as fl,Pf as yl,Pg as EM,Ph as _0,Pi as on,Pj as pu,Q as kn,Qa as fx,Qb as ti,Qc as Bx,Qd as Pt,Qe as pI,Qf as BI,Qg as JI,Qh as v0,Qi as Gf,Qj as dL,R as dh,Ra as _x,Rb as Ne,Rc as Vx,Rd as Uo,Re as mI,Rf as Fh,Rg as RM,Rh as Hf,Ri as z0,Rj as bo,S as oo,Sa as xs,Sb as ae,Sc as wh,Sd as lt,Se as Nh,Sf as Fs,Sg as e0,Sh as b0,Si as au,Sj as Al,T as ch,Ta as vx,Tb as Ue,Tc as _f,Td as Sf,Te as Df,Tf as Nf,Tg as TM,Th as C0,Ti as H0,Tj as cL,U as nl,Ua as lf,Ub as x,Uc as Ux,Ud as Lr,Ue as uo,Uf as xl,Ug as t0,Uh as Bf,Ui as B0,Uj as mu,V as ee,Va as Is,Vb as Tx,Vc as Rn,Vd as wf,Ve as z,Vf as Qt,Vg as PM,Vh as S0,Vi as V0,Vj as Co,W as pe,Wa as Ht,Wb as X,Wc as be,Wd as Ps,We as A,Wf as Wh,Wg as i0,Wh as Vf,Wi as U0,Wj as hL,X as Ei,Xa as bx,Xb as G,Xc as jx,Xd as yf,Xe as fI,Xf as Lt,Xg as OM,Xh as Qh,Xi as j0,Xj as Tr,Y as hh,Ya as _M,Yb as re,Yc as Kx,Yd as he,Ye as _l,Yf as zh,Yg as o0,Yh as w0,Yi as Pl,Yj as t_,Z as bi,Za as Ls,Zb as mf,Zc as et,Zd as It,Ze as _I,Zf as Go,Zg as AM,Zh as Er,Zi as $f,Zj as fu,_ as rl,_a as df,_b as vM,_c as oi,_d as tI,_e as Oi,_f as Ef,_g as n0,_h as y0,_i as lu,_j as _u,a as ui,aa as uh,ab as Ds,ac as bM,ad as qx,ae as xf,af as Eh,ag as VI,ah as $h,ai as fo,aj as Zf,ak as i_,b as br,ba as cx,bb as Wo,bc as wt,bd as Gx,be as Tn,bf as Rh,bg as UI,bh as r0,bi as Xh,bj as Qf,bk as gL,c as Zy,ca as gh,cb as Sx,cc as zo,cd as yh,ce as yM,cf as vI,cg as kM,ch as Xt,ci as x0,cj as K0,ck as pL,d as of,da as $e,db as wx,dc as Ci,dd as $x,de as si,df as bI,dg as $o,dh as s0,di as I0,dj as _o,e as zt,ea as sf,eb as Cr,ec as ff,ed as hl,ee as lo,ef as CI,eg as jI,eh as Vs,ei as L0,ej as q0,f as Qy,fa as xe,fb as ll,fc as Ox,fd as Yx,fe as kr,ff as Th,fg as Ws,fh as a0,fi as D0,fj as Ot,g as Ge,ga as L,gb as Ze,gc as O,gd as vf,ge as Pn,gf as Ko,gg as Bh,gh as l0,gi as k0,gj as G0,h as Xy,ha as I,hb as ks,hc as Ho,hd as Pe,he as iI,hf as Ph,hg as Rf,hh as kl,hi as M0,hj as $0,i as oh,ia as Ye,ib as cf,ic as Yt,id as xr,ie as xM,if as SI,ig as KI,ih as yi,ii as Rr,ij as Y0,j as Jy,ja as hx,jb as yx,jc as Ax,jd as Ui,je as If,jf as wI,jg as qI,jh as d0,ji as Jo,jj as du,k as ex,ka as E,kb as hf,kc as wr,kd as T,ke as oI,kf as yI,kg as dt,kh as FM,ki as Jh,kj as Z0,l as Fe,la as st,lb as uf,lc as Tt,ld as Ir,le as Dh,lf as xI,lg as Ae,lh as Of,li as eu,lj as cu,m as nh,ma as Ao,mb as Mn,mc as ve,md as P,me as nI,mf as vl,mg as On,mh as Us,mi as N0,n as rh,na as Me,nb as xx,nc as Je,nd as Zx,ne as rI,nf as II,ng as Dt,nh as te,ni as E0,nj as Ve,o as nf,oa as K,ob as Ix,oc as pi,od as Bt,oe as gl,of as bl,og as Vh,oh as mt,oi as Qe,oj as hu,p as tl,pa as af,pb as Lx,pc as yr,pd as xt,pe as Pi,pf as po,pg as GI,ph as c0,pi as zn,pj as Q0,q as tx,qa as Ie,qb as Dx,qc as Nn,qd as Qx,qe as co,qf as qo,qg as Ce,qh as Af,qi as tu,qj as X0,r as ue,ra as Y,rb as mh,rc as vh,rd as xh,re as sI,rf as LI,rg as Tf,rh as Ff,ri as R0,rj as J0,rk as Bn,s as In,sa as We,sb as kx,sc as bh,sd as de,se as ji,sf as Mr,sg as MM,sh as Wf,si as T0,sj as eL,t as ix,ta as Te,tb as fh,tc as Fx,td as Ih,te as pl,tf as DI,tg as $I,th as Ml,ti as P0,tj as uu,u as St,ua as Ee,ub as gf,uc as Wx,ud as je,ue as ie,uf as kf,ug as Yo,uh as js,ui as iu,uj as Xf,v as ox,va as Fo,vb as Be,vc as CM,vd as k,ve as ho,vf as kI,vg as YI,vh as He,vi as ou,vj as Ki,w as ws,wa as ux,wb as Mx,wc as Se,wd as bf,we as aI,wf as MI,wg as Uh,wh as h0,wi as Rl,wj as tL,x as rf,xa as ys,xb as Nx,xc as En,xd as ni,xe as N,xf as Oh,xg as jh,xh as Ks,xi as ai,xj as iL,y as h,ya as ph,yb as Ex,yc as Si,yd as ri,ye as lI,yf as NI,yg as zs,yh as u0,yi as qs,yj as Hn,z as nx,za as gx,zb as _h,zc as Es,zd as H,ze as dI,zf as EI,zg as Il,zh as g0,zi as Uf}from"./APEX2ZKJ.js";import{a as tf,b as Gy,d as $y}from"./LB3V3VCM.js";var nm,Dk=tf(()=>{ut();nm=class{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){let o=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new V(o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn),o.endLineNumber,Math.min(this._originalSelection.positionColumn,o.endColumn)):new V(o.endLineNumber,o.endColumn-this._text.length,o.endLineNumber,o.endColumn)}}});var kk=tf(()=>{});var Mk=Gy(bc=>{fe();me();Tr();Z();q();ut();we();mt();su();F();Dk();kk();var lT=bc&&bc.__decorate||function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},dT=bc&&bc.__param||function(s,e){return function(t,i){e(t,i,s)}},rm,lr=rm=class{static get(e){return e.getContribution(rm.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var i;(i=this.currentRequest)===null||i===void 0||i.cancel();let o=this.editor.getSelection(),n=this.editor.getModel();if(!n||!o)return;let r=o;if(r.startLineNumber!==r.endLineNumber)return;let a=new mu(this.editor,5),l=n.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Se(d=>this.editorWorkerService.navigateValueSet(l,r,t)),this.currentRequest.then(d=>{var c;if(!d||!d.range||!d.value||!a.validate(this.editor))return;let u=b.lift(d.range),g=d.range,p=d.value.length-(r.endColumn-r.startColumn);g={startLineNumber:g.startLineNumber,startColumn:g.startColumn,endLineNumber:g.endLineNumber,endColumn:g.startColumn+d.value.length},p>1&&(r=new V(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn+p-1));let m=new nm(u,r,d.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,m),this.editor.pushUndoStop(),this.decorations.set([{range:g,options:rm.DECORATION}]),(c=this.decorationRemover)===null||c===void 0||c.cancel(),this.decorationRemover=Es(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(ee)}).catch(ee)):Promise.resolve(void 0)}};lr.ID="editor.contrib.inPlaceReplaceController";lr.DECORATION=te.register({description:"in-place-replace",className:"valueSetReplacement"});lr=rm=lT([dT(1,tn)],lr);var bS=class extends k{constructor(){super({id:"editor.action.inPlaceReplace.up",label:h("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:_.writable,kbOpts:{kbExpr:_.editorTextFocus,primary:3159,weight:100}})}run(e,t){let i=lr.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}},CS=class extends k{constructor(){super({id:"editor.action.inPlaceReplace.down",label:h("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:_.writable,kbOpts:{kbExpr:_.editorTextFocus,primary:3161,weight:100}})}run(e,t){let i=lr.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}};W(lr.ID,lr,4);w(bS);w(CS)});var tM=tf(()=>{});var oM=Gy(Gc=>{tM();de();ho();E();Z();Ht();LM();IM();Ti();Xf();Er();var dP=Gc&&Gc.__decorate||function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},iM=Gc&&Gc.__param||function(s,e){return function(t,i){e(t,i,s)}},Py,$a=Py=class extends I{static get(e){return e.getContribution(Py.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(o=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(o=>this.stop())),this._register(Is.onDidChange(o=>this.stop())),this._register(this._editor.onKeyUp(o=>o.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new Ym(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};$a.ID="editor.contrib.inspectTokens";$a=Py=dP([iM(1,uu),iM(2,tt)],$a);var Oy=class extends k{constructor(){super({id:"editor.action.inspectTokens",label:C0.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){let i=$a.get(t);i?.launch()}};function cP(s){let e="";for(let t=0,i=s.length;t<i;t++){let o=s.charCodeAt(t);switch(o){case 9:e+="\u2192";break;case 32:e+="\xB7";break;default:e+=String.fromCharCode(o)}}return e}function hP(s,e){let t=Is.get(e);if(t)return t;let i=s.encodeLanguageId(e);return{getInitialState:()=>dI,tokenize:(o,n,r)=>cI(e,r),tokenizeEncoded:(o,n,r)=>hI(i,r)}}var Ym=class s extends I{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=hP(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return s._ID}_compute(e){let t=this._getTokensAtLine(e.lineNumber),i=0;for(let l=t.tokens1.length-1;l>=0;l--){let d=t.tokens1[l];if(e.column-1>=d.offset){i=l;break}}let o=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){o=l;break}let n=this._model.getLineContent(e.lineNumber),r="";if(i<t.tokens1.length){let l=t.tokens1[i].offset,d=i+1<t.tokens1.length?t.tokens1[i+1].offset:n.length;r=n.substring(l,d)}Ir(this._domNode,P("h2.tm-token",void 0,cP(r),P("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),T(this._domNode,P("hr.tokens-inspect-separator",{style:"clear:both"}));let a=(o<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(o<<1)+1]):null;T(this._domNode,P("table.tm-metadata-table",void 0,P("tbody",void 0,P("tr",void 0,P("td.tm-metadata-key",void 0,"language"),P("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),P("tr",void 0,P("td.tm-metadata-key",void 0,"token type"),P("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),P("tr",void 0,P("td.tm-metadata-key",void 0,"font style"),P("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),P("tr",void 0,P("td.tm-metadata-key",void 0,"foreground"),P("td.tm-metadata-value",void 0,`${a?ie.Format.CSS.formatHex(a.foreground):"-?-"}`)),P("tr",void 0,P("td.tm-metadata-key",void 0,"background"),P("td.tm-metadata-value",void 0,`${a?ie.Format.CSS.formatHex(a.background):"-?-"}`))))),T(this._domNode,P("hr.tokens-inspect-separator")),i<t.tokens1.length&&T(this._domNode,P("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){let t=Is.getColorMap(),i=Os.getLanguageId(e),o=Os.getTokenType(e),n=Os.getFontStyle(e),r=Os.getForeground(e),a=Os.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:o,fontStyle:n,foreground:t[r],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){let t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),o=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:o.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};Ym._ID="editor.contrib.inspectTokensWidget";W($a.ID,$a,4);w(Oy)});var WM=Object.defineProperty,zM=Object.getOwnPropertyDescriptor,HM=Object.getOwnPropertyNames,BM=Object.prototype.hasOwnProperty,mL=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of HM(e))!BM.call(s,o)&&o!==t&&WM(s,o,{get:()=>e[o],enumerable:!(i=zM(e,o))||i.enumerable});return s},VM=(s,e,t)=>(mL(s,e,"default"),t&&mL(t,e,"default")),Fl={};VM(Fl,Bn);var fL={},o_={},_L=class{static getOrCreate(s){return o_[s]||(o_[s]=new _L(s)),o_[s]}_languageId;_loadingTriggered;_lazyLoadPromise;_lazyLoadPromiseResolve;_lazyLoadPromiseReject;constructor(s){this._languageId=s,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,fL[this._languageId].loader().then(s=>this._lazyLoadPromiseResolve(s),s=>this._lazyLoadPromiseReject(s))),this._lazyLoadPromise}};function Vn(s){let e=s.id;fL[e]=s,Fl.languages.register(s);let t=_L.getOrCreate(e);Fl.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Fl.languages.onLanguageEncountered(e,async()=>{let i=await t.load();Fl.languages.setLanguageConfiguration(e,i.conf)})}Vn({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>import("./4MCCKOVD.js")});Vn({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>import("./IHB5F7HJ.js")});Vn({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>import("./GLQTWXTY.js")});Vn({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>import("./YBU23HBJ.js")});var UM=Object.defineProperty,jM=Object.getOwnPropertyDescriptor,KM=Object.getOwnPropertyNames,qM=Object.prototype.hasOwnProperty,vL=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of KM(e))!qM.call(s,o)&&o!==t&&UM(s,o,{get:()=>e[o],enumerable:!(i=jM(e,o))||i.enumerable});return s},GM=(s,e,t)=>(vL(s,e,"default"),t&&vL(t,e,"default")),Gs={};GM(Gs,Bn);var n_=class{_onDidChange=new Gs.Emitter;_options;_modeConfiguration;_languageId;constructor(s,e,t){this._languageId=s,this.setOptions(e),this.setModeConfiguration(t)}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(s){this._options=s||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(s){this.setOptions(s)}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(this)}},r_={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},s_={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},bL=new n_("css",r_,s_),CL=new n_("scss",r_,s_),SL=new n_("less",r_,s_);Gs.languages.css={cssDefaults:bL,lessDefaults:SL,scssDefaults:CL};function a_(){return import("./LXKAY3SY.js")}Gs.languages.onLanguage("less",()=>{a_().then(s=>s.setupMode(SL))});Gs.languages.onLanguage("scss",()=>{a_().then(s=>s.setupMode(CL))});Gs.languages.onLanguage("css",()=>{a_().then(s=>s.setupMode(bL))});var $M=Object.defineProperty,YM=Object.getOwnPropertyDescriptor,ZM=Object.getOwnPropertyNames,QM=Object.prototype.hasOwnProperty,wL=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ZM(e))!QM.call(s,o)&&o!==t&&$M(s,o,{get:()=>e[o],enumerable:!(i=YM(e,o))||i.enumerable});return s},XM=(s,e,t)=>(wL(s,e,"default"),t&&wL(t,e,"default")),vu={};XM(vu,Bn);var JM=class{_onDidChange=new vu.Emitter;_options;_modeConfiguration;_languageId;constructor(s,e,t){this._languageId=s,this.setOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(s){this._options=s||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(this)}},eN={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"},bu={format:eN,suggest:{},data:{useDefaultDataProvider:!0}};function Cu(s){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:s===Wl,documentFormattingEdits:s===Wl,documentRangeFormattingEdits:s===Wl}}var Wl="html",yL="handlebars",xL="razor",IL=Su(Wl,bu,Cu(Wl)),tN=IL.defaults,LL=Su(yL,bu,Cu(yL)),iN=LL.defaults,DL=Su(xL,bu,Cu(xL)),oN=DL.defaults;vu.languages.html={htmlDefaults:tN,razorDefaults:oN,handlebarDefaults:iN,htmlLanguageService:IL,handlebarLanguageService:LL,razorLanguageService:DL,registerHTMLLanguageService:Su};function nN(){return import("./SAVSDVAN.js")}function Su(s,e=bu,t=Cu(s)){let i=new JM(s,e,t),o,n=vu.languages.onLanguage(s,async()=>{o=(await nN()).setupMode(i)});return{defaults:i,dispose(){n.dispose(),o?.dispose(),o=void 0}}}var rN=Object.defineProperty,sN=Object.getOwnPropertyDescriptor,aN=Object.getOwnPropertyNames,lN=Object.prototype.hasOwnProperty,kL=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of aN(e))!lN.call(s,o)&&o!==t&&rN(s,o,{get:()=>e[o],enumerable:!(i=sN(e,o))||i.enumerable});return s},dN=(s,e,t)=>(kL(s,e,"default"),t&&kL(t,e,"default")),zl={};dN(zl,Bn);var cN=class{_onDidChange=new zl.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(s,e,t){this._languageId=s,this.setDiagnosticsOptions(e),this.setModeConfiguration(t)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(s){this._diagnosticsOptions=s||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(s){this._modeConfiguration=s||Object.create(null),this._onDidChange.fire(this)}},hN={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},uN={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},ML=new cN("json",hN,uN);zl.languages.json={jsonDefaults:ML};function gN(){return import("./WJQCH5MH.js")}zl.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});zl.languages.onLanguage("json",()=>{gN().then(s=>s.setupMode(ML))});de();Nt();Z();Rt();we();F();Je();Ue();at();re();var l_=class extends Tt{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:h("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:$.map,toggled:x.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:x.has("isInDiffEditor"),menu:{when:x.has("isInDiffEditor"),id:O.EditorTitle,order:22,group:"navigation"}})}run(e,...t){let i=e.get(se),o=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",o)}};ve(l_);var wu=class extends Tt{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:h("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:x.has("isInDiffEditor")})}run(e,...t){let i=e.get(se),o=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",o)}};ve(wu);var yu=class extends Tt{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:h("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:x.has("isInDiffEditor")})}run(e,...t){let i=e.get(se),o=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",o)}};ve(yu);Yt.appendMenuItem(O.EditorTitle,{command:{id:new yu().desc.id,title:h("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:x.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:x.has("isInDiffEditor")},order:11,group:"1_diff",when:x.and(_.diffEditorRenderSideBySideInlineBreakpointReached,x.has("isInDiffEditor"))});Yt.appendMenuItem(O.EditorTitle,{command:{id:new wu().desc.id,title:h("showMoves","Show Moved Code Blocks"),icon:$.move,toggled:Tx.create("config.diffEditor.experimental.showMoves",!0),precondition:x.has("isInDiffEditor")},order:10,group:"1_diff",when:x.has("isInDiffEditor")});var xu={value:h("diffEditor","Diff Editor"),original:"Diff Editor"},d_=class extends ni{constructor(){super({id:"diffEditor.switchSide",title:{value:h("switchSide","Switch Side"),original:"Switch Side"},icon:$.arrowSwap,precondition:x.has("isInDiffEditor"),f1:!0,category:xu})}runEditorCommand(e,t,i){let o=Ys(e);if(o instanceof Al){if(i&&i.dryRun)return{destinationSelection:o.mapToOtherSide().destinationSelection};o.switchSide()}}};ve(d_);var c_=class extends ni{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:h("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:$.close,precondition:_.comparingMovedCode,f1:!1,category:xu,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){let o=Ys(e);o instanceof Al&&o.exitCompareMove()}};ve(c_);var h_=class extends ni{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:h("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:$.fold,precondition:x.has("isInDiffEditor"),f1:!0,category:xu})}runEditorCommand(e,t,...i){let o=Ys(e);o instanceof Al&&o.collapseAllUnchangedRegions()}};ve(h_);var u_=class extends ni{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:h("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:$.unfold,precondition:x.has("isInDiffEditor"),f1:!0,category:xu})}runEditorCommand(e,t,...i){let o=Ys(e);o instanceof Al&&o.showAllUnchangedRegions()}};ve(u_);var NL={value:h("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"},$s=class s extends Tt{constructor(){super({id:s.id,title:{value:h("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:NL,precondition:x.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){let t=Ys(e);t?.accessibleDiffViewerNext()}};$s.id="editor.action.accessibleDiffViewer.next";Yt.appendMenuItem(O.EditorTitle,{command:{id:$s.id,title:h("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:x.has("isInDiffEditor")},order:10,group:"2_diff",when:x.and(_.accessibleDiffViewerVisible.negate(),x.has("isInDiffEditor"))});var Hl=class s extends Tt{constructor(){super({id:s.id,title:{value:h("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:NL,precondition:x.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){let t=Ys(e);t?.accessibleDiffViewerPrev()}};Hl.id="editor.action.accessibleDiffViewer.prev";function Ys(s){var e;let t=s.get(_e),i=t.listDiffEditors(),o=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!o)return null;for(let r=0,a=i.length;r<a;r++){let l=i[r];if(l.getModifiedEditor().getId()===o.getId()||l.getOriginalEditor().getId()===o.getId())return l}let n=yh();if(n)for(let r of i){let a=r.getContainerDomNode();if(pN(a,n))return r}return null}function pN(s,e){let t=e;for(;t;){if(t===s)return!0;t=t.parentElement}return!1}ae.registerCommandAlias("editor.action.diffReview.next",$s.id);ve($s);ae.registerCommandAlias("editor.action.diffReview.prev",Hl.id);ve(Hl);Fo();Z();ut();we();F();re();var mN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},fN=function(s,e){return function(t,i){e(t,i,s)}},g_,Iu=new X("selectionAnchorSet",!1),nn=g_=class{static get(e){return e.getContribution(g_.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Iu.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){let e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(V.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Qe().appendText(h("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),nt(h("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){let e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){let t=this.editor.getPosition();this.editor.setSelection(V.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){let e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};nn.ID="editor.contrib.selectionAnchorController";nn=g_=mN([fN(1,G)],nn);var p_=class extends k{constructor(){super({id:"editor.action.setSelectionAnchor",label:h("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:_.editorTextFocus,primary:Ee(2089,2080),weight:100}})}async run(e,t){var i;(i=nn.get(t))===null||i===void 0||i.setSelectionAnchor()}},m_=class extends k{constructor(){super({id:"editor.action.goToSelectionAnchor",label:h("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Iu})}async run(e,t){var i;(i=nn.get(t))===null||i===void 0||i.goToSelectionAnchor()}},f_=class extends k{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:h("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Iu,kbOpts:{kbExpr:_.editorTextFocus,primary:Ee(2089,2089),weight:100}})}async run(e,t){var i;(i=nn.get(t))===null||i===void 0||i.selectFromAnchorToCursor()}},__=class extends k{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:h("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Iu,kbOpts:{kbExpr:_.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=nn.get(t))===null||i===void 0||i.cancelSelectionAnchor()}};W(nn.ID,nn,4);w(p_);w(m_);w(f_);w(__);fe();E();Z();ke();q();ut();we();Pn();mt();F();Je();Lt();Dt();var _N=z("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},h("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets.")),v_=class extends k{constructor(){super({id:"editor.action.jumpToBracket",label:h("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:_.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=So.get(t))===null||i===void 0||i.jumpToBracket()}},b_=class extends k{constructor(){super({id:"editor.action.selectToBracket",label:h("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:nx("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var o;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(o=So.get(t))===null||o===void 0||o.selectToBracket(n)}},C_=class extends k{constructor(){super({id:"editor.action.removeBrackets",label:h("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:_.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=So.get(t))===null||i===void 0||i.removeBrackets(this.id)}},S_=class{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}},So=class s extends I{static get(e){return e.getContribution(s.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new De(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;let e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{let o=i.getStartPosition(),n=e.bracketPairs.matchBracket(o),r=null;if(n)n[0].containsPosition(o)&&!n[1].containsPosition(o)?r=n[1].getStartPosition():n[1].containsPosition(o)&&(r=n[0].getStartPosition());else{let a=e.bracketPairs.findEnclosingBrackets(o);if(a)r=a[1].getStartPosition();else{let l=e.bracketPairs.findNextBracket(o);l&&l.range&&(r=l.range.getStartPosition())}}return r?new V(r.lineNumber,r.column,r.lineNumber,r.column):new V(o.lineNumber,o.column,o.lineNumber,o.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;let t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(o=>{let n=o.getStartPosition(),r=t.bracketPairs.matchBracket(n);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(n),!r)){let d=t.bracketPairs.findNextBracket(n);d&&d.range&&(r=t.bracketPairs.matchBracket(d.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(b.compareRangesUsingStarts);let[d,c]=r;if(a=e?d.getStartPosition():d.getEndPosition(),l=e?c.getEndPosition():c.getStartPosition(),c.containsPosition(n)){let u=a;a=l,l=u}}a&&l&&i.push(new V(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(i=>{let o=i.getPosition(),n=t.bracketPairs.matchBracket(o);n||(n=t.bracketPairs.findEnclosingBrackets(o)),n&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:n[0],text:""},{range:n[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();let e=[],t=0;for(let i of this._lastBracketsData){let o=i.brackets;o&&(e[t++]={range:o[0],options:i.options},e[t++]={range:o[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getModel(),i=t.getVersionId(),o=[];this._lastVersionId===i&&(o=this._lastBracketsData);let n=[],r=0;for(let u=0,g=e.length;u<g;u++){let p=e[u];p.isEmpty()&&(n[r++]=p.getStartPosition())}n.length>1&&n.sort(R.compare);let a=[],l=0,d=0,c=o.length;for(let u=0,g=n.length;u<g;u++){let p=n[u];for(;d<c&&o[d].position.isBefore(p);)d++;if(d<c&&o[d].position.equals(p))a[l++]=o[d];else{let m=t.bracketPairs.matchBracket(p,20),f=s._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!m&&this._matchBrackets==="always"&&(m=t.bracketPairs.findEnclosingBrackets(p,20),f=s._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new S_(p,m,f)}}this._lastBracketsData=a,this._lastVersionId=i}};So.ID="editor.contrib.bracketMatchingController";So._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=te.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Ae(_N),position:si.Center}});So._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=te.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});W(So.ID,So,1);w(b_);w(v_);w(C_);Yt.appendMenuItem(O.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:h({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});Z();we();q();ut();var Lu=class{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;let i=this._selection.startLineNumber,o=this._selection.startColumn,n=this._selection.endColumn;if(!(this._isMovingLeft&&o===1)&&!(!this._isMovingLeft&&n===e.getLineMaxColumn(i)))if(this._isMovingLeft){let r=new b(i,o-1,i,o),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new b(i,n,i,n),a)}else{let r=new b(i,n,i,n+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new b(i,o,i,o),a)}}computeCursorState(e,t){return this._isMovingLeft?new V(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new V(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}};F();var Du=class extends k{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;let i=[],o=t.getSelections();for(let n of o)i.push(new Lu(n,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}},w_=class extends Du{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:h("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:_.writable})}},y_=class extends Du{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:h("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:_.writable})}};w(w_);w(y_);Z();q();we();F();var x_=class extends k{constructor(){super({id:"editor.action.transposeLetters",label:h("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:_.writable,kbOpts:{kbExpr:_.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let i=t.getModel(),o=[],n=t.getSelections();for(let r of n){if(!r.isEmpty())continue;let a=r.startLineNumber,l=r.startColumn,d=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&d===2))continue;let c=l===d?r.getPosition():jh.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),u=jh.leftPosition(i,c),g=jh.leftPosition(i,u),p=i.getValueInRange(b.fromPositions(g,u)),m=i.getValueInRange(b.fromPositions(u,c)),f=b.fromPositions(g,c);o.push(new Yo(f,m+p))}o.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop())}};w(x_);Ex();de();$t();Z();Rt();we();F();Je();re();var Pr="9_cutcopypaste",vN=Dn||document.queryCommandSupported("cut"),EL=Dn||document.queryCommandSupported("copy"),bN=typeof navigator.clipboard>"u"||Nx?document.queryCommandSupported("paste"):!0;function D_(s){return s.register(),s}var CN=vN?D_(new Ih({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Dn?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:O.MenubarEditMenu,group:"2_ccp",title:h({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:O.EditorContext,group:Pr,title:h("actions.clipboard.cutLabel","Cut"),when:_.writable,order:1},{menuId:O.CommandPalette,group:"",title:h("actions.clipboard.cutLabel","Cut"),order:1},{menuId:O.SimpleEditorContext,group:Pr,title:h("actions.clipboard.cutLabel","Cut"),when:_.writable,order:1}]})):void 0,SN=EL?D_(new Ih({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Dn?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:O.MenubarEditMenu,group:"2_ccp",title:h({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:O.EditorContext,group:Pr,title:h("actions.clipboard.copyLabel","Copy"),order:2},{menuId:O.CommandPalette,group:"",title:h("actions.clipboard.copyLabel","Copy"),order:1},{menuId:O.SimpleEditorContext,group:Pr,title:h("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;Yt.appendMenuItem(O.MenubarEditMenu,{submenu:O.MenubarCopy,title:{value:h("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});Yt.appendMenuItem(O.EditorContext,{submenu:O.EditorContextCopy,title:{value:h("copy as","Copy As"),original:"Copy As"},group:Pr,order:3});Yt.appendMenuItem(O.EditorContext,{submenu:O.EditorContextShare,title:{value:h("share","Share"),original:"Share"},group:"11_share",order:-1,when:x.and(x.notEquals("resourceScheme","output"),_.editorTextFocus)});Yt.appendMenuItem(O.EditorTitleContext,{submenu:O.EditorTitleContextShare,title:{value:h("share","Share"),original:"Share"},group:"11_share",order:-1});Yt.appendMenuItem(O.ExplorerContext,{submenu:O.ExplorerContextShare,title:{value:h("share","Share"),original:"Share"},group:"11_share",order:-1});var I_=bN?D_(new Ih({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Dn?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:O.MenubarEditMenu,group:"2_ccp",title:h({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:O.EditorContext,group:Pr,title:h("actions.clipboard.pasteLabel","Paste"),when:_.writable,order:4},{menuId:O.CommandPalette,group:"",title:h("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:O.SimpleEditorContext,group:Pr,title:h("actions.clipboard.pasteLabel","Paste"),when:_.writable,order:4}]})):void 0,L_=class extends k{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:h("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:_.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(Rf.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),Rf.forceCopyWithSyntaxHighlighting=!1)}};function RL(s,e){s&&(s.addImplementation(1e4,"code-editor",(t,i)=>{let o=t.get(_e).getFocusedCodeEditor();if(o&&o.hasTextFocus()){let n=o.getOption(37),r=o.getSelection();return r&&r.isEmpty()&&!n||o.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),s.addImplementation(0,"generic-dom",(t,i)=>(hl().execCommand(e),!0)))}RL(CN,"cut");RL(SN,"copy");I_&&(I_.addImplementation(1e4,"code-editor",(s,e)=>{let t=s.get(_e),i=s.get(Ki),o=t.getFocusedCodeEditor();return o&&o.hasTextFocus()?!o.getContainerDomNode().ownerDocument.execCommand("paste")&&sh?(async()=>{let r=await i.readText();if(r!==""){let a=KI.INSTANCE.get(r),l=!1,d=null,c=null;a&&(l=o.getOption(37)&&!!a.isFromEmptySelection,d=typeof a.multicursorText<"u"?a.multicursorText:null,c=a.mode),o.trigger("keyboard","paste",{text:r,pasteOnNewLine:l,multicursorText:d,mode:c})}})():!0:!1}),I_.addImplementation(0,"generic-dom",(s,e)=>(hl().execCommand("paste"),!0)));EL&&w(L_);Z();Be();Z();we();Fe();Te();me();E();pt();q();ut();Ri();Tr();F();Ue();yr();me();var U=class s{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+s.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new s(this.value+s.sep+e)}};U.sep=".";U.None=new U("@@none@@");U.Empty=new U("");U.QuickFix=new U("quickfix");U.Refactor=new U("refactor");U.RefactorExtract=U.Refactor.append("extract");U.RefactorInline=U.Refactor.append("inline");U.RefactorMove=U.Refactor.append("move");U.RefactorRewrite=U.Refactor.append("rewrite");U.Notebook=new U("notebook");U.Source=new U("source");U.SourceOrganizeImports=U.Source.append("organizeImports");U.SourceFixAll=U.Source.append("fixAll");U.SurroundWith=U.Refactor.append("surround");var _t;(function(s){s.Refactor="refactor",s.RefactorPreview="refactor preview",s.Lightbulb="lightbulb",s.Default="other (default)",s.SourceAction="source action",s.QuickFix="quick fix action",s.FixAll="fix all",s.OrganizeImports="organize imports",s.AutoFix="auto fix",s.QuickFixHover="quick fix hover window",s.OnSave="save participants",s.ProblemsView="problems view"})(_t||(_t={}));function TL(s,e){return!(s.include&&!s.include.intersects(e)||s.excludes&&s.excludes.some(t=>OL(e,t,s.include))||!s.includeSourceActions&&U.Source.contains(e))}function PL(s,e){let t=e.kind?new U(e.kind):void 0;return!(s.include&&(!t||!s.include.contains(t))||s.excludes&&t&&s.excludes.some(i=>OL(t,i,s.include))||!s.includeSourceActions&&t&&U.Source.contains(t)||s.onlyIncludePreferredActions&&!e.isPreferred)}function OL(s,e,t){return!(!e.contains(s)||t&&e.contains(t))}var jn=class s{static fromUser(e,t){return!e||typeof e!="object"?new s(t.kind,t.apply,!1):new s(s.getKindFromUser(e,t.kind),s.getApplyFromUser(e,t.apply),s.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new U(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}},ku=class{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(o){pe(o)}i&&(this.action.edit=i.edit)}return this}};var Mu="editor.action.codeAction",Zs="editor.action.quickFix",Nu="editor.action.autoFix",Eu="editor.action.refactor",Ru="editor.action.sourceAction",Vl="editor.action.organizeImports",Ul="editor.action.fixAll",k_=class s extends I{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Ge(e.diagnostics)?Ge(t.diagnostics)?s.codeActionsPreferredComparator(e,t):-1:Ge(t.diagnostics)?1:s.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(s.codeActionsComparator),this.validActions=this.allActions.filter(({action:o})=>!o.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&U.QuickFix.contains(new U(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}},AL={actions:[],documentation:void 0};async function Or(s,e,t,i,o,n){var r;let a=i.filter||{},l={...a,excludes:[...a.excludes||[],U.Notebook]},d={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},c=new hL(e,n),u=i.type===2,g=wN(s,e,u?l:a),p=new L,m=g.map(async C=>{try{o.report(C);let v=await C.provideCodeActions(e,t,d,c.token);if(v&&p.add(v),c.token.isCancellationRequested)return AL;let S=(v?.actions||[]).filter(D=>D&&PL(a,D)),y=xN(C,S,a.include);return{actions:S.map(D=>new ku(D,C)),documentation:y}}catch(v){if(Ei(v))throw v;return pe(v),AL}}),f=s.onDidChange(()=>{let C=s.all(e);ui(C,g)||c.cancel()});try{let C=await Promise.all(m),v=C.map(y=>y.actions).flat(),S=[...zt(C.map(y=>y.documentation)),...yN(s,e,i,v)];return new k_(v,S,p)}finally{f.dispose(),c.dispose()}}function wN(s,e,t){return s.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(o=>TL(t,new U(o))):!0)}function*yN(s,e,t,i){var o,n,r;if(e&&i.length)for(let a of s.all(e))a._getAdditionalMenuItems&&(yield*(o=a._getAdditionalMenuItems)===null||o===void 0?void 0:o.call(a,{trigger:t.type,only:(r=(n=t.filter)===null||n===void 0?void 0:n.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function xN(s,e,t){if(!s.documentation)return;let i=s.documentation.map(o=>({kind:new U(o.kind),command:o.command}));if(t){let o;for(let n of i)n.kind.contains(t)&&(o?o.kind.contains(n.kind)&&(o=n):o=n);if(o)return o?.command}for(let o of e)if(o.kind){for(let n of i)if(n.kind.contains(new U(o.kind)))return n.command}}var Bl;(function(s){s.OnSave="onSave",s.FromProblemsView="fromProblemsView",s.FromCodeActions="fromCodeActions"})(Bl||(Bl={}));async function FL(s,e,t,i,o=Y.None){var n;let r=s.get(Fn),a=s.get(Ne),l=s.get(pi),d=s.get(He);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(o),!o.isCancellationRequested&&!(!((n=e.action.edit)===null||n===void 0)&&n.edits.length&&!(await r.apply(e.action.edit,{editor:i?.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Bl.OnSave,showPreview:i?.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(c){let u=IN(c);d.error(typeof u=="string"?u:h("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function IN(s){return typeof s=="string"?s:s instanceof Error&&typeof s.message=="string"?s.message:void 0}ae.registerCommand("_executeCodeActionProvider",async function(s,e,t,i,o){if(!(e instanceof ne))throw bi();let{codeActionProvider:n}=s.get(N),r=s.get(ze).getModel(e);if(!r)throw bi();let a=V.isISelection(t)?V.liftSelection(t):b.isIRange(t)?r.validateRange(t):void 0;if(!a)throw bi();let l=typeof i=="string"?new U(i):void 0,d=await Or(n,r,a,{type:1,triggerAction:_t.Default,filter:{includeSourceActions:!0,include:l}},Ai.None,Y.None),c=[],u=Math.min(d.validActions.length,typeof o=="number"?o:0);for(let g=0;g<u;g++)c.push(d.validActions[g].resolve(Y.None));try{return await Promise.all(c),d.validActions.map(g=>g.action)}finally{setTimeout(()=>d.dispose(),100)}});F();re();de();me();df();E();ke();mt();df();var LN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},DN=function(s,e){return function(t,i){e(t,i,s)}},M_,jl=M_=class{constructor(e){this.keybindingService=e}getResolver(){let e=new Ls(()=>this.keybindingService.getKeybindings().filter(t=>M_.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Vl?i={kind:U.SourceOrganizeImports.value}:t.command===Ul&&(i={kind:U.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...jn.fromUser(i,{kind:U.None,apply:"never"})}}));return t=>{if(t.kind){let i=this.bestKeybindingForCodeAction(t,e.value);return i?.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;let i=new U(e.kind);return t.filter(o=>o.kind.contains(i)).filter(o=>o.preferred?e.isPreferred:!0).reduceRight((o,n)=>o?o.kind.contains(n.kind)?n:o:n,void 0)}};jl.codeActionCommands=[Eu,Mu,Ru,Vl,Ul];jl=M_=LN([DN(0,Ce)],jl);Nt();F();Lt();var P1=z("symbolIcon.arrayForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),O1=z("symbolIcon.booleanForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),A1=z("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},h("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),F1=z("symbolIcon.colorForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),W1=z("symbolIcon.constantForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),z1=z("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},h("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),H1=z("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},h("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),B1=z("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},h("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),V1=z("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},h("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),U1=z("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},h("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),j1=z("symbolIcon.fileForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),K1=z("symbolIcon.folderForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),q1=z("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},h("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),G1=z("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},h("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),$1=z("symbolIcon.keyForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Y1=z("symbolIcon.keywordForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Z1=z("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},h("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Q1=z("symbolIcon.moduleForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),X1=z("symbolIcon.namespaceForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),J1=z("symbolIcon.nullForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),eA=z("symbolIcon.numberForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),tA=z("symbolIcon.objectForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),iA=z("symbolIcon.operatorForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),oA=z("symbolIcon.packageForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),nA=z("symbolIcon.propertyForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),rA=z("symbolIcon.referenceForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),sA=z("symbolIcon.snippetForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),aA=z("symbolIcon.stringForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),lA=z("symbolIcon.structForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),dA=z("symbolIcon.textForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),cA=z("symbolIcon.typeParameterForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),hA=z("symbolIcon.unitForeground",{dark:A,light:A,hcDark:A,hcLight:A},h("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),uA=z("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},h("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F();var WL=Object.freeze({kind:U.Empty,title:h("codeAction.widget.id.more","More Actions...")}),kN=Object.freeze([{kind:U.QuickFix,title:h("codeAction.widget.id.quickfix","Quick Fix")},{kind:U.RefactorExtract,title:h("codeAction.widget.id.extract","Extract"),icon:$.wrench},{kind:U.RefactorInline,title:h("codeAction.widget.id.inline","Inline"),icon:$.wrench},{kind:U.RefactorRewrite,title:h("codeAction.widget.id.convert","Rewrite"),icon:$.wrench},{kind:U.RefactorMove,title:h("codeAction.widget.id.move","Move"),icon:$.wrench},{kind:U.SurroundWith,title:h("codeAction.widget.id.surround","Surround With"),icon:$.symbolSnippet},{kind:U.Source,title:h("codeAction.widget.id.source","Source Action"),icon:$.symbolFile},WL]);function zL(s,e,t){if(!e)return s.map(n=>{var r;return{kind:"action",item:n,group:WL,disabled:!!n.action.disabled,label:n.action.disabled||n.action.title,canPreview:!!(!((r=n.action.edit)===null||r===void 0)&&r.edits.length)}});let i=kN.map(n=>({group:n,actions:[]}));for(let n of s){let r=n.action.kind?new U(n.action.kind):U.None;for(let a of i)if(a.group.kind.contains(r)){a.actions.push(n);break}}let o=[];for(let n of i)if(n.actions.length){o.push({kind:"header",group:n.group});for(let r of n.actions){let a=n.group;o.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:$.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return o}de();Nt();Ie();E();ti();ZI();F();Ue();var MN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},HL=function(s,e){return function(t,i){e(t,i,s)}},N_,Qs;(function(s){s.Hidden={type:0};class e{constructor(i,o,n,r){this.actions=i,this.trigger=o,this.editorPosition=n,this.widgetPosition=r,this.type=1}}s.Showing=e})(Qs||(Qs={}));var rn=N_=class extends I{constructor(e,t,i){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new K),this.onClick=this._onClick.event,this._state=Qs.Hidden,this._iconClasses=[],this._domNode=P("div.lightBulbWidget"),this._register(Nh.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(o=>{let n=this._editor.getModel();(this.state.type!==1||!n||this.state.editorPosition.lineNumber>=n.getLineCount())&&this.hide()})),this._register(Bx(this._domNode,o=>{var n;if(this.state.type!==1)return;let r=this._editor.getOption(64).experimental.showAiIcon;if((r===kn.On||r===kn.OnCode)&&this.state.actions.allAIFixes&&this.state.actions.validActions.length===1){let u=this.state.actions.validActions[0].action;if(!((n=u.command)===null||n===void 0)&&n.id){i.executeCommand(u.command.id,...u.command.arguments||[]),o.preventDefault();return}}this._editor.focus(),o.preventDefault();let{top:a,height:l}=et(this._domNode),d=this._editor.getOption(66),c=Math.floor(d/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(c+=d),this._onClick.fire({x:o.posx,y:a+l+c,actions:this.state.actions,trigger:this.state.trigger})})),this._register(ce(this._domNode,"mouseenter",o=>{(o.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(64)&&(this._editor.getOption(64).enabled||this.hide(),this._updateLightBulbTitleAndIcon())})),this._register(Me.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var o,n,r,a;this._preferredKbLabel=(n=(o=this._keybindingService.lookupKeybinding(Nu))===null||o===void 0?void 0:o.getLabel())!==null&&n!==void 0?n:void 0,this._quickFixKbLabel=(a=(r=this._keybindingService.lookupKeybinding(Zs))===null||r===void 0?void 0:r.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();let o=this._editor.getOptions();if(!o.get(64).enabled)return this.hide();let n=this._editor.getModel();if(!n)return this.hide();let{lineNumber:r,column:a}=n.validatePosition(i),l=n.getOptions().tabSize,d=o.get(50),c=n.getLineContent(r),u=Dl(c,l),g=d.spaceWidth*u>22,p=f=>f>2&&this._editor.getTopForLineNumber(f)===this._editor.getTopForLineNumber(f-1),m=r;if(!g){if(r>1&&!p(r-1))m-=1;else if(!p(r+1))m+=1;else if(a*d.spaceWidth<22)return this.hide()}this.state=new Qs.Showing(e,t,i,{position:{lineNumber:m,column:n.getLineContent(m).match(/^\S\s*$/)?2:1},preference:N_._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==Qs.Hidden&&(this.state=Qs.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){var e,t,i;if(this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],this.state.type!==1)return;let o=()=>{this._preferredKbLabel&&(this.title=h("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel))},n=()=>{this._quickFixKbLabel?this.title=h("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=h("codeAction","Show Code Actions")},r,a=this._editor.getOption(64).experimental.showAiIcon;if(a===kn.On||a===kn.OnCode)if(a===kn.On&&this.state.actions.allAIFixes)if(r=$.sparkleFilled,this.state.actions.allAIFixes&&this.state.actions.validActions.length===1)if(((e=this.state.actions.validActions[0].action.command)===null||e===void 0?void 0:e.id)==="inlineChat.start"){let l=(i=(t=this._keybindingService.lookupKeybinding("inlineChat.start"))===null||t===void 0?void 0:t.getLabel())!==null&&i!==void 0?i:void 0;this.title=l?h("codeActionStartInlineChatWithKb","Start Inline Chat ({0})",l):h("codeActionStartInlineChat","Start Inline Chat")}else this.title=h("codeActionTriggerAiAction","Trigger AI Action");else n();else this.state.actions.hasAutoFix?(this.state.actions.hasAIFix?r=$.lightbulbSparkleAutofix:r=$.lightbulbAutofix,o()):this.state.actions.hasAIFix?(r=$.lightbulbSparkle,n()):(r=$.lightBulb,n());else this.state.actions.hasAutoFix?(r=$.lightbulbAutofix,o()):(r=$.lightBulb,n());this._iconClasses=le.asClassNameArray(r),this._domNode.classList.add(...this._iconClasses)}set title(e){this._domNode.title=e}};rn.ID="editor.contrib.lightbulbWidget";rn._posPref=[0];rn=N_=MN([HL(1,Ce),HL(2,Ne)],rn);Ie();E();Z();q();me();Ie();E();Ti();yf();var NN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},BL=function(s,e){return function(t,i){e(t,i,s)}},E_,di=E_=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new K,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};let o=new L,n=o.add(iu(e,{...this._getRenderOptions(e,o),...t},i));return n.element.classList.add("rendered-markdown"),{element:n.element,dispose:()=>o.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:async(i,o)=>{var n,r,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(n=this._options.editor.getModel())===null||n===void 0?void 0:n.getLanguageId()),l||(l=Ps);let d=await c0(this._languageService,o,l),c=document.createElement("span");if(c.innerHTML=(a=(r=E_._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(d))!==null&&a!==void 0?a:d,this._options.editor){let u=this._options.editor.getOption(50);_h(c,u)}else this._options.codeBlockFontFamily&&(c.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(c.style.fontSize=this._options.codeBlockFontSize),c},asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>R_(this._openerService,i,e.isTrusted),disposables:t}}}};di._ttpTokenizer=Ts("tokenizeToString",{createHTML(s){return s}});di=E_=NN([BL(1,tt),BL(2,it)],di);async function R_(s,e,t){try{return await s.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:EN(t)})}catch(i){return ee(i),!1}}function EN(s){return s===!0?!0:s&&Array.isArray(s.enabledCommands)?s.enabledCommands:!1}F();re();de();var RN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},VL=function(s,e){return function(t,i){e(t,i,s)}},Tu,kt=Tu=class{static get(e){return e.getContribution(Tu.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Ye,this._messageListeners=new L,this._mouseOverMessage=!1,this._editor=e,this._visible=Tu.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){nt(tu(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=tu(e)?iu(e,{actionHandler:{callback:o=>R_(this._openerService,o,tu(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Pu(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Me.debounce(this._editor.onDidBlurEditorText,(o,n)=>n,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&qx(yh(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(ce(this._messageWidget.value.getDomNode(),Pe.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ce(this._messageWidget.value.getDomNode(),Pe.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(o=>{o.target.position&&(i?i.containsPosition(o.target.position)||this.closeMessage():i=new b(t.lineNumber-3,1,o.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Pu.fadeOut(this._messageWidget.value))}};kt.ID="editor.contrib.messageController";kt.MESSAGE_VISIBLE=new X("messageVisible",!1,h("messageVisible","Whether the editor is currently showing an inline message"));kt=Tu=RN([VL(1,G),VL(2,it)],kt);var TN=je.bindToContribution(kt.get);H(new TN({id:"leaveEditorMessage",precondition:kt.MESSAGE_VISIBLE,handler:s=>s.closeMessage(),kbOpts:{weight:130,primary:9}}));var Pu=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},o){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";let n=document.createElement("div");n.classList.add("anchor","top"),this._domNode.appendChild(n);let r=document.createElement("div");typeof o=="string"?(r.classList.add("message"),r.textContent=o):(o.classList.add("message"),r.appendChild(o)),this._domNode.appendChild(r);let a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};W(kt.ID,kt,4);F();de();E();F();de();Te();Nt();E();$t();ti();F();Lt();var UL=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},T_=function(s,e){return function(t,i){e(t,i,s)}},F_="acceptSelectedCodeAction",W_="previewSelectedCodeAction",P_=class{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");let t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var o,n;i.text.textContent=(n=(o=e.group)===null||o===void 0?void 0:o.title)!==null&&n!==void 0?n:""}disposeTemplate(e){}},O_=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);let t=document.createElement("div");t.className="icon",e.append(t);let i=document.createElement("span");i.className="title",e.append(i);let o=new cu(e,ah);return{container:e,icon:t,text:i,keybinding:o}}renderElement(e,t,i){var o,n,r;if(!((o=e.group)===null||o===void 0)&&o.icon?(i.icon.className=le.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=uo(e.group.icon.color.id))):(i.icon.className=le.asClassName($.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=jL(e.label),i.keybinding.set(e.keybinding),Zx(!!e.keybinding,i.keybinding.element);let a=(n=this._keybindingService.lookupKeybinding(F_))===null||n===void 0?void 0:n.getLabel(),l=(r=this._keybindingService.lookupKeybinding(W_))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=h({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=h({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};O_=UL([T_(1,Ce)],O_);var A_=class extends UIEvent{constructor(){super("acceptSelectedAction")}},Ou=class extends UIEvent{constructor(){super("previewSelectedAction")}};function PN(s){if(s.kind==="action")return s.label}var Au=class extends I{constructor(e,t,i,o,n,r){super(),this._delegate=o,this._contextViewService=n,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new We),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");let a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new ou(e,this.domNode,a,[new O_(t,this._keybindingService),new P_],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:PN},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let d=l.label?jL(l?.label):"";return l.disabled&&(d=h({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",d,l.disabled)),d}return null},getWidgetAriaLabel:()=>h({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(A0),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){let t=this._allMenuItems.filter(l=>l.kind==="header").length,o=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(o);let n=e;if(this._allMenuItems.length>=50)n=380;else{let l=this._allMenuItems.map((d,c)=>{let u=this.domNode.ownerDocument.getElementById(this._list.getElementID(c));if(u){u.style.width="auto";let g=u.getBoundingClientRect().width;return u.style.width="",g}return 0});n=Math.max(...l,e)}let a=Math.min(o,this.domNode.ownerDocument.body.clientHeight*.7);return this._list.layout(a,n),this.domNode.style.height=`${a}px`,this._list.domFocus(),n}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){let t=this._list.getFocus();if(t.length===0)return;let i=t[0],o=this._list.element(i);if(!this.focusCondition(o))return;let n=e?new Ou:new A_;this._list.setSelection([i],n)}onListSelection(e){if(!e.elements.length)return;let t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof Ou):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();let i=this._list.getFocus();if(i.length===0)return;let o=i[0],n=this._list.element(o);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,n.item)}async onListHover(e){let t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){let i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Au=UL([T_(4,Wn),T_(5,Ce)],Au);function jL(s){return s.replace(/\r\n|\r|\n/g," ")}Je();re();Uo();ge();Lt();var ON=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},z_=function(s,e){return function(t,i){e(t,i,s)}};z("actionBar.toggledBackground",{dark:Ko,light:Ko,hcDark:Ko,hcLight:Ko},h("actionBar.toggledBackground","Background color for toggled action items in action bar."));var Ar={Visible:new X("codeActionMenuVisible",!1,h("codeActionMenuVisible","Whether the action widget list is visible"))},Kn=Et("actionWidgetService"),Fr=class extends I{get isVisible(){return Ar.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Ye)}show(e,t,i,o,n,r,a){let l=Ar.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(Au,e,t,i,o);this._contextViewService.showContextView({getAnchor:()=>n,render:c=>(l.set(!0),this._renderWidget(c,d,a??[])),onHide:c=>{l.reset(),this._onWidgetClosed(c)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var o;let n=document.createElement("div");if(n.classList.add("action-widget"),e.appendChild(n),this._list.value=t,this._list.value)n.appendChild(this._list.value.domNode);else throw new Error("List has no value");let r=new L,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(ce(l,Pe.MOUSE_DOWN,m=>m.stopPropagation()));let d=document.createElement("div"),c=e.appendChild(d);c.classList.add("context-view-pointerBlock"),r.add(ce(c,Pe.POINTER_MOVE,()=>c.remove())),r.add(ce(c,Pe.MOUSE_DOWN,()=>c.remove()));let u=0;if(i.length){let m=this._createActionBar(".action-widget-action-bar",i);m&&(n.appendChild(m.getContainer().parentElement),r.add(m),u=m.getContainer().offsetWidth)}let g=(o=this._list.value)===null||o===void 0?void 0:o.layout(u);n.style.width=`${g}px`;let p=r.add(Ui(e));return r.add(p.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;let i=P(e),o=new en(i);return o.push(t,{icon:!1,label:!0}),o}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};Fr=ON([z_(0,Wn),z_(1,G),z_(2,B)],Fr);Pt(Kn,Fr,1);var Kl=1100;ve(class extends Tt{constructor(){super({id:"hideCodeActionWidget",title:{value:h("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:Ar.Visible,keybinding:{weight:Kl,primary:9,secondary:[1033]}})}run(s){s.get(Kn).hide()}});ve(class extends Tt{constructor(){super({id:"selectPrevCodeAction",title:{value:h("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:Ar.Visible,keybinding:{weight:Kl,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(s){let e=s.get(Kn);e instanceof Fr&&e.focusPrevious()}});ve(class extends Tt{constructor(){super({id:"selectNextCodeAction",title:{value:h("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:Ar.Visible,keybinding:{weight:Kl,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(s){let e=s.get(Kn);e instanceof Fr&&e.focusNext()}});ve(class extends Tt{constructor(){super({id:F_,title:{value:h("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:Ar.Visible,keybinding:{weight:Kl,primary:3,secondary:[2137]}})}run(s){let e=s.get(Kn);e instanceof Fr&&e.acceptSelected()}});ve(class extends Tt{constructor(){super({id:W_,title:{value:h("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:Ar.Visible,keybinding:{weight:Kl,primary:2051}})}run(s){let e=s.get(Kn);e instanceof Fr&&e.acceptSelected(!0)}});Ue();at();re();ge();Lt();Hh();Dt();fe();me();Ie();E();yi();ke();ut();re();var B_=new X("supportedCodeAction",""),H_=class extends I{constructor(e,t,i,o=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=o,this._autoTriggerTimer=this._register(new ao),this._register(this._markerService.onMarkerChanged(n=>this._onMarkerChanges(n))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){let t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){let t=this._editor.getModel();t&&e.some(i=>$h(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:_t.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){var t;if(!this._editor.hasModel())return;let i=this._editor.getModel(),o=this._editor.getSelection();if(o.isEmpty()&&e.type===2){let{lineNumber:n,column:r}=o.getPosition(),a=i.getLineContent(n);if(a.length===0){if(!(((t=this._editor.getOption(64).experimental)===null||t===void 0?void 0:t.showAiIcon)===kn.On))return}else if(r===1){if(/\s/.test(a[0]))return}else if(r===i.getLineMaxColumn(n)){if(/\s/.test(a[a.length-1]))return}else if(/\s/.test(a[r-2])&&/\s/.test(a[r-1]))return}return o}},Wr;(function(s){s.Empty={type:0};class e{constructor(i,o,n){this.trigger=i,this.position=o,this._cancellablePromise=n,this.type=1,this.actions=n.catch(r=>{if(Ei(r))return KL;throw r})}cancel(){this._cancellablePromise.cancel()}}s.Triggered=e})(Wr||(Wr={}));var KL=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1}),Fu=class extends I{constructor(e,t,i,o,n,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=n,this._configurationService=r,this._codeActionOracle=this._register(new Ye),this._state=Wr.Empty,this._onDidChangeState=this._register(new K),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=B_.bindTo(o),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Wr.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;let t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Wr.Empty);let e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){let t=this._registry.all(e).flatMap(i=>{var o;return(o=i.providedCodeActionKinds)!==null&&o!==void 0?o:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new H_(this._editor,this._markerService,i=>{var o;if(!i){this.setState(Wr.Empty);return}let n=i.selection.getStartPosition(),r=Se(async a=>{var l,d,c,u,g,p;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===_t.QuickFix||!((d=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||d===void 0)&&d.contains(U.QuickFix))){let m=await Or(this._registry,e,i.selection,i.trigger,Ai.None,a),f=[...m.allActions];if(a.isCancellationRequested)return KL;if(!((c=m.validActions)===null||c===void 0?void 0:c.some(v=>v.action.kind?U.QuickFix.contains(new U(v.action.kind)):!1))){let v=this._markerService.read({resource:e.uri});if(v.length>0){let S=i.selection.getPosition(),y=S,D=Number.MAX_VALUE,M=[...m.validActions];for(let j of v){let Re=j.endColumn,qe=j.endLineNumber,ht=j.startLineNumber;if(qe===S.lineNumber||ht===S.lineNumber){y=new R(qe,Re);let Ni={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((u=i.trigger.filter)===null||u===void 0)&&u.include?(g=i.trigger.filter)===null||g===void 0?void 0:g.include:U.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((p=i.trigger.context)===null||p===void 0?void 0:p.notAvailableMessage)||"",position:y}},ih=new V(y.lineNumber,y.column,y.lineNumber,y.column),el=await Or(this._registry,e,ih,Ni,Ai.None,a);if(el.validActions.length!==0){for(let qy of el.validActions)qy.highlightRange=qy.action.isPreferred;m.allActions.length===0&&f.push(...el.allActions),Math.abs(S.column-Re)<D?M.unshift(...el.validActions):M.push(...el.validActions)}D=Math.abs(S.column-Re)}}let J=M.filter((j,Re,qe)=>qe.findIndex(ht=>ht.action.title===j.action.title)===Re);return J.sort((j,Re)=>j.action.isPreferred&&!Re.action.isPreferred?-1:!j.action.isPreferred&&Re.action.isPreferred||j.action.isAI&&!Re.action.isAI?1:!j.action.isAI&&Re.action.isAI?-1:0),{validActions:J,allActions:f,documentation:m.documentation,hasAutoFix:m.hasAutoFix,hasAIFix:m.hasAIFix,allAIFixes:m.allAIFixes,dispose:()=>{m.dispose()}}}}}return Or(this._registry,e,i.selection,i.trigger,Ai.None,a)});i.trigger.type===1&&((o=this._progressService)===null||o===void 0||o.showWhile(r,250)),this.setState(new Wr.Triggered(i.trigger,n,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:_t.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}};var FN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},sn=function(s,e){return function(t,i){e(t,i,s)}},Wu,WN="quickfix-edit-highlight",Gi=Wu=class extends I{static get(e){return e.getContribution(Wu.ID)}constructor(e,t,i,o,n,r,a,l,d,c){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=d,this._instantiationService=c,this._activeCodeActions=this._register(new Ye),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Fu(this._editor,n.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Ls(()=>{let u=this._editor.getContribution(rn.ID);return u&&this._register(u.onClick(g=>this.showCodeActionList(g.actions,g,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=o.createInstance(jl),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,o){var n;if(!this._editor.hasModel())return;(n=kt.get(this._editor))===null||n===void 0||n.closeMessage();let r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:o,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,i){try{await this._instantiationService.invokeFunction(FL,e,Bl.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:_t.QuickFix,filter:{}})}}async update(e){var t,i,o,n,r,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let d;try{d=await e.actions}catch(c){ee(c);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(d,e.trigger,e.position),e.trigger.type===1){if(!((o=e.trigger.filter)===null||o===void 0)&&o.include){let u=this.tryGetValidActionToApply(e.trigger,d);if(u){try{(n=this._lightBulbWidget.value)===null||n===void 0||n.hide(),await this._applyCodeAction(u,!1,!1)}finally{d.dispose()}return}if(e.trigger.context){let g=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,d);if(g&&g.action.disabled){(r=kt.get(this._editor))===null||r===void 0||r.showMessage(g.action.disabled,e.trigger.context.position),d.dispose();return}}}let c=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!d.allActions.length||!c&&!d.validActions.length)){(l=kt.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=d,d.dispose();return}this._activeCodeActions.value=d,this.showCodeActionList(d,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?d.dispose():this._activeCodeActions.value=d}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]}async showCodeActionList(e,t,i){let o=this._editor.createDecorationsCollection(),n=this._editor.getDomNode();if(!n)return;let r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;let a=R.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(d,c)=>{this._applyCodeAction(d,!0,!!c),this._actionWidgetService.hide(),o.clear()},onHide:()=>{var d;(d=this._editor)===null||d===void 0||d.focus(),o.clear()},onHover:async(d,c)=>{var u;if(await d.resolve(c),!c.isCancellationRequested)return{canPreview:!!(!((u=d.action.edit)===null||u===void 0)&&u.edits.length)}},onFocus:d=>{var c,u;if(d&&d.highlightRange&&d.action.diagnostics){let g=[{range:d.action.diagnostics[0],options:Wu.DECORATION}];o.set(g);let p=d.action.diagnostics[0],m=(u=(c=this._editor.getModel())===null||c===void 0?void 0:c.getWordAtPosition({lineNumber:p.startLineNumber,column:p.startColumn}))===null||u===void 0?void 0:u.word;jo(h("editingNewSelection","Context: {0} at line {1} and column {2}.",m,p.startLineNumber,p.startColumn))}else o.clear()}};this._actionWidgetService.show("codeActionWidget",!0,zL(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,n,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();let t=this._editor.getScrolledVisiblePosition(e),i=et(this._editor.getDomNode()),o=i.left+t.left,n=i.top+t.top+t.height;return{x:o,y:n}}_shouldShowHeaders(){var e;let t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t?.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];let o=e.documentation.map(n=>{var r;return{id:n.id,label:n.title,tooltip:(r=n.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(n.id,...(a=n.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&o.push(this._showDisabled?{id:"hideMoreActions",label:h("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:h("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),o}};Gi.ID="editor.contrib.codeActionController";Gi.DECORATION=te.register({description:"quickfix-highlight",className:WN});Gi=Wu=FN([sn(1,Tl),sn(2,G),sn(3,B),sn(4,N),sn(5,Qo),sn(6,Ne),sn(7,se),sn(8,Kn),sn(9,B)],Gi);On((s,e)=>{((o,n)=>{n&&e.addRule(`.monaco-editor ${o} { background-color: ${n}; }`)})(".quickfix-edit-highlight",s.getColor(Oh));let i=s.getColor(Ah);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Go(s.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function ql(s){return x.regex(B_.keys()[0],new RegExp("(\\s|^)"+Wo(s.value)+"\\b"))}var V_={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:h("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:h("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[h("args.schema.apply.first","Always apply the first returned code action."),h("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),h("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:h("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function zr(s,e,t,i,o=_t.Default){if(s.hasModel()){let n=Gi.get(s);n?.manualTriggerAtCurrentPosition(e,o,t,i)}}var zu=class extends k{constructor(){super({id:Zs,label:h("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:x.and(_.writable,_.hasCodeActionsProvider),kbOpts:{kbExpr:_.textInputFocus,primary:2137,weight:100}})}run(e,t){return zr(t,h("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,_t.QuickFix)}},Hu=class extends je{constructor(){super({id:Mu,precondition:x.and(_.writable,_.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:V_}]}})}runEditorCommand(e,t,i){let o=jn.fromUser(i,{kind:U.Empty,apply:"ifSingle"});return zr(t,typeof i?.kind=="string"?o.preferred?h("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):h("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):o.preferred?h("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):h("editor.action.codeAction.noneMessage","No code actions available"),{include:o.kind,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply)}},Bu=class extends k{constructor(){super({id:Eu,label:h("refactor.label","Refactor..."),alias:"Refactor...",precondition:x.and(_.writable,_.hasCodeActionsProvider),kbOpts:{kbExpr:_.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:x.and(_.writable,ql(U.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:V_}]}})}run(e,t,i){let o=jn.fromUser(i,{kind:U.Refactor,apply:"never"});return zr(t,typeof i?.kind=="string"?o.preferred?h("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):h("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):o.preferred?h("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):h("editor.action.refactor.noneMessage","No refactorings available"),{include:U.Refactor.contains(o.kind)?o.kind:U.None,onlyIncludePreferredActions:o.preferred},o.apply,_t.Refactor)}},Vu=class extends k{constructor(){super({id:Ru,label:h("source.label","Source Action..."),alias:"Source Action...",precondition:x.and(_.writable,_.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:x.and(_.writable,ql(U.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:V_}]}})}run(e,t,i){let o=jn.fromUser(i,{kind:U.Source,apply:"never"});return zr(t,typeof i?.kind=="string"?o.preferred?h("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):h("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):o.preferred?h("editor.action.source.noneMessage.preferred","No preferred source actions available"):h("editor.action.source.noneMessage","No source actions available"),{include:U.Source.contains(o.kind)?o.kind:U.None,includeSourceActions:!0,onlyIncludePreferredActions:o.preferred},o.apply,_t.SourceAction)}},Uu=class extends k{constructor(){super({id:Vl,label:h("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:x.and(_.writable,ql(U.SourceOrganizeImports)),kbOpts:{kbExpr:_.textInputFocus,primary:1581,weight:100}})}run(e,t){return zr(t,h("editor.action.organize.noneMessage","No organize imports action available"),{include:U.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",_t.OrganizeImports)}},ju=class extends k{constructor(){super({id:Ul,label:h("fixAll.label","Fix All"),alias:"Fix All",precondition:x.and(_.writable,ql(U.SourceFixAll))})}run(e,t){return zr(t,h("fixAll.noneMessage","No fix all action available"),{include:U.SourceFixAll,includeSourceActions:!0},"ifSingle",_t.FixAll)}},Ku=class extends k{constructor(){super({id:Nu,label:h("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:x.and(_.writable,ql(U.QuickFix)),kbOpts:{kbExpr:_.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return zr(t,h("editor.action.autoFix.noneMessage","No auto fixes available"),{include:U.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",_t.AutoFix)}};F();wf();zo();W(Gi.ID,Gi,3);W(rn.ID,rn,4);w(zu);w(Bu);w(Vu);w(Uu);w(Ku);w(ju);H(new Hu);wt.as(Lr.Configuration).registerConfiguration({...El,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:h("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});wt.as(Lr.Configuration).registerConfiguration({...El,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:h("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});fe();me();E();Z();we();Te();me();E();St();pt();Ri();Ue();var Xs=class{constructor(){this.lenses=[],this._disposables=new L}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(let i of e.lenses)this.lenses.push({symbol:i,provider:t})}};async function U_(s,e,t){let i=s.ordered(e),o=new Map,n=new Xs,r=i.map(async(a,l)=>{o.set(a,l);try{let d=await Promise.resolve(a.provideCodeLenses(e,t));d&&n.add(d,a)}catch(d){pe(d)}});return await Promise.all(r),n.lenses=n.lenses.sort((a,l)=>a.symbol.range.startLineNumber<l.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>l.symbol.range.startLineNumber?1:o.get(a.provider)<o.get(l.provider)?-1:o.get(a.provider)>o.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),n}ae.registerCommand("_executeCodeLensProvider",function(s,...e){let[t,i]=e;ue(ne.isUri(t)),ue(typeof i=="number"||!i);let{codeLensProvider:o}=s.get(N),n=s.get(ze).getModel(t);if(!n)throw bi();let r=[],a=new L;return U_(o,n,Y.None).then(l=>{a.add(l);let d=[];for(let c of l.lenses)i==null||c.symbol.command?r.push(c.symbol):i-- >0&&c.provider.resolveCodeLens&&d.push(Promise.resolve(c.provider.resolveCodeLens(n,c.symbol,Y.None)).then(u=>r.push(u||c.symbol)));return Promise.all(d)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});Ie();q();Uo();ge();_M();de();var zN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},HN=function(s,e){return function(t,i){e(t,i,s)}},K_=Et("ICodeLensCache"),qu=class{constructor(e,t){this.lineCount=e,this.data=t}},j_=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new co(20,.75);let t="codelens/cache";Vx(bx,()=>e.remove(t,1));let i="codelens/cache2",o=e.get(i,1,"{}");this._deserialize(o),Me.once(e.onWillSaveState)(n=>{n.reason===qs.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){let i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)===null||a===void 0?void 0:a.title}}}),o=new Xs;o.add({lenses:i,dispose:()=>{}},this._fakeProvider);let n=new qu(e.getLineCount(),o);this._cache.set(e.uri.toString(),n)}get(e){let t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){let e=Object.create(null);for(let[t,i]of this._cache){let o=new Set;for(let n of i.data.lenses)o.add(n.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...o.values()]}}return JSON.stringify(e)}_deserialize(e){try{let t=JSON.parse(e);for(let i in t){let o=t[i],n=[];for(let a of o.lines)n.push({range:new b(a,1,a,11)});let r=new Xs;r.add({lenses:n,dispose(){}},this._fakeProvider),this._cache.set(i,new qu(o.lineCount,r))}}catch{}}};j_=zN([HN(0,ai)],j_);Pt(K_,j_,1);de();q();mt();var q_=class{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}},Gu=class s{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${s._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();let i=[],o=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r&&(o=!0,r.command)){let a=R0(r.command.title.trim());r.command.id?(i.push(P("a",{id:String(n),title:r.command.tooltip,role:"button"},...a)),this._commands.set(String(n),r.command)):i.push(P("span",{title:r.command.tooltip},...a)),n+1<e.length&&i.push(P("span",void 0,"\xA0|\xA0"))}}o?(Ir(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):Ir(this._domNode,P("span",void 0,"no commands"))}getCommand(e){return e.parentElement===this._domNode?this._commands.get(e.id):void 0}getId(){return this._id}getDomNode(){return this._domNode}updatePosition(e){let t=this._editor.getModel().getLineFirstNonWhitespaceColumn(e);this._widgetPosition={position:{lineNumber:e,column:t},preference:[1]}}getPosition(){return this._widgetPosition||null}};Gu._idPool=0;var Js=class{constructor(){this._removeDecorations=[],this._addDecorations=[],this._addDecorationsCallbacks=[]}addDecoration(e,t){this._addDecorations.push(e),this._addDecorationsCallbacks.push(t)}removeDecoration(e){this._removeDecorations.push(e)}commit(e){let t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,o=t.length;i<o;i++)this._addDecorationsCallbacks[i](t[i])}},qL=te.register({collapseOnReplaceEdit:!0,description:"codelens"}),Gl=class{constructor(e,t,i,o,n,r){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a,l=[];this._data.forEach((d,c)=>{d.symbol.command&&l.push(d.symbol),i.addDecoration({range:d.symbol.range,options:qL},u=>this._decorationIds[c]=u),a?a=b.plusRange(a,d.symbol.range):a=b.lift(d.symbol.range)}),this._viewZone=new q_(a.startLineNumber-1,n,r),this._viewZoneId=o.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new Gu(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t?.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{let i=this._editor.getModel().getDecorationRange(e),o=this._data[t].symbol;return!!(i&&b.isEmpty(o.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,o)=>{t.addDecoration({range:i.symbol.range,options:qL},n=>this._decorationIds[o]=n)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t<this._decorationIds.length;t++){let i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){let i=e[t];if(i){let{symbol:o}=this._data[t];o.command=i.command||o.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?void 0:t.getCommand(e)}getLineNumber(){let e=this._editor.getModel().getDecorationRange(this._decorationIds[0]);return e?e.startLineNumber:-1}update(e){if(this.isValid()){let t=this._editor.getModel().getDecorationRange(this._decorationIds[0]);t&&(this._viewZone.afterLineNumber=t.startLineNumber-1,e.layoutZone(this._viewZoneId),this._contentWidget&&(this._contentWidget.updatePosition(t.startLineNumber),this._editor.layoutContentWidget(this._contentWidget)))}}};F();Ue();var BN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},$l=function(s,e){return function(t,i){e(t,i,s)}},ea=class{constructor(e,t,i,o,n,r){this._editor=e,this._languageFeaturesService=t,this._commandService=o,this._notificationService=n,this._codeLensCache=r,this._disposables=new L,this._localToDispose=new L,this._lenses=[],this._oldCodeLensModels=new L,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new De(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){let e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52)),t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){let{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),o=this._editor.getOption(50),{style:n}=this._editor.getContainerDomNode();n.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),n.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),n.setProperty("--vscode-editorCodeLens-fontFeatureSettings",o.fontFeatureSettings),i&&(n.setProperty("--vscode-editorCodeLens-fontFamily",i),n.setProperty("--vscode-editorCodeLens-fontFamilyDefault",ch.fontFamily)),this._editor.changeViewZones(r=>{for(let a of this._lenses)a.updateHeight(e,r)})}_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();let e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;let t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&Bo(()=>{let o=this._codeLensCache.get(e);t===o&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(let o of this._languageFeaturesService.codeLensProvider.all(e))if(typeof o.onDidChange=="function"){let n=o.onDidChange(()=>i.schedule());this._localToDispose.add(n)}let i=new De(()=>{var o;let n=Date.now();(o=this._getCodeLensModelPromise)===null||o===void 0||o.cancel(),this._getCodeLensModelPromise=Se(r=>U_(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);let a=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},ee)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(xe(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var o;this._editor.changeDecorations(n=>{this._editor.changeViewZones(r=>{let a=[],l=-1;this._lenses.forEach(c=>{!c.isValid()||l===c.getLineNumber()?a.push(c):(c.update(r),l=c.getLineNumber())});let d=new Js;a.forEach(c=>{c.dispose(d,r),this._lenses.splice(this._lenses.indexOf(c),1)}),d.commit(n)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(o=this._resolveCodeLensesPromise)===null||o===void 0||o.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(o=>{o.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(xe(()=>{if(this._editor.getModel()){let o=bo.capture(this._editor);this._editor.changeDecorations(n=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(n,r)})}),o.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(o=>{if(o.target.type!==9)return;let n=o.target.element;if(n?.tagName==="SPAN"&&(n=n.parentElement),n?.tagName==="A")for(let r of this._lenses){let a=r.getCommand(n);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){let i=new Js;for(let o of this._lenses)o.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=[],o;for(let a of e.lenses){let l=a.symbol.range.startLineNumber;l<1||l>t||(o&&o[o.length-1].symbol.range.startLineNumber===l?o.push(a):(o=[a],i.push(o)))}if(!i.length&&!this._lenses.length)return;let n=bo.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{let d=new Js,c=0,u=0;for(;u<i.length&&c<this._lenses.length;){let g=i[u][0].symbol.range.startLineNumber,p=this._lenses[c].getLineNumber();p<g?(this._lenses[c].dispose(d,l),this._lenses.splice(c,1)):p===g?(this._lenses[c].updateCodeLensSymbols(i[u],d),u++,c++):(this._lenses.splice(c,0,new Gl(i[u],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),c++,u++)}for(;c<this._lenses.length;)this._lenses[c].dispose(d,l),this._lenses.splice(c,1);for(;u<i.length;)this._lenses.push(new Gl(i[u],this._editor,d,l,r.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),u++;d.commit(a)})}),n.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;let t=this._editor.getModel();if(!t)return;let i=[],o=[];if(this._lenses.forEach(a=>{let l=a.computeIfNecessary(t);l&&(i.push(l),o.push(a))}),i.length===0)return;let n=Date.now(),r=Se(a=>{let l=i.map((d,c)=>{let u=new Array(d.length),g=d.map((p,m)=>!p.symbol.command&&typeof p.provider.resolveCodeLens=="function"?Promise.resolve(p.provider.resolveCodeLens(t,p.symbol,a)).then(f=>{u[m]=f},pe):(u[m]=p.symbol,Promise.resolve(void 0)));return Promise.all(g).then(()=>{!a.isCancellationRequested&&!o[c].isDisposed()&&o[c].updateCommands(u)})});return Promise.all(l)});this._resolveCodeLensesPromise=r,this._resolveCodeLensesPromise.then(()=>{let a=this._resolveCodeLensesDebounce.update(t,Date.now()-n);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{ee(a),r===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};ea.ID="css.editor.codeLens";ea=BN([$l(1,N),$l(2,rt),$l(3,Ne),$l(4,He),$l(5,K_)],ea);W(ea.ID,ea,1);w(class extends k{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:_.hasCodeLensProvider,label:h("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;let i=e.get(Ot),o=e.get(Ne),n=e.get(He),r=t.getSelection().positionLineNumber,a=t.getContribution(ea.ID);if(!a)return;let l=await a.getModel();if(!l)return;let d=[];for(let g of l.lenses)g.symbol.command&&g.symbol.range.startLineNumber===r&&d.push({label:g.symbol.command.title,command:g.symbol.command});if(d.length===0)return;let c=await i.pick(d,{canPickMany:!1,placeHolder:h("placeHolder","Select a command")});if(!c)return;let u=c.command;if(l.isDisposed){let g=await a.getModel(),p=g?.lenses.find(m=>{var f;return m.symbol.range.startLineNumber===r&&((f=m.symbol.command)===null||f===void 0?void 0:f.title)===u.title});if(!p||!p.symbol.command)return;u=p.symbol.command}try{await o.executeCommand(u.id,...u.arguments||[])}catch(g){n.error(g)}}});E();Z();q();fe();ho();me();Ie();E();Ao();Be();Z();q();mt();Te();me();pt();q();Ri();Ue();ho();Ri();It();E();var VN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},G_=function(s,e){return function(t,i){e(t,i,s)}},Hr=class{constructor(e,t){this._editorWorkerClient=new lI(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){let o=t.range,n=t.color,r=n.alpha,a=new ie(new ji(Math.round(255*n.red),Math.round(255*n.green),Math.round(255*n.blue),r)),l=r?ie.Format.CSS.formatRGB(a):ie.Format.CSS.formatRGBA(a),d=r?ie.Format.CSS.formatHSL(a):ie.Format.CSS.formatHSLA(a),c=r?ie.Format.CSS.formatHex(a):ie.Format.CSS.formatHexA(a),u=[];return u.push({label:l,textEdit:{range:o,text:l}}),u.push({label:d,textEdit:{range:o,text:d}}),u.push({label:c,textEdit:{range:o,text:c}}),u}},$_=class extends I{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new Hr(e,t)))}};$_=VN([G_(0,ze),G_(1,he),G_(2,N)],$_);Hn($_);at();async function $u(s,e,t,i=!0){return J_(new Y_,s,e,t,i)}function X_(s,e,t,i){return Promise.resolve(t.provideColorPresentations(s,e,i))}var Y_=class{constructor(){}async compute(e,t,i,o){let n=await e.provideDocumentColors(t,i);if(Array.isArray(n))for(let r of n)o.push({colorInfo:r,provider:e});return Array.isArray(n)}},Z_=class{constructor(){}async compute(e,t,i,o){let n=await e.provideDocumentColors(t,i);if(Array.isArray(n))for(let r of n)o.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(n)}},Q_=class{constructor(e){this.colorInfo=e}async compute(e,t,i,o){let n=await e.provideColorPresentations(t,this.colorInfo,Y.None);return Array.isArray(n)&&o.push(...n),Array.isArray(n)}};async function J_(s,e,t,i,o){let n=!1,r,a=[],l=e.ordered(t);for(let d=l.length-1;d>=0;d--){let c=l[d];if(c instanceof Hr)r=c;else try{await s.compute(c,t,i,a)&&(n=!0)}catch(u){pe(u)}}return n?a:r&&o?(await s.compute(r,t,i,a),a):[]}function GL(s,e){let{colorProvider:t}=s.get(N),i=s.get(ze).getModel(e);if(!i)throw bi();let o=s.get(se).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:o}}ae.registerCommand("_executeDocumentColorProvider",function(s,...e){let[t]=e;if(!(t instanceof ne))throw bi();let{model:i,colorProviderRegistry:o,isDefaultColorDecoratorsEnabled:n}=GL(s,t);return J_(new Z_,o,i,Y.None,n)});ae.registerCommand("_executeColorPresentationProvider",function(s,...e){let[t,i]=e,{uri:o,range:n}=i;if(!(o instanceof ne)||!Array.isArray(t)||t.length!==4||!b.isIRange(n))throw bi();let{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=GL(s,o),[d,c,u,g]=t;return J_(new Q_({range:n,color:{red:d,green:c,blue:u,alpha:g}}),a,r,Y.None,l)});at();var UN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},ev=function(s,e){return function(t,i){e(t,i,s)}},tv,ov=Object.create({}),an=tv=class extends I{constructor(e,t,i,o){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new L),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new zh(this._editor),this._decoratorLimitReporter=new iv,this._colorDecorationClassRefs=this._register(new L),this._debounceInformation=o.for(i.colorProvider,"Document Colors",{min:tv.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(n=>{let r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);let a=r!==this._isColorDecoratorsEnabled||n.hasChanged(21),l=n.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){let e=this._editor.getModel();if(!e)return!1;let t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){let o=i.colorDecorators;if(o&&o.enable!==void 0&&!o.enable)return o.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;let e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new ao,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Se(async e=>{let t=this._editor.getModel();if(!t)return[];let i=new st(!1),o=await $u(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),o});try{let e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){ee(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){let t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:te.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((o,n)=>this._colorDatas.set(o,e[n]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();let t=[],i=this._editor.getOption(21);for(let n=0;n<e.length&&t.length<i;n++){let{red:r,green:a,blue:l,alpha:d}=e[n].colorInfo.color,c=new ji(Math.round(r*255),Math.round(a*255),Math.round(l*255),d),u=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,g=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:u}));t.push({range:{startLineNumber:e[n].colorInfo.range.startLineNumber,startColumn:e[n].colorInfo.range.startColumn,endLineNumber:e[n].colorInfo.range.endLineNumber,endColumn:e[n].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:fh,inlineClassName:`${g.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:ov}}})}let o=i<e.length?i:!1;this._decoratorLimitReporter.update(e.length,o),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){let t=this._editor.getModel();if(!t)return null;let i=t.getDecorationsInRange(b.fromPositions(e,e)).filter(o=>this._colorDatas.has(o.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};an.ID="editor.contrib.colorDetector";an.RECOMPUTE_TIME=1e3;an=tv=UN([ev(1,se),ev(2,N),ev(3,rt)],an);var iv=class{constructor(){this._onDidChange=new K,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}};W(an.ID,an,1);fe();Te();ho();E();q();Ie();var Yu=class{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new K,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new K,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new K,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let o=0;o<this.colorPresentations.length;o++)if(t.toLowerCase()===this.colorPresentations[o].label){i=o;break}if(i===-1){let o=t.split("(")[0].toLowerCase();for(let n=0;n<this.colorPresentations.length;n++)if(this.colorPresentations[n].label.toLowerCase().startsWith(o)){i=n;break}}i!==-1&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}};Ex();de();Nt();ho();Ie();E();ti();F();Lt();var mi=P,nv=class extends I{constructor(e,t,i,o=!1){super(),this.model=t,this.showingStandaloneColorPicker=o,this._closeButton=null,this._domNode=mi(".colorpicker-header"),T(e,this._domNode),this._pickedColorNode=T(this._domNode,mi(".picked-color")),T(this._pickedColorNode,mi("span.codicon.codicon-color-mode")),this._pickedColorPresentation=T(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");let n=h("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",n),this._originalColorNode=T(this._domNode,mi(".original-color")),this._originalColorNode.style.backgroundColor=ie.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(Mf)||ie.white,this._register(i.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor(Mf)||ie.white})),this._register(ce(this._pickedColorNode,Pe.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ce(this._originalColorNode,Pe.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=ie.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new rv(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=ie.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}},rv=class extends I{constructor(e){super(),this._onClicked=this._register(new K),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),T(e,this._button);let t=document.createElement("div");t.classList.add("close-button-inner-div"),T(this._button,t),T(t,mi(".button"+le.asCSSSelector(Ve("color-picker-close",$.close,h("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}},sv=class extends I{constructor(e,t,i,o=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=mi(".colorpicker-body"),T(e,this._domNode),this._saturationBox=new av(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new lv(this._domNode,this.model,o),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new dv(this._domNode,this.model,o),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),o&&(this._insertButton=this._register(new cv(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){let i=this.model.color.hsva;this.model.color=new ie(new pl(i.h,e,t,i.a))}onDidOpacityChange(e){let t=this.model.color.hsva;this.model.color=new ie(new pl(t.h,t.s,t.v,e))}onDidHueChange(e){let t=this.model.color.hsva,i=(1-e)*360;this.model.color=new ie(new pl(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}},av=class extends I{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new K,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new K,this.onColorFlushed=this._onColorFlushed.event,this._domNode=mi(".saturation-wrap"),T(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",T(this._domNode,this._canvas),this.selection=mi(".saturation-selection"),T(this._domNode,this.selection),this.layout(),this._register(ce(this._domNode,Pe.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new Df);let t=et(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangePosition(o.pageX-t.left,o.pageY-t.top),()=>null);let i=ce(e.target.ownerDocument,Pe.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){let i=Math.max(0,Math.min(1,e/this.width)),o=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,o),this._onDidChange.fire({s:i,v:o})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();let e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){let e=this.model.color.hsva,t=new ie(new pl(e.h,1,1,1)),i=this._canvas.getContext("2d"),o=i.createLinearGradient(0,0,this._canvas.width,0);o.addColorStop(0,"rgba(255, 255, 255, 1)"),o.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),o.addColorStop(1,"rgba(255, 255, 255, 0)");let n=i.createLinearGradient(0,0,0,this._canvas.height);n.addColorStop(0,"rgba(0, 0, 0, 0)"),n.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=ie.Format.CSS.format(t),i.fill(),i.fillStyle=o,i.fill(),i.fillStyle=n,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();let t=e.hsva;this.paintSelection(t.s,t.v)}},Zu=class extends I{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new K,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new K,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=T(e,mi(".standalone-strip")),this.overlay=T(this.domNode,mi(".standalone-overlay"))):(this.domNode=T(e,mi(".strip")),this.overlay=T(this.domNode,mi(".overlay"))),this.slider=T(this.domNode,mi(".slider")),this.slider.style.top="0px",this._register(ce(this.domNode,Pe.POINTER_DOWN,o=>this.onPointerDown(o))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;let e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){let t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._register(new Df),i=et(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,n=>this.onDidChangeTop(n.pageY-i.top),()=>null);let o=ce(e.target.ownerDocument,Pe.POINTER_UP,()=>{this._onColorFlushed.fire(),o.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){let t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}},lv=class extends Zu{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);let{r:t,g:i,b:o}=e.rgba,n=new ie(new ji(t,i,o,1)),r=new ie(new ji(t,i,o,0));this.overlay.style.background=`linear-gradient(to bottom, ${n} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}},dv=class extends Zu{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}},cv=class extends I{constructor(e){super(),this._onClicked=this._register(new K),this.onClicked=this._onClicked.event,this._button=T(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}},Qu=class extends $o{constructor(e,t,i,o,n=!1){super(),this.model=t,this.pixelRatio=i,this._register(Mx.onDidChange(()=>this.layout()));let r=mi(".colorpicker-widget");e.appendChild(r),this.header=this._register(new nv(r,this.model,o,n)),this.body=this._register(new sv(r,this.model,this.pixelRatio,n))}layout(){this.body.layout()}};Dt();de();var $L=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},YL=function(s,e){return function(t,i){e(t,i,s)}},hv=class{constructor(e,t,i,o){this.owner=e,this.range=t,this.model=i,this.provider=o,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}},Yl=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return Zt.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];let o=an.get(this._editor);if(!o)return[];for(let n of t){if(!o.isColorDecoration(n))continue;let r=o.getColorData(n.range.getStartPosition());if(r)return[await ZL(this,this._editor.getModel(),r.colorInfo,r.provider)]}return[]}renderHoverParts(e,t){return QL(this,this._editor,this._themeService,t,e)}};Yl=$L([YL(1,dt)],Yl);var uv=class{constructor(e,t,i,o){this.owner=e,this.range=t,this.model=i,this.provider=o}},ta=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,i){if(!this._editor.hasModel()||!an.get(this._editor))return null;let n=await $u(i,this._editor.getModel(),Y.None),r=null,a=null;for(let u of n){let g=u.colorInfo;b.containsRange(g.range,e.range)&&(r=g,a=u.provider)}let l=r??e,d=a??t,c=!!r;return{colorHover:await ZL(this,this._editor.getModel(),l,d),foundInEditor:c}}async updateEditorModel(e){if(!this._editor.hasModel())return;let t=e.model,i=new b(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await Xu(this._editor.getModel(),t,this._color,i,e),i=XL(this._editor,i,t))}renderHoverParts(e,t){return QL(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};ta=$L([YL(1,dt)],ta);async function ZL(s,e,t,i){let o=e.getValueInRange(t.range),{red:n,green:r,blue:a,alpha:l}=t.color,d=new ji(Math.round(n*255),Math.round(r*255),Math.round(a*255),l),c=new ie(d),u=await X_(e,t,i,Y.None),g=new Yu(c,[],0);return g.colorPresentations=u||[],g.guessColorPresentation(c,o),s instanceof Yl?new hv(s,b.lift(t.range),g,i):new uv(s,b.lift(t.range),g,i)}function QL(s,e,t,i,o){if(i.length===0||!e.hasModel())return I.None;if(o.setMinimumDimensions){let g=e.getOption(66)+8;o.setMinimumDimensions(new be(302,g))}let n=new L,r=i[0],a=e.getModel(),l=r.model,d=n.add(new Qu(o.fragment,l,e.getOption(141),t,s instanceof ta));o.setColorPicker(d);let c=!1,u=new b(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(s instanceof ta){let g=i[0].model.color;s.color=g,Xu(a,l,g,u,r),n.add(l.onColorFlushed(p=>{s.color=p}))}else n.add(l.onColorFlushed(async g=>{await Xu(a,l,g,u,r),c=!0,u=XL(e,u,l,o)}));return n.add(l.onDidChangeColor(g=>{Xu(a,l,g,u,r)})),n.add(e.onDidChangeModelContent(g=>{c?c=!1:(o.hide(),e.focus())})),n}function XL(s,e,t,i){let o,n;if(t.presentation.textEdit){o=[t.presentation.textEdit],n=new b(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);let r=s.getModel()._setTrackedRange(null,n,3);s.pushUndoStop(),s.executeEdits("colorpicker",o),n=s.getModel()._getTrackedRange(r)||n}else o=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],n=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),s.pushUndoStop(),s.executeEdits("colorpicker",o);return t.presentation.additionalTextEdits&&(o=[...t.presentation.additionalTextEdits],s.executeEdits("colorpicker",o),i&&i.hide()),s.pushUndoStop(),n}async function Xu(s,e,t,i,o){let n=await X_(s,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},o.provider,Y.None);e.colorPresentations=n||[]}Fo();E();Z();q();we();Ti();fe();me();E();Tr();Z();q();Ti();ro();Ie();E();$t();function gv(s,e){return!!s[e]}var Zl=class{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=gv(e.event,t.triggerModifier),this.hasSideBySideModifier=gv(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}},Ju=class{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=gv(e,t.triggerModifier)}},ia=class{constructor(e,t,i,o){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=o}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}};function JL(s){return s==="altKey"?Gt?new ia(57,"metaKey",6,"altKey"):new ia(5,"ctrlKey",6,"altKey"):Gt?new ia(6,"altKey",57,"metaKey"):new ia(6,"altKey",5,"ctrlKey")}var wo=class extends I{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new K),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new K),this.onExecute=this._onExecute.event,this._onCancel=this._register(new K),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t?.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:o=>o.target.position?o.target.position.lineNumber:0,this._opts=JL(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(o=>{if(o.hasChanged(77)){let n=JL(this._editor.getOption(77));if(this._opts.equals(n))return;this._opts=n,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(o=>this._onEditorMouseMove(new Zl(o,this._opts)))),this._register(this._editor.onMouseDown(o=>this._onEditorMouseDown(new Zl(o,this._opts)))),this._register(this._editor.onMouseUp(o=>this._onEditorMouseUp(new Zl(o,this._opts)))),this._register(this._editor.onKeyDown(o=>this._onEditorKeyDown(new Ju(o,this._opts)))),this._register(this._editor.onKeyUp(o=>this._onEditorKeyUp(new Ju(o,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(o=>this._onDidChangeCursorSelection(o))),this._register(this._editor.onDidChangeModel(o=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(o=>{(o.scrollTopChanged||o.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){let t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}};de();Ns();Nt();ti();ho();Ie();rf();Z();Rt();rf();Rt();It();Ue();re();ge();Dt();var jN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},ln=function(s,e){return function(t,i){e(t,i,s)}},xi=class extends h0{constructor(e,t,i,o,n,r,a,l,d,c,u,g,p){super(e,{...o.getRawOptions(),overflowWidgetsDomNode:o.getOverflowWidgetsDomNode()},i,n,r,a,l,d,c,u,g,p),this._parentEditor=o,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(o.onDidChangeConfiguration(m=>this._onParentConfigurationChanged(m)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){ws(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};xi=jN([ln(4,B),ln(5,_e),ln(6,Ne),ln(7,G),ln(8,dt),ln(9,He),ln(10,As),ln(11,he),ln(12,N)],xi);de();ho();E();rf();q();mt();var tD=new ie(new ji(0,122,204)),KN={showArrow:!0,showFrame:!0,className:"",frameColor:tD,arrowColor:tD,keepEditorSelection:!1},qN="vs.editor.contrib.zoneWidget",pv=class{constructor(e,t,i,o,n,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=o,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=n,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}},mv=class{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}},eg=class s{constructor(e){this._editor=e,this._ruleName=s._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),vf(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){vf(this._ruleName),Yx(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:b.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}};eg._IdGenerator=new T0(".arrow-decoration-");var tg=class{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new L,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=ox(t),ws(this.options,KN,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{let o=this._getWidth(i);this.domNode.style.width=o+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(o)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new eg(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){let e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){let e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){let i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;let o=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(o))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){let e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){let i=b.isIRange(e)?b.lift(e):b.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:te.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){let e=this.editor.getOption(66),t=0;if(this.options.showArrow){let i=Math.round(e/3);t+=2*i}if(this.options.showFrame){let i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){let i=e.getStartPosition(),o=this.editor.getLayoutInfo(),n=this._getWidth(o);this.domNode.style.width=`${n}px`,this.domNode.style.left=this._getLeft(o)+"px";let r=document.createElement("div");r.style.overflow="hidden";let a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){let g=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,g)}let l=0,d=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(g=>{this._viewZone&&g.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new pv(r,i.lineNumber,i.column,t,p=>this._onViewZoneTop(p),p=>this._onViewZoneHeight(p),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=g.addZone(this._viewZone),this._overlayWidget=new mv(qN+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){let g=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=g+"px",this.container.style.borderBottomWidth=g+"px"}let c=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=c+"px",this.container.style.overflow="hidden"),this._doLayout(c,n),this.options.keepEditorSelection||this.editor.setSelection(e);let u=this.editor.getModel();if(u){let g=u.validateRange(new b(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(g,g.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new on(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){let i=(t.currentY-e.startY)/this.editor.getOption(66),o=i<0?Math.ceil(i):Math.floor(i),n=e.heightInLines+o;n>5&&n<35&&this._relayout(n)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){let e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}};F();re();Uo();ge();Lt();var iD=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},oD=function(s,e){return function(t,i){e(t,i,s)}},fv=Et("IPeekViewService");Pt(fv,class{constructor(){this._widgets=new Map}addExclusiveWidget(s,e){let t=this._widgets.get(s);t&&(t.listener.dispose(),t.widget.dispose());let i=()=>{let o=this._widgets.get(s);o&&o.widget===e&&(o.listener.dispose(),this._widgets.delete(s))};this._widgets.set(s,{widget:e,listener:e.onDidClose(i)})}},1);var vt;(function(s){s.inPeekEditor=new X("inReferenceSearchEditor",!0,h("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),s.notInPeekEditor=s.inPeekEditor.toNegated()})(vt||(vt={}));var Ql=class{constructor(e,t){e instanceof xi&&vt.inPeekEditor.bindTo(t)}dispose(){}};Ql.ID="editor.contrib.referenceController";Ql=iD([oD(1,G)],Ql);W(Ql.ID,Ql,0);function nD(s){let e=s.get(_e).getFocusedCodeEditor();return e instanceof xi?e.getParentEditor():e}var GN={headerBackgroundColor:ie.white,primaryHeadingColor:ie.fromHex("#333333"),secondaryHeadingColor:ie.fromHex("#6c6c6cb3")},oa=class extends tg{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new K,this.onDidClose=this._onDidClose.event,ws(this.options,GN,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){let t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();let e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=P(".head"),this._bodyElement=P(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=P(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),wi(this._titleElement,"click",n=>this._onTitleClick(n))),T(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=P("span.filename"),this._secondaryHeading=P("span.dirname"),this._metaHeading=P("span.meta"),T(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);let i=P(".peekview-actions");T(this._headElement,i);let o=this._getActionBarOptions();this._actionbarWidget=new en(i,o),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new so("peekview.close",h("label.close","Close"),le.asClassName($.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:W0.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:ii(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Bt(this._metaHeading)):xt(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}let i=Math.ceil(this.editor.getOption(66)*1.2),o=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(o,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};oa=iD([oD(2,B)],oa);var rD=z("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:ie.black,hcLight:ie.white},h("peekViewTitleBackground","Background color of the peek view title area.")),ig=z("peekViewTitleLabel.foreground",{dark:ie.white,light:ie.black,hcDark:ie.white,hcLight:po},h("peekViewTitleForeground","Color of the peek view title.")),og=z("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},h("peekViewTitleInfoForeground","Color of the peek view title info.")),sD=z("peekView.border",{dark:vl,light:vl,hcDark:Oi,hcLight:Oi},h("peekViewBorder","Color of the peek view borders and arrow.")),aD=z("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:ie.black,hcLight:ie.white},h("peekViewResultsBackground","Background color of the peek view result list.")),$2=z("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:ie.white,hcLight:po},h("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list.")),Y2=z("peekViewResult.fileForeground",{dark:ie.white,light:"#1E1E1E",hcDark:ie.white,hcLight:po},h("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list.")),Z2=z("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},h("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list.")),Q2=z("peekViewResult.selectionForeground",{dark:ie.white,light:"#6C6C6C",hcDark:ie.white,hcLight:po},h("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list.")),qn=z("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:ie.black,hcLight:ie.white},h("peekViewEditorBackground","Background color of the peek view editor.")),X2=z("peekViewEditorGutter.background",{dark:qn,light:qn,hcDark:qn,hcLight:qn},h("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor.")),J2=z("peekViewEditorStickyScroll.background",{dark:qn,light:qn,hcDark:qn,hcLight:qn},h("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor.")),eB=z("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},h("peekViewResultsMatchHighlight","Match highlight color in the peek view result list.")),tB=z("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},h("peekViewEditorMatchHighlight","Match highlight color in the peek view editor.")),iB=z("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:go,hcLight:go},h("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));F();re();fe();Fo();St();pt();Tr();Z();Rt();ke();q();we();Ht();fe();me();Fo();E();Rt();ke();q();F();Ue();at();re();ge();ff();me();Ie();E();yi();Be();q();F();var Ii=class{constructor(e,t,i,o){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=o,this.id=P0.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;let t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?h({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,Xt(this.uri),this.range.startLineNumber,this.range.startColumn):h("aria.oneReference","in {0} on line {1} at column {2}",Xt(this.uri),this.range.startLineNumber,this.range.startColumn)}},_v=class{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){let i=this._modelReference.object.textEditorModel;if(!i)return;let{startLineNumber:o,startColumn:n,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:o,column:n-t}),d=new b(o,l.startColumn,o,n),c=new b(r,a,r,1073741824),u=i.getValueInRange(d).replace(/^\s+/,""),g=i.getValueInRange(e),p=i.getValueInRange(c).replace(/\s+$/,"");return{value:u+g+p,highlight:{start:u.length,end:u.length+g.length}}}},dn=class{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Pi}dispose(){$e(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){let e=this.children.length;return e===1?h("aria.fileReferences.1","1 symbol in {0}, full path {1}",Xt(this.uri),this.uri.fsPath):h("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Xt(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(let t of this.children)if(!this._previews.has(t.uri))try{let i=await e.createModelReference(t.uri);this._previews.set(t.uri,new _v(i))}catch(i){ee(i)}return this}},Jt=class s{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new K,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;let[i]=e;e.sort(s._compareReferences);let o;for(let n of e)if((!o||!Pf.isEqual(o.uri,n.uri,!0))&&(o=new dn(this,n.uri),this.groups.push(o)),o.children.length===0||s._compareReferences(n,o.children[o.children.length-1])!==0){let r=new Ii(i===n,o,n,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),o.children.push(r)}}dispose(){$e(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new s(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?h("aria.result.0","No results found"):this.references.length===1?h("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?h("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):h("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){let{parent:i}=e,o=i.children.indexOf(e),n=i.children.length,r=i.parent.groups.length;return r===1||t&&o+1<n||!t&&o>0?(t?o=(o+1)%n:o=(o+n-1)%n,i.children[o]):(o=i.parent.groups.indexOf(i),t?(o=(o+1)%r,i.parent.groups[o].children[0]):(o=(o+r-1)%r,i.parent.groups[o].children[i.parent.groups[o].children.length-1]))}nearestReference(e,t){let i=this.references.map((o,n)=>({idx:n,prefixLen:Mn(o.uri.toString(),e.toString()),offsetDist:Math.abs(o.range.startLineNumber-t.lineNumber)*100+Math.abs(o.range.startColumn-t.column)})).sort((o,n)=>o.prefixLen>n.prefixLen?-1:o.prefixLen<n.prefixLen?1:o.offsetDist<n.offsetDist?-1:o.offsetDist>n.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(let i of this.references)if(i.uri.toString()===e.toString()&&b.containsPosition(i.range,t))return i}firstReference(){for(let e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Pf.compare(e.uri,t.uri)||b.compareRangesUsingStarts(e.range,t.range)}};de();ho();Ie();E();Rs();yi();q();mt();It();yf();Ti();ro();de();E();yi();ro();F();ge();var dg=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},cg=function(s,e){return function(t,i){e(t,i,s)}},vv,ng=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Jt||e instanceof dn}getChildren(e){if(e instanceof Jt)return e.groups;if(e instanceof dn)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};ng=dg([cg(0,gt)],ng);var rg=class{getHeight(){return 23}getTemplateId(e){return e instanceof dn?na.id:ra.id}},sg=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Ii){let i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Xt(e.uri)}};sg=dg([cg(0,Ce)],sg);var ag=class{getId(e){return e instanceof Ii?e.id:e.uri}},bv=class extends I{constructor(e,t){super(),this._labelService=t;let i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new du(i,{supportHighlights:!0})),this.badge=new $0(T(i,P(".count")),{},O0),e.appendChild(i)}set(e,t){let i=Vs(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});let o=e.children.length;this.badge.setCount(o),o>1?this.badge.setTitleFormat(h("referencesCount","{0} references",o)):this.badge.setTitleFormat(h("referenceCount","{0} reference",o))}};bv=dg([cg(1,Zo)],bv);var na=vv=class{constructor(e){this._instantiationService=e,this.templateId=vv.id}renderTemplate(e){return this._instantiationService.createInstance(bv,e)}renderElement(e,t,i){i.set(e.element,Rr(e.filterData))}disposeTemplate(e){e.dispose()}};na.id="FileReferencesRenderer";na=vv=dg([cg(0,B)],na);var Cv=class{constructor(e){this.label=new Y0(e)}set(e,t){var i;let o=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!o||!o.value)this.label.set(`${Xt(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{let{value:n,highlight:r}=o;t&&!Jo.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(n,Rr(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(n,[r]))}}},ra=class s{constructor(){this.templateId=s.id}renderTemplate(e){return new Cv(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}};ra.id="OneReferenceRenderer";var lg=class{getWidgetAriaLabel(){return h("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}};F();ge();Dt();FM();var YN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},cn=function(s,e){return function(t,i){e(t,i,s)}},hg=class s{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new L,this._callOnModelChange=new L,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();let e=this._editor.getModel();if(e){for(let t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));let t=[],i=[];for(let o=0,n=e.children.length;o<n;o++){let r=e.children[o];this._decorationIgnoreSet.has(r.id)||r.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:r.range,options:s.DecorationOptions}),i.push(o))}this._editor.changeDecorations(o=>{let n=o.deltaDecorations([],t);for(let r=0;r<n.length;r++)this._decorations.set(n[r],e.children[i[r]])})}_onDecorationChanged(){let e=[],t=this._editor.getModel();if(t){for(let[i,o]of this._decorations){let n=t.getDecorationRange(i);if(!n)continue;let r=!1;if(!b.equalsRange(n,o.range)){if(b.spansMultipleLines(n))r=!0;else{let a=o.range.endColumn-o.range.startColumn,l=n.endColumn-n.startColumn;a!==l&&(r=!0)}r?(this._decorationIgnoreSet.add(o.id),e.push(i)):o.range=n}}for(let i=0,o=e.length;i<o;i++)this._decorations.delete(e[i]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}};hg.DecorationOptions=te.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});var ug=class{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{let o=JSON.parse(e);t=o.ratio,i=o.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}},Sv=class extends K0{},gg=class extends oa{constructor(e,t,i,o,n,r,a,l,d,c,u,g){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=n,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._undoRedoService=d,this._keybindingService=c,this._languageService=u,this._languageConfigurationService=g,this._disposeOnNewModel=new L,this._callOnDispose=new L,this._onDidSelectReference=new K,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new be(0,0),this._applyTheme(o.getColorTheme()),this._callOnDispose.add(o.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),$e(this._preview),$e(this._previewNotAvailableMessage),$e(this._tree),$e(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){let t=e.getColor(sD)||ie.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(rD)||ie.transparent,primaryHeadingColor:e.getColor(ig),secondaryHeadingColor:e.getColor(og)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=T(e,P("div.messages")),xt(this._messageContainer),this._splitView=new z0(e,{orientation:1}),this._previewContainer=T(e,P("div.preview.inline"));let t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(xi,this._previewContainer,t,{},this.editor),xt(this._previewContainer),this._previewNotAvailableMessage=new Of(h("missingPreviewMessage","no preview available"),Ps,Of.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=T(e,P("div.ref-tree.inline"));let i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new lg,keyboardNavigationLabelProvider:this._instantiationService.createInstance(sg),identityProvider:new ag,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:aD}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(wi(this._treeContainer,"keydown",n=>{n.equals(9)&&(this._keybindingService.dispatchEvent(n,n.target),n.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(Sv,"ReferencesWidget",this._treeContainer,new rg,[this._instantiationService.createInstance(na),this._instantiationService.createInstance(ra)],this._instantiationService.createInstance(ng),i),this._splitView.addView({onDidChange:Me.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:n=>{this._preview.layout({height:this._dim.height,width:n})}},Gf.Distribute),this._splitView.addView({onDidChange:Me.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:n=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${n}px`,this._tree.layout(this._dim.height,n)}},Gf.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));let o=(n,r)=>{n instanceof Ii&&(r==="show"&&this._revealReference(n,!1),this._onDidSelectReference.fire({element:n,kind:r,source:"tree"}))};this._tree.onDidOpen(n=>{n.sideBySide?o(n.element,"side"):n.editorOptions.pinned?o(n.element,"goto"):o(n.element,"show")}),xt(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new be(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=h("noResults","No results"),Bt(this._messageContainer),Promise.resolve(void 0)):(xt(this._messageContainer),this._decorationsManager=new hg(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{let{event:t,target:i}=e;if(t.detail!==2)return;let o=this._getFocusedReference();o&&this._onDidSelectReference.fire({element:{uri:o.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Bt(this._treeContainer),Bt(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){let[e]=this._tree.getFocus();if(e instanceof Ii)return e;if(e instanceof dn&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==yt.inMemory?this.setTitle(r0(e.uri),this._uriLabel.getUriLabel(Vs(e.uri))):this.setTitle(h("peekView.alternateTitle","References"));let i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));let o=await i;if(!this._model){o.dispose();return}$e(this._previewModelReference);let n=o.object;if(n){let r=this._preview.getModel()===n.textEditorModel?0:1,a=b.lift(e.range).collapseToStart();this._previewModelReference=o,this._preview.setModel(n.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),o.dispose()}};gg=YN([cn(3,dt),cn(4,gt),cn(5,B),cn(6,fv),cn(7,Zo),cn(8,d0),cn(9,Ce),cn(10,tt),cn(11,he)],gg);var ZN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},sa=function(s,e){return function(t,i){e(t,i,s)}},pg,Br=new X("referenceSearchVisible",!1,h("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'")),xo=pg=class{static get(e){return e.getContribution(pg.ID)}constructor(e,t,i,o,n,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=o,this._notificationService=n,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new L,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Br.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let o;if(this._widget&&(o=this._widget.position),this.closeWidget(),o&&e.containsPosition(o))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));let n="peekViewLayout",r=ug.fromJSON(this._storageService.get(n,0,"{}"));this._widget=this._instantiationService.createInstance(gg,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(h("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(n,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{let{element:d,kind:c}=l;if(d)switch(c){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(d,!1,!1);break;case"side":this.openReference(d,!0,!1);break;case"goto":i?this._gotoReference(d,!0):this.openReference(d,!1,!0);break}}));let a=++this._requestIdPool;t.then(l=>{var d;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(d=this._model)===null||d===void 0||d.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(h("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));let c=this._editor.getModel().uri,u=new R(e.startLineNumber,e.startColumn),g=this._model.nearestReference(c,u);if(g)return this._widget.setSelection(g).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;let t=this._widget.position;if(!t)return;let i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;let o=this._model.nextOrPreviousReference(i,e),n=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(o),await this._gotoReference(o,!1),n?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;let o=b.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:o,selectionSource:"code.jump",pinned:t}},this._editor).then(n=>{var r;if(this._ignoreModelChangeEvent=!1,!n||!this._widget){this.closeWidget();return}if(this._editor===n)this._widget.show(o),this._widget.focusOnReferenceTree();else{let a=pg.get(n),l=this._model.clone();this.closeWidget(),n.focus(),a?.toggleWidget(o,Se(d=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},n=>{this._ignoreModelChangeEvent=!1,ee(n)})}openReference(e,t,i){t||this.closeWidget();let{uri:o,range:n}=e;this._editorService.openCodeEditor({resource:o,options:{selection:n,selectionSource:"code.jump",pinned:i}},this._editor,t)}};xo.ID="editor.contrib.referencesController";xo=pg=ZN([sa(2,G),sa(3,_e),sa(4,He),sa(5,B),sa(6,ai),sa(7,se)],xo);function Vr(s,e){let t=nD(s);if(!t)return;let i=xo.get(t);i&&e(i)}Ci.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Ee(2089,60),when:x.or(Br,vt.inPeekEditor),handler(s){Vr(s,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Ci.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:x.or(Br,vt.inPeekEditor),handler(s){Vr(s,e=>{e.goToNextOrPreviousReference(!0)})}});Ci.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:x.or(Br,vt.inPeekEditor),handler(s){Vr(s,e=>{e.goToNextOrPreviousReference(!1)})}});ae.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");ae.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");ae.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");ae.registerCommand("closeReferenceSearch",s=>Vr(s,e=>e.closeWidget()));Ci.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:x.and(vt.inPeekEditor,x.not("config.editor.stablePeek"))});Ci.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:x.and(Br,x.not("config.editor.stablePeek"))});Ci.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:x.and(Br,Yf,Zf.negate(),Qf.negate()),handler(s){var e;let i=(e=s.get(lu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Ii&&Vr(s,o=>o.revealReference(i[0]))}});Ci.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:x.and(Br,Yf,Zf.negate(),Qf.negate()),handler(s){var e;let i=(e=s.get(lu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Ii&&Vr(s,o=>o.openReference(i[0],!0,!0))}});ae.registerCommand("openReference",s=>{var e;let i=(e=s.get(lu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Ii&&Vr(s,o=>o.openReference(i[0],!1,!0))});Ie();E();yi();Z();Rt();q();F();re();Uo();ge();ff();var lD=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Xl=function(s,e){return function(t,i){e(t,i,s)}},xv=new X("hasSymbols",!1,h("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),Jl=Et("ISymbolNavigationService"),wv=class{constructor(e,t,i,o){this._editorService=t,this._notificationService=i,this._keybindingService=o,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=xv.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){let t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();let i=new yv(this._editorService),o=i.onDidChange(n=>{if(this._ignoreEditorChange)return;let r=this._editorService.getActiveCodeEditor();if(!r)return;let a=r.getModel(),l=r.getPosition();if(!a||!l)return;let d=!1,c=!1;for(let u of t.references)if($h(u.uri,a.uri))d=!0,c=c||b.containsPosition(u.range,l);else if(d)break;(!d||!c)&&this.reset()});this._currentState=sf(i,o)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;let t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:b.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();let t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?h("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):h("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};wv=lD([Xl(0,G),Xl(1,_e),Xl(2,He),Xl(3,Ce)],wv);Pt(Jl,wv,1);H(new class extends je{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:xv,kbOpts:{weight:100,primary:70}})}runEditorCommand(s,e){return s.get(Jl).revealNext(e)}});Ci.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:xv,primary:9,handler(s){s.get(Jl).reset()}});var yv=class{constructor(e){this._listener=new Map,this._disposables=new L,this._onDidChange=new K,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),$e(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,sf(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};yv=lD([Xl(0,_e)],yv);F();Je();Ue();re();ge();Fe();Te();me();Z();async function ed(s,e,t,i){let n=t.ordered(s).map(a=>Promise.resolve(i(a,s,e)).then(void 0,l=>{pe(l)})),r=await Promise.all(n);return zt(r.flat())}function Ur(s,e,t,i){return ed(e,t,s,(o,n,r)=>o.provideDefinition(n,r,i))}function Iv(s,e,t,i){return ed(e,t,s,(o,n,r)=>o.provideDeclaration(n,r,i))}function Lv(s,e,t,i){return ed(e,t,s,(o,n,r)=>o.provideImplementation(n,r,i))}function Dv(s,e,t,i){return ed(e,t,s,(o,n,r)=>o.provideTypeDefinition(n,r,i))}function td(s,e,t,i,o){return ed(e,t,s,async(n,r,a)=>{let l=await n.provideReferences(r,a,{includeDeclaration:!0},o);if(!i||!l||l.length!==2)return l;let d=await n.provideReferences(r,a,{includeDeclaration:!1},o);return d&&d.length===1?d:l})}async function id(s){let e=await s(),t=new Jt(e,""),i=t.references.map(o=>o.link);return t.dispose(),i}ri("_executeDefinitionProvider",(s,e,t)=>{let i=s.get(N),o=Ur(i.definitionProvider,e,t,Y.None);return id(()=>o)});ri("_executeTypeDefinitionProvider",(s,e,t)=>{let i=s.get(N),o=Dv(i.typeDefinitionProvider,e,t,Y.None);return id(()=>o)});ri("_executeDeclarationProvider",(s,e,t)=>{let i=s.get(N),o=Iv(i.declarationProvider,e,t,Y.None);return id(()=>o)});ri("_executeReferenceProvider",(s,e,t)=>{let i=s.get(N),o=td(i.referenceProvider,e,t,!1,Y.None);return id(()=>o)});ri("_executeImplementationProvider",(s,e,t)=>{let i=s.get(N),o=Lv(i.implementationProvider,e,t,Y.None);return id(()=>o)});ol();var od,nd,rd,mg,fg,_g,vg,bg;Yt.appendMenuItem(O.EditorContext,{submenu:O.EditorContextPeek,title:h("peek.submenu","Peek"),group:"navigation",order:100});var jr=class s{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof s||R.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}},Fi=class s extends ni{static all(){return s._allSymbolNavigationCommands.values()}static _patchConfig(e){let t={...e,f1:!0};if(t.menu)for(let i of gi.wrap(t.menu))(i.id===O.EditorContext||i.id===O.EditorContextPeek)&&(i.when=x.and(e.precondition,i.when));return t}constructor(e,t){super(s._patchConfig(t)),this.configuration=e,s._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,o){if(!t.hasModel())return Promise.resolve(void 0);let n=e.get(He),r=e.get(_e),a=e.get(Qo),l=e.get(Jl),d=e.get(N),c=e.get(B),u=t.getModel(),g=t.getPosition(),p=jr.is(i)?i:new jr(u,g),m=new Co(t,5),f=En(this._getLocationModel(d,p.model,p.position,m.token),m.token).then(async C=>{var v;if(!C||m.token.isCancellationRequested)return;nt(C.ariaMessage);let S;if(C.referenceAt(u.uri,g)){let D=this._getAlternativeCommand(t);!s._activeAlternativeCommands.has(D)&&s._allSymbolNavigationCommands.has(D)&&(S=s._allSymbolNavigationCommands.get(D))}let y=C.references.length;if(y===0){if(!this.configuration.muteMessage){let D=u.getWordAtPosition(g);(v=kt.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(D),g)}}else if(y===1&&S)s._activeAlternativeCommands.add(this.desc.id),c.invokeFunction(D=>S.runEditorCommand(D,t,i,o).finally(()=>{s._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,C,o)},C=>{n.error(C)}).finally(()=>{m.dispose()});return a.showWhile(f,250),f}async _onResult(e,t,i,o,n){let r=this._getGoToPreference(i);if(!(i instanceof xi)&&(this.configuration.openInPeek||r==="peek"&&o.references.length>1))this._openInPeek(i,o,n);else{let a=o.firstReference(),l=o.references.length>1&&r==="gotoAndPeek",d=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&d?this._openInPeek(d,o,n):o.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,o,n){let r;if(mx(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;let a=await t.openCodeEditor({resource:i.uri,options:{selection:b.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,o);if(a){if(n){let l=a.getModel(),d=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&d.clear()},350)}return a}}_openInPeek(e,t,i){let o=xo.get(e);o&&e.hasModel()?o.toggleWidget(i??e.getSelection(),Se(n=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};Fi._allSymbolNavigationCommands=new Map;Fi._activeAlternativeCommands=new Set;var hn=class extends Fi{async _getLocationModel(e,t,i,o){return new Jt(await Ur(e.definitionProvider,t,i,o),h("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?h("noResultWord","No definition found for '{0}'",e.word):h("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}};ve((od=class extends hn{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:od.id,title:{value:h("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:h({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:x.and(_.hasDefinitionProvider,_.isInWalkThroughSnippet.toNegated()),keybinding:[{when:_.editorTextFocus,primary:70,weight:100},{when:x.and(_.editorTextFocus,$f),primary:2118,weight:100}],menu:[{id:O.EditorContext,group:"navigation",order:1.1},{id:O.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),ae.registerCommandAlias("editor.action.goToDeclaration",od.id)}},od.id="editor.action.revealDefinition",od));ve((nd=class extends hn{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:nd.id,title:{value:h("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:x.and(_.hasDefinitionProvider,_.isInWalkThroughSnippet.toNegated()),keybinding:[{when:_.editorTextFocus,primary:Ee(2089,70),weight:100},{when:x.and(_.editorTextFocus,$f),primary:Ee(2089,2118),weight:100}]}),ae.registerCommandAlias("editor.action.openDeclarationToTheSide",nd.id)}},nd.id="editor.action.revealDefinitionAside",nd));ve((rd=class extends hn{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:rd.id,title:{value:h("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:x.and(_.hasDefinitionProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),keybinding:{when:_.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:O.EditorContextPeek,group:"peek",order:2}}),ae.registerCommandAlias("editor.action.previewDeclaration",rd.id)}},rd.id="editor.action.peekDefinition",rd));var Cg=class extends Fi{async _getLocationModel(e,t,i,o){return new Jt(await Iv(e.declarationProvider,t,i,o),h("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?h("decl.noResultWord","No declaration found for '{0}'",e.word):h("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}};ve((mg=class extends Cg{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:mg.id,title:{value:h("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:h({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:x.and(_.hasDeclarationProvider,_.isInWalkThroughSnippet.toNegated()),menu:[{id:O.EditorContext,group:"navigation",order:1.3},{id:O.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?h("decl.noResultWord","No declaration found for '{0}'",e.word):h("decl.generic.noResults","No declaration found")}},mg.id="editor.action.revealDeclaration",mg));ve(class extends Cg{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:h("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:x.and(_.hasDeclarationProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),menu:{id:O.EditorContextPeek,group:"peek",order:3}})}});var Sg=class extends Fi{async _getLocationModel(e,t,i,o){return new Jt(await Dv(e.typeDefinitionProvider,t,i,o),h("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?h("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):h("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}};ve((fg=class extends Sg{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:fg.ID,title:{value:h("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:h({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:x.and(_.hasTypeDefinitionProvider,_.isInWalkThroughSnippet.toNegated()),keybinding:{when:_.editorTextFocus,primary:0,weight:100},menu:[{id:O.EditorContext,group:"navigation",order:1.4},{id:O.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},fg.ID="editor.action.goToTypeDefinition",fg));ve((_g=class extends Sg{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:_g.ID,title:{value:h("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:x.and(_.hasTypeDefinitionProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),menu:{id:O.EditorContextPeek,group:"peek",order:4}})}},_g.ID="editor.action.peekTypeDefinition",_g));var wg=class extends Fi{async _getLocationModel(e,t,i,o){return new Jt(await Lv(e.implementationProvider,t,i,o),h("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?h("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):h("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}};ve((vg=class extends wg{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:vg.ID,title:{value:h("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:h({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:x.and(_.hasImplementationProvider,_.isInWalkThroughSnippet.toNegated()),keybinding:{when:_.editorTextFocus,primary:2118,weight:100},menu:[{id:O.EditorContext,group:"navigation",order:1.45},{id:O.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},vg.ID="editor.action.goToImplementation",vg));ve((bg=class extends wg{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:bg.ID,title:{value:h("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:x.and(_.hasImplementationProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),keybinding:{when:_.editorTextFocus,primary:3142,weight:100},menu:{id:O.EditorContextPeek,group:"peek",order:5}})}},bg.ID="editor.action.peekImplementation",bg));var yg=class extends Fi{_getNoResultFoundMessage(e){return e?h("references.no","No references found for '{0}'",e.word):h("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}};ve(class extends yg{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:h("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:h({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:x.and(_.hasReferenceProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),keybinding:{when:_.editorTextFocus,primary:1094,weight:100},menu:[{id:O.EditorContext,group:"navigation",order:1.45},{id:O.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,o){return new Jt(await td(e.referenceProvider,t,i,!0,o),h("ref.title","References"))}});ve(class extends yg{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:h("references.action.label","Peek References"),original:"Peek References"},precondition:x.and(_.hasReferenceProvider,vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated()),menu:{id:O.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,o){return new Jt(await td(e.referenceProvider,t,i,!1,o),h("ref.title","References"))}});var kv=class extends Fi{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:h("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:x.and(vt.notInPeekEditor,_.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,o){return new Jt(this._references,h("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&h("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}};ae.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:ne},{name:"position",description:"The position at which to start",constraint:R.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(s,e,t,i,o,n,r)=>{ue(ne.isUri(e)),ue(R.isIPosition(t)),ue(Array.isArray(i)),ue(typeof o>"u"||typeof o=="string"),ue(typeof r>"u"||typeof r=="boolean");let a=s.get(_e),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(t_(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(d=>{let c=new class extends kv{_getNoResultFoundMessage(u){return n||super._getNoResultFoundMessage(u)}}({muteMessage:!n,openInPeek:!!r,openToSide:!1},i,o);d.get(B).invokeFunction(c.run.bind(c),l)})}});ae.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:ne},{name:"position",description:"The position at which to start",constraint:R.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:async(s,e,t,i,o)=>{s.get(Ne).executeCommand("editor.action.goToLocations",e,t,i,o,void 0,!0)}});ae.registerCommand({id:"editor.action.findReferences",handler:(s,e,t)=>{ue(ne.isUri(e)),ue(R.isIPosition(t));let i=s.get(N),o=s.get(_e);return o.openCodeEditor({resource:e},o.getFocusedCodeEditor()).then(n=>{if(!t_(n)||!n.hasModel())return;let r=xo.get(n);if(!r)return;let a=Se(d=>td(i.referenceProvider,n.getModel(),R.lift(t),!1,d).then(c=>new Jt(c,h("ref.title","References")))),l=new b(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});ae.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");mt();var QN=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Mv=function(s,e){return function(t,i){e(t,i,s)}},sd,Gn=sd=class{constructor(e,t,i,o){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=o,this.toUnhook=new L,this.toUnhookForKeyboard=new L,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();let n=new wo(e);this.toUnhook.add(n),this.toUnhook.add(n.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(n.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{ee(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(n.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(sd.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}let i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();let i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;let o=new mu(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Se(a=>this.findDefinition(e,a));let n;try{n=await this.previousPromise}catch(a){ee(a);return}if(!n||!n.length||!o.validate(this.editor)){this.removeLinkDecorations();return}let r=n[0].originSelectionRange?b.lift(n[0].originSelectionRange):new b(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(n.length>1){let a=r;for(let{originSelectionRange:l}of n)l&&(a=b.plusRange(a,l));this.addDecoration(a,new Qe().appendText(h("multipleResults","Click to show {0} definitions.",n.length)))}else{let a=n[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}let{object:{textEditorModel:d}}=l,{startLineNumber:c}=a.range;if(c<1||c>d.getLineCount()){l.dispose();return}let u=this.getPreviewValue(d,c,a),g=this.languageService.guessLanguageIdByFilepathOrFirstLine(d.uri);this.addDecoration(r,u?new Qe().appendCodeblock(g||"",u):void 0),l.dispose()})}}getPreviewValue(e,t,i){let o=i.range;return o.endLineNumber-o.startLineNumber>=sd.MAX_SOURCE_PREVIEW_LINES&&(o=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,o)}stripIndentationFromPreviewRange(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){let l=e.getLineFirstNonWhitespaceColumn(a);n=Math.min(n,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${n-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){let i=e.getLineFirstNonWhitespaceColumn(t),o=Math.min(e.getLineCount(),t+sd.MAX_SOURCE_PREVIEW_LINES),n=t+1;for(;n<o;n++){let r=e.getLineFirstNonWhitespaceColumn(n);if(i===r)break}return new b(t,1,n+1,1)}addDecoration(e,t){let i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){var i;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&e.target.type===6&&!(((i=e.target.detail.injectedText)===null||i===void 0?void 0:i.options)instanceof Us)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){let i=this.editor.getModel();return i?Ur(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{let o=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new hn({openToSide:t,openInPeek:o,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){let t=e.get(G);return vt.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Gn.ID="editor.contrib.gotodefinitionatposition";Gn.MAX_SOURCE_PREVIEW_LINES=8;Gn=sd=QN([Mv(1,gt),Mv(2,tt),Mv(3,N)],Gn);W(Gn.ID,Gn,2);de();de();Fx();E();F();var xg=P,aa=class extends I{constructor(){super(),this.containerDomNode=document.createElement("div"),this.containerDomNode.className="monaco-hover",this.containerDomNode.tabIndex=0,this.containerDomNode.setAttribute("role","tooltip"),this.contentsDomNode=document.createElement("div"),this.contentsDomNode.className="monaco-hover-content",this.scrollbar=this._register(new Ws(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}},Ig=class s extends I{static render(e,t,i){return new s(e,t,i)}constructor(e,t,i){super(),this.actionContainer=T(e,xg("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=T(this.actionContainer,xg("a.action")),this.action.setAttribute("role","button"),t.iconClass&&T(this.action,xg(`span.icon.${t.iconClass}`));let o=T(this.action,xg("span"));o.textContent=i?`${t.label} (${i})`:t.label,this._register(ce(this.actionContainer,Pe.CLICK,n=>{n.stopPropagation(),n.preventDefault(),t.run(this.actionContainer)})),this._register(ce(this.actionContainer,Pe.KEY_DOWN,n=>{let r=new bh(n);(r.equals(3)||r.equals(10))&&(n.stopPropagation(),n.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}};function dD(s,e){return s&&e?h("acessibleViewHint","Inspect this in the accessible view with {0}.",e):s?h("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}Fe();E();ke();q();mt();Ht();fe();me();Ie();E();var Nv=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}},la=class extends I{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new K),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new De(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new De(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new De(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=zx(e=>this._computer.computeAsync(e)),(async()=>{try{for await(let e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){ee(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;let e=this._state===0,t=this._state===4;this._onResult.fire(new Nv(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}};var da=class{constructor(e,t,i,o){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=o,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}},$n=class{constructor(e,t,i,o,n,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=o,this.initialMousePosY=n,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}},Li=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};ge();fe();we();re();de();Ie();E();var Yn=class{constructor(){this._onDidWillResize=new K,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new K,this.onDidResize=this._onDidResize.event,this._sashListener=new L,this._size=new be(0,0),this._minSize=new be(0,0),this._maxSize=new be(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new on(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new on(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new on(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:qf.North}),this._southSash=new on(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:qf.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(Me.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(Me.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(o=>{e&&(i=o.currentX-o.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(o=>{e&&(i=-(o.currentX-o.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(o=>{e&&(t=-(o.currentY-o.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(o=>{e&&(t=o.currentY-o.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Me.any(this._eastSash.onDidReset,this._westSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Me.any(this._northSash.onDidReset,this._southSash.onDidReset)(o=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,o){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=o?3:0}layout(e=this.size.height,t=this.size.width){let{height:i,width:o}=this._minSize,{height:n,width:r}=this._maxSize;e=Math.max(i,Math.min(n,e)),t=Math.max(o,Math.min(r,t));let a=new be(t,e);be.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}};E();ke();de();var XN=30,JN=24,Lg=class extends I{constructor(e,t=new be(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new Yn),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=be.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new be(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?R.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){let t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:et(t).top+i.top-XN}_availableVerticalSpaceBelow(e){let t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;let o=et(t),n=Rn(t.ownerDocument.body),r=o.top+i.top+i.height;return n.height-r-JN}_findPositionPreference(e,t){var i,o;let n=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((o=this._availableVerticalSpaceAbove(t))!==null&&o!==void 0?o:1/0,e),a=Math.min(Math.max(r,n),e),l=Math.min(e,a),d;return this._editor.getOption(60).above?d=l<=r?1:2:d=l<=n?2:1,d===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),d}_resize(e){this._resizableNode.layout(e.height,e.width)}};at();var Ov=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Kr=function(s,e){return function(t,i){e(t,i,s)}},Dg,Io,cD=P,ad=Dg=class extends I{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(un,this._editor)),this._participants=[];for(let o of Li.getAll())this._participants.push(this._instantiationService.createInstance(o,this._editor));this._participants.sort((o,n)=>o.hoverOrdinal-n.hoverOrdinal),this._computer=new Pv(this._editor,this._participants),this._hoverOperation=this._register(new la(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{if(!this._computer.anchor)return;let n=o.hasLoadingMessage?this._addLoadingMessage(o.value):o.value;this._withResult(new kg(this._computer.anchor,n,o.isComplete))})),this._register(wi(this._widget.getDomNode(),"keydown",o=>{o.equals(9)&&this.hide()})),this._register(Is.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;let t=[];for(let o of this._participants)if(o.suggestHoverAnchor){let n=o.suggestHoverAnchor(e);n&&t.push(n)}let i=e.target;if(i.type===6&&t.push(new da(0,i.range,e.event.posx,e.event.posy)),i.type===7){let o=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToText<o&&t.push(new da(0,i.range,e.event.posx,e.event.posy))}return t.length===0?this._startShowingOrUpdateHover(null,0,0,!1,e):(t.sort((o,n)=>n.priority-o.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,o){this._startShowingOrUpdateHover(new da(0,e,void 0,void 0),t,i,o,null)}_startShowingOrUpdateHover(e,t,i,o,n){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,o,!1),!0):!1:this._editor.getOption(60).sticky&&n&&this._widget.isMouseGettingCloser(n.event.posx,n.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,o,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,o,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,o,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,o,n){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=o,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=n,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(let t of this._participants)if(t.createLoadingMessage){let i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){let{showAtPosition:i,showAtSecondaryPosition:o,highlightRange:n}=Dg.computeHoverRanges(this._editor,e.range,t),r=new L,a=r.add(new ld(this._keybindingService)),l=document.createDocumentFragment(),d=null,c={fragment:l,statusBar:a,setColorPicker:g=>d=g,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:g=>this._widget.setMinimumDimensions(g),hide:()=>this.hide()};for(let g of this._participants){let p=t.filter(m=>m.owner===g);p.length>0&&r.add(g.renderHoverParts(c,p))}let u=t.some(g=>g.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(n){let g=this._editor.createDecorationsCollection();g.set([{range:n,options:Dg._DECORATION_OPTIONS}]),r.add(xe(()=>{g.clear()}))}this._widget.showAt(l,new Tv(d,i,o,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let o=1;if(e.hasModel()){let d=e._getViewModel(),c=d.coordinatesConverter,u=c.convertModelRangeToViewRange(t),g=new R(u.startLineNumber,d.getLineMinColumn(u.startLineNumber));o=c.convertViewPositionToModelPosition(g).column}let n=t.startLineNumber,r=t.startColumn,a=i[0].range,l=null;for(let d of i)a=b.plusRange(a,d.range),d.range.startLineNumber===n&&d.range.endLineNumber===n&&(r=Math.max(Math.min(r,d.range.startColumn),o)),d.forceShowAtRange&&(l=d.range);return{showAtPosition:l?l.getStartPosition():new R(n,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new R(n,r),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};ad._DECORATION_OPTIONS=te.register({description:"content-hover-highlight",className:"hoverHighlight"});ad=Dg=Ov([Kr(1,B),Kr(2,Ce)],ad);var kg=class{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){let t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new Rv(this,this.anchor,t,this.isComplete)}},Rv=class extends kg{constructor(e,t,i,o){super(t,i,o),this.original=e}filter(e){return this.original.filter(e)}},Tv=class{constructor(e,t,i,o,n,r,a,l,d,c){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=o,this.stoleFocus=n,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=d,this.disposables=c,this.closestMouseDistance=void 0}},hD=30,Ev=10,eE=6,un=Io=class extends Lg{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,o,n){let r=e.getOption(66)+8,a=150,l=new be(a,r);super(e,l),this._configurationService=i,this._accessibilityService=o,this._keybindingService=n,this._hover=this._register(new aa),this._minimumSize=l,this._hoverVisibleKey=_.hoverVisible.bindTo(t),this._hoverFocusedKey=_.hoverFocused.bindTo(t),T(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(50)&&this._updateFont()}));let d=this._register(Ui(this._resizableNode.domNode));this._register(d.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(d.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return Io.ID}static _applyDimensions(e,t,i){let o=typeof t=="number"?`${t}px`:t,n=typeof i=="number"?`${i}px`:i;e.style.width=o,e.style.height=n}_setContentsDomNodeDimensions(e,t){let i=this._hover.contentsDomNode;return Io._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){let i=this._hover.containerDomNode;return Io._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){let o=typeof t=="number"?`${t}px`:t,n=typeof i=="number"?`${i}px`:i;e.style.maxWidth=o,e.style.maxHeight=n}_setHoverWidgetMaxDimensions(e,t){Io._applyMaxDimensions(this._hover.contentsDomNode,e,t),Io._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){let e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){let e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");let t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-Ev))}_updateResizableNodeMaxDimensions(){var e,t;let i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new be(i,o),this._setHoverWidgetMaxDimensions(i,o)}_resize(e){var t,i;Io._lastDimensions=new be(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;let t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){let e=this._findAvailableSpaceVertically();if(!e)return;let t=eE;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=Ev),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");let e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;let e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth<t?Rn(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;let i=et(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=uD(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));let o=uD(e,t,i.left,i.top,i.width,i.height);return o>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,o),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){let{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(n=>this._editor.applyFontInfo(n))}_updateContent(e){let t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){let e=Math.max(this._editor.getLayoutInfo().height/4,250,Io._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,Io._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,o,n,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);let a=cl(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(o=t.colorPicker)===null||o===void 0||o.layout();let c=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&dD(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(n=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||n===void 0?void 0:n.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;let e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new be(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){let e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;let i=this._hover.containerDomNode,o=this._hover.contentsDomNode,n=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(oi(i),Math.min(n,e)),this._setContentsDomNodeDimensions(oi(o),Math.min(n,e-Ev))}setMinimumDimensions(e){this._minimumSize=new be(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){let e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new be(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();let t=this._hover.containerDomNode,i=cl(t),o=oi(t);if(this._resizableNode.layout(i,o),this._setHoverWidgetDimensions(o,i),i=cl(t),o=oi(t),this._contentWidth=o,this._updateMinimumWidth(),this._resizableNode.layout(i,o),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){let n=cl(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(n,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-hD})}scrollRight(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+hD})}pageUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};un.ID="editor.contrib.resizableContentHoverWidget";un._lastDimensions=new be(0,0);un=Io=Ov([Kr(1,G),Kr(2,se),Kr(3,As),Kr(4,Ce)],un);var ld=class extends I{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=cD("div.hover-row.status-bar"),this.actionsElement=T(this.hoverElement,cD("div.actions"))}addAction(e){let t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(Ig.render(this.actionsElement,e,i))}append(e){let t=T(this.actionsElement,e);return this._hasContent=!0,t}};ld=Ov([Kr(0,Ce)],ld);var Pv=class s{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];let i=e.getModel(),o=t.range.startLineNumber;if(o>i.getLineCount())return[];let n=i.getLineMaxColumn(o);return e.getLineDecorations(o).filter(r=>{if(r.options.isWholeLine)return!0;let a=r.range.startLineNumber===o?r.range.startColumn:1,l=r.range.endLineNumber===o?r.range.endColumn:n;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){let t=this._anchor;if(!this._editor.hasModel()||!t)return Zt.EMPTY;let i=s._getLineDecorations(this._editor,t);return Zt.merge(this._participants.map(o=>o.computeAsync?o.computeAsync(t,i,e):Zt.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];let e=s._getLineDecorations(this._editor,this._anchor),t=[];for(let i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return zt(t)}};function uD(s,e,t,i,o,n){let r=t+o/2,a=i+n/2,l=Math.max(Math.abs(s-r)-o/2,0),d=Math.max(Math.abs(e-a)-n/2,0);return Math.sqrt(l*l+d*d)}de();Fe();E();var gD=P,qr=class s extends I{constructor(e,t,i){super(),this._renderDisposeables=this._register(new L),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new aa),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new di({editor:this._editor},t,i)),this._computer=new Av(this._editor),this._hoverOperation=this._register(new la(this._editor,this._computer)),this._register(this._hoverOperation.onResult(o=>{this._withResult(o.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return s.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();let i=document.createDocumentFragment();for(let o of t){let n=gD("div.hover-row.markdown-hover"),r=T(n,gD("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(o.value));r.appendChild(a.element),i.appendChild(n)}this._updateContents(i),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));let t=this._editor.getLayoutInfo(),i=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),n=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-o-(r-n)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}};qr.ID="editor.contrib.modesGlyphHoverWidget";var Av=class{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){let e=o=>({value:o}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(let o of t){if(!o.options.glyphMarginClassName)continue;let n=o.options.glyphMarginHoverMessage;!n||zn(n)||i.push(...oh(n).map(e))}return i}};ge();Lt();Dt();de();Fe();fe();E();ke();q();Ti();fe();Te();me();Z();var Fv=class{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}};async function tE(s,e,t,i,o){try{let n=await Promise.resolve(s.provideHover(t,i,o));if(n&&oE(n))return new Fv(s,n,e)}catch(n){pe(n)}}function dd(s,e,t,i){let n=s.ordered(e).map((r,a)=>tE(r,a,e,t,i));return Zt.fromPromises(n).coalesce()}function iE(s,e,t,i){return dd(s,e,t,i).map(o=>o.hover).toPromise()}ri("_executeHoverProvider",(s,e,t)=>{let i=s.get(N);return iE(i.hoverProvider,e,t,Y.None)});function oE(s){let e=typeof s.range<"u",t=typeof s.contents<"u"&&s.contents&&s.contents.length>0;return e&&t}F();at();var nE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Mg=function(s,e){return function(t,i){e(t,i,s)}},pD=P,ci=class{constructor(e,t,i,o,n){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=o,this.ordinal=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}},ca=class{constructor(e,t,i,o,n){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=o,this._languageFeaturesService=n,this.hoverOrdinal=3}createLoadingMessage(e){return new ci(this,e.range,[new Qe().appendText(h("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];let i=this._editor.getModel(),o=e.range.startLineNumber,n=i.getLineMaxColumn(o),r=[],a=1e3,l=i.getLineLength(o),d=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),c=this._editor.getOption(116),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:d}),g=!1;c>=0&&l>c&&e.range.startColumn>=c&&(g=!0,r.push(new ci(this,e.range,[{value:h("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!g&&typeof u=="number"&&l>=u&&r.push(new ci(this,e.range,[{value:h("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let p=!1;for(let m of t){let f=m.range.startLineNumber===o?m.range.startColumn:1,C=m.range.endLineNumber===o?m.range.endColumn:n,v=m.options.hoverMessage;if(!v||zn(v))continue;m.options.beforeContentClassName&&(p=!0);let S=new b(e.range.startLineNumber,f,e.range.startLineNumber,C);r.push(new ci(this,S,oh(v),p,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return Zt.EMPTY;let o=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(o))return Zt.EMPTY;let n=new R(e.range.startLineNumber,e.range.startColumn);return dd(this._languageFeaturesService.hoverProvider,o,n,i).filter(r=>!zn(r.hover.contents)).map(r=>{let a=r.hover.range?b.lift(r.hover.range):e.range;return new ci(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return Wv(e,t,this._editor,this._languageService,this._openerService)}};ca=nE([Mg(1,tt),Mg(2,it),Mg(3,se),Mg(4,N)],ca);function Wv(s,e,t,i,o){e.sort((r,a)=>r.ordinal-a.ordinal);let n=new L;for(let r of e)for(let a of r.contents){if(zn(a))continue;let l=pD("div.hover-row.markdown-hover"),d=T(l,pD("div.hover-contents")),c=n.add(new di({editor:t},i,o));n.add(c.onDidRenderAsync(()=>{d.className="hover-contents code-hover-contents",s.onContentsChanged()}));let u=n.add(c.render(a));d.appendChild(u.element),s.fragment.appendChild(l)}return n}de();Fe();fe();me();E();yi();q();Nt();E();Z();Rt();ke();q();we();Fe();Ie();E();lx();Be();pt();q();Uo();ge();at();var mD=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Ng=function(s,e){return function(t,i){e(t,i,s)}},Eg=class{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}},zv=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new K,this.onDidChange=this._onDidChange.event,this._dispoables=new L,this._markers=[],this._nextIdx=-1,ne.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);let o=this._configService.getValue("problems.sortOrder"),n=(a,l)=>{let d=cf(a.resource.toString(),l.resource.toString());return d===0&&(o==="position"?d=b.compareRangesUsingStarts(a,l)||ft.compare(a.severity,l.severity):d=ft.compare(a.severity,l.severity)||b.compareRangesUsingStarts(a,l)),d},r=()=>{this._markers=this._markerService.read({resource:ne.isUri(e)?e:void 0,severities:ft.Error|ft.Warning|ft.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(n)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){let e=this._markers[this._nextIdx];return e&&new Eg(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let o=!1,n=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());n<0&&(n=br(this._markers,{resource:e.uri},(r,a)=>cf(r.resource.toString(),a.resource.toString())),n<0&&(n=~n));for(let r=n;r<this._markers.length;r++){let a=b.lift(this._markers[r]);if(a.isEmpty()){let l=e.getWordAtPosition(a.getStartPosition());l&&(a=new b(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=r,o=!0;break}if(this._markers[r].resource.toString()!==e.uri.toString())break}o||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;let o=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),o!==this._nextIdx}find(e,t){let i=this._markers.findIndex(o=>o.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(b.containsPosition(this._markers[i],t))return new Eg(this._markers[i],i+1,this._markers.length)}}};zv=mD([Ng(1,Tl),Ng(2,se)],zv);var Bv=Et("IMarkerNavigationService"),Hv=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new lh}getMarkerList(e){for(let t of this._provider){let i=t.getMarkerList(e);if(i)return i}return new zv(e,this._markerService,this._configService)}};Hv=mD([Ng(0,Tl),Ng(1,se)],Hv);Pt(Bv,Hv,1);F();Je();re();ge();de();Fe();ho();Ie();E();yi();Be();q();F();Je();re();ge();Nt();ti();var Rg;(function(s){function e(t){switch(t){case Ml.Ignore:return"severity-ignore "+le.asClassName($.info);case Ml.Info:return le.asClassName($.info);case Ml.Warning:return le.asClassName($.warning);case Ml.Error:return le.asClassName($.error);default:return""}}s.className=e})(Rg||(Rg={}));Lt();Dt();var rE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},ha=function(s,e){return function(t,i){e(t,i,s)}},Vv,Uv=class{constructor(e,t,i,o,n){this._openerService=o,this._labelService=n,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new L,this._editor=t;let r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(wi(this._relatedBlock,"click",a=>{a.preventDefault();let l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new jI(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){$e(this._disposables)}update(e){let{source:t,message:i,relatedInformation:o,code:n}=e,r=(t?.length||0)+2;n&&(typeof n=="string"?r+=n.length:r+=n.value.length);let a=Cr(i);this._lines=a.length,this._longestLineLength=0;for(let g of a)this._longestLineLength=Math.max(g.length+r,this._longestLineLength);ii(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(let g of a)l=document.createElement("div"),l.innerText=g,g===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||n){let g=document.createElement("span");if(g.classList.add("details"),l.appendChild(g),t){let p=document.createElement("span");p.innerText=t,p.classList.add("source"),g.appendChild(p)}if(n)if(typeof n=="string"){let p=document.createElement("span");p.innerText=`(${n})`,p.classList.add("code"),g.appendChild(p)}else{this._codeLink=P("a.code-link"),this._codeLink.setAttribute("href",`${n.target.toString()}`),this._codeLink.onclick=m=>{this._openerService.open(n.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()};let p=T(this._codeLink,P("span"));p.innerText=n.value,g.appendChild(this._codeLink)}}if(ii(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Ge(o)){let g=this._relatedBlock.appendChild(document.createElement("div"));g.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(let p of o){let m=document.createElement("div"),f=document.createElement("a");f.classList.add("filename"),f.innerText=`${this._labelService.getUriBasenameLabel(p.resource)}(${p.startLineNumber}, ${p.startColumn}): `,f.title=this._labelService.getUriLabel(p.resource),this._relatedDiagnostics.set(f,p);let C=document.createElement("span");C.innerText=p.message,m.appendChild(f),m.appendChild(C),this._lines+=1,g.appendChild(m)}}let d=this._editor.getOption(50),c=Math.ceil(d.typicalFullwidthCharacterWidth*this._longestLineLength*.75),u=d.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:c,scrollHeight:u})}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 ft.Error:t=h("Error","Error");break;case ft.Warning:t=h("Warning","Warning");break;case ft.Info:t=h("Info","Info");break;case ft.Hint:t=h("Hint","Hint");break}let i=h("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn),o=this._editor.getModel();return o&&e.startLineNumber<=o.getLineCount()&&e.startLineNumber>=1&&(i=`${o.getLineContent(e.startLineNumber)}, ${i}`),i}},Gr=Vv=class extends oa{constructor(e,t,i,o,n,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},n),this._themeService=t,this._openerService=i,this._menuService=o,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new L,this._onDidSelectRelatedInformation=new K,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ft.Warning,this._backgroundColor=ie.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(dE);let t=jv,i=sE;this._severity===ft.Warning?(t=Tg,i=aE):this._severity===ft.Info&&(t=Kv,i=lE);let o=e.getColor(t),n=e.getColor(i);this.style({arrowColor:o,frameColor:o,headerBackgroundColor:n,primaryHeadingColor:e.getColor(ig),secondaryHeadingColor:e.getColor(og)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(o=>this.editor.focus()));let t=[],i=this._menuService.createMenu(Vv.TitleMenu,this._contextKeyService);nu(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=T(e,P(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new Uv(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());let o=b.lift(e),n=this.editor.getPosition(),r=n&&o.containsPosition(n)?n:o.getStartPosition();super.show(r,this.computeRequiredHeight());let a=this.editor.getModel();if(a){let l=i>1?h("problems","{0} of {1} problems",t,i):h("change","{0} of {1} problem",t,i);this.setTitle(Xt(a.uri),l)}this._icon.className=`codicon ${Rg.className(ft.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Gr.TitleMenu=new O("gotoErrorTitleMenu");Gr=Vv=rE([ha(1,dt),ha(2,it),ha(3,Ho),ha(4,B),ha(5,G),ha(6,Zo)],Gr);var fD=Wh(SI,wI),_D=Wh(yI,xI),vD=Wh(vl,II),jv=z("editorMarkerNavigationError.background",{dark:fD,light:fD,hcDark:Oi,hcLight:Oi},h("editorMarkerNavigationError","Editor marker navigation widget error color.")),sE=z("editorMarkerNavigationError.headerBackground",{dark:Qt(jv,.1),light:Qt(jv,.1),hcDark:null,hcLight:null},h("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),Tg=z("editorMarkerNavigationWarning.background",{dark:_D,light:_D,hcDark:Oi,hcLight:Oi},h("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),aE=z("editorMarkerNavigationWarning.headerBackground",{dark:Qt(Tg,.1),light:Qt(Tg,.1),hcDark:"#0C141F",hcLight:Qt(Tg,.2)},h("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),Kv=z("editorMarkerNavigationInfo.background",{dark:vD,light:vD,hcDark:Oi,hcLight:Oi},h("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),lE=z("editorMarkerNavigationInfo.headerBackground",{dark:Qt(Kv,.1),light:Qt(Kv,.1),hcDark:null,hcLight:null},h("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),dE=z("editorMarkerNavigation.background",{dark:bl,light:bl,hcDark:bl,hcLight:bl},h("editorMarkerNavigationBackground","Editor marker navigation widget background."));var cE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Pg=function(s,e){return function(t,i){e(t,i,s)}},cd,gn=cd=class{static get(e){return e.getContribution(cd.ID)}constructor(e,t,i,o,n){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=o,this._instantiationService=n,this._sessionDispoables=new L,this._editor=e,this._widgetVisible=bD.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(Gr,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var o,n,r;(!(!((o=this._model)===null||o===void 0)&&o.selected)||!b.containsPosition((n=this._model)===null||n===void 0?void 0:n.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;let i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:b.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){let t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new R(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var i,o;if(this._editor.hasModel()){let n=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(n.move(e,this._editor.getModel(),this._editor.getPosition()),!n.selected)return;if(n.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();let r=await this._editorService.openCodeEditor({resource:n.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:n.selected.marker}},this._editor);r&&((i=cd.get(r))===null||i===void 0||i.close(),(o=cd.get(r))===null||o===void 0||o.nagivate(e,t))}else this._widget.showAtMarker(n.selected.marker,n.selected.index,n.selected.total)}}};gn.ID="editor.contrib.markerController";gn=cd=cE([Pg(1,Bv),Pg(2,G),Pg(3,_e),Pg(4,B)],gn);var ua=class extends k{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&((i=gn.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))}},$r=class s extends ua{constructor(){super(!0,!1,{id:s.ID,label:s.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:578,weight:100},menuOpts:{menuId:Gr.TitleMenu,title:s.LABEL,icon:Ve("marker-navigation-next",$.arrowDown,h("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}};$r.ID="editor.action.marker.next";$r.LABEL=h("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");var hd=class s extends ua{constructor(){super(!1,!1,{id:s.ID,label:s.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:1602,weight:100},menuOpts:{menuId:Gr.TitleMenu,title:s.LABEL,icon:Ve("marker-navigation-previous",$.arrowUp,h("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}};hd.ID="editor.action.marker.prev";hd.LABEL=h("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");var qv=class extends ua{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:h("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:66,weight:100},menuOpts:{menuId:O.MenubarGoMenu,title:h({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}},Gv=class extends ua{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:h("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:1090,weight:100},menuOpts:{menuId:O.MenubarGoMenu,title:h({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}};W(gn.ID,gn,4);w($r);w(hd);w(qv);w(Gv);var bD=new X("markersNavigationVisible",!1),hE=je.bindToContribution(gn.get);H(new hE({id:"closeMarkersNavigation",precondition:bD,handler:s=>s.close(),kbOpts:{weight:150,kbExpr:_.focus,primary:9,secondary:[1033]}}));F();var uE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},$v=function(s,e){return function(t,i){e(t,i,s)}},Wi=P,Yv=class{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}},CD={type:1,filter:{include:U.QuickFix},triggerAction:_t.QuickFixHover},Og=class{constructor(e,t,i,o){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=o,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];let i=this._editor.getModel(),o=e.range.startLineNumber,n=i.getLineMaxColumn(o),r=[];for(let a of t){let l=a.range.startLineNumber===o?a.range.startColumn:1,d=a.range.endLineNumber===o?a.range.endColumn:n,c=this._markerDecorationsService.getMarker(i.uri,a);if(!c)continue;let u=new b(e.range.startLineNumber,l,e.range.startLineNumber,d);r.push(new Yv(this,u,c))}return r}renderHoverParts(e,t){if(!t.length)return I.None;let i=new L;t.forEach(n=>e.fragment.appendChild(this.renderMarkerHover(n,i)));let o=t.length===1?t[0]:t.sort((n,r)=>ft.compare(n.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,o,i),i}renderMarkerHover(e,t){let i=Wi("div.hover-row"),o=T(i,Wi("div.marker.hover-contents")),{source:n,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(o);let d=T(o,Wi("span"));if(d.style.whiteSpace="pre-wrap",d.innerText=r,n||a)if(a&&typeof a!="string"){let c=Wi("span");if(n){let m=T(c,Wi("span"));m.innerText=n}let u=T(c,Wi("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(ce(u,"click",m=>{this._openerService.open(a.target,{allowCommands:!0}),m.preventDefault(),m.stopPropagation()}));let g=T(u,Wi("span"));g.innerText=a.value;let p=T(o,c);p.style.opacity="0.6",p.style.paddingLeft="6px"}else{let c=T(o,Wi("span"));c.style.opacity="0.6",c.style.paddingLeft="6px",c.innerText=n&&a?`${n}(${a})`:n||`(${a})`}if(Ge(l))for(let{message:c,resource:u,startLineNumber:g,startColumn:p}of l){let m=T(o,Wi("div"));m.style.marginTop="8px";let f=T(m,Wi("a"));f.innerText=`${Xt(u)}(${g}, ${p}): `,f.style.cursor="pointer",t.add(ce(f,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:g,startColumn:p}}}).catch(ee)}));let C=T(m,Wi("span"));C.innerText=c,this._editor.applyFontInfo(C)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===ft.Error||t.marker.severity===ft.Warning||t.marker.severity===ft.Info)&&e.statusBar.addAction({label:h("view problem","View Problem"),commandId:$r.ID,run:()=>{var o;e.hide(),(o=gn.get(this._editor))===null||o===void 0||o.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){let o=e.statusBar.append(Wi("div"));this.recentMarkerCodeActionsInfo&&(Kf.makeKey(this.recentMarkerCodeActionsInfo.marker)===Kf.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(o.textContent=h("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);let n=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?I.None:i.add(Bo(()=>o.textContent=h("checkingForQuickFixes","Checking for quick fixes..."),200));o.textContent||(o.textContent="\xA0");let r=this.getCodeActions(t.marker);i.add(xe(()=>r.cancel())),r.then(a=>{if(n.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),o.textContent=h("noQuickFixes","No quick fixes available");return}o.style.display="none";let l=!1;i.add(xe(()=>{l||a.dispose()})),e.statusBar.addAction({label:h("quick fixes","Quick Fix..."),commandId:Zs,run:d=>{l=!0;let c=Gi.get(this._editor),u=et(d);e.hide(),c?.showCodeActions(CD,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},ee)}}getCodeActions(e){return Se(t=>Or(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new b(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),CD,Ai.None,t))}};Og=uE([$v(1,gI),$v(2,it),$v(3,N)],Og);de();Ns();Fe();fe();Nt();E();$t();ti();ke();Ht();var Ag="editor.action.inlineSuggest.commit",Fg="editor.action.inlineSuggest.showPrevious",Wg="editor.action.inlineSuggest.showNext";F();Je();Ue();re();ge();yr();var Jv=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},$i=function(s,e){return function(t,i){e(t,i,s)}},zg,Hg=class extends I{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=qi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=li(this,o=>{var n,r,a;let l=(n=this.model.read(o))===null||n===void 0?void 0:n.ghostText.read(o);if(!this.alwaysShowToolbar.read(o)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;let d=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);let c=new R(l.lineNumber,Math.min(d,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=c,c}),this._register(aL((o,n)=>{let r=this.model.read(o);if(!r||!this.alwaysShowToolbar.read(o))return;let a=n.add(this.instantiationService.createInstance(Yi,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var d;return(d=l?.inlineCompletion.source.inlineCompletions.commands)!==null&&d!==void 0?d:[]})));e.addContentWidget(a),n.add(xe(()=>e.removeContentWidget(a))),n.add(Vt(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==no.Explicit&&r.triggerExplicitly()}))}))}};Hg=Jv([$i(2,B)],Hg);var gE=Ve("inline-suggestion-hints-next",$.chevronRight,h("parameterHintsNextIcon","Icon for show next parameter hint.")),pE=Ve("inline-suggestion-hints-previous",$.chevronLeft,h("parameterHintsPreviousIcon","Icon for show previous parameter hint.")),Yi=zg=class extends I{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){let o=new so(e,t,i,!0,()=>this._commandService.executeCommand(e)),n=this.keybindingService.lookupKeybinding(e,this._contextKeyService),r=t;return n&&(r=h({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,n.getLabel())),o.tooltip=r,o}constructor(e,t,i,o,n,r,a,l,d,c,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=o,this._suggestionCount=n,this._extraCommands=r,this._commandService=a,this.keybindingService=d,this._contextKeyService=c,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${zg.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=xh("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[xh("div@toolBar")]),this.previousAction=this.createCommandAction(Fg,h("previous","Previous"),le.asClassName(pE)),this.availableSuggestionCountAction=new so("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(Wg,h("next","Next"),le.asClassName(gE)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(O.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new De(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new De(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(Xv,this.nodes.toolBar,O.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:g=>g.startsWith("primary")},actionViewItemProvider:(g,p)=>{if(g instanceof wr)return l.createInstance(Qv,g,void 0);if(g===this.availableSuggestionCountAction){let m=new Zv(void 0,g,{label:!0,icon:!1});return m.setClass("availableSuggestionCount"),m}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(g=>{zg._dropDownVisible=g})),this._register(Vt(g=>{this._position.read(g),this.editor.layoutContentWidget(this)})),this._register(Vt(g=>{let p=this._suggestionCount.read(g),m=this._currentSuggestionIdx.read(g);p!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${m+1}/${p}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),p!==void 0&&p>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(Vt(g=>{let p=this._extraCommands.read(g);if(ui(this.lastCommands,p))return;this.lastCommands=p;let m=p.map(f=>({class:void 0,id:f.id,enabled:!0,tooltip:f.tooltip||"",label:f.title,run:C=>this._commandService.executeCommand(f.id)}));for(let[f,C]of this.inlineCompletionsActionsMenus.getActions())for(let v of C)v instanceof wr&&m.push(v);m.length>0&&m.unshift(new Sr),this.toolBar.setAdditionalSecondaryActions(m)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};Yi._dropDownVisible=!1;Yi.id=0;Yi=zg=Jv([$i(6,Ne),$i(7,B),$i(8,Ce),$i(9,G),$i(10,Ho)],Yi);var Zv=class extends Rl{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}},Qv=class extends ru{updateLabel(){let e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){let t=xh("div.keybinding").root;new cu(t,ah,{disableTitle:!0,...Z0}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},Xv=class extends cL{constructor(e,t,i,o,n,r,a,l){super(e,{resetMenu:t,...i},o,n,r,a,l),this.menuId=t,this.options2=i,this.menuService=o,this.contextKeyService=n,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,o,n,r,a;let l=[],d=[];nu(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:d},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(n=(o=this.options2)===null||o===void 0?void 0:o.toolbarOptions)===null||n===void 0?void 0:n.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),d.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,d)}setPrependedPrimaryActions(e){ui(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){ui(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};Xv=Jv([$i(3,Ho),$i(4,G),$i(5,fo),$i(6,Ce),$i(7,pi)],Xv);F();fe();var mE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Bg=function(s,e){return function(t,i){e(t,i,s)}},eb,Vg=!1,Ut=eb=class extends I{static get(e){return e.getContribution(eb.ID)}constructor(e,t,i,o,n){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=o,this._keybindingService=n,this._toUnhook=new L,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new De(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())}))}_hookEvents(){let e=this._editor.getOption(60);this._isHoverEnabled=e.enabled,this._isHoverSticky=e.sticky,this._hidingDelay=e.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._toUnhook.add(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._toUnhook.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._toUnhook.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._toUnhook.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._toUnhook.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._toUnhook.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._toUnhook.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;let i=e.target;if(i.type===9&&i.detail===un.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===qr.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;this._cancelScheduler();let o=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(o)||Vg||this._hideWidgets()}_isMouseOverWidget(e){var t,i,o,n,r;let a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===un.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((n=(o=e.event.browserEvent.view)===null||o===void 0?void 0:o.getSelection())===null||n===void 0)&&n.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===un.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===qr.ID)}_onEditorMouseMove(e){var t,i,o,n;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((o=this._contentWidget)===null||o===void 0)&&o.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((n=this._contentWidget)===null||n===void 0)&&n.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,o;if(!e)return;let n=e.target,r=(t=n.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!Vg||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(n.type===2&&n.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._glyphWidget||(this._glyphWidget=new qr(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(n.position.lineNumber);return}Vg||this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;let i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),o=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!o&&this._hideWidgets()}_hideWidgets(){var e,t,i;Vg||this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||Yi.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(ad,this._editor)),this._contentWidget}showContentHover(e,t,i,o,n=!1){this._hoverActivatedByColorDecoratorClick=n,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,o)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};Ut.ID="editor.contrib.hover";Ut=eb=mE([Bg(1,B),Bg(2,it),Bg(3,tt),Bg(4,Ce)],Ut);var Zi;(function(s){s.NoAutoFocus="noAutoFocus",s.FocusIfVisible="focusIfVisible",s.AutoFocusImmediately="autoFocusImmediately"})(Zi||(Zi={}));var tb=class extends k{constructor(){super({id:"editor.action.showHover",label:h({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse."]},"Show or Focus Hover"),metadata:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[Zi.NoAutoFocus,Zi.FocusIfVisible,Zi.AutoFocusImmediately],enumDescriptions:[h("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),h("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),h("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Zi.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:_.editorTextFocus,primary:Ee(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;let o=Ut.get(t);if(!o)return;let n=i?.focus,r=Zi.FocusIfVisible;n in Zi?r=n:typeof n=="boolean"&&n&&(r=Zi.AutoFocusImmediately);let a=d=>{let c=t.getPosition(),u=new b(c.lineNumber,c.column,c.lineNumber,c.column);o.showContentHover(u,1,1,d)},l=t.getOption(2)===2;o.isHoverVisible?r!==Zi.NoAutoFocus?o.focus():a(l):a(l||r===Zi.AutoFocusImmediately)}},ib=class extends k{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:h({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){let i=Ut.get(t);if(!i)return;let o=t.getPosition();if(!o)return;let n=new b(o.lineNumber,o.column,o.lineNumber,o.column),r=Gn.get(t);if(!r)return;r.startFindDefinitionFromCursor(o).then(()=>{i.showContentHover(n,1,1,!0)})}},ob=class extends k{constructor(){super({id:"editor.action.scrollUpHover",label:h({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:16,weight:100}})}run(e,t){let i=Ut.get(t);i&&i.scrollUp()}},nb=class extends k{constructor(){super({id:"editor.action.scrollDownHover",label:h({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:18,weight:100}})}run(e,t){let i=Ut.get(t);i&&i.scrollDown()}},rb=class extends k{constructor(){super({id:"editor.action.scrollLeftHover",label:h({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:15,weight:100}})}run(e,t){let i=Ut.get(t);i&&i.scrollLeft()}},sb=class extends k{constructor(){super({id:"editor.action.scrollRightHover",label:h({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:17,weight:100}})}run(e,t){let i=Ut.get(t);i&&i.scrollRight()}},ab=class extends k{constructor(){super({id:"editor.action.pageUpHover",label:h({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){let i=Ut.get(t);i&&i.pageUp()}},lb=class extends k{constructor(){super({id:"editor.action.pageDownHover",label:h({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){let i=Ut.get(t);i&&i.pageDown()}},db=class extends k{constructor(){super({id:"editor.action.goToTopHover",label:h({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){let i=Ut.get(t);i&&i.goToTop()}},cb=class extends k{constructor(){super({id:"editor.action.goToBottomHover",label:h({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:_.hoverFocused,kbOpts:{kbExpr:_.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){let i=Ut.get(t);i&&i.goToBottom()}};W(Ut.ID,Ut,2);w(tb);w(ib);w(ob);w(nb);w(rb);w(sb);w(ab);w(lb);w(db);w(cb);Li.register(ca);Li.register(Og);On((s,e)=>{let t=s.getColor(TI);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});var ud=class extends I{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){let t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;let i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==ov||!i.range)return;let o=this._editor.getContribution(Ut.ID);if(o&&!o.isColorPickerVisible){let n=new b(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);o.showContentHover(n,1,0,!1,!0)}}};ud.ID="editor.contrib.colorContribution";W(ud.ID,ud,2);Li.register(Yl);Z();F();E();ge();Ie();Z();we();re();Ri();It();de();var wD=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Qi=function(s,e){return function(t,i){e(t,i,s)}},hb,ub,pn=hb=class extends I{constructor(e,t,i,o,n,r,a){super(),this._editor=e,this._modelService=i,this._keybindingService=o,this._instantiationService=n,this._languageFeatureService=r,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=_.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=_.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new Ug(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(hb.ID)}};pn.ID="editor.contrib.standaloneColorPickerController";pn=hb=wD([Qi(1,G),Qi(2,ze),Qi(3,Ce),Qi(4,B),Qi(5,N),Qi(6,he)],pn);W(pn.ID,pn,1);var SD=8,fE=22,Ug=ub=class extends I{constructor(e,t,i,o,n,r,a,l){var d;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=n,this._keybindingService=r,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new K),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=o.createInstance(ta,this._editor),this._position=(d=this._editor._getViewModel())===null||d===void 0?void 0:d.getPrimaryCursorState().modelState.position;let c=this._editor.getSelection(),u=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},g=this._register(Ui(this._body));this._register(g.onDidBlur(p=>{this.hide()})),this._register(g.onDidFocus(p=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(p=>{var m;let f=(m=p.target.element)===null||m===void 0?void 0:m.classList;f&&f.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(p=>{this._render(p.value,p.foundInEditor)})),this._start(u),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return ub.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;let e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){let t=await this._computeAsync(e);t&&this._onResult.fire(new gb(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;let t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new Hr(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){let i=document.createDocumentFragment(),o=this._register(new ld(this._keybindingService)),n,r={fragment:i,statusBar:o,setColorPicker:f=>n=f,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(r,[e])),n===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),n.layout();let a=n.body,l=a.saturationBox.domNode.clientWidth,d=a.domNode.clientWidth-l-fE-SD,c=n.body.enterButton;c?.onClicked(()=>{this.updateEditor(),this.hide()});let u=n.header,g=u.pickedColorNode;g.style.width=l+SD+"px";let p=u.originalColorNode;p.style.width=d+"px";let m=n.header.closeButton;m?.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};Ug.ID="editor.contrib.standaloneColorPickerWidget";Ug=ub=wD([Qi(3,B),Qi(4,ze),Qi(5,Ce),Qi(6,N),Qi(7,he)],Ug);var gb=class{constructor(e,t){this.value=e,this.foundInEditor=t}};we();Je();var pb=class extends ni{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:h("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:h({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:O.CommandPalette}]})}runEditorCommand(e,t){var i;(i=pn.get(t))===null||i===void 0||i.showOrFocus()}},mb=class extends k{constructor(){super({id:"editor.action.hideColorPicker",label:h({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:_.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=pn.get(t))===null||i===void 0||i.hide()}},fb=class extends k{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:h({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:_.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=pn.get(t))===null||i===void 0||i.insertColor()}};w(mb);w(fb);ve(pb);Fo();Z();q();we();It();ke();q();ut();var mn=class s{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;let o=t.length,n=e.length;if(i+o>n)return!1;for(let r=0;r<o;r++){let a=e.charCodeAt(i+r),l=t.charCodeAt(r);if(a!==l&&!(a>=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,o,n,r){let a=e.startLineNumber,l=e.startColumn,d=e.endLineNumber,c=e.endColumn,u=n.getLineContent(a),g=n.getLineContent(d),p=u.lastIndexOf(t,l-1+t.length),m=g.indexOf(i,c-1-i.length);if(p!==-1&&m!==-1)if(a===d)u.substring(p+t.length,m).indexOf(i)>=0&&(p=-1,m=-1);else{let C=u.substring(p+t.length),v=g.substring(0,m);(C.indexOf(i)>=0||v.indexOf(i)>=0)&&(p=-1,m=-1)}let f;p!==-1&&m!==-1?(o&&p+t.length<u.length&&u.charCodeAt(p+t.length)===32&&(t=t+" "),o&&m>0&&g.charCodeAt(m-1)===32&&(i=" "+i,m-=1),f=s._createRemoveBlockCommentOperations(new b(a,p+t.length+1,d,m+1),t,i)):(f=s._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=f.length===1?i:null);for(let C of f)r.addTrackedEditOperation(C.range,C.text)}static _createRemoveBlockCommentOperations(e,t,i){let o=[];return b.isEmpty(e)?o.push(ye.delete(new b(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(o.push(ye.delete(new b(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),o.push(ye.delete(new b(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),o}static _createAddBlockCommentOperations(e,t,i,o){let n=[];return b.isEmpty(e)?n.push(ye.replace(new b(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(n.push(ye.insert(new R(e.startLineNumber,e.startColumn),t+(o?" ":""))),n.push(ye.insert(new R(e.endLineNumber,e.endColumn),(o?" ":"")+i))),n}getEditOperations(e,t){let i=this._selection.startLineNumber,o=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);let n=e.getLanguageIdAtPosition(i,o),r=this.languageConfigurationService.getLanguageConfiguration(n).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){let i=t.getInverseEditOperations();if(i.length===2){let o=i[0],n=i[1];return new V(o.range.endLineNumber,o.range.endColumn,n.range.startLineNumber,n.range.startColumn)}else{let o=i[0].range,n=this._usedEndToken?-this._usedEndToken.length-1:0;return new V(o.endLineNumber,o.endColumn+n,o.endLineNumber,o.endColumn+n)}}};Be();ke();q();ut();var jg=class s{constructor(e,t,i,o,n,r,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=o,this._insertSpace=n,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,o){e.tokenization.tokenizeIfCheap(t);let n=e.getLanguageIdAtPosition(t,1),r=o.getLanguageConfiguration(n).comments,a=r?r.lineCommentToken:null;if(!a)return null;let l=[];for(let d=0,c=i-t+1;d<c;d++)l[d]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,i,o,n,r,a,l){let d=!0,c;e===0?c=!0:e===1?c=!1:c=!0;for(let u=0,g=o.length;u<g;u++){let p=o[u],m=n+u;if(m===n&&a){p.ignore=!0;continue}let f=i.getLineContent(m),C=ll(f);if(C===-1){p.ignore=r,p.commentStrOffset=f.length;continue}if(d=!1,p.ignore=!1,p.commentStrOffset=C,c&&!mn._haystackHasNeedleAtOffset(f,p.commentStr,C)&&(e===0?c=!1:e===1||(p.ignore=!0)),c&&t){let v=C+p.commentStrLength;v<f.length&&f.charCodeAt(v)===32&&(p.commentStrLength+=1)}}if(e===0&&d){c=!1;for(let u=0,g=o.length;u<g;u++)o[u].ignore=!1}return{supported:!0,shouldRemoveComments:c,lines:o}}static _gatherPreflightData(e,t,i,o,n,r,a,l){let d=s._gatherPreflightCommentStrings(i,o,n,l);return d===null?{supported:!1}:s._analyzeLines(e,t,i,d,o,r,a,l)}_executeLineComments(e,t,i,o){let n;i.shouldRemoveComments?n=s._createRemoveLineCommentsOperations(i.lines,o.startLineNumber):(s._normalizeInsertionPoint(e,i.lines,o.startLineNumber,this._tabSize),n=this._createAddLineCommentsOperations(i.lines,o.startLineNumber));let r=new R(o.positionLineNumber,o.positionColumn);for(let a=0,l=n.length;a<l;a++)t.addEditOperation(n[a].range,n[a].text),b.isEmpty(n[a].range)&&b.getStartPosition(n[a].range).equals(r)&&e.getLineContent(r.lineNumber).length+1===r.column&&(this._deltaColumn=(n[a].text||"").length);this._selectionId=t.trackSelection(o)}_attemptRemoveBlockComment(e,t,i,o){let n=t.startLineNumber,r=t.endLineNumber,a=o.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn),l=e.getLineContent(n).lastIndexOf(i,a-1),d=e.getLineContent(r).indexOf(o,t.endColumn-1-i.length);return l!==-1&&d===-1&&(d=e.getLineContent(n).indexOf(o,l+i.length),r=n),l===-1&&d!==-1&&(l=e.getLineContent(r).lastIndexOf(i,d),n=r),t.isEmpty()&&(l===-1||d===-1)&&(l=e.getLineContent(n).indexOf(i),l!==-1&&(d=e.getLineContent(n).indexOf(o,l+i.length))),l!==-1&&e.getLineContent(n).charCodeAt(l+i.length)===32&&(i+=" "),d!==-1&&e.getLineContent(r).charCodeAt(d-1)===32&&(o=" "+o,d-=1),l!==-1&&d!==-1?mn._createRemoveBlockCommentOperations(new b(n,l+i.length+1,r,d+1),i,o):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);let o=e.getLanguageIdAtPosition(i.startLineNumber,1),n=this.languageConfigurationService.getLanguageConfiguration(o).comments;if(!n||!n.blockCommentStartToken||!n.blockCommentEndToken)return;let r=n.blockCommentStartToken,a=n.blockCommentEndToken,l=this._attemptRemoveBlockComment(e,i,r,a);if(!l){if(i.isEmpty()){let d=e.getLineContent(i.startLineNumber),c=ll(d);c===-1&&(c=d.length),l=mn._createAddBlockCommentOperations(new b(i.startLineNumber,c+1,i.startLineNumber,d.length+1),r,a,this._insertSpace)}else l=mn._createAddBlockCommentOperations(new b(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),r,a,this._insertSpace);l.length===1&&(this._deltaColumn=r.length+1)}this._selectionId=t.trackSelection(i);for(let d of l)t.addEditOperation(d.range,d.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new b(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
7
7
  `),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)));let o=s._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return o.supported?this._executeLineComments(e,t,o,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 V(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){let i=[];for(let o=0,n=e.length;o<n;o++){let r=e[o];r.ignore||i.push(ye.delete(new b(t+o,r.commentStrOffset+1,t+o,r.commentStrOffset+r.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){let i=[],o=this._insertSpace?" ":"";for(let n=0,r=e.length;n<r;n++){let a=e[n];a.ignore||i.push(ye.insert(new R(t+n,a.commentStrOffset+1),a.commentStr+o))}return i}static nextVisibleColumn(e,t,i,o){return i?e+(t-e%t):e+o}static _normalizeInsertionPoint(e,t,i,o){let n=1073741824,r,a;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;let c=e.getLineContent(i+l),u=0;for(let g=0,p=t[l].commentStrOffset;u<n&&g<p;g++)u=s.nextVisibleColumn(u,o,c.charCodeAt(g)===9,1);u<n&&(n=u)}n=Math.floor(n/o)*o;for(let l=0,d=t.length;l<d;l++){if(t[l].ignore)continue;let c=e.getLineContent(i+l),u=0;for(r=0,a=t[l].commentStrOffset;u<n&&r<a;r++)u=s.nextVisibleColumn(u,o,c.charCodeAt(r)===9,1);u>n?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}};F();Je();var gd=class extends k{constructor(e,t){super(t),this._type=e}run(e,t){let i=e.get(he);if(!t.hasModel())return;let o=t.getModel(),n=[],r=o.getOptions(),a=t.getOption(23),l=t.getSelections().map((c,u)=>({selection:c,index:u,ignoreFirstLine:!1}));l.sort((c,u)=>b.compareRangesUsingStarts(c.selection,u.selection));let d=l[0];for(let c=1;c<l.length;c++){let u=l[c];d.selection.endLineNumber===u.selection.startLineNumber&&(d.index<u.index?u.ignoreFirstLine=!0:(d.ignoreFirstLine=!0,d=u))}for(let c of l)n.push(new jg(i,c.selection,r.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,c.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}},_b=class extends gd{constructor(){super(0,{id:"editor.action.commentLine",label:h("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:_.writable,kbOpts:{kbExpr:_.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:O.MenubarEditMenu,group:"5_insert",title:h({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}},vb=class extends gd{constructor(){super(1,{id:"editor.action.addCommentLine",label:h("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:_.writable,kbOpts:{kbExpr:_.editorTextFocus,primary:Ee(2089,2081),weight:100}})}},bb=class extends gd{constructor(){super(2,{id:"editor.action.removeCommentLine",label:h("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:_.writable,kbOpts:{kbExpr:_.editorTextFocus,primary:Ee(2089,2099),weight:100}})}},Cb=class extends k{constructor(){super({id:"editor.action.blockComment",label:h("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:_.writable,kbOpts:{kbExpr:_.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:O.MenubarEditMenu,group:"5_insert",title:h({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){let i=e.get(he);if(!t.hasModel())return;let o=t.getOption(23),n=[],r=t.getSelections();for(let a of r)n.push(new mn(a,o.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}};w(_b);w(vb);w(bb);w(Cb);de();Ns();E();$t();Z();we();F();Je();re();at();var _E=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Yr=function(s,e){return function(t,i){e(t,i,s)}},Sb,ga=Sb=class{static get(e){return e.getContribution(Sb.ID)}constructor(e,t,i,o,n,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=o,this._keybindingService=n,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new L,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(d=>this._onContextMenu(d))),this._toDispose.add(this._editor.onMouseWheel(d=>{if(this._contextMenuIsBeingShownCount>0){let c=this._contextViewService.getContextViewElement(),u=d.srcElement;u.shadowRoot&&Gx(c)===u.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(d=>{this._editor.getOption(24)&&d.keyCode===58&&(d.preventDefault(),d.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(let o of this._editor.getSelections())if(o.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;let t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?O.SimpleEditorContext:O.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){let i=[],o=this._menuService.createMenu(t,this._contextKeyService),n=o.getActions({arg:e.uri});o.dispose();for(let r of n){let[,a]=r,l=0;for(let d of a)if(d instanceof Ax){let c=this._getMenuActions(e,d.item.submenu);c.length>0&&(i.push(new pf(d.id,d.label,c)),l++)}else i.push(d),l++;l&&i.push(new Sr)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;let i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let o=t;if(!o){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();let r=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=et(this._editor.getDomNode()),l=a.left+r.left,d=a.top+r.top+r.height;o={x:l,y:d}}let n=this._editor.getOption(126)&&!il;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:n?this._editor.getDomNode():void 0,getAnchor:()=>o,getActions:()=>e,getActionViewItem:r=>{let a=this._keybindingFor(r);if(a)return new Rl(r,r,{label:!0,keybinding:a.getLabel(),isMenu:!0});let l=r;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new Rl(r,r,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:r=>this._keybindingFor(r),onHide:r=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||b0(this._workspaceContextService.getWorkspace()))return;let t=this._editor.getOption(72),i=0,o=d=>({id:`menu-action-${++i}`,label:d.label,tooltip:"",class:void 0,enabled:typeof d.enabled>"u"?!0:d.enabled,checked:d.checked,run:d.run}),n=(d,c)=>new pf(`menu-action-${++i}`,d,c,void 0),r=(d,c,u,g,p)=>{if(!c)return o({label:d,enabled:c,run:()=>{}});let m=C=>()=>{this._configurationService.updateValue(u,C)},f=[];for(let C of p)f.push(o({label:C.label,checked:g===C.value,run:m(C.value)}));return n(d,f)},a=[];a.push(o({label:h("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Sr),a.push(o({label:h("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(h("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:h("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:h("context.minimap.size.fill","Fill"),value:"fill"},{label:h("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(r(h("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:h("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:h("context.minimap.slider.always","Always"),value:"always"}]));let l=this._editor.getOption(126)&&!il;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:d=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};ga.ID="editor.contrib.contextmenu";ga=Sb=_E([Yr(1,fo),Yr(2,Wn),Yr(3,G),Yr(4,Ce),Yr(5,Ho),Yr(6,se),Yr(7,Xo)],ga);var wb=class extends k{constructor(){super({id:"editor.action.showContextMenu",label:h("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:_.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=ga.get(t))===null||i===void 0||i.showContextMenu()}};W(ga.ID,ga,2);w(wb);E();Z();we();F();var pd=class{constructor(e){this.selections=e}equals(e){let t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let o=0;o<t;o++)if(!this.selections[o].equalsSelection(e.selections[o]))return!1;return!0}},md=class{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}},Zr=class s extends I{static get(e){return e.getContribution(s.ID)}constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;let i=new pd(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new md(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new md(new pd(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new md(new pd(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}};Zr.ID="editor.contrib.cursorUndoRedoController";var yb=class extends k{constructor(){super({id:"cursorUndo",label:h("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:_.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var o;(o=Zr.get(t))===null||o===void 0||o.cursorUndo()}},xb=class extends k{constructor(){super({id:"cursorRedo",label:h("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var o;(o=Zr.get(t))===null||o===void 0||o.cursorRedo()}};W(Zr.ID,Zr,0);w(yb);w(xb);E();$t();Z();ke();q();ut();mt();q();ut();var Kg=class{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){let i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new b(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new V(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new V(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber<this.selection.endLineNumber){this.targetSelection=new V(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber+this.selection.endLineNumber-this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new V(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column-this.selection.endColumn+this.selection.startColumn:this.targetPosition.column-this.selection.endColumn+this.selection.startColumn,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column:this.selection.endColumn):this.targetSelection=new V(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn)}computeCursorState(e,t){return this.targetSelection}};function pa(s){return Gt?s.altKey:s.ctrlKey}var Qr=class s extends I{constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(pa(e)&&(this._modifierPressed=!0),this._mouseDown&&pa(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(pa(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===s.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){let t=e.target;if(this._dragSelection===null){let o=(this._editor.getSelections()||[]).filter(n=>t.position&&n.containsPosition(t.position));if(o.length===1)this._dragSelection=o[0];else return}pa(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){let t=new R(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){let o=this._editor.getSelection();if(o){let{selectionStartLineNumber:n,selectionStartColumn:r}=o;i=[new V(n,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(o=>o.containsPosition(t)?new V(t.lineNumber,t.column,t.lineNumber,t.column):o);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(pa(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(s.ID,new Kg(this._dragSelection,t,pa(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new b(e.lineNumber,e.column,e.lineNumber,e.column),options:s._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}};Qr.ID="editor.contrib.dragAndDrop";Qr.TRIGGER_KEY_VALUE=Gt?6:5;Qr._DECORATION_OPTIONS=te.register({description:"dnd-target",className:"dnd-target"});W(Qr.ID,Qr,2);Z();de();Fe();fe();Fe();ol();var Zn=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let s;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?s=crypto.getRandomValues.bind(crypto):s=function(i){for(let o=0;o<i.length;o++)i[o]=Math.floor(Math.random()*256);return i};let e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){s(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let o=0,n="";return n+=t[e[o++]],n+=t[e[o++]],n+=t[e[o++]],n+=t[e[o++]],n+="-",n+=t[e[o++]],n+=t[e[o++]],n+="-",n+=t[e[o++]],n+=t[e[o++]],n+="-",n+=t[e[o++]],n+=t[e[o++]],n+="-",n+=t[e[o++]],n+=t[e[o++]],n+=t[e[o++]],n+=t[e[o++]],n+=t[e[o++]],n+=t[e[o++]],n}}();function fd(s){return{asString:async()=>s,asFile:()=>{},value:typeof s=="string"?s:void 0}}function yD(s,e,t){let i={id:Zn(),name:s,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}var ma=class{constructor(){this._entries=new Map}get size(){let e=0;for(let t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){let t=[...this._entries.keys()];return gi.some(this,([i,o])=>o.asFile())&&t.push("files"),xD(qg(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){let i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(let[e,t]of this._entries)for(let i of t)yield[e,i]}toKey(e){return qg(e)}};function qg(s){return s.toLowerCase()}function Gg(s,e){return xD(qg(s),e.map(qg))}function xD(s,e){if(s==="*/*")return e.length>0;if(e.includes(s))return!0;let t=s.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;let[i,o,n]=t;return n==="*"?e.some(r=>r.startsWith(o+"/")):!1}var Xr=Object.freeze({create:s=>Xy(s.map(e=>e.toString())).join(`\r
8
8
  `),split:s=>s.split(`\r
9
9
  `),parse:s=>Xr.split(s).filter(e=>!e.startsWith("#"))});E();Sf();$t();Sf();pt();zo();var Lb={EDITORS:"CodeEditors",FILES:"CodeFiles"},Ib=class{},vE={DragAndDropContribution:"workbench.contributions.dragAndDrop"};wt.add(vE.DragAndDropContribution,new Ib);var fa=class s{constructor(){}static getInstance(){return s.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};fa.INSTANCE=new fa;function Db(s){let e=new ma;for(let t of s.items){let i=t.type;if(t.kind==="string"){let o=new Promise(n=>t.getAsString(n));e.append(i,fd(o))}else if(t.kind==="file"){let o=t.getAsFile();o&&e.append(i,bE(o))}}return e}function bE(s){let e=s.path?ne.parse(s.path):void 0;return yD(s.name,e,async()=>new Uint8Array(await s.arrayBuffer()))}var CE=Object.freeze([Lb.EDITORS,Lb.FILES,Xh.RESOURCES,Xh.INTERNAL_URI_LIST]);function $g(s,e=!1){let t=Db(s),i=t.get(Xh.INTERNAL_URI_LIST);if(i)t.replace(lt.uriList,i);else if(e||!t.has(lt.uriList)){let o=[];for(let n of s.items){let r=n.getAsFile();if(r){let a=r.path;try{a?o.push(ne.file(a).toString()):o.push(ne.parse(r.name,!0).toString())}catch{}}}o.length&&t.replace(lt.uriList,fd(Xr.create(o)))}for(let o of CE)t.delete(o);return t}q();function ID(s,e,t){var i,o;return{edits:[...e.map(n=>new Zh(s,typeof t.insertText=="string"?{range:n,text:t.insertText,insertAsSnippet:!1}:{range:n,text:t.insertText.snippet,insertAsSnippet:!0})),...(o=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&o!==void 0?o:[]]}}function Yg(s){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}let i=new Map;for(let a of s)for(let l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(let d of s)if(d!==a&&t(l,d)){let c=i.get(a);c||(c=[],i.set(a,c)),c.push(d)}if(!i.size)return Array.from(s);let o=new Set,n=[];function r(a){if(!a.length)return[];let l=a[0];if(n.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(o.has(l))return r(a.slice(1));let d=[],c=i.get(l);return c&&(n.push(l),d=r(c),n.pop()),o.add(l),[...d,l,...r(a.slice(1))]}return r(Array.from(s))}Tr();de();fe();Nt();E();Be();ti();q();mt();ge();var SE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},wE=function(s,e){return function(t,i){e(t,i,s)}},yE=te.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:fh,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),Zg=class s extends I{constructor(e,t,i,o,n){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=n,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(o),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=P(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;let t=P("span.icon");this.domNode.append(t),t.classList.add(...le.asClassNameArray($.loading),"codicon-modifier-spin");let i=()=>{let o=this.editor.getOption(66);this.domNode.style.height=`${o}px`,this.domNode.style.width=`${Math.ceil(.8*o)}px`};i(),this._register(this.editor.onDidChangeConfiguration(o=>{(o.hasChanged(52)||o.hasChanged(66))&&i()})),this._register(ce(this.domNode,Pe.CLICK,o=>{this.delegate.cancel()}))}getId(){return s.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};Zg.baseId="editor.widget.inlineProgressWidget";var _a=class extends I{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Ye),this._currentWidget=new Ye,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,i){let o=this._operationIdPool++;this._currentOperation=o,this.clear(),this._showPromise.value=Bo(()=>{let n=b.fromPositions(e);this._currentDecorations.set([{range:n,options:yE}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Zg,this.id,this._editor,n,t,i))},this._showDelay);try{return await i}finally{this._currentOperation===o&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};_a=SE([wE(2,B)],_a);F();re();ge();de();Ns();Ie();E();re();ge();var LD=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},_d=function(s,e){return function(t,i){e(t,i,s)}},kb,Qg=kb=class extends I{constructor(e,t,i,o,n,r,a,l,d,c){super(),this.typeId=e,this.editor=t,this.showCommand=o,this.range=n,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=c,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(d),this.visibleContext.set(!0),this._register(xe(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(xe(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{n.containsPosition(u.position)||this.dispose()})),this._register(Me.runAndSubscribe(c.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;let t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=P(".post-edit-widget"),this.button=this._register(new G0(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ce(this.domNode,Pe.CLICK,()=>this.showSelector()))}getId(){return kb.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{let e=et(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>Rx({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};Qg.baseId="editor.widget.postEditWidget";Qg=kb=LD([_d(7,fo),_d(8,G),_d(9,Ce)],Qg);var va=class extends I{constructor(e,t,i,o,n,r){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=o,this._instantiationService=n,this._bulkEditService=r,this._currentWidget=this._register(new Ye),this._register(Me.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,o){var n,r;let a=this._editor.getModel();if(!a||!e.length)return;let l=t.allEdits[t.activeEditIndex];if(!l)return;let d=[];(typeof l.insertText=="string"?l.insertText==="":l.insertText.snippet==="")?d=[]:d=e.map(C=>new Zh(a.uri,typeof l.insertText=="string"?{range:C,text:l.insertText,insertAsSnippet:!1}:{range:C,text:l.insertText.snippet,insertAsSnippet:!0}));let u={edits:[...d,...(r=(n=l.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&r!==void 0?r:[]]},g=e[0],p=a.deltaDecorations([],[{range:g,options:{description:"paste-line-suffix",stickiness:0}}]),m,f;try{m=await this._bulkEditService.apply(u,{editor:this._editor,token:o}),f=a.getDecorationRange(p[0])}finally{a.deltaDecorations(p,[])}i&&m.isApplied&&t.allEdits.length>1&&this.show(f??g,t,async C=>{let v=this._editor.getModel();v&&(await v.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:C,allEdits:t.allEdits},i,o))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(Qg,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};va=LD([_d(4,B),_d(5,Fn)],va);var xE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},ba=function(s,e){return function(t,i){e(t,i,s)}},Nb,Eb="editor.changePasteType",Rb=new X("pasteWidgetVisible",!1,h("pasteWidgetVisible","Whether the paste widget is showing")),Mb="application/vnd.code.copyMetadata",Qn=Nb=class extends I{static get(e){return e.getContribution(Nb.ID)}constructor(e,t,i,o,n,r,a){super(),this._bulkEditService=i,this._clipboardService=o,this._languageFeaturesService=n,this._quickInputService=r,this._progressService=a,this._editor=e;let l=e.getContainerDomNode();this._register(ce(l,"copy",d=>this.handleCopy(d))),this._register(ce(l,"cut",d=>this.handleCopy(d))),this._register(ce(l,"paste",d=>this.handlePaste(d),!0)),this._pasteProgressManager=this._register(new _a("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(va,"pasteIntoEditor",e,Rb,{id:Eb,label:h("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},hl().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus()||(sh&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;let o=this._editor.getModel(),n=this._editor.getSelections();if(!o||!n?.length)return;let r=this._editor.getOption(37),a=n,l=n.length===1&&n[0].isEmpty();if(l){if(!r)return;a=[new b(a[0].startLineNumber,1,a[0].startLineNumber,1+o.getLineLength(a[0].startLineNumber))]}let d=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(n,r,Ln),u={multicursorText:Array.isArray(d)?d:null,pasteOnNewLine:l,mode:null},g=this._languageFeaturesService.documentPasteEditProvider.ordered(o).filter(v=>!!v.prepareDocumentPaste);if(!g.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:u});return}let p=Db(e.clipboardData),m=g.flatMap(v=>{var S;return(S=v.copyMimeTypes)!==null&&S!==void 0?S:[]}),f=Zn();this.setCopyMetadata(e.clipboardData,{id:f,providerCopyMimeTypes:m,defaultPastePayload:u});let C=Se(async v=>{let S=zt(await Promise.all(g.map(async y=>{try{return await y.prepareDocumentPaste(o,a,p,v)}catch(D){console.error(D);return}})));S.reverse();for(let y of S)for(let[D,M]of y)p.replace(D,M);return p});(i=this._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:f,dataTransferPromise:C}}async handlePaste(e){var t,i;if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=this._currentPasteOperation)===null||t===void 0||t.cancel(),this._currentPasteOperation=void 0;let o=this._editor.getModel(),n=this._editor.getSelections();if(!n?.length||!o||!this.isPasteAsEnabled())return;let r=this.fetchCopyMetadata(e),a=$g(e.clipboardData);a.delete(Mb);let l=[...e.clipboardData.types,...(i=r?.providerCopyMimeTypes)!==null&&i!==void 0?i:[],lt.uriList],d=this._languageFeaturesService.documentPasteEditProvider.ordered(o).filter(c=>{var u;return(u=c.pasteMimeTypes)===null||u===void 0?void 0:u.some(g=>Gg(g,l))});d.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,d,n,a,r):this.doPasteInline(d,n,a,r))}doPasteInline(e,t,i,o){let n=Se(async r=>{let a=this._editor;if(!a.hasModel())return;let l=a.getModel(),d=new Co(a,3,void 0,r);try{if(await this.mergeInDataFromCopy(i,o,d.token),d.token.isCancellationRequested)return;let c=e.filter(g=>DD(g,i));if(!c.length||c.length===1&&c[0].id==="text"){await this.applyDefaultPasteHandler(i,o,d.token);return}let u=await this.getPasteEdits(c,i,l,t,d.token);if(d.token.isCancellationRequested)return;if(u.length===1&&u[0].providerId==="text"){await this.applyDefaultPasteHandler(i,o,d.token);return}if(u.length){let g=a.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:u},g,d.token)}await this.applyDefaultPasteHandler(i,o,d.token)}finally{d.dispose(),this._currentPasteOperation===n&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),h("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),n),this._currentPasteOperation=n}showPasteAsPick(e,t,i,o,n){let r=Se(async a=>{let l=this._editor;if(!l.hasModel())return;let d=l.getModel(),c=new Co(l,3,void 0,a);try{if(await this.mergeInDataFromCopy(o,n,c.token),c.token.isCancellationRequested)return;let u=t.filter(f=>DD(f,o));e&&(u=u.filter(f=>f.id===e));let g=await this.getPasteEdits(u,o,d,i,c.token);if(c.token.isCancellationRequested||!g.length)return;let p;if(e)p=g.at(0);else{let f=await this._quickInputService.pick(g.map(C=>({label:C.label,description:C.providerId,detail:C.detail,edit:C})),{placeHolder:h("pasteAsPickerPlaceholder","Select Paste Action")});p=f?.edit}if(!p)return;let m=ID(d.uri,i,p);await this._bulkEditService.apply(m,{editor:this._editor})}finally{c.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:h("pasteAsProgress","Running paste handlers")},()=>r)}setCopyMetadata(e,t){e.setData(Mb,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;let i=e.clipboardData.getData(Mb);if(i)try{return JSON.parse(i)}catch{return}let[o,n]=qI.getTextData(e.clipboardData);if(n)return{defaultPastePayload:{mode:n.mode,multicursorText:(t=n.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!n.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i){var o;if(t?.id&&((o=this._currentCopyOperation)===null||o===void 0?void 0:o.handle)===t.id){let n=await this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(let[r,a]of n)e.replace(r,a)}if(!e.has(lt.uriList)){let n=await this._clipboardService.readResources();if(i.isCancellationRequested)return;n.length&&e.append(lt.uriList,fd(Xr.create(n)))}}async getPasteEdits(e,t,i,o,n){let r=await En(Promise.all(e.map(async l=>{var d;try{let c=await((d=l.provideDocumentPasteEdits)===null||d===void 0?void 0:d.call(l,i,o,t,n));if(c)return{...c,providerId:l.id}}catch(c){console.error(c)}})),n),a=zt(r??[]);return Yg(a)}async applyDefaultPasteHandler(e,t,i){var o,n,r;let a=(o=e.get(lt.text))!==null&&o!==void 0?o:e.get("text");if(!a)return;let l=await a.asString();if(i.isCancellationRequested)return;let d={text:l,pasteOnNewLine:(n=t?.defaultPastePayload.pasteOnNewLine)!==null&&n!==void 0?n:!1,multicursorText:(r=t?.defaultPastePayload.multicursorText)!==null&&r!==void 0?r:null,mode:null};this._editor.trigger("keyboard","paste",d)}};Qn.ID="editor.contrib.copyPasteActionController";Qn=Nb=xE([ba(1,B),ba(2,Fn),ba(3,Ki),ba(4,N),ba(5,Ot),ba(6,m0)],Qn);function DD(s,e){var t;return!!(!((t=s.pasteMimeTypes)===null||t===void 0)&&t.some(i=>e.matches(i)))}Fe();E();Sf();Rs();yi();pt();F();var Tb=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},vd=function(s,e){return function(t,i){e(t,i,s)}},Pb=h("builtIn","Built-in"),bd=class{async provideDocumentPasteEdits(e,t,i,o){let n=await this.getEdit(i,o);return n?{insertText:n.insertText,label:n.label,detail:n.detail,handledMimeType:n.handledMimeType,yieldTo:n.yieldTo}:void 0}async provideDocumentOnDropEdits(e,t,i,o){let n=await this.getEdit(i,o);return n?{insertText:n.insertText,label:n.label,handledMimeType:n.handledMimeType,yieldTo:n.yieldTo}:void 0}},Xg=class extends bd{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[lt.text],this.pasteMimeTypes=[lt.text]}async getEdit(e,t){let i=e.get(lt.text);if(!i||e.has(lt.uriList))return;let o=await i.asString();return{handledMimeType:lt.text,label:h("text.label","Insert Plain Text"),detail:Pb,insertText:o}}},Jg=class extends bd{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[lt.uriList],this.pasteMimeTypes=[lt.uriList]}async getEdit(e,t){let i=await kD(e);if(!i.length||t.isCancellationRequested)return;let o=0,n=i.map(({uri:a,originalText:l})=>a.scheme===yt.file?a.fsPath:(o++,l)).join(" "),r;return o>0?r=i.length>1?h("defaultDropProvider.uriList.uris","Insert Uris"):h("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?h("defaultDropProvider.uriList.paths","Insert Paths"):h("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:lt.uriList,insertText:n,label:r,detail:Pb}}},ep=class extends bd{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[lt.uriList],this.pasteMimeTypes=[lt.uriList]}async getEdit(e,t){let i=await kD(e);if(!i.length||t.isCancellationRequested)return;let o=zt(i.map(({uri:n})=>{let r=this._workspaceContextService.getWorkspaceFolder(n);return r?l0(r.uri,n):void 0}));if(o.length)return{handledMimeType:lt.uriList,insertText:o.join(" "),label:i.length>1?h("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):h("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:Pb}}};ep=Tb([vd(0,Xo)],ep);async function kD(s){let e=s.get(lt.uriList);if(!e)return[];let t=await e.asString(),i=[];for(let o of Xr.parse(t))try{i.push({uri:ne.parse(o),originalText:o})}catch{}return i}var tp=class extends I{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new Xg)),this._register(e.documentOnDropEditProvider.register("*",new Jg)),this._register(e.documentOnDropEditProvider.register("*",new ep(t)))}};tp=Tb([vd(0,N),vd(1,Xo)],tp);var ip=class extends I{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Xg)),this._register(e.documentPasteEditProvider.register("*",new Jg)),this._register(e.documentPasteEditProvider.register("*",new ep(t)))}};ip=Tb([vd(0,N),vd(1,Xo)],ip);F();W(Qn.ID,Qn,0);Hn(ip);H(new class extends je{constructor(){super({id:Eb,precondition:Rb,kbOpts:{weight:100,primary:2137}})}runEditorCommand(s,e,t){var i;return(i=Qn.get(e))===null||i===void 0?void 0:i.changePasteType()}});w(class extends k{constructor(){super({id:"editor.action.pasteAs",label:h("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,metadata:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:h("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(s,e,t){var i;let o=typeof t?.id=="string"?t.id:void 0;return(i=Qn.get(e))===null||i===void 0?void 0:i.pasteAs(o)}});Z();F();wf();zo();Fe();fe();E();q();var op=class{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){let t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}},Cd=class{constructor(e){this.identifier=e}};Uo();ge();var Ob=Et("treeViewsDndService");Pt(Ob,op,1);Tr();F();at();re();ge();var IE=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},np=function(s,e){return function(t,i){e(t,i,s)}},Ab,Fb="editor.experimental.dropIntoEditor.defaultProvider",Wb="editor.changeDropType",zb=new X("dropWidgetVisible",!1,h("dropWidgetVisible","Whether the drop widget is showing")),Jr=Ab=class extends I{static get(e){return e.getContribution(Ab.ID)}constructor(e,t,i,o,n){super(),this._configService=i,this._languageFeaturesService=o,this._treeViewsDragAndDropService=n,this.treeItemsTransfer=fa.getInstance(),this._dropProgressManager=this._register(t.createInstance(_a,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(va,"dropIntoEditor",e,zb,{id:Wb,label:h("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){var o;if(!i.dataTransfer||!e.hasModel())return;(o=this._currentOperation)===null||o===void 0||o.cancel(),e.focus(),e.setPosition(t);let n=Se(async r=>{let a=new Co(e,1,void 0,r);try{let l=await this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;let d=e.getModel();if(!d)return;let c=this._languageFeaturesService.documentOnDropEditProvider.ordered(d).filter(g=>g.dropMimeTypes?g.dropMimeTypes.some(p=>l.matches(p)):!0),u=await this.getDropEdits(c,d,t,l,a);if(a.token.isCancellationRequested)return;if(u.length){let g=this.getInitialActiveEditIndex(d,u),p=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([b.fromPositions(t)],{activeEditIndex:g,allEdits:u},p,r)}}finally{a.dispose(),this._currentOperation===n&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,h("dropIntoEditorProgress","Running drop handlers. Click to cancel"),n),this._currentOperation=n}async getDropEdits(e,t,i,o,n){let r=await En(Promise.all(e.map(async l=>{try{let d=await l.provideDocumentOnDropEdits(t,i,o,n.token);if(d)return{...d,providerId:l.id}}catch(d){console.error(d)}})),n.token),a=zt(r??[]);return Yg(a)}getInitialActiveEditIndex(e,t){let i=this._configService.getValue(Fb,{resource:e.uri});for(let[o,n]of Object.entries(i)){let r=t.findIndex(a=>n===a.providerId&&a.handledMimeType&&Gg(o,[a.handledMimeType]));if(r>=0)return r}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new ma;let t=$g(e.dataTransfer);if(this.treeItemsTransfer.hasData(Cd.prototype)){let i=this.treeItemsTransfer.getData(Cd.prototype);if(Array.isArray(i))for(let o of i){let n=await this._treeViewsDragAndDropService.removeDragOperationTransfer(o.identifier);if(n)for(let[r,a]of n)t.replace(r,a)}}return t}};Jr.ID="editor.contrib.dropIntoEditorController";Jr=Ab=IE([np(1,B),np(2,se),np(3,N),np(4,Ob)],Jr);W(Jr.ID,Jr,2);H(new class extends je{constructor(){super({id:Wb,precondition:zb,kbOpts:{weight:100,primary:2137}})}runEditorCommand(s,e,t){var i;(i=Jr.get(e))===null||i===void 0||i.changeDropType()}});Hn(tp);wt.as(Lr.Configuration).registerConfiguration({...El,properties:{[Fb]:{type:"object",scope:5,description:h("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});fe();E();Be();Z();GI();we();Pn();gl();fe();E();ke();q();ut();xM();q();Pn();mt();Lt();Dt();var Lo=class s{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){let e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){let t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){let t=e<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(e){let t=this._editor.getModel().getDecorationsInRange(e);for(let i of t){let o=i.options;if(o===s._FIND_MATCH_DECORATION||o===s._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let o=0,n=this._decorations.length;o<n;o++){let r=this._editor.getModel().getDecorationRange(this._decorations[o]);if(e.equalsRange(r)){t=this._decorations[o],i=o+1;break}}return(this._highlightedDecorationId!==null||t!==null)&&this._editor.changeDecorations(o=>{if(this._highlightedDecorationId!==null&&(o.changeDecorationOptions(this._highlightedDecorationId,s._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,o.changeDecorationOptions(this._highlightedDecorationId,s._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(o.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let n=this._editor.getModel().getDecorationRange(t);if(n.startLineNumber!==n.endLineNumber&&n.endColumn===1){let r=n.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);n=new b(n.startLineNumber,n.startColumn,r,a)}this._rangeHighlightDecorationId=o.addDecoration(n,s._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let o=s._FIND_MATCH_DECORATION,n=[];if(e.length>1e3){o=s._FIND_MATCH_NO_OVERVIEW_DECORATION;let a=this._editor.getModel().getLineCount(),d=this._editor.getLayoutInfo().height/a,c=Math.max(2,Math.ceil(3/d)),u=e[0].range.startLineNumber,g=e[0].range.endLineNumber;for(let p=1,m=e.length;p<m;p++){let f=e[p].range;g+c>=f.startLineNumber?f.endLineNumber>g&&(g=f.endLineNumber):(n.push({range:new b(u,1,g,1),options:s._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=f.startLineNumber,g=f.endLineNumber)}n.push({range:new b(u,1,g,1),options:s._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}let r=new Array(e.length);for(let a=0,l=e.length;a<l;a++)r[a]={range:e[a].range,options:o};this._decorations=i.deltaDecorations(this._decorations,r),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,n),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(a=>i.removeDecoration(a)),this._findScopeDecorationIds=[]),t?.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,s._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){let i=this._decorations[t],o=this._editor.getModel().getDecorationRange(i);if(!(!o||o.endLineNumber>e.lineNumber)){if(o.endLineNumber<e.lineNumber)return o;if(!(o.endColumn>e.column))return o}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;t<i;t++){let o=this._decorations[t],n=this._editor.getModel().getDecorationRange(o);if(!(!n||n.startLineNumber<e.lineNumber)){if(n.startLineNumber>e.lineNumber)return n;if(!(n.startColumn<e.column))return n}}return this._editor.getModel().getDecorationRange(this._decorations[0])}_allDecorations(){let e=[];return e=e.concat(this._decorations),e=e.concat(this._overviewRulerApproximateDecorations),this._findScopeDecorationIds.length&&e.push(...this._findScopeDecorationIds),this._rangeHighlightDecorationId&&e.push(this._rangeHighlightDecorationId),e}};Lo._CURRENT_FIND_MATCH_DECORATION=te.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:Ae(Fh),position:si.Center},minimap:{color:Ae(Nf),position:lo.Inline}});Lo._FIND_MATCH_DECORATION=te.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:Ae(Fh),position:si.Center},minimap:{color:Ae(Nf),position:lo.Inline}});Lo._FIND_MATCH_NO_OVERVIEW_DECORATION=te.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0});Lo._FIND_MATCH_ONLY_OVERVIEW_DECORATION=te.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:Ae(Fh),position:si.Center}});Lo._RANGE_HIGHLIGHT_DECORATION=te.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0});Lo._FIND_SCOPE_DECORATION=te.register({description:"find-scope",className:"findScope",isWholeLine:!0});q();var rp=class{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){let i=[];for(let r=0;r<this._ranges.length;r++)i.push({range:this._ranges[r],text:this._replaceStrings[r]});i.sort((r,a)=>b.compareRangesUsingStarts(r.range,a.range));let o=[],n=i[0];for(let r=1;r<i.length;r++)n.range.endLineNumber===i[r].range.startLineNumber&&n.range.endColumn===i[r].range.startColumn?(n.range=n.range.plusRange(i[r].range),n.text=n.text+i[r].text):(o.push(n),n=i[r]);o.push(n);for(let r of o)t.addEditOperation(r.range,r.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}};Be();function Hb(s,e){if(s&&s[0]!==""){let t=MD(s,e,"-"),i=MD(s,e,"_");return t&&!i?ND(s,e,"-"):!t&&i?ND(s,e,"_"):s[0].toUpperCase()===s[0]?e.toUpperCase():s[0].toLowerCase()===s[0]?e.toLowerCase():kx(s[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):s[0][0].toUpperCase()!==s[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function MD(s,e,t){return s[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&s[0].split(t).length===e.split(t).length}function ND(s,e,t){let i=e.split(t),o=s[0].split(t),n="";return i.forEach((r,a)=>{n+=Hb([o[a]],r)+t}),n.slice(0,-1)}var sp=class{constructor(e){this.staticValue=e,this.kind=0}},Bb=class{constructor(e){this.pieces=e,this.kind=1}},Sa=class s{static fromStaticValue(e){return new s([Ca.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new sp(""):e.length===1&&e[0].staticValue!==null?this._state=new sp(e[0].staticValue):this._state=new Bb(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?Hb(e,this._state.staticValue):this._state.staticValue;let i="";for(let o=0,n=this._state.pieces.length;o<n;o++){let r=this._state.pieces[o];if(r.staticValue!==null){i+=r.staticValue;continue}let a=s._substitute(r.matchIndex,e);if(r.caseOps!==null&&r.caseOps.length>0){let l=[],d=r.caseOps.length,c=0;for(let u=0,g=a.length;u<g;u++){if(c>=d){l.push(a.slice(u));break}switch(r.caseOps[c]){case"U":l.push(a[u].toUpperCase());break;case"u":l.push(a[u].toUpperCase()),c++;break;case"L":l.push(a[u].toLowerCase());break;case"l":l.push(a[u].toLowerCase()),c++;break;default:l.push(a[u])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}},Ca=class s{static staticValue(e){return new s(e,-1,null)}static caseOps(e,t){return new s(null,e,t)}constructor(e,t,i){this.staticValue=e,this.matchIndex=t,!i||i.length===0?this.caseOps=null:this.caseOps=i.slice(0)}},Vb=class{constructor(e){this._source=e,this._lastCharIndex=0,this._result=[],this._resultLen=0,this._currentStaticPiece=""}emitUnchanged(e){this._emitStatic(this._source.substring(this._lastCharIndex,e)),this._lastCharIndex=e}emitStatic(e,t){this._emitStatic(e),this._lastCharIndex=t}_emitStatic(e){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Ca.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=Ca.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Ca.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new Sa(this._result)}};function ED(s){if(!s||s.length===0)return new Sa(null);let e=[],t=new Vb(s);for(let i=0,o=s.length;i<o;i++){let n=s.charCodeAt(i);if(n===92){if(i++,i>=o)break;let r=s.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(`
@@ -66,4 +66,4 @@ The flag will not be saved for the future.
66
66
  `):void 0}:{range:b.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
67
67
  `):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,o){let n=this._providers[t];if(!n)return{edits:[],rejectReason:i.join(`
68
68
  `)};let r=await n.provideRenameEdits(this.model,this.position,e,o);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),o)}else return this._provideRenameEdits(e,t+1,i.concat(h("no result","No result.")),o);return r}};async function AT(s,e,t,i){let o=new kc(e,t,s),n=await o.resolveRenameLocation(Y.None);return n?.rejectReason?{edits:[],rejectReason:n.rejectReason}:o.provideRenameEdits(i,Y.None)}var ps=fw=class{static get(e){return e.getContribution(fw.ID)}constructor(e,t,i,o,n,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=o,this._progressService=n,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new L,this._cts=new We,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(Sm,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var e,t;if(this._cts.dispose(!0),this._cts=new We,!this.editor.hasModel())return;let i=this.editor.getPosition(),o=new kc(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!o.hasProvider())return;let n=new Co(this.editor,5,void 0,this._cts.token),r;try{let m=o.resolveRenameLocation(n.token);this._progressService.showWhile(m,250),r=await m}catch(m){(e=kt.get(this.editor))===null||e===void 0||e.showMessage(m||h("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}finally{n.dispose()}if(!r)return;if(r.rejectReason){(t=kt.get(this.editor))===null||t===void 0||t.showMessage(r.rejectReason,i);return}if(n.token.isCancellationRequested)return;let a=new Co(this.editor,5,r.range,this._cts.token),l=this.editor.getSelection(),d=0,c=r.text.length;!b.isEmpty(l)&&!b.spansMultipleLines(l)&&b.containsRange(r.range,l)&&(d=Math.max(0,l.startColumn-r.range.startColumn),c=Math.min(r.range.endColumn,l.endColumn)-r.range.startColumn);let u=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),g=await this._renameInputField.getInput(r.range,r.text,d,c,u,a.token);if(typeof g=="boolean"){g&&this.editor.focus(),a.dispose();return}this.editor.focus();let p=En(o.provideRenameEdits(g.newName,a.token),a.token).then(async m=>{if(!(!m||!this.editor.hasModel())){if(m.rejectReason){this._notificationService.info(m.rejectReason);return}this.editor.setSelection(b.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(m,{editor:this.editor,showPreview:g.wantsPreview,label:h("label","Renaming '{0}' to '{1}'",r?.text,g.newName),code:"undoredo.rename",quotableLabel:h("quotableLabel","Renaming {0} to {1}",r?.text,g.newName),respectAutoSaveConfig:!0}).then(f=>{f.ariaSummary&&nt(h("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",r.text,g.newName,f.ariaSummary))}).catch(f=>{this._notificationService.error(h("rename.failedApply","Rename failed to apply edits")),this._logService.error(f)})}},m=>{this._notificationService.error(h("rename.failed","Rename failed to compute edits")),this._logService.error(m)}).finally(()=>{a.dispose()});return this._progressService.showWhile(p,250),p}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};ps.ID="editor.contrib.renameController";ps=fw=OT([gs(1,B),gs(2,He),gs(3,Fn),gs(4,Qo),gs(5,Nn),gs(6,aI),gs(7,N)],ps);var _w=class extends k{constructor(){super({id:"editor.action.rename",label:h("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:x.and(_.writable,_.hasRenameProvider),kbOpts:{kbExpr:_.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){let i=e.get(_e),[o,n]=Array.isArray(t)&&t||[void 0,void 0];return ne.isUri(o)&&R.isIPosition(n)?i.openCodeEditor({resource:o},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(n),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},ee):super.runCommand(e,t)}run(e,t){let i=ps.get(t);return i?i.run():Promise.resolve()}};W(ps.ID,ps,4);w(_w);var vw=je.bindToContribution(ps.get);H(new vw({id:"acceptRenameInput",precondition:Dc,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:x.and(_.focus,x.not("isComposing")),primary:3}}));H(new vw({id:"acceptRenameInputWithPreview",precondition:x.and(Dc,x.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:x.and(_.focus,x.not("isComposing")),primary:1027}}));H(new vw({id:"cancelRenameInput",precondition:Dc,handler:s=>s.cancelRenameInput(),kbOpts:{weight:199,kbExpr:_.focus,primary:9,secondary:[1033]}}));ri("_executeDocumentRenameProvider",function(s,e,t,...i){let[o]=i;ue(typeof o=="string");let{renameProvider:n}=s.get(N);return AT(n,e,t,o)});ri("_executePrepareRename",async function(s,e,t){let{renameProvider:i}=s.get(N),n=await new kc(e,t,i).resolveRenameLocation(Y.None);if(n?.rejectReason)throw new Error(n.rejectReason);return n});wt.as(Lr.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:h("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});E();me();Ri();at();fe();Te();Dt();Te();me();pt();Ri();Ue();St();wM();$t();function FT(s){for(let e=0,t=s.length;e<t;e+=4){let i=s[e+0],o=s[e+1],n=s[e+2],r=s[e+3];s[e+0]=r,s[e+1]=n,s[e+2]=o,s[e+3]=i}}function WT(s){let e=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return ax()||FT(e),Jx.wrap(e)}function bw(s){let e=new Uint32Array(zT(s)),t=0;if(e[t++]=s.id,s.type==="full")e[t++]=1,e[t++]=s.data.length,e.set(s.data,t),t+=s.data.length;else{e[t++]=2,e[t++]=s.deltas.length;for(let i of s.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return WT(e)}function zT(s){let e=0;if(e+=2,s.type==="full")e+=1+s.data.length;else{e+=1,e+=3*s.deltas.length;for(let t of s.deltas)t.data&&(e+=t.data.length)}return e}q();function Mc(s){return s&&!!s.data}function ww(s){return s&&Array.isArray(s.edits)}var Cw=class{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}};function yw(s,e){return s.has(e)}function HT(s,e){let t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function xw(s,e,t,i,o){let n=HT(s,e),r=await Promise.all(n.map(async a=>{let l,d=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,o)}catch(c){d=c,l=null}return(!l||!Mc(l)&&!ww(l))&&(l=null),new Cw(a,l,d)}));for(let a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function BT(s,e){let t=s.orderedGroups(e);return t.length>0?t[0]:null}var Sw=class{constructor(e,t){this.provider=e,this.tokens=t}};function zk(s,e){return s.has(e)}function Hk(s,e){let t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function wm(s,e,t,i){let o=Hk(s,e),n=await Promise.all(o.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){pe(l),a=null}return(!a||!Mc(a))&&(a=null),new Sw(r,a)}));for(let r of n)if(r.tokens)return r;return n.length>0?n[0]:null}ae.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{let[t]=e;ue(t instanceof ne);let i=s.get(ze).getModel(t);if(!i)return;let{documentSemanticTokensProvider:o}=s.get(N),n=BT(o,i);return n?n[0].getLegend():s.get(Ne).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});ae.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{let[t]=e;ue(t instanceof ne);let i=s.get(ze).getModel(t);if(!i)return;let{documentSemanticTokensProvider:o}=s.get(N);if(!yw(o,i))return s.get(Ne).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());let n=await xw(o,i,null,null,Y.None);if(!n)return;let{provider:r,tokens:a}=n;if(!a||!Mc(a))return;let l=bw({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l});ae.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{let[t,i]=e;ue(t instanceof ne);let o=s.get(ze).getModel(t);if(!o)return;let{documentRangeSemanticTokensProvider:n}=s.get(N),r=Hk(n,o);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!b.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();let a=await wm(n,o,b.lift(i),Y.None);if(a)return a.provider.getLegend()});ae.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{let[t,i]=e;ue(t instanceof ne),ue(b.isIRange(i));let o=s.get(ze).getModel(t);if(!o)return;let{documentRangeSemanticTokensProvider:n}=s.get(N),r=await wm(n,o,b.lift(i),Y.None);if(!(!r||!r.tokens))return bw({id:0,type:"full",data:r.tokens.data})});Ao();var Nc="editor.semanticHighlighting";function Ec(s,e,t){var i;let o=(i=t.getValue(Nc,{overrideIdentifier:s.getLanguageId(),resource:s.uri}))===null||i===void 0?void 0:i.enabled;return typeof o=="boolean"?o:e.getColorTheme().semanticHighlighting}var Bk=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},To=function(s,e){return function(t,i){e(t,i,s)}},pr,Iw=class extends I{constructor(e,t,i,o,n,r){super(),this._watchers=Object.create(null);let a=c=>{this._watchers[c.uri.toString()]=new Rc(c,e,i,n,r)},l=(c,u)=>{u.dispose(),delete this._watchers[c.uri.toString()]},d=()=>{for(let c of t.getModels()){let u=this._watchers[c.uri.toString()];Ec(c,i,o)?u||a(c):u&&l(c,u)}};this._register(t.onModelAdded(c=>{Ec(c,i,o)&&a(c)})),this._register(t.onModelRemoved(c=>{let u=this._watchers[c.uri.toString()];u&&l(c,u)})),this._register(o.onDidChangeConfiguration(c=>{c.affectsConfiguration(Nc)&&d()})),this._register(i.onDidColorThemeChange(d))}dispose(){for(let e of Object.values(this._watchers))e.dispose();super.dispose()}};Iw=Bk([To(0,Nl),To(1,ze),To(2,dt),To(3,se),To(4,rt),To(5,N)],Iw);var Rc=pr=class extends I{constructor(e,t,i,o,n){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=n.documentSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentSemanticTokens",{min:pr.REQUEST_MIN_DELAY,max:pr.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new De(()=>this._fetchDocumentSemanticTokensNow(),pr.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));let r=()=>{$e(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(let a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),$e(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!yw(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;let e=new We,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,o=xw(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;let n=[],r=this._model.onDidChangeContent(l=>{n.push(l)}),a=new st(!1);o.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,n);else{let{provider:d,tokens:c}=l,u=this._semanticTokensStylingService.getStyling(d);this._setDocumentSemanticTokens(d,c||null,u,n)}},l=>{l&&(Ei(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||ee(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(n.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,o,n){n=Math.min(n,i.length-o,e.length-t);for(let r=0;r<n;r++)i[o+r]=e[t+r]}_setDocumentSemanticTokens(e,t,i,o){let n=this._currentDocumentResponse,r=()=>{(o.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(ww(t)){if(!n){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:n.data};else{let a=0;for(let g of t.edits)a+=(g.data?g.data.length:0)-g.deleteCount;let l=n.data,d=new Uint32Array(l.length+a),c=l.length,u=d.length;for(let g=t.edits.length-1;g>=0;g--){let p=t.edits[g];if(p.start>l.length){i.warnInvalidEditStart(n.resultId,t.resultId,g,p.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}let m=c-(p.start+p.deleteCount);m>0&&(pr._copy(l,c-m,d,u-m,m),u-=m),p.data&&(pr._copy(p.data,0,d,u-p.data.length,p.data.length),u-=p.data.length),c=p.start}c>0&&pr._copy(l,0,d,0,c),t={resultId:t.resultId,data:d}}}if(Mc(t)){this._currentDocumentResponse=new Lw(e,t.resultId,t.data);let a=Yh(t,i,this._model.getLanguageId());if(o.length>0)for(let l of o)for(let d of a)for(let c of l.changes)d.applyEdit(c.range,c.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}};Rc.REQUEST_MIN_DELAY=300;Rc.REQUEST_MAX_DELAY=2e3;Rc=pr=Bk([To(1,Nl),To(2,dt),To(3,rt),To(4,N)],Rc);var Lw=class{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}};Hn(Iw);fe();E();Z();at();Dt();Ao();var VT=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Tc=function(s,e){return function(t,i){e(t,i,s)}},Pc=class extends I{constructor(e,t,i,o,n,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=o,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new De(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];let a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(Nc)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(let e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;let e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!Ec(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!zk(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}let t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){let i=e.getVersionId(),o=Se(r=>Promise.resolve(wm(this._provider,e,t,r))),n=new st(!1);return o.then(r=>{if(this._debounceInformation.update(e,n.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;let{provider:a,tokens:l}=r,d=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,Yh(l,d,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(o),()=>this._removeOutstandingRequest(o)),o}};Pc.ID="editor.contrib.viewportSemanticTokens";Pc=VT([Tc(1,Nl),Tc(2,dt),Tc(3,se),Tc(4,rt),Tc(5,N)],Pc);W(Pc.ID,Pc,1);Fe();Te();me();Z();ke();q();ut();we();Be();q();var ym=class{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){let i=[];for(let o of t){let n=[];i.push(n),this.selectSubwords&&this._addInWordRanges(n,e,o),this._addWordRanges(n,e,o),this._addWhitespaceLine(n,e,o),n.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){let o=t.getWordAtPosition(i);if(!o)return;let{word:n,startColumn:r}=o,a=i.column-r,l=a,d=a,c=0;for(;l>=0;l--){let u=n.charCodeAt(l);if(l!==a&&(u===95||u===45))break;if(hf(u)&&uf(c))break;c=u}for(l+=1;d<n.length;d++){let u=n.charCodeAt(d);if(uf(u)&&hf(c))break;if(u===95||u===45)break;c=u}l<d&&e.push({range:new b(i.lineNumber,r+l,i.lineNumber,r+d)})}_addWordRanges(e,t,i){let o=t.getWordAtPosition(i);o&&e.push({range:new b(i.lineNumber,o.startColumn,i.lineNumber,o.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new b(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}};F();Je();Ue();ro();St();pt();var UT=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},jT=function(s,e){return function(t,i){e(t,i,s)}},Dw,kw=class s{constructor(e,t){this.index=e,this.ranges=t}mov(e){let t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;let i=new s(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}},Ba=Dw=class{static get(e){return e.getContribution(Dw.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}async run(e){if(!this._editor.hasModel())return;let t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await Vk(this._languageFeaturesService.selectionRangeProvider,i,t.map(n=>n.getPosition()),this._editor.getOption(112),Y.None).then(n=>{var r;if(!(!Ge(n)||n.length!==t.length)&&!(!this._editor.hasModel()||!ui(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<n.length;a++)n[a]=n[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),n[a].unshift(t[a]);this._state=n.map(a=>new kw(0,a)),(r=this._selectionListener)===null||r===void 0||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(n=>n.mov(e));let o=this._state.map(n=>V.fromPositions(n.ranges[n.index].getStartPosition(),n.ranges[n.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(o)}finally{this._ignoreSelection=!1}}};Ba.ID="editor.contrib.smartSelectController";Ba=Dw=UT([jT(1,N)],Ba);var xm=class extends k{constructor(e,t){super(t),this._forward=e}async run(e,t){let i=Ba.get(t);i&&await i.run(this._forward)}},Mw=class extends xm{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:h("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:_.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:O.MenubarSelectionMenu,group:"1_basic",title:h({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}};ae.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");var Nw=class extends xm{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:h("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:_.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:O.MenubarSelectionMenu,group:"1_basic",title:h({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}};W(Ba.ID,Ba,4);w(Mw);w(Nw);async function Vk(s,e,t,i,o){let n=s.all(e).concat(new ym(i.selectSubwords));n.length===1&&n.unshift(new or);let r=[],a=[];for(let l of n)r.push(Promise.resolve(l.provideSelectionRanges(e,t,o)).then(d=>{if(Ge(d)&&d.length===t.length)for(let c=0;c<t.length;c++){a[c]||(a[c]=[]);for(let u of d[c])b.isIRange(u.range)&&b.containsPosition(u.range,t[c])&&a[c].push(b.lift(u.range))}},pe));return await Promise.all(r),a.map(l=>{if(l.length===0)return[];l.sort((g,p)=>R.isBefore(g.getStartPosition(),p.getStartPosition())?1:R.isBefore(p.getStartPosition(),g.getStartPosition())||R.isBefore(g.getEndPosition(),p.getEndPosition())?-1:R.isBefore(p.getEndPosition(),g.getEndPosition())?1:0);let d=[],c;for(let g of l)(!c||b.containsRange(g,c)&&!b.equalsRange(g,c))&&(d.push(g),c=g);if(!i.selectLeadingAndTrailingWhitespace)return d;let u=[d[0]];for(let g=1;g<d.length;g++){let p=d[g-1],m=d[g];if(m.startLineNumber!==p.startLineNumber||m.endLineNumber!==p.endLineNumber){let f=new b(p.startLineNumber,e.getLineFirstNonWhitespaceColumn(p.startLineNumber),p.endLineNumber,e.getLineLastNonWhitespaceColumn(p.endLineNumber));f.containsRange(p)&&!f.equalsRange(p)&&m.containsRange(f)&&!m.equalsRange(f)&&u.push(f);let C=new b(p.startLineNumber,1,p.endLineNumber,e.getLineMaxColumn(p.endLineNumber));C.containsRange(p)&&!C.equalsRange(f)&&m.containsRange(C)&&!m.equalsRange(C)&&u.push(C)}u.push(m)}return u})}ae.registerCommand("_executeSelectionRangeProvider",async function(s,...e){let[t,i]=e;ue(ne.isUri(t));let o=s.get(N).selectionRangeProvider,n=await s.get(gt).createModelReference(t);try{return Vk(o,n.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},Y.None)}finally{n.dispose()}});Z();Z();F();F();var Uk=Object.freeze({View:{value:h("view","View"),original:"View"},Help:{value:h("help","Help"),original:"Help"},Test:{value:h("test","Test"),original:"Test"},File:{value:h("file","File"),original:"File"},Preferences:{value:h("preferences","Preferences"),original:"Preferences"},Developer:{value:h({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer"),original:"Developer"}});Je();at();re();we();E();de();Fe();E();ti();ke();eI();var Oc=class{constructor(e,t,i,o=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=o}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&ui(this.startLineNumbers,e.startLineNumbers)&&ui(this.endLineNumbers,e.endLineNumbers)}},jk=Ts("stickyScrollViewLayer",{createHTML:s=>s}),Ew="data-sticky-line-index",Kk="data-sticky-is-line",KT="data-sticky-is-line-number",qk="data-sticky-is-folding-icon",Im=class extends I{constructor(e){super(),this._editor=e,this._foldingIconStore=new L,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(66),this._stickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof xi),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);let t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(114)&&t(),i.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&i===1/0)return;this._previousState=e;let o=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;let r=[...e.startLineNumbers];e.showEndForLine!==null&&(r[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=r}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(o,t,i)}_updateWidgetWidth(){let e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),ii(this._lineNumbersDomNode),ii(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(let t of this._stickyLines){let i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i=1/0){let o=this._editor.getLayoutInfo();for(let[r,a]of this._lineNumbers.entries()){let l=e[r],d=a>=i||l?.lineNumber!==a?this._renderChildNode(r,a,t,o):this._updateTopAndZIndexOfStickyLine(l);d&&(this._linesDomNode.appendChild(d.lineDomNode),this._lineNumbersDomNode.appendChild(d.lineNumberDomNode),this._stickyLines.push(d))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));let n=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(n===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${n}px`,this._linesDomNodeScrollable.style.height=`${n}px`,this._rootDomNode.style.height=`${n}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(ce(this._lineNumbersDomNode,Pe.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(ce(this._lineNumbersDomNode,Pe.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,o){let n=this._editor._getViewModel();if(!n)return;let r=n.coordinatesConverter.convertModelPositionToViewPosition(new R(t,1)).lineNumber,a=n.getViewLineRenderingData(r),l=this._editor.getOption(67),d;try{d=ml.filter(a.inlineDecorations,r,a.minColumn,a.maxColumn)}catch{d=[]}let c=new kh(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,d,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),u=new Lh(2e3),g=Mh(c,u),p;jk?p=jk.createHTML(u.build()):p=u.build();let m=document.createElement("span");m.setAttribute(Ew,String(e)),m.setAttribute(Kk,""),m.setAttribute("role","listitem"),m.tabIndex=0,m.className="sticky-line-content",m.classList.add(`stickyLine${t}`),m.style.lineHeight=`${this._lineHeight}px`,m.innerHTML=p;let f=document.createElement("span");f.setAttribute(Ew,String(e)),f.setAttribute(KT,""),f.className="sticky-line-number",f.style.lineHeight=`${this._lineHeight}px`;let C=o.contentLeft;f.style.width=`${C}px`;let v=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?v.innerText=t.toString():l.renderType===2&&(v.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),v.className="sticky-line-number-inner",v.style.lineHeight=`${this._lineHeight}px`,v.style.width=`${o.lineNumbersWidth}px`,v.style.paddingLeft=`${o.lineNumbersLeft}px`,f.appendChild(v);let S=this._renderFoldingIconForLine(i,t);S&&f.appendChild(S.domNode),this._editor.applyFontInfo(m),this._editor.applyFontInfo(v),f.style.lineHeight=`${this._lineHeight}px`,m.style.lineHeight=`${this._lineHeight}px`,f.style.height=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`;let y=new Rw(e,t,m,f,S,g.characterMapping);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var t;let i=e.index,o=e.lineDomNode,n=e.lineNumberDomNode,r=i===this._lineNumbers.length-1,a="0",l="1";o.style.zIndex=r?a:l,n.style.zIndex=r?a:l;let d=`${i*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,c=`${i*this._lineHeight}px`;return o.style.top=r?d:c,n.style.top=r?d:c,e}_renderFoldingIconForLine(e,t){let i=this._editor.getOption(109);if(!e||i==="never")return;let o=e.regions,n=o.findRange(t),r=o.getStartLineNumber(n);if(!(t===r))return;let l=o.isCollapsed(n),d=new Tw(l,r,o.getEndLineNumber(n),this._lineHeight);return d.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),d.domNode.setAttribute(qk,""),d}_updateMinContentWidth(){this._minContentWidthInPx=0;for(let e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._stickyLines.length&&this._stickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;let t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;let i=VI(t.characterMapping,e,0);return new R(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return(i=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&i!==void 0?i:null}_getRenderedStickyLineFromChildDomNode(e){let t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){let t=this._getAttributeValue(e,Ew);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Kk)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,qk)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){let i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}},Rw=class{constructor(e,t,i,o,n,r){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=o,this.foldingIcon=n,this.characterMapping=r}},Tw=class{constructor(e,t,i,o){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=o,this.domNode=document.createElement("div"),this.domNode.style.width=`${o}px`,this.domNode.style.height=`${o}px`,this.domNode.className=le.asClassName(e?Td:Rd)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}};E();Te();fe();Fe();Ie();It();E();fe();It();me();var yn=class{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}},ms=class{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}},Ac=class{constructor(e,t,i,o){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=o}};ol();var Mm=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Wc=function(s,e){return function(t,i){e(t,i,s)}},Fc;(function(s){s.OUTLINE_MODEL="outlineModel",s.FOLDING_PROVIDER_MODEL="foldingProviderModel",s.INDENTATION_MODEL="indentationModel"})(Fc||(Fc={}));var mr;(function(s){s[s.VALID=0]="VALID",s[s.INVALID=1]="INVALID",s[s.CANCELED=2]="CANCELED"})(mr||(mr={}));var Lm=class extends I{constructor(e,t,i,o){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=i,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Si(300)),this._updateOperation=this._register(new L);let n=new Pw(i),r=new Aw(this._editor,i),a=new Ow(this._editor,t);switch(o){case Fc.OUTLINE_MODEL:this._modelProviders.push(n),this._modelProviders.push(r),this._modelProviders.push(a);break;case Fc.FOLDING_PROVIDER_MODEL:this._modelProviders.push(r),this._modelProviders.push(a);break;case Fc.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e,t,i){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(let o of this._modelProviders){let{statusPromise:n,modelPromise:r}=o.computeStickyModel(e,t,i);this._modelPromise=r;let a=await n;if(this._modelPromise!==r)return null;switch(a){case mr.CANCELED:return this._updateOperation.clear(),null;case mr.VALID:return o.stickyModel}}return null}).catch(o=>(ee(o),null))}};Lm=Mm([Wc(1,he),Wc(2,N)],Lm);var Dm=class{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,mr.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};let o=Se(n=>this.createModelFromProvider(e,t,n));return{statusPromise:o.then(n=>this.isModelValid(n)?i.isCancellationRequested?mr.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,n),mr.VALID):this._invalid()).then(void 0,n=>(ee(n),mr.CANCELED)),modelPromise:o}}isModelValid(e){return!0}isProviderValid(e){return!0}},Pw=class extends Dm{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,i){return Hd.create(this._languageFeaturesService.documentSymbolProvider,e,i)}createStickyModel(e,t,i,o){var n;let{stickyOutlineElement:r,providerID:a}=this._stickyModelFromOutlineModel(o,(n=this._stickyModel)===null||n===void 0?void 0:n.outlineProviderId);return new Ac(e.uri,t,r,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(gi.first(e.children.values())instanceof zd){let a=gi.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",d=-1,c;for(let[u,g]of e.children.entries()){let p=this._findSumOfRangesOfGroup(g);p>d&&(c=g,d=p,l=g.id)}t=l,i=c.children}}else i=e.children;let o=[],n=Array.from(i.values()).sort((a,l)=>{let d=new yn(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),c=new yn(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(d,c)});for(let a of n)o.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new ms(void 0,o,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){let i=[];for(let n of e.children.values())if(n.symbol.selectionRange.startLineNumber!==n.symbol.range.endLineNumber)if(n.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(n,n.symbol.selectionRange.startLineNumber));else for(let r of n.children.values())i.push(this._stickyModelFromOutlineElement(r,n.symbol.selectionRange.startLineNumber));i.sort((n,r)=>this._comparator(n.range,r.range));let o=new yn(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new ms(o,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(let i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof xa?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};Pw=Mm([Wc(0,N)],Pw);var km=class extends Dm{constructor(e){super(),this._foldingLimitReporter=new Od(e)}createStickyModel(e,t,i,o){let n=this._fromFoldingRegions(o);return new Ac(e.uri,t,n,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){let t=e.length,i=[],o=new ms(void 0,[],void 0);for(let n=0;n<t;n++){let r=e.getParentIndex(n),a;r!==-1?a=i[r]:a=o;let l=new ms(new yn(e.getStartLineNumber(n),e.getEndLineNumber(n)+1),[],a);a.children.push(l),i.push(l)}return o}},Ow=class extends km{constructor(e,t){super(e),this._languageConfigurationService=t}createModelFromProvider(e,t,i){return new ts(e,this._languageConfigurationService,this._foldingLimitReporter).compute(i)}};Ow=Mm([Wc(1,he)],Ow);var Aw=class extends km{constructor(e,t){super(e),this._languageFeaturesService=t}isProviderValid(e){return zi.getFoldingRangeProviders(this._languageFeaturesService,e).length>0}createModelFromProvider(e,t,i){let o=zi.getFoldingRangeProviders(this._languageFeaturesService,e);return new is(e,o,()=>this.createModelFromProvider(e,t,i),this._foldingLimitReporter,void 0).compute(i)}};Aw=Mm([Wc(1,N)],Aw);var qT=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Gk=function(s,e){return function(t,i){e(t,i,s)}},Fw=class{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}},Nm=class extends I{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new K),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new L),this._updateSoon=this._register(new De(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(114)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new Lm(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}async update(){var e;(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new We,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}let t=this._editor.getModel(),i=t.getVersionId(),o=await this._stickyModelProvider.update(t,i,e);e.isCancellationRequested||(this._model=o)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,o,n){if(t.children.length===0)return;let r=n,a=[];for(let c=0;c<t.children.length;c++){let u=t.children[c];u.range&&a.push(u.range.startLineNumber)}let l=this.updateIndex(br(a,e.startLineNumber,(c,u)=>c-u)),d=this.updateIndex(br(a,e.startLineNumber+o,(c,u)=>c-u));for(let c=l;c<=d;c++){let u=t.children[c];if(!u)return;if(u.range){let g=u.range.startLineNumber,p=u.range.endLineNumber;e.startLineNumber<=p+1&&g-1<=e.endLineNumber&&g!==r&&(r=g,i.push(new Fw(g,p-1,o+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,i,o+1,g))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,u,i,o,n)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let o=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,o,0,-1);let n=(i=this._editor._getViewModel())===null||i===void 0?void 0:i.getHiddenAreas();if(n)for(let r of n)o=o.filter(a=>!(a.startLineNumber>=r.startLineNumber&&a.endLineNumber<=r.endLineNumber+1));return o}};Nm=qT([Gk(1,N),Gk(2,he)],Nm);ge();Je();re();we();q();ke();Te();It();de();CM();var GT=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Va=function(s,e){return function(t,i){e(t,i,s)}},Ww,Bi=Ww=class extends I{constructor(e,t,i,o,n,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=o,this._contextKeyService=a,this._sessionStore=new L,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new Im(this._editor),this._stickyLineCandidateProvider=new Nm(this._editor,i,n),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new Oc([],[],0),this._readConfiguration();let l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(c=>{(c.hasChanged(114)||c.hasChanged(72)||c.hasChanged(66)||c.hasChanged(109))&&this._readConfiguration()})),this._register(ce(l,Pe.CONTEXT_MENU,async c=>{this._onContextMenu(Vo(l),c)})),this._stickyScrollFocusedContextKey=_.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=_.stickyScrollVisible.bindTo(this._contextKeyService);let d=this._register(Ui(l));this._register(d.onDidBlur(c=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(d.onDidFocus(c=>{this.focus()})),this._registerMouseListeners(),this._register(ce(l,Pe.MOUSE_DOWN,c=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(Ww.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new L,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){let e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(b.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){let e=this._register(new L),t=this._register(new wo(this._editor,{extractLineNumberFromMouseEvent:n=>{let r=this._stickyScrollWidget.getEditorPositionFromNode(n.target.element);return r?r.lineNumber:0}})),i=n=>{if(!this._editor.hasModel()||n.target.type!==12||n.target.detail!==this._stickyScrollWidget.getId())return null;let r=n.target.element;if(!r||r.innerText!==r.innerHTML)return null;let a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new b(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},o=this._stickyScrollWidget.getDomNode();this._register(wi(o,Pe.CLICK,n=>{if(n.ctrlKey||n.altKey||n.metaKey||!n.leftButton)return;if(n.shiftKey){let d=this._stickyScrollWidget.getLineIndexFromChildDomNode(n.target);if(d===null)return;let c=new R(this._endLineNumbers[d],1);this._revealLineInCenterIfOutsideViewport(c);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(n.target)){let d=this._stickyScrollWidget.getLineNumberFromChildDomNode(n.target);this._toggleFoldingRegionForLine(d);return}if(!this._stickyScrollWidget.isInStickyLine(n.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(n.target);if(!l){let d=this._stickyScrollWidget.getLineNumberFromChildDomNode(n.target);if(d===null)return;l=new R(d,1)}this._revealPosition(l)})),this._register(wi(o,Pe.MOUSE_MOVE,n=>{if(n.shiftKey){let r=this._stickyScrollWidget.getLineIndexFromChildDomNode(n.target);if(r===null||this._showEndForLine!==null&&this._showEndForLine===r)return;this._showEndForLine=r,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(ce(o,Pe.MOUSE_LEAVE,n=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([n,r])=>{let a=i(n);if(!a||!n.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}let{range:l,textElement:d}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(d.style.textDecoration==="underline")return;let c=new We;e.add(xe(()=>c.dispose(!0)));let u;Ur(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new R(l.startLineNumber,l.startColumn+1),c.token).then(g=>{if(!c.token.isCancellationRequested)if(g.length!==0){this._candidateDefinitionsLength=g.length;let p=d;u!==p?(e.clear(),u=p,u.style.textDecoration="underline",e.add(xe(()=>{u.style.textDecoration="none"}))):u||(u=p,u.style.textDecoration="underline",e.add(xe(()=>{u.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async n=>{if(n.target.type!==12||n.target.detail!==this._stickyScrollWidget.getId())return;let r=this._stickyScrollWidget.getEditorPositionFromNode(n.target.element);r&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(em,n,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))}))}_onContextMenu(e,t){let i=new Wx(e,t);this._contextMenuService.showContextMenu({menuId:O.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;let t=this._stickyScrollWidget.getStickyLineForLine(e),i=t?.foldingIcon;if(!i)return;vp(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;let o=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(66)*t.index+1;this._editor.setScrollTop(o),this._renderStickyScroll(e)}_readConfiguration(){let e=this._editor.getOption(114);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(67).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll(-1)}))}_needsUpdate(e){let t=this._stickyScrollWidget.getCurrentLines();for(let i of t)for(let o of e.ranges)if(i>=o.fromLineNumber&&i<=o.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){let t=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e=1/0){var t,i;let o=this._editor.getModel();if(!o||o.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}let n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===o.getVersionId())if(this._foldingModel=(i=await((t=zi.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel()))!==null&&i!==void 0?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{let r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}findScrollWidgetState(){let e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),i=this._editor.getScrollTop(),o=0,n=[],r=[],a=this._editor.getVisibleRanges();if(a.length!==0){let l=new yn(a[0].startLineNumber,a[a.length-1].endLineNumber),d=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(let c of d){let u=c.startLineNumber,g=c.endLineNumber,p=c.nestingDepth;if(g-u>0){let m=(p-1)*e,f=p*e,C=this._editor.getBottomForLineNumber(u)-i,v=this._editor.getTopForLineNumber(g)-i,S=this._editor.getBottomForLineNumber(g)-i;if(m>v&&m<=S){n.push(u),r.push(g+1),o=S-f;break}else f>C&&f<=S&&(n.push(u),r.push(g+1));if(n.length===t)break}}}return this._endLineNumbers=r,new Oc(n,r,o,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};Bi.ID="store.contrib.stickyScrollController";Bi=Ww=GT([Va(1,fo),Va(2,N),Va(3,B),Va(4,he),Va(5,rt),Va(6,G)],Bi);var Em=class extends Tt{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:h("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:h({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:Uk.View,toggled:{condition:x.equals("config.editor.stickyScroll.enabled",!0),title:h("stickyScroll","Sticky Scroll"),mnemonicTitle:h({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:O.CommandPalette},{id:O.MenubarAppearanceMenu,group:"4_editor",order:3},{id:O.StickyScrollContext}]})}async run(e){let t=e.get(se),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}},Fm=100,Rm=class extends ni{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:h("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:h({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:x.and(x.has("config.editor.stickyScroll.enabled"),_.stickyScrollVisible),menu:[{id:O.CommandPalette}]})}runEditorCommand(e,t){var i;(i=Bi.get(t))===null||i===void 0||i.focus()}},Tm=class extends ni{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:h("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:_.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Fm,primary:18}})}runEditorCommand(e,t){var i;(i=Bi.get(t))===null||i===void 0||i.focusNext()}},Pm=class extends ni{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:h("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:_.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Fm,primary:16}})}runEditorCommand(e,t){var i;(i=Bi.get(t))===null||i===void 0||i.focusPrevious()}},Om=class extends ni{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:h("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:_.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Fm,primary:3}})}runEditorCommand(e,t){var i;(i=Bi.get(t))===null||i===void 0||i.goToFocused()}},Am=class extends ni{constructor(){super({id:"editor.action.selectEditor",title:{value:h("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:_.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:Fm,primary:9}})}runEditorCommand(e,t){var i;(i=Bi.get(t))===null||i===void 0||i.selectEditor()}};Je();W(Bi.ID,Bi,1);ve(Em);ve(Rm);ve(Pm);ve(Tm);ve(Om);ve(Am);Te();ol();E();Z();Rt();q();ge();var Vw=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},_s=function(s,e){return function(t,i){e(t,i,s)}},fs,zw=class{constructor(e,t,i,o,n,r){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=o,this.command=n,this.completion=r}},Hw=class extends hx{constructor(e,t,i,o,n,r){super(n.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=o,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){var e;let t=[],{items:i}=this.completionModel,o=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},i),n=gi.slice(i,o),r=gi.slice(i,0,o),a=5;for(let l of gi.concat(n,r)){if(l.score===Jo.Default)continue;let d=new b(l.editStart.lineNumber,l.editStart.column,l.editInsertEnd.lineNumber,l.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),c=l.completion.insertTextRules&&l.completion.insertTextRules&4?{snippet:l.completion.insertText}:l.completion.insertText;t.push(new zw(d,c,(e=l.filterTextLow)!==null&&e!==void 0?e:l.labelLow,l.completion.additionalTextEdits,l.completion.command,l)),a-->=0&&l.resolve(Y.None)}return t}};Hw=Vw([_s(5,Ea)],Hw);var Bw=class{constructor(e,t,i,o){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=o}async provideInlineCompletions(e,t,i,o){var n;if(i.selectedSuggestionInfo)return;let r=this._getEditorOption(88,e);if(Eo.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);let a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Eo.valueFor(r,l)!=="inline")return;let d=e.getWordAtPosition(t),c;if(d?.word||(c=this._getTriggerCharacterInfo(e,t)),!d?.word&&!c||(d||(d=e.getWordUntilPosition(t)),d.endColumn!==t.column))return;let u,g=e.getValueInRange(new b(t.lineNumber,1,t.lineNumber,t.column));if(!c&&(!((n=this._lastResult)===null||n===void 0)&&n.canBeReused(e,t.lineNumber,d))){let p=new oc(g,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=p,this._lastResult.acquire(),u=this._lastResult}else{let p=await jd(this._languageFeatureService.completionProvider,e,t,new _n(void 0,void 0,c?.providers),c&&{triggerKind:1,triggerCharacter:c.ch},o),m;p.needsClipboard&&(m=await this._clipboardService.readText());let f=new Ta(p.items,t.column,new oc(g,0),nr.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},m);u=new Hw(e,t.lineNumber,d,f,p,this._suggestMemoryService)}return this._lastResult=u,u}handleItemDidShow(e,t){t.completion.resolve(Y.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;let o=e.getValueInRange(b.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(let r of this._languageFeatureService.completionProvider.all(e))!((i=r.triggerCharacters)===null||i===void 0)&&i.includes(o)&&n.add(r);if(n.size!==0)return{providers:n,ch:o}}};Bw=Vw([_s(1,N),_s(2,Ki),_s(3,Ea)],Bw);var Wm=fs=class{constructor(e,t,i,o){if(++fs._counter===1){let n=o.createInstance(Bw,(r,a)=>{var l;return((l=i.listCodeEditors().find(c=>c.getModel()===a))!==null&&l!==void 0?l:e).getOption(r)});fs._disposable=t.inlineCompletionsProvider.register("*",n)}}dispose(){var e;--fs._counter===0&&((e=fs._disposable)===null||e===void 0||e.dispose(),fs._disposable=void 0)}};Wm._counter=0;Wm=fs=Vw([_s(1,N),_s(2,_e),_s(3,B)],Wm);W("suggest.inlineCompletionsProvider",Wm,0);Ao();Z();F();var Uw=class extends k{constructor(){super({id:"editor.action.forceRetokenize",label:h("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;let i=t.getModel();i.tokenization.resetTokenization();let o=new st;i.tokenization.forceTokenization(i.getLineCount()),o.stop(),console.log(`tokenization took ${o.elapsed()}`)}};w(Uw);F();Je();var zm=class s extends Tt{constructor(){super({id:s.ID,title:{value:h({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){let t=!Lf.getTabFocusMode();Lf.setTabFocusMode(t),t?nt(h("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element")):nt(h("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}};zm.ID="editor.action.toggleTabFocusMode";ve(zm);fe();Nt();E();$t();Be();Z();mt();su();Ti();de();Ns();E();ge();de();Fx();Ie();E();var $T=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},YT=function(s,e){return function(t,i){e(t,i,s)}},Hm=class extends I{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},o){var n;super(),this._link=t,this._enabled=!0,this.el=T(e,P("a.monaco-link",{tabIndex:(n=t.tabIndex)!==null&&n!==void 0?n:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");let r=this._register(new Bh(this.el,"click")),a=this._register(new Bh(this.el,"keypress")),l=Me.chain(a.event,u=>u.map(g=>new bh(g)).filter(g=>g.keyCode===3)),d=this._register(new Bh(this.el,mI.Tap)).event;this._register(Nh.addTarget(this.el));let c=Me.any(r.event,l,d);this._register(c(u=>{this.enabled&&(xr.stop(u,!0),i?.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};Hm=$T([YT(3,it)],Hm);ti();var $k=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Yk=function(s,e){return function(t,i){e(t,i,s)}},ZT=26,Bm=class extends I{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(jw))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}}),this._editor.setBanner(this.banner.element,ZT)}};Bm=$k([Yk(1,B)],Bm);var jw=class extends I{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(di,{}),this.element=P("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){let t=P("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){ii(this.element)}show(e){ii(this.element);let t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);let i=T(this.element,P("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(P(`div${le.asCSSSelector(e.icon)}`));let o=T(this.element,P("div.message-container"));if(o.setAttribute("aria-hidden","true"),o.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=T(this.element,P("div.message-actions-container")),e.actions)for(let r of e.actions)this._register(this.instantiationService.createInstance(Hm,this.messageActionsContainer,{...r,tabIndex:-1},{}));let n=T(this.element,P("div.action-container"));this.actionBar=this._register(new en(n)),this.actionBar.push(this._register(new so("banner.close","Close Banner",le.asClassName(hu),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};jw=$k([Yk(0,B)],jw);F();at();ge();var Xw=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Ua=function(s,e){return function(t,i){e(t,i,s)}},QT=Ve("extensions-warning-message",$.warning,h("warningIcon","Icon shown with a warning message in the extensions editor.")),ja=class extends I{constructor(e,t,i,o){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=n=>{if(n&&n.hasMore){if(this._bannerClosed)return;let r=Math.max(n.ambiguousCharacterCount,n.nonBasicAsciiCharacterCount,n.invisibleCharacterCount),a;if(n.nonBasicAsciiCharacterCount>=r)a={message:h("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new Ga};else if(n.ambiguousCharacterCount>=r)a={message:h("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new fr};else if(n.invisibleCharacterCount>=r)a={message:h("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new qa};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:QT,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(o.createInstance(Bm,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(i.onDidChangeTrust(n=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(n=>{n.hasChanged(124)&&(this._options=e.getOption(124),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;let e=XT(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;let t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?sx:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new qw(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new Gw(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};ja.ID="editor.contrib.unicodeHighlighter";ja=Xw([Ua(1,tn),Ua(2,y0),Ua(3,B)],ja);function XT(s,e){return{nonBasicASCII:e.nonBasicASCII===dh?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===dh?!s:e.includeComments,includeStrings:e.includeStrings===dh?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}var qw=class extends I{constructor(e,t,i,o){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=o,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new De(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}let e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);let i=[];if(!t.hasMore)for(let o of t.ranges)i.push({range:o,options:Ka.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;let t=this._editor.getModel();if(!Af(t,e))return null;let i=t.getValueInRange(e.range);return{reason:Zk(i,this._options),inComment:Ff(t,e),inString:Wf(t,e)}}};qw=Xw([Ua(3,tn)],qw);var Gw=class extends I{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new De(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}let e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(let o of e){let n=If.computeUnicodeHighlights(this._model,this._options,o);for(let r of n.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||n.hasMore}if(!i.hasMore)for(let o of i.ranges)t.push({range:o,options:Ka.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;let t=this._editor.getModel(),i=t.getValueInRange(e.range);return Af(t,e)?{reason:Zk(i,this._options),inComment:Ff(t,e),inString:Wf(t,e)}:null}},$w=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];let i=this._editor.getModel(),o=this._editor.getContribution(ja.ID);if(!o)return[];let n=[],r=new Set,a=300;for(let l of t){let d=o.getDecorationInfo(l);if(!d)continue;let u=i.getValueInRange(l.range).codePointAt(0),g=Kw(u),p;switch(d.reason.kind){case 0:{mh(d.reason.confusableWith)?p=h("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",g,Kw(d.reason.confusableWith.codePointAt(0))):p=h("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",g,Kw(d.reason.confusableWith.codePointAt(0)));break}case 1:p=h("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",g);break;case 2:p=h("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",g);break}if(r.has(p))continue;r.add(p);let m={codePoint:u,reason:d.reason,inComment:d.inComment,inString:d.inString},f=h("unicodeHighlight.adjustSettings","Adjust settings"),C=`command:${zc.ID}?${encodeURIComponent(JSON.stringify(m))}`,v=new Qe("",!0).appendMarkdown(p).appendText(" ").appendLink(C,f);n.push(new ci(this,l.range,[v],!1,a++))}return n}renderHoverParts(e,t){return Wv(e,t,this._editor,this._languageService,this._openerService)}};$w=Xw([Ua(1,tt),Ua(2,it)],$w);function Yw(s){return`U+${s.toString(16).padStart(4,"0")}`}function Kw(s){let e=`\`${Yw(s)}\``;return gf.isInvisibleCharacter(s)||(e+=` "${`${JT(s)}`}"`),e}function JT(s){return s===96?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function Zk(s,e){return If.computeUnicodeHighlightReason(s,e)}var Ka=class{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){let i=`${e}${t}`,o=this.map.get(i);return o||(o=te.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,o)),o}};Ka.instance=new Ka;var Zw=class extends k{constructor(){super({id:fr.ID,label:h("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=h("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,i){let o=e?.get(se);o&&this.runAction(o)}async runAction(e){await e.updateValue(oo.includeComments,!1,2)}},Qw=class extends k{constructor(){super({id:fr.ID,label:h("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=h("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,i){let o=e?.get(se);o&&this.runAction(o)}async runAction(e){await e.updateValue(oo.includeStrings,!1,2)}},fr=class s extends k{constructor(){super({id:s.ID,label:h("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=h("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,i){let o=e?.get(se);o&&this.runAction(o)}async runAction(e){await e.updateValue(oo.ambiguousCharacters,!1,2)}};fr.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";var qa=class s extends k{constructor(){super({id:s.ID,label:h("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=h("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,i){let o=e?.get(se);o&&this.runAction(o)}async runAction(e){await e.updateValue(oo.invisibleCharacters,!1,2)}};qa.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";var Ga=class s extends k{constructor(){super({id:s.ID,label:h("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=h("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,i){let o=e?.get(se);o&&this.runAction(o)}async runAction(e){await e.updateValue(oo.nonBasicASCII,!1,2)}};Ga.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";var zc=class s extends k{constructor(){super({id:s.ID,label:h("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){let{codePoint:o,reason:n,inString:r,inComment:a}=i,l=String.fromCodePoint(o),d=e.get(Ot),c=e.get(se);function u(m){return gf.isInvisibleCharacter(m)?h("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",Yw(m)):h("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${Yw(m)} "${l}"`)}let g=[];if(n.kind===0)for(let m of n.notAmbiguousInLocales)g.push({label:h("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',m),run:async()=>{tP(c,[m])}});if(g.push({label:u(o),run:()=>eP(c,[o])}),a){let m=new Zw;g.push({label:m.label,run:async()=>m.runAction(c)})}else if(r){let m=new Qw;g.push({label:m.label,run:async()=>m.runAction(c)})}if(n.kind===0){let m=new fr;g.push({label:m.label,run:async()=>m.runAction(c)})}else if(n.kind===1){let m=new qa;g.push({label:m.label,run:async()=>m.runAction(c)})}else if(n.kind===2){let m=new Ga;g.push({label:m.label,run:async()=>m.runAction(c)})}else iP(n);let p=await d.pick(g,{title:h("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});p&&await p.run()}};zc.ID="editor.action.unicodeHighlight.showExcludeOptions";async function eP(s,e){let t=s.getValue(oo.allowedCharacters),i;typeof t=="object"&&t?i=t:i={};for(let o of e)i[String.fromCodePoint(o)]=!0;await s.updateValue(oo.allowedCharacters,i,2)}async function tP(s,e){var t;let i=(t=s.inspect(oo.allowedLocales).user)===null||t===void 0?void 0:t.value,o;typeof i=="object"&&i?o=Object.assign({},i):o={};for(let n of e)o[n]=!0;await s.updateValue(oo.allowedLocales,o,2)}function iP(s){throw new Error(`Unexpected value: ${s}`)}w(fr);w(qa);w(Ga);w(zc);W(ja.ID,ja,1);Li.register($w);E();yi();Z();Rt();F();var oP=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Qk=function(s,e){return function(t,i){e(t,i,s)}},Xk="ignoreUnusualLineTerminators";function nP(s,e,t){s.setModelProperty(e.uri,Xk,t)}function rP(s,e){return s.getModelProperty(e.uri,Xk)}var Hc=class extends I{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(o=>{o.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;let e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||rP(this._codeEditorService,e)===!0||this._editor.getOption(90))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:h("unusualLineTerminators.title","Unusual Line Terminators"),message:h("unusualLineTerminators.message","Detected unusual line terminators"),detail:h("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Xt(e.uri)),primaryButton:h({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:h("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){nP(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}};Hc.ID="editor.contrib.unusualLineTerminatorsDetector";Hc=oP([Qk(1,Ks),Qk(2,_e)],Hc);W(Hc.ID,Hc,1);F();Fe();fe();Te();me();E();Z();Rt();q();we();Ht();re();Rs();var Jk=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Vm=function(s,e){return function(t,i){e(t,i,s)}},Ke,Jw,Km=new X("hasWordHighlights",!1);function eM(s,e,t,i){let o=s.ordered(e);return dl(o.map(n=>()=>Promise.resolve(n.provideDocumentHighlights(e,t,i)).then(void 0,pe)),Ge).then(n=>{if(n){let r=new Pi;return r.set(e.uri,n),r}return new Pi})}function sP(s,e,t,i,o,n){let r=s.ordered(e);return dl(r.map(a=>()=>{let l=n.filter(d=>p0(a.selector,d.uri,d.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(a.provideMultiDocumentHighlights(e,t,l,o)).then(void 0,pe)}),a=>a instanceof Pi&&a.size>0)}var Bc=class{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Se(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){let i=e.getWordAtPosition(t.getPosition());return i?new b(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){let o=t.startLineNumber,n=t.startColumn,r=t.endColumn,a=this._getCurrentWordRange(e,t),l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let d=0,c=i.length;!l&&d<c;d++){let u=i.getRange(d);u&&u.startLineNumber===o&&u.startColumn<=n&&u.endColumn>=r&&(l=!0)}return l}cancel(){this.result.cancel()}},ey=class extends Bc{constructor(e,t,i,o){super(e,t,i),this._providers=o}_compute(e,t,i,o){return eM(this._providers,e,t.getPosition(),o).then(n=>n||new Pi)}},ty=class extends Bc{constructor(e,t,i,o,n){super(e,t,i),this._providers=o,this._otherModels=n}_compute(e,t,i,o){return sP(this._providers,e,t.getPosition(),i,o,this._otherModels).then(n=>n||new Pi)}},Um=class extends Bc{constructor(e,t,i,o,n){super(e,t,o),this._otherModels=n,this._selectionIsEmpty=t.isEmpty(),this._word=i}_compute(e,t,i,o){return Es(250,o).then(()=>{let n=new Pi,r;if(this._word?r=this._word:r=e.getWordAtPosition(t.getPosition()),!r)return new Pi;let a=[e,...this._otherModels];for(let l of a){if(l.isDisposed())continue;let c=l.findMatches(r.word,!0,!1,!0,i,!1).map(u=>({range:u.range,kind:al.Text}));c&&n.set(l.uri,c)}return n})}isValid(e,t,i){let o=t.isEmpty();return this._selectionIsEmpty!==o?!1:super.isValid(e,t,i)}};function aP(s,e,t,i,o){return s.has(e)?new ey(e,t,o,s):new Um(e,t,i,o,[])}function lP(s,e,t,i,o,n){return s.has(e)?new ty(e,t,o,s,n):new Um(e,t,i,o,n)}ri("_executeDocumentHighlights",async(s,e,t)=>{let i=s.get(N),o=await eM(i.documentHighlightProvider,e,t,Y.None);return o?.get(e.uri)});var Vc=Ke=class{constructor(e,t,i,o,n){this.toUnhook=new L,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Pi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=n,this._hasWordHighlights=Km.bindTo(o),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(r=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this._onPositionChanged(r)})),this.toUnhook.add(e.onDidChangeModelContent(r=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(r=>{!r.newModelUrl&&r.oldModelUrl?this._stopSingular():Ke.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(r=>{let a=this.editor.getOption(80);this.occurrencesHighlight!==a&&(this.occurrencesHighlight=a,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,Ke.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(b.compareRangesUsingStarts)}moveNext(){let e=this._getSortedHighlights(),i=(e.findIndex(n=>n.containsPosition(this.editor.getPosition()))+1)%e.length,o=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);let n=this._getWord();if(n){let r=this.editor.getModel().getLineContent(o.startLineNumber);nt(`${r}, ${i+1} of ${e.length} for '${n.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),i=(e.findIndex(n=>n.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,o=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(o.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(o);let n=this._getWord();if(n){let r=this.editor.getModel().getLineContent(o.startLineNumber);nt(`${r}, ${i+1} of ${e.length} for '${n.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;let e=Ke.storedDecorations.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),Ke.storedDecorations.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(){let e=this.codeEditorService.listCodeEditors();for(let t of e){if(!t.hasModel())continue;let i=Ke.storedDecorations.get(t.getModel().uri);if(!i)continue;t.removeDecorations(i),Ke.storedDecorations.delete(t.getModel().uri);let o=xn.get(t);o?.wordHighlighter&&o.wordHighlighter.decorations.length>0&&(o.wordHighlighter.decorations.clear(),o.wordHighlighter._hasWordHighlights.set(!1))}}_stopSingular(){var e,t,i,o;this._removeSingleDecorations(),this.editor.hasWidgetFocus()&&(((e=this.editor.getModel())===null||e===void 0?void 0:e.uri.scheme)!==yt.vscodeNotebookCell&&((i=(t=Ke.query)===null||t===void 0?void 0:t.modelInfo)===null||i===void 0?void 0:i.model.uri.scheme)!==yt.vscodeNotebookCell?(Ke.query=null,this._run()):!((o=Ke.query)===null||o===void 0)&&o.modelInfo&&(Ke.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(){this._removeAllDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())===null||t===void 0?void 0:t.uri.scheme)!==yt.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===yt.vscodeNotebookCell){let n=[],r=this.codeEditorService.listCodeEditors();for(let a of r){let l=a.getModel();l&&l!==e&&l.uri.scheme===yt.vscodeNotebookCell&&n.push(l)}return n}let i=[],o=this.codeEditorService.listCodeEditors();for(let n of o){if(!fu(n))continue;let r=n.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(let n of o){let r=n.getModel();r&&r!==e&&i.push(r)}return i}_run(){var e,t;let i;if(this.editor.hasWidgetFocus()){let o=this.editor.getSelection();if(!o||o.startLineNumber!==o.endLineNumber){this._stopAll();return}let n=o.startColumn,r=o.endColumn,a=this._getWord();if(!a||a.startColumn>n||a.endColumn<r){Ke.query=null,this._stopAll();return}i=this.workerRequest&&this.workerRequest.isValid(this.model,o,this.decorations),Ke.query={modelInfo:{model:this.model,selection:o},word:a}}else if(Ke.query===null)return;if(this.lastCursorPositionChangeTime=new Date().getTime(),i)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();let o=++this.workerRequestTokenId;this.workerRequestCompleted=!1;let n=this.getOtherModelsToHighlight(this.editor.getModel()),r=!!(!Ke.query.modelInfo&&Ke.query.word||((e=Ke.query.modelInfo)===null||e===void 0?void 0:e.model.uri)!==this.model.uri);!Ke.query.modelInfo||Ke.query.modelInfo.model.uri!==this.model.uri?this.workerRequest=this.computeWithModel(this.model,this.editor.getSelection(),r?Ke.query.word:null,n):this.workerRequest=this.computeWithModel(Ke.query.modelInfo.model,Ke.query.modelInfo.selection,Ke.query.word,n),(t=this.workerRequest)===null||t===void 0||t.result.then(a=>{o===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},ee)}}computeWithModel(e,t,i,o){return o.length?lP(this.multiDocumentProviders,e,t,i,this.editor.getOption(129),o):aP(this.providers,e,t,i,this.editor.getOption(129))}_beginRenderDecorations(){let e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var e,t,i;this.renderDecorationsTimer=-1;let o=this.codeEditorService.listCodeEditors();for(let n of o){let r=xn.get(n);if(!r)continue;let a=[],l=(e=n.getModel())===null||e===void 0?void 0:e.uri;if(l&&this.workerRequestValue.has(l)){let d=Ke.storedDecorations.get(l),c=this.workerRequestValue.get(l);if(c)for(let g of c)a.push({range:g.range,options:Pk(g.kind)});let u=[];n.changeDecorations(g=>{u=g.deltaDecorations(d??[],a)}),Ke.storedDecorations=Ke.storedDecorations.set(l,u),a.length>0&&((t=r.wordHighlighter)===null||t===void 0||t.decorations.set(a),(i=r.wordHighlighter)===null||i===void 0||i._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}};Vc.storedDecorations=new Pi;Vc.query=null;Vc=Ke=Jk([Vm(4,_e)],Vc);var xn=Jw=class extends I{static get(e){return e.getContribution(Jw.ID)}constructor(e,t,i,o){super(),this._wordHighlighter=null;let n=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new Vc(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,o))};this._register(e.onDidChangeModel(r=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),n()})),n()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}};xn.ID="editor.contrib.wordHighlighter";xn=Jw=Jk([Vm(1,G),Vm(2,N),Vm(3,_e)],xn);var jm=class extends k{constructor(e,t){super(t),this._isNext=e}run(e,t){let i=xn.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}},iy=class extends jm{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:h("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:Km,kbOpts:{kbExpr:_.editorTextFocus,primary:65,weight:100}})}},oy=class extends jm{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:h("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:Km,kbOpts:{kbExpr:_.editorTextFocus,primary:1089,weight:100}})}},ny=class extends k{constructor(){super({id:"editor.action.wordHighlight.trigger",label:h("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:Km.toNegated(),kbOpts:{kbExpr:_.editorTextFocus,primary:0,weight:100}})}run(e,t,i){let o=xn.get(t);o&&o.restoreViewState(!0)}};W(xn.ID,xn,0);w(iy);w(oy);w(ny);Z();yM();ke();q();ut();we();It();F();re();var vs=class extends je{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;let o=Tn(t.getOption(129)),n=t.getModel(),a=t.getSelections().map(l=>{let d=new R(l.positionLineNumber,l.positionColumn),c=this._move(o,n,d,this._wordNavigationType);return this._moveTo(l,c,this._inSelectionMode)});if(n.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>$I.fromModelSelection(l))),a.length===1){let l=new R(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new V(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new V(t.lineNumber,t.column,t.lineNumber,t.column)}},Po=class extends vs{_move(e,t,i,o){return zs.moveWordLeft(e,t,i,o)}},Oo=class extends vs{_move(e,t,i,o){return zs.moveWordRight(e,t,i,o)}},ry=class extends Po{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}},sy=class extends Po{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}},ay=class extends Po{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:x.and(_.textInputFocus,(e=x.and(fl,Pl))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}},ly=class extends Po{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}},dy=class extends Po{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}},cy=class extends Po{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:x.and(_.textInputFocus,(e=x.and(fl,Pl))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}},hy=class extends Po{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,o){return super._move(Tn(nl.wordSeparators.defaultValue),t,i,o)}},uy=class extends Po{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,o){return super._move(Tn(nl.wordSeparators.defaultValue),t,i,o)}},gy=class extends Oo{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}},py=class extends Oo{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:x.and(_.textInputFocus,(e=x.and(fl,Pl))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}},my=class extends Oo{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}},fy=class extends Oo{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}},_y=class extends Oo{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:x.and(_.textInputFocus,(e=x.and(fl,Pl))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}},vy=class extends Oo{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}},by=class extends Oo{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,o){return super._move(Tn(nl.wordSeparators.defaultValue),t,i,o)}},Cy=class extends Oo{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,o){return super._move(Tn(nl.wordSeparators.defaultValue),t,i,o)}},bs=class extends je{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){let o=e.get(he);if(!t.hasModel())return;let n=Tn(t.getOption(129)),r=t.getModel(),a=t.getSelections(),l=t.getOption(6),d=t.getOption(11),c=o.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),g=a.map(p=>{let m=this._delete({wordSeparators:n,model:r,selection:p,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:d,autoClosingPairs:c,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Yo(m,"")});t.pushUndoStop(),t.executeCommands(this.id,g),t.pushUndoStop()}},Uc=class extends bs{_delete(e,t){let i=zs.deleteWordLeft(e,t);return i||new b(1,1,1,1)}},jc=class extends bs{_delete(e,t){let i=zs.deleteWordRight(e,t);if(i)return i;let o=e.model.getLineCount(),n=e.model.getLineMaxColumn(o);return new b(o,n,o,n)}},Sy=class extends Uc{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:_.writable})}},wy=class extends Uc{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:_.writable})}},yy=class extends Uc{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:_.writable,kbOpts:{kbExpr:_.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}},xy=class extends jc{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:_.writable})}},Iy=class extends jc{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:_.writable})}},Ly=class extends jc{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:_.writable,kbOpts:{kbExpr:_.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}},Dy=class extends k{constructor(){super({id:"deleteInsideWord",precondition:_.writable,label:h("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;let o=Tn(t.getOption(129)),n=t.getModel(),a=t.getSelections().map(l=>{let d=zs.deleteInsideWord(o,n,l);return new Yo(d,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}};H(new ry);H(new sy);H(new ay);H(new ly);H(new dy);H(new cy);H(new gy);H(new py);H(new my);H(new fy);H(new _y);H(new vy);H(new hy);H(new uy);H(new by);H(new Cy);H(new Sy);H(new wy);H(new yy);H(new xy);H(new Iy);H(new Ly);w(Dy);Z();q();we();Ue();var ky=class extends bs{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:_.writable,kbOpts:{kbExpr:_.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){let i=Il.deleteWordPartLeft(e);return i||new b(1,1,1,1)}},My=class extends bs{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:_.writable,kbOpts:{kbExpr:_.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let i=Il.deleteWordPartRight(e);if(i)return i;let o=e.model.getLineCount(),n=e.model.getLineMaxColumn(o);return new b(o,n,o,n)}},qm=class extends vs{_move(e,t,i,o){return Il.moveWordPartLeft(e,t,i)}},Ny=class extends qm{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:_.textInputFocus,primary:0,mac:{primary:783},weight:100}})}};ae.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");var Ey=class extends qm{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:_.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}};ae.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");var Gm=class extends vs{_move(e,t,i,o){return Il.moveWordPartRight(e,t,i)}},Ry=class extends Gm{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:_.textInputFocus,primary:0,mac:{primary:785},weight:100}})}},Ty=class extends Gm{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:_.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}};H(new ky);H(new My);H(new Ny);H(new Ey);H(new Ry);H(new Ty);E();Z();F();var Kc=class extends I{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){let e=kt.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new Qe(h("editor.simple.readonly","Cannot edit in read-only input")):t=new Qe(h("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};Kc.ID="editor.contrib.readOnlyMessageController";W(Kc.ID,Kc,2);Er();de();E();Z();$t();var qc=class extends I{constructor(e){super(),this.editor=e,this.widget=null,il&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){let e=!this.editor.getOption(90);!this.widget&&e?this.widget=new $m(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};qc.ID="editor.contrib.iPadShowKeyboard";var $m=class s extends I{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(ce(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(ce(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return s.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};$m.ID="editor.contrib.ShowKeyboardWidget";W(qc.ID,qc,3);var Nfe=$y(oM());zo();Er();F();zo();E();var uP=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},nM=function(s,e){return function(t,i){e(t,i,s)}},$c,Yc=$c=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=wt.as(_o.Quickaccess)}provide(e){let t=new L;return t.add(e.onDidAccept(()=>{let[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{let o=this.registry.getQuickAccessProvider(i.substr($c.PREFIX.length));o&&o.prefix&&o.prefix!==$c.PREFIX&&this.quickInputService.quickAccess.show(o.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==$c.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{let i=t.prefix||e.prefix,o=i||"\u2026";return{prefix:i,label:o,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:h("helpPickAriaLabel","{0}, {1}",o,t.description),description:t.description}})}};Yc.PREFIX="?";Yc=$c=uP([nM(0,Ot),nM(1,Ce)],Yc);wt.as(_o.Quickaccess).registerQuickAccessProvider({ctor:Yc,prefix:"",helpEntries:[{description:S0.helpQuickAccessActionLabel}]});E();cx();E();Pn();GI();Dt();var Ya=class{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;let o=new L;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let n=o.add(new Ye);return n.value=this.doProvide(e,t),o.add(this.onDidActiveTextEditorControlChange(()=>{n.value=void 0,n.value=this.doProvide(e,t)})),o}doProvide(e,t){var i;let o=new L,n=this.activeTextEditorControl;if(n&&this.canProvideWithTextEditor(n)){let r={editor:n},a=_u(n);if(a){let l=(i=n.saveViewState())!==null&&i!==void 0?i:void 0;o.add(a.onDidChangeCursorPosition(()=>{var d;l=(d=n.saveViewState())!==null&&d!==void 0?d:void 0})),r.restoreViewState=()=>{l&&n===this.activeTextEditorControl&&n.restoreViewState(l)},o.add(uh(t.onCancellationRequested)(()=>{var d;return(d=r.restoreViewState)===null||d===void 0?void 0:d.call(r)}))}o.add(xe(()=>this.clearDecorations(n))),o.add(this.provideWithTextEditor(r,e,t))}else o.add(this.provideWithoutTextEditor(e,t));return o}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();let i=e.getModel();i&&"getLineContent"in i&&jo(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return fu(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{let o=[];this.rangeHighlightDecorationId&&(o.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),o.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);let n=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Ae(Vh),position:si.Full}}}],[r,a]=i.deltaDecorations(o,n);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){let t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}};F();var Zc=class s extends Ya{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){let t=h("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,I.None}provideWithTextEditor(e,t,i){let o=e.editor,n=new L;n.add(t.onDidAccept(l=>{let[d]=t.selectedItems;if(d){if(!this.isValidLineNumber(o,d.lineNumber))return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));let r=()=>{let l=this.parsePosition(o,t.value.trim().substr(s.PREFIX.length)),d=this.getPickLabel(o,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:d}],t.ariaLabel=d,!this.isValidLineNumber(o,l.lineNumber)){this.clearDecorations(o);return}let c=this.toRange(l.lineNumber,l.column);o.revealRangeInCenter(c,0),this.addDecorations(o,c)};r(),n.add(t.onDidChangeValue(()=>r()));let a=_u(o);return a&&a.getOptions().get(67).renderType===2&&(a.updateOptions({lineNumbers:"on"}),n.add(xe(()=>a.updateOptions({lineNumbers:"relative"})))),n}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){let i=t.split(/,|:|#/).map(n=>parseInt(n,10)).filter(n=>!isNaN(n)),o=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:o+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?h("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):h("gotoLineLabel","Go to line {0}.",t);let o=e.getPosition()||{lineNumber:1,column:1},n=this.lineCount(e);return n>1?h("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",o.lineNumber,o.column,n):h("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",o.lineNumber,o.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;let o=this.getModel(e);if(!o)return!1;let n={lineNumber:t,column:i};return o.validatePosition(n).equals(n)}lineCount(e){var t,i;return(i=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&i!==void 0?i:0}};Zc.PREFIX=":";zo();Rt();Er();Ie();Z();we();var gP=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},pP=function(s,e){return function(t,i){e(t,i,s)}},Qc=class extends Zc{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Me.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};Qc=gP([pP(0,_e)],Qc);var Xc=class s extends k{constructor(){super({id:s.ID,label:Bf.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Ot).quickAccess.show(Qc.PREFIX)}};Xc.ID="editor.action.gotoLine";w(Xc);wt.as(_o.Quickaccess).registerQuickAccessProvider({ctor:Qc,prefix:Qc.PREFIX,helpEntries:[{description:Bf.gotoLineActionLabel,commandId:Xc.ID}]});fe();Te();Nt();ti();gx();$t();Be();var aM=[void 0,[]];function Qm(s,e,t=0,i=0){let o=e;return o.values&&o.values.length>1?mP(s,o.values,t,i):lM(s,e,t,i)}function mP(s,e,t,i){let o=0,n=[];for(let r of e){let[a,l]=lM(s,r,t,i);if(typeof a!="number")return aM;o+=a,n.push(...l)}return[o,fP(n)]}function lM(s,e,t,i){let o=eu(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return o?[o[0],Rr(o)]:aM}var jpe=Object.freeze({score:0});function fP(s){let e=s.sort((o,n)=>o.start-n.start),t=[],i;for(let o of e)!i||!_P(i,o)?(i=o,t.push(o)):(i.start=Math.min(i.start,o.start),i.end=Math.max(i.end,o.end));return t}function _P(s,e){return!(s.end<e.start||e.end<s.start)}function rM(s){return s.startsWith('"')&&s.endsWith('"')}var dM=" ";function Zm(s){typeof s!="string"&&(s="");let e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:o}=sM(s),n=t.indexOf(ph)>=0,r=rM(s),a,l=s.split(dM);if(l.length>1)for(let d of l){let c=rM(d),{pathNormalized:u,normalized:g,normalizedLowercase:p}=sM(d);g&&(a||(a=[]),a.push({original:d,originalLowercase:d.toLowerCase(),pathNormalized:u,normalized:g,normalizedLowercase:p,expectContiguousMatch:c}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:o,values:a,containsPathSeparator:n,expectContiguousMatch:r}}function sM(s){let e;Ln?e=s.replace(/\//g,ph):e=s.replace(/\\/g,ph);let t=wx(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function Ay(s){return Array.isArray(s)?Zm(s.map(e=>e.original).join(dM)):Zm(s.original)}E();Be();q();Ht();F();gl();var vP=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},cM=function(s,e){return function(t,i){e(t,i,s)}},Za,io=Za=class extends Ya{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,h("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),I.None}provideWithTextEditor(e,t,i){let o=e.editor,n=this.getModel(o);return n?this._languageFeaturesService.documentSymbolProvider.has(n)?this.doProvideWithEditorSymbols(e,n,t,i):this.doProvideWithoutEditorSymbols(e,n,t,i):I.None}doProvideWithoutEditorSymbols(e,t,i,o){let n=new L;return this.provideLabelPick(i,h("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,n)||o.isCancellationRequested||n.add(this.doProvideWithEditorSymbols(e,t,i,o)))(),n}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;let i=new Ch,o=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(o.dispose(),i.complete(!0))}));return t.add(xe(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,o){var n;let r=e.editor,a=new L;a.add(i.onDidAccept(u=>{let[g]=i.selectedItems;g&&g.range&&(this.gotoLocation(e,{range:g.range.selection,keyMods:i.keyMods,preserveFocus:u.inBackground}),u.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));let l=this.getDocumentSymbols(t,o),d,c=async u=>{d?.dispose(!0),i.busy=!1,d=new We(o),i.busy=!0;try{let g=Zm(i.value.substr(Za.PREFIX.length).trim()),p=await this.doGetSymbolPicks(l,g,void 0,d.token);if(o.isCancellationRequested)return;if(p.length>0){if(i.items=p,u&&g.original.length===0){let m=oI(p,f=>!!(f.type!=="separator"&&f.range&&b.containsPosition(f.range.decoration,u)));m&&(i.activeItems=[m])}}else g.original.length>0?this.provideLabelPick(i,h("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,h("noSymbolResults","No editor symbols"))}finally{o.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>c(void 0))),c((n=r.getSelection())===null||n===void 0?void 0:n.getPosition()),a.add(i.onDidChangeActive(()=>{let[u]=i.activeItems;u&&u.range&&(r.revealRangeInCenter(u.range.selection,0),this.addDecorations(r,u.range.decoration))})),a}async doGetSymbolPicks(e,t,i,o){var n,r;let a=await e;if(o.isCancellationRequested)return[];let l=t.original.indexOf(Za.SCOPE_PREFIX)===0,d=l?1:0,c,u;t.values&&t.values.length>1?(c=Ay(t.values[0]),u=Ay(t.values.slice(1))):c=t;let g,p=(r=(n=this.options)===null||n===void 0?void 0:n.openSideBySideDirection)===null||r===void 0?void 0:r.call(n);p&&(g=[{iconClass:p==="right"?le.asClassName($.splitHorizontal):le.asClassName($.splitVertical),tooltip:p==="right"?h("openToSide","Open to the Side"):h("openToBottom","Open to the Bottom")}]);let m=[];for(let v=0;v<a.length;v++){let S=a[v],y=Sx(S.name),D=`$(${_x.toIcon(S.kind).id}) ${y}`,M=D.length-y.length,J=S.containerName;i?.extraContainerLabel&&(J?J=`${i.extraContainerLabel} \u2022 ${J}`:J=i.extraContainerLabel);let j,Re,qe,ht;if(t.original.length>d){let ih=!1;if(c!==t&&([j,Re]=Qm(D,{...t,values:void 0},d,M),typeof j=="number"&&(ih=!0)),typeof j!="number"&&([j,Re]=Qm(D,c,d,M),typeof j!="number"))continue;if(!ih&&u){if(J&&u.original.length>0&&([qe,ht]=Qm(J,u)),typeof qe!="number")continue;typeof j=="number"&&(j+=qe)}}let Ni=S.tags&&S.tags.indexOf(1)>=0;m.push({index:v,kind:S.kind,score:j,label:D,ariaLabel:fx(S.name,S.kind),description:J,highlights:Ni?void 0:{label:Re,description:ht},range:{selection:b.collapseToStart(S.selectionRange),decoration:S.range},strikethrough:Ni,buttons:g})}let f=m.sort((v,S)=>l?this.compareByKindAndScore(v,S):this.compareByScore(v,S)),C=[];if(l){let D=function(){S&&typeof v=="number"&&y>0&&(S.label=Ds(Wy[v]||Fy,y))},v,S,y=0;for(let M of f)v!==M.kind?(D(),v=M.kind,y=1,S={type:"separator"},C.push(S)):y++,C.push(M);D()}else f.length>0&&(C=[{label:h("symbols","symbols ({0})",m.length),type:"separator"},...f]);return C}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){let i=Wy[e.kind]||Fy,o=Wy[t.kind]||Fy,n=i.localeCompare(o);return n===0?this.compareByScore(e,t):n}async getDocumentSymbols(e,t){let i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}};io.PREFIX="@";io.SCOPE_PREFIX=":";io.PREFIX_BY_CATEGORY=`${Za.PREFIX}${Za.SCOPE_PREFIX}`;io=Za=vP([cM(0,N),cM(1,ns)],io);var Fy=h("property","properties ({0})"),Wy={5:h("method","methods ({0})"),11:h("function","functions ({0})"),8:h("_constructor","constructors ({0})"),12:h("variable","variables ({0})"),4:h("class","classes ({0})"),22:h("struct","structs ({0})"),23:h("event","events ({0})"),24:h("operator","operators ({0})"),10:h("interface","interfaces ({0})"),2:h("namespace","namespaces ({0})"),3:h("package","packages ({0})"),25:h("typeParameter","type parameters ({0})"),1:h("modules","modules ({0})"),6:h("property","properties ({0})"),9:h("enum","enumerations ({0})"),21:h("enumMember","enumeration members ({0})"),14:h("string","strings ({0})"),0:h("file","files ({0})"),17:h("array","arrays ({0})"),15:h("number","numbers ({0})"),16:h("boolean","booleans ({0})"),18:h("object","objects ({0})"),19:h("key","keys ({0})"),7:h("field","fields ({0})"),13:h("constant","constants ({0})")};zo();Rt();Er();Ie();Z();we();var bP=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},zy=function(s,e){return function(t,i){e(t,i,s)}},Hy=class extends io{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=Me.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};Hy=bP([zy(0,_e),zy(1,N),zy(2,ns)],Hy);var Jc=class s extends k{constructor(){super({id:s.ID,label:Qh.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:_.hasDocumentSymbolProvider,kbOpts:{kbExpr:_.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Ot).quickAccess.show(io.PREFIX,{itemActivation:q0.NONE})}};Jc.ID="editor.action.quickOutline";w(Jc);wt.as(_o.Quickaccess).registerQuickAccessProvider({ctor:Hy,prefix:io.PREFIX,helpEntries:[{description:Qh.quickOutlineActionLabel,prefix:io.PREFIX,commandId:Jc.ID},{description:Qh.quickOutlineByCategoryActionLabel,prefix:io.PREFIX_BY_CATEGORY}]});zo();Er();Rt();Fe();St();F();function By(s,e){return e&&(s.stack||s.stacktrace)?h("stackTrace.format","{0}: {1}",uM(s),hM(s.stack)||hM(s.stacktrace)):uM(s)}function hM(s){return Array.isArray(s)?s.join(`
69
- `):s}function uM(s){return s.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${s.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof s.code=="string"&&typeof s.errno=="number"&&typeof s.syscall=="string"?h("nodeExceptionMessage","A system error occurred ({0})",s.message):s.message||h("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function Vy(s=null,e=!1){if(!s)return h("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(s)){let t=zt(s),i=Vy(t[0],e);return t.length>1?h("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(nh(s))return s;if(s.detail){let t=s.detail;if(t.error)return By(t.error,e);if(t.exception)return By(t.exception,e)}return s.stack?By(s,e):s.message?s.message:h("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}me();cx();E();function CP(s){var e;let t=new Map;for(let i of s)t.set(i,((e=t.get(i))!==null&&e!==void 0?e:0)+1);return t}var Xm=class s{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){let i=this.computeEmbedding(e),o=new Map,n=[];for(let[r,a]of this.documents){if(t.isCancellationRequested)return[];for(let l of a.chunks){let d=this.computeSimilarityScore(l,i,o);d>0&&n.push({key:r,score:d})}}return n}static termFrequencies(e){return CP(s.splitTerms(e))}static*splitTerms(e){let t=i=>i.toLowerCase();for(let[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);let o=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(o.length>1)for(let n of o)n.length>2&&/\p{Letter}{3,}/gu.test(n)&&(yield t(n))}}updateDocuments(e){var t;for(let{key:i}of e)this.deleteDocument(i);for(let i of e){let o=[];for(let n of i.textChunks){let r=s.termFrequencies(n);for(let a of r.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);o.push({text:n,tf:r})}this.chunkCount+=o.length,this.documents.set(i.key,{chunks:o})}return this}deleteDocument(e){let t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(let i of t.chunks)for(let o of i.tf.keys()){let n=this.chunkOccurrences.get(o);if(typeof n=="number"){let r=n-1;r<=0?this.chunkOccurrences.delete(o):this.chunkOccurrences.set(o,r)}}}}computeSimilarityScore(e,t,i){let o=0;for(let[n,r]of Object.entries(t)){let a=e.tf.get(n);if(!a)continue;let l=i.get(n);typeof l!="number"&&(l=this.computeIdf(n),i.set(n,l));let d=a*l;o+=d*r}return o}computeEmbedding(e){let t=s.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;let i=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){let t=Object.create(null);for(let[i,o]of e){let n=this.computeIdf(i);n>0&&(t[i]=o*n)}return t}};function gM(s){var e,t;let i=s.slice(0);i.sort((n,r)=>r.score-n.score);let o=(t=(e=i[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(o>0)for(let n of i)n.score/=o;return i}F();Ue();at();ge();fe();Te();E();St();var Qa;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(Qa||(Qa={}));function Uy(s){let e=s;return Array.isArray(e.items)}function pM(s){let e=s;return!!e.picks&&e.additionalPicks instanceof Promise}var Jm=class extends I{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var o;let n=new L;e.canAcceptInBackground=!!(!((o=this.options)===null||o===void 0)&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r,a=n.add(new Ye),l=async()=>{let d=a.value=new L;r?.dispose(!0),e.busy=!1,r=new We(t);let c=r.token,u=e.value.substr(this.prefix.length).trim(),g=this._getPicks(u,d,c,i),p=(f,C)=>{var v;let S,y;if(Uy(f)?(S=f.items,y=f.active):S=f,S.length===0){if(C)return!1;(u.length>0||e.hideInput)&&(!((v=this.options)===null||v===void 0)&&v.noResultsPick)&&(ix(this.options.noResultsPick)?S=[this.options.noResultsPick(u)]:S=[this.options.noResultsPick])}return e.items=S,y&&(e.activeItems=[y]),!0},m=async f=>{let C=!1,v=!1;await Promise.all([(async()=>{typeof f.mergeDelay=="number"&&(await Es(f.mergeDelay),c.isCancellationRequested)||v||(C=p(f.picks,!0))})(),(async()=>{e.busy=!0;try{let S=await f.additionalPicks;if(c.isCancellationRequested)return;let y,D;Uy(f.picks)?(y=f.picks.items,D=f.picks.active):y=f.picks;let M,J;if(Uy(S)?(M=S.items,J=S.active):M=S,M.length>0||!C){let j;if(!D&&!J){let Re=e.activeItems[0];Re&&y.indexOf(Re)!==-1&&(j=Re)}p({items:[...y,...M],active:D||J||j})}}finally{c.isCancellationRequested||(e.busy=!1),v=!0}})()])};if(g!==null)if(pM(g))await m(g);else if(!(g instanceof Promise))p(g);else{e.busy=!0;try{let f=await g;if(c.isCancellationRequested)return;pM(f)?await m(f):p(f)}finally{c.isCancellationRequested||(e.busy=!1)}}};return n.add(e.onDidChangeValue(()=>l())),l(),n.add(e.onDidAccept(d=>{let[c]=e.selectedItems;typeof c?.accept=="function"&&(d.inBackground||e.hide(),c.accept(e.keyMods,d))})),n.add(e.onDidTriggerItemButton(async({button:d,item:c})=>{var u,g;if(typeof c.trigger=="function"){let p=(g=(u=c.buttons)===null||u===void 0?void 0:u.indexOf(d))!==null&&g!==void 0?g:-1;if(p>=0){let m=c.trigger(p,e.keyMods),f=typeof m=="number"?m:await m;if(t.isCancellationRequested)return;switch(f){case Qa.NO_ACTION:break;case Qa.CLOSE_PICKER:e.hide();break;case Qa.REFRESH_PICKER:l();break;case Qa.REMOVE_ITEM:{let C=e.items.indexOf(c);if(C!==-1){let v=e.items.slice(),S=v.splice(C,1),y=e.activeItems.filter(M=>M!==S[0]),D=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,y&&(e.activeItems=y),e.keepScrollPosition=D}break}}}}})),n}};yr();var mM=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Ss=function(s,e){return function(t,i){e(t,i,s)}},Cs,Xe,_r=Cs=class extends Jm{constructor(e,t,i,o,n,r){super(Cs.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=o,this.telemetryService=n,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(vr)),this.options=e}async _getPicks(e,t,i,o){var n,r,a,l;let d=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];let c=uh(()=>{let v=new Xm;v.updateDocuments(d.map(y=>({key:y.commandId,textChunks:[this.getTfIdfChunk(y)]})));let S=v.calculateScores(e,i);return gM(S).filter(y=>y.score>Cs.TFIDF_THRESHOLD).slice(0,Cs.TFIDF_MAX_RESULTS)}),u=[];for(let v of d){let S=(n=Cs.WORD_FILTER(e,v.label))!==null&&n!==void 0?n:void 0,y=v.commandAlias&&(r=Cs.WORD_FILTER(e,v.commandAlias))!==null&&r!==void 0?r:void 0;if(S||y)v.highlights={label:S,detail:this.options.showAlias?y:void 0},u.push(v);else if(e===v.commandId)u.push(v);else if(e.length>=3){let D=c();if(i.isCancellationRequested)return[];let M=D.find(J=>J.key===v.commandId);M&&(v.tfIdfScore=M.score,u.push(v))}}let g=new Map;for(let v of u){let S=g.get(v.label);S?(v.description=v.commandId,S.description=S.commandId):g.set(v.label,v)}u.sort((v,S)=>{if(v.tfIdfScore&&S.tfIdfScore)return v.tfIdfScore===S.tfIdfScore?v.label.localeCompare(S.label):S.tfIdfScore-v.tfIdfScore;if(v.tfIdfScore)return 1;if(S.tfIdfScore)return-1;let y=this.commandsHistory.peek(v.commandId),D=this.commandsHistory.peek(S.commandId);if(y&&D)return y>D?-1:1;if(y)return-1;if(D)return 1;if(this.options.suggestedCommandIds){let M=this.options.suggestedCommandIds.has(v.commandId),J=this.options.suggestedCommandIds.has(S.commandId);if(M&&J)return 0;if(M)return-1;if(J)return 1}return v.label.localeCompare(S.label)});let p=[],m=!1,f=!0,C=!!this.options.suggestedCommandIds;for(let v=0;v<u.length;v++){let S=u[v];v===0&&this.commandsHistory.peek(S.commandId)&&(p.push({type:"separator",label:h("recentlyUsed","recently used")}),m=!0),f&&S.tfIdfScore!==void 0&&(p.push({type:"separator",label:h("suggested","similar commands")}),f=!1),C&&S.tfIdfScore===void 0&&!this.commandsHistory.peek(S.commandId)&&(!((a=this.options.suggestedCommandIds)===null||a===void 0)&&a.has(S.commandId))&&(p.push({type:"separator",label:h("commonlyUsed","commonly used")}),m=!0,C=!1),m&&S.tfIdfScore===void 0&&!this.commandsHistory.peek(S.commandId)&&!(!((l=this.options.suggestedCommandIds)===null||l===void 0)&&l.has(S.commandId))&&(p.push({type:"separator",label:h("morecCommands","other commands")}),m=!1),p.push(this.toCommandPick(S,o))}return this.hasAdditionalCommandPicks(e,i)?{picks:p,additionalPicks:(async()=>{var v;let S=await this.getAdditionalCommandPicks(d,u,e,i);if(i.isCancellationRequested)return[];let y=S.map(D=>this.toCommandPick(D,o));return f&&((v=y[0])===null||v===void 0?void 0:v.type)!=="separator"&&y.unshift({type:"separator",label:h("suggested","similar commands")}),y})()}:p}toCommandPick(e,t){if(e.type==="separator")return e;let i=this.keybindingService.lookupKeybinding(e.commandId),o=i?h("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:o,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var n,r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(n=t?.from)!==null&&n!==void 0?n:"quick open"});try{!((r=e.args)===null||r===void 0)&&r.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(a){Ei(a)||this.dialogService.error(h("canNotRun","Command '{0}' resulted in an error",e.label),Vy(a))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let o=e;return t&&t!==e&&(o+=` - ${t}`),i&&i.value!==e&&(o+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),o}};_r.PREFIX=">";_r.TFIDF_THRESHOLD=.5;_r.TFIDF_MAX_RESULTS=5;_r.WORD_FILTER=x0(I0,k0,L0);_r=Cs=mM([Ss(1,B),Ss(2,Ce),Ss(3,Ne),Ss(4,pi),Ss(5,Ks)],_r);var vr=Xe=class extends I{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===qs.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Xe.getConfiguredCommandHistoryLength(this.configurationService),Xe.cache&&Xe.cache.limit!==this.configuredCommandsHistoryLength&&(Xe.cache.limit=this.configuredCommandsHistoryLength,Xe.hasChanges=!0))}load(){let e=this.storageService.get(Xe.PREF_KEY_CACHE,0),t;if(e)try{t=JSON.parse(e)}catch{}let i=Xe.cache=new co(this.configuredCommandsHistoryLength,1);if(t){let o;t.usesLRU?o=t.entries:o=t.entries.sort((n,r)=>n.value-r.value),o.forEach(n=>i.set(n.key,n.value))}Xe.counter=this.storageService.getNumber(Xe.PREF_KEY_COUNTER,0,Xe.counter)}push(e){Xe.cache&&(Xe.cache.set(e,Xe.counter++),Xe.hasChanges=!0)}peek(e){var t;return(t=Xe.cache)===null||t===void 0?void 0:t.peek(e)}saveState(){if(!Xe.cache||!Xe.hasChanges)return;let e={usesLRU:!0,entries:[]};Xe.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Xe.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Xe.PREF_KEY_COUNTER,Xe.counter,0,0),Xe.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var t,i;let n=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof n=="number"?n:Xe.DEFAULT_COMMANDS_HISTORY_LENGTH}};vr.DEFAULT_COMMANDS_HISTORY_LENGTH=50;vr.PREF_KEY_CACHE="commandPalette.mru.cache";vr.PREF_KEY_COUNTER="commandPalette.mru.counter";vr.counter=1;vr.hasChanges=!1;vr=Xe=mM([Ss(0,ai),Ss(1,se)],vr);var ef=class extends _r{constructor(e,t,i,o,n,r){super(e,t,i,o,n,r)}getCodeEditorCommandPicks(){let e=this.activeTextEditorControl;if(!e)return[];let t=[];for(let i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:E0(i.label)||i.id});return t}};ge();Ue();yr();Z();we();var SP=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Xa=function(s,e){return function(t,i){e(t,i,s)}},eh=class extends ef{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,i,o,n,r){super({showAlias:!1},e,i,o,n,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};eh=SP([Xa(0,B),Xa(1,_e),Xa(2,Ce),Xa(3,Ne),Xa(4,pi),Xa(5,Ks)],eh);var th=class s extends k{constructor(){super({id:s.ID,label:Vf.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Ot).quickAccess.show(eh.PREFIX)}};th.ID="editor.action.quickCommand";w(th);wt.as(_o.Quickaccess).registerQuickAccessProvider({ctor:eh,prefix:eh.PREFIX,helpEntries:[{description:Vf.quickCommandHelp,commandId:th.ID}]});Z();Rt();at();re();ge();var wP=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Ja=function(s,e){return function(t,i){e(t,i,s)}},jy=class extends xo{constructor(e,t,i,o,n,r,a){super(!0,e,t,i,o,n,r,a)}};jy=wP([Ja(1,G),Ja(2,_e),Ja(3,He),Ja(4,B),Ja(5,ai),Ja(6,se)],jy);W(xo.ID,jy,4);Z();Xf();Er();Hh();var Ky=class extends k{constructor(){super({id:"editor.action.toggleHighContrast",label:w0.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){let i=e.get(uu),o=i.getColorTheme();Go(o.type)?(i.setTheme(this._originalThemeName||(Ef(o.type)?X0:Q0)),this._originalThemeName=null):(i.setTheme(Ef(o.type)?J0:eL),this._originalThemeName=o.themeName)}};w(Ky);Xf();function Qfe(s,e,t,i){if(!e)return[];let o=Array.isArray(e)?e:[e];if(!o.length)return[];let n=Yy(t);return s.filter(r=>o.some(a=>n.test(String(r[a]??""))))}function Xfe(s){return s?`${s.portal.url}/home/item.html?id=${s.id}`:""}var yP=async()=>{let{editor:s}=await import("./5XCCTH27.js");return s},fM=null;async function Jfe(){return fM??=yP(),await fM}export{Qfe as a,Xfe as b,Jfe as c};
69
+ `):s}function uM(s){return s.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${s.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof s.code=="string"&&typeof s.errno=="number"&&typeof s.syscall=="string"?h("nodeExceptionMessage","A system error occurred ({0})",s.message):s.message||h("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function Vy(s=null,e=!1){if(!s)return h("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(s)){let t=zt(s),i=Vy(t[0],e);return t.length>1?h("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(nh(s))return s;if(s.detail){let t=s.detail;if(t.error)return By(t.error,e);if(t.exception)return By(t.exception,e)}return s.stack?By(s,e):s.message?s.message:h("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}me();cx();E();function CP(s){var e;let t=new Map;for(let i of s)t.set(i,((e=t.get(i))!==null&&e!==void 0?e:0)+1);return t}var Xm=class s{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){let i=this.computeEmbedding(e),o=new Map,n=[];for(let[r,a]of this.documents){if(t.isCancellationRequested)return[];for(let l of a.chunks){let d=this.computeSimilarityScore(l,i,o);d>0&&n.push({key:r,score:d})}}return n}static termFrequencies(e){return CP(s.splitTerms(e))}static*splitTerms(e){let t=i=>i.toLowerCase();for(let[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);let o=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(o.length>1)for(let n of o)n.length>2&&/\p{Letter}{3,}/gu.test(n)&&(yield t(n))}}updateDocuments(e){var t;for(let{key:i}of e)this.deleteDocument(i);for(let i of e){let o=[];for(let n of i.textChunks){let r=s.termFrequencies(n);for(let a of r.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);o.push({text:n,tf:r})}this.chunkCount+=o.length,this.documents.set(i.key,{chunks:o})}return this}deleteDocument(e){let t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(let i of t.chunks)for(let o of i.tf.keys()){let n=this.chunkOccurrences.get(o);if(typeof n=="number"){let r=n-1;r<=0?this.chunkOccurrences.delete(o):this.chunkOccurrences.set(o,r)}}}}computeSimilarityScore(e,t,i){let o=0;for(let[n,r]of Object.entries(t)){let a=e.tf.get(n);if(!a)continue;let l=i.get(n);typeof l!="number"&&(l=this.computeIdf(n),i.set(n,l));let d=a*l;o+=d*r}return o}computeEmbedding(e){let t=s.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;let i=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){let t=Object.create(null);for(let[i,o]of e){let n=this.computeIdf(i);n>0&&(t[i]=o*n)}return t}};function gM(s){var e,t;let i=s.slice(0);i.sort((n,r)=>r.score-n.score);let o=(t=(e=i[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(o>0)for(let n of i)n.score/=o;return i}F();Ue();at();ge();fe();Te();E();St();var Qa;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(Qa||(Qa={}));function Uy(s){let e=s;return Array.isArray(e.items)}function pM(s){let e=s;return!!e.picks&&e.additionalPicks instanceof Promise}var Jm=class extends I{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var o;let n=new L;e.canAcceptInBackground=!!(!((o=this.options)===null||o===void 0)&&o.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let r,a=n.add(new Ye),l=async()=>{let d=a.value=new L;r?.dispose(!0),e.busy=!1,r=new We(t);let c=r.token,u=e.value.substr(this.prefix.length).trim(),g=this._getPicks(u,d,c,i),p=(f,C)=>{var v;let S,y;if(Uy(f)?(S=f.items,y=f.active):S=f,S.length===0){if(C)return!1;(u.length>0||e.hideInput)&&(!((v=this.options)===null||v===void 0)&&v.noResultsPick)&&(ix(this.options.noResultsPick)?S=[this.options.noResultsPick(u)]:S=[this.options.noResultsPick])}return e.items=S,y&&(e.activeItems=[y]),!0},m=async f=>{let C=!1,v=!1;await Promise.all([(async()=>{typeof f.mergeDelay=="number"&&(await Es(f.mergeDelay),c.isCancellationRequested)||v||(C=p(f.picks,!0))})(),(async()=>{e.busy=!0;try{let S=await f.additionalPicks;if(c.isCancellationRequested)return;let y,D;Uy(f.picks)?(y=f.picks.items,D=f.picks.active):y=f.picks;let M,J;if(Uy(S)?(M=S.items,J=S.active):M=S,M.length>0||!C){let j;if(!D&&!J){let Re=e.activeItems[0];Re&&y.indexOf(Re)!==-1&&(j=Re)}p({items:[...y,...M],active:D||J||j})}}finally{c.isCancellationRequested||(e.busy=!1),v=!0}})()])};if(g!==null)if(pM(g))await m(g);else if(!(g instanceof Promise))p(g);else{e.busy=!0;try{let f=await g;if(c.isCancellationRequested)return;pM(f)?await m(f):p(f)}finally{c.isCancellationRequested||(e.busy=!1)}}};return n.add(e.onDidChangeValue(()=>l())),l(),n.add(e.onDidAccept(d=>{let[c]=e.selectedItems;typeof c?.accept=="function"&&(d.inBackground||e.hide(),c.accept(e.keyMods,d))})),n.add(e.onDidTriggerItemButton(async({button:d,item:c})=>{var u,g;if(typeof c.trigger=="function"){let p=(g=(u=c.buttons)===null||u===void 0?void 0:u.indexOf(d))!==null&&g!==void 0?g:-1;if(p>=0){let m=c.trigger(p,e.keyMods),f=typeof m=="number"?m:await m;if(t.isCancellationRequested)return;switch(f){case Qa.NO_ACTION:break;case Qa.CLOSE_PICKER:e.hide();break;case Qa.REFRESH_PICKER:l();break;case Qa.REMOVE_ITEM:{let C=e.items.indexOf(c);if(C!==-1){let v=e.items.slice(),S=v.splice(C,1),y=e.activeItems.filter(M=>M!==S[0]),D=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,y&&(e.activeItems=y),e.keepScrollPosition=D}break}}}}})),n}};yr();var mM=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Ss=function(s,e){return function(t,i){e(t,i,s)}},Cs,Xe,_r=Cs=class extends Jm{constructor(e,t,i,o,n,r){super(Cs.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=o,this.telemetryService=n,this.dialogService=r,this.commandsHistory=this._register(this.instantiationService.createInstance(vr)),this.options=e}async _getPicks(e,t,i,o){var n,r,a,l;let d=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];let c=uh(()=>{let v=new Xm;v.updateDocuments(d.map(y=>({key:y.commandId,textChunks:[this.getTfIdfChunk(y)]})));let S=v.calculateScores(e,i);return gM(S).filter(y=>y.score>Cs.TFIDF_THRESHOLD).slice(0,Cs.TFIDF_MAX_RESULTS)}),u=[];for(let v of d){let S=(n=Cs.WORD_FILTER(e,v.label))!==null&&n!==void 0?n:void 0,y=v.commandAlias&&(r=Cs.WORD_FILTER(e,v.commandAlias))!==null&&r!==void 0?r:void 0;if(S||y)v.highlights={label:S,detail:this.options.showAlias?y:void 0},u.push(v);else if(e===v.commandId)u.push(v);else if(e.length>=3){let D=c();if(i.isCancellationRequested)return[];let M=D.find(J=>J.key===v.commandId);M&&(v.tfIdfScore=M.score,u.push(v))}}let g=new Map;for(let v of u){let S=g.get(v.label);S?(v.description=v.commandId,S.description=S.commandId):g.set(v.label,v)}u.sort((v,S)=>{if(v.tfIdfScore&&S.tfIdfScore)return v.tfIdfScore===S.tfIdfScore?v.label.localeCompare(S.label):S.tfIdfScore-v.tfIdfScore;if(v.tfIdfScore)return 1;if(S.tfIdfScore)return-1;let y=this.commandsHistory.peek(v.commandId),D=this.commandsHistory.peek(S.commandId);if(y&&D)return y>D?-1:1;if(y)return-1;if(D)return 1;if(this.options.suggestedCommandIds){let M=this.options.suggestedCommandIds.has(v.commandId),J=this.options.suggestedCommandIds.has(S.commandId);if(M&&J)return 0;if(M)return-1;if(J)return 1}return v.label.localeCompare(S.label)});let p=[],m=!1,f=!0,C=!!this.options.suggestedCommandIds;for(let v=0;v<u.length;v++){let S=u[v];v===0&&this.commandsHistory.peek(S.commandId)&&(p.push({type:"separator",label:h("recentlyUsed","recently used")}),m=!0),f&&S.tfIdfScore!==void 0&&(p.push({type:"separator",label:h("suggested","similar commands")}),f=!1),C&&S.tfIdfScore===void 0&&!this.commandsHistory.peek(S.commandId)&&(!((a=this.options.suggestedCommandIds)===null||a===void 0)&&a.has(S.commandId))&&(p.push({type:"separator",label:h("commonlyUsed","commonly used")}),m=!0,C=!1),m&&S.tfIdfScore===void 0&&!this.commandsHistory.peek(S.commandId)&&!(!((l=this.options.suggestedCommandIds)===null||l===void 0)&&l.has(S.commandId))&&(p.push({type:"separator",label:h("morecCommands","other commands")}),m=!1),p.push(this.toCommandPick(S,o))}return this.hasAdditionalCommandPicks(e,i)?{picks:p,additionalPicks:(async()=>{var v;let S=await this.getAdditionalCommandPicks(d,u,e,i);if(i.isCancellationRequested)return[];let y=S.map(D=>this.toCommandPick(D,o));return f&&((v=y[0])===null||v===void 0?void 0:v.type)!=="separator"&&y.unshift({type:"separator",label:h("suggested","similar commands")}),y})()}:p}toCommandPick(e,t){if(e.type==="separator")return e;let i=this.keybindingService.lookupKeybinding(e.commandId),o=i?h("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:o,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var n,r;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(n=t?.from)!==null&&n!==void 0?n:"quick open"});try{!((r=e.args)===null||r===void 0)&&r.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(a){Ei(a)||this.dialogService.error(h("canNotRun","Command '{0}' resulted in an error",e.label),Vy(a))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let o=e;return t&&t!==e&&(o+=` - ${t}`),i&&i.value!==e&&(o+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),o}};_r.PREFIX=">";_r.TFIDF_THRESHOLD=.5;_r.TFIDF_MAX_RESULTS=5;_r.WORD_FILTER=x0(I0,k0,L0);_r=Cs=mM([Ss(1,B),Ss(2,Ce),Ss(3,Ne),Ss(4,pi),Ss(5,Ks)],_r);var vr=Xe=class extends I{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===qs.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Xe.getConfiguredCommandHistoryLength(this.configurationService),Xe.cache&&Xe.cache.limit!==this.configuredCommandsHistoryLength&&(Xe.cache.limit=this.configuredCommandsHistoryLength,Xe.hasChanges=!0))}load(){let e=this.storageService.get(Xe.PREF_KEY_CACHE,0),t;if(e)try{t=JSON.parse(e)}catch{}let i=Xe.cache=new co(this.configuredCommandsHistoryLength,1);if(t){let o;t.usesLRU?o=t.entries:o=t.entries.sort((n,r)=>n.value-r.value),o.forEach(n=>i.set(n.key,n.value))}Xe.counter=this.storageService.getNumber(Xe.PREF_KEY_COUNTER,0,Xe.counter)}push(e){Xe.cache&&(Xe.cache.set(e,Xe.counter++),Xe.hasChanges=!0)}peek(e){var t;return(t=Xe.cache)===null||t===void 0?void 0:t.peek(e)}saveState(){if(!Xe.cache||!Xe.hasChanges)return;let e={usesLRU:!0,entries:[]};Xe.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Xe.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Xe.PREF_KEY_COUNTER,Xe.counter,0,0),Xe.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var t,i;let n=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof n=="number"?n:Xe.DEFAULT_COMMANDS_HISTORY_LENGTH}};vr.DEFAULT_COMMANDS_HISTORY_LENGTH=50;vr.PREF_KEY_CACHE="commandPalette.mru.cache";vr.PREF_KEY_COUNTER="commandPalette.mru.counter";vr.counter=1;vr.hasChanges=!1;vr=Xe=mM([Ss(0,ai),Ss(1,se)],vr);var ef=class extends _r{constructor(e,t,i,o,n,r){super(e,t,i,o,n,r)}getCodeEditorCommandPicks(){let e=this.activeTextEditorControl;if(!e)return[];let t=[];for(let i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:E0(i.label)||i.id});return t}};ge();Ue();yr();Z();we();var SP=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Xa=function(s,e){return function(t,i){e(t,i,s)}},eh=class extends ef{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,i,o,n,r){super({showAlias:!1},e,i,o,n,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};eh=SP([Xa(0,B),Xa(1,_e),Xa(2,Ce),Xa(3,Ne),Xa(4,pi),Xa(5,Ks)],eh);var th=class s extends k{constructor(){super({id:s.ID,label:Vf.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:_.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Ot).quickAccess.show(eh.PREFIX)}};th.ID="editor.action.quickCommand";w(th);wt.as(_o.Quickaccess).registerQuickAccessProvider({ctor:eh,prefix:eh.PREFIX,helpEntries:[{description:Vf.quickCommandHelp,commandId:th.ID}]});Z();Rt();at();re();ge();var wP=function(s,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(n=(o<3?r(n):o>3?r(e,t,n):r(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n},Ja=function(s,e){return function(t,i){e(t,i,s)}},jy=class extends xo{constructor(e,t,i,o,n,r,a){super(!0,e,t,i,o,n,r,a)}};jy=wP([Ja(1,G),Ja(2,_e),Ja(3,He),Ja(4,B),Ja(5,ai),Ja(6,se)],jy);W(xo.ID,jy,4);Z();Xf();Er();Hh();var Ky=class extends k{constructor(){super({id:"editor.action.toggleHighContrast",label:w0.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){let i=e.get(uu),o=i.getColorTheme();Go(o.type)?(i.setTheme(this._originalThemeName||(Ef(o.type)?X0:Q0)),this._originalThemeName=null):(i.setTheme(Ef(o.type)?J0:eL),this._originalThemeName=o.themeName)}};w(Ky);Xf();function Qfe(s,e,t,i){if(!e)return[];let o=Array.isArray(e)?e:[e];if(!o.length)return[];let n=Yy(t);return s.filter(r=>o.some(a=>n.test(String(r[a]??""))))}function Xfe(s){return s?`${s.portal.url}/home/item.html?id=${s.id}`:""}var yP=async()=>{let{editor:s}=await import("./UVUHHWFK.js");return s},fM=null;async function Jfe(){return fM??=yP(),await fM}export{Qfe as a,Xfe as b,Jfe as c};