@loicngr/kobo 2.1.21 → 2.1.23
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.
- package/AGENTS.md +69 -4
- package/CHANGELOG.md +9 -0
- package/CONFIGURATION.md +112 -2
- package/dist/mcp-server/kobo-tasks-server.js +4 -4
- package/dist/server/index.js +21 -6
- package/dist/server/services/agent/engines/claude-code/engine.js +5 -2
- package/dist/server/services/agent/engines/codex/engine.js +3 -0
- package/dist/server/services/agent/orchestrator.js +2 -0
- package/dist/server/services/agent/turn-liveness.js +1 -1
- package/dist/server/services/dev-server-service.js +41 -13
- package/dist/server/services/lifecycle-hook-service.js +29 -2
- package/dist/server/services/settings-service.js +66 -0
- package/dist/server/utils/script-runner.js +3 -1
- package/dist/shared/launch-instructions.js +8 -4
- package/dist/shared/memory-tools.js +2 -2
- package/docker-compose.vps.yml +1 -1
- package/docs/deployment-vps.md +36 -10
- package/docs/getting-started.md +11 -0
- package/package.json +1 -1
- package/scripts/kobo-update +25 -13
- package/src/client/dist/pwa/assets/ActivityFeed-1OKX_g3B.js +2 -0
- package/src/client/dist/pwa/assets/{ActivityFeed-DdJvMzRI.css → ActivityFeed-CmAFv-2c.css} +1 -1
- package/src/client/dist/pwa/assets/{AutoLoopFinalReviewSettings-f4VDR5dd.js → AutoLoopFinalReviewSettings-VoA9uBw0.js} +1 -1
- package/src/client/dist/pwa/assets/{ChangelogPage-dEWpjTlp.js → ChangelogPage-DHl3hD3t.js} +1 -1
- package/src/client/dist/pwa/assets/{ComparisonPanel-Bwbqgvr4.js → ComparisonPanel-D6EKTtni.js} +1 -1
- package/src/client/dist/pwa/assets/{CreatePage-CCCCAhrx.js → CreatePage-CZzEOVVq.js} +1 -1
- package/src/client/dist/pwa/assets/{DashboardPage-3byhBITf.js → DashboardPage-DjLoUvjA.js} +1 -1
- package/src/client/dist/pwa/assets/{DiffViewer-Bj_NTfCF.js → DiffViewer-BQ6OEmoi.js} +3 -3
- package/src/client/dist/pwa/assets/{DocumentsPanel-xyLDV3T1.js → DocumentsPanel-yrQviqCd.js} +1 -1
- package/src/client/dist/pwa/assets/{DrawerToggleButton-pwBSstQP.js → DrawerToggleButton-D5qNeXnn.js} +1 -1
- package/src/client/dist/pwa/assets/{GitPanel-DvIdrkVw.js → GitPanel-DCXlhcAD.js} +3 -3
- package/src/client/dist/pwa/assets/{HealthPage-BSwhZQRo.js → HealthPage-COicuNQn.js} +1 -1
- package/src/client/dist/pwa/assets/{MainLayout-DZJ9BvZw.js → MainLayout-ZcExZTqC.js} +2 -2
- package/src/client/dist/pwa/assets/{MemoryPanel-ChR032zP.js → MemoryPanel-D73Qz9f7.js} +1 -1
- package/src/client/dist/pwa/assets/{MemoryProposalList-BRKSoS4K.js → MemoryProposalList-BGlq2DkD.js} +1 -1
- package/src/client/dist/pwa/assets/{QBtnDropdown-o3QH0Bb8.js → QBtnDropdown-CykBCmwa.js} +1 -1
- package/src/client/dist/pwa/assets/{QExpansionItem-BhFHiyq9.js → QExpansionItem-CAW9J1Uv.js} +1 -1
- package/src/client/dist/pwa/assets/{QScrollArea-BsNY6slB.js → QScrollArea-C_d-8eO7.js} +1 -1
- package/src/client/dist/pwa/assets/{QSelect-bEq3g_io.js → QSelect-C1AN93yA.js} +1 -1
- package/src/client/dist/pwa/assets/{QTooltip-xYZ6KNu2.js → QTooltip-C9qaLW_h.js} +1 -1
- package/src/client/dist/pwa/assets/{SchedulePanel-DIFv_FTY.js → SchedulePanel-CQpzDhq7.js} +1 -1
- package/src/client/dist/pwa/assets/{SearchPage-BqTBIt5E.js → SearchPage-fZlSSEu_.js} +1 -1
- package/src/client/dist/pwa/assets/{SettingsPage-BRvUAZ5r.css → SettingsPage-BCOF0ssp.css} +1 -1
- package/src/client/dist/pwa/assets/SettingsPage-eyJZxeCJ.js +9 -0
- package/src/client/dist/pwa/assets/{SplitWorkspacePage-D6r2pl5g.js → SplitWorkspacePage-CfeO6TZb.js} +1 -1
- package/src/client/dist/pwa/assets/{TerminalPanel-CladK9Vv.js → TerminalPanel-CfDZOteT.js} +1 -1
- package/src/client/dist/pwa/assets/{ToolCallItem-CdzEME4w.js → ToolCallItem-CHE6tylq.js} +2 -2
- package/src/client/dist/pwa/assets/{TouchPan-B4gQPwGN.js → TouchPan-Csev_qU6.js} +1 -1
- package/src/client/dist/pwa/assets/{TourReplayButton-B0j6AZwU.js → TourReplayButton-Crr7tF1b.js} +1 -1
- package/src/client/dist/pwa/assets/{WorkspaceAttentionLabels-CeVhoidC.js → WorkspaceAttentionLabels-DpUZOiJv.js} +1 -1
- package/src/client/dist/pwa/assets/{WorkspacePage-w2bF8wTd.css → WorkspacePage-Bk-WWOYM.css} +1 -1
- package/src/client/dist/pwa/assets/{WorkspacePage-CK5XCuG_.js → WorkspacePage-_QSKLO42.js} +3 -3
- package/src/client/dist/pwa/assets/{browser-B8tNScg1.js → browser-o7ftkZex.js} +1 -1
- package/src/client/dist/pwa/assets/{build-path-tree-kmVAcvs_.js → build-path-tree-D6dZQpIb.js} +1 -1
- package/src/client/dist/pwa/assets/{custom-sounds-CJwd-8TL.js → custom-sounds-DVX9zCET.js} +1 -1
- package/src/client/dist/pwa/assets/{de-BaO6kbdO.js → de-DOE4H_Jf.js} +2 -2
- package/src/client/dist/pwa/assets/{editor.api-CgbPVW9s.js → editor.api-C8TYnUXm.js} +1 -1
- package/src/client/dist/pwa/assets/{efforts-y7Wf_Rgd.js → efforts-DfsG0_o0.js} +1 -1
- package/src/client/dist/pwa/assets/{es-DTvSsbD0.js → es-BW57JPlm.js} +2 -2
- package/src/client/dist/pwa/assets/{expand-template-BFbbjj7X.js → expand-template-CJZlWMfI.js} +1 -1
- package/src/client/dist/pwa/assets/{format-BETfc4z9.js → format-DOCqk2Dn.js} +1 -1
- package/src/client/dist/pwa/assets/{formatters-C22K9vlC.js → formatters-BFocC6LJ.js} +1 -1
- package/src/client/dist/pwa/assets/{fr-BH7V66Yz.js → fr-DnmIKHaQ.js} +2 -2
- package/src/client/dist/pwa/assets/{freemarker2-DiRVvp9O.js → freemarker2-CfME4WOK.js} +1 -1
- package/src/client/dist/pwa/assets/{handlebars-BLYRroSQ.js → handlebars-uvKdDnJl.js} +1 -1
- package/src/client/dist/pwa/assets/{html-DAW2vteY.js → html-BrEPgLuD.js} +1 -1
- package/src/client/dist/pwa/assets/i18n-BmTCjikk.js +1 -0
- package/src/client/dist/pwa/assets/{index-CbyHfF8I.js → index-z1Oh2-I_.js} +4 -4
- package/src/client/dist/pwa/assets/{it-DZGbkkoy.js → it-DSrEQgZQ.js} +2 -2
- package/src/client/dist/pwa/assets/{javascript-Bb5J8n0k.js → javascript-KH2xP4lQ.js} +1 -1
- package/src/client/dist/pwa/assets/{liquid-Dqx3adnJ.js → liquid-D08TlsVs.js} +1 -1
- package/src/client/dist/pwa/assets/{mdx-D_7igLV3.js → mdx-y74A51cS.js} +1 -1
- package/src/client/dist/pwa/assets/{monaco-contributions-C-0CbrAy.js → monaco-contributions-Cx8iaAhd.js} +1 -1
- package/src/client/dist/pwa/assets/{monaco.contribution-c6JPBEZI.js → monaco.contribution-CFq0guCl.js} +2 -2
- package/src/client/dist/pwa/assets/{network-auth-BE4qbvWm.js → network-auth-DnGOOzCV.js} +1 -1
- package/src/client/dist/pwa/assets/{notify-theme-BVFBBGrJ.js → notify-theme-B9lUAgQl.js} +1 -1
- package/src/client/dist/pwa/assets/{project-color-CHOR2jB5.js → project-color-TgENPFLi.js} +1 -1
- package/src/client/dist/pwa/assets/{python-Dqubw1F5.js → python-Cy3bAVPq.js} +1 -1
- package/src/client/dist/pwa/assets/{razor-BQphc9Kt.js → razor-gD9QOuiV.js} +1 -1
- package/src/client/dist/pwa/assets/{typescript-Dep00l0X.js → typescript-CEItY0bH.js} +1 -1
- package/src/client/dist/pwa/assets/{use-search-index-status-CQHHvHwM.js → use-search-index-status-BtJ0pOy9.js} +1 -1
- package/src/client/dist/pwa/assets/{use-tours-IVbXTmz2.js → use-tours-COLDth2h.js} +2 -2
- package/src/client/dist/pwa/assets/{use-worktree-restore-B3s5xDGR.js → use-worktree-restore-CShbwpGy.js} +1 -1
- package/src/client/dist/pwa/assets/{workspace-templates-CyuTpztP.js → workspace-templates-BOMNQgBl.js} +1 -1
- package/src/client/dist/pwa/assets/{xml-BMS2dvaF.js → xml-BJvL5qcE.js} +1 -1
- package/src/client/dist/pwa/assets/{yaml-CYw92aic.js → yaml-DtkVRZaX.js} +1 -1
- package/src/client/dist/pwa/index.html +1 -1
- package/src/client/dist/pwa/sw.js +1 -1
- package/src/mcp-server/README.md +13 -0
- package/src/mcp-server/kobo-tasks-server.ts +5 -4
- package/src/client/dist/pwa/assets/ActivityFeed-DiUxnmGJ.js +0 -2
- package/src/client/dist/pwa/assets/SettingsPage-BLD0xWFB.js +0 -9
- package/src/client/dist/pwa/assets/i18n-DnuTmw3O.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,$c as t,$h as n,$l as r,$m as i,$n as a,$o as o,$p as s,$r as c,$s as l,$t as u,$u as d,A as f,Aa as p,Ac as m,Ad as h,Ah as g,Ai as _,Al as v,An as y,Ao as b,Ar as ee,As as te,At as ne,Au as re,B as ie,Bd as ae,Bf as oe,Bh as se,Bi as ce,Bl as le,Bo as ue,Br as de,Bt as fe,Bu as pe,C as me,Ca as he,Cc as ge,Cd as x,Cf as _e,Ch as ve,Ci as ye,Cl as be,Co as xe,Cr as Se,Cs as Ce,Ct as we,Cu as S,Da as Te,Dc as Ee,Dd as C,Df as De,Dh as Oe,Dl as ke,Dm as w,Do as Ae,Dr as je,Ds as Me,Dt as Ne,Du as Pe,E as Fe,Ea as Ie,Ec as Le,Ed as Re,Ef as ze,El as Be,Em as Ve,En as He,Eo as Ue,Et as We,Eu as Ge,F as Ke,Fa as qe,Fd as Je,Ff as Ye,Fh as Xe,Fl as Ze,Fn as Qe,Fo as $e,Fs as et,Ft as tt,Fu as nt,G as rt,Ga as it,Gc as at,Gd as ot,Gi as st,Gl as ct,Gm as lt,Gn as ut,Go as dt,Gp as ft,Gr as pt,Gs as T,H as mt,Ha as ht,Hd as gt,Hf as _t,Hh as vt,Hi as yt,Hl as E,Hn as bt,Ho as xt,Hr as St,Hs as D,Ht as Ct,Hu as wt,Ia as Tt,Ic as Et,Id as Dt,If as Ot,Ih as kt,Ii as At,Il as jt,In as Mt,Io as Nt,Ir as Pt,Is as Ft,It,Iu as Lt,J as Rt,Ja as zt,Jc as O,Jd as Bt,Jh as Vt,Ji as Ht,Jl as Ut,Jm as Wt,Jn as Gt,Jo as Kt,Jr as qt,Js as Jt,Ju as Yt,Ka as Xt,Kh as Zt,Ki as Qt,Kl as $t,Kn as en,Ko as tn,Kp as nn,Kr as rn,Ks as an,Kt as on,Ku as sn,La as cn,Ld as ln,Lf as un,Lh as dn,Li as fn,Ll as k,Lm as pn,Ln as mn,Lo as hn,Lr as gn,Ls as _n,Lu as vn,M as yn,Ma as bn,Md as xn,Mh as Sn,Mi as Cn,Ml as A,Mm as wn,Mn as Tn,Mo as En,Mr as Dn,Ms as On,Mt as kn,Mu as An,Na as jn,Nc as Mn,Nd as Nn,Nf as Pn,Nh as Fn,Ni as In,Nl as Ln,Nm as Rn,No as zn,Ns as Bn,Nt as Vn,Nu as Hn,O as Un,Oa as Wn,Od as Gn,Of as Kn,Oh as qn,Om as Jn,On as Yn,Oo as Xn,Or as Zn,Os as Qn,Ot as $n,Ou as er,P as tr,Pa as nr,Pc as rr,Pd as ir,Pf as ar,Ph as or,Pi as sr,Pl as cr,Pm as lr,Po as ur,Ps as dr,Pu as fr,Q as pr,Qc as mr,Qd as hr,Qf as gr,Qh as _r,Ql as vr,Qm as j,Qn as yr,Qo as br,Qp as xr,Qr as Sr,Qs as Cr,Qt as wr,R as Tr,Ra as Er,Rc as Dr,Rd as Or,Rf as kr,Rh as Ar,Ri as jr,Rl as Mr,Rm as Nr,Rn as Pr,Ro as Fr,Rr as Ir,Rs as Lr,S as Rr,Sa as zr,Sc as Br,Sd as Vr,Sh as M,Si as Hr,Sl as Ur,Sm as Wr,So as Gr,Ss as Kr,St as qr,Su as Jr,T as Yr,Ta as Xr,Tc as Zr,Td as Qr,Tf as $r,To as ei,Tr as ti,Ts as ni,Tt as ri,Tu as ii,U as ai,Ua as oi,Uf as si,Uh as ci,Ui as li,Ul as N,Um as ui,Un as di,Uo as fi,Ur as pi,Us as mi,Ut as hi,Uu as gi,V as _i,Va as vi,Vd as yi,Vf as bi,Vh as xi,Vl as P,Vm as Si,Vn as Ci,Vo as wi,Vr as Ti,Vs as Ei,Vt as Di,Vu as Oi,W as ki,Wc as Ai,Wd as ji,Wh as Mi,Wi as Ni,Wm as F,Wo as Pi,Wp as Fi,Wr as Ii,Wt as Li,X as Ri,Xa as zi,Xc as Bi,Xd as Vi,Xf as Hi,Xh as Ui,Xi as Wi,Xm as Gi,Xn as Ki,Xo as qi,Xp as Ji,Xr as Yi,Xs as Xi,Xt as Zi,Y as Qi,Ya as $i,Yc as ea,Yd as ta,Yf as na,Yh as ra,Yi as ia,Ym as aa,Yn as oa,Yo as sa,Yp as ca,Yr as la,Ys as ua,Yt as da,Yu as I,Z as fa,Zc as pa,Zd as ma,Zf as ha,Zh as ga,Zi as _a,Zl as va,Zm as L,Zn as ya,Zo as ba,Zp as xa,Zr as Sa,Zs as Ca,Zt as wa,_ as Ta,_a as Ea,_c as Da,_d as Oa,_i as ka,_l as Aa,_m as R,_o as ja,_r as Ma,_s as Na,_u as Pa,a as Fa,aa as Ia,ac as La,ad as Ra,af as za,ag as Ba,ah as Va,ai as Ha,al as Ua,am as Wa,an as Ga,ao as Ka,ar as qa,as as Ja,at as Ya,au as Xa,b as Za,ba as Qa,bf as $a,bi as eo,bl as to,bm as no,bn as ro,bs as io,bt as ao,bu as z,c as oo,ca as so,cc as co,cd as lo,cf as uo,cg as fo,ch as po,ci as B,cl as mo,cn as ho,co as go,cr as _o,cs as vo,cu as yo,d as bo,da as xo,dc as So,dd as Co,df as wo,dg as To,dh as Eo,dm as Do,do as Oo,ds as ko,du as Ao,ea as jo,ec as Mo,ed as No,eg as Po,eh as Fo,ei as Io,el as V,em as Lo,en as Ro,es as zo,et as Bo,eu as Vo,f as Ho,fa as Uo,fc as Wo,fd as Go,ff as Ko,fg as qo,fh as Jo,fi as Yo,fl as Xo,fm as Zo,fo as Qo,fs as $o,ft as es,fu as ts,g as ns,ga as rs,gd as is,gh as as,gi as os,gl as ss,gm as H,gn as cs,gr as ls,gs as us,gt as ds,gu as fs,h as ps,ha as ms,hc as hs,hd as gs,hh as _s,hl as vs,hm as U,hn as ys,ho as bs,hs as xs,ht as Ss,hu as Cs,i as ws,ia as Ts,ic as Es,id as Ds,if as Os,ig as ks,ih as As,il as js,im as Ms,in as Ns,is as Ps,j as Fs,ja as Is,jd as Ls,jh as Rs,jl as zs,jo as Bs,jr as Vs,js as Hs,ju as Us,k as Ws,ka as Gs,kc as Ks,kd as qs,kf as Js,kh as Ys,kl as Xs,km as Zs,kn as Qs,ko as $s,kr as ec,kt as tc,ku as nc,l as rc,la as ic,lc as ac,ld as oc,lf as sc,lg as cc,lh as lc,li as uc,ll as dc,lm as fc,lo as pc,lr as mc,ls as hc,lu as W,ma as gc,mc as _c,md as vc,mh as yc,ml as bc,mn as xc,mo as Sc,mt as Cc,mu as wc,n as Tc,na as Ec,nc as Dc,nd as Oc,ng as kc,nh as Ac,ni as jc,nl as Mc,nm as Nc,no as Pc,nr as Fc,ns as Ic,nu as Lc,o as Rc,oa as zc,oc as Bc,od as Vc,of as Hc,og as Uc,oh as Wc,om as Gc,on as Kc,oo as qc,os as Jc,ot as Yc,p as Xc,pa as Zc,pc as Qc,pd as $c,pf as el,ph as tl,pi as nl,pl as rl,pm as G,pn as il,po as al,pr as ol,ps as sl,pu as cl,qa as ll,qd as ul,qf as dl,qh as fl,qi as pl,ql as K,qo as ml,qp as hl,qr as gl,qs as _l,r as vl,rc as yl,rd as bl,rf as xl,rg as Sl,rh as Cl,ri as wl,rl as Tl,rm as El,rn as Dl,ro as Ol,rr as kl,rs as Al,rt as jl,ru as q,s as Ml,sa as J,sc as Nl,sf as Pl,sg as Fl,sh as Il,si as Ll,sl as Rl,sm as zl,sn as Bl,so as Vl,ss as Hl,st as Ul,su as Wl,tc as Gl,td as Kl,tf as ql,tg as Jl,ti as Yl,tl as Y,tn as Xl,to as Zl,tr as Ql,ts as $l,tu as eu,u as tu,ua as nu,uc as ru,ud as iu,uf as au,ug as ou,uh as su,ui as cu,uo as lu,ur as uu,us as X,ut as du,uu as fu,v as pu,va as mu,vc as hu,vd as gu,vh as _u,vi as vu,vl as yu,vm as bu,vr as xu,vs as Su,vt as Cu,w as wu,wa as Tu,wc as Eu,wd as Du,wf as Ou,wh as ku,wi as Au,wl as ju,wm as Mu,wo as Nu,wr as Pu,wt as Fu,wu as Iu,x as Lu,xa as Ru,xc as zu,xd as Bu,xh as Z,xi as Vu,xn as Hu,xo as Uu,xr as Wu,xs as Gu,xt as Ku,xu as qu,y as Ju,ya as Yu,yc as Xu,yd as Zu,yi as Qu,yl as $u,ym as ed,yn as td,yo as nd,yu as rd,z as id,zc as ad,zd as od,zf as sd,zh as cd,zi as ld,zl as ud,zn as dd,zo as fd,zr as pd,zt as md,zu as hd}from"./format-BETfc4z9.js";var gd,_d=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},vd=function(e,t){return function(n,r){t(n,r,e)}},yd,bd=new N(`selectionAnchorSet`,!1),xd=(gd=class{static get(e){return e.getContribution(yd.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=bd.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(U.fromPositions(e,e),{description:`selection-anchor`,stickiness:1,hoverMessage:new ec().appendText(Z(849,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ce(Z(850,`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(U.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()}},yd=gd,gd.ID=`editor.contrib.selectionAnchorController`,gd);xd=yd=_d([vd(1,E)],xd);var Sd=class extends O{constructor(){super({id:`editor.action.setSelectionAnchor`,label:M(851,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:Mu(2089,2080),weight:100}})}async run(e,t){xd.get(t)?.setSelectionAnchor()}},Cd=class extends O{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:M(852,`Go to Selection Anchor`),precondition:bd})}async run(e,t){xd.get(t)?.goToSelectionAnchor()}},wd=class extends O{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:M(853,`Select from Anchor to Cursor`),precondition:bd,kbOpts:{kbExpr:J.editorTextFocus,primary:Mu(2089,2089),weight:100}})}async run(e,t){xd.get(t)?.selectFromAnchorToCursor()}},Td=class extends O{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:M(854,`Cancel Selection Anchor`),precondition:bd,kbOpts:{kbExpr:J.editorTextFocus,primary:9,weight:100}})}async run(e,t){xd.get(t)?.cancelSelectionAnchor()}};Y(xd.ID,xd,4),t(Sd),t(Cd),t(wd),t(Td);var Ed,Dd=X(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,Z(855,`Overview ruler marker color for matching brackets.`)),Od=class extends O{constructor(){super({id:`editor.action.jumpToBracket`,label:M(857,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:3165,weight:100}})}run(e,t){Md.get(t)?.jumpToBracket()}},kd=class extends O{constructor(){super({id:`editor.action.selectToBracket`,label:M(858,`Select to Bracket`),precondition:void 0,metadata:{description:M(859,`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,n){let r=!0;n&&n.selectBrackets===!1&&(r=!1),Md.get(t)?.selectToBracket(r)}},Ad=class extends O{constructor(){super({id:`editor.action.removeBrackets`,label:M(860,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Md.get(t)?.removeBrackets(this.id)}},jd=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},Md=class e extends L{static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new ql(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(e=>{this._matchBrackets!==`never`&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(e=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(e=>{e.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),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(t=>{let n=t.getStartPosition(),r=e.bracketPairs.matchBracket(n),i=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?i=r[1].getStartPosition():r[1].containsPosition(n)&&(i=r[0].getStartPosition());else{let t=e.bracketPairs.findEnclosingBrackets(n);if(t)i=t[1].getStartPosition();else{let t=e.bracketPairs.findNextBracket(n);t&&t.range&&(i=t.range.getStartPosition())}}return i?new U(i.lineNumber,i.column,i.lineNumber,i.column):new U(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;let t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{let i=r.getStartPosition(),a=t.bracketPairs.matchBracket(i);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(i),!a)){let e=t.bracketPairs.findNextBracket(i);e&&e.range&&(a=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let o=null,s=null;if(a){a.sort(H.compareRangesUsingStarts);let[t,n]=a;if(o=e?t.getStartPosition():t.getEndPosition(),s=e?n.getEndPosition():n.getStartPosition(),n.containsPosition(i)){let e=o;o=s,s=e}}o&&s&&n.push(new U(o.lineNumber,o.column,s.lineNumber,s.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(n=>{let r=n.getPosition(),i=t.bracketPairs.matchBracket(r);i||=t.bracketPairs.findEnclosingBrackets(r),i&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:i[0],text:``},{range:i[1],text:``}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets===`never`)return;this._recomputeBrackets();let e=[],t=0;for(let n of this._lastBracketsData){let r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getSelections();if(t.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let n=this._editor.getModel(),r=n.getVersionId(),i=[];this._lastVersionId===r&&(i=this._lastBracketsData);let a=[],o=0;for(let e=0,n=t.length;e<n;e++){let n=t[e];n.isEmpty()&&(a[o++]=n.getStartPosition())}a.length>1&&a.sort(R.compare);let s=[],c=0,l=0,u=i.length;for(let t=0,r=a.length;t<r;t++){let r=a[t];for(;l<u&&i[l].position.isBefore(r);)l++;if(l<u&&i[l].position.equals(r))s[c++]=i[l];else{let t=n.bracketPairs.matchBracket(r,20),i=e._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!t&&this._matchBrackets===`always`&&(t=n.bracketPairs.findEnclosingBrackets(r,20),i=e._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),s[c++]=new jd(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};Ed=Md,Ed.ID=`editor.contrib.bracketMatchingController`,Ed._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=B.register({description:`bracket-match-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`,overviewRuler:{color:Ia(Dd),position:Xu.Center}}),Ed._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=B.register({description:`bracket-match-no-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`}),Y(Md.ID,Md,1),t(kd),t(Od),t(Ad),cr.appendMenuItem(A.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:Z(856,`Go to &&Bracket`)},order:2}),Ts((e,t)=>{let n=e.getColor(Wi);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)}),t(class extends O{constructor(){super({id:`editor.action.transposeLetters`,label:M(863,`Transpose Letters`),precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let n=t.getModel(),r=[],i=t.getSelections();for(let e of i){if(!e.isEmpty())continue;let t=e.startLineNumber,i=e.startColumn,a=n.getLineMaxColumn(t);if(t===1&&(i===1||i===2&&a===2))continue;let o=i===a?e.getPosition():mu.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=mu.leftPosition(n,o),c=mu.leftPosition(n,s),l=n.getValueInRange(H.fromPositions(c,s)),u=n.getValueInRange(H.fromPositions(s,o)),d=H.fromPositions(c,o);r.push(new Yu(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var Nd,Pd=class e{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(t){return this.equals(t)||this.value===``||t.value.startsWith(this.value+e.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}};Nd=Pd,Nd.sep=`.`,Nd.None=new Nd(`@@none@@`),Nd.Empty=new Nd(``);var Fd,Id=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Ld=function(e,t){return function(n,r){t(n,r,e)}},Rd=B.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0,widthInEm:1}}),zd=class e extends L{constructor(e,t,n,r,i){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=W(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=W(`span.icon`);this.domNode.append(t),t.classList.add(...K.asClassNameArray(G.loading),`codicon-modifier-spin`);let n=()=>{let e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};n(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&n()})),this._register(z(this.domNode,cl.CLICK,e=>{this.delegate.cancel()}))}getId(){return e.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)}};Fd=zd,Fd.baseId=`editor.widget.inlineProgressWidget`;var Bd=class extends L{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new i),this._currentWidget=this._register(new i),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,n,r,i){let a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=Hc(()=>{let n=H.fromPositions(e);this._currentDecorations.set([{range:n,options:Rd}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(zd,this.id,this._editor,n,t,r))},i??this._showDelay);try{return await n}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Bd=Id([Ld(2,q)],Bd);var Vd,Hd=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Ud=function(e,t){return function(n,r){t(n,r,e)}},Wd,Gd=(Vd=class{static get(e){return e.getContribution(Wd.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new i,this._messageListeners=new j,this._mouseOverMessage=!1,this._editor=e,this._visible=Wd.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(Ce(Dn(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Dn(e)){let n=this._messageListeners.add(Se(e,{actionHandler:(e,t)=>{this.closeMessage(),Ma(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new qd(this._editor,t,n.element)}else this._messageWidget.value=new qd(this._editor,t,e);this._messageListeners.add(lt.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Oi(Ge(),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(z(this._messageWidget.value.getDomNode(),cl.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(z(this._messageWidget.value.getDomNode(),cl.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(n?n.containsPosition(e.target.position)||this.closeMessage():n=new H(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(qd.fadeOut(this._messageWidget.value))}},Wd=Vd,Vd.ID=`editor.contrib.messageController`,Vd.MESSAGE_VISIBLE=new N(`messageVisible`,!1,Z(1353,`Whether the editor is currently showing an inline message`)),Vd);Gd=Wd=Hd([Ud(1,E),Ud(2,xu)],Gd);var Kd=Bi.bindToContribution(Gd.get);V(new Kd({id:`leaveEditorMessage`,precondition:Gd.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var qd=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener(`animationend`,t)},n=setTimeout(t,110);return e.getDomNode().addEventListener(`animationend`,t),e.getDomNode().classList.add(`fadeOut`),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement(`div`),this._domNode.classList.add(`monaco-editor-overlaymessage`),this._domNode.style.marginLeft=`-6px`;let i=document.createElement(`div`);i.classList.add(`anchor`,`top`),this._domNode.appendChild(i);let a=document.createElement(`div`);typeof r==`string`?(a.classList.add(`message`),a.textContent=r):(r.classList.add(`message`),a.appendChild(r)),this._domNode.appendChild(a);let o=document.createElement(`div`);o.classList.add(`anchor`,`below`),this._domNode.appendChild(o),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)}};Y(Gd.ID,Gd,4);var Jd,Yd=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Xd=function(e,t){return function(n,r){t(n,r,e)}},Zd=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,n,r,i){let a=await this.getEdit(n,i);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,n,r){let i=await this.getEdit(n,r);if(i)return{edits:[{insertText:i.insertText,title:i.title,kind:i.kind,handledMimeType:i.handledMimeType,yieldTo:i.yieldTo}],dispose(){}}}},Qd=class e extends Zd{constructor(){super(Pd.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[rr.text],this.pasteMimeTypes=[rr.text]}async getEdit(e,t){let n=e.get(rr.text);if(!n||e.has(rr.uriList))return;let r=await n.asString();return{handledMimeType:rr.text,title:Z(980,`Insert Plain Text`),insertText:r,kind:this.kind}}};Jd=Qd,Jd.id=`text`;var $d=class extends Zd{constructor(){super(Pd.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[rr.uriList],this.pasteMimeTypes=[rr.uriList]}async getEdit(e,t){let n=await nf(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===ul.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?Z(981,`Insert Uris`):Z(982,`Insert Uri`):n.length>1?Z(983,`Insert Paths`):Z(984,`Insert Path`),{handledMimeType:rr.uriList,insertText:i,title:a,kind:this.kind}}},ef=class extends Zd{constructor(e){super(Pd.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[rr.uriList],this.pasteMimeTypes=[rr.uriList]}async getEdit(e,t){let n=await nf(e);if(!n.length||t.isCancellationRequested)return;let r=Po(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?be(t.uri,e):void 0}));if(r.length)return{handledMimeType:rr.uriList,insertText:r.join(` `),title:n.length>1?Z(985,`Insert Relative Paths`):Z(986,`Insert Relative Path`),kind:this.kind}}};ef=Yd([Xd(0,ds)],ef);var tf=class{constructor(){this.kind=new Pd(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:rr.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==hl.PasteAs&&!r.only?.contains(this.kind))return;let a=await n.get(`text/html`)?.asString();if(a&&!i.isCancellationRequested)return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:Z(987,`Insert HTML`),kind:this.kind}]}}};async function nf(e){let t=e.get(rr.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of Gs.parse(n))try{r.push({uri:bu.parse(e),originalText:e})}catch{}return r}var rf={scheme:`*`,hasAccessToAllModels:!0},af=class extends L{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(rf,new Qd)),this._register(e.documentDropEditProvider.register(rf,new $d)),this._register(e.documentDropEditProvider.register(rf,new ef(t)))}};af=Yd([Xd(0,D),Xd(1,ds)],af);var of=class extends L{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(rf,new Qd)),this._register(e.documentPasteEditProvider.register(rf,new $d)),this._register(e.documentPasteEditProvider.register(rf,new ef(t))),this._register(e.documentPasteEditProvider.register(rf,new tf))}};of=Yd([Xd(0,D),Xd(1,ds)],of);var sf,cf=class e{constructor(){this.value=``,this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let t=this.pos,n=0,r=this.value.charCodeAt(t),i;if(i=e._table[r],typeof i==`number`)return this.pos+=1,{type:i,pos:t,len:1};if(e.isDigitCharacter(r)){i=8;do n+=1,r=this.value.charCodeAt(t+n);while(e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}if(e.isVariableCharacter(r)){i=9;do r=this.value.charCodeAt(t+ ++n);while(e.isVariableCharacter(r)||e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}i=10;do n+=1,r=this.value.charCodeAt(t+n);while(!isNaN(r)&&e._table[r]===void 0&&!e.isDigitCharacter(r)&&!e.isVariableCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}};sf=cf,sf._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};var lf=class{constructor(){this._children=[]}appendChild(e){return e instanceof uf&&this._children[this._children.length-1]instanceof uf?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){let{parent:n}=e,r=n.children.indexOf(e),i=n.children.slice(0);i.splice(r,1,...t),n._children=i,(function e(t,n){for(let r of t)r.parent=n,e(r.children,r)})(t,n)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof vf)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},uf=class e extends lf{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},df=class extends lf{},ff=class e extends df{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:+(e.index>t.index)}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof pf?this._children[0]:void 0}clone(){let t=new e(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}},pf=class e extends lf{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof uf&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let t=new e;return this.options.forEach(t.appendChild,t),t}},mf=class e extends lf{constructor(){super(...arguments),this.regexp=RegExp(``)}resolve(e){let t=this,n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(e=>e instanceof hf&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof hf){let r=e[n.index]||``;r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return``}clone(){let t=new e;return t.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?`i`:``)+(this.regexp.global?`g`:``)),t._children=this.children.map(e=>e.clone()),t}},hf=class e extends lf{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}resolve(e){return this.shorthandName===`upcase`?e?e.toLocaleUpperCase():``:this.shorthandName===`downcase`?e?e.toLocaleLowerCase():``:this.shorthandName===`capitalize`?e?e[0].toLocaleUpperCase()+e.substr(1):``:this.shorthandName===`pascalcase`?e?this._toPascalCase(e):``:this.shorthandName===`camelcase`?e?this._toCamelCase(e):``:this.shorthandName===`kebabcase`?e?this._toKebabCase(e):``:this.shorthandName===`snakecase`?e?this._toSnakeCase(e):``:e&&typeof this.ifValue==`string`?this.ifValue:!e&&typeof this.elseValue==`string`?this.elseValue:e||``}_toKebabCase(e){if(!e.match(/[\p{L}0-9]+/gu))return e;if(!e.match(/[\p{L}0-9]/u))return e.trim().toLowerCase().replace(/^_+|_+$/g,``).replace(/[\s_]+/g,`-`);let t=e.trim().replace(/^_+|_+$/g,``),n=t.match(/\p{Lu}{2,}(?=\p{Lu}\p{Ll}+[0-9]*|[\s_-]|$)|\p{Lu}?\p{Ll}+[0-9]*|\p{Lu}(?=\p{Lu}\p{Ll})|\p{Lu}(?=[\s_-]|$)|[0-9]+/gu);return n?n.map(e=>e.toLowerCase()).join(`-`):t.split(/[\s_-]+/).filter(e=>e.length>0).map(e=>e.toLowerCase()).join(`-`)}_toPascalCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map(e=>e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toCamelCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map((e,t)=>t===0?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toSnakeCase(e){return e.replace(/(\p{Ll})(\p{Lu})/gu,`$1_$2`).replace(/[\s\-]+/g,`_`).toLowerCase()}clone(){return new e(this.index,this.shorthandName,this.ifValue,this.elseValue)}},gf=class e extends df{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||``)),t!==void 0&&(this._children=[new uf(t)],!0)}clone(){let t=new e(this.name);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}};function _f(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var vf=class e extends lf{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof ff&&(e.push(n),t=!t||t.index<n.index?n:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){let{all:e}=this.placeholderInfo;return e}offset(e){let t=0,n=!1;return this.walk(r=>r===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return _f([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof ff&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof gf&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let t=new e;return t._children=this.children.map(e=>e.clone()),t}walk(e){_f(this.children,e)}},yf=class{constructor(){this._scanner=new cf,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,`\\$&`)}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){let r=new vf;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){let n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););let r=new Map,i=[];t.walk(e=>(e instanceof ff&&(e.isFinalTabstop?r.set(0,void 0):!r.has(e.index)&&e.children.length>0?r.set(e.index,e.children):i.push(e)),!0));let a=(e,n)=>{let i=r.get(e.index);if(!i)return;let o=new ff(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof ff&&r.has(t.index)&&!n.has(t.index)&&(n.add(t.index),a(t,n),n.delete(t.index))}t.replace(e,[o])},o=new Set;for(let e of i)a(e,o);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(e=>e.index===0)||e.appendChild(new ff(0)))}_accept(e,t){if(e===void 0||this._token.type===e){let e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){let t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){let e=this._scanner.next();if(e.type!==0&&e.type!==4&&e.type!==5)return!1}this._token=this._scanner.next()}let n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,`$1`);return this._token=this._scanner.next(),n}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new uf(t)),!0):!1}_parseTabstopOrVariableName(e){let t,n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new ff(Number(t)):new gf(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);let r=new ff(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new uf("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new pf;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(t),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseChoiceElement(e){let t=this._token,n=[];for(;this._token.type!==2&&this._token.type!==7;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;n.push(e)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new uf(n.join(``))),!0)}_parseComplexVariable(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);let r=new gf(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new uf("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseTransform(e){let t=new mf,n=``,r=``;for(;!this._accept(6);){let e;if(e=this._accept(5,!0)){e=this._accept(6,!0)||e,n+=e;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let e;if(e=this._accept(5,!0)){e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new uf(e));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);let r=this._accept(8,!0);if(!r)return this._backTo(t),!1;if(!n||this._accept(4))return e.appendChild(new hf(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let n=this._accept(9,!0);return!n||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new hf(Number(r),n)),!0)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new hf(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new hf(Number(r),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let n=this._until(4);if(n)return e.appendChild(new hf(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new hf(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14&&(e.appendChild(new uf(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function bf(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new Cc(e,{range:t,text:typeof n.insertText==`string`?yf.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function xf(e){function t(e,t){return`mimeType`in e?e.mimeType===t.handledMimeType:!!t.kind&&e.kind.contains(t.kind)}let n=new Map;for(let r of e)for(let i of r.yieldTo??[])for(let a of e)if(a!==r&&t(i,a)){let e=n.get(r);e||(e=[],n.set(r,e)),e.push(a)}if(!n.size)return Array.from(e);let r=new Set,i=[];function a(e){if(!e.length)return[];let t=e[0];if(i.includes(t))return console.warn(`Yield to cycle detected`,t),e;if(r.has(t))return a(e.slice(1));let o=[],s=n.get(t);return s&&(i.push(t),o=a(s),i.pop()),r.add(t),[...o,t,...a(e.slice(1))]}return a(Array.from(e))}function Sf(e,t){return t&&(e.stack||e.stacktrace)?Z(33,`{0}: {1}`,wf(e),Cf(e.stack)||Cf(e.stacktrace)):wf(e)}function Cf(e){return Array.isArray(e)?e.join(`
|
|
1
|
+
import{$ as e,$c as t,$h as n,$l as r,$m as i,$n as a,$o as o,$p as s,$r as c,$s as l,$t as u,$u as d,A as f,Aa as p,Ac as m,Ad as h,Ah as g,Ai as _,Al as v,An as y,Ao as b,Ar as ee,As as te,At as ne,Au as re,B as ie,Bd as ae,Bf as oe,Bh as se,Bi as ce,Bl as le,Bo as ue,Br as de,Bt as fe,Bu as pe,C as me,Ca as he,Cc as ge,Cd as x,Cf as _e,Ch as ve,Ci as ye,Cl as be,Co as xe,Cr as Se,Cs as Ce,Ct as we,Cu as S,Da as Te,Dc as Ee,Dd as C,Df as De,Dh as Oe,Dl as ke,Dm as w,Do as Ae,Dr as je,Ds as Me,Dt as Ne,Du as Pe,E as Fe,Ea as Ie,Ec as Le,Ed as Re,Ef as ze,El as Be,Em as Ve,En as He,Eo as Ue,Et as We,Eu as Ge,F as Ke,Fa as qe,Fd as Je,Ff as Ye,Fh as Xe,Fl as Ze,Fn as Qe,Fo as $e,Fs as et,Ft as tt,Fu as nt,G as rt,Ga as it,Gc as at,Gd as ot,Gi as st,Gl as ct,Gm as lt,Gn as ut,Go as dt,Gp as ft,Gr as pt,Gs as T,H as mt,Ha as ht,Hd as gt,Hf as _t,Hh as vt,Hi as yt,Hl as E,Hn as bt,Ho as xt,Hr as St,Hs as D,Ht as Ct,Hu as wt,Ia as Tt,Ic as Et,Id as Dt,If as Ot,Ih as kt,Ii as At,Il as jt,In as Mt,Io as Nt,Ir as Pt,Is as Ft,It,Iu as Lt,J as Rt,Ja as zt,Jc as O,Jd as Bt,Jh as Vt,Ji as Ht,Jl as Ut,Jm as Wt,Jn as Gt,Jo as Kt,Jr as qt,Js as Jt,Ju as Yt,Ka as Xt,Kh as Zt,Ki as Qt,Kl as $t,Kn as en,Ko as tn,Kp as nn,Kr as rn,Ks as an,Kt as on,Ku as sn,La as cn,Ld as ln,Lf as un,Lh as dn,Li as fn,Ll as k,Lm as pn,Ln as mn,Lo as hn,Lr as gn,Ls as _n,Lu as vn,M as yn,Ma as bn,Md as xn,Mh as Sn,Mi as Cn,Ml as A,Mm as wn,Mn as Tn,Mo as En,Mr as Dn,Ms as On,Mt as kn,Mu as An,Na as jn,Nc as Mn,Nd as Nn,Nf as Pn,Nh as Fn,Ni as In,Nl as Ln,Nm as Rn,No as zn,Ns as Bn,Nt as Vn,Nu as Hn,O as Un,Oa as Wn,Od as Gn,Of as Kn,Oh as qn,Om as Jn,On as Yn,Oo as Xn,Or as Zn,Os as Qn,Ot as $n,Ou as er,P as tr,Pa as nr,Pc as rr,Pd as ir,Pf as ar,Ph as or,Pi as sr,Pl as cr,Pm as lr,Po as ur,Ps as dr,Pu as fr,Q as pr,Qc as mr,Qd as hr,Qf as gr,Qh as _r,Ql as vr,Qm as j,Qn as yr,Qo as br,Qp as xr,Qr as Sr,Qs as Cr,Qt as wr,R as Tr,Ra as Er,Rc as Dr,Rd as Or,Rf as kr,Rh as Ar,Ri as jr,Rl as Mr,Rm as Nr,Rn as Pr,Ro as Fr,Rr as Ir,Rs as Lr,S as Rr,Sa as zr,Sc as Br,Sd as Vr,Sh as M,Si as Hr,Sl as Ur,Sm as Wr,So as Gr,Ss as Kr,St as qr,Su as Jr,T as Yr,Ta as Xr,Tc as Zr,Td as Qr,Tf as $r,To as ei,Tr as ti,Ts as ni,Tt as ri,Tu as ii,U as ai,Ua as oi,Uf as si,Uh as ci,Ui as li,Ul as N,Um as ui,Un as di,Uo as fi,Ur as pi,Us as mi,Ut as hi,Uu as gi,V as _i,Va as vi,Vd as yi,Vf as bi,Vh as xi,Vl as P,Vm as Si,Vn as Ci,Vo as wi,Vr as Ti,Vs as Ei,Vt as Di,Vu as Oi,W as ki,Wc as Ai,Wd as ji,Wh as Mi,Wi as Ni,Wm as F,Wo as Pi,Wp as Fi,Wr as Ii,Wt as Li,X as Ri,Xa as zi,Xc as Bi,Xd as Vi,Xf as Hi,Xh as Ui,Xi as Wi,Xm as Gi,Xn as Ki,Xo as qi,Xp as Ji,Xr as Yi,Xs as Xi,Xt as Zi,Y as Qi,Ya as $i,Yc as ea,Yd as ta,Yf as na,Yh as ra,Yi as ia,Ym as aa,Yn as oa,Yo as sa,Yp as ca,Yr as la,Ys as ua,Yt as da,Yu as I,Z as fa,Zc as pa,Zd as ma,Zf as ha,Zh as ga,Zi as _a,Zl as va,Zm as L,Zn as ya,Zo as ba,Zp as xa,Zr as Sa,Zs as Ca,Zt as wa,_ as Ta,_a as Ea,_c as Da,_d as Oa,_i as ka,_l as Aa,_m as R,_o as ja,_r as Ma,_s as Na,_u as Pa,a as Fa,aa as Ia,ac as La,ad as Ra,af as za,ag as Ba,ah as Va,ai as Ha,al as Ua,am as Wa,an as Ga,ao as Ka,ar as qa,as as Ja,at as Ya,au as Xa,b as Za,ba as Qa,bf as $a,bi as eo,bl as to,bm as no,bn as ro,bs as io,bt as ao,bu as z,c as oo,ca as so,cc as co,cd as lo,cf as uo,cg as fo,ch as po,ci as B,cl as mo,cn as ho,co as go,cr as _o,cs as vo,cu as yo,d as bo,da as xo,dc as So,dd as Co,df as wo,dg as To,dh as Eo,dm as Do,do as Oo,ds as ko,du as Ao,ea as jo,ec as Mo,ed as No,eg as Po,eh as Fo,ei as Io,el as V,em as Lo,en as Ro,es as zo,et as Bo,eu as Vo,f as Ho,fa as Uo,fc as Wo,fd as Go,ff as Ko,fg as qo,fh as Jo,fi as Yo,fl as Xo,fm as Zo,fo as Qo,fs as $o,ft as es,fu as ts,g as ns,ga as rs,gd as is,gh as as,gi as os,gl as ss,gm as H,gn as cs,gr as ls,gs as us,gt as ds,gu as fs,h as ps,ha as ms,hc as hs,hd as gs,hh as _s,hl as vs,hm as U,hn as ys,ho as bs,hs as xs,ht as Ss,hu as Cs,i as ws,ia as Ts,ic as Es,id as Ds,if as Os,ig as ks,ih as As,il as js,im as Ms,in as Ns,is as Ps,j as Fs,ja as Is,jd as Ls,jh as Rs,jl as zs,jo as Bs,jr as Vs,js as Hs,ju as Us,k as Ws,ka as Gs,kc as Ks,kd as qs,kf as Js,kh as Ys,kl as Xs,km as Zs,kn as Qs,ko as $s,kr as ec,kt as tc,ku as nc,l as rc,la as ic,lc as ac,ld as oc,lf as sc,lg as cc,lh as lc,li as uc,ll as dc,lm as fc,lo as pc,lr as mc,ls as hc,lu as W,ma as gc,mc as _c,md as vc,mh as yc,ml as bc,mn as xc,mo as Sc,mt as Cc,mu as wc,n as Tc,na as Ec,nc as Dc,nd as Oc,ng as kc,nh as Ac,ni as jc,nl as Mc,nm as Nc,no as Pc,nr as Fc,ns as Ic,nu as Lc,o as Rc,oa as zc,oc as Bc,od as Vc,of as Hc,og as Uc,oh as Wc,om as Gc,on as Kc,oo as qc,os as Jc,ot as Yc,p as Xc,pa as Zc,pc as Qc,pd as $c,pf as el,ph as tl,pi as nl,pl as rl,pm as G,pn as il,po as al,pr as ol,ps as sl,pu as cl,qa as ll,qd as ul,qf as dl,qh as fl,qi as pl,ql as K,qo as ml,qp as hl,qr as gl,qs as _l,r as vl,rc as yl,rd as bl,rf as xl,rg as Sl,rh as Cl,ri as wl,rl as Tl,rm as El,rn as Dl,ro as Ol,rr as kl,rs as Al,rt as jl,ru as q,s as Ml,sa as J,sc as Nl,sf as Pl,sg as Fl,sh as Il,si as Ll,sl as Rl,sm as zl,sn as Bl,so as Vl,ss as Hl,st as Ul,su as Wl,tc as Gl,td as Kl,tf as ql,tg as Jl,ti as Yl,tl as Y,tn as Xl,to as Zl,tr as Ql,ts as $l,tu as eu,u as tu,ua as nu,uc as ru,ud as iu,uf as au,ug as ou,uh as su,ui as cu,uo as lu,ur as uu,us as X,ut as du,uu as fu,v as pu,va as mu,vc as hu,vd as gu,vh as _u,vi as vu,vl as yu,vm as bu,vr as xu,vs as Su,vt as Cu,w as wu,wa as Tu,wc as Eu,wd as Du,wf as Ou,wh as ku,wi as Au,wl as ju,wm as Mu,wo as Nu,wr as Pu,wt as Fu,wu as Iu,x as Lu,xa as Ru,xc as zu,xd as Bu,xh as Z,xi as Vu,xn as Hu,xo as Uu,xr as Wu,xs as Gu,xt as Ku,xu as qu,y as Ju,ya as Yu,yc as Xu,yd as Zu,yi as Qu,yl as $u,ym as ed,yn as td,yo as nd,yu as rd,z as id,zc as ad,zd as od,zf as sd,zh as cd,zi as ld,zl as ud,zn as dd,zo as fd,zr as pd,zt as md,zu as hd}from"./format-DOCqk2Dn.js";var gd,_d=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},vd=function(e,t){return function(n,r){t(n,r,e)}},yd,bd=new N(`selectionAnchorSet`,!1),xd=(gd=class{static get(e){return e.getContribution(yd.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=bd.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(U.fromPositions(e,e),{description:`selection-anchor`,stickiness:1,hoverMessage:new ec().appendText(Z(849,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ce(Z(850,`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(U.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()}},yd=gd,gd.ID=`editor.contrib.selectionAnchorController`,gd);xd=yd=_d([vd(1,E)],xd);var Sd=class extends O{constructor(){super({id:`editor.action.setSelectionAnchor`,label:M(851,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:Mu(2089,2080),weight:100}})}async run(e,t){xd.get(t)?.setSelectionAnchor()}},Cd=class extends O{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:M(852,`Go to Selection Anchor`),precondition:bd})}async run(e,t){xd.get(t)?.goToSelectionAnchor()}},wd=class extends O{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:M(853,`Select from Anchor to Cursor`),precondition:bd,kbOpts:{kbExpr:J.editorTextFocus,primary:Mu(2089,2089),weight:100}})}async run(e,t){xd.get(t)?.selectFromAnchorToCursor()}},Td=class extends O{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:M(854,`Cancel Selection Anchor`),precondition:bd,kbOpts:{kbExpr:J.editorTextFocus,primary:9,weight:100}})}async run(e,t){xd.get(t)?.cancelSelectionAnchor()}};Y(xd.ID,xd,4),t(Sd),t(Cd),t(wd),t(Td);var Ed,Dd=X(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,Z(855,`Overview ruler marker color for matching brackets.`)),Od=class extends O{constructor(){super({id:`editor.action.jumpToBracket`,label:M(857,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:3165,weight:100}})}run(e,t){Md.get(t)?.jumpToBracket()}},kd=class extends O{constructor(){super({id:`editor.action.selectToBracket`,label:M(858,`Select to Bracket`),precondition:void 0,metadata:{description:M(859,`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,n){let r=!0;n&&n.selectBrackets===!1&&(r=!1),Md.get(t)?.selectToBracket(r)}},Ad=class extends O{constructor(){super({id:`editor.action.removeBrackets`,label:M(860,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:J.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){Md.get(t)?.removeBrackets(this.id)}},jd=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},Md=class e extends L{static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new ql(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(e=>{this._matchBrackets!==`never`&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(e=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(e=>{e.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),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(t=>{let n=t.getStartPosition(),r=e.bracketPairs.matchBracket(n),i=null;if(r)r[0].containsPosition(n)&&!r[1].containsPosition(n)?i=r[1].getStartPosition():r[1].containsPosition(n)&&(i=r[0].getStartPosition());else{let t=e.bracketPairs.findEnclosingBrackets(n);if(t)i=t[1].getStartPosition();else{let t=e.bracketPairs.findNextBracket(n);t&&t.range&&(i=t.range.getStartPosition())}}return i?new U(i.lineNumber,i.column,i.lineNumber,i.column):new U(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;let t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{let i=r.getStartPosition(),a=t.bracketPairs.matchBracket(i);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(i),!a)){let e=t.bracketPairs.findNextBracket(i);e&&e.range&&(a=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let o=null,s=null;if(a){a.sort(H.compareRangesUsingStarts);let[t,n]=a;if(o=e?t.getStartPosition():t.getEndPosition(),s=e?n.getEndPosition():n.getStartPosition(),n.containsPosition(i)){let e=o;o=s,s=e}}o&&s&&n.push(new U(o.lineNumber,o.column,s.lineNumber,s.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;let t=this._editor.getModel();this._editor.getSelections().forEach(n=>{let r=n.getPosition(),i=t.bracketPairs.matchBracket(r);i||=t.bracketPairs.findEnclosingBrackets(r),i&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:i[0],text:``},{range:i[1],text:``}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets===`never`)return;this._recomputeBrackets();let e=[],t=0;for(let n of this._lastBracketsData){let r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}let t=this._editor.getSelections();if(t.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}let n=this._editor.getModel(),r=n.getVersionId(),i=[];this._lastVersionId===r&&(i=this._lastBracketsData);let a=[],o=0;for(let e=0,n=t.length;e<n;e++){let n=t[e];n.isEmpty()&&(a[o++]=n.getStartPosition())}a.length>1&&a.sort(R.compare);let s=[],c=0,l=0,u=i.length;for(let t=0,r=a.length;t<r;t++){let r=a[t];for(;l<u&&i[l].position.isBefore(r);)l++;if(l<u&&i[l].position.equals(r))s[c++]=i[l];else{let t=n.bracketPairs.matchBracket(r,20),i=e._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!t&&this._matchBrackets===`always`&&(t=n.bracketPairs.findEnclosingBrackets(r,20),i=e._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),s[c++]=new jd(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};Ed=Md,Ed.ID=`editor.contrib.bracketMatchingController`,Ed._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=B.register({description:`bracket-match-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`,overviewRuler:{color:Ia(Dd),position:Xu.Center}}),Ed._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=B.register({description:`bracket-match-no-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`}),Y(Md.ID,Md,1),t(kd),t(Od),t(Ad),cr.appendMenuItem(A.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:Z(856,`Go to &&Bracket`)},order:2}),Ts((e,t)=>{let n=e.getColor(Wi);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)}),t(class extends O{constructor(){super({id:`editor.action.transposeLetters`,label:M(863,`Transpose Letters`),precondition:J.writable,kbOpts:{kbExpr:J.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;let n=t.getModel(),r=[],i=t.getSelections();for(let e of i){if(!e.isEmpty())continue;let t=e.startLineNumber,i=e.startColumn,a=n.getLineMaxColumn(t);if(t===1&&(i===1||i===2&&a===2))continue;let o=i===a?e.getPosition():mu.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=mu.leftPosition(n,o),c=mu.leftPosition(n,s),l=n.getValueInRange(H.fromPositions(c,s)),u=n.getValueInRange(H.fromPositions(s,o)),d=H.fromPositions(c,o);r.push(new Yu(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var Nd,Pd=class e{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(t){return this.equals(t)||this.value===``||t.value.startsWith(this.value+e.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}};Nd=Pd,Nd.sep=`.`,Nd.None=new Nd(`@@none@@`),Nd.Empty=new Nd(``);var Fd,Id=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Ld=function(e,t){return function(n,r){t(n,r,e)}},Rd=B.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0,widthInEm:1}}),zd=class e extends L{constructor(e,t,n,r,i){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=i,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=W(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=W(`span.icon`);this.domNode.append(t),t.classList.add(...K.asClassNameArray(G.loading),`codicon-modifier-spin`);let n=()=>{let e=this.editor.getOption(75);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};n(),this._register(this.editor.onDidChangeConfiguration(e=>{(e.hasChanged(61)||e.hasChanged(75))&&n()})),this._register(z(this.domNode,cl.CLICK,e=>{this.delegate.cancel()}))}getId(){return e.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)}};Fd=zd,Fd.baseId=`editor.widget.inlineProgressWidget`;var Bd=class extends L{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new i),this._currentWidget=this._register(new i),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,n,r,i){let a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=Hc(()=>{let n=H.fromPositions(e);this._currentDecorations.set([{range:n,options:Rd}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(zd,this.id,this._editor,n,t,r))},i??this._showDelay);try{return await n}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Bd=Id([Ld(2,q)],Bd);var Vd,Hd=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Ud=function(e,t){return function(n,r){t(n,r,e)}},Wd,Gd=(Vd=class{static get(e){return e.getContribution(Wd.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new i,this._messageListeners=new j,this._mouseOverMessage=!1,this._editor=e,this._visible=Wd.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(Ce(Dn(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Dn(e)){let n=this._messageListeners.add(Se(e,{actionHandler:(e,t)=>{this.closeMessage(),Ma(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new qd(this._editor,t,n.element)}else this._messageWidget.value=new qd(this._editor,t,e);this._messageListeners.add(lt.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Oi(Ge(),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(z(this._messageWidget.value.getDomNode(),cl.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(z(this._messageWidget.value.getDomNode(),cl.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(e=>{e.target.position&&(n?n.containsPosition(e.target.position)||this.closeMessage():n=new H(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(qd.fadeOut(this._messageWidget.value))}},Wd=Vd,Vd.ID=`editor.contrib.messageController`,Vd.MESSAGE_VISIBLE=new N(`messageVisible`,!1,Z(1353,`Whether the editor is currently showing an inline message`)),Vd);Gd=Wd=Hd([Ud(1,E),Ud(2,xu)],Gd);var Kd=Bi.bindToContribution(Gd.get);V(new Kd({id:`leaveEditorMessage`,precondition:Gd.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var qd=class{static fadeOut(e){let t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener(`animationend`,t)},n=setTimeout(t,110);return e.getDomNode().addEventListener(`animationend`,t),e.getDomNode().classList.add(`fadeOut`),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement(`div`),this._domNode.classList.add(`monaco-editor-overlaymessage`),this._domNode.style.marginLeft=`-6px`;let i=document.createElement(`div`);i.classList.add(`anchor`,`top`),this._domNode.appendChild(i);let a=document.createElement(`div`);typeof r==`string`?(a.classList.add(`message`),a.textContent=r):(r.classList.add(`message`),a.appendChild(r)),this._domNode.appendChild(a);let o=document.createElement(`div`);o.classList.add(`anchor`,`below`),this._domNode.appendChild(o),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)}};Y(Gd.ID,Gd,4);var Jd,Yd=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Xd=function(e,t){return function(n,r){t(n,r,e)}},Zd=class{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,n,r,i){let a=await this.getEdit(n,i);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,n,r){let i=await this.getEdit(n,r);if(i)return{edits:[{insertText:i.insertText,title:i.title,kind:i.kind,handledMimeType:i.handledMimeType,yieldTo:i.yieldTo}],dispose(){}}}},Qd=class e extends Zd{constructor(){super(Pd.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[rr.text],this.pasteMimeTypes=[rr.text]}async getEdit(e,t){let n=e.get(rr.text);if(!n||e.has(rr.uriList))return;let r=await n.asString();return{handledMimeType:rr.text,title:Z(980,`Insert Plain Text`),insertText:r,kind:this.kind}}};Jd=Qd,Jd.id=`text`;var $d=class extends Zd{constructor(){super(Pd.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[rr.uriList],this.pasteMimeTypes=[rr.uriList]}async getEdit(e,t){let n=await nf(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===ul.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?Z(981,`Insert Uris`):Z(982,`Insert Uri`):n.length>1?Z(983,`Insert Paths`):Z(984,`Insert Path`),{handledMimeType:rr.uriList,insertText:i,title:a,kind:this.kind}}},ef=class extends Zd{constructor(e){super(Pd.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[rr.uriList],this.pasteMimeTypes=[rr.uriList]}async getEdit(e,t){let n=await nf(e);if(!n.length||t.isCancellationRequested)return;let r=Po(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?be(t.uri,e):void 0}));if(r.length)return{handledMimeType:rr.uriList,insertText:r.join(` `),title:n.length>1?Z(985,`Insert Relative Paths`):Z(986,`Insert Relative Path`),kind:this.kind}}};ef=Yd([Xd(0,ds)],ef);var tf=class{constructor(){this.kind=new Pd(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:rr.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==hl.PasteAs&&!r.only?.contains(this.kind))return;let a=await n.get(`text/html`)?.asString();if(a&&!i.isCancellationRequested)return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:Z(987,`Insert HTML`),kind:this.kind}]}}};async function nf(e){let t=e.get(rr.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of Gs.parse(n))try{r.push({uri:bu.parse(e),originalText:e})}catch{}return r}var rf={scheme:`*`,hasAccessToAllModels:!0},af=class extends L{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(rf,new Qd)),this._register(e.documentDropEditProvider.register(rf,new $d)),this._register(e.documentDropEditProvider.register(rf,new ef(t)))}};af=Yd([Xd(0,D),Xd(1,ds)],af);var of=class extends L{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(rf,new Qd)),this._register(e.documentPasteEditProvider.register(rf,new $d)),this._register(e.documentPasteEditProvider.register(rf,new ef(t))),this._register(e.documentPasteEditProvider.register(rf,new tf))}};of=Yd([Xd(0,D),Xd(1,ds)],of);var sf,cf=class e{constructor(){this.value=``,this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let t=this.pos,n=0,r=this.value.charCodeAt(t),i;if(i=e._table[r],typeof i==`number`)return this.pos+=1,{type:i,pos:t,len:1};if(e.isDigitCharacter(r)){i=8;do n+=1,r=this.value.charCodeAt(t+n);while(e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}if(e.isVariableCharacter(r)){i=9;do r=this.value.charCodeAt(t+ ++n);while(e.isVariableCharacter(r)||e.isDigitCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}i=10;do n+=1,r=this.value.charCodeAt(t+n);while(!isNaN(r)&&e._table[r]===void 0&&!e.isDigitCharacter(r)&&!e.isVariableCharacter(r));return this.pos+=n,{type:i,pos:t,len:n}}};sf=cf,sf._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};var lf=class{constructor(){this._children=[]}appendChild(e){return e instanceof uf&&this._children[this._children.length-1]instanceof uf?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){let{parent:n}=e,r=n.children.indexOf(e),i=n.children.slice(0);i.splice(r,1,...t),n._children=i,(function e(t,n){for(let r of t)r.parent=n,e(r.children,r)})(t,n)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof vf)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},uf=class e extends lf{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},df=class extends lf{},ff=class e extends df{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:+(e.index>t.index)}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof pf?this._children[0]:void 0}clone(){let t=new e(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}},pf=class e extends lf{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof uf&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){let t=new e;return this.options.forEach(t.appendChild,t),t}},mf=class e extends lf{constructor(){super(...arguments),this.regexp=RegExp(``)}resolve(e){let t=this,n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(e=>e instanceof hf&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof hf){let r=e[n.index]||``;r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return``}clone(){let t=new e;return t.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?`i`:``)+(this.regexp.global?`g`:``)),t._children=this.children.map(e=>e.clone()),t}},hf=class e extends lf{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}resolve(e){return this.shorthandName===`upcase`?e?e.toLocaleUpperCase():``:this.shorthandName===`downcase`?e?e.toLocaleLowerCase():``:this.shorthandName===`capitalize`?e?e[0].toLocaleUpperCase()+e.substr(1):``:this.shorthandName===`pascalcase`?e?this._toPascalCase(e):``:this.shorthandName===`camelcase`?e?this._toCamelCase(e):``:this.shorthandName===`kebabcase`?e?this._toKebabCase(e):``:this.shorthandName===`snakecase`?e?this._toSnakeCase(e):``:e&&typeof this.ifValue==`string`?this.ifValue:!e&&typeof this.elseValue==`string`?this.elseValue:e||``}_toKebabCase(e){if(!e.match(/[\p{L}0-9]+/gu))return e;if(!e.match(/[\p{L}0-9]/u))return e.trim().toLowerCase().replace(/^_+|_+$/g,``).replace(/[\s_]+/g,`-`);let t=e.trim().replace(/^_+|_+$/g,``),n=t.match(/\p{Lu}{2,}(?=\p{Lu}\p{Ll}+[0-9]*|[\s_-]|$)|\p{Lu}?\p{Ll}+[0-9]*|\p{Lu}(?=\p{Lu}\p{Ll})|\p{Lu}(?=[\s_-]|$)|[0-9]+/gu);return n?n.map(e=>e.toLowerCase()).join(`-`):t.split(/[\s_-]+/).filter(e=>e.length>0).map(e=>e.toLowerCase()).join(`-`)}_toPascalCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map(e=>e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toCamelCase(e){let t=e.match(/[\p{L}0-9]+/gu);return t?t.map((e,t)=>t===0?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1)).join(``):e}_toSnakeCase(e){return e.replace(/(\p{Ll})(\p{Lu})/gu,`$1_$2`).replace(/[\s\-]+/g,`_`).toLowerCase()}clone(){return new e(this.index,this.shorthandName,this.ifValue,this.elseValue)}},gf=class e extends df{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||``)),t!==void 0&&(this._children=[new uf(t)],!0)}clone(){let t=new e(this.name);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(e=>e.clone()),t}};function _f(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var vf=class e extends lf{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof ff&&(e.push(n),t=!t||t.index<n.index?n:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){let{all:e}=this.placeholderInfo;return e}offset(e){let t=0,n=!1;return this.walk(r=>r===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return _f([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof ff&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof gf&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){let t=new e;return t._children=this.children.map(e=>e.clone()),t}walk(e){_f(this.children,e)}},yf=class{constructor(){this._scanner=new cf,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,`\\$&`)}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){let r=new vf;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){let n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););let r=new Map,i=[];t.walk(e=>(e instanceof ff&&(e.isFinalTabstop?r.set(0,void 0):!r.has(e.index)&&e.children.length>0?r.set(e.index,e.children):i.push(e)),!0));let a=(e,n)=>{let i=r.get(e.index);if(!i)return;let o=new ff(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof ff&&r.has(t.index)&&!n.has(t.index)&&(n.add(t.index),a(t,n),n.delete(t.index))}t.replace(e,[o])},o=new Set;for(let e of i)a(e,o);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(e=>e.index===0)||e.appendChild(new ff(0)))}_accept(e,t){if(e===void 0||this._token.type===e){let e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){let t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){let e=this._scanner.next();if(e.type!==0&&e.type!==4&&e.type!==5)return!1}this._token=this._scanner.next()}let n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,`$1`);return this._token=this._scanner.next(),n}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new uf(t)),!0):!1}_parseTabstopOrVariableName(e){let t,n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new ff(Number(t)):new gf(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);let r=new ff(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new uf("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new pf;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(r.appendChild(t),this._accept(4)))return e.appendChild(r),!0}return this._backTo(n),!1}}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseChoiceElement(e){let t=this._token,n=[];for(;this._token.type!==2&&this._token.type!==7;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;n.push(e)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new uf(n.join(``))),!0)}_parseComplexVariable(e){let t,n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);let r=new gf(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new uf("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(this._accept(6))return this._parseTransform(r)?(e.appendChild(r),!0):(this._backTo(n),!1);else if(this._accept(4))return e.appendChild(r),!0;else return this._backTo(n)}_parseTransform(e){let t=new mf,n=``,r=``;for(;!this._accept(6);){let e;if(e=this._accept(5,!0)){e=this._accept(6,!0)||e,n+=e;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let e;if(e=this._accept(5,!0)){e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new uf(e));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);let r=this._accept(8,!0);if(!r)return this._backTo(t),!1;if(!n||this._accept(4))return e.appendChild(new hf(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){let n=this._accept(9,!0);return!n||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new hf(Number(r),n)),!0)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new hf(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new hf(Number(r),void 0,void 0,t)),!0}else if(this._accept(13)){let t=this._until(1);if(t){let n=this._until(4);if(n)return e.appendChild(new hf(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new hf(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14&&(e.appendChild(new uf(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function bf(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new Cc(e,{range:t,text:typeof n.insertText==`string`?yf.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function xf(e){function t(e,t){return`mimeType`in e?e.mimeType===t.handledMimeType:!!t.kind&&e.kind.contains(t.kind)}let n=new Map;for(let r of e)for(let i of r.yieldTo??[])for(let a of e)if(a!==r&&t(i,a)){let e=n.get(r);e||(e=[],n.set(r,e)),e.push(a)}if(!n.size)return Array.from(e);let r=new Set,i=[];function a(e){if(!e.length)return[];let t=e[0];if(i.includes(t))return console.warn(`Yield to cycle detected`,t),e;if(r.has(t))return a(e.slice(1));let o=[],s=n.get(t);return s&&(i.push(t),o=a(s),i.pop()),r.add(t),[...o,t,...a(e.slice(1))]}return a(Array.from(e))}function Sf(e,t){return t&&(e.stack||e.stacktrace)?Z(33,`{0}: {1}`,wf(e),Cf(e.stack)||Cf(e.stacktrace)):wf(e)}function Cf(e){return Array.isArray(e)?e.join(`
|
|
2
2
|
`):e}function wf(e){return e.code===`ERR_UNC_HOST_NOT_ALLOWED`?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof e.code==`string`&&typeof e.errno==`number`&&typeof e.syscall==`string`?Z(34,`A system error occurred ({0})`,e.message):e.message||Z(35,`An unknown error occurred. Please consult the log for more details.`)}function Tf(e=null,t=!1){if(!e)return Z(36,`An unknown error occurred. Please consult the log for more details.`);if(Array.isArray(e)){let n=Po(e),r=Tf(n[0],t);return n.length>1?Z(37,`{0} ({1} errors in total)`,r,n.length):r}if(Xe(e))return e;if(e.detail){let n=e.detail;if(n.error)return Sf(n.error,t);if(n.exception)return Sf(n.exception,t)}return e.stack?Sf(e,t):e.message?e.message:Z(38,`An unknown error occurred. Please consult the log for more details.`)}var Ef=class extends L{constructor(e){super(),this._onChange=this._register(new F),this.onChange=this._onChange.event,this._checked=!!e.checked,this._title=e.title??e.ariaLabel,this.domNode=W(`button.monaco-switch`),this.domNode.type=`button`,this.domNode.setAttribute(`role`,`switch`),S(this.domNode,W(`.monaco-switch-thumb`)),this._register(y().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}))),this.setAriaLabel(e.ariaLabel,e.title),this.disabled=!!e.disabled,this._applyState(),this._register(z(this.domNode,cl.CLICK,e=>{ts.stop(e,!0),!this.domNode.disabled&&(this._checked=!this._checked,this._applyState(),this._onChange.fire(this._checked))}))}get checked(){return this._checked}set checked(e){this._checked!==e&&(this._checked=e,this._applyState())}get disabled(){return this.domNode.disabled}set disabled(e){this.domNode.disabled=e}setAriaLabel(e,t=e){this.domNode.setAttribute(`aria-label`,e),this._title=t}_applyState(){this.domNode.setAttribute(`aria-checked`,String(this._checked)),this.domNode.classList.toggle(`checked`,this._checked)}},Df=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Of=function(e,t){return function(n,r){t(n,r,e)}},kf=class extends L{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,n={},r,i){super(),this._link=t,this._hoverService=r,this._enabled=!0,this.el=S(e,W(`a.monaco-link`,{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=n.hoverDelegate??Tn(`mouse`),this.setTooltip(t.title),this.el.setAttribute(`role`,`button`);let a=this._register(new Tt(this.el,`click`)),o=this._register(new Tt(this.el,`keydown`)),s=lt.chain(o.event,e=>e.map(e=>new el(e)).filter(e=>e.keyCode===3||e.keyCode===10)),c=this._register(new Tt(this.el,ht.Tap)).event;this._register(oi.addTarget(this.el));let l=lt.any(a.event,s,c);this._register(l(e=>{this.enabled&&(ts.stop(e,!0),n?.opener?n.opener(this._link.href):i.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};kf=Df([Of(3,Io),Of(4,xu)],kf);var Af=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},jf=function(e,t){return function(n,r){t(n,r,e)}},Mf,Nf=`acceptSelectedCodeAction`,Pf=`previewSelectedCodeAction`,Ff=new Set([Nf,Pf,`toggleSectionCodeAction`]),If=`actionList.remove`,Lf=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,n){n.text.textContent=e.group?.title??e.label??``}disposeTemplate(e){}},Rf=class{get templateId(){return`separator`}renderTemplate(e){e.classList.add(`separator`);let t=document.createElement(`span`);return e.append(t),{container:e,text:t}}renderElement(e,t,n){n.container.classList.toggle(`has-label`,!!e.label),n.text.textContent=e.label??``}disposeTemplate(e){}};function zf(e){return!!e.submenuActions?.length&&!e.hover?.content||!!e.hover?.expandable}function Bf(e){return zf(e)&&e.hover?.showIndicator!==!1}var Vf=class{get templateId(){return`action`}constructor(e,t,n,r,i,a,o,s,c,l,u,d){this._supportsPreview=e,this._onRemoveItem=t,this._onShowSubmenu=n,this._reservesSubmenuSpace=r,this._groupTitleByIndex=i,this._linkHandler=a,this._hideDefaultKeybindingTooltip=o,this._stopToolbarPointerPropagation=s,this._registerStandaloneToggle=c,this._registerToolbar=l,this._keybindingService=u,this._openerService=d}renderTemplate(e){e.classList.add(this.templateId);let t=document.createElement(`div`);t.className=`icon`,e.append(t);let n=document.createElement(`span`);n.className=`title`,e.append(n);let r=document.createElement(`span`);r.className=`action-item-badge`,r.ariaHidden=`true`,e.append(r);let i=document.createElement(`span`);i.className=`description`,e.append(i);let a=document.createElement(`span`);a.className=`group-title`,e.append(a);let o=document.createElement(`span`);o.className=`detail`,e.append(o);let s=new ie(e,po),c=document.createElement(`div`);c.className=`action-list-item-toolbar`,e.append(c);let l=document.createElement(`div`);l.className=`action-list-submenu-indicator`,e.append(l);let u=document.createElement(`div`);return u.className=`action-list-item-inline-toggle`,e.append(u),{container:e,icon:t,text:n,detail:o,badge:r,description:i,groupTitle:a,keybinding:s,toolbar:c,submenuIndicator:l,inlineToggleContainer:u,elementDisposables:new j}}renderElement(e,t,n){if(n.elementDisposables.clear(),e.iconClasses?.length?(n.icon.className=[`icon`,...e.iconClasses].join(` `),n.icon.style.color=``):e.group?.icon?(n.icon.className=K.asClassName(e.group.icon),n.icon.style.color=e.group.icon.color?Hl(e.group.icon.color.id):``):(n.icon.className=K.asClassName(G.lightBulb),n.icon.style.color=`var(--vscode-editorLightBulb-foreground)`),!e.item&&!e.standaloneToggle||!e.label)return;if(bl(!e.hideIcon,n.icon),e.isSectionToggle){let t=e.group?.icon===G.chevronDown;n.container.setAttribute(`aria-expanded`,String(t))}else n.container.removeAttribute(`aria-expanded`);n.previousClassNames?.length&&n.container.classList.remove(...n.previousClassNames);let i=e.className?.split(/\s+/).filter(e=>e.length>0)??[];if(n.container.classList.toggle(`action-list-custom`,i.length>0),i.length&&n.container.classList.add(...i),n.previousClassNames=i,n.text.textContent=qf(e.label),e.badge?(n.badge.textContent=e.badge,n.badge.style.display=``):(n.badge.textContent=``,n.badge.style.display=`none`),e.keybinding)n.description.textContent=e.keybinding.getLabel(),n.description.style.display=`inline`,n.description.style.letterSpacing=`0.5px`;else if(e.description){if(Iu(n.description),typeof e.description==`string`)n.description.textContent=qf(e.description);else{let t=Se(e.description,{actionHandler:t=>{let n=bu.parse(t);this._linkHandler?this._linkHandler(n,e):this._openerService.open(n,{allowCommands:!0})}});n.elementDisposables.add(t),n.description.appendChild(t.element)}n.description.style.display=`inline`}else n.description.textContent=``,n.description.style.display=`none`;let a=this._groupTitleByIndex.get(t);a?(n.groupTitle.textContent=a,n.groupTitle.style.display=``):(n.groupTitle.textContent=``,n.groupTitle.style.display=`none`),e.detail?(n.detail.textContent=qf(e.detail),n.detail.style.display=``):(n.detail.textContent=``,n.detail.style.display=`none`),n.container.classList.toggle(`has-detail`,!!e.detail),Iu(n.inlineToggleContainer);let o=e.standaloneToggle??e.inlineToggle;if(o){let t=document.createElement(`span`);t.className=`action-list-item-inline-toggle-label`,t.textContent=qf(o.label),e.standaloneToggle||n.inlineToggleContainer.append(t),n.inlineToggleContainer.style.display=``,n.container.classList.toggle(`has-inline-toggle`,!!e.inlineToggle),n.container.classList.toggle(`has-standalone-toggle`,!!e.standaloneToggle);let r=n.elementDisposables.add(new Ef({ariaLabel:o.title??o.label,checked:o.checked,disabled:o.disabled}));n.inlineToggleContainer.append(r.domNode),e.standaloneToggle&&n.elementDisposables.add(this._registerStandaloneToggle(e,r)),n.elementDisposables.add(r.onChange(()=>o.onChange(r.checked))),n.elementDisposables.add(z(n.inlineToggleContainer,cl.CLICK,e=>e.stopPropagation()))}else n.inlineToggleContainer.style.display=`none`,n.container.classList.remove(`has-inline-toggle`),n.container.classList.remove(`has-standalone-toggle`);let s=this._keybindingService.lookupKeybinding(Nf)?.getLabel(),c=this._keybindingService.lookupKeybinding(Pf)?.getLabel();n.container.classList.toggle(`option-disabled`,!!e.disabled),e.hover===void 0?e.tooltip?n.container.title=e.tooltip:e.disabled?n.container.title=e.label:e.standaloneToggle||this._hideDefaultKeybindingTooltip?n.container.title=``:s&&c?this._supportsPreview&&e.canPreview?n.container.title=Z(1731,`{0} to Apply, {1} to Preview`,s,c):n.container.title=Z(1732,`{0} to Apply`,s):n.container.title=``:n.container.title=``,Iu(n.toolbar);let l=[...e.toolbarActions??[]];if(e.onRemove&&l.push(r({id:If,label:Z(1733,`Remove`),class:K.asClassName(G.close),run:async()=>{await e.onRemove(),this._onRemoveItem?.(e)}})),n.container.classList.toggle(`has-toolbar`,l.length>0),l.length>0){let t=new Dl(n.toolbar);n.elementDisposables.add(t),this._stopToolbarPointerPropagation?(n.elementDisposables.add(Pa(n.toolbar,e=>{e.preventDefault(),e.stopPropagation()})),n.elementDisposables.add(z(n.toolbar,cl.CLICK,e=>e.stopPropagation())),n.elementDisposables.add(z(n.toolbar,ht.Tap,e=>e.stopPropagation()))):n.elementDisposables.add(Pa(n.toolbar,e=>e.preventDefault())),t.push(l,{icon:!0,label:!1}),n.elementDisposables.add(this._registerToolbar(e,t))}Bf(e)?(n.submenuIndicator.className=`action-list-submenu-indicator has-submenu `+K.asClassName(G.chevronRight),n.submenuIndicator.style.display=``,n.submenuIndicator.style.visibility=``,n.elementDisposables.add(z(n.submenuIndicator,cl.CLICK,t=>{t.stopPropagation(),this._onShowSubmenu?.(e)}))):this._reservesSubmenuSpace()?(n.submenuIndicator.className=`action-list-submenu-indicator`,n.submenuIndicator.style.display=``,n.submenuIndicator.style.visibility=`hidden`):(n.submenuIndicator.className=`action-list-submenu-indicator`,n.submenuIndicator.style.display=`none`),zf(e)?(n.container.setAttribute(`aria-haspopup`,e.hover?.expandable?`dialog`:`menu`),n.container.setAttribute(`aria-expanded`,`false`)):(n.container.removeAttribute(`aria-haspopup`),e.isSectionToggle||n.container.removeAttribute(`aria-expanded`))}disposeTemplate(e){e.keybinding.dispose(),e.elementDisposables.dispose()}};Vf=Af([jf(10,sr),jf(11,xu)],Vf);var Hf=class extends UIEvent{constructor(){super(`acceptSelectedAction`)}},Uf=class extends UIEvent{constructor(){super(`previewSelectedAction`)}};function Wf(e){if(e.kind===`action`)return e.label}var Gf=Mf=class extends L{constructor(e,t,n,r,a,o,s,c,l){if(super(),this._supportsPreview=t,this._delegate=r,this._options=o,this._keybindingService=s,this._openerService=c,this._instantiationService=l,this._headerLineHeight=24,this._separatorLineHeight=8,this.cts=this._register(new Jn),this._submenuDisposables=this._register(new j),this._submenuHoverActionElements=[],this._itemMoveAnimation=this._register(new i),this._collapsedSections=new Set,this._filterText=``,this._imeSessionInProgress=!1,this._isMeasuringWidth=!1,this._suppressHover=!1,this._hoverEnabled=!0,this._ignoreInitialHover=!0,this._hasLaidOut=!1,this._filterCts=this._register(new i),this._groupTitleByIndex=new Map,this._standaloneToggles=new Map,this._itemToolbars=new Map,this._onDidRequestLayout=this._register(new F),this.onDidRequestLayout=this._onDidRequestLayout.event,this._visibleMenuItems=n,this._initialFocusItemId=this._options?.initialFocusItemId,this._filterText=this._options?.showFilter?this._options.initialFilterValue??``:``,this.domNode=document.createElement(`div`),this.domNode.classList.add(`actionList`),this._options?.inlineDescription&&this.domNode.classList.add(`inline-description`),this._options?.className){let e=this._options.className.split(/\s+/).filter(e=>e.length>0);e.length>0&&this.domNode.classList.add(...e)}if(this._actionLineHeight=24,this._submenuContainer=document.createElement(`div`),this._submenuContainer.className=`action-list-submenu-panel action-widget`,this._submenuContainer.style.display=`none`,this._options?.persistentHover&&(this._submenuContainer.style.boxSizing=`border-box`),this._submenuContainer.tabIndex=-1,this.domNode.append(this._submenuContainer),this._register(z(this._submenuContainer,`keydown`,e=>{if((e.key===`Enter`||e.key===` `)&&this._currentSubmenuElement?.hover?.tabThroughPanel){let t=sn(e.target)?e.target:void 0;if(t&&this._currentSubmenuElement.hover.getTabbableElements?.().includes(t)){e.stopPropagation();return}}if(e.key!==`ArrowLeft`&&e.key!==`Escape`)return;ts.stop(e,!0);let t=e.key===`Escape`&&this._currentSubmenuWidget!==void 0;if(this._hideSubmenu(),t){this.hide();return}this._setKeyboardNavigation(!0),this._list.domFocus()})),this._register(z(this._submenuContainer,`mouseenter`,()=>{this._cancelSubmenuHide(),this._usesSubmenuPointerIntent()&&(this._cancelSubmenuShow(),this._resetSubmenuPointer())})),this._register(z(this._submenuContainer,`mouseleave`,()=>{this._scheduleSubmenuHide()})),this._register(z(this.domNode,cl.MOUSE_LEAVE,()=>{this._cancelSubmenuShow(),this._resetSubmenuPointer()})),this._usesSubmenuPointerIntent()&&this._register(z(this.domNode,cl.MOUSE_MOVE,e=>{sn(e.target)&&this._expandedTrigger?.contains(e.target)&&this._updateSubmenuPointer(e)})),this._register(Va(()=>{this._cancelSubmenuHide(),this._cancelSubmenuShow()})),this._options?.collapsedByDefault)for(let e of this._options.collapsedByDefault)this._collapsedSections.add(e);let u={getHeight:e=>this._getItemHeight(e),getTemplateId:e=>e.kind},d=()=>{let e=this._options?.reserveSubmenuSpace??!0;return e===`always`||e&&this._allMenuItems.some(Bf)};this._list=this._register(new Yn(e,this.domNode,u,[new Vf(this._supportsPreview,e=>this._removeItem(e),e=>this._showSubmenuForItem(e),d,this._groupTitleByIndex,this._options?.linkHandler,this._options?.hideDefaultKeybindingTooltip??!1,this._options?.stopToolbarPointerPropagation??!1,(e,t)=>(this._standaloneToggles.set(e,t),Va(()=>{this._standaloneToggles.get(e)===t&&this._standaloneToggles.delete(e)})),(e,t)=>(this._itemToolbars.set(e,t),this._updateToolbarFocusability(),Va(()=>{this._itemToolbars.get(e)===t&&this._itemToolbars.delete(e)})),this._keybindingService,this._openerService),new Lf,new Rf],{keyboardSupport:!1,typeNavigationEnabled:!this._options?.showFilter&&!this._options?.onType,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:Wf},accessibilityProvider:{getAriaLabel:e=>{if(e.kind===`action`){let t=e.label?qf(e?.label):``;if(e.badge&&(t=t+`, `+qf(e.badge)),e.detail&&(t=t+`, `+qf(e.detail)),e.ariaDescription)t=t+`, `+qf(e.ariaDescription);else if(e.description){let n=typeof e.description==`string`?e.description:e.description.value;t=t+`, `+qf(n)}if(e.hover?.content&&!e.ariaDescription&&!e.description){let n=e.hover.content,r=typeof n==`string`?n:Dn(n)?n.value:sn(n)?n.textContent??void 0:void 0;r&&(!e.detail||qf(e.detail)!==qf(r))&&(t=t+`, `+qf(r))}e.group?.title&&(t=t+`, `+e.group.title);let n=e.standaloneToggle??e.inlineToggle;return n&&(t=e.standaloneToggle?n.checked?Z(1734,`{0}, on`,n.label):Z(1735,`{0}, off`,n.label):t+`, `+(n.checked?Z(1736,`{0}, on`,n.label):Z(1737,`{0}, off`,n.label))),e.disabled&&(t=Z(1738,`{0}, Disabled Reason: {1}`,t,e.disabled)),e.submenuActions?.length&&(t=Z(1739,`{0}, use right arrow to access options`,t)),t}return null},getWidgetAriaLabel:()=>Z(1740,`Action Widget`),getSetSize:()=>this._visibleMenuItems.filter(e=>e.kind===`action`).length,getPosInSet:(e,t)=>Math.max(this._visibleMenuItems.slice(0,t+1).filter(e=>e.kind===`action`).length,1),getRole:e=>{switch(e.kind){case`action`:return`option`;case`separator`:return`separator`;default:return`separator`}},getWidgetRole:()=>`listbox`,...a}})),this._list.style(cs),this._register(this._list.onKeyDown(()=>this._setKeyboardNavigation(!0))),this._register(z(this._list.getHTMLElement(),cl.MOUSE_MOVE,e=>{(e.movementX!==0||e.movementY!==0)&&this._setKeyboardNavigation(!1)})),this._register(this._list.onMouseClick(e=>this.onListClick(e))),this._register(this._list.onMouseOver(e=>{this._ignoreInitialHover||this.onListHover(e)}));let f=this._register(new i);if(f.value=this._list.onMouseMove(e=>{(e.browserEvent.movementX!==0||e.browserEvent.movementY!==0)&&(f.clear(),this._ignoreInitialHover=!1,this.onListHover(e))}),this._register(this._list.onMouseDown(()=>{f.clear(),this._ignoreInitialHover=!1,this._setKeyboardNavigation(!1)})),this._register(this._list.onDidChangeFocus(()=>{this._updateToolbarFocusability(),this.onFocus()})),this._register(this._list.onDidChangeSelection(e=>this.onListSelection(e))),this._register(this._list.onDidScroll(()=>{this._isMeasuringWidth||this._layoutSubmenu?.()})),this._allMenuItems=[...n],this._options?.showFilter||this._options?.secondaryHeading){this._filterContainer=document.createElement(`div`),this._filterContainer.className=`action-list-filter`;let e=S(this._filterContainer,W(`.action-list-filter-row`));if(this._options?.showFilter){if(this._filterInput=document.createElement(`input`),this._filterInput.type=`text`,this._filterInput.className=`action-list-filter-input`,this._filterInput.placeholder=this._options?.filterPlaceholder??Z(1741,`Search...`),this._filterInput.value=this._filterText,this._filterInput.setAttribute(`aria-label`,Z(1742,`Filter items`)),e.appendChild(this._filterInput),this._register(z(this._filterInput,cl.KEY_DOWN,e=>{if(this._setKeyboardNavigation(!0),e.isComposing||!this._filterInput?.closest(`.action-list-submenu-panel`))return;let t=this._keybindingService.softDispatch(new el(e),this._filterInput);(t.kind===2&&t.commandId!==null&&Ff.has(t.commandId)||e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey)&&e.stopPropagation()})),this._register(z(this._filterInput,cl.MOUSE_DOWN,()=>this._setKeyboardNavigation(!1))),this._options.tabThroughItemActions&&this._register(z(this._filterInput,`keydown`,e=>this._handleTabThroughPanelKeyDown(e),!0)),this._options.filterAsCombobox){let e=this._list.getHTMLElement();e.id=this._list.domId,this._filterInput.setAttribute(`role`,`combobox`),this._filterInput.setAttribute(`aria-label`,this._filterInput.placeholder),this._filterInput.setAttribute(`aria-autocomplete`,`list`),this._filterInput.setAttribute(`aria-expanded`,`true`),this._filterInput.setAttribute(`aria-controls`,e.id),this._register(this._list.onDidChangeFocus(()=>this._updateFilterActiveDescendant())),this._register(z(this._filterInput,`focus`,()=>this._updateFilterActiveDescendant())),this._register(z(this._filterInput,`blur`,()=>this._updateFilterActiveDescendant())),this._register(Jr(this._filterInput,`keydown`,e=>{if(this._imeSessionInProgress||e.browserEvent.isComposing||e.keyCode===114||e.keyCode===15||e.keyCode===17||e.keyCode===14||e.keyCode===13){e.stopPropagation();return}let t=e.keyCode===16||e.keyCode===18;if(t||e.keyCode===3){if(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey){t&&e.stopPropagation();return}ts.stop(e,!0),e.keyCode===16?this.focusPrevious():e.keyCode===18?this.focusNext():this.acceptSelected()}}))}let t=this._options?.filterActions??[];if(t.length>0){let n=S(e,W(`.action-list-filter-actions`));this._register(new Dl(n)).push(t,{icon:!0,label:!1})}let n=()=>{let e=this._filterInput.value;this._imeSessionInProgress||e===this._filterText&&!this._filterCts.value?.token.isCancellationRequested||(this._filterText=e,this._applyOrUpdateFilter())};this._register(z(this._filterInput,`compositionstart`,()=>{this._imeSessionInProgress=!0,this._filterCts.value?.cancel()})),this._register(z(this._filterInput,`compositionend`,()=>{this._imeSessionInProgress=!1,n()})),this._register(z(this._filterInput,`input`,n))}if(this._options?.secondaryHeading){let t=S(e,W(`.action-list-filter-label`));t.textContent=this._options.secondaryHeading}}if(this._options?.footerText&&(this._footerContainer=document.createElement(`div`),this._footerContainer.className=`action-list-footer`,this._footerContainer.textContent=this._options.footerText),this._options?.headerText){if(this._headerContainer=document.createElement(`div`),this._headerContainer.className=`action-list-header`,this._options.headerIcon){let e=S(this._headerContainer,W(`span.action-list-header-icon`));e.classList.add(...K.asClassNameArray(this._options.headerIcon)),e.setAttribute(`aria-hidden`,`true`)}let e=S(this._headerContainer,W(`span.action-list-header-text`));if(e.textContent=this._options.headerText,this._register(z(this._headerContainer,cl.MOUSE_ENTER,()=>{this._options?.persistentHover?(this._cancelSubmenuShow(),this._resetSubmenuPointer()):this._hideSubmenu()})),this._options.headerLink){let{label:t,uri:n}=this._options.headerLink;e.textContent+=` `,this._register(this._instantiationService.createInstance(kf,e,{label:t,href:n.toString(!0)},{}))}if(this._options.headerDismiss){let e=this._options.headerDismiss,t=S(this._headerContainer,W(`span.action-list-header-dismiss`));t.appendChild(W(K.asCSSSelector(G.close))),t.tabIndex=0,t.setAttribute(`role`,`button`),t.setAttribute(`aria-label`,Z(1743,`Dismiss`));let n=()=>{e(),this.focus(),this._headerContainer?.remove(),this._headerContainer=void 0,this._onDidRequestLayout.fire()};this._register(rd(t,()=>n())),this._register(z(t,cl.KEY_DOWN,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())}))}}this._applyFilter(),this._list.length&&this._focusCheckedOrFirst(),this._register(z(this.domNode,`keydown`,e=>{if(e.key===`ArrowRight`&&!e.isComposing){let t=this._list.getFocus();if(t.length>0){let n=this._list.element(t[0]);if(n?.submenuActions?.length||n?.hover?.expandable){ts.stop(e,!0);let r=this._getRowElement(t[0]);r&&(this._showSubmenuForElement(n,r),n.hover?.tabThroughPanel?this._focusFirstTabThroughPanelControl(n,r):this._currentSubmenuWidget?this._currentSubmenuWidget.focus():this._submenuContainer.focus())}}}})),this._register(z(this.domNode,`keydown`,e=>this._handleTabThroughPanelKeyDown(e),!0)),(this._filterInput||this._options?.onType)&&this._register(z(this.domNode,`keydown`,e=>{let t=e.target;(this._options?.onType||this._options?.filterAsCombobox)&&sn(t)&&(gi(t)||t.closest(`button, a, [contenteditable="true"], .action-list-submenu-panel`))||(!this._filterInput||!pe(this._filterInput))&&!e.isComposing&&e.key.length===1&&e.key!==` `&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),e.stopPropagation(),this._filterInput?(this._filterInput.focus(),this._filterInput.value=e.key,this._filterText=e.key,this._applyOrUpdateFilter()):this._options?.onType?.(e.key))}))}_toggleSection(e){let t=this._collapsedSections.has(e);if(t)this._collapsedSections.delete(e);else{this._collapsedSections.add(e);let t=this.getFocusedElement();if(t?.section===e&&!t.isSectionToggle){let t=this._visibleMenuItems.findIndex(t=>t.section===e&&t.isSectionToggle);t>=0&&this._list.setFocus([t])}}this._options?.onDidToggleSection?.(e,this._collapsedSections.has(e)),this._applyFilter(),t&&this._revealFirstItemOfSection(e)}_revealFirstItemOfSection(e){for(let t=0;t<this._list.length;t++){let n=this._list.element(t);if(n.section===e&&!n.isSectionToggle){this._list.reveal(t);return}}}_applyOrUpdateFilter(){if(!this._delegate.onFilter){this._applyFilter();return}let e=this._filterText;this._filterCts.value?.cancel();let t=new Jn;this._filterCts.value=t,this._delegate.onFilter(e,t.token).then(e=>{t.token.isCancellationRequested||(this._allMenuItems=[...e],this._applyFilter(!0))}).catch(()=>{}).finally(()=>{this._filterCts.value===t&&!t.token.isCancellationRequested&&this._filterCts.clear()})}_applyFilter(e=!1,t=!0,n){this._itemMoveAnimation.clear();let r=e?``:this._filterText.toLowerCase(),i=!e&&r.length>0,a=[],o=this._list.getFocus(),s;if(o.length>0&&(s=this._list.element(o[0])),i){let e,t=[],n=!1,i=()=>{e&&n&&a.push(e),a.push(...t),e=void 0,t=[],n=!1},o=e=>{let t=(e.label??``).toLowerCase(),n=typeof e.description==`string`?e.description:e.description?.value??``;return t.includes(r)||n.toLowerCase().includes(r)};for(let r of this._allMenuItems)if(r.kind!==`header`){if(r.kind===`separator`){i(),e=r.label?r:void 0;continue}if(r.showAlways){t.push(r);continue}if(!r.isSectionToggle){if(r.filterItems){let e=o(r)?r.filterItems:r.filterItems.filter(o);e.length>0&&(n=!0,t.push(...e));continue}o(r)&&(n=!0,t.push(r))}}i()}else for(let e of this._allMenuItems){if(e.kind===`header`){a.push(e);continue}if(e.kind===`separator`){if(e.section&&this._collapsedSections.has(e.section))continue;a.push(e);continue}if(e.isSectionToggle&&e.section){let t=this._collapsedSections.has(e.section);a.push({...e,group:{...e.group,icon:t?G.chevronRight:G.chevronDown}});continue}e.section&&this._collapsedSections.has(e.section)||a.push(e)}let c=[],l=!1;for(let e=0;e<a.length;e++)c[e]=l,a[e].kind===`action`&&(l=!0);let u=[],d=!1;for(let e=a.length-1;e>=0;e--){if(a[e].kind===`action`){d=!0;continue}a[e].kind===`separator`&&(u[e]=d,d=!1)}for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.kind!==`separator`)continue;let n=u[e],r=!t.label&&!c[e];(!n||r)&&a.splice(e,1)}this._options?.showGroupTitleOnFirstItem&&this._recomputeGroupTitles(a);let f=this._filterInput&&pe(this._filterInput),p=wt(this._list.getHTMLElement());if(this._visibleMenuItems=a,this._list.splice(0,this._list.length,a),t&&this._onDidRequestLayout.fire(),f)this._filterInput?.focus(),this._focusCheckedOrFirst();else if(this._hasLaidOut&&(s||n)){let e=n??s?.item?.id;if(e){for(let t=0;t<this._list.length;t++)if(this._list.element(t).item?.id===e){this._list.setFocus([t]),this._list.reveal(t);break}p&&(this._focusCheckedOrFirst(),this._list.domFocus())}}}get filterContainer(){return this._filterContainer}get footerContainer(){return this._footerContainer}get headerContainer(){return this._headerContainer}get filterInput(){return this._filterInput}get closeAnimation(){return this._options?.closeAnimation}focusCondition(e){return!e.disabled&&e.kind===`action`}_setKeyboardNavigation(e){if(this._keyboardNavigation===e)return;this._keyboardNavigation=e;let t=this._list.getHTMLElement();t.classList.toggle(`keyboard-navigation`,e===!0),t.classList.toggle(`mouse-navigation`,e===!1)}_updateFilterActiveDescendant(){if(!this._filterInput)return;let[e]=this._list.getFocus();pe(this._filterInput)&&e!==void 0?this._filterInput.setAttribute(`aria-activedescendant`,this._list.getElementID(e)):this._filterInput.removeAttribute(`aria-activedescendant`)}focus(){if(this._setKeyboardNavigation(void 0),this._filterInput&&this._options?.focusFilterOnOpen){this._filterInput.focus(),this._focusCheckedOrFirst();return}this._list.domFocus(),this._focusCheckedOrFirst(),this._showTabThroughPanelForFocusedItem()}clearFocus(){this._list.setFocus([])}getFocusedElement(){let e=this._list.getFocus();if(e.length>0)return this._list.element(e[0])}_updateToolbarFocusability(){if(!this._options?.tabThroughItemActions)return;let[e]=this._list.getFocus(),t=e!==void 0&&e<this._list.length?this._list.element(e):void 0;for(let[e,n]of this._itemToolbars)n.setFocusable(e===t)}_focusCheckedOrFirst(){let e=this._suppressHover;this._suppressHover=!0;try{let e=this._initialFocusItemId;if(this._initialFocusItemId=void 0,e)for(let t=0;t<this._list.length;t++){let n=this._list.element(t);if(this.focusCondition(n)&&n.item?.id===e){this._list.setFocus([t]),this._list.reveal(t);return}}let[t]=this._list.getFocus();if(t!==void 0){let e=this._list.element(t);if(e&&this.focusCondition(e)){this._list.reveal(t);return}}for(let e=0;e<this._list.length;e++){let t=this._list.element(e);if(this.focusCondition(t)&&t.item?.checked){this._list.setFocus([e]),this._list.reveal(e);return}}this._list.focusFirst(void 0,this.focusCondition);let n=this._list.getFocus();n.length>0&&this._list.reveal(n[0])}finally{this._suppressHover=e,this._options?.filterAsCombobox&&this._updateFilterActiveDescendant()}}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._filterCts.value?.cancel(),this._filterCts.clear(),this._hideSubmenu()}clearFilter(){return this._filterInput&&this._filterText?(this._filterInput.value=``,this._filterText=``,this._applyOrUpdateFilter(),!0):!1}get hasDynamicHeight(){return this._options?.showFilter?!0:this._allMenuItems.some(e=>e.isSectionToggle)}get lineHeight(){return this._actionLineHeight}_getItemHeight(e){return this._itemHeightWith(e,this._options)}_itemHeightWith(e,t){switch(e.kind){case`header`:return this._headerLineHeight;case`separator`:return e.label?this._actionLineHeight:this._separatorLineHeight;default:return e.inlineToggle?t?.inlineToggleItemHeight??70:e.detail?t?.detailItemHeight??48:this._actionLineHeight}}computeFullHeight(){return this.computeHeightForItems(this._allMenuItems,void 0,this._options)}computeHeightForItems(e,t,n){let r=0;for(let i of e)t&&i.section&&!i.isSectionToggle&&t.has(i.section)||(r+=this._itemHeightWith(i,n));return r}computeListHeight(){let e=this._list.length,t=0;for(let n=0;n<e;n++){let e=this._list.element(n);t+=this._getItemHeight(e)}return t}layout(e,t){this._hasLaidOut=!0,this._list.layout(e,t),this.domNode.style.height=`${e}px`;let n=this.domNode.parentElement;n&&this._filterContainer?.parentElement===n&&n.insertBefore(this._filterContainer,this.domNode),this._layoutSubmenu?.()}computeMaxWidth(e){let t=this._list.length,n=Math.max(e,this._options?.minWidth??0),r=this._options?.maxWidth??1/0,i=Math.max(r,n),a=e=>Math.min(Math.max(e,n),i),o=this._allMenuItems.length;if(o>=50)return a(380);if(o>t){let e=[];for(let n=0;n<t;n++)e.push(this._list.element(n));let n=this._list.renderHeight,r=this._list.scrollTop,i=this._list.getFocus(),o=this._isMeasuringWidth;this._isMeasuringWidth=!0;try{let e=[...this._allMenuItems];this._list.splice(0,t,e);let n=0;for(let t of e)n+=this._getItemHeight(t);this._list.layout(n);let r=this._measureItemWidths(e);return a(Math.max(...r))}finally{try{this._list.splice(0,this._list.length,e),this._list.layout(n),this._list.scrollTop=r;let t=this._suppressHover;this._suppressHover=!0;try{this._list.setFocus(i)}finally{this._suppressHover=t}}finally{this._isMeasuringWidth=o}}}let s=[];for(let e=0;e<t;e++)s.push(this._list.element(e));let c=this._measureItemWidths(s);return a(Math.max(...c))}focusPrevious(){if(this._setKeyboardNavigation(!0),this._focusFilterResult(`previous`))return;if(this._filterInput&&pe(this._filterInput)){this._list.domFocus();let e=this._list.getFocus();if(e.length>0){this._list.focusPrevious(1,!1,void 0,this.focusCondition);let t=this._list.getFocus();t.length>0&&t[0]>=e[0]?this._filterInput.focus():t.length>0&&this._list.reveal(t[0])}else{this._list.focusLast(void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}return}let e=this._list.getFocus();this._list.focusPrevious(1,!0,void 0,this.focusCondition);let t=this._list.getFocus();if(t.length>0){if(this._filterInput&&e.length>0&&t[0]>e[0]){this._list.setFocus([]),this._filterInput.focus();return}this._list.reveal(t[0])}}focusNext(){if(this._setKeyboardNavigation(!0),this._focusFilterResult(`next`))return;if(this._filterInput&&pe(this._filterInput)){if(this._list.domFocus(),this._list.getFocus().length>0){this._list.focusNext(1,!1,void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}else{this._list.focusFirst(void 0,this.focusCondition);let e=this._list.getFocus();e.length>0&&this._list.reveal(e[0])}return}let e=this._list.getFocus();this._list.focusNext(1,!0,void 0,this.focusCondition);let t=this._list.getFocus();if(t.length>0){if(this._filterInput&&e.length>0&&t[0]<e[0]){this._list.setFocus([]),this._filterInput.focus();return}this._list.reveal(t[0])}}_focusFilterResult(e){if(!this._options?.filterAsCombobox||!this._filterInput||!pe(this._filterInput))return!1;e===`previous`?this._list.focusPrevious(1,!0,void 0,this.focusCondition):this._list.focusNext(1,!0,void 0,this.focusCondition);let[t]=this._list.getFocus();return t!==void 0&&this._list.reveal(t),!0}collapseFocusedSection(){let e=this._getFocusedSection();e&&!this._collapsedSections.has(e)&&this._toggleSection(e)}expandFocusedSection(){let e=this._getFocusedSection();e&&this._collapsedSections.has(e)&&this._toggleSection(e)}toggleFocusedSection(){let e=this._list.getFocus();if(e.length===0)return!1;let t=this._list.element(e[0]);return t.isSectionToggle&&t.section?(this._toggleSection(t.section),!0):!1}_getFocusedSection(){let e=this._list.getFocus();if(e.length===0)return;let t=this._list.element(e[0]);return t.isSectionToggle&&t.section,t.section}acceptSelected(e){let t=this._list.getFocus();if(t.length===0)return;let n=t[0],r=this._list.element(n);if(!this.focusCondition(r))return;let i=e?new Uf:new Hf;this._list.setSelection([n],i)}onListSelection(e){if(!e.elements.length)return;let t=e.elements[0];if(t.standaloneToggle){this._list.setSelection([]);let e=this._standaloneToggles.get(t);e&&!e.disabled&&(e.checked=!e.checked,t.standaloneToggle.onChange(e.checked));return}if(t.isSectionToggle&&t.section){this._list.setSelection([]);let e=t.section;queueMicrotask(()=>{this._toggleSection(e)});return}let n=Yt(e.browserEvent)||e.browserEvent?.type===ht.Tap;if(n){let t=e.browserEvent.target;if(sn(t)&&(t.closest(`.action-list-item-toolbar`)||t.closest(`.action-list-submenu-indicator`)||t.closest(`.action-list-item-inline-toggle`))){this._list.setSelection([]);return}}if(t.openSubmenuOnClick&&t.submenuActions?.length&&(n||e.browserEvent instanceof Hf)){this._list.setSelection([]),this._showSubmenuForItem(t),n||this._currentSubmenuWidget?.focus();return}if(t.item&&this.focusCondition(t)){let n=e.browserEvent instanceof Uf;this._delegate.onSelect(t.item,n&&this._supportsPreview)}else this._list.setSelection([])}onFocus(){let e=this._list.getFocus();if(e.length===0)return;let t=e[0],n=this._list.element(t);this._delegate.onFocus?.(n.item),this._suppressHover||(this._options?.persistentHover&&(this._cancelSubmenuShow(),this._resetSubmenuPointer(),this._list.reveal(t)),this._showHoverForElement(n,t))}_removeItem(e){let t=this._allMenuItems.indexOf(e);t>=0&&(this._allMenuItems.splice(t,1),this._applyFilter())}_recomputeGroupTitles(e){this._groupTitleByIndex.clear();let t=new Set;for(let n=0;n<e.length;n++){let r=e[n];r.kind===`action`&&r.group?.title&&!t.has(r.group.title)&&(t.add(r.group.title),this._groupTitleByIndex.set(n,r.group.title))}}_measureItemWidths(e){let t=[];for(let n=0;n<e.length;n++){let r=this._getRowElement(n);r&&(r.style.width=`auto`,t.push({element:r,item:e[n]}))}try{return t.map(({element:e,item:t})=>e.getBoundingClientRect().width+(t.detail?0:this._computeToolbarWidth(t)))}finally{for(let{element:e}of t)e.style.width=``}}_computeToolbarWidth(e){let t=e.toolbarActions?.length??0;return e.onRemove&&t++,t===0?0:t*22+6+10}_getRowElement(e){return e<0?null:this.domNode.ownerDocument.getElementById(this._list.getElementID(e))}_showTabThroughPanelForFocusedItem(){let e=this._list.getFocus();if(e.length===0)return;let t=e[0],n=this._list.element(t);if(!n.hover?.tabThroughPanel)return;let r=this._getRowElement(t);r&&this._showSubmenuForElement(n,r)}_getTabThroughPanelControls(e,t){return e.hover?.tabThroughPanel&&this._currentSubmenuElement!==e&&this._showSubmenuForElement(e,t),{toolbar:this._itemToolbars.get(e),panelControls:[...e.hover?.getTabbableElements?.()??[],...this._submenuHoverActionElements]}}_focusFirstTabThroughPanelControl(e,t){let n=this._getTabThroughPanelControls(e,t);n.toolbar?.length()?n.toolbar.focus(0):(n.panelControls[0]??this._list.getHTMLElement()).focus()}_handleTabThroughPanelKeyDown(e){if(e.isComposing)return;let t=this._list.getFocus();if(t.length===0)return;let n=t[0],r=this._list.element(n);if(!r.hover?.tabThroughPanel&&!this._options?.tabThroughItemActions)return;let i=this._getRowElement(n),a=Ge();if(!i||!sn(a))return;let o=this._getTabThroughPanelControls(r,i),s=o.toolbar?.isFocused()??!1,c=this._submenuContainer.contains(a);if((e.key===`ArrowUp`||e.key===`ArrowDown`)&&(s||c)){ts.stop(e,!0),this._list.domFocus(),e.key===`ArrowUp`?this.focusPrevious():this.focusNext();return}if(e.key!==`Tab`||e.ctrlKey||e.metaKey||e.altKey)return;let l;if(e.shiftKey){if(c){let t=o.panelControls.indexOf(a);if(t>0)l=o.panelControls[t-1];else if(o.toolbar?.length()){ts.stop(e,!0),o.toolbar.focus(o.toolbar.length()-1);return}else l=this._list.getHTMLElement()}else if(o.toolbar?.isFocused()){let t=o.toolbar.viewItems.findIndex((e,t)=>o.toolbar?.isFocused(t));if(t>0){ts.stop(e,!0),o.toolbar.focus(t-1);return}l=this._options?.filterAsCombobox?this._filterInput:this._list.getHTMLElement()}}else if(a===this._list.getHTMLElement()||a===this._filterInput){if(o.toolbar?.length()){ts.stop(e,!0),o.toolbar.focus(0);return}l=o.panelControls[0]}else if(o.toolbar?.isFocused()){let t=o.toolbar.viewItems.findIndex((e,t)=>o.toolbar?.isFocused(t));if(t+1<o.toolbar.length()){ts.stop(e,!0),o.toolbar.focus(t+1);return}l=o.panelControls[0]}else{let e=o.panelControls.indexOf(a);e>=0&&(l=o.panelControls[e+1]??this._list.getHTMLElement())}l&&(ts.stop(e,!0),l.focus())}_showHoverForElement(e,t){if(this._currentSubmenuElement===e)return;let n=!!e.hover?.content,r=!!e.submenuActions?.length;if(n||r){let n=this._getRowElement(t);n&&this._showSubmenuForElement(e,n);return}this._options?.persistentHover||this._hideSubmenu()}_showSubmenuForItem(e){let t=this._list.indexOf(e);if(t>=0){let n=this._getRowElement(t);n&&this._showSubmenuForElement(e,n)}}_showSubmenuForElement(e,t){if(!this._hoverEnabled||this._currentSubmenuElement===e)return;this._currentSubmenuElement=e,this._clearSubmenuContainer(),t.setAttribute(`aria-expanded`,`true`),this._expandedTrigger=t,this._submenuPanelClassName=e.hover?.panelClassName,this._submenuPanelClassName&&this._submenuContainer.classList.add(this._submenuPanelClassName);let n=e.hover?.preserveVerticalPosition,r=!!e.submenuActions?.length,a=n?W(`.action-list-submenu-content`):this._submenuContainer,o=n?W(`.action-list-submenu-viewport`,void 0,a):void 0,s=o&&!r?this._submenuDisposables.add(new cn(o,{horizontal:2,vertical:1,consumeMouseWheelIfScrollbarIsNeeded:!0,useShadows:!1})):void 0;s&&o?(this._submenuContainer.appendChild(s.getDomNode()),this._submenuDisposables.add(z(o,cl.SCROLL,()=>s.scanDomNode())),this._submenuDisposables.add(z(this._submenuContainer,cl.KEY_DOWN,e=>{let t=new el(e);(t.equals(12)||t.equals(11))&&(ts.stop(e,!0),s.setScrollPosition({scrollTop:s.getScrollPosition().scrollTop+(t.equals(12)?1:-1)*o.clientHeight}))}))):o&&this._submenuContainer.appendChild(o);let c,l=typeof e.hover?.content==`function`?e.hover.content():e.hover?.content;if(l){if(sn(l))c=l,e.hover?.disposable&&this._register(e.hover.disposable);else{let t=typeof l==`string`?new ec(l):l,n=this._options?.linkHandler,r=Se(t,{actionHandler:t=>{let r=bu.parse(t);n?n(r,e):this._openerService.open(r,{allowCommands:!0})}});this._submenuDisposables.add(r),c=r.element}c.classList.add(`action-list-submenu-hover-header`),c.classList.toggle(`content-owns-padding`,e.hover?.contentOwnsPadding===!0),e.submenuActions?.length&&c.classList.add(`has-submenu`),a.appendChild(c)}if(e.hover?.actions?.length){let t=W(`.hover-row.status-bar`),n=S(t,W(`.actions`));for(let t of e.hover.actions){let e=this._keybindingService.lookupKeybinding(t.commandId),r=this._submenuDisposables.add(qt.render(n,{label:t.label,commandId:t.commandId,run:e=>t.run(e),iconClass:t.iconClass},e?.getLabel()??null));this._submenuHoverActionElements.push(r.actionContainer)}this._submenuContainer.appendChild(t)}this._submenuContainer.style.display=``,this._submenuContainer.style.position=`absolute`,e.hover?.expandable?(this._submenuContainer.setAttribute(`role`,`dialog`),e.label&&this._submenuContainer.setAttribute(`aria-label`,e.label)):this._submenuContainer.removeAttribute(`role`);let u=Lt(this.domNode),d=0,f=c?c.offsetWidth:0,p;if(r){let t=this._createSubmenuItems(e.submenuActions),n=this._submenuDisposables.add(this._instantiationService.createInstance(Mf,`submenu`,!1,t,{onHide:()=>{},onSelect:e=>{e.run();let t=this._currentSubmenuElement?.item;this._hideSubmenu(),t&&this._delegate.onSelect(t),this.hide()}},void 0,e.submenuOptions));p=n,n.headerContainer&&a.appendChild(n.headerContainer),n.filterContainer&&a.appendChild(n.filterContainer),a.appendChild(n.domNode),n.footerContainer&&a.appendChild(n.footerContainer),this._currentSubmenuWidget=n,n.clearFocus(),d=n.computeListHeight(),n.layout(d);let r=n.computeMaxWidth(0);f=Math.max(f,r,n.footerContainer?.offsetWidth??0),n.layout(d,f),n.domNode.style.width=`${f}px`,e.submenuOptions&&(this._submenuContainer.style.boxSizing=`border-box`,this._submenuContainer.style.width=`${f+10}px`),this._submenuDisposables.add(n.onDidRequestLayout(()=>{d=n.computeListHeight(),n.layout(d,f),this._layoutSubmenu?.()})),this._submenuDisposables.add(z(a,`keydown`,e=>{e.key===`Escape`?(ts.stop(e,!0),this._hideSubmenu(),this.hide()):e.key===`ArrowLeft`?(ts.stop(e,!0),this._hideSubmenu(),this._setKeyboardNavigation(!0),this._list.domFocus()):e.key===`Enter`||e.key===` `?(ts.stop(e,!0),n.acceptSelected()):e.key===`ArrowDown`?(ts.stop(e,!0),n.focusNext()):e.key===`ArrowUp`&&(ts.stop(e,!0),n.focusPrevious())}))}let m,h,g=()=>{let e=this._currentSubmenuElement;if(!e||this._layoutSubmenu!==g)return;let t=this._list.indexOf(e),r=t>=0?this._getRowElement(t):null,i=this._options?.persistentHover;if(!r&&(!i||!this._allMenuItems.includes(e))){this._hideSubmenu();return}this._expandedTrigger!==r&&(this._expandedTrigger?.hasAttribute(`aria-expanded`)&&this._expandedTrigger.setAttribute(`aria-expanded`,`false`),this._expandedTrigger=r??void 0),r?.setAttribute(`aria-expanded`,`true`);let c=this.domNode.getBoundingClientRect(),l=i||e.hover?.alignToParent,_=l?this.domNode.parentElement?.closest(`.action-widget`)?.getBoundingClientRect()??c:c,v=r?.getBoundingClientRect()??_,y=l||n?Us(this.domNode):1;i&&(this._submenuContainer.style.width=`${_.width/y}px`);let b=this._submenuContainer.getBoundingClientRect(),ee=l?b.width:f+10,te=u.innerWidth-(l?_.right:v.right),ne=_.left,re=l?0:4;if(!l){let e=u.innerWidth-8;ee>e&&(ee=Math.max(e,0)),this._submenuContainer.style.boxSizing=`border-box`,this._submenuContainer.style.width=`${ee}px`}let ie=te>=ee||te>=ne;i&&this._submenuSide&&(this._submenuSide===`right`?te:ne)>=ee&&(ie=this._submenuSide===`right`),i&&(this._submenuSide=ie?`right`:`left`);let ae=ie?_.right-c.left+re:_.left-c.left-ee-re,oe=c.left+ae;oe<4?ae+=4-oe:oe+ee>u.innerWidth-4&&(ae-=oe+ee-(u.innerWidth-4)),this._submenuContainer.style.left=`${ae/y}px`;let se=b.height;n&&(m??=se/y);let ce=m===void 0?se:m*y,le=h===void 0?r&&e.hover?.alignToAnchorTop?v.top-c.top:r?v.top-c.top+(v.height-ce)/2:b.top-c.top:h*y;if(n&&e.hover?.alignToAnchorTop&&o&&p){let e=b.height-o.getBoundingClientRect().height+((p.headerContainer?.offsetHeight??0)+(p.filterContainer?.offsetHeight??0)+(p.footerContainer?.offsetHeight??0)+d)*y;le=Math.min(le,u.innerHeight-c.top-e-8)}let ue=c.top+le+ce;if(ue>u.innerHeight&&!(n&&e.hover?.alignToAnchorTop)&&(le-=ue-u.innerHeight+8),c.top+le<0&&(le=-c.top),n&&(h??=le/y),o&&s){let e=(b.height-s.getDomNode().getBoundingClientRect().height)/y,t=Math.max(0,(u.innerHeight-c.top-le-8)/y-e);o.style.height=`${Math.min(a.getBoundingClientRect().height/y,t)}px`,s.scanDomNode()}else if(o&&p){let e=(b.height-o.getBoundingClientRect().height)/y,t=Math.max(0,(u.innerHeight-c.top-le-8)/y-e),n=(p.headerContainer?.offsetHeight??0)+(p.filterContainer?.offsetHeight??0)+(p.footerContainer?.offsetHeight??0),r=d===0?0:Math.max(this._actionLineHeight,Math.min(d,t-n));p.layout(r,f),o.style.height=`${n+r}px`}this._submenuContainer.style.top=`${le/y}px`};if(this._layoutSubmenu=g,g(),(this._options?.persistentHover||e.hover?.alignToParent||e.hover?.tabThroughPanel||n)&&this._currentSubmenuElement===e){if(!p){let e=this._submenuDisposables.add(new i),t=this._submenuDisposables.add(new Ao(`ActionListWidget.hoverPanel`,()=>{e.value||=Oc(u,()=>{e.clear(),g()})},u));this._submenuDisposables.add(t.observe(n?a:this._submenuContainer,{box:`border-box`}))}(this._options?.persistentHover||n)&&this._submenuDisposables.add(z(u,cl.RESIZE,()=>{this._cancelSubmenuShow(),this._resetSubmenuPointer(),g()}))}}_createSubmenuItems(e){let t=[],n=e.filter(e=>e instanceof vr).filter(e=>e.actions.length>0);for(let e=0;e<n.length;e++){let r=n[e];r.label&&t.push({kind:`header`,group:{title:r.label},label:r.label});for(let e of r.actions){let n=e,r=n.icon??K.fromId(e.checked?G.check.id:G.blank.id),i=n.hoverContent,a=i?new ec().appendText(`${e.label}\n`).appendMarkdown(i):void 0;t.push({item:e,kind:`action`,label:e.label,description:e.tooltip&&e.tooltip!==e.label?e.tooltip:void 0,group:{title:``,icon:r},hideIcon:!1,hover:a?{content:a}:void 0,tooltip:e.tooltip||e.label,onRemove:n.onRemove,submenuActions:e instanceof vr?[new vr(e.id,``,e.actions)]:void 0})}e<n.length-1&&t.push({kind:`separator`,label:``})}for(let n of e)if(!(n instanceof vr)){let e=n,r=e.icon??K.fromId(n.checked?G.check.id:G.blank.id),i=e.hoverContent,a=i?new ec().appendText(`${n.label}\n`).appendMarkdown(i):void 0;t.push({item:n,kind:`action`,label:n.label,description:n.tooltip&&n.tooltip!==n.label?n.tooltip:void 0,group:{title:``,icon:r},hideIcon:!1,hover:a?{content:a}:void 0,tooltip:n.tooltip||n.label,onRemove:e.onRemove})}return t}_hideSubmenu(){this._cancelSubmenuHide(),this._cancelSubmenuShow(),this._currentSubmenuElement=void 0,this._submenuSide=void 0,this._clearSubmenuContainer(),this._submenuContainer.style.display=`none`}_clearSubmenuContainer(){this._layoutSubmenu=void 0,this._resetSubmenuPointer(),this._submenuContainer.contains(Ge())&&this._list.domFocus(),this._submenuDisposables.clear(),this._currentSubmenuWidget=void 0,this._submenuHoverActionElements=[],this._submenuPanelClassName&&=(this._submenuContainer.classList.remove(this._submenuPanelClassName),void 0),this._submenuContainer.removeAttribute(`role`),this._submenuContainer.removeAttribute(`aria-label`),this._expandedTrigger?.hasAttribute(`aria-expanded`)&&this._expandedTrigger.setAttribute(`aria-expanded`,`false`),this._expandedTrigger=void 0,Iu(this._submenuContainer),this._submenuContainer.style.width=``,this._submenuContainer.style.boxSizing=this._options?.persistentHover?`border-box`:``}_scheduleSubmenuHide(){this._cancelSubmenuHide(),!this._options?.persistentHover&&(this._submenuHideTimeout=setTimeout(()=>{this._hideSubmenu()},300))}_cancelSubmenuHide(){this._submenuHideTimeout!==void 0&&(clearTimeout(this._submenuHideTimeout),this._submenuHideTimeout=void 0)}_scheduleSubmenuShow(e,t){this._cancelSubmenuShow();let n=this._options?.submenuHoverDelay??500;if(this._usesSubmenuPointerIntent()){n=0;let e=this._submenuPointerOrigin;if(e&&t.clientX!==e.x&&this._currentSubmenuElement&&new Cs(e.x,e.y,this._submenuContainer).contains(t.clientX,t.clientY)){let e=Date.now();this._submenuPointerGraceDeadline??=e+200,n=Math.max(0,this._submenuPointerGraceDeadline-e)}}let r=()=>{this._submenuShowTimeout=void 0;let n=this._list.indexOf(e),r=n>=0?this._getRowElement(n):null;r&&(this._showSubmenuForElement(e,r),this._usesSubmenuPointerIntent()&&this._updateSubmenuPointer(t))};n===0?r():this._submenuShowTimeout=setTimeout(r,n)}_updateSubmenuPointer(e){this._submenuPointerOrigin={x:e.clientX,y:e.clientY},this._submenuPointerGraceDeadline=void 0}_resetSubmenuPointer(){this._submenuPointerOrigin=void 0,this._submenuPointerGraceDeadline=void 0}_usesSubmenuPointerIntent(){return this._options?.persistentHover===!0||this._options?.submenuPointerIntent===!0}_cancelSubmenuShow(){this._submenuShowTimeout!==void 0&&(clearTimeout(this._submenuShowTimeout),this._submenuShowTimeout=void 0)}async onListHover(e){this._setKeyboardNavigation(!1);let t=e.element;if(t&&t.item&&this.focusCondition(t)){let n=typeof e.index==`number`?[e.index]:[],r=Ge();if(this._options?.tabThroughItemActions&&this._list.getFocus()[0]!==e.index&&sn(r)&&this.domNode.contains(r)&&r.closest(`.action-list-item-toolbar`)&&this._list.domFocus(),sn(e.browserEvent.target)&&e.browserEvent.target.closest(`.action-list-item-toolbar`)!==null){t.submenuActions?.length||this._cancelSubmenuShow(),this._list.setFocus(this._options?.tabThroughItemActions?n:[]);return}let i=!!(t.submenuActions?.length||t.hover?.content),a=this._suppressHover;(i||this._usesSubmenuPointerIntent())&&(this._suppressHover=!0);try{this._list.setFocus(n)}finally{this._suppressHover=a}if(i){this._currentSubmenuElement===t?(this._cancelSubmenuHide(),this._cancelSubmenuShow(),this._usesSubmenuPointerIntent()&&this._updateSubmenuPointer(e.browserEvent)):(this._usesSubmenuPointerIntent()||this._hideSubmenu(),this._scheduleSubmenuShow(t,e.browserEvent));return}if(this._currentSubmenuElement===t?this._cancelSubmenuHide():(this._cancelSubmenuShow(),this._options?.submenuPointerIntent?this._scheduleSubmenuHide():this._options?.persistentHover||this._hideSubmenu()),this._delegate.onHover&&!t.disabled&&t.kind===`action`&&this._currentSubmenuElement!==t){let n=await this._delegate.onHover(t.item,this.cts.token),r=n?n.canPreview:void 0;r!==t.canPreview&&(t.canPreview=r,typeof e.index==`number`&&(this._list.splice(e.index,1,[t]),this._list.setFocus([e.index])))}}else t&&t.hover?.content&&typeof e.index==`number`&&(this._currentSubmenuElement===t?(this._cancelSubmenuHide(),this._cancelSubmenuShow()):(this._options?.persistentHover||this._hideSubmenu(),this._scheduleSubmenuShow(t,e.browserEvent)))}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Gf=Mf=Af([jf(6,sr),jf(7,xu),jf(8,q)],Gf);var Kf=class extends L{get domNode(){return this._widget.domNode}get filterContainer(){return this._widget.filterContainer}get footerContainer(){return this._widget.footerContainer}get headerContainer(){return this._widget.headerContainer}get filterInput(){return this._widget.filterInput}get closeAnimation(){return this._widget.closeAnimation}get widgetClassName(){return this._widgetClassName}get anchorPosition(){if(this._preferredAnchorPosition!==void 0)return this._preferredAnchorPosition;if(this._showAbove!==void 0)return+!!this._showAbove}constructor(e,t,n,r,i,a,o,s,c,l){super(),this._contextViewService=s,this._layoutService=c,this._lastMinWidth=0,this._hasLaidOut=!1,this._anchor=o,this._preferredAnchorPosition=a?.anchorPosition,this._useFullHeight=a?.useFullHeight??!1,this._widgetClassName=a?.widgetClassName,this._widget=this._register(l.createInstance(Gf,e,t,n,r,i,a)),this._register(this._widget.onDidRequestLayout(()=>{this._hasLaidOut&&(this.layout(this._lastMinWidth),this._contextViewService.layout())}))}focus(){this._widget.focus()}hide(e,t=!0){this._widget.hide(e),t&&this._contextViewService.hideContextView()}clearFilter(){return this._widget.clearFilter()}focusPrevious(){this._widget.focusPrevious()}focusNext(){this._widget.focusNext()}collapseFocusedSection(){this._widget.collapseFocusedSection()}expandFocusedSection(){this._widget.expandFocusedSection()}toggleFocusedSection(){return this._widget.toggleFocusedSection()}acceptSelected(e){this._widget.acceptSelected(e)}hasDynamicHeight(){return this._widget.hasDynamicHeight}computeActionWidgetVerticalChromeHeight(){let e=this.domNode.parentElement?.closest(`.action-widget`);if(!e)return 0;let t=Lt(e).getComputedStyle(e),n=e=>Number.parseFloat(e)||0;return n(t.paddingTop)+n(t.paddingBottom)+n(t.borderTopWidth)+n(t.borderBottomWidth)}computeHeight(){let e=this._fixedContentHeight??this._widget.computeListHeight(),t=this._widget.filterContainer?36:0,n=this._widget.footerContainer?32:0,r=this._widget.headerContainer&&!this._widget.headerContainer.hidden?this._widget.headerContainer.offsetHeight||36:0,i=t+n+r,a=Lt(this.domNode),o;if(this.hasDynamicHeight()||this._preferredAnchorPosition!==void 0){let e=a.innerHeight,t=ol(this._anchor),n=t.top-a.pageYOffset,r=e-n-t.height-30,s=n;if(this._showAbove===void 0){let e=this._fixedContentHeight??this._widget.computeFullHeight();this._showAbove=this._preferredAnchorPosition===void 0?i+e>r&&s>r:this._preferredAnchorPosition===1}o=Math.max(0,(this._showAbove?s:r)-this.computeActionWidgetVerticalChromeHeight())}else{let e=this._layoutService.getContainer(a).clientHeight,t=this.domNode.getBoundingClientRect().top;o=t>0?e-t-10:e*.7}let s=this._useFullHeight?a.innerHeight:Math.floor(a.innerHeight*.6),c=this._widget.lineHeight;if(this._preferredAnchorPosition!==void 0){let t=Math.min(o,s),n=Math.min(e+i,Math.max(0,t));return Math.max(0,n-i)}let l=Math.min(Math.max(o,c*3+i),s);return Math.min(e+i,l)-i}layout(e,t){this._hasLaidOut=!0,this._lastMinWidth=e,t!==void 0&&(this._fixedContentHeight=t);let n=this.computeHeight();this._widget.layout(n);let r=this._widget.computeMaxWidth(e);return this._cachedMaxWidth=r,this._widget.layout(n,this._cachedMaxWidth),this._cachedMaxWidth}};Kf=Af([jf(7,c),jf(8,uu),jf(9,q)],Kf);function qf(e){return e.replace(/\r\n|\r|\n/g,` `)}var Jf=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Yf=function(e,t){return function(n,r){t(n,r,e)}};X(`actionBar.toggledBackground`,Vl,Z(1744,`Background color for toggled action items in action bar.`));var Xf=`--action-widget-close-start-opacity`,Zf=`--action-widget-close-start-transform`,Qf={Visible:new N(`codeActionMenuVisible`,!1,Z(1745,`Whether the action widget list is visible`)),FilterFocused:new N(`codeActionMenuFilterFocused`,!1,Z(1746,`Whether the action widget filter input is focused`))},$f=Xa(`actionWidgetService`),ep=class extends L{get isVisible(){return Qf.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new i),this._closeAnimation=this._register(new i)}show(e,t,n,r,i,a,o,s,c){let l=Qf.Visible.bindTo(this._contextKeyService),u=this._instantiationService.createInstance(Kf,e,t,n,r,s,c,i);this._contextViewService.showContextView({getAnchor:()=>i,render:e=>(l.set(!0),this._renderWidget(e,u,o??[],c)),onHide:e=>{l.reset(),this._onWidgetClosed(e)},get anchorPosition(){return u.anchorPosition},focus:()=>u.focus()},a,!1)}acceptSelected(e){this._list.value?.acceptSelected(e)}focusPrevious(){this._list?.value?.focusPrevious()}focusNext(){this._list?.value?.focusNext()}collapseSection(){this._list?.value?.collapseFocusedSection()}expandSection(){this._list?.value?.expandFocusedSection()}toggleSection(){return this._list?.value?.toggleFocusedSection()??!1}clearFilter(){return this._list?.value?.clearFilter()??!1}hide(e){let t=this._list.value,n=this._widgetElement;if(!t||this._closingList===t)return;let r=t.closeAnimation;if(!n||!r||r.duration<=0||!this._hasRequiredAncestorClasses(n,r.requiredAncestorClasses)){this._closingList=t,t.hide(e);return}this._closingList=t;let i=Lt(n).getComputedStyle(n);n.style.setProperty(Xf,i.opacity),n.style.setProperty(Zf,i.transform),n.classList.add(r.className),t.hide(e,!1),this._closeAnimation.value=Hc(()=>{this._list.value===t&&this._contextViewService.hideContextView(e)},r.duration)}clear(){this._closeAnimation.clear(),this._closingList=void 0,this._widgetElement?.style.removeProperty(Xf),this._widgetElement?.style.removeProperty(Zf),this._widgetElement=void 0,this._list.clear()}_renderWidget(e,t,n,r){let a=document.createElement(`div`);a.classList.add(`action-widget`);let o=t.widgetClassName?.split(/\s+/).filter(Boolean);if(o?.length&&a.classList.add(...o),e.appendChild(a),this._widgetElement=a,this._list.value=t,this._list.value)this._list.value.headerContainer&&a.appendChild(this._list.value.headerContainer),this._list.value.filterContainer&&a.appendChild(this._list.value.filterContainer),a.appendChild(this._list.value.domNode),this._list.value.footerContainer&&a.appendChild(this._list.value.footerContainer);else throw Error(`List has no value`);let s=new j;r?.filterAsCombobox&&s.add(Jr(a,`keydown`,e=>{e.keyCode===9&&!e.browserEvent.isComposing&&(ts.stop(e,!0),this.hide(!0))}));let c=this._list.value.headerContainer;c&&s.add(Pa(c,e=>e.preventDefault()));let l=0;s.add(Pa(a,()=>{l=Date.now()+1e3}));let u=document.createElement(`div`),d=e.appendChild(u);d.classList.add(`context-view-block`),s.add(Pa(d,e=>e.stopPropagation()));let f=0;if(n.length){let e=this._createActionBar(`.action-widget-action-bar`,n);e&&(a.appendChild(e.getContainer().parentElement),s.add(e),f=e.getContainer().offsetWidth)}let p=this._list.value?.layout(f);a.style.width=`${p}px`;let m=Qf.FilterFocused.bindTo(this._contextKeyService);if(s.add({dispose:()=>m.reset()}),this._list.value?.filterInput){let e=this._list.value.filterInput;s.add(z(e,`focus`,()=>m.set(!0))),s.add(z(e,`blur`,()=>m.set(!1)))}let h=s.add(Vc(e)),g=s.add(new i);return s.add(h.onDidFocus(()=>g.clear())),s.add(h.onDidBlur(()=>{let t=()=>{let n=l-Date.now();if(n>0){g.value=Hc(t,n);return}let r=Ge();r&&(e.contains(r)||r.closest(`.action-widget-hover`)||r.closest(`.action-list-submenu-panel`))||this.hide(!0)};g.value=Hc(t,75)})),s}_createActionBar(e,t){if(!t.length)return;let n=W(e),r=new Dl(n);return r.push(t,{icon:!1,label:!0}),r}_hasRequiredAncestorClasses(e,t){if(!t?.length)return!0;for(let n=e;n;n=n.parentElement)if(t.every(e=>n.classList.contains(e)))return!0;return!1}_onWidgetClosed(e){if(this._closingList===this._list.value){this.clear();return}this._closeAnimation.clear(),this._closingList=void 0,this._widgetElement=void 0,this._list.value?.hide(e)}};ep=Jf([Yf(0,c),Yf(1,E),Yf(2,q)],ep),Et($f,ep,1);var tp=1100;k(class extends v{constructor(){super({id:`hideCodeActionWidget`,title:M(1747,`Hide action widget`),precondition:Qf.Visible,keybinding:{weight:tp,primary:9,secondary:[1033]}})}run(e){e.get($f).hide(!0)}}),k(class extends v{constructor(){super({id:`clearFilterCodeActionWidget`,title:M(1748,`Clear action widget filter`),precondition:P.and(Qf.Visible,Qf.FilterFocused),keybinding:{weight:1101,primary:9}})}run(e){let t=e.get($f);t instanceof ep&&(t.clearFilter()||t.hide(!0))}}),k(class extends v{constructor(){super({id:`selectPrevCodeAction`,title:M(1749,`Select previous action`),precondition:Qf.Visible,keybinding:{weight:tp,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){let t=e.get($f);t instanceof ep&&t.focusPrevious()}}),k(class extends v{constructor(){super({id:`selectNextCodeAction`,title:M(1750,`Select next action`),precondition:Qf.Visible,keybinding:{weight:tp,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){let t=e.get($f);t instanceof ep&&t.focusNext()}}),k(class extends v{constructor(){super({id:`collapseSectionCodeAction`,title:M(1751,`Collapse section`),precondition:P.and(Qf.Visible,Qf.FilterFocused.negate()),keybinding:{weight:tp,primary:15}})}run(e){let t=e.get($f);t instanceof ep&&t.collapseSection()}}),k(class extends v{constructor(){super({id:`expandSectionCodeAction`,title:M(1752,`Expand section`),precondition:P.and(Qf.Visible,Qf.FilterFocused.negate()),keybinding:{weight:tp,primary:17}})}run(e){let t=e.get($f);t instanceof ep&&t.expandSection()}}),k(class extends v{constructor(){super({id:`toggleSectionCodeAction`,title:M(1753,`Toggle section`),precondition:P.and(Qf.Visible,Qf.FilterFocused.negate()),keybinding:{weight:tp,primary:10}})}run(e){let t=e.get($f);t instanceof ep&&(t.toggleSection()||t.acceptSelected())}}),k(class extends v{constructor(){super({id:Nf,title:M(1754,`Accept selected action`),precondition:Qf.Visible,keybinding:{weight:tp,primary:3,secondary:[2137]}})}run(e){let t=e.get($f);t instanceof ep&&t.acceptSelected()}}),k(class extends v{constructor(){super({id:Pf,title:M(1755,`Preview selected action`),precondition:Qf.Visible,keybinding:{weight:tp,primary:2051}})}run(e){let t=e.get($f);t instanceof ep&&t.acceptSelected(!0)}});var np,rp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ip=function(e,t){return function(n,r){t(n,r,e)}},ap,op=(np=class extends L{constructor(e,t,n,r,i,a,o,s,c,l,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=i,this.edits=a,this.onSelectNewEdit=o,this.additionalActions=s,this._keybindingService=l,this._actionWidgetService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(Va(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Va((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(e=>{this.dispose()})),this._register(lt.runAndSubscribe(l.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){this.button.element.title=this._keybindingService.appendKeybinding(this.showCommand.label,this.showCommand.id)}create(){this.domNode=W(`.post-edit-widget`),this.button=this._register(new rt(this.domNode,{supportIcons:!0})),this.button.label=`$(insert)`,this._register(z(this.domNode,cl.CLICK,()=>this.showSelector()))}getId(){return ap.baseId+`.`+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){let e=re(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show(`postEditWidget`,!1,this.edits.allEdits.map((e,t)=>({kind:`action`,item:e,label:e.title,disabled:!1,canPreview:!1,group:{title:``,icon:K.fromId(t===this.edits.activeEditIndex?G.check.id:G.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:e=>{this._actionWidgetService.hide(!1);let t=this.edits.allEdits.findIndex(t=>t===e);if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}},ap=np,np.baseId=`editor.widget.postEditWidget`,np);op=ap=rp([ip(8,E),ip(9,sr),ip(10,$f)],op);var sp=class extends L{constructor(e,t,n,r,a,o,s,c){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=r,this._getAdditionalActions=a,this._instantiationService=o,this._bulkEditService=s,this._notificationService=c,this._currentWidget=this._register(new i),this._register(lt.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,n,r,i){if(!e.length||!this._editor.hasModel())return;let a=this._editor.getModel(),o=t.allEdits.at(t.activeEditIndex);if(!o)return;let s=async a=>{let o=this._editor.getModel();o&&(await o.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:a,allEdits:t.allEdits},n,r,i))},c=(r,i)=>{Zt(r)||(this._notificationService.error(i),n&&this.show(e[0],t,s))},l=new Ml(this._editor,3,void 0,i),u;try{u=await sc(r(o,l.token),l.token)}catch(e){return c(e,Z(991,`Error resolving edit '{0}':
|
|
3
3
|
{1}`,o.title,Tf(e)))}finally{l.dispose()}if(i.isCancellationRequested)return;let d=bf(a.uri,e,u),f=e[0],p=a.deltaDecorations([],[{range:f,options:{description:`paste-line-suffix`,stickiness:0}}]);this._editor.focus();let m,h;try{m=await this._bulkEditService.apply(d,{editor:this._editor,token:i}),h=a.getDecorationRange(p[0])}catch(e){return c(e,Z(992,`Error applying edit '{0}':
|
|
4
4
|
{1}`,o.title,Tf(e)))}finally{a.deltaDecorations(p,[])}i.isCancellationRequested||n&&m.isApplied&&t.allEdits.length>1&&this.show(h??f,t,s)}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(op,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};sp=rp([ip(5,q),ip(6,es),ip(7,ce)],sp);var cp,lp=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},up=function(e,t){return function(n,r){t(n,r,e)}},dp,fp=`editor.changePasteType`,pp=`editor.pasteAs.preferences`,mp=new N(`pasteWidgetVisible`,!1,Z(971,`Whether the paste widget is showing`)),hp=`application/vnd.code.copymetadata`,gp=(cp=class extends L{static get(e){return e.getContribution(dp.ID)}constructor(e,t,n,r,i,a,o,s,c,l){super(),this._logService=n,this._bulkEditService=r,this._clipboardService=i,this._commandService=a,this._configService=o,this._languageFeaturesService=s,this._quickInputService=c,this._progressService=l,this._editor=e,this._register(e.onWillCopy(e=>this.handleCopy(e))),this._register(e.onWillCut(e=>this.handleCopy(e))),this._register(e.onWillPaste(e=>this.handlePaste(e))),this._pasteProgressManager=this._register(new Bd(`pasteIntoEditor`,e,t)),this._postPasteWidgetManager=this._register(t.createInstance(sp,`pasteIntoEditor`,e,mp,{id:fp,label:Z(972,`Show paste options...`)},()=>dp._configureDefaultAction?[dp._configureDefaultAction]:[]))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(e){this._logService.trace(`CopyPasteController.pasteAs`),this._editor.focus();try{this._logService.trace(`Before calling editor.action.clipboardPasteAction`),this._pasteAsActionContext={preferred:e},await this._commandService.executeCommand(`editor.action.clipboardPasteAction`)}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){if(this._logService.trace(`CopyPasteController#handleCopy`),!this._editor.hasTextFocus()||(this._clipboardService.clearInternalState?.(),!this.isPasteAsEnabled()))return;let t=this._editor.getModel(),n=this._editor._getViewModel(),r=this._editor.getSelections();if(!t||!n||!r?.length)return;let i={multicursorText:e.dataToCopy.multicursorText??null,pasteOnNewLine:e.dataToCopy.isFromEmptySelection,mode:null},a=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(e=>!!e.prepareDocumentPaste);if(!a.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:i});return}let o=new p,s=a.flatMap(e=>e.copyMimeTypes??[]),c=nr();this.setCopyMetadata(e.clipboardData,{id:c,providerCopyMimeTypes:s,defaultPastePayload:i});let l=a.map(n=>({providerMimeTypes:n.copyMimeTypes,operation:za(r=>n.prepareDocumentPaste(t,e.dataToCopy.sourceRanges,o,r).catch(e=>{console.error(e)}))}));dp._currentCopyOperation?.operations.forEach(e=>e.operation.cancel()),dp._currentCopyOperation={handle:c,operations:l}}async handlePaste(e){if(this._logService.trace(`CopyPasteController#handlePaste for id : `,e.metadata?.id),!this._editor.hasTextFocus())return;let t=e.toExternalVSDataTransfer();if(!t)return;t.delete(hp),Gd.get(this._editor)?.closeMessage(),this._currentPasteOperation?.cancel(),this._currentPasteOperation=void 0;let n=this._editor.getModel(),r=this._editor.getSelections();if(!r?.length||!n||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;let i=this.fetchCopyMetadata(e);this._logService.trace(`CopyPasteController#handlePaste with metadata : `,i?.id,` and text.length : `,e.clipboardData.getData(`text/plain`).length);let a=Array.from(e.clipboardData.files).map(e=>e.type),o=[...e.clipboardData.types,...a,...i?.providerCopyMimeTypes??[],rr.uriList],s=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter(e=>{let t=this._pasteAsActionContext?.preferred;return t&&!this.providerMatchesPreference(e,t)?!1:e.pasteMimeTypes?.some(e=>bn(e,o))});if(!s.length){this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(r,this._pasteAsActionContext.preferred),e.setHandled());return}e.setHandled(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,s,r,t,i):this.doPasteInline(s,r,t,i,e.browserEvent)}showPasteAsNoEditMessage(e,t){let n=`only`in t?t.only.value:`preferences`in t?t.preferences.length?t.preferences.map(e=>e.value).join(`, `):Z(973,`empty`):t.providerId;Gd.get(this._editor)?.showMessage(Z(974,`No paste edits for '{0}' found`,n),e[0].getStartPosition())}doPasteInline(e,t,n,r,i){this._logService.trace(`CopyPasteController#doPasteInline`);let a=this._editor;if(!a.hasModel())return;let o=new Ml(a,3,void 0),s=za(async a=>{let c=this._editor;if(!c.hasModel())return;let l=c.getModel(),u=new j,d=u.add(new Jn(a));u.add(o.token.onCancellationRequested(()=>d.cancel()));let f=d.token;try{if(await this.mergeInDataFromCopy(e,n,r,f),f.isCancellationRequested)return;let a=e.filter(e=>this.isSupportedPasteProvider(e,n));if(!a.length||a.length===1&&a[0]instanceof Qd)return this.applyDefaultPasteHandler(n,r,f,i);let o={triggerKind:hl.Automatic},s=await this.getPasteEdits(a,n,l,t,o,f);if(u.add(s),f.isCancellationRequested)return;if(s.edits.length===1&&s.edits[0].provider instanceof Qd)return this.applyDefaultPasteHandler(n,r,f,i);if(s.edits.length){let e=c.getOption(97).showPasteSelector===`afterPaste`;return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(l,s.edits),allEdits:s.edits},e,async(e,n)=>{if(!e.provider.resolveDocumentPasteEdit)return e;let r=e.provider.resolveDocumentPasteEdit(e,n),i=new ma,a=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),Z(975,`Resolving paste edit for '{0}'. Click to cancel`,e.title),uo(Promise.race([i.p,r]),n),{cancel:()=>i.cancel()},0);return a&&(e.insertText=a.insertText,e.additionalEdit=a.additionalEdit),e},f)}await this.applyDefaultPasteHandler(n,r,f,i)}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),Z(976,`Running paste handlers. Click to cancel and do basic paste`),s,{cancel:async()=>{s.cancel(),!o.token.isCancellationRequested&&await this.applyDefaultPasteHandler(n,r,o.token,i)}}).finally(()=>{o.dispose()}),this._currentPasteOperation=s}showPasteAsPick(e,t,n,r,i){this._logService.trace(`CopyPasteController#showPasteAsPick`);let a=za(async o=>{let s=this._editor;if(!s.hasModel())return;let c=s.getModel(),l=new j,u=l.add(new Ml(s,3,void 0,o));try{if(await this.mergeInDataFromCopy(t,r,i,u.token),u.token.isCancellationRequested)return;let a=t.filter(t=>this.isSupportedPasteProvider(t,r,e));e&&(a=a.filter(t=>this.providerMatchesPreference(t,e)));let o={triggerKind:hl.PasteAs,only:e&&`only`in e?e.only:void 0},s=l.add(await this.getPasteEdits(a,r,c,n,o,u.token));if(u.token.isCancellationRequested)return;if(e&&(s={edits:s.edits.filter(t=>`only`in e?e.only.contains(t.kind):`preferences`in e?e.preferences.some(e=>e.contains(t.kind)):e.providerId===t.provider.id),dispose:s.dispose}),!s.edits.length){e&&this.showPasteAsNoEditMessage(n,e);return}let d;if(e)d=s.edits.at(0);else{let e={id:`editor.pasteAs.default`,label:Z(977,`Configure default paste action`),edit:void 0},t=await this._quickInputService.pick([...s.edits.map(e=>({label:e.title,description:e.kind?.value,edit:e})),...dp._configureDefaultAction?[dn({type:`separator`}),{label:dp._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:Z(978,`Select Paste Action`)});if(t===e){dp._configureDefaultAction?.run();return}d=t?.edit}if(!d)return;let f=bf(c.uri,n,d);await this._bulkEditService.apply(f,{editor:this._editor})}finally{l.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:Z(979,`Running paste handlers`)},()=>a)}setCopyMetadata(e,t){this._logService.trace(`CopyPasteController#setCopyMetadata new id : `,t.id),e.setData(hp,JSON.stringify(t))}fetchCopyMetadata(e){this._logService.trace(`CopyPasteController#fetchCopyMetadata`);let t=e.clipboardData.getData(hp);if(t)try{return JSON.parse(t)}catch{return}if(e.metadata)return{defaultPastePayload:{mode:e.metadata.mode,multicursorText:e.metadata.multicursorText??null,pasteOnNewLine:!!e.metadata.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,n,r){if(this._logService.trace(`CopyPasteController#mergeInDataFromCopy with metadata : `,n?.id),n?.id&&dp._currentCopyOperation?.handle===n.id){let n=dp._currentCopyOperation.operations.filter(t=>e.some(e=>e.pasteMimeTypes.some(e=>bn(e,t.providerMimeTypes)))).map(e=>e.operation),i=await Promise.all(n);if(r.isCancellationRequested)return;for(let e of i.reverse())if(e)for(let[n,r]of e)t.replace(n,r)}if(!t.has(rr.uriList)){let e=await this._clipboardService.readResources();if(r.isCancellationRequested)return;e.length&&t.append(rr.uriList,Is(Gs.create(e)))}}async getPasteEdits(e,t,n,r,i,a){let o=new j,s=await uo(Promise.all(e.map(async e=>{try{let s=await e.provideDocumentPasteEdits?.(n,r,t,i,a);return s&&o.add(s),s?.edits?.map(t=>({...t,provider:e}))}catch(e){Zt(e)||console.error(e);return}})),a);return{edits:xf(Po(s??[]).flat().filter(e=>!i.only||i.only.contains(e.kind))),dispose:()=>o.dispose()}}async applyDefaultPasteHandler(e,t,n,r){let i=await(e.get(rr.text)??e.get(`text`))?.asString()??``;if(n.isCancellationRequested)return;let a={clipboardEvent:r,text:i,pasteOnNewLine:t?.defaultPastePayload.pasteOnNewLine??!1,multicursorText:t?.defaultPastePayload.multicursorText??null,mode:null};this._logService.trace(`CopyPasteController#applyDefaultPasteHandler for id : `,t?.id),this._editor.trigger(`keyboard`,`paste`,a)}isSupportedPasteProvider(e,t,n){return e.pasteMimeTypes?.some(e=>t.matches(e))?!n||this.providerMatchesPreference(e,n):!1}providerMatchesPreference(e,t){return`only`in t?e.providedPasteEditKinds.some(e=>t.only.contains(e)):`preferences`in t?e.providedPasteEditKinds.some(e=>t.preferences.some(t=>t.contains(e))):e.id===t.providerId}getInitialActiveEditIndex(e,t){let n=this._configService.getValue(pp,{resource:e.uri});for(let e of Array.isArray(n)?n:[]){let n=new Pd(e),r=t.findIndex(e=>n.contains(e.kind));if(r>=0)return r}return 0}},dp=cp,cp.ID=`editor.contrib.copyPasteActionController`,cp);gp=dp=lp([up(1,q),up(2,Rl),up(3,es),up(4,dd),up(5,$t),up(6,ad),up(7,D),up(8,Fc),up(9,ri)],gp);var _p=`9_cutcopypaste`,vp=tl||document.queryCommandSupported&&document.queryCommandSupported(`cut`),yp=tl||document.queryCommandSupported&&document.queryCommandSupported(`copy`),bp=navigator.clipboard===void 0||$a?document.queryCommandSupported&&document.queryCommandSupported(`paste`):!0;function xp(e){return e.register(),e}var Sp=vp?xp(new pa({id:`editor.action.clipboardCutAction`,precondition:void 0,kbOpts:tl?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:A.MenubarEditMenu,group:`2_ccp`,title:Z(864,`Cu&&t`),order:1},{menuId:A.EditorContext,group:_p,title:Z(865,`Cut`),when:J.writable,order:1},{menuId:A.CommandPalette,group:``,title:Z(866,`Cut`),order:1},{menuId:A.SimpleEditorContext,group:_p,title:Z(867,`Cut`),when:J.writable,order:1}]})):void 0,Cp=yp?xp(new pa({id:`editor.action.clipboardCopyAction`,precondition:void 0,kbOpts:tl?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:A.MenubarEditMenu,group:`2_ccp`,title:Z(868,`&&Copy`),order:2},{menuId:A.EditorContext,group:_p,title:Z(869,`Copy`),order:2},{menuId:A.CommandPalette,group:``,title:Z(870,`Copy`),order:1},{menuId:A.SimpleEditorContext,group:_p,title:Z(871,`Copy`),order:2}]})):void 0;cr.appendMenuItem(A.MenubarEditMenu,{submenu:A.MenubarCopy,title:M(876,`Copy As`),group:`2_ccp`,order:3}),cr.appendMenuItem(A.EditorContext,{submenu:A.EditorContextCopy,title:M(877,`Copy As`),group:_p,order:3}),cr.appendMenuItem(A.EditorContext,{submenu:A.EditorContextShare,title:M(878,`Share`),group:`11_share`,order:-1,when:P.and(P.notEquals(`resourceScheme`,`output`),J.editorTextFocus)}),cr.appendMenuItem(A.ExplorerContext,{submenu:A.ExplorerContextShare,title:M(879,`Share`),group:`11_share`,order:-1});var wp=bp?xp(new pa({id:`editor.action.clipboardPasteAction`,precondition:void 0,kbOpts:tl?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:A.MenubarEditMenu,group:`2_ccp`,title:Z(872,`&&Paste`),order:4},{menuId:A.EditorContext,group:_p,title:Z(873,`Paste`),when:J.writable,order:4},{menuId:A.CommandPalette,group:``,title:Z(874,`Paste`),order:1},{menuId:A.SimpleEditorContext,group:_p,title:Z(875,`Paste`),when:J.writable,order:4}]})):void 0,Tp=class extends O{constructor(){super({id:`editor.action.clipboardCopyWithSyntaxHighlightingAction`,label:M(880,`Copy with Syntax Highlighting`),precondition:void 0,kbOpts:{kbExpr:J.textInputFocus,primary:0,weight:100}})}run(e,t){let n=e.get(Rl),r=e.get(dd);n.trace(`ExecCommandCopyWithSyntaxHighlightingAction#run`),t.hasModel()&&(t.getOption(45)||!t.getSelection().isEmpty())&&(Tu.forceCopyWithSyntaxHighlighting=!0,t.focus(),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)`),Ep(t,r),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)`),Tu.forceCopyWithSyntaxHighlighting=!1)}};function Ep(e,t){if(Tu.electronBugWorkaroundCopyEventHasFired=!1,e.getContainerDomNode().ownerDocument.execCommand(`copy`),tl&&Tu.electronBugWorkaroundCopyEventHasFired===!1){let{dataToCopy:n}=Ie(e._getViewModel(),void 0,$a);t.writeText(n.text)}}function Dp(e,t){e&&(e.addImplementation(1e4,`code-editor`,(e,n)=>{let r=e.get(Rl),i=e.get(dd);r.trace(`registerExecCommandImpl (addImplementation code-editor for : `,t,`)`);let a=e.get(Lc).getFocusedCodeEditor();if(a&&a.hasTextFocus()&&a.hasModel()){let e=a.getOption(45),n=a.getSelection();return n&&n.isEmpty()&&!e||(a.getOption(171)&&t===`cut`?(Op(a),r.trace(`registerExecCommandImpl (before execCommand copy)`),Ep(a,i),a.trigger(void 0,`cut`,void 0),r.trace(`registerExecCommandImpl (after execCommand copy)`)):(Op(a),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),t===`copy`?Ep(a,i):a.getContainerDomNode().ownerDocument.execCommand(t),r.trace(`registerExecCommandImpl (after execCommand `+t+`)`))),!0}return!1}),e.addImplementation(0,`generic-dom`,(e,n)=>{let r=e.get(Rl);return r.trace(`registerExecCommandImpl (addImplementation generic-dom for : `,t,`)`),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),ii().execCommand(t),r.trace(`registerExecCommandImpl (after execCommand `+t+`)`),!0}))}function Op(e){if(e.getOption(171)){let t=In.get(e.getId());t&&t.handleWillCopy()}}Dp(Sp,`cut`),Dp(Cp,`copy`),wp&&(wp.addImplementation(1e4,`code-editor`,(e,t)=>{let n=e.get(Rl);n.trace(`registerExecCommandImpl (addImplementation code-editor for : paste)`);let r=e.get(Lc),i=e.get(dd),a=r.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(171)){let e=In.get(a.getId());e&&e.handleWillPaste()}n.trace(`registerExecCommandImpl (before triggerPaste)`);let e=i.triggerPaste(Pe().vscodeWindowId);return e?(n.trace(`registerExecCommandImpl (triggerPaste defined)`),e.then(async()=>(n.trace(`registerExecCommandImpl (after triggerPaste)`),gp.get(a)?.finishedPaste()??Promise.resolve()))):(n.trace(`registerExecCommandImpl (triggerPaste undefined)`),!yc||(n.trace(`registerExecCommandImpl (Paste handling on web)`),(async()=>{let e=await i.readText();if(e!==``){let t=Xr.INSTANCE.get(e),r=!1,i=null,o=null;t&&(r=a.getOption(45)&&!!t.isFromEmptySelection,i=t.multicursorText===void 0?null:t.multicursorText,o=t.mode),n.trace(`registerExecCommandImpl (clipboardText.length : `,e.length,` id : `,t?.id,`)`),a.trigger(`keyboard`,`paste`,{text:e,pasteOnNewLine:r,multicursorText:i,mode:o})}})()))}return!1}),wp.addImplementation(0,`generic-dom`,(e,t)=>(e.get(Rl).trace(`registerExecCommandImpl (addImplementation generic-dom for : paste)`),e.get(dd).triggerPaste(Pe().vscodeWindowId)??!1))),yp&&t(Tp);var kp=new class{constructor(){this.QuickFix=new Pd(`quickfix`),this.Refactor=new Pd(`refactor`),this.RefactorExtract=this.Refactor.append(`extract`),this.RefactorInline=this.Refactor.append(`inline`),this.RefactorMove=this.Refactor.append(`move`),this.RefactorRewrite=this.Refactor.append(`rewrite`),this.Notebook=new Pd(`notebook`),this.Source=new Pd(`source`),this.SourceOrganizeImports=this.Source.append(`organizeImports`),this.SourceFixAll=this.Source.append(`fixAll`),this.SurroundWith=this.Refactor.append(`surround`)}},Ap;(function(e){e.Refactor=`refactor`,e.RefactorPreview=`refactor preview`,e.Lightbulb=`lightbulb`,e.Default=`other (default)`,e.SourceAction=`source action`,e.QuickFix=`quick fix action`,e.FixAll=`fix all`,e.OrganizeImports=`organize imports`,e.AutoFix=`auto fix`,e.QuickFixHover=`quick fix hover window`,e.OnSave=`save participants`,e.ProblemsView=`problems view`})(Ap||={});function jp(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some(n=>Np(t,n,e.include))||!e.includeSourceActions&&kp.Source.contains(t))}function Mp(e,t){let n=t.kind?new Pd(t.kind):void 0;return!(e.include&&(!n||!e.include.contains(n))||e.excludes&&n&&e.excludes.some(t=>Np(n,t,e.include))||!e.includeSourceActions&&n&&kp.Source.contains(n)||e.onlyIncludePreferredActions&&!t.isPreferred)}function Np(e,t,n){return!(!t.contains(e)||n&&t.contains(n))}var Pp=class e{static fromUser(t,n){return!t||typeof t!=`object`?new e(n.kind,n.apply,!1):new e(e.getKindFromUser(t,n.kind),e.getApplyFromUser(t,n.apply),e.getPreferredUser(t))}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 Pd(e.kind):t}static getPreferredUser(e){return typeof e.preferred==`boolean`&&e.preferred}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}},Fp=class{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){if(this.provider?.resolveCodeAction&&!this.action.edit){let t;try{t=await this.provider.resolveCodeAction(this.action,e)}catch(e){Vt(e)}t&&(this.action.edit=t.edit)}return this}},Ip=`editor.action.codeAction`,Lp=`editor.action.quickFix`,Rp=`editor.action.autoFix`,zp=`editor.action.refactor`,Bp=`editor.action.sourceAction`,Vp=`editor.action.organizeImports`,Hp=`editor.action.fixAll`,Up=1e3,Wp=class e extends L{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:t},{action:n}){return t.isAI&&!n.isAI?1:!t.isAI&&n.isAI?-1:Fl(t.diagnostics)?Fl(n.diagnostics)?e.codeActionsPreferredComparator(t,n):-1:Fl(n.diagnostics)?1:e.codeActionsPreferredComparator(t,n)}constructor(t,n,r){super(),this.documentation=n,this._register(r),this.allActions=[...t].sort(e.codeActionsComparator),this.validActions=this.allActions.filter(({action:e})=>!e.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&kp.QuickFix.contains(new Pd(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}},Gp={actions:[],documentation:void 0};async function Kp(e,t,n,r,i,a){let o=r.filter||{},s={...o,excludes:[...o.excludes||[],kp.Notebook]},c={only:o.include?.value,trigger:r.type},l=new oo(t,a),u=qp(e,t,r.type===2?s:o),d=new j,f=u.map(async e=>{let r=setTimeout(()=>i.report(e),1250);try{let r=await e.provideCodeActions(t,n,c,l.token);if(l.token.isCancellationRequested)return r?.dispose(),Gp;r&&d.add(r);let i=(r?.actions||[]).filter(e=>e&&Mp(o,e)),a=Yp(e,i,o.include);return{actions:i.map(t=>new Fp(t,e)),documentation:a}}catch(e){if(Zt(e))throw e;return Vt(e),Gp}finally{clearTimeout(r)}}),p=e.onDidChange(()=>{let n=e.all(t);ks(n,u)||l.cancel()});try{let n=await Promise.all(f),i=n.map(e=>e.actions).flat(),a=new Wp(i,[...Po(n.map(e=>e.documentation)),...Jp(e,t,r,i)],d);return d.add(a),a}catch(e){throw d.dispose(),e}finally{p.dispose(),l.dispose()}}function qp(e,t,n){return e.all(t).filter(e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some(e=>jp(n,new Pd(e))))}function*Jp(e,t,n,r){if(t&&r.length)for(let i of e.all(t))i._getAdditionalMenuItems&&(yield*i._getAdditionalMenuItems?.({trigger:n.type,only:n.filter?.include?.value},r.map(e=>e.action)))}function Yp(e,t,n){if(!e.documentation)return;let r=e.documentation.map(e=>({kind:new Pd(e.kind),command:e.command}));if(n){let e;for(let t of r)t.kind.contains(n)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return e?.command}for(let e of t)if(e.kind){for(let t of r)if(t.kind.contains(new Pd(e.kind)))return t.command}}var Xp;(function(e){e.OnSave=`onSave`,e.FromProblemsView=`fromProblemsView`,e.FromCodeActions=`fromCodeActions`,e.FromAILightbulb=`fromAILightbulb`,e.FromProblemsHover=`fromProblemsHover`})(Xp||={});async function Zp(e,t,n,r,i=w.None){let a=e.get(es),o=e.get($t),s=e.get(Xs),c=e.get(ce),l=e.get(bt);if(s.publicLog2(`codeAction.applyCodeAction`,{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:n}),l.playSignal(Ci.codeActionTriggered),await t.resolve(i),!i.isCancellationRequested&&(!t.action.edit?.edits.length||(await a.apply(t.action.edit,{editor:r?.editor,label:t.action.title,quotableLabel:t.action.title,code:`undoredo.codeAction`,respectAutoSaveConfig:n!==Xp.OnSave,showPreview:r?.preview,reason:ye.codeAction({kind:t.action.kind,providerId:Ms.fromExtensionId(t.provider?.extensionId)})})).isApplied)){if(t.action.command)try{await o.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(e){let t=Qp(e);c.error(typeof t==`string`?t:Z(881,`An unknown error occurred while applying the code action`))}setTimeout(()=>l.playSignal(Ci.codeActionApplied),Up)}}function Qp(e){if(typeof e==`string`)return e;if(e instanceof Error&&typeof e.message==`string`)return e.message}ct.registerCommand(`_executeCodeActionProvider`,async function(e,t,n,r,i){if(!(t instanceof bu))throw Mi();let{codeActionProvider:a}=e.get(D),o=e.get(eu).getModel(t);if(!o)throw Mi();let s=U.isISelection(n)?U.liftSelection(n):H.isIRange(n)?o.validateRange(n):void 0;if(!s)throw Mi();let c=typeof r==`string`?new Pd(r):void 0,l=await Kp(a,o,s,{type:1,triggerAction:Ap.Default,filter:{includeSourceActions:!0,include:c}},We.None,w.None),u=[],d=Math.min(l.validActions.length,typeof i==`number`?i:0);for(let e=0;e<d;e++)u.push(l.validActions[e].resolve(w.None));try{return await Promise.all(u),l.validActions.map(e=>e.action)}finally{setTimeout(()=>l.dispose(),100)}});var $p,em=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},tm=function(e,t){return function(n,r){t(n,r,e)}},nm,rm=($p=class{constructor(e){this.keybindingService=e}getResolver(){let e=new Hi(()=>this.keybindingService.getKeybindings().filter(e=>nm.codeActionCommands.indexOf(e.command)>=0).filter(e=>e.resolvedKeybinding).map(e=>{let t=e.commandArgs;return e.command===`editor.action.organizeImports`?t={kind:kp.SourceOrganizeImports.value}:e.command===`editor.action.fixAll`&&(t={kind:kp.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...Pp.fromUser(t,{kind:Pd.None,apply:`never`})}}));return t=>{if(t.kind)return this.bestKeybindingForCodeAction(t,e.value)?.resolvedKeybinding}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;let n=new Pd(e.kind);return t.filter(e=>e.kind.contains(n)).filter(t=>!t.preferred||e.isPreferred).reduceRight((e,t)=>e?e.kind.contains(t.kind)?t:e:t,void 0)}},nm=$p,$p.codeActionCommands=[zp,Ip,Bp,Vp,Hp],$p);rm=nm=em([tm(0,sr)],rm),X(`symbolIcon.arrayForeground`,Ja,Z(1569,`The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.booleanForeground`,Ja,Z(1570,`The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.classForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},Z(1571,`The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.colorForeground`,Ja,Z(1572,`The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.constantForeground`,Ja,Z(1573,`The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.constructorForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},Z(1574,`The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.enumeratorForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},Z(1575,`The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.enumeratorMemberForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},Z(1576,`The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.eventForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},Z(1577,`The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.fieldForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},Z(1578,`The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.fileForeground`,Ja,Z(1579,`The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.folderForeground`,Ja,Z(1580,`The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.functionForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},Z(1581,`The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.interfaceForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},Z(1582,`The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.keyForeground`,Ja,Z(1583,`The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.keywordForeground`,Ja,Z(1584,`The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.methodForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},Z(1585,`The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.moduleForeground`,Ja,Z(1586,`The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.namespaceForeground`,Ja,Z(1587,`The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.nullForeground`,Ja,Z(1588,`The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.numberForeground`,Ja,Z(1589,`The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.objectForeground`,Ja,Z(1590,`The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.operatorForeground`,Ja,Z(1591,`The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.packageForeground`,Ja,Z(1592,`The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.propertyForeground`,Ja,Z(1593,`The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.referenceForeground`,Ja,Z(1594,`The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.snippetForeground`,Ja,Z(1595,`The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.stringForeground`,Ja,Z(1596,`The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.structForeground`,Ja,Z(1597,`The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.textForeground`,Ja,Z(1598,`The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.typeParameterForeground`,Ja,Z(1599,`The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.unitForeground`,Ja,Z(1600,`The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),X(`symbolIcon.variableForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},Z(1601,`The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`));var im=Object.freeze({kind:Pd.Empty,title:Z(917,`More Actions...`)}),am=Object.freeze([{kind:kp.QuickFix,title:Z(918,`Quick Fix`)},{kind:kp.RefactorExtract,title:Z(919,`Extract`),icon:G.wrench},{kind:kp.RefactorInline,title:Z(920,`Inline`),icon:G.wrench},{kind:kp.RefactorRewrite,title:Z(921,`Rewrite`),icon:G.wrench},{kind:kp.RefactorMove,title:Z(922,`Move`),icon:G.wrench},{kind:kp.SurroundWith,title:Z(923,`Surround With`),icon:G.surroundWith},{kind:kp.Source,title:Z(924,`Source Action`),icon:G.symbolFile},im]);function om(e,t,n){if(!t)return e.map(e=>({kind:`action`,item:e,group:im,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!e.action.edit?.edits.length}));let r=am.map(e=>({group:e,actions:[]}));for(let t of e){let e=t.action.kind?new Pd(t.action.kind):Pd.None;for(let n of r)if(n.group.kind.contains(e)){n.actions.push(t);break}}let i=[];for(let e of r)if(e.actions.length){i.push({kind:`header`,group:e.group});for(let t of e.actions){let r=e.group;i.push({kind:`action`,item:t,group:t.action.isAI?{title:r.title,kind:r.kind,icon:G.sparkle}:r,label:t.action.title,disabled:!!t.action.disabled,keybinding:n(t.action)})}}return i}var sm=new N(`supportedCodeAction`,``),cm=class extends L{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new xl),this.ignoreLightbulbOff=!1,this._register(this._markerService.onMarkerChanged(e=>this._onMarkerChanges(e))),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(e=>$u(e,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Ap.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;let t=this._editor.getSelection();if(e.type===1)return t;let n=this._editor.getOption(73).enabled;if(n!==lr.Off||this.ignoreLightbulbOff){if(n===lr.Off||n===lr.On)return t;if(n===lr.OnCode){if(!t.isEmpty())return t;let e=this._editor.getModel(),{lineNumber:n,column:r}=t.getPosition(),i=e.getLineContent(n);if(i.length===0)return;if(r===1){if(/\s/.test(i[0]))return}else if(r===e.getLineMaxColumn(n)){if(/\s/.test(i[i.length-1]))return}else if(/\s/.test(i[r-2])&&/\s/.test(i[r-1]))return}return t}}},lm;(function(e){e.Empty={type:0};class t{constructor(e,t,n){this.trigger=e,this.position=t,this._cancellablePromise=n,this.type=1,this.actions=n.catch(e=>{if(Zt(e))return um;throw e})}cancel(){this._cancellablePromise.cancel()}}e.Triggered=t})(lm||={});var um=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1}),dm=class extends L{constructor(e,t,n,r,a,o){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=a,this._configurationService=o,this._codeActionOracle=this._register(new i),this._state=lm.Empty,this._onDidChangeState=this._register(new F),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new i),this._disposed=!1,this._ignoreLightbulbOff=!1,this._supportedCodeActions=sm.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(lm.Empty,!0))}_settingEnabledNearbyQuickfixes(){let e=this._editor?.getModel();return this._configurationService?this._configurationService.getValue(`editor.codeActionWidget.includeNearbyQuickFixes`,{resource:e?.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(lm.Empty),this.codeActionsDisposable.clear();let e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){let t=this._registry.all(e).flatMap(e=>e.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(` `));let n=new cm(this._editor,this._markerService,t=>{if(!t){this.setState(lm.Empty);return}let n=t.selection.getStartPosition(),r=za(async n=>{if(this._settingEnabledNearbyQuickfixes()&&t.trigger.type===1&&(t.trigger.triggerAction===Ap.QuickFix||t.trigger.filter?.include?.contains(kp.QuickFix))){let r=new j,i=!1;try{let a=r.add(await Kp(this._registry,e,t.selection,t.trigger,We.None,n)),o=[...a.allActions];if(n.isCancellationRequested)return um;let s=a.validActions?.some(e=>e.action.kind&&kp.QuickFix.contains(new Pd(e.action.kind))&&!e.action.isAI),c=this._markerService.read({resource:e.uri});if(s){for(let e of a.validActions)e.action.command?.arguments?.some(e=>typeof e==`string`&&e.includes(`_typescript.applyFixAllCodeAction`))&&(e.action.diagnostics=[...c.filter(e=>e.relatedInformation)]);let e=this._setCodeActions({validActions:a.validActions,allActions:o,documentation:a.documentation,hasAutoFix:a.hasAutoFix,hasAIFix:a.hasAIFix,allAIFixes:a.allAIFixes,dispose:()=>r.dispose()});return i=!0,e}if(!s&&c.length>0){let s=t.selection.getPosition(),l=s,u=Number.MAX_VALUE,d=[...a.validActions];for(let i of c){let f=i.endColumn,p=i.endLineNumber,m=i.startLineNumber;if(p===s.lineNumber||m===s.lineNumber){l=new R(p,f);let i={type:t.trigger.type,triggerAction:t.trigger.triggerAction,filter:{include:t.trigger.filter?.include?t.trigger.filter?.include:kp.QuickFix},autoApply:t.trigger.autoApply,context:{notAvailableMessage:t.trigger.context?.notAvailableMessage||``,position:l}},m=new U(l.lineNumber,l.column,l.lineNumber,l.column),h=r.add(await Kp(this._registry,e,m,i,We.None,n));if(n.isCancellationRequested)return um;if(h.validActions.length!==0){for(let e of h.validActions)e.action.command?.arguments?.some(e=>typeof e==`string`&&e.includes(`_typescript.applyFixAllCodeAction`))&&(e.action.diagnostics=[...c.filter(e=>e.relatedInformation)]);a.allActions.length===0&&o.push(...h.allActions),Math.abs(s.column-f)<u?d.unshift(...h.validActions):d.push(...h.validActions)}u=Math.abs(s.column-f)}}let f=d.filter((e,t,n)=>n.findIndex(t=>t.action.title===e.action.title)===t);f.sort((e,t)=>e.action.isPreferred&&!t.action.isPreferred?-1:!e.action.isPreferred&&t.action.isPreferred||e.action.isAI&&!t.action.isAI?1:!e.action.isAI&&t.action.isAI?-1:0);let p=this._setCodeActions({validActions:f,allActions:o,documentation:a.documentation,hasAutoFix:a.hasAutoFix,hasAIFix:a.hasAIFix,allAIFixes:a.allAIFixes,dispose:()=>r.dispose()});return i=!0,p}}finally{i||r.dispose()}}if(t.trigger.type===1){let r=await Kp(this._registry,e,t.selection,t.trigger,We.None,n);return n.isCancellationRequested?(r.dispose(),um):this._setCodeActions(r)}let r=await Kp(this._registry,e,t.selection,t.trigger,We.None,n);return n.isCancellationRequested?(r.dispose(),um):this._setCodeActions(r)});t.trigger.type===1&&this._progressService?.showWhile(r,250);let i=new lm.Triggered(t.trigger,n,r),a=!1;this._state.type===1&&(a=this._state.trigger.type===1&&i.type===1&&i.trigger.type===2&&this._state.position!==i.position),a?setTimeout(()=>{this.setState(i)},500):this.setState(i)},void 0);n.ignoreLightbulbOff=this._ignoreLightbulbOff,this._codeActionOracle.value=n,this._codeActionOracle.value.trigger({type:2,triggerAction:Ap.Default})}else this._supportedCodeActions.reset()}_setCodeActions(e){return this.codeActionsDisposable.value=e,e}takeCodeActions(e){if(this.codeActionsDisposable.value===e)return this.codeActionsDisposable.clearAndLeak(),e}trigger(e){this._codeActionOracle.value?.trigger(e),this.codeActionsDisposable.clear()}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}},fm,pm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},mm=function(e,t){return function(n,r){t(n,r,e)}},hm,gm=Tr(`gutter-lightbulb`,G.lightBulb,Z(925,`Icon which spawns code actions menu from the gutter when there is no space in the editor.`)),_m=Tr(`gutter-lightbulb-auto-fix`,G.lightbulbAutofix,Z(926,`Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.`)),vm=Tr(`gutter-lightbulb-sparkle`,G.lightbulbSparkle,Z(927,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.`)),ym=Tr(`gutter-lightbulb-aifix-auto-fix`,G.lightbulbSparkleAutofix,Z(928,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.`)),bm=Tr(`gutter-lightbulb-sparkle-filled`,G.sparkleFilled,Z(929,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.`)),xm;(function(e){e.Hidden={type:0};class t{constructor(e,t,n,r){this.actions=e,this.trigger=t,this.editorPosition=n,this.widgetPosition=r,this.type=1}}e.Showing=t})(xm||={});function Sm(e,t,n,r,i=!1){if(e.validActions.length<=0)return;let a,o=!1;e.allAIFixes?(a=i?bm:G.sparkleFilled,e.validActions.length===1&&(o=!0)):a=e.hasAutoFix?e.hasAIFix?i?ym:G.lightbulbSparkleAutofix:i?_m:G.lightbulbAutofix:e.hasAIFix?i?vm:G.lightbulbSparkle:i?gm:G.lightBulb;let s;return s=o?Z(930,`Run: {0}`,e.validActions[0].action.title):e.hasAutoFix&&n?Z(931,`Show Code Actions. Preferred Quick Fix Available ({0})`,n):!e.hasAutoFix&&r?Z(932,`Show Code Actions ({0})`,r):Z(933,`Show Code Actions`),{actions:e,trigger:t,icon:a,autoRun:o,title:s,isGutter:i}}var Cm=(fm=class extends L{static _computeLightBulbInfo(e,t,n,r){if(e.type===1)return Sm(e.actions,e.trigger,n,r,t)}constructor(e,t){super(),this._editor=e,this._keybindingService=t,this.onlyWithEmptySelection=!1,this._onClick=this._register(new F),this.onClick=this._onClick.event,this._state=gu(this,xm.Hidden),this._gutterState=gu(this,xm.Hidden),this._combinedInfo=C(this,e=>{let t=this._gutterState.read(e);if(t.type===1)return hm._computeLightBulbInfo(t,!0,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e));let n=this._state.read(e);if(n.type===1)return hm._computeLightBulbInfo(n,!1,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e))}),this._iconClasses=[],this.lightbulbClasses=[`codicon-`+gm.id,`codicon-`+ym.id,`codicon-`+_m.id,`codicon-`+vm.id,`codicon-`+bm.id],this._preferredKbLabel=gu(this,void 0),this._quickFixKbLabel=gu(this,void 0),this.gutterDecoration=hm.GUTTER_DECORATION,this._domNode=W(`div.lightBulbWidget`),this._domNode.role=`listbox`,this._register(oi.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(e=>{let t=this._editor.getModel(),n=this._state.get();(n.type!==1||!t||n.editorPosition.lineNumber>=t.getLineCount())&&this.hide();let r=this._gutterState.get();(r.type!==1||!t||r.editorPosition.lineNumber>=t.getLineCount())&&this.gutterHide()})),this._register(qu(this._domNode,e=>{let t=this._state.get();if(t.type!==1)return;this._editor.focus(),e.preventDefault();let{top:n,height:r}=re(this._domNode),i=this._editor.getOption(75),a=Math.floor(i/3);t.widgetPosition.position!==null&&t.widgetPosition.position.lineNumber<t.editorPosition.lineNumber&&(a+=i),this._onClick.fire({x:e.posx,y:n+r+a,actions:t.actions,trigger:t.trigger})})),this._register(z(this._domNode,`mouseenter`,e=>{(e.buttons&1)==1&&this.hide()})),this._register(lt.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.autoFix`)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.quickFix`)?.getLabel()??void 0,void 0)})),this._register(x(e=>{let t=this._combinedInfo.read(e);this._updateLightBulbTitleAndIcon(t),this._updateGutterDecorationOptions(t)})),this._register(this._editor.onMouseDown(async e=>{if(!e.target.element||!this.lightbulbClasses.some(t=>e.target.element&&e.target.element.classList.contains(t)))return;let t=this._gutterState.get();if(t.type!==1)return;this._editor.focus();let{top:n,height:r}=re(e.target.element),i=this._editor.getOption(75),a=Math.floor(i/3);t.widgetPosition.position!==null&&t.widgetPosition.position.lineNumber<t.editorPosition.lineNumber&&(a+=i),this._onClick.fire({x:e.event.posx,y:n+r+a,actions:t.actions,trigger:t.trigger})}))}dispose(){super.dispose(),this._editor.removeContentWidget(this),this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID)}getId(){return`LightBulbWidget`}getDomNode(){return this._domNode}getPosition(){let e=this._state.get();return e.type===1?e.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0||this.onlyWithEmptySelection&&!this._editor.getSelection()?.isEmpty()||!this._editor.hasTextFocus()||this._editor.getOptions().get(73).enabled===lr.Off)return this.gutterHide(),this.hide();let r=this._editor.getModel();if(!r)return this.gutterHide(),this.hide();let{lineNumber:i,column:a}=r.validatePosition(n),o=r.getOptions().tabSize,s=this._editor.getOptions().get(59),c=r.getLineContent(i),l=ia(c,o),u=s.spaceWidth*l>22,d=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1),f=this._editor.getLineDecorations(i),p=!1;if(f)for(let e of f){let t=e.options.glyphMarginClassName;if(t&&!this.lightbulbClasses.some(e=>t.includes(e))){p=!0;break}}let m=i,h=1;if(!u){let o=e=>{let t=r.getLineContent(e);return/^\s*$|^\s+/.test(t)||t.length<=h};if(i>1&&!d(i-1)){let a=i===r.getLineCount(),s=i>1&&o(i-1),c=!a&&o(i+1),l=o(i),u=!c&&!s;if(!c&&!s&&!p)return this._gutterState.set(new xm.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:hm._posPref}),void 0),this.renderGutterLightbub(),this.hide();s||a||s&&!l?--m:(c||u&&l)&&(m+=1)}else if(i===1&&(i===r.getLineCount()||!o(i+1)&&!o(i))){if(this._gutterState.set(new xm.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:hm._posPref}),void 0),p)this.gutterHide();else return this.renderGutterLightbub(),this.hide()}else if(i<r.getLineCount()&&!d(i+1))m+=1;else if(a*s.spaceWidth<22)return this.hide();h=/^\S\s*$/.test(r.getLineContent(m))?2:1}this._state.set(new xm.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:hm._posPref}),void 0),this._gutterDecorationID&&(this._removeGutterDecoration(this._gutterDecorationID),this.gutterHide());let g=e.validActions,_=e.validActions[0].action.kind;if(g.length!==1||!_){this._editor.layoutContentWidget(this);return}this._editor.layoutContentWidget(this)}hide(){this._state.get()!==xm.Hidden&&(this._state.set(xm.Hidden,void 0),this._editor.layoutContentWidget(this))}gutterHide(){this._gutterState.get()!==xm.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this._gutterState.set(xm.Hidden,void 0))}_updateLightBulbTitleAndIcon(e){this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],e&&!e.isGutter&&(this._domNode.title=e.title,this._iconClasses=K.asClassNameArray(e.icon),this._domNode.classList.add(...this._iconClasses))}_updateGutterDecorationOptions(e){e&&e.isGutter&&(this.gutterDecoration=B.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:K.asClassName(e.icon),glyphMargin:{position:Da.Left},stickiness:1}))}renderGutterLightbub(){let e=this._editor.getSelection();e&&(this._gutterDecorationID===void 0?this._addGutterDecoration(e.startLineNumber):this._updateGutterDecoration(this._gutterDecorationID,e.startLineNumber))}_addGutterDecoration(e){this._editor.changeDecorations(t=>{this._gutterDecorationID=t.addDecoration(new H(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(n=>{n.changeDecoration(e,new H(t,0,t,0)),n.changeDecorationOptions(e,this.gutterDecoration)})}},hm=fm,fm.GUTTER_DECORATION=B.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:K.asClassName(G.lightBulb),glyphMargin:{position:Da.Left},stickiness:1}),fm.ID=`editor.contrib.lightbulbWidget`,fm._posPref=[0],fm);Cm=hm=pm([mm(1,sr)],Cm);var wm,Tm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Em=function(e,t){return function(n,r){t(n,r,e)}},Dm,Om=(wm=class extends L{static get(e){return e.getContribution(Dm.ID)}constructor(e,t,n,r,a,o,s,c,l,u,d,f){super(),this._commandService=s,this._configurationService=c,this._actionWidgetService=l,this._instantiationService=u,this._progressService=d,this._keybindingService=f,this._activeCodeActions=this._register(new i),this._showDisabled=!1,this._disposed=!1,this._onlyLightBulbWithEmptySelection=!1,this._lightBulbInfoObs=gu(this,void 0),this._preferredKbLabel=gu(this,void 0),this._quickFixKbLabel=gu(this,void 0),this._editor=e,this._model=this._register(new dm(this._editor,a.codeActionProvider,t,n,o,c)),this._register(this._model.onDidChangeState(e=>this.update(e))),this._register(lt.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{this._preferredKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.autoFix`)?.getLabel()??void 0,void 0),this._quickFixKbLabel.set(this._keybindingService.lookupKeybinding(`editor.action.quickFix`)?.getLabel()??void 0,void 0)})),this._lightBulbWidget=new Hi(()=>{let e=this._editor.getContribution(Cm.ID);return e&&(this._register(e.onClick(e=>this.showCodeActionsFromLightbulb(e.actions,e))),e.onlyWithEmptySelection=this._onlyLightBulbWithEmptySelection),e}),this._resolver=r.createInstance(rm),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){let t=e.validActions[0],n=t.action.command;n&&n.id===`inlineChat.start`&&n.arguments&&n.arguments.length>=1&&n.arguments[0]&&(n.arguments[0]={...n.arguments[0],autoSend:!1}),await this.applyCodeAction(t,!1,!1,Xp.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,r){if(!this._editor.hasModel())return;Gd.get(this._editor)?.closeMessage();let i=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:r,context:{notAvailableMessage:e,position:i}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,n,r){let i=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(Zp,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Ap.QuickFix,filter:{}}),i.done()}}hideLightBulbWidget(){this._lightBulbWidget.rawValue?.hide(),this._lightBulbWidget.rawValue?.gutterHide()}async update(e){if(e.type!==1){this.hideLightBulbWidget(),this._lightBulbInfoObs.set(void 0,void 0);return}let t;try{t=this._model.takeCodeActions(await e.actions)}catch(e){fl(e);return}if(t){if(this._disposed){t.dispose();return}if(this._editor.getSelection()?.startLineNumber!==e.position.lineNumber){t.dispose();return}if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),this._lightBulbInfoObs.set(Sm(t,e.trigger,this._preferredKbLabel.get(),this._quickFixKbLabel.get()),void 0),e.trigger.type===1){if(e.trigger.filter?.include){let n=this.tryGetValidActionToApply(e.trigger,t);if(n){try{this.hideLightBulbWidget(),await this.applyCodeAction(n,!1,!1,Xp.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){let n=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(n&&n.action.disabled){Gd.get(this._editor)?.showMessage(n.action.disabled,e.trigger.context.position),t.dispose();return}}}let n=!!e.trigger.filter?.include;if(e.trigger.context&&(!t.allActions.length||!n&&!t.validActions.length)){Gd.get(this._editor)?.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:n,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}}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:e})=>e.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,n){let r=this._editor.createDecorationsCollection(),i=this._editor.getDomNode();if(!i)return;let a=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!a.length)return;let o=R.isIPosition(t)?this.toCoords(t):t;this._actionWidgetService.show(`codeActionWidget`,!0,om(a,this._shouldShowHeaders(),this._resolver.getResolver()),{onSelect:async(e,t)=>{this.applyCodeAction(e,!0,!!t,n.fromLightbulb?Xp.FromAILightbulb:Xp.FromCodeActions),this._actionWidgetService.hide(!1),r.clear()},onHide:e=>{this._editor?.focus(),r.clear()},onHover:async(e,t)=>{if(t.isCancellationRequested)return;let n=!1,r=e.action.kind;if(r){let e=new Pd(r);n=[kp.RefactorExtract,kp.RefactorInline,kp.RefactorRewrite,kp.RefactorMove,kp.Source].some(t=>t.contains(e))}return{canPreview:n||!!e.action.edit?.edits.length}},onFocus:e=>{if(e&&e.action){let t=e.action.ranges,n=e.action.diagnostics;if(r.clear(),t&&t.length>0){let e=n&&n?.length>1?n.map(e=>({range:e,options:Dm.DECORATION})):t.map(e=>({range:e,options:Dm.DECORATION}));r.set(e)}else if(n&&n.length>0){let e=n.map(e=>({range:e,options:Dm.DECORATION}));r.set(e);let t=n[0];if(t.startLineNumber&&t.startColumn){let e=this._editor.getModel()?.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn})?.word;ni(Z(914,`Context: {0} at line {1} and column {2}.`,e,t.startLineNumber,t.startColumn))}}}else r.clear()}},o,i,this._getActionBarActions(e,t,n))}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),n=re(this._editor.getDomNode());return{x:n.left+t.left,y:n.top+t.top+t.height}}_shouldShowHeaders(){let e=this._editor?.getModel();return this._configurationService.getValue(`editor.codeActionWidget.showHeaders`,{resource:e?.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];let r=e.documentation.map(e=>({id:e.id,label:e.title,tooltip:e.tooltip??``,class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(e.id,...e.arguments??[])}));return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:`hideMoreActions`,label:Z(915,`Hide Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:`showMoreActions`,label:Z(916,`Show Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}},Dm=wm,wm.ID=`editor.contrib.codeActionController`,wm.DECORATION=B.register({description:`quickfix-highlight`,className:`quickfix-edit-highlight`}),wm);Om=Dm=Tm([Em(1,$n),Em(2,E),Em(3,q),Em(4,D),Em(5,Fu),Em(6,$t),Em(7,ad),Em(8,$f),Em(9,q),Em(10,Fu),Em(11,sr)],Om),Ts((e,t)=>{((e,n)=>{n&&t.addRule(`.monaco-editor ${e} { background-color: ${n}; }`)})(`.quickfix-edit-highlight`,e.getColor($s));let n=e.getColor(b);n&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${zt(e.type)?`dotted`:`solid`} ${n}; box-sizing: border-box; }`)});function km(e){return P.regex(sm.keys()[0],RegExp(`(\\s|^)`+Pn(e.value)+`\\b`))}var Am={type:`object`,defaultSnippets:[{body:{kind:``}}],properties:{kind:{type:`string`,description:Z(882,`Kind of the code action to run.`)},apply:{type:`string`,description:Z(883,`Controls when the returned actions are applied.`),default:`ifSingle`,enum:[`first`,`ifSingle`,`never`],enumDescriptions:[Z(884,`Always apply the first returned code action.`),Z(885,`Apply the first returned code action if it is the only one.`),Z(886,`Do not apply the returned code actions.`)]},preferred:{type:`boolean`,default:!1,description:Z(887,`Controls if only preferred code actions should be returned.`)}}};function jm(e,t,n,r,i=Ap.Default){e.hasModel()&&Om.get(e)?.manualTriggerAtCurrentPosition(t,i,n,r)}var Mm=class extends ea{constructor(){super({id:Lp,title:M(904,`Quick Fix...`),precondition:P.and(J.writable,J.hasCodeActionsProvider),icon:G.lightBulb,f1:!0,keybinding:{when:J.textInputFocus,primary:2137,weight:100},menu:{id:A.InlineChatEditorAffordance,group:`1_quickfix`,order:0,when:P.and(J.writable,J.hasCodeActionsProvider)}})}runEditorCommand(e,t){return jm(t,Z(888,`No code actions available`),void 0,void 0,Ap.QuickFix)}},Nm=class extends Bi{constructor(){super({id:Ip,precondition:P.and(J.writable,J.hasCodeActionsProvider),metadata:{description:`Trigger a code action`,args:[{name:`args`,schema:Am}]}})}runEditorCommand(e,t,n){let r=Pp.fromUser(n,{kind:Pd.Empty,apply:`ifSingle`});return jm(t,typeof n?.kind==`string`?r.preferred?Z(889,`No preferred code actions for '{0}' available`,n.kind):Z(890,`No code actions for '{0}' available`,n.kind):r.preferred?Z(891,`No preferred code actions available`):Z(892,`No code actions available`),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}},Pm=class extends O{constructor(){super({id:zp,label:M(905,`Refactor...`),precondition:P.and(J.writable,J.hasCodeActionsProvider),kbOpts:{kbExpr:J.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:`1_modification`,order:2,when:P.and(J.writable,km(kp.Refactor))},metadata:{description:`Refactor...`,args:[{name:`args`,schema:Am}]}})}run(e,t,n){let r=Pp.fromUser(n,{kind:kp.Refactor,apply:`never`});return jm(t,typeof n?.kind==`string`?r.preferred?Z(893,`No preferred refactorings for '{0}' available`,n.kind):Z(894,`No refactorings for '{0}' available`,n.kind):r.preferred?Z(895,`No preferred refactorings available`):Z(896,`No refactorings available`),{include:kp.Refactor.contains(r.kind)?r.kind:Pd.None,onlyIncludePreferredActions:r.preferred},r.apply,Ap.Refactor)}},Fm=class extends O{constructor(){super({id:Bp,label:M(906,`Source Action...`),precondition:P.and(J.writable,J.hasCodeActionsProvider),contextMenuOpts:{group:`1_modification`,order:2.1,when:P.and(J.writable,km(kp.Source))},metadata:{description:`Source Action...`,args:[{name:`args`,schema:Am}]}})}run(e,t,n){let r=Pp.fromUser(n,{kind:kp.Source,apply:`never`});return jm(t,typeof n?.kind==`string`?r.preferred?Z(897,`No preferred source actions for '{0}' available`,n.kind):Z(898,`No source actions for '{0}' available`,n.kind):r.preferred?Z(899,`No preferred source actions available`):Z(900,`No source actions available`),{include:kp.Source.contains(r.kind)?r.kind:Pd.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Ap.SourceAction)}},Im=class extends O{constructor(){super({id:Vp,label:M(907,`Organize Imports`),precondition:P.and(J.writable,km(kp.SourceOrganizeImports)),kbOpts:{kbExpr:J.textInputFocus,primary:1581,weight:100},metadata:{description:M(908,`Organize imports in the current file. Also called 'Optimize Imports' by some tools`)}})}run(e,t){return jm(t,Z(901,`No organize imports action available`),{include:kp.SourceOrganizeImports,includeSourceActions:!0},`ifSingle`,Ap.OrganizeImports)}},Lm=class extends O{constructor(){super({id:Hp,label:M(909,`Fix All`),precondition:P.and(J.writable,km(kp.SourceFixAll))})}run(e,t){return jm(t,Z(902,`No fix all action available`),{include:kp.SourceFixAll,includeSourceActions:!0},`ifSingle`,Ap.FixAll)}},Rm=class extends O{constructor(){super({id:Rp,label:M(910,`Auto Fix...`),precondition:P.and(J.writable,km(kp.QuickFix)),kbOpts:{kbExpr:J.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return jm(t,Z(903,`No auto fixes available`),{include:kp.QuickFix,onlyIncludePreferredActions:!0},`ifSingle`,Ap.AutoFix)}};Y(Om.ID,Om,3),Y(Cm.ID,Cm,4),k(Mm),t(Pm),t(Fm),t(Im),t(Rm),t(Lm),V(new Nm),ud.as(m.Configuration).registerConfiguration({...Ul,properties:{"editor.codeActionWidget.showHeaders":{type:`boolean`,scope:6,description:Z(911,`Enable/disable showing group headers in the Code Action menu.`),default:!0}}}),ud.as(m.Configuration).registerConfiguration({...Ul,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:`boolean`,scope:6,description:Z(912,`Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic.`),default:!0}}}),ud.as(m.Configuration).registerConfiguration({...Ul,properties:{"editor.codeActions.triggerOnFocusChange":{type:`boolean`,scope:6,markdownDescription:Z(913,`Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.`,"`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});var zm,Bm=class{constructor(){this.lenses=[]}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){As(e)&&(this._store??=new j,this._store.add(e));for(let n of e.lenses)this.lenses.push({symbol:n,provider:t})}};zm=Bm,zm.Empty=new zm;async function Vm(e,t,n){let r=e.ordered(t),i=new Map,a=new Bm,o=r.map(async(e,r)=>{i.set(e,r);try{let r=await Promise.resolve(e.provideCodeLenses(t,n));r&&a.add(r,e)}catch(e){Vt(e)}});return await Promise.all(o),n.isCancellationRequested?(a.dispose(),Bm.Empty):(a.lenses=a.lenses.sort((e,t)=>e.symbol.range.startLineNumber<t.symbol.range.startLineNumber?-1:e.symbol.range.startLineNumber>t.symbol.range.startLineNumber?1:i.get(e.provider)<i.get(t.provider)?-1:i.get(e.provider)>i.get(t.provider)?1:e.symbol.range.startColumn<t.symbol.range.startColumn?-1:+(e.symbol.range.startColumn>t.symbol.range.startColumn)),a)}ct.registerCommand(`_executeCodeLensProvider`,function(e,...t){let[n,r]=t;Ys(bu.isUri(n)),Ys(typeof r==`number`||!r);let{codeLensProvider:i}=e.get(D),a=e.get(eu).getModel(n);if(!a)throw Mi();let o=[],s=new j;return Vm(i,a,w.None).then(e=>{s.add(e);let t=[];for(let n of e.lenses)r==null||n.symbol.command?o.push(n.symbol):r-->0&&n.provider.resolveCodeLens&&t.push(Promise.resolve(n.provider.resolveCodeLens(a,n.symbol,w.None)).then(e=>o.push(e||n.symbol)));return Promise.all(t)}).then(()=>o).finally(()=>{setTimeout(()=>s.dispose(),100)})});var Hm=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Um=function(e,t){return function(n,r){t(n,r,e)}},Wm=Xa(`ICodeLensCache`),Gm=class{constructor(e,t){this.lineCount=e,this.data=t}},Km=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw Error(`not supported`)}},this._cache=new Be(20,.75),Kl(gr,()=>e.remove(`codelens/cache`,1));let t=`codelens/cache2`,n=e.get(t,1,`{}`);this._deserialize(n);let r=lt.filter(e.onWillSaveState,e=>e.reason===Ql.SHUTDOWN);lt.once(r)(n=>{e.store(t,this._serialize(),1,1)})}put(e,t){let n=t.lenses.map(e=>({range:e.symbol.range,command:e.symbol.command&&{id:``,title:e.symbol.command?.title}})),r=new Bm;r.add({lenses:n},this._fakeProvider);let i=new Gm(e.getLineCount(),r);this._cache.set(e.uri.toString(),i)}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,n]of this._cache){let r=new Set;for(let e of n.data.lenses)r.add(e.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{let t=JSON.parse(e);for(let e in t){let n=t[e],r=[];for(let e of n.lines)r.push({range:new H(e,1,e,11)});let i=new Bm;i.add({lenses:r},this._fakeProvider),this._cache.set(e,new Gm(n.lineCount,i))}}catch{}}};Km=Hm([Um(0,a)],Km),Et(Wm,Km,1);var qm,Jm=class{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,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`)}},Ym=class e{constructor(t,n){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=t,this._id=`codelens.widget-${e._idPool++}`,this.updatePosition(n),this._domNode=document.createElement(`span`),this._domNode.className=`codelens-decoration`}withCommands(t,n){this._commands.clear();let r=[],i=!1;for(let n=0;n<t.length;n++){let a=t[n];if(a&&(i=!0,a.command)){let i=ti(a.command.title.trim());if(a.command.id){let t=`c${e._idPool++}`;r.push(W(`a`,{id:t,title:a.command.tooltip,role:`button`},...i)),this._commands.set(t,a.command)}else r.push(W(`span`,{title:a.command.tooltip},...i));n+1<t.length&&r.push(W(`span`,void 0,`\xA0|\xA0`))}}i?(d(this._domNode,...r),this._isEmpty&&n&&this._domNode.classList.add(`fadein`),this._isEmpty=!1):d(this._domNode,W(`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}};qm=Ym,qm._idPool=0;var Xm=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 e=0,n=t.length;e<n;e++)this._addDecorationsCallbacks[e](t[e])}},Zm=B.register({collapseOnReplaceEdit:!0,description:`codelens`}),Qm=class{constructor(e,t,n,r,i,a){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let o,s=[];this._data.forEach((e,t)=>{e.symbol.command&&s.push(e.symbol),n.addDecoration({range:e.symbol.range,options:Zm},e=>this._decorationIds[t]=e),o=o?H.plusRange(o,e.symbol.range):H.lift(e.symbol.range)}),this._viewZone=new Jm(o.startLineNumber-1,i,a),this._viewZoneId=r.addZone(this._viewZone),s.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(s,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new Ym(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),void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{let n=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(n&&H.isEmpty(r.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((e,n)=>{t.addDecoration({range:e.symbol.range,options:Zm},e=>this._decorationIds[n]=e)})}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 n=e.getDecorationRange(this._decorationIds[t]);n&&(this._data[t].symbol.range=n)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){let n=e[t];if(n){let{symbol:e}=this._data[t];e.command=n.command||e.command}}}getCommand(e){return this._contentWidget?.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)))}}},$m,eh=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},th=function(e,t){return function(n,r){t(n,r,e)}},nh=($m=class{constructor(e,t,n,r,i,a){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=i,this._codeLensCache=a,this._disposables=new j,this._localToDispose=new j,this._lenses=[],this._oldCodeLensModels=new j,this._provideCodeLensDebounce=n.for(t.codeLensProvider,`CodeLensProvide`,{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,`CodeLensResolve`,{min:250,salt:`resolve`}),this._resolveCodeLensesScheduler=new ql(()=>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(e=>{(e.hasChanged(59)||e.hasChanged(25)||e.hasChanged(24))&&this._updateLensStyle(),e.hasChanged(23)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._resolveCodeLensesScheduler.dispose(),this._oldCodeLensModels.dispose(),this._currentCodeLensModel?.dispose()}_getLayoutInfo(){let e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61)),t=this._editor.getOption(25);return(!t||t<5)&&(t=this._editor.getOption(61)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){let{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),n=this._editor.getOption(24),r=this._editor.getOption(59),{style:i}=this._editor.getContainerDomNode();i.setProperty(`--vscode-editorCodeLens-lineHeight`,`${e}px`),i.setProperty(`--vscode-editorCodeLens-fontSize`,`${t}px`),i.setProperty(`--vscode-editorCodeLens-fontFeatureSettings`,r.fontFeatureSettings),n&&(i.setProperty(`--vscode-editorCodeLens-fontFamily`,n),i.setProperty(`--vscode-editorCodeLens-fontFamilyDefault`,Si.fontFamily)),this._editor.changeViewZones(t=>{for(let n of this._lenses)n.updateHeight(e,t)})}_localDispose(){this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=void 0,this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),this._currentCodeLensModel?.dispose()}_onModelChange(){this._localDispose();let e=this._editor.getModel();if(!e||!this._editor.getOption(23)||e.isTooLargeForTokenization())return;let t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&Hc(()=>{let n=this._codeLensCache.get(e);t===n&&(this._codeLensCache.delete(e),this._onModelChange())},3e4,this._localToDispose);return}for(let t of this._languageFeaturesService.codeLensProvider.all(e))if(typeof t.onDidChange==`function`){let e=t.onDidChange(()=>n.schedule());this._localToDispose.add(e)}let n=new ql(()=>{let t=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=za(t=>Vm(this._languageFeaturesService.codeLensProvider,e,t)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);let i=this._provideCodeLensDebounce.update(e,Date.now()-t);n.delay=i,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},fl)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(Va(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let n=[],r=-1;this._lenses.forEach(e=>{!e.isValid()||r===e.getLineNumber()?n.push(e):(e.update(t),r=e.getLineNumber())});let i=new Xm;n.forEach(e=>{e.dispose(i,t),this._lenses.splice(this._lenses.indexOf(e),1)}),i.commit(e)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Va(()=>{if(this._editor.getModel()){let e=Ws.capture(this._editor);this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{this._disposeAllLenses(e,t)})}),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(e=>{if(e.target.type!==9)return;let t=e.target.element;if(t?.tagName===`SPAN`&&(t=t.parentElement),t?.tagName===`A`)for(let e of this._lenses){let n=e.getCommand(t);if(n){this._commandService.executeCommand(n.id,...n.arguments||[]).catch(e=>this._notificationService.error(e));break}}})),n.schedule()}_disposeAllLenses(e,t){let n=new Xm;for(let e of this._lenses)e.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;let t=this._editor.getModel().getLineCount(),n=[],r;for(let i of e.lenses){let e=i.symbol.range.startLineNumber;e<1||e>t||(r&&r[r.length-1].symbol.range.startLineNumber===e?r.push(i):(r=[i],n.push(r)))}if(!n.length&&!this._lenses.length)return;let i=Ws.capture(this._editor),a=this._getLayoutInfo();this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let r=new Xm,i=0,o=0;for(;o<n.length&&i<this._lenses.length;){let e=n[o][0].symbol.range.startLineNumber,s=this._lenses[i].getLineNumber();s<e?(this._lenses[i].dispose(r,t),this._lenses.splice(i,1)):s===e?(this._lenses[i].updateCodeLensSymbols(n[o],r),o++,i++):(this._lenses.splice(i,0,new Qm(n[o],this._editor,r,t,a.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),i++,o++)}for(;i<this._lenses.length;)this._lenses[i].dispose(r,t),this._lenses.splice(i,1);for(;o<n.length;)this._lenses.push(new Qm(n[o],this._editor,r,t,a.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),o++;r.commit(e)})}),i.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){this._resolveCodeLensesPromise?.cancel(),this._resolveCodeLensesPromise=void 0;let e=this._editor.getModel();if(!e)return;let t=[],n=[];if(this._lenses.forEach(r=>{let i=r.computeIfNecessary(e);i&&(t.push(i),n.push(r))}),t.length===0){this._oldCodeLensModels.clear();return}let r=Date.now(),i=za(r=>{let i=t.map((t,i)=>{let a=Array(t.length),o=t.map((t,n)=>!t.symbol.command&&typeof t.provider.resolveCodeLens==`function`?Promise.resolve(t.provider.resolveCodeLens(e,t.symbol,r)).then(e=>{a[n]=e},Vt):(a[n]=t.symbol,Promise.resolve(void 0)));return Promise.all(o).then(()=>{!r.isCancellationRequested&&!n[i].isDisposed()&&n[i].updateCommands(a)})});return Promise.all(i)});this._resolveCodeLensesPromise=i,this._resolveCodeLensesPromise.then(()=>{let t=this._resolveCodeLensesDebounce.update(e,Date.now()-r);this._resolveCodeLensesScheduler.delay=t,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),i===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},e=>{fl(e),i===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}},$m.ID=`css.editor.codeLens`,$m);nh=eh([th(1,D),th(2,Gt),th(3,$t),th(4,ce),th(5,Wm)],nh),Y(nh.ID,nh,1),t(class extends O{constructor(){super({id:`codelens.showLensesInCurrentLine`,precondition:J.hasCodeLensProvider,label:M(935,`Show CodeLens Commands for Current Line`)})}async run(e,t){if(!t.hasModel())return;let n=e.get(Fc),r=e.get($t),i=e.get(ce),a=t.getSelection().positionLineNumber,o=t.getContribution(nh.ID);if(!o)return;let s=await o.getModel();if(!s)return;let c=[];for(let e of s.lenses)e.symbol.command&&e.symbol.range.startLineNumber===a&&c.push({label:e.symbol.command.title,command:e.symbol.command});if(c.length===0)return;let l=await n.pick(c,{canPickMany:!1,placeHolder:Z(934,`Select a command`)});if(!l)return;let u=l.command;if(s.isDisposed){let e=(await o.getModel())?.lenses.find(e=>e.symbol.range.startLineNumber===a&&e.symbol.command?.title===u.title);if(!e||!e.symbol.command)return;u=e.symbol.command}try{await r.executeCommand(u.id,...u.arguments||[])}catch(e){i.error(e)}}});var rh=class{constructor(e,t,n,r){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=r,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}},ih=class{constructor(e,t,n,r,i,a){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=r,this.initialMousePosY=i,this.supportsMarkerHover=a,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}},ah=class{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(let e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}},oh=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}},sh=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},ch=function(e,t){return function(n,r){t(n,r,e)}},lh=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){let r=t.range,i=t.color,a=new T(new _l(Math.round(255*i.red),Math.round(255*i.green),Math.round(255*i.blue),i.alpha)),o=T.Format.CSS.formatRGB(a),s=T.Format.CSS.formatHSL(a),c=T.Format.CSS.formatHexA(a,!0),l=[];return l.push({label:o,textEdit:{range:r,text:o}}),l.push({label:s,textEdit:{range:r,text:s}}),l.push({label:c,textEdit:{range:r,text:c}}),l}};lh=sh([ch(0,Kr)],lh);var uh=class extends L{constructor(e,t){super(),this._register(e.colorProvider.register(`*`,new lh(t)))}};uh=sh([ch(0,D),ch(1,Kr)],uh);async function dh(e,t,n,r=`auto`){return gh(new ph,e,t,n,r)}function fh(e,t,n,r){return Promise.resolve(n.provideColorPresentations(e,t,r))}var ph=class{constructor(){}async compute(e,t,n,r){let i=await e.provideDocumentColors(t,n);if(Array.isArray(i))for(let t of i)r.push({colorInfo:t,provider:e});return Array.isArray(i)}},mh=class{constructor(){}async compute(e,t,n,r){let i=await e.provideDocumentColors(t,n);if(Array.isArray(i))for(let e of i)r.push({range:e.range,color:[e.color.red,e.color.green,e.color.blue,e.color.alpha]});return Array.isArray(i)}},hh=class{constructor(e){this.colorInfo=e}async compute(e,t,n,r){let i=await e.provideColorPresentations(t,this.colorInfo,w.None);return Array.isArray(i)&&r.push(...i),Array.isArray(i)}};async function gh(e,t,n,r,i){let a=!1,o,s=[],c=t.ordered(n);for(let t=c.length-1;t>=0;t--){let l=c[t];if(i!==`always`&&l instanceof lh)o=l;else try{await e.compute(l,n,r,s)&&(a=!0)}catch(e){Vt(e)}}return a?s:o&&i!==`never`?(await e.compute(o,n,r,s),s):[]}function _h(e,t){let{colorProvider:n}=e.get(D),r=e.get(eu).getModel(t);if(!r)throw Mi();return{model:r,colorProviderRegistry:n,defaultColorDecoratorsEnablement:e.get(ad).getValue(`editor.defaultColorDecorators`,{resource:t})}}var vh,yh=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},bh=function(e,t){return function(n,r){t(n,r,e)}},xh,Sh=Object.create({}),Ch=(vh=class extends L{constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new j),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new wh),this._colorDecorationClassRefs=this._register(new j),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new $i(this._editor));let i=this._editor.getContainerDomNode();i.style.setProperty(`--vscode-colorPicker-colorDecoratorWidth`,`${xh.colorDecoratorInnerWidthInEm}em`),i.style.setProperty(`--vscode-colorPicker-colorDecoratorMargin`,`${xh.colorDecoratorMarginInEm}em`),this._register(Va(()=>{i.style.removeProperty(`--vscode-colorPicker-colorDecoratorWidth`),i.style.removeProperty(`--vscode-colorPicker-colorDecoratorMargin`)})),this._debounceInformation=r.for(n.colorProvider,`Document Colors`,{min:xh.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(e=>{let t=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(168);let n=t!==this._isColorDecoratorsEnabled||e.hasChanged(27),r=e.hasChanged(168);(n||r)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(168),this.updateColors()}isEnabled(){let e=this._editor.getModel();if(!e)return!1;let t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n==`object`){let e=n.colorDecorators;if(e&&e.enable!==void 0&&!e.enable)return e.enable}return this._editor.getOption(26)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled){this.removeAllDecorations();return}let e=this._editor.getModel();e&&this._languageFeaturesService.colorProvider.has(e)&&(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new xl,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=za(async e=>{let t=this._editor.getModel();if(!t)return[];let n=new aa(!1),r=await dh(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,n.elapsed()),r});try{let e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){fl(e)}}stop(){this._timeoutTimer&&=(this._timeoutTimer.cancel(),null),this._computePromise&&=(this._computePromise.cancel(),null),this._localToDispose.clear()}updateDecorations(e){let t=e.map(e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:B.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((t,n)=>this._colorDatas.set(t,e[n]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();let t=[],n=xh.colorDecoratorInnerWidthInEm+2*xh.colorDecoratorMarginInEm,r=this._editor.getOption(27);for(let i=0;i<e.length&&t.length<r;i++){let{red:r,green:a,blue:o,alpha:s}=e[i].colorInfo.color,c=new _l(Math.round(r*255),Math.round(a*255),Math.round(o*255),s),l=`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,u=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:l}));t.push({range:{startLineNumber:e[i].colorInfo.range.startLineNumber,startColumn:e[i].colorInfo.range.startColumn,endLineNumber:e[i].colorInfo.range.endLineNumber,endColumn:e[i].colorInfo.range.endColumn},options:{description:`colorDetector`,before:{content:`\xA0`,inlineClassName:`${u.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:Sh,widthInEm:n}}})}let i=r<e.length&&r;this._decoratorLimitReporter.update(e.length,i),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 n=t.getDecorationsInRange(H.fromPositions(e,e)).filter(e=>this._colorDatas.has(e.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},xh=vh,vh.ID=`editor.contrib.colorDetector`,vh.RECOMPUTE_TIME=1e3,vh.colorDecoratorInnerWidthInEm=.8,vh.colorDecoratorMarginInEm=.2,vh);Ch=xh=yh([bh(1,ad),bh(2,D),bh(3,Gt)],Ch);var wh=class extends L{constructor(){super(...arguments),this._onDidChange=this._register(new F),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}},Th=`editor.action.showHover`,Eh=`editor.action.showDefinitionPreviewHover`,Dh=`editor.action.hideHover`,Oh=`editor.action.scrollUpHover`,kh=`editor.action.scrollDownHover`,Ah=`editor.action.scrollLeftHover`,jh=`editor.action.scrollRightHover`,Mh=`editor.action.pageUpHover`,Nh=`editor.action.pageDownHover`,Ph=`editor.action.goToTopHover`,Fh=`editor.action.goToBottomHover`,Ih=`editor.action.increaseHoverVerbosityLevel`,Lh=Z(1160,`Increase Hover Verbosity Level`),Rh=`editor.action.decreaseHoverVerbosityLevel`,zh=Z(1161,`Decrease Hover Verbosity Level`),Bh=`editor.action.hideLongLineWarningHover`,Vh=`editor.action.inlineSuggest.commit`,Hh=`editor.action.inlineSuggest.commitAlternativeAction`,Uh=`editor.action.inlineSuggest.showPrevious`,Wh=`editor.action.inlineSuggest.showNext`,Gh=`editor.action.inlineSuggest.jump`,Kh=`editor.action.inlineSuggest.hide`,qh=`editor.action.inlineSuggest.toggleShowCollapsed`,Jh=`editor.action.inlineSuggest.renameSymbol`,Yh,Xh=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Zh=function(e,t){return function(n,r){t(n,r,e)}},Qh,$h=class extends L{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=gs(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar===`always`),this.sessionPosition=void 0,this.position=C(this,e=>{let t=this.model.read(e)?.primaryGhostText.read(e);if(!this.alwaysShowToolbar.read(e)||!t||t.parts.length===0)return this.sessionPosition=void 0,null;let n=t.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==t.lineNumber&&(this.sessionPosition=void 0);let r=new R(t.lineNumber,Math.min(n,this.sessionPosition?.column??2**53-1));return this.sessionPosition=r,r}),this._register(Qr((t,n)=>{let r=this.model.read(t);if(!r||!this.alwaysShowToolbar.read(t))return;let i=C(t=>{let n=t.store.add(this.instantiationService.createInstance(ng.hot.read(t),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(n),t.store.add(Va(()=>e.removeContentWidget(n))),t.store.add(x(e=>{this.position.read(e)&&r.lastTriggerKind.read(e)!==Lo.Explicit&&r.triggerExplicitly()})),n}),a=iu(this,(e,t)=>!!this.position.read(e)||!!t);n.add(x(e=>{a.read(e)&&i.read(e)}))}))}};$h=Xh([Zh(2,q)],$h);var eg=Tr(`inline-suggestion-hints-next`,G.chevronRight,Z(1270,`Icon for show next parameter hint.`)),tg=Tr(`inline-suggestion-hints-previous`,G.chevronLeft,Z(1271,`Icon for show previous parameter hint.`)),ng=(Yh=class extends L{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,n){let r=new Ut(e,t,n,!0,()=>this._commandService.executeCommand(e));return r.tooltip=this.keybindingService.appendKeybinding(t,e,this._contextKeyService),r}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=r,this._suggestionCount=i,this._extraCommands=a,this._warning=o,this._relayout=s,this._commandService=c,this.keybindingService=u,this._contextKeyService=d,this._menuService=f,this.id=`InlineSuggestionHintsContentWidget${Qh.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=C(e=>{let t=this._warning.read(e);if(t)return typeof t.message==`string`?t.message:e.store.add(Se(t.message)).element}),this._warningMessageNode=I.div({class:`warningMessage`,style:{maxWidth:400,margin:4,marginBottom:4,display:C(e=>this._warning.read(e)?`block`:`none`)}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=vn(`div.inlineSuggestionsHints`,{className:this.withBorder?`monaco-hover monaco-hover-content`:``},[this._warningMessageNode.element,vn(`div@toolBar`)]),this.previousAction=this._register(this.createCommandAction(Uh,Z(1272,`Previous`),K.asClassName(tg))),this.availableSuggestionCountAction=this._register(new Ut(`inlineSuggestionHints.availableSuggestionCount`,``,void 0,!1)),this.nextAction=this._register(this.createCommandAction(Wh,Z(1273,`Next`),K.asClassName(eg))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(A.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new ql(()=>{this.availableSuggestionCountAction.label=``},100)),this.disableButtonsDebounced=this._register(new ql(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(x(e=>{this._warningMessageContentNode.read(e),this._warningMessageNode.readEffect(e),this._relayout()})),this.toolBar=this._register(l.createInstance(ag,this.nodes.toolBar,A.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith(`primary`)},actionViewItemProvider:(e,t)=>{if(e instanceof Ln)return l.createInstance(ig,e,void 0);if(e===this.availableSuggestionCountAction){let t=new rg(void 0,e,{label:!0,icon:!1});return t.setClass(`availableSuggestionCount`),t}},telemetrySource:`InlineSuggestionToolbar`})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(e=>{Qh._dropDownVisible=e})),this._register(x(e=>{this._position.read(e),this.editor.layoutContentWidget(this)})),this._register(x(e=>{let t=this._suggestionCount.read(e),n=this._currentSuggestionIdx.read(e);t===void 0?this.clearAvailableSuggestionCountLabelDebounced.schedule():(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${n+1}/${t}`),t!==void 0&&t>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(x(e=>{let t=this._extraCommands.read(e).map(e=>({class:void 0,id:e.command.id,enabled:!0,tooltip:e.command.tooltip||``,label:e.command.title,run:()=>this._commandService.executeCommand(e.command.id,...e.command.arguments??[])}));for(let[e,n]of this.inlineCompletionsActionsMenus.getActions())for(let e of n)e instanceof Ln&&t.push(e);t.length>0&&t.unshift(new va),this.toolBar.setAdditionalSecondaryActions(t)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}},Qh=Yh,Yh.hot=yn(Yh),Yh._dropDownVisible=!1,Yh.id=0,Yh);ng=Qh=Xh([Zh(8,$t),Zh(9,q),Zh(10,sr),Zh(11,E),Zh(12,zs)],ng);var rg=class extends He{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}},ig=class extends Ns{updateLabel(){let e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){let t=vn(`div.keybinding`).root;this._register(new ie(t,po,{disableTitle:!0,..._i})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add(`inlineSuggestionStatusBarItemLabel`)}}updateTooltip(){}},ag=class extends Ta{constructor(e,t,n,r,i,a,o,s,c){super(e,{resetMenu:t,...n},r,i,a,o,s,c),this.menuId=t,this.options2=n,this.menuService=r,this.contextKeyService=i,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){let{primary:e,secondary:t}=Bl(this.menu.getActions(this.options2?.menuOptions),this.options2?.toolbarOptions?.primaryGroup,this.options2?.toolbarOptions?.shouldInlineSubmenu,this.options2?.toolbarOptions?.useSeparatorsInPrimaryActions);t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),e.push(...this.additionalPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){ks(this.prependedPrimaryActions,e,(e,t)=>e===t)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){ks(this.additionalActions,e,(e,t)=>e===t)||(this.additionalActions=e,this.updateToolbar())}};ag=Xh([Zh(3,zs),Zh(4,E),Zh(5,Sr),Zh(6,sr),Zh(7,$t),Zh(8,Xs)],ag);function og(e,t,n){let r=re(e);return!(t<r.left+3||t>r.left+r.width-3||n<r.top+3||n>r.top+r.height-3)}function sg(e,t,n){return e===`on`||e!==`off`&&cg(t,n.event)}function cg(e,t){return e===`altKey`?t.ctrlKey||t.metaKey:t.altKey}var lg=class{constructor(e,t,n,r){this.value=e,this.isComplete=t,this.hasLoadingMessage=n,this.options=r}},ug=class extends L{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new F),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new dg(e=>this._triggerAsyncComputation(e),0)),this._syncComputationScheduler=this._register(new dg(e=>this._triggerSyncComputation(e),0)),this._loadingMessageScheduler=this._register(new dg(e=>this._triggerLoadingMessage(e),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&=(this._asyncIterable.cancel(),null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t){this._options=t,this._state=e,this._fireResult(t)}_triggerAsyncComputation(e){this._setState(2,e),this._syncComputationScheduler.schedule(e,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=Os(t=>this._computer.computeAsync(e,t)),(async()=>{try{for await(let t of this._asyncIterable)t&&(this._result.push(t),this._fireResult(e));this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0,e)}catch(e){fl(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(e){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(e))),this._setState(this._asyncIterableDone?0:3,e)}_triggerLoadingMessage(e){this._state===3&&this._setState(4,e)}_fireResult(e){if(this._state===1||this._state===2)return;let t=this._state===0,n=this._state===4;this._onResult.fire(new lg(this._result.slice(0),t,n,e))}start(e,t){if(e===0)this._state===0&&(this._setState(1,t),this._asyncComputationScheduler.schedule(t,this._firstWaitTime),this._loadingMessageScheduler.schedule(t,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(t),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t)}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&=(this._asyncIterable.cancel(),null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}},dg=class extends L{constructor(e,t){super(),this._scheduler=this._register(new ql(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}},fg=class{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new F,this._onDidResize=new F,this._sashListener=new j,this._size=new fu(0,0),this._minSize=new fu(0,0),this._maxSize=new fu(2**53-1,2**53-1),this.domNode=document.createElement(`div`),this._eastSash=new wr(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new wr(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new wr(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:wa.North}),this._southSash=new wr(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:wa.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,n=0;this._sashListener.add(lt.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(lt.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(n=r.currentX-r.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(n=-(r.currentX-r.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(lt.any(this._eastSash.onDidReset,this._westSash.onDidReset)(e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(lt.any(this._northSash.onDidReset,this._southSash.onDidReset)(e=>{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,n,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){let{height:n,width:r}=this._minSize,{height:i,width:a}=this._maxSize;e=Math.max(n,Math.min(i,e)),t=Math.max(r,Math.min(a,t));let o=new fu(t,e);fu.equals(o,this._size)||(this.domNode.style.height=e+`px`,this.domNode.style.width=t+`px`,this._size=o,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}},pg=30,mg=24,hg=class extends L{constructor(e,t=new fu(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new fg),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position=`absolute`,this._resizableNode.minSize=fu.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(e=>{this._resize(new fu(e.dimension.width,e.dimension.height)),e.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(){return this._contentPosition?.position?R.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(t&&n)return re(t).top+n.top-pg}_availableVerticalSpaceBelow(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;let r=re(t),i=er(t.ownerDocument.body),a=r.top+n.top+n.height;return i.height-a-mg}_findPositionPreference(e,t){let n=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),r=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),i=Math.min(e,Math.min(Math.max(r,n),e)),a;return a=this._editor.getOption(69).above?i<=r?1:2:i<=n?2:1,a===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}},gg,_g=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},vg=function(e,t){return function(n,r){t(n,r,e)}},yg,bg=30,xg=(gg=class extends hg{get isVisibleFromKeyboard(){return this._renderedHover?.source===2}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,n,r,i){let a=e.getOption(75)+8,o=new fu(150,a);super(e,o),this._configurationService=n,this._accessibilityService=r,this._keybindingService=i,this._hover=this._register(new la(!0)),this._onDidResize=this._register(new F),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new F),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new F),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=o,this._hoverVisibleKey=J.hoverVisible.bindTo(t),this._hoverFocusedKey=J.hoverFocused.bindTo(t),S(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex=`50`,this._resizableNode.domNode.className=`monaco-resizable-hover`,this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(59)&&this._updateFont()}));let s=this._register(Vc(this._resizableNode.domNode));this._register(s.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(s.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._register(this._hover.scrollbar.onScroll(e=>{this._onDidScroll.fire(e)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){super.dispose(),this._renderedHover?.dispose(),this._editor.removeContentWidget(this)}getId(){return yg.ID}static _applyDimensions(e,t,n){let r=typeof t==`number`?`${t}px`:t,i=typeof n==`number`?`${n}px`:n;e.style.width=r,e.style.height=i}_setContentsDomNodeDimensions(e,t){let n=this._hover.contentsDomNode;return yg._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){let n=this._hover.containerDomNode;return yg._applyDimensions(n,e,t)}_setScrollableElementDimensions(e,t){let n=this._hover.scrollbar.getDomNode();return yg._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){let r=typeof t==`number`?`${t}px`:t,i=typeof n==`number`?`${n}px`:n;e.style.maxWidth=r,e.style.maxHeight=i}_setHoverWidgetMaxDimensions(e,t){yg._applyMaxDimensions(this._hover.contentsDomNode,e,t),yg._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),yg._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty(`--vscode-hover-maxWidth`,typeof e==`number`?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions(`none`,`none`),this._setHoverWidgetDimensions(e.width,e.height)}_updateResizableNodeMaxDimensions(){let e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new fu(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){yg._lastDimensions=new fu(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){let e=this._renderedHover?.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){let e=this._findAvailableSpaceVertically();if(!e)return;let t=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(e=>{t+=e.clientHeight}),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(e=>e.scrollWidth>e.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=this._contentWidth===void 0?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidth<t?er(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth}isMouseGettingCloser(e,t){if(!this._renderedHover)return!1;if(this._renderedHover.initialMousePosX===void 0||this._renderedHover.initialMousePosY===void 0)return this._renderedHover.initialMousePosX=e,this._renderedHover.initialMousePosY=t,!1;let n=re(this.getDomNode());this._renderedHover.closestMouseDistance===void 0&&(this._renderedHover.closestMouseDistance=Sg(this._renderedHover.initialMousePosX,this._renderedHover.initialMousePosY,n.left,n.top,n.width,n.height));let r=Sg(e,t,n.left,n.top,n.width,n.height);return r>this._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,r),!0)}_setRenderedHover(e){this._renderedHover?.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle(`hidden`,!e)}_updateFont(){let{fontSize:e,lineHeight:t}=this._editor.getOption(59),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName(`code`)).forEach(e=>this._editor.applyFontInfo(e))}_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,yg._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,yg._lastDimensions.width);this._resizableNode.maxSize=new fu(t,e),this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){if(!this._editor||!this._editor.hasModel())return;this._render(e);let t=fr(this._hover.containerDomNode),n=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,n)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();let r=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&Sa(this._configurationService.getValue(`accessibility.verbosity.hover`)===!0&&this._accessibilityService.isScreenReaderOptimized(),this._keybindingService.lookupKeybinding(`editor.action.accessibleView`)?.getAriaLabel()??``);r&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+`, `+r)}hide(){if(!this._renderedHover)return;let e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new fu(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`),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new fu(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){let e=this._contentWidth===void 0?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new fu(e,this._minimumSize.height)}handleContentsChanged(){this._removeConstraintsRenderNormally();let e=this._hover.contentsDomNode,t=fr(e),n=nt(e)+2;if(this._resizableNode.layout(t,n),this._setHoverWidgetDimensions(n,t),t=fr(e),n=nt(e),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(t,n),this._renderedHover?.showAtPosition){let e=fr(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(e,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){let e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-bg})}scrollRight(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+bg})}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})}},yg=gg,gg.ID=`editor.contrib.resizableContentHoverWidget`,gg._lastDimensions=new fu(0,0),gg);xg=yg=_g([vg(1,E),vg(2,ad),vg(3,Su),vg(4,sr)],xg);function Sg(e,t,n,r,i,a){let o=n+i/2,s=r+a/2,c=Math.max(Math.abs(e-o)-i/2,0),l=Math.max(Math.abs(t-s)-a/2,0);return Math.sqrt(c*c+l*l)}var Cg=class e{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];let n=e.getModel(),r=t.range.startLineNumber;if(r>n.getLineCount())return[];let i=n.getLineMaxColumn(r);return e.getLineDecorations(r).filter(e=>{if(e.options.isWholeLine)return!0;let n=e.range.startLineNumber===r?e.range.startColumn:1,a=e.range.endLineNumber===r?e.range.endColumn:i;if(e.options.showIfCollapsed){if(n>t.range.startColumn+1||t.range.endColumn-1>a)return!1}else if(n>t.range.startColumn||t.range.endColumn>a)return!1;return!0})}computeAsync(t,n){let r=t.anchor;if(!this._editor.hasModel()||!r)return Vi.EMPTY;let i=e._getLineDecorations(this._editor,r);return Vi.merge(this._participants.map(e=>e.computeAsync?e.computeAsync(r,i,t.source,n):Vi.EMPTY))}computeSync(t){if(!this._editor.hasModel())return[];let n=t.anchor,r=e._getLineDecorations(this._editor,n),i=[];for(let e of this._participants)i=i.concat(e.computeSync(n,r,t.source));return Po(i)}},wg=class{constructor(e,t,n){this.hoverParts=e,this.isComplete=t,this.options=n}filter(e){let t=this.hoverParts.filter(t=>t.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new Tg(this,t,this.isComplete,this.options)}},Tg=class extends wg{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}},Eg=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Dg=function(e,t){return function(n,r){t(n,r,e)}},Og=W,kg=class extends L{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=Og(`div.hover-row.status-bar`),this.hoverElement.tabIndex=0,this.actionsElement=S(this.hoverElement,Og(`div.actions`))}addAction(e){let t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;this._hasContent=!0;let r=this._register(qt.render(this.actionsElement,e,n));return this._register(this._hoverService.setupManagedHover(Tn(`element`),r.actionContainer,r.actionRenderedLabel)),this.actions.push(r),r}append(e){let t=S(this.actionsElement,e);return this._hasContent=!0,t}};kg=Eg([Dg(0,sr),Dg(1,Io)],kg);var Ag,jg=class e{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(e=>this._editor.getModel().getDecorationRange(e)).filter(e=>!!e);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(t){let n=this._editor.getModel().getDecorationsInRange(t);for(let t of n){let n=t.options;if(n===e._FIND_MATCH_DECORATION||n===e._FIND_MATCH_NO_OVERVIEW_DECORATION||n===e._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(t.id)}return 0}setCurrentFindMatch(t){let n=null,r=0;if(t)for(let e=0,i=this._decorations.length;e<i;e++){let i=this._editor.getModel().getDecorationRange(this._decorations[e]);if(t.equalsRange(i)){n=this._decorations[e],r=e+1;break}}return(this._highlightedDecorationId!==null||n!==null)&&this._editor.changeDecorations(t=>{if(this._highlightedDecorationId!==null&&(t.changeDecorationOptions(this._highlightedDecorationId,e._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),n!==null&&(this._highlightedDecorationId=n,t.changeDecorationOptions(this._highlightedDecorationId,e._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(t.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),n!==null){let r=this._editor.getModel().getDecorationRange(n);if(r.startLineNumber!==r.endLineNumber&&r.endColumn===1){let e=r.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);r=new H(r.startLineNumber,r.startColumn,e,t)}this._rangeHighlightDecorationId=t.addDecoration(r,e._RANGE_HIGHLIGHT_DECORATION)}}),r}set(t,n){this._editor.changeDecorations(r=>{let i=e._FIND_MATCH_DECORATION,a=[];if(t.length>1e3){i=e._FIND_MATCH_NO_OVERVIEW_DECORATION;let n=this._editor.getModel().getLineCount(),r=this._editor.getLayoutInfo().height/n,o=Math.max(2,Math.ceil(3/r)),s=t[0].range.startLineNumber,c=t[0].range.endLineNumber;for(let n=1,r=t.length;n<r;n++){let r=t[n].range;c+o>=r.startLineNumber?r.endLineNumber>c&&(c=r.endLineNumber):(a.push({range:new H(s,1,c,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),s=r.startLineNumber,c=r.endLineNumber)}a.push({range:new H(s,1,c,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}let o=Array(t.length);for(let e=0,n=t.length;e<n;e++)o[e]={range:t[e].range,options:i};this._decorations=r.deltaDecorations(this._decorations,o),this._overviewRulerApproximateDecorations=r.deltaDecorations(this._overviewRulerApproximateDecorations,a),this._rangeHighlightDecorationId&&=(r.removeDecoration(this._rangeHighlightDecorationId),null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(e=>r.removeDecoration(e)),this._findScopeDecorationIds=[]),n?.length&&(this._findScopeDecorationIds=n.map(t=>r.addDecoration(t,e._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){let n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.endLineNumber>e.lineNumber)&&(r.endLineNumber<e.lineNumber||!(r.endColumn>e.column)))return r}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;t<n;t++){let n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.startLineNumber<e.lineNumber)&&(r.startLineNumber>e.lineNumber||!(r.startColumn<e.column)))return r}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}};Ag=jg,Ag._CURRENT_FIND_MATCH_DECORATION=B.register({description:`current-find-match`,stickiness:1,zIndex:13,className:`currentFindMatch`,inlineClassName:`currentFindMatchInline`,showIfCollapsed:!0,overviewRuler:{color:Ia(ba),position:Xu.Center},minimap:{color:Ia(ja),position:1}}),Ag._FIND_MATCH_DECORATION=B.register({description:`find-match`,stickiness:1,zIndex:10,className:`findMatch`,inlineClassName:`findMatchInline`,showIfCollapsed:!0,overviewRuler:{color:Ia(ba),position:Xu.Center},minimap:{color:Ia(ja),position:1}}),Ag._FIND_MATCH_NO_OVERVIEW_DECORATION=B.register({description:`find-match-no-overview`,stickiness:1,className:`findMatch`,showIfCollapsed:!0}),Ag._FIND_MATCH_ONLY_OVERVIEW_DECORATION=B.register({description:`find-match-only-overview`,stickiness:1,overviewRuler:{color:Ia(ba),position:Xu.Center}}),Ag._RANGE_HIGHLIGHT_DECORATION=B.register({description:`find-range-highlight`,stickiness:1,className:`rangeHighlight`,isWholeLine:!0}),Ag._FIND_SCOPE_DECORATION=B.register({description:`find-scope`,className:`findScope`,isWholeLine:!0});var Mg=class{constructor(e,t,n){this._editorSelection=e,this._ranges=t,this._replaceStrings=n,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){let e=[];for(let t=0;t<this._ranges.length;t++)e.push({range:this._ranges[t],text:this._replaceStrings[t]});e.sort((e,t)=>H.compareRangesUsingStarts(e.range,t.range));let n=[],r=e[0];for(let t=1;t<e.length;t++)r.range.endLineNumber===e[t].range.startLineNumber&&r.range.endColumn===e[t].range.startColumn?(r.range=r.range.plusRange(e[t].range),r.text+=e[t].text):(n.push(r),r=e[t]);n.push(r);for(let e of n)t.addEditOperation(e.range,e.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}};function Ng(e,t){if(e&&e[0]!==``){let n=Pg(e,t,`-`),r=Pg(e,t,`_`);return n&&!r?Fg(e,t,`-`):!n&&r?Fg(e,t,`_`):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():Js(e[0][0])&&t.length>0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}return t}function Pg(e,t,n){return e[0].indexOf(n)!==-1&&t.indexOf(n)!==-1&&e[0].split(n).length===t.split(n).length}function Fg(e,t,n){let r=t.split(n),i=e[0].split(n),a=``;return r.forEach((e,t)=>{a+=Ng([i[t]],e)+n}),a.slice(0,-1)}var Ig=class{constructor(e){this.staticValue=e,this.kind=0}},Lg=class{constructor(e){this.pieces=e,this.kind=1}},Rg=class e{static fromStaticValue(t){return new e([zg.staticValue(t)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){this._state=!e||e.length===0?new Ig(``):e.length===1&&e[0].staticValue!==null?new Ig(e[0].staticValue):new Lg(e)}buildReplaceString(t,n){if(this._state.kind===0)return n?Ng(t,this._state.staticValue):this._state.staticValue;let r=``;for(let n=0,i=this._state.pieces.length;n<i;n++){let i=this._state.pieces[n];if(i.staticValue!==null){r+=i.staticValue;continue}let a=e._substitute(i.matchIndex,t);if(i.caseOps!==null&&i.caseOps.length>0){let e=[],t=i.caseOps.length,n=0;for(let r=0,o=a.length;r<o;r++){if(n>=t){e.push(a.slice(r));break}switch(i.caseOps[n]){case`U`:e.push(a[r].toUpperCase());break;case`u`:e.push(a[r].toUpperCase()),n++;break;case`L`:e.push(a[r].toLowerCase());break;case`l`:e.push(a[r].toLowerCase()),n++;break;default:e.push(a[r])}}a=e.join(``)}r+=a}return r}static _substitute(e,t){if(t===null)return``;if(e===0)return t[0];let n=``;for(;e>0;){if(e<t.length)return(t[e]||``)+n;n=String(e%10)+n,e=Math.floor(e/10)}return`$`+n}},zg=class e{static staticValue(t){return new e(t,-1,null)}static caseOps(t,n){return new e(null,t,n)}constructor(e,t,n){this.staticValue=e,this.matchIndex=t,this.caseOps=!n||n.length===0?null:n.slice(0)}},Bg=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,n){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=zg.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),this._result[this._resultLen++]=zg.caseOps(e,n),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=zg.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),new Rg(this._result)}};function Vg(e){if(!e||e.length===0)return new Rg(null);let t=[],n=new Bg(e);for(let r=0,i=e.length;r<i;r++){let a=e.charCodeAt(r);if(a===92){if(r++,r>=i)break;let a=e.charCodeAt(r);switch(a){case 92:n.emitUnchanged(r-1),n.emitStatic(`\\`,r+1);break;case 110:n.emitUnchanged(r-1),n.emitStatic(`
|