offsite 0.0.55 → 0.0.57
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/README.md +8 -0
- package/apps/client/dist/assets/TextWrapIcon-BRhMbXe9.js +1 -0
- package/apps/client/dist/assets/{TextWrapIcon-CaHR7d2a.js → XIcon-BF9rDynM.js} +1 -1
- package/apps/client/dist/assets/{context-menu-CniNpkSW.js → context-menu-ah5Njpdz.js} +9 -9
- package/apps/client/dist/assets/{diff-panel-DfyRZtVh.js → diff-panel-BKiJiAiZ.js} +5 -5
- package/apps/client/dist/assets/{dist-D9LSGRim.js → dist-Cgj97HqD.js} +1 -1
- package/apps/client/dist/assets/{editor-dialog-Bc1Gpfll.js → editor-dialog-DY6qlmWC.js} +2 -2
- package/apps/client/dist/assets/{image-viewer-BPClqXmZ.js → image-viewer-DVmKXAyv.js} +1 -1
- package/apps/client/dist/assets/index-BtnFX6Z2.css +2 -0
- package/apps/client/dist/assets/index-CfER-bxq.js +21 -0
- package/apps/client/dist/assets/{preview-dialog-DvyH_XYP.js → preview-dialog-B-LOxdLg.js} +67 -67
- package/apps/client/dist/assets/{video-viewer-BATGlwTk.js → video-viewer-BBAwsDzR.js} +1 -1
- package/apps/client/dist/index.html +6 -6
- package/apps/client/dist/sw.js +1 -1
- package/apps/server/dist/main.mjs +353 -25
- package/apps/server/dist/main.mjs.map +1 -1
- package/apps/server/drizzle/20261031083530_session_opens/migration.sql +6 -0
- package/apps/server/drizzle/20261031083530_session_opens/snapshot.json +378 -0
- package/package.json +1 -1
- package/apps/client/dist/assets/XIcon-C8QiXos4.js +0 -1
- package/apps/client/dist/assets/index-BwVrIQyk.js +0 -21
- package/apps/client/dist/assets/index-DkhFb5Mr.css +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/freemarker2-Bw62YruA.js","assets/editor.api-Rfucz3mk.js","assets/rolldown-runtime-COiEfhsA.js","assets/preload-helper-BLdHbfdN.js","assets/editor-DjpsE8to.css","assets/handlebars-84NJRWd6.js","assets/html-86U_8x8W.js","assets/javascript-MI6i-TIC.js","assets/typescript-Bjj6HU8L.js","assets/liquid-Dcyd1pkL.js","assets/mdx-DR7vQeQJ.js","assets/python-CiSQgsVi.js","assets/razor-WdSU-o-W.js","assets/typescript-Dy13l_qr.js","assets/xml-AovvXo6A.js","assets/yaml-EESuZNdc.js","assets/zoomable-image-DkYN4OSU.js","assets/zoomable-image-E-lZC3nM.js","assets/MinusSignIcon-DGIm2EHe.js","assets/tooltip-CVA2QYzo.js","assets/utils-U6QfaJBO.js","assets/dist-C_Y10kCd.js","assets/button-CWFREsRn.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{A as t,B as n,D as r,F as i,H as a,M as o,N as s,O as c,P as l,Q as u,R as d,U as f,V as p,W as m,_ as h,at as g,b as _,ct as v,d as y,dt as b,f as ee,g as te,gt as ne,h as re,it as ie,k as ae,m as oe,mt as se,n as ce,nt as le,o as ue,p as de,pt as fe,r as pe,st as me,t as he,tt as ge,u as _e,ut as ve,v as ye,z as be}from"./context-menu-CniNpkSW.js";import{t as xe}from"./XIcon-C8QiXos4.js";import{a as Se,t as Ce}from"./button-CWFREsRn.js";import{c as we,l as Te,n as Ee,o as De,r as Oe,t as ke}from"./utils-U6QfaJBO.js";import{E as Ae,F as je,Gt as Me,I as Ne,M as Pe,N as Fe,Wt as Ie,b as Le,g as Re,n as ze,r as Be}from"./TextWrapIcon-CaHR7d2a.js";import{a as Ve,l as He,r as Ue,u as We}from"./preview-dialog-DvyH_XYP.js";import{n as Ge,r as Ke}from"./getFiletypeFromFileName-DGoZTiUS.js";import{G as qe,U as Je,W as Ye,d as Xe,h as Ze,o as Qe}from"./dist-TdUDcI9m.js";import{$ as $e,$a as et,$c as tt,$d as nt,$i as rt,$l as it,$n as at,$o as ot,$r as st,$s as ct,$t as lt,$u as ut,A as dt,Aa as ft,Ac as pt,Ad as x,Ai as mt,Al as ht,An as gt,Ao as _t,Ar as vt,As as yt,At as bt,Au as xt,B as St,Ba as Ct,Bc as S,Bd as wt,Bi as Tt,Bl as Et,Bn as Dt,Bo as Ot,Br as kt,Bs as At,Bt as jt,Bu as C,C as Mt,Ca as Nt,Cc as Pt,Cd as Ft,Ci as It,Cl as Lt,Cn as Rt,Co as zt,Cr as Bt,Cs as Vt,Ct as Ht,Cu as Ut,D as Wt,Da as Gt,Dc as Kt,Dd as qt,Di as Jt,Dl as Yt,Dn as Xt,Do as Zt,Dr as Qt,Ds as $t,Dt as en,Du as tn,E as nn,Ea as rn,Ec as an,Ed as on,Ei as sn,El as cn,En as ln,Eo as un,Er as dn,Es as fn,Et as pn,Eu as mn,F as hn,Fa as gn,Fc as _n,Fd as vn,Fi as yn,Fl as bn,Fn as xn,Fo as Sn,Fr as Cn,Fs as wn,Ft as Tn,Fu as En,G as Dn,Ga as On,Gc as kn,Gd as An,Gi as jn,Gl as Mn,Gn as Nn,Go as Pn,Gr as Fn,Gs as In,Gt as Ln,Gu as Rn,H as zn,Ha as Bn,Hc as Vn,Hd as Hn,Hi as Un,Hl as Wn,Hn as Gn,Ho as Kn,Hr as qn,Hs as w,Ht as Jn,Hu as Yn,Ia as Xn,Ic as Zn,Id as Qn,Ii as $n,Il as er,In as tr,Io as nr,Ir as rr,Is as ir,It as ar,Iu as or,J as sr,Ja as cr,Jc as lr,Jd as ur,Ji as dr,Jl as fr,Jn as pr,Jo as mr,Jr as hr,Js as gr,Jt as _r,Ju as T,K as vr,Ka as yr,Kc as br,Kd as xr,Ki as Sr,Kl as Cr,Kn as wr,Ko as Tr,Kr as E,Ks as Er,Kt as Dr,Ku as Or,L as kr,La as Ar,Lc as jr,Ld as Mr,Li as Nr,Ll as Pr,Ln as Fr,Lo as Ir,Lr,Ls as Rr,Lt as zr,Lu as Br,M as Vr,Ma as Hr,Mc as Ur,Md as Wr,Mi as Gr,Ml as Kr,Mn as qr,Mo as Jr,Mr as Yr,Ms as Xr,Mt as Zr,Mu as Qr,N as $r,Na as ei,Nc as ti,Nd as ni,Ni as ri,Nl as ii,Nn as ai,No as oi,Nr as si,Ns as D,Nt as ci,Nu as li,O as ui,Oa as di,Oc as fi,Od as pi,Oi as mi,Ol as hi,On as gi,Oo as _i,Or as vi,Os as yi,Ot as bi,Ou as xi,P as Si,Pa as Ci,Pc as wi,Pd as Ti,Pi as Ei,Pl as Di,Pn as Oi,Po as ki,Pr as Ai,Ps as ji,Pt as Mi,Pu as Ni,Q as Pi,Qa as Fi,Qc as Ii,Qd as Li,Qi as Ri,Ql as zi,Qn as Bi,Qo as Vi,Qr as Hi,Qs as Ui,Qt as Wi,Qu as Gi,R as Ki,Ra as O,Rc as qi,Rd as Ji,Ri as Yi,Rl as Xi,Rn as Zi,Ro as Qi,Rr as $i,Rs as ea,Rt as ta,Ru as k,S as na,Sa as ra,Sc as ia,Sd as aa,Si as oa,Sl as sa,Sn as ca,So as la,Sr as ua,Ss as da,St as fa,Su as pa,T as ma,Ta as ha,Tc as ga,Td as _a,Ti as va,Tl as ya,Tn as ba,To as xa,Tr as Sa,Ts as Ca,Tt as wa,Tu as Ta,U as Ea,Ua as Da,Uc as Oa,Ud as ka,Ui as Aa,Ul as ja,Un as Ma,Uo as Na,Ur as Pa,Us as Fa,Ut as Ia,Uu as La,V as Ra,Va as za,Vc as Ba,Vd as Va,Vi as Ha,Vl as Ua,Vn as Wa,Vo as Ga,Vr as Ka,Vs as qa,Vt as Ja,Vu as A,W as Ya,Wa as Xa,Wc as Za,Wd as Qa,Wi as $a,Wl as eo,Wn as to,Wo as no,Wr as ro,Ws as j,Wt as io,Wu as ao,X as oo,Xa as so,Xc as co,Xd as lo,Xi as uo,Xl as fo,Xn as po,Xo as mo,Xr as ho,Xs as go,Xt as _o,Xu as vo,Y as yo,Ya as bo,Yc as xo,Yd as So,Yi as Co,Yl as wo,Yn as To,Yo as Eo,Yr as Do,Ys as Oo,Yt as ko,Yu as Ao,Z as jo,Za as Mo,Zc as No,Zd as Po,Zi as Fo,Zl as Io,Zn as Lo,Zo as Ro,Zr as zo,Zs as Bo,Zt as Vo,Zu as Ho,_ as Uo,_a as Wo,_c as Go,_d as Ko,_f as qo,_i as Jo,_l as Yo,_n as Xo,_o as Zo,_r as Qo,_s as $o,_t as es,_u as ts,a as ns,aa as rs,ac as M,ad as N,af as is,ai as as,al as os,an as ss,ao as cs,ar as ls,as as us,at as ds,au as fs,b as ps,ba as ms,bc as hs,bd as gs,bi as _s,bl as vs,bn as ys,bo as bs,br as xs,bs as Ss,bt as Cs,bu as ws,c as Ts,ca as Es,cc as Ds,cd as Os,cf as ks,ci as As,cl as js,cn as Ms,co as Ns,cr as P,cs as Ps,ct as Fs,cu as Is,d as Ls,da as Rs,dc as zs,dd as F,df as Bs,di as Vs,dl as Hs,dn as Us,do as Ws,dr as Gs,ds as Ks,dt as qs,du as Js,ea as Ys,ec as Xs,ef as Zs,ei as Qs,el as $s,en as ec,eo as tc,er as nc,es as rc,et as ic,eu as ac,f as oc,fa as sc,fc as cc,fd as lc,ff as uc,fi as dc,fl as fc,fn as pc,fo as mc,fr as hc,fs as gc,ft as _c,fu as vc,g as yc,ga as bc,gc as xc,gd as Sc,gf as Cc,gi as wc,gl as Tc,gn as Ec,go as Dc,gr as Oc,gs as kc,gt as Ac,gu as jc,h as Mc,ha as Nc,hc as I,hd as Pc,hf as Fc,hi as Ic,hl as Lc,hn as Rc,ho as zc,hr as Bc,hs as Vc,ht as Hc,hu as Uc,i as Wc,ia as Gc,ic as Kc,id as qc,if as Jc,ii as Yc,il as Xc,in as Zc,io as Qc,ir as $c,is as el,it as tl,iu as nl,j as rl,ja as il,jc as al,jd as L,ji as ol,jl as sl,jn as cl,jo as ll,jr as ul,js as dl,jt as fl,ju as pl,k as ml,ka as hl,kc as gl,kd as _l,ki as vl,kl as yl,kn as bl,ko as xl,kr as Sl,ks as Cl,kt as wl,ku as Tl,l as El,la as Dl,lc as Ol,ld as kl,lf as Al,li as jl,ll as Ml,ln as Nl,lo as R,lr as Pl,ls as Fl,lt as Il,lu as Ll,m as Rl,ma as zl,mc as Bl,md as Vl,mf as Hl,mi as Ul,ml as Wl,mn as Gl,mo as Kl,mr as ql,ms as Jl,mt as Yl,mu as Xl,n as Zl,na as Ql,nc as $l,nd as eu,nf as tu,ni as nu,nl as ru,nn as iu,no as au,nr as ou,ns as su,nt as cu,nu as lu,o as uu,oa as du,oc as fu,od as pu,of as mu,oi as hu,ol as gu,on as _u,oo as vu,or as yu,os as z,ot as bu,ou as xu,p as Su,pa as Cu,pc as wu,pd as Tu,pf as Eu,pi as Du,pl as B,pn as Ou,po as ku,pr as Au,ps as ju,pt as Mu,pu as Nu,q as Pu,qa as Fu,qc as Iu,qd as Lu,qi as Ru,ql as zu,qn as Bu,qo as Vu,qr as Hu,qs as V,qt as Uu,qu as Wu,r as Gu,ra as Ku,rc as qu,rd as Ju,rf as Yu,ri as Xu,rl as Zu,rn as Qu,ro as $u,rr as ed,rs as td,rt as nd,ru as rd,s as id,sa as ad,sc as od,sd,sf as cd,si as ld,sl as ud,sn as dd,so as fd,sr as pd,ss as H,st as md,su as hd,t as gd,ta as _d,tc as U,td as vd,tf as yd,ti as bd,tl as xd,tn as Sd,to as Cd,tr as wd,ts as W,tt as Td,tu as Ed,u as Dd,ua as Od,uc as kd,ud as G,uf as Ad,ui as jd,ul as Md,un as Nd,uo as Pd,ur as Fd,us as Id,ut as Ld,uu as Rd,v as zd,va as Bd,vc as K,vd as Vd,vf as Hd,vi as Ud,vl as Wd,vn as Gd,vo as Kd,vr as qd,vs as Jd,vt as Yd,vu as Xd,w as Zd,wa as Qd,wc as $d,wd as ef,wi as tf,wl as nf,wn as rf,wo as af,wr as of,ws as sf,wt as cf,wu as lf,x as uf,xa as df,xc as ff,xd as pf,xi as mf,xl as hf,xn as gf,xo as _f,xr as vf,xs as yf,xt as bf,xu as xf,y as Sf,ya as Cf,yc as wf,yd as Tf,yi as Ef,yl as Df,yn as Of,yo as kf,yr as Af,ys as jf,yt as Mf,yu as Nf,z as Pf,za as Ff,zc as If,zd as Lf,zi as Rf,zl as zf,zn as Bf,zo as Vf,zr as Hf,zs as Uf,zt as Wf,zu as q}from"./editor.api-Rfucz3mk.js";import{t as J}from"./preload-helper-BLdHbfdN.js";import{i as Gf,t as Kf}from"./langs-DssLtjmH.js";import{t as qf}from"./engine-oniguruma-BMl9YtsA.js";import{t as Jf}from"./MinusSignIcon-DGIm2EHe.js";import{c as Yf}from"./tooltip-CVA2QYzo.js";var Xf=[[`path`,{d:`M17.4776 9.01106C17.485 9.01102 17.4925 9.01101 17.5 9.01101C19.9853 9.01101 22 11.0294 22 13.5193C22 15.8398 20.25 17.7508 18 18M17.4776 9.01106C17.4924 8.84606 17.5 8.67896 17.5 8.51009C17.5 5.46695 15.0376 3 12 3C9.12324 3 6.76233 5.21267 6.52042 8.03192M17.4776 9.01106C17.3753 10.1476 16.9286 11.1846 16.2428 12.0165M6.52042 8.03192C3.98398 8.27373 2 10.4139 2 13.0183C2 15.4417 3.71776 17.4632 6 17.9273M6.52042 8.03192C6.67826 8.01687 6.83823 8.00917 7 8.00917C8.12582 8.00917 9.16474 8.38194 10.0005 9.01101`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 21L12 13M12 21C11.2998 21 9.99153 19.0057 9.5 18.5M12 21C12.7002 21 14.0085 19.0057 14.5 18.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Zf=[[`path`,{d:`M4 12.0005L4 14.5446C4 17.7896 4 19.4122 4.88607 20.5111C5.06508 20.7331 5.26731 20.9354 5.48933 21.1144C6.58831 22.0005 8.21082 22.0005 11.4558 22.0005C12.1614 22.0005 12.5141 22.0005 12.8372 21.8865C12.9044 21.8627 12.9702 21.8355 13.0345 21.8047C13.3436 21.6569 13.593 21.4075 14.0919 20.9086L18.8284 16.172C19.4065 15.594 19.6955 15.3049 19.8478 14.9374C20 14.5699 20 14.1611 20 13.3436V10.0005C20 6.22922 20 4.34361 18.8284 3.17203C17.7693 2.11287 16.1265 2.01125 13.0345 2.0015M13 21.5005V21.0005C13 18.172 13 16.7578 13.8787 15.8791C14.7574 15.0005 16.1716 15.0005 19 15.0005H19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 5.99954H4M8 1.99954V9.99954`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Qf=[[`path`,{d:`M20 14V10.6569C20 9.83935 20 9.4306 19.8478 9.06306C19.6955 8.69552 19.4065 8.40649 18.8284 7.82843L14.0919 3.09188C13.593 2.593 13.3436 2.34355 13.0345 2.19575C12.9702 2.165 12.9044 2.13772 12.8372 2.11401C12.5141 2 12.1614 2 11.4558 2C8.21082 2 6.58831 2 5.48933 2.88607C5.26731 3.06508 5.06508 3.26731 4.88607 3.48933C4 4.58831 4 6.21082 4 9.45584V14C4 17.7712 4 19.6569 5.17157 20.8284C6.34315 22 8.22876 22 12 22M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M17 22C17.6068 21.4102 20 19.8403 20 19C20 18.1597 17.6068 16.5898 17 16M19 19H12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],$f=[[`path`,{d:`M13 20H8C5.17157 20 3.75736 20 2.87868 19.1213C2 18.2426 2 16.8284 2 14V8.49183C2 6.15409 2 4.98521 2.61604 4.17881C2.7778 3.96706 2.96706 3.7778 3.17881 3.61604C3.98521 3 5.15409 3 7.49183 3C8.16633 3 8.50358 3 8.81392 3.10442C8.8976 3.13257 8.97932 3.16623 9.05854 3.20518C9.35239 3.34965 9.59179 3.58719 10.0706 4.06227L10.8483 4.83389C11.4254 5.4066 11.714 5.69295 12.08 5.8437C12.446 5.99446 12.8525 5.99446 13.6656 5.99446H16C18.8284 5.99446 20.2426 5.99446 21.1213 6.87314C22 7.75182 22 9.16603 22 11.9945V12.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 15V21M22 18H16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ep=[[`path`,{d:`M13.6656 6.49446H16C18.8284 6.49446 20.2426 6.49446 21.1213 7.37314C22 8.25182 22 9.66603 22 12.4945V14.5C22 17.3284 22 18.7426 21.1213 19.6213C20.2426 20.5 18.8284 20.5 16 20.5H8C5.17157 20.5 3.75736 20.5 2.87868 19.6213C2 18.7426 2 17.3284 2 14.5V8.99183C2 6.65409 2 5.48521 2.61604 4.67881C2.7778 4.46706 2.96706 4.2778 3.17881 4.11604C3.98521 3.5 5.15409 3.5 7.49183 3.5C8.16633 3.5 8.50358 3.5 8.81392 3.60442C8.8976 3.63257 8.97932 3.66623 9.05854 3.70518C9.35239 3.84965 9.59179 4.08719 10.0706 4.56227L10.8483 5.33389C11.4254 5.9066 11.714 6.19295 12.08 6.3437C12.446 6.49446 12.8525 6.49446 13.6656 6.49446Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 10.5H17C18.8692 10.5 19.8038 10.5 20.5 10.9019C20.9561 11.1652 21.3348 11.5439 21.5981 12C22 12.6962 22 13.6308 22 15.5C22 17.3692 22 18.3038 21.5981 19C21.3348 19.4561 20.9561 19.8348 20.5 20.0981C19.8038 20.5 18.8692 20.5 17 20.5H7C5.13077 20.5 4.19615 20.5 3.5 20.0981C3.04394 19.8348 2.66523 19.4561 2.40192 19C2 18.3038 2 17.3692 2 15.5C2 13.6308 2 12.6962 2.40192 12C2.66523 11.5439 3.04394 11.1652 3.5 10.9019C4.19615 10.5 5.13077 10.5 7 10.5Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],tp=[[`path`,{d:`M12 8H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 12H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 20H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M12 16H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M3 4V11C3 12.8692 3 13.8038 3.40192 14.5C3.66523 14.9561 4.04394 15.3348 4.5 15.5981C5.19615 16 6.13077 16 8 16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M8 8H7C6.07003 8 5.60504 8 5.22354 7.89778C4.18827 7.62038 3.37962 6.81173 3.10222 5.77646C3 5.39496 3 4.92997 3 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],np=[[`path`,{d:`M2 11.4C2 10.2417 2.24173 10 3.4 10H20.6C21.7583 10 22 10.2417 22 11.4V12.6C22 13.7583 21.7583 14 20.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2 19.4C2 18.2417 2.24173 18 3.4 18H20.6C21.7583 18 22 18.2417 22 19.4V20.6C22 21.7583 21.7583 22 20.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}]],rp=[[`path`,{d:`M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ip=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.38886 15.1629C9.89331 15.5 10.5955 15.5 12 15.5C13.4045 15.5 14.1067 15.5 14.6111 15.1629C14.8295 15.017 15.017 14.8295 15.1629 14.6111C15.5 14.1067 15.5 13.4045 15.5 12C15.5 10.5955 15.5 9.89331 15.1629 9.38886C15.017 9.17048 14.8295 8.98298 14.6111 8.83706C14.1067 8.5 13.4045 8.5 12 8.5C10.5955 8.5 9.89331 8.5 9.38886 8.83706C9.17048 8.98298 8.98298 9.17048 8.83706 9.38886C8.5 9.89331 8.5 10.5955 8.5 12C8.5 13.4045 8.5 14.1067 8.83706 14.6111C8.98298 14.8295 9.17048 15.017 9.38886 15.1629Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ap=[[`path`,{d:`M8 2H9.01472C10.241 2 10.8541 2 11.4054 2.22836C11.9567 2.45672 12.3903 2.89027 13.2574 3.75736L21.1262 11.6263C21.6841 12.1867 21.9982 12.9449 22 13.7357L22 13.75L22 13.7643C21.9982 14.5551 21.6841 15.3133 21.1262 15.8737L15.8737 21.1262C15.3133 21.6841 14.5551 21.9982 13.7643 22L13.75 22L13.7357 22C12.9449 21.9982 12.1867 21.6841 11.6263 21.1262L3.75736 13.2574C2.89027 12.3903 2.45672 11.9567 2.22836 11.4054C2 10.8541 2 10.241 2 9.01472V8C2 5.17157 2 3.75736 2.87868 2.87868C3.75736 2 5.17157 2 8 2Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 7.25V7.5M8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],op=[[`path`,{d:`M3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C8.79275 3 5.97733 4.67765 4.38341 7.20327M3.29339 3.00076L3.46556 5.05452C3.58958 6.53384 3.65159 7.27349 4.13359 7.68914C4.61559 8.10479 5.32673 8.03185 6.74899 7.88595L8.79339 7.67625`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],sp=[[`path`,{d:`M21.544 11.045C21.848 11.4713 22 11.6845 22 12C22 12.3155 21.848 12.5287 21.544 12.955C20.1779 14.8706 16.6892 19 12 19C7.31078 19 3.8221 14.8706 2.45604 12.955C2.15201 12.5287 2 12.3155 2 12C2 11.6845 2.15201 11.4713 2.45604 11.045C3.8221 9.12944 7.31078 5 12 5C16.6892 5 20.1779 9.12944 21.544 11.045Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],Y=e(Te(),1),X=we();function cp(e){let t=lp(e.document,e.view);return t===null?null:(0,X.jsx)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:t})}function lp(e,t){return e===void 0?t===`explorer`?`Open a file from the explorer to start editing.`:`Select a change to see its diff.`:e.status===`large`?`This file is ${up(e.size)}, too large to open in the editor (limit ${up(e.limit)}).`:e.status===`binary`?`The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding.`:e.status===`error`?e.message:null}function up(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function dp(){let e=Fe(e=>e.errors);return e.length===0?null:(0,X.jsxs)(`div`,{role:`alert`,className:`bg-popover text-popover-foreground absolute right-3 bottom-9 z-20 flex w-96 max-w-[calc(100%-1.5rem)] items-start gap-2 rounded-md border p-3 text-[13px] shadow-lg`,children:[(0,X.jsx)(Se,{icon:ne,className:`text-destructive mt-0.5 size-4 shrink-0`}),(0,X.jsx)(`p`,{className:`min-w-0 flex-1 break-words whitespace-pre-wrap`,children:e.at(-1)}),(0,X.jsx)(`button`,{type:`button`,title:`Dismiss`,"aria-label":`Dismiss`,className:`hover:bg-accent grid size-5 shrink-0 cursor-pointer place-items-center rounded-sm`,onClick:Re,children:(0,X.jsx)(Se,{icon:xe,className:`size-3.5`})})]})}function fp(e,t){let n=localStorage.getItem(`editorWindow ${e} ${t}`);return n===null?{tabs:[],active:null,expanded:[],settings:{view:`explorer`,sidebar:!0,width:300,tree:!0,sort:`path`,messages:{},graphHeight:240,inline:!1,whitespace:!0,collapse:!1,smartCommit:!0,preview:!1}}:JSON.parse(n)}function pp(e,t,n){localStorage.setItem(`editorWindow ${e} ${t}`,JSON.stringify(n))}function mp(e){let t=(0,Y.useRef)(!1),n=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{let t=e.initial.lastIndexOf(`.`);n.current?.focus(),n.current?.setSelectionRange(0,t>0?t:e.initial.length)},[e.initial]),(0,X.jsx)(`input`,{ref:n,"aria-label":`Name`,defaultValue:e.initial,className:`border-primary bg-background text-foreground h-5 min-w-0 flex-1 border px-1 text-[13px] outline-none`,onKeyDown:n=>{n.key===`Enter`&&(t.current=!0,e.onCommit(n.currentTarget.value)),n.key===`Escape`&&(t.current=!0,e.onCancel())},onBlur:n=>{t.current||(t.current=!0,e.onCommit(n.currentTarget.value))}})}function hp(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(0),[s,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)({path:``,folder:!0}),[f,p]=(0,Y.useState)(null),[m,_]=(0,Y.useState)(null),v=(0,Y.useRef)(null),b=c();(0,Y.useEffect)(()=>{let t=!0;return Me(e.machine,`files.entries`,{projectId:e.projectId}).then(e=>{t&&(n(e),i(null))},e=>{t&&i(Oe(e))}),()=>{t=!1}},[e.machine,e.projectId,a]);let ne=(0,Y.useMemo)(()=>gp(t?.files??[],t?.folders??[]),[t]),ie=s??e.active,se=s??(e.active===null?``:_p(e.active));function le(t,n){let r=t===``?[]:t.split(`/`);e.onExpanded([...new Set([...e.expanded,...r.map((e,t)=>r.slice(0,t+1).join(`/`))])]),p({kind:`create`,parent:t,folder:n})}async function fe(t){if(f===null)return;p(null);let n=t.trim();if(n!==``)try{if(f.kind===`create`){let t=f.parent===``?n:`${f.parent}/${n}`;await Me(e.machine,`files.create`,{projectId:e.projectId,path:t,folder:f.folder}),f.folder&&e.onExpanded(e=>[...e,t]),f.folder||e.onOpen(t)}if(f.kind===`rename`&&n!==vp(f.path)){let t=_p(f.path),r=t===``?n:`${t}/${n}`;await Me(e.machine,`files.rename`,{projectId:e.projectId,path:f.path,to:r}),e.onRenamed(f.path,r)}o(e=>e+1)}catch(e){Ae(e)}}async function me(t){try{await Me(e.machine,`files.delete`,{projectId:e.projectId,path:t.path}),e.onDeleted(t.path),o(e=>e+1)}catch(e){Ae(e)}}function ge(e,t,n){return(0,X.jsxs)(`div`,{className:`flex h-[22px] items-center gap-1.5 pr-2`,style:{paddingLeft:8+e*12},children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),t&&(0,X.jsx)(Se,{icon:ep,className:`text-muted-foreground size-4 shrink-0`}),!t&&(0,X.jsx)(We,{path:n}),(0,X.jsx)(mp,{initial:n,onCommit:e=>void fe(e),onCancel:()=>p(null)})]},`input`)}function ve(t,n,r,i){return f?.kind===`rename`&&f.path===t?ge(n,r,vp(t)):(0,X.jsxs)(`button`,{type:`button`,"data-path":t,"data-folder":r,className:ke(`text-sidebar-foreground hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] w-full cursor-pointer items-center gap-1.5 pr-2 text-left text-[13px] outline-none focus-visible:ring-1 focus-visible:ring-inset`,t===ie&&`bg-sidebar-row-active`),style:{paddingLeft:8+n*12},onClick:()=>{r?(l(t),e.onExpanded(i?e.expanded.filter(e=>e!==t):[...e.expanded,t])):(l(null),e.onOpen(t))},children:[Array.from({length:n},(e,t)=>(0,X.jsx)(`span`,{"aria-hidden":!0,className:`border-sidebar-border pointer-events-none absolute inset-y-0 border-l opacity-0 transition-opacity group-hover/tree:opacity-100`,style:{left:16+t*12}},t)),r&&(0,X.jsx)(Se,{icon:Be,"aria-hidden":!0,className:ke(`text-muted-foreground size-4 shrink-0 transition-transform`,i&&`rotate-90`)}),!r&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),r&&(0,X.jsx)(Se,{icon:i?g:ep,className:`text-muted-foreground size-4 shrink-0`}),!r&&(0,X.jsx)(We,{path:t}),(0,X.jsx)(`span`,{className:`truncate`,children:vp(t)})]},t)}function be(t,n,r){return[f?.kind===`create`&&f.parent===n&&ge(r,f.folder,``),...[...t.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(t=>{let i=n===``?t[0]:`${n}/${t[0]}`,a=e.expanded.includes(i);return(0,X.jsxs)(`div`,{children:[ve(i,r,!0,a),a&&be(t[1],i,r+1)]},`dir:${i}`)}),...[...t.files].sort((e,t)=>e.localeCompare(t)).map(e=>ve(e,r,!1,!1))]}return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`New File…`,"aria-label":`New File`,onClick:()=>le(se,!1),children:(0,X.jsx)(Se,{icon:Zf,className:`size-4`})}),(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`New Folder…`,"aria-label":`New Folder`,onClick:()=>le(se,!0),children:(0,X.jsx)(Se,{icon:$f,className:`size-4`})}),(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`Refresh Explorer`,"aria-label":`Refresh Explorer`,onClick:()=>o(a+1),children:(0,X.jsx)(Se,{icon:ze,className:`size-4`})}),(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`Collapse Folders in Explorer`,"aria-label":`Collapse Folders in Explorer`,onClick:()=>e.onExpanded([]),children:(0,X.jsx)(Se,{icon:Ke,className:`size-4`})})]}),(0,X.jsxs)(he,{children:[(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsxs)(`div`,{className:`group/tree min-h-0 flex-1 overflow-y-auto pb-6`,onContextMenu:e=>{let t=e.target instanceof Element?e.target.closest(`[data-path]`):null;d(t===null?{path:``,folder:!0}:{path:t.dataset.path??``,folder:t.dataset.folder===`true`})},children:[r!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:r}),r===null&&t===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),r===null&&t!==null&&be(ne,``,0)]})}),(0,X.jsxs)(ce,{className:`min-w-48`,onCloseAutoFocus:e=>{v.current!==null&&(e.preventDefault(),v.current(),v.current=null)},children:[!u.folder&&Ge(u.path)===`markdown`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(pe,{onSelect:()=>e.onPreview(u.path),children:`Open Preview`}),(0,X.jsx)(ue,{})]}),(0,X.jsx)(pe,{onSelect:()=>{v.current=()=>le(u.folder?u.path:_p(u.path),!1)},children:`New File…`}),(0,X.jsx)(pe,{onSelect:()=>{v.current=()=>le(u.folder?u.path:_p(u.path),!0)},children:`New Folder…`}),(0,X.jsx)(ue,{}),(0,X.jsx)(pe,{onSelect:()=>void b.copy(u.path===``?e.root:`${e.root}/${u.path}`),children:`Copy Path`}),u.path!==``&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(pe,{onSelect:()=>void b.copy(u.path),children:`Copy Relative Path`}),!u.folder&&(0,X.jsx)(pe,{onSelect:()=>void ae(e.machine,e.projectId,u.path).catch(Ae),children:`Download`}),(0,X.jsx)(ue,{}),(0,X.jsx)(pe,{onSelect:()=>{v.current=()=>p({kind:`rename`,path:u.path,folder:u.folder})},children:`Rename…`}),(0,X.jsx)(pe,{variant:`destructive`,onSelect:()=>{v.current=()=>_(u)},children:`Delete`})]})]})]}),(0,X.jsx)(y,{open:m!==null,onOpenChange:e=>{e||_(null)},children:(0,X.jsxs)(oe,{children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(ye,{children:`Delete '${m===null?``:vp(m.path)}'?`}),(0,X.jsx)(re,{children:m?.folder===!0?`This folder and everything in it will be permanently deleted.`:`This file will be permanently deleted.`})]}),(0,X.jsxs)(te,{children:[(0,X.jsx)(de,{children:`Cancel`}),(0,X.jsx)(ee,{variant:`destructive`,onClick:()=>{m!==null&&me(m)},children:`Delete`})]})]})})]})}function gp(e,t){let n={folders:new Map,files:[]};function r(e){let t=n;for(let n of e){let e=t.folders.get(n)??{folders:new Map,files:[]};t.folders.set(n,e),t=e}return t}for(let e of t)r(e.split(`/`));for(let t of e)r(t.split(`/`).slice(0,-1)).files.push(t);return n}function _p(e){return e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``}function vp(e){return e.slice(e.lastIndexOf(`/`)+1)}function yp(e){return(0,X.jsx)(`div`,{role:`tablist`,className:`flex h-full min-w-0 flex-1 [scrollbar-width:thin] overflow-x-auto`,children:e.tabs.map(t=>{let n=t.id===e.active,r=e.dirty.includes(t.id);return(0,X.jsxs)(`div`,{role:`tab`,tabIndex:0,"aria-selected":n,title:t.path,className:ke(`group/tab border-sidebar-border relative flex shrink-0 cursor-pointer items-center gap-1.5 border-r pr-1.5 pl-3 text-[13px] outline-none select-none`,n&&`bg-background text-foreground`,!n&&`text-muted-foreground hover:bg-background/50`),onClick:()=>e.onSelect(t.id),onAuxClick:n=>{n.button===1&&e.onClose(t.id)},onKeyDown:n=>{n.key===`Enter`&&e.onSelect(t.id)},children:[n&&(0,X.jsx)(`span`,{className:`bg-primary absolute inset-x-0 top-0 h-px`}),(0,X.jsx)(We,{path:t.path}),(0,X.jsx)(`span`,{className:`max-w-48 truncate`,children:t.label}),e.tabs.some(e=>e!==t&&e.label===t.label)&&(0,X.jsx)(`span`,{className:`text-muted-foreground max-w-40 truncate text-xs`,children:_p(t.path)}),(0,X.jsxs)(`button`,{type:`button`,title:`Close`,"aria-label":`Close ${t.label}`,className:ke(`group/close hover:bg-accent flex size-5 cursor-pointer items-center justify-center rounded opacity-0 group-hover/tab:opacity-100 focus-visible:opacity-100`,(n||r)&&`opacity-100`),onClick:n=>{n.stopPropagation(),e.onClose(t.id)},children:[r&&(0,X.jsx)(`span`,{className:`bg-foreground size-2 rounded-full group-hover/close:hidden`}),(0,X.jsx)(Se,{icon:xe,className:ke(`size-3.5`,r&&`hidden group-hover/close:block`)})]})]},t.id)})})}var bp=class e{_ruleStack;constructor(e){this._ruleStack=e}get ruleStack(){return this._ruleStack}clone(){return new e(this._ruleStack)}equals(t){return!(!t||!(t instanceof e)||t!==this||t._ruleStack!==this._ruleStack)}};function xp(e){if(Array.isArray(e)&&(e=e[0]),e)return e=(e.charCodeAt(0)===35?e.slice(1):e).toLowerCase(),(e.length===3||e.length===4)&&(e=e.split(``).map(e=>e+e).join(``)),e}var Sp=/[\s,]+/;function Cp(e){let t=`rules`in e?e.rules:void 0;if(!t){t=[];let n=e.settings||e.tokenColors;for(let{scope:e,settings:{foreground:r,background:i,fontStyle:a}={}}of n){if(!r&&!i&&!a)continue;let n=Array.isArray(e)?e:e?[e]:[],o=Op(a),s=xp(r),c=xp(i);t.push(...n.map(e=>({token:e,foreground:s,background:c,fontStyle:o})))}}let n=Object.fromEntries(Object.entries(e.colors||{}).map(([e,t])=>[e,`#${xp(t)}`]));return{base:e.type===`light`?`vs`:`vs-dark`,inherit:!1,colors:n,rules:t}}function wp(e,t,n={}){let r=new Map,i=e.getLoadedThemes();for(let n of i){let i=Cp(e.getTheme(n));r.set(n,i),t.editor.defineTheme(n,i)}let a=[],o=new Map,s=t.editor.setTheme.bind(t.editor);t.editor.setTheme=t=>{let n=e.setTheme(t),i=r.get(t);a.length=n.colorMap.length;for(let e=0;e<n.colorMap.length;e++)a[e]=n.colorMap[e];o.clear(),i?.rules.forEach(e=>{let t=xp(e.foreground);if(!t)return;let n=kp(t,Op(e.fontStyle));o.has(n)||o.set(n,e.token)}),s(t)};let c=t.editor.create;t.editor.create=(e,n,r)=>(n?.theme&&t.editor.setTheme(n.theme),c(e,n,r)),t.editor.setTheme(i[0]);function l(e,t){let n=kp(e,Tp(t));return o.get(n)}let{tokenizeMaxLineLength:u=2e4,tokenizeTimeLimit:d=500}=n,f=new Set(t.languages.getLanguages().map(e=>e.id));for(let n of e.getLoadedLanguages())f.has(n)&&t.languages.setTokensProvider(n,{getInitialState(){return new bp(qe)},tokenize(t,r){if(t.length>=u)return{endState:r,tokens:[{startIndex:0,scopes:``}]};let i=e.getLanguage(n).tokenizeLine2(t,r.ruleStack,d);i.stoppedEarly&&console.warn(`Time limit reached when tokenizing line: ${t.substring(0,100)}`);let o=i.tokens.length/2,s=[];for(let e=0;e<o;e++){let t=i.tokens[2*e],n=i.tokens[2*e+1],r=Je.getForeground(n),o=xp(a[r]||``),c=Je.getFontStyle(n),u=o&&l(o,c)||``;s.push({startIndex:t,scopes:u})}return{endState:new bp(i.ruleStack),tokens:s}}})}function Tp(e){if(e<=Ye.None)return``;let t=[];return e&Ye.Italic&&t.push(`italic`),e&Ye.Bold&&t.push(`bold`),e&Ye.Underline&&t.push(`underline`),e&Ye.Strikethrough&&t.push(`strikethrough`),t.join(` `)}var Ep=[`italic`,`bold`,`underline`,`strikethrough`],Dp={"line-through":`strikethrough`};function Op(e){if(!e)return``;let t=new Set(e.split(Sp).map(e=>e.trim().toLowerCase()).map(e=>Dp[e]||e).filter(Boolean));return Ep.filter(e=>t.has(e)).join(` `)}function kp(e,t){return t?`${e}|${t}`:e}var Ap={},jp={},Mp=class e{static getOrCreate(t){return jp[t]||(jp[t]=new e(t)),jp[t]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,Ap[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function Z(e){let t=e.id;Ap[t]=e,Wc.register(e);let n=Mp.getOrCreate(t);Wc.registerTokensProviderFactory(t,{create:async()=>(await n.load()).language}),Wc.onLanguageEncountered(t,async()=>{let e=await n.load();Wc.setLanguageConfiguration(t,e.conf)})}Z({id:`abap`,extensions:[`.abap`],aliases:[`abap`,`ABAP`],loader:()=>J(()=>import(`./abap-08VXUWAP.js`),[])}),Z({id:`apex`,extensions:[`.cls`],aliases:[`Apex`,`apex`],mimetypes:[`text/x-apex-source`,`text/x-apex`],loader:()=>J(()=>import(`./apex-BWPQTe0t.js`),[])}),Z({id:`azcli`,extensions:[`.azcli`],aliases:[`Azure CLI`,`azcli`],loader:()=>J(()=>import(`./azcli-Bc_sGQ0U.js`),[])}),Z({id:`bat`,extensions:[`.bat`,`.cmd`],aliases:[`Batch`,`bat`],loader:()=>J(()=>import(`./bat-i0X4ZdIN.js`),[])}),Z({id:`bicep`,extensions:[`.bicep`],aliases:[`Bicep`],loader:()=>J(()=>import(`./bicep-B5-_aFwp.js`),[])}),Z({id:`cameligo`,extensions:[`.mligo`],aliases:[`Cameligo`],loader:()=>J(()=>import(`./cameligo-DMUM7wLl.js`),[])}),Z({id:`clojure`,extensions:[`.clj`,`.cljs`,`.cljc`,`.edn`],aliases:[`clojure`,`Clojure`],loader:()=>J(()=>import(`./clojure-Cm7r79vr.js`),[])}),Z({id:`coffeescript`,extensions:[`.coffee`],aliases:[`CoffeeScript`,`coffeescript`,`coffee`],mimetypes:[`text/x-coffeescript`,`text/coffeescript`],loader:()=>J(()=>import(`./coffee-Ba7i2nA0.js`),[])}),Z({id:`c`,extensions:[`.c`,`.h`],aliases:[`C`,`c`],loader:()=>J(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`cpp`,extensions:[`.cpp`,`.cc`,`.cxx`,`.hpp`,`.hh`,`.hxx`],aliases:[`C++`,`Cpp`,`cpp`],loader:()=>J(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`csharp`,extensions:[`.cs`,`.csx`,`.cake`],aliases:[`C#`,`csharp`],loader:()=>J(()=>import(`./csharp-BKxtCVv1.js`),[])}),Z({id:`csp`,extensions:[`.csp`],aliases:[`CSP`,`csp`],loader:()=>J(()=>import(`./csp-bTuwJoIa.js`),[])}),Z({id:`css`,extensions:[`.css`],aliases:[`CSS`,`css`],mimetypes:[`text/css`],loader:()=>J(()=>import(`./css-DIMkf-bt.js`),[])}),Z({id:`cypher`,extensions:[`.cypher`,`.cyp`],aliases:[`Cypher`,`OpenCypher`],loader:()=>J(()=>import(`./cypher-CVaqCwHa.js`),[])}),Z({id:`dart`,extensions:[`.dart`],aliases:[`Dart`,`dart`],mimetypes:[`text/x-dart-source`,`text/x-dart`],loader:()=>J(()=>import(`./dart-onAF5SnQ.js`),[])}),Z({id:`dockerfile`,extensions:[`.dockerfile`],filenames:[`Dockerfile`],aliases:[`Dockerfile`],loader:()=>J(()=>import(`./dockerfile-DZFCIeNp.js`),[])}),Z({id:`ecl`,extensions:[`.ecl`],aliases:[`ECL`,`Ecl`,`ecl`],loader:()=>J(()=>import(`./ecl-94qehhXe.js`),[])}),Z({id:`elixir`,extensions:[`.ex`,`.exs`],aliases:[`Elixir`,`elixir`,`ex`],loader:()=>J(()=>import(`./elixir-6RTg0lbw.js`),[])}),Z({id:`flow9`,extensions:[`.flow`],aliases:[`Flow9`,`Flow`,`flow9`,`flow`],loader:()=>J(()=>import(`./flow9-C5_-GSwl.js`),[])}),Z({id:`fsharp`,extensions:[`.fs`,`.fsi`,`.ml`,`.mli`,`.fsx`,`.fsscript`],aliases:[`F#`,`FSharp`,`fsharp`],loader:()=>J(()=>import(`./fsharp-C8Ef5oNN.js`),[])}),Z({id:`freemarker2`,extensions:[`.ftl`,`.ftlh`,`.ftlx`],aliases:[`FreeMarker2`,`Apache FreeMarker2`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-dollar`,aliases:[`FreeMarker2 (Angle/Dollar)`,`Apache FreeMarker2 (Angle/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAngleInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-dollar`,aliases:[`FreeMarker2 (Bracket/Dollar)`,`Apache FreeMarker2 (Bracket/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagBracketInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-bracket`,aliases:[`FreeMarker2 (Angle/Bracket)`,`Apache FreeMarker2 (Angle/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAngleInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-bracket`,aliases:[`FreeMarker2 (Bracket/Bracket)`,`Apache FreeMarker2 (Bracket/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagBracketInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-dollar`,aliases:[`FreeMarker2 (Auto/Dollar)`,`Apache FreeMarker2 (Auto/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-bracket`,aliases:[`FreeMarker2 (Auto/Bracket)`,`Apache FreeMarker2 (Auto/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`go`,extensions:[`.go`],aliases:[`Go`],loader:()=>J(()=>import(`./go-C-y9NEjX.js`),[])}),Z({id:`graphql`,extensions:[`.graphql`,`.gql`],aliases:[`GraphQL`,`graphql`,`gql`],mimetypes:[`application/graphql`],loader:()=>J(()=>import(`./graphql-fmXr3nnJ.js`),[])}),Z({id:`handlebars`,extensions:[`.handlebars`,`.hbs`],aliases:[`Handlebars`,`handlebars`,`hbs`],mimetypes:[`text/x-handlebars-template`],loader:()=>J(()=>import(`./handlebars-84NJRWd6.js`),__vite__mapDeps([5,1,2,3,4]))}),Z({id:`hcl`,extensions:[`.tf`,`.tfvars`,`.hcl`],aliases:[`Terraform`,`tf`,`HCL`,`hcl`],loader:()=>J(()=>import(`./hcl-CpzslTdj.js`),[])}),Z({id:`html`,extensions:[`.html`,`.htm`,`.shtml`,`.xhtml`,`.mdoc`,`.jsp`,`.asp`,`.aspx`,`.jshtm`],aliases:[`HTML`,`htm`,`html`,`xhtml`],mimetypes:[`text/html`,`text/x-jshtm`,`text/template`,`text/ng-template`],loader:()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))}),Z({id:`ini`,extensions:[`.ini`,`.properties`,`.gitconfig`],filenames:[`config`,`.gitattributes`,`.gitconfig`,`.editorconfig`],aliases:[`Ini`,`ini`],loader:()=>J(()=>import(`./ini-sBoK_t0W.js`),[])}),Z({id:`java`,extensions:[`.java`,`.jav`],aliases:[`Java`,`java`],mimetypes:[`text/x-java-source`,`text/x-java`],loader:()=>J(()=>import(`./java-BEtHBSE6.js`),[])}),Z({id:`javascript`,extensions:[`.js`,`.es6`,`.jsx`,`.mjs`,`.cjs`],firstLine:`^#!.*\\bnode`,filenames:[`jakefile`],aliases:[`JavaScript`,`javascript`,`js`],mimetypes:[`text/javascript`],loader:()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))}),Z({id:`julia`,extensions:[`.jl`],aliases:[`julia`,`Julia`],loader:()=>J(()=>import(`./julia-Bri6UV-V.js`),[])}),Z({id:`kotlin`,extensions:[`.kt`,`.kts`],aliases:[`Kotlin`,`kotlin`],mimetypes:[`text/x-kotlin-source`,`text/x-kotlin`],loader:()=>J(()=>import(`./kotlin-BOotOW0E.js`),[])}),Z({id:`less`,extensions:[`.less`],aliases:[`Less`,`less`],mimetypes:[`text/x-less`,`text/less`],loader:()=>J(()=>import(`./less-B9JPFI3C.js`),[])}),Z({id:`lexon`,extensions:[`.lex`],aliases:[`Lexon`],loader:()=>J(()=>import(`./lexon-CfSJPG6W.js`),[])}),Z({id:`lua`,extensions:[`.lua`],aliases:[`Lua`,`lua`],loader:()=>J(()=>import(`./lua-CsQS60Ue.js`),[])}),Z({id:`liquid`,extensions:[`.liquid`,`.html.liquid`],aliases:[`Liquid`,`liquid`],mimetypes:[`application/liquid`],loader:()=>J(()=>import(`./liquid-Dcyd1pkL.js`),__vite__mapDeps([9,1,2,3,4]))}),Z({id:`m3`,extensions:[`.m3`,`.i3`,`.mg`,`.ig`],aliases:[`Modula-3`,`Modula3`,`modula3`,`m3`],loader:()=>J(()=>import(`./m3-D-oSqn_W.js`),[])}),Z({id:`markdown`,extensions:[`.md`,`.markdown`,`.mdown`,`.mkdn`,`.mkd`,`.mdwn`,`.mdtxt`,`.mdtext`],aliases:[`Markdown`,`markdown`],loader:()=>J(()=>import(`./markdown-Cimd5fb3.js`),[])}),Z({id:`mdx`,extensions:[`.mdx`],aliases:[`MDX`,`mdx`],loader:()=>J(()=>import(`./mdx-DR7vQeQJ.js`),__vite__mapDeps([10,1,2,3,4]))}),Z({id:`mips`,extensions:[`.s`],aliases:[`MIPS`,`MIPS-V`],mimetypes:[`text/x-mips`,`text/mips`,`text/plaintext`],loader:()=>J(()=>import(`./mips-CIPQ_RoX.js`),[])}),Z({id:`msdax`,extensions:[`.dax`,`.msdax`],aliases:[`DAX`,`MSDAX`],loader:()=>J(()=>import(`./msdax-DauUninz.js`),[])}),Z({id:`mysql`,extensions:[],aliases:[`MySQL`,`mysql`],loader:()=>J(()=>import(`./mysql-SOo6toE5.js`),[])}),Z({id:`objective-c`,extensions:[`.m`],aliases:[`Objective-C`],loader:()=>J(()=>import(`./objective-c-FvmIjYaQ.js`),[])}),Z({id:`pascal`,extensions:[`.pas`,`.p`,`.pp`],aliases:[`Pascal`,`pas`],mimetypes:[`text/x-pascal-source`,`text/x-pascal`],loader:()=>J(()=>import(`./pascal-DrH0SRf2.js`),[])}),Z({id:`pascaligo`,extensions:[`.ligo`],aliases:[`Pascaligo`,`ligo`],loader:()=>J(()=>import(`./pascaligo-D-ptJ9y-.js`),[])}),Z({id:`perl`,extensions:[`.pl`,`.pm`],aliases:[`Perl`,`pl`],loader:()=>J(()=>import(`./perl-oz_6vUea.js`),[])}),Z({id:`pgsql`,extensions:[],aliases:[`PostgreSQL`,`postgres`,`pg`,`postgre`],loader:()=>J(()=>import(`./pgsql-DTj74zXo.js`),[])}),Z({id:`php`,extensions:[`.php`,`.php4`,`.php5`,`.phtml`,`.ctp`],aliases:[`PHP`,`php`],mimetypes:[`application/x-php`],loader:()=>J(()=>import(`./php-nr791fC2.js`),[])}),Z({id:`pla`,extensions:[`.pla`],loader:()=>J(()=>import(`./pla-CopQ2nXW.js`),[])}),Z({id:`postiats`,extensions:[`.dats`,`.sats`,`.hats`],aliases:[`ATS`,`ATS/Postiats`],loader:()=>J(()=>import(`./postiats-43DmfD33.js`),[])}),Z({id:`powerquery`,extensions:[`.pq`,`.pqm`],aliases:[`PQ`,`M`,`Power Query`,`Power Query M`],loader:()=>J(()=>import(`./powerquery-D3hlyOfw.js`),[])}),Z({id:`powershell`,extensions:[`.ps1`,`.psm1`,`.psd1`],aliases:[`PowerShell`,`powershell`,`ps`,`ps1`],loader:()=>J(()=>import(`./powershell-DmHpPYUd.js`),[])}),Z({id:`proto`,extensions:[`.proto`],aliases:[`protobuf`,`Protocol Buffers`],loader:()=>J(()=>import(`./protobuf-C531GsRP.js`),[])}),Z({id:`pug`,extensions:[`.jade`,`.pug`],aliases:[`Pug`,`Jade`,`jade`],loader:()=>J(()=>import(`./pug-Z5eAx3Zn.js`),[])}),Z({id:`python`,extensions:[`.py`,`.rpy`,`.pyw`,`.cpy`,`.gyp`,`.gypi`],aliases:[`Python`,`py`],firstLine:`^#!/.*\\bpython[0-9.-]*\\b`,loader:()=>J(()=>import(`./python-CiSQgsVi.js`),__vite__mapDeps([11,1,2,3,4]))}),Z({id:`qsharp`,extensions:[`.qs`],aliases:[`Q#`,`qsharp`],loader:()=>J(()=>import(`./qsharp-DkqhCAOL.js`),[])}),Z({id:`r`,extensions:[`.r`,`.rhistory`,`.rmd`,`.rprofile`,`.rt`],aliases:[`R`,`r`],loader:()=>J(()=>import(`./r-BwWrilGY.js`),[])}),Z({id:`razor`,extensions:[`.cshtml`],aliases:[`Razor`,`razor`],mimetypes:[`text/x-cshtml`],loader:()=>J(()=>import(`./razor-WdSU-o-W.js`),__vite__mapDeps([12,1,2,3,4]))}),Z({id:`redis`,extensions:[`.redis`],aliases:[`redis`],loader:()=>J(()=>import(`./redis-ClamHrr6.js`),[])}),Z({id:`redshift`,extensions:[],aliases:[`Redshift`,`redshift`],loader:()=>J(()=>import(`./redshift-DT7zqm-g.js`),[])}),Z({id:`restructuredtext`,extensions:[`.rst`],aliases:[`reStructuredText`,`restructuredtext`],loader:()=>J(()=>import(`./restructuredtext-BYgofb2h.js`),[])}),Z({id:`ruby`,extensions:[`.rb`,`.rbx`,`.rjs`,`.gemspec`,`.pp`],filenames:[`rakefile`,`Gemfile`],aliases:[`Ruby`,`rb`],loader:()=>J(()=>import(`./ruby-DezsRK8O.js`),[])}),Z({id:`rust`,extensions:[`.rs`,`.rlib`],aliases:[`Rust`,`rust`],loader:()=>J(()=>import(`./rust-DdL9SqIa.js`),[])}),Z({id:`sb`,extensions:[`.sb`],aliases:[`Small Basic`,`sb`],loader:()=>J(()=>import(`./sb-CcwsVR0C.js`),[])}),Z({id:`scala`,extensions:[`.scala`,`.sc`,`.sbt`],aliases:[`Scala`,`scala`,`SBT`,`Sbt`,`sbt`,`Dotty`,`dotty`],mimetypes:[`text/x-scala-source`,`text/x-scala`,`text/x-sbt`,`text/x-dotty`],loader:()=>J(()=>import(`./scala-DHpiXF5c.js`),[])}),Z({id:`scheme`,extensions:[`.scm`,`.ss`,`.sch`,`.rkt`],aliases:[`scheme`,`Scheme`],loader:()=>J(()=>import(`./scheme-BeGwcela.js`),[])}),Z({id:`scss`,extensions:[`.scss`],aliases:[`Sass`,`sass`,`scss`],mimetypes:[`text/x-scss`,`text/scss`],loader:()=>J(()=>import(`./scss-gp-XZpBa.js`),[])}),Z({id:`shell`,extensions:[`.sh`,`.bash`],aliases:[`Shell`,`sh`],loader:()=>J(()=>import(`./shell-CC2rA5mh.js`),[])}),Z({id:`sol`,extensions:[`.sol`],aliases:[`sol`,`solidity`,`Solidity`],loader:()=>J(()=>import(`./solidity-BEEn4gHE.js`),[])}),Z({id:`aes`,extensions:[`.aes`],aliases:[`aes`,`sophia`,`Sophia`],loader:()=>J(()=>import(`./sophia-CRfGWb83.js`),[])}),Z({id:`sparql`,extensions:[`.rq`],aliases:[`sparql`,`SPARQL`],loader:()=>J(()=>import(`./sparql-D_Lu-MrJ.js`),[])}),Z({id:`sql`,extensions:[`.sql`],aliases:[`SQL`],loader:()=>J(()=>import(`./sql-NEE52Syq.js`),[])}),Z({id:`st`,extensions:[`.st`,`.iecst`,`.iecplc`,`.lc3lib`,`.TcPOU`,`.TcDUT`,`.TcGVL`,`.TcIO`],aliases:[`StructuredText`,`scl`,`stl`],loader:()=>J(()=>import(`./st-DbInun42.js`),[])}),Z({id:`swift`,aliases:[`Swift`,`swift`],extensions:[`.swift`],mimetypes:[`text/swift`],loader:()=>J(()=>import(`./swift-Bxkupp3x.js`),[])}),Z({id:`systemverilog`,extensions:[`.sv`,`.svh`],aliases:[`SV`,`sv`,`SystemVerilog`,`systemverilog`],loader:()=>J(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`verilog`,extensions:[`.v`,`.vh`],aliases:[`V`,`v`,`Verilog`,`verilog`],loader:()=>J(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`tcl`,extensions:[`.tcl`],aliases:[`tcl`,`Tcl`,`tcltk`,`TclTk`,`tcl/tk`,`Tcl/Tk`],loader:()=>J(()=>import(`./tcl-DISqw1ZD.js`),[])}),Z({id:`twig`,extensions:[`.twig`],aliases:[`Twig`,`twig`],mimetypes:[`text/x-twig`],loader:()=>J(()=>import(`./twig-De2hgUGE.js`),[])}),Z({id:`typescript`,extensions:[`.ts`,`.tsx`,`.cts`,`.mts`],aliases:[`TypeScript`,`ts`,`typescript`],mimetypes:[`text/typescript`],loader:()=>J(()=>import(`./typescript-Dy13l_qr.js`),__vite__mapDeps([13,8,1,2,3,4]))}),Z({id:`typespec`,extensions:[`.tsp`],aliases:[`TypeSpec`],loader:()=>J(()=>import(`./typespec-B8J7ngcE.js`),[])}),Z({id:`vb`,extensions:[`.vb`],aliases:[`Visual Basic`,`vb`],loader:()=>J(()=>import(`./vb-DV3o63ZY.js`),[])}),Z({id:`wgsl`,extensions:[`.wgsl`],aliases:[`WebGPU Shading Language`,`WGSL`,`wgsl`],loader:()=>J(()=>import(`./wgsl-DpFanUEy.js`),[])}),Z({id:`xml`,extensions:[`.xml`,`.xsd`,`.dtd`,`.ascx`,`.csproj`,`.config`,`.props`,`.targets`,`.wxi`,`.wxl`,`.wxs`,`.xaml`,`.svg`,`.svgz`,`.opf`,`.xslt`,`.xsl`],firstLine:`(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)`,aliases:[`XML`,`xml`],mimetypes:[`text/xml`,`application/xml`,`application/xaml+xml`,`application/xml-dtd`],loader:()=>J(()=>import(`./xml-AovvXo6A.js`),__vite__mapDeps([14,1,2,3,4]))}),Z({id:`yaml`,extensions:[`.yaml`,`.yml`],aliases:[`YAML`,`yaml`,`YML`,`yml`],mimetypes:[`application/x-yaml`,`text/x-yaml`],loader:()=>J(()=>import(`./yaml-EESuZNdc.js`),__vite__mapDeps([15,1,2,3,4]))});var Np=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},Pp=function(e,t){return function(n,r){t(n,r,e)}},Fp,Ip=new j(`selectionAnchorSet`,!1),Lp=class{static{Fp=this}static{this.ID=`editor.contrib.selectionAnchorController`}static get(e){return e.getContribution(Fp.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Ip.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(q.fromPositions(e,e),{description:`selection-anchor`,stickiness:1,hoverMessage:new Oi().appendText(x(849,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),bo(x(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(q.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()}};Lp=Fp=Np([Pp(1,Fa)],Lp);var Rp=class extends W{constructor(){super({id:`editor.action.setSelectionAnchor`,label:L(851,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:Or(2089,2080),weight:100}})}async run(e,t){Lp.get(t)?.setSelectionAnchor()}},zp=class extends W{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:L(852,`Go to Selection Anchor`),precondition:Ip})}async run(e,t){Lp.get(t)?.goToSelectionAnchor()}},Bp=class extends W{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:L(853,`Select from Anchor to Cursor`),precondition:Ip,kbOpts:{kbExpr:E.editorTextFocus,primary:Or(2089,2089),weight:100}})}async run(e,t){Lp.get(t)?.selectFromAnchorToCursor()}},Vp=class extends W{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:L(854,`Cancel Selection Anchor`),precondition:Ip,kbOpts:{kbExpr:E.editorTextFocus,primary:9,weight:100}})}async run(e,t){Lp.get(t)?.cancelSelectionAnchor()}};Ps(Lp.ID,Lp,4),z(Rp),z(zp),z(Bp),z(Vp);var Hp=O(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,x(855,`Overview ruler marker color for matching brackets.`)),Up=class extends W{constructor(){super({id:`editor.action.jumpToBracket`,label:L(857,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:3165,weight:100}})}run(e,t){qp.get(t)?.jumpToBracket()}},Wp=class extends W{constructor(){super({id:`editor.action.selectToBracket`,label:L(858,`Select to Bracket`),precondition:void 0,metadata:{description:L(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),qp.get(t)?.selectToBracket(r)}},Gp=class extends W{constructor(){super({id:`editor.action.removeBrackets`,label:L(860,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){qp.get(t)?.removeBrackets(this.id)}},Kp=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},qp=class e extends G{static{this.ID=`editor.contrib.bracketMatchingController`}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 Pr(()=>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 q(i.lineNumber,i.column,i.lineNumber,i.column):new q(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(C.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 q(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())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=P.register({description:`bracket-match-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`,overviewRuler:{color:ro(Hp),position:Qi.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=P.register({description:`bracket-match-no-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`})}_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(A.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 Kp(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};Ps(qp.ID,qp,1),z(Wp),z(Up),z(Gp),wn.appendMenuItem(D.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:x(856,`Go to &&Bracket`)},order:2}),Pa((e,t)=>{let n=e.getColor(Hf);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)}),z(class extends W{constructor(){super({id:`editor.action.transposeLetters`,label:L(863,`Transpose Letters`),precondition:E.writable,kbOpts:{kbExpr:E.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():Xu.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=Xu.leftPosition(n,o),c=Xu.leftPosition(n,s),l=n.getValueInRange(C.fromPositions(c,s)),u=n.getValueInRange(C.fromPositions(s,o)),d=C.fromPositions(c,o);r.push(new Yc(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var Jp=class e{static{this.sep=`.`}static{this.None=new e(`@@none@@`)}static{this.Empty=new 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))}},Yp=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},Xp=function(e,t){return function(n,r){t(n,r,e)}},Zp=P.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0,widthInEm:1}}),Qp=class e extends G{static{this.baseId=`editor.widget.inlineProgressWidget`}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=M(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=M(`span.icon`);this.domNode.append(t),t.classList.add(...V.asClassNameArray(k.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(I(this.domNode,Ol.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)}},$p=class extends G{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new lc),this._currentWidget=this._register(new lc),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=Ua(()=>{let n=C.fromPositions(e);this._currentDecorations.set([{range:n,options:Zp}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Qp,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()}};$p=Yp([Xp(2,U)],$p);var 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=class{static{nm=this}static{this.ID=`editor.contrib.messageController`}static{this.MESSAGE_VISIBLE=new j(`messageVisible`,!1,x(1353,`Whether the editor is currently showing an inline message`))}static get(e){return e.getContribution(nm.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new lc,this._messageListeners=new F,this._mouseOverMessage=!1,this._editor=e,this._visible=nm.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(bo(Fr(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Fr(e)){let n=this._messageListeners.add(bl(e,{actionHandler:(e,t)=>{this.closeMessage(),ln(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new am(this._editor,t,n.element)}else this._messageWidget.value=new am(this._editor,t,e);this._messageListeners.add(pu.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&_n(ff(),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(I(this._messageWidget.value.getDomNode(),Ol.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(I(this._messageWidget.value.getDomNode(),Ol.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 C(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(am.fadeOut(this._messageWidget.value))}};rm=nm=em([tm(1,Fa),tm(2,Xt)],rm);var im=td.bindToContribution(rm.get);H(new im({id:`leaveEditorMessage`,precondition:rm.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var am=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)}};Ps(rm.ID,rm,4);var om=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},sm=function(e,t){return function(n,r){t(n,r,e)}},cm=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(){}}}},lm=class e extends cm{static{this.id=`text`}constructor(){super(Jp.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[Eo.text],this.pasteMimeTypes=[Eo.text]}async getEdit(e,t){let n=e.get(Eo.text);if(!n||e.has(Eo.uriList))return;let r=await n.asString();return{handledMimeType:Eo.text,title:x(980,`Insert Plain Text`),insertText:r,kind:this.kind}}},um=class extends cm{constructor(){super(Jp.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[Eo.uriList],this.pasteMimeTypes=[Eo.uriList]}async getEdit(e,t){let n=await pm(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===sl.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?x(981,`Insert Uris`):x(982,`Insert Uri`):n.length>1?x(983,`Insert Paths`):x(984,`Insert Path`),{handledMimeType:Eo.uriList,insertText:i,title:a,kind:this.kind}}},dm=class extends cm{constructor(e){super(Jp.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[Eo.uriList],this.pasteMimeTypes=[Eo.uriList]}async getEdit(e,t){let n=await pm(e);if(!n.length||t.isCancellationRequested)return;let r=mu(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?fn(t.uri,e):void 0}));if(r.length)return{handledMimeType:Eo.uriList,insertText:r.join(` `),title:n.length>1?x(985,`Insert Relative Paths`):x(986,`Insert Relative Path`),kind:this.kind}}};dm=om([sm(0,bu)],dm);var fm=class{constructor(){this.kind=new Jp(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:Eo.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==pa.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:x(987,`Insert HTML`),kind:this.kind}]}}};async function pm(e){let t=e.get(Eo.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of Ul.parse(n))try{r.push({uri:Yn.parse(e),originalText:e})}catch{}return r}var mm={scheme:`*`,hasAccessToAllModels:!0},hm=class extends G{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(mm,new lm)),this._register(e.documentDropEditProvider.register(mm,new um)),this._register(e.documentDropEditProvider.register(mm,new dm(t)))}};hm=om([sm(0,R),sm(1,bu)],hm);var gm=class extends G{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(mm,new lm)),this._register(e.documentPasteEditProvider.register(mm,new um)),this._register(e.documentPasteEditProvider.register(mm,new dm(t))),this._register(e.documentPasteEditProvider.register(mm,new fm))}};gm=om([sm(0,R),sm(1,bu)],gm);var _m=class e{constructor(){this.value=``,this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}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}}},vm=class{constructor(){this._children=[]}appendChild(e){return e instanceof ym&&this._children[this._children.length-1]instanceof ym?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 Dm)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},ym=class e extends vm{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},bm=class extends vm{},xm=class e extends bm{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 Sm?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}},Sm=class e extends vm{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof ym&&(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}},Cm=class e extends vm{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 wm&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof wm){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}},wm=class e extends vm{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)}},Tm=class e extends bm{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 ym(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 Em(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var Dm=class e extends vm{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof xm&&(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 Em([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof xm&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Tm&&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){Em(this.children,e)}},Om=class{constructor(){this._scanner=new _m,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 Dm;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 xm&&(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 xm(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof xm&&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 xm(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 ym(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 xm(Number(t)):new Tm(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 xm(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ym("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new Sm;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 ym(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 Tm(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ym("${"+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 Cm,n=``,r=``;for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,n+=e;else if(this._token.type!==14)n+=this._accept(void 0,!0);else 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 ym(e));else if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);)if(this._token.type!==14)r+=this._accept(void 0,!0);else 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 wm(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 wm(Number(r),n)),!0)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new wm(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new wm(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 wm(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new wm(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14&&(e.appendChild(new ym(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function km(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new tl(e,{range:t,text:typeof n.insertText==`string`?Om.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function Am(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 jm(e,t){return t&&(e.stack||e.stacktrace)?x(33,`{0}: {1}`,Nm(e),Mm(e.stack)||Mm(e.stacktrace)):Nm(e)}function Mm(e){return Array.isArray(e)?e.join(`
|
|
2
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{A as t,B as n,D as r,F as i,H as a,M as o,N as s,O as c,P as l,Q as u,R as d,U as f,V as p,W as m,_ as h,at as g,b as _,ct as v,d as y,dt as b,f as ee,g as te,gt as ne,h as re,it as ie,k as ae,m as oe,mt as se,n as ce,nt as le,o as ue,p as de,pt as fe,r as pe,st as me,t as he,tt as ge,u as _e,ut as ve,v as ye,z as be}from"./context-menu-ah5Njpdz.js";import{A as xe,N as Se,P as Ce,Ut as we,Wt as Te,j as Ee,m as De,t as Oe,v as ke,w as Ae}from"./XIcon-BF9rDynM.js";import{a as je,t as Me}from"./button-CWFREsRn.js";import{c as Ne,l as Pe,n as Fe,o as Ie,r as Le,t as Re}from"./utils-U6QfaJBO.js";import{a as ze,l as Be,r as Ve,u as He}from"./preview-dialog-B-LOxdLg.js";import{n as Ue,r as We}from"./TextWrapIcon-BRhMbXe9.js";import{n as Ge,r as Ke}from"./getFiletypeFromFileName-DGoZTiUS.js";import{G as qe,U as Je,W as Ye,d as Xe,h as Ze,o as Qe}from"./dist-TdUDcI9m.js";import{$ as $e,$a as et,$c as tt,$d as nt,$i as rt,$l as it,$n as at,$o as ot,$r as st,$s as ct,$t as lt,$u as ut,A as dt,Aa as ft,Ac as pt,Ad as x,Ai as mt,Al as ht,An as gt,Ao as _t,Ar as vt,As as yt,At as bt,Au as xt,B as St,Ba as Ct,Bc as S,Bd as wt,Bi as Tt,Bl as Et,Bn as Dt,Bo as Ot,Br as kt,Bs as At,Bt as jt,Bu as C,C as Mt,Ca as Nt,Cc as Pt,Cd as Ft,Ci as It,Cl as Lt,Cn as Rt,Co as zt,Cr as Bt,Cs as Vt,Ct as Ht,Cu as Ut,D as Wt,Da as Gt,Dc as Kt,Dd as qt,Di as Jt,Dl as Yt,Dn as Xt,Do as Zt,Dr as Qt,Ds as $t,Dt as en,Du as tn,E as nn,Ea as rn,Ec as an,Ed as on,Ei as sn,El as cn,En as ln,Eo as un,Er as dn,Es as fn,Et as pn,Eu as mn,F as hn,Fa as gn,Fc as _n,Fd as vn,Fi as yn,Fl as bn,Fn as xn,Fo as Sn,Fr as Cn,Fs as wn,Ft as Tn,Fu as En,G as Dn,Ga as On,Gc as kn,Gd as An,Gi as jn,Gl as Mn,Gn as Nn,Go as Pn,Gr as Fn,Gs as In,Gt as Ln,Gu as Rn,H as zn,Ha as Bn,Hc as Vn,Hd as Hn,Hi as Un,Hl as Wn,Hn as Gn,Ho as Kn,Hr as qn,Hs as w,Ht as Jn,Hu as Yn,Ia as Xn,Ic as Zn,Id as Qn,Ii as $n,Il as er,In as tr,Io as nr,Ir as rr,Is as ir,It as ar,Iu as or,J as sr,Ja as cr,Jc as lr,Jd as ur,Ji as dr,Jl as fr,Jn as pr,Jo as mr,Jr as hr,Js as gr,Jt as _r,Ju as T,K as vr,Ka as yr,Kc as br,Kd as xr,Ki as Sr,Kl as Cr,Kn as wr,Ko as Tr,Kr as E,Ks as Er,Kt as Dr,Ku as Or,L as kr,La as Ar,Lc as jr,Ld as Mr,Li as Nr,Ll as Pr,Ln as Fr,Lo as Ir,Lr,Ls as Rr,Lt as zr,Lu as Br,M as Vr,Ma as Hr,Mc as Ur,Md as Wr,Mi as Gr,Ml as Kr,Mn as qr,Mo as Jr,Mr as Yr,Ms as Xr,Mt as Zr,Mu as Qr,N as $r,Na as ei,Nc as ti,Nd as ni,Ni as ri,Nl as ii,Nn as ai,No as oi,Nr as si,Ns as D,Nt as ci,Nu as li,O as ui,Oa as di,Oc as fi,Od as pi,Oi as mi,Ol as hi,On as gi,Oo as _i,Or as vi,Os as yi,Ot as bi,Ou as xi,P as Si,Pa as Ci,Pc as wi,Pd as Ti,Pi as Ei,Pl as Di,Pn as Oi,Po as ki,Pr as Ai,Ps as ji,Pt as Mi,Pu as Ni,Q as Pi,Qa as Fi,Qc as Ii,Qd as Li,Qi as Ri,Ql as zi,Qn as Bi,Qo as Vi,Qr as Hi,Qs as Ui,Qt as Wi,Qu as Gi,R as Ki,Ra as O,Rc as qi,Rd as Ji,Ri as Yi,Rl as Xi,Rn as Zi,Ro as Qi,Rr as $i,Rs as ea,Rt as ta,Ru as k,S as na,Sa as ra,Sc as ia,Sd as aa,Si as oa,Sl as sa,Sn as ca,So as la,Sr as ua,Ss as da,St as fa,Su as pa,T as ma,Ta as ha,Tc as ga,Td as _a,Ti as va,Tl as ya,Tn as ba,To as xa,Tr as Sa,Ts as Ca,Tt as wa,Tu as Ta,U as Ea,Ua as Da,Uc as Oa,Ud as ka,Ui as Aa,Ul as ja,Un as Ma,Uo as Na,Ur as Pa,Us as Fa,Ut as Ia,Uu as La,V as Ra,Va as za,Vc as Ba,Vd as Va,Vi as Ha,Vl as Ua,Vn as Wa,Vo as Ga,Vr as Ka,Vs as qa,Vt as Ja,Vu as A,W as Ya,Wa as Xa,Wc as Za,Wd as Qa,Wi as $a,Wl as eo,Wn as to,Wo as no,Wr as ro,Ws as j,Wt as io,Wu as ao,X as oo,Xa as so,Xc as co,Xd as lo,Xi as uo,Xl as fo,Xn as po,Xo as mo,Xr as ho,Xs as go,Xt as _o,Xu as vo,Y as yo,Ya as bo,Yc as xo,Yd as So,Yi as Co,Yl as wo,Yn as To,Yo as Eo,Yr as Do,Ys as Oo,Yt as ko,Yu as Ao,Z as jo,Za as Mo,Zc as No,Zd as Po,Zi as Fo,Zl as Io,Zn as Lo,Zo as Ro,Zr as zo,Zs as Bo,Zt as Vo,Zu as Ho,_ as Uo,_a as Wo,_c as Go,_d as Ko,_f as qo,_i as Jo,_l as Yo,_n as Xo,_o as Zo,_r as Qo,_s as $o,_t as es,_u as ts,a as ns,aa as rs,ac as M,ad as N,af as is,ai as as,al as os,an as ss,ao as cs,ar as ls,as as us,at as ds,au as fs,b as ps,ba as ms,bc as hs,bd as gs,bi as _s,bl as vs,bn as ys,bo as bs,br as xs,bs as Ss,bt as Cs,bu as ws,c as Ts,ca as Es,cc as Ds,cd as Os,cf as ks,ci as As,cl as js,cn as Ms,co as Ns,cr as P,cs as Ps,ct as Fs,cu as Is,d as Ls,da as Rs,dc as zs,dd as F,df as Bs,di as Vs,dl as Hs,dn as Us,do as Ws,dr as Gs,ds as Ks,dt as qs,du as Js,ea as Ys,ec as Xs,ef as Zs,ei as Qs,el as $s,en as ec,eo as tc,er as nc,es as rc,et as ic,eu as ac,f as oc,fa as sc,fc as cc,fd as lc,ff as uc,fi as dc,fl as fc,fn as pc,fo as mc,fr as hc,fs as gc,ft as _c,fu as vc,g as yc,ga as bc,gc as xc,gd as Sc,gf as Cc,gi as wc,gl as Tc,gn as Ec,go as Dc,gr as Oc,gs as kc,gt as Ac,gu as jc,h as Mc,ha as Nc,hc as I,hd as Pc,hf as Fc,hi as Ic,hl as Lc,hn as Rc,ho as zc,hr as Bc,hs as Vc,ht as Hc,hu as Uc,i as Wc,ia as Gc,ic as Kc,id as qc,if as Jc,ii as Yc,il as Xc,in as Zc,io as Qc,ir as $c,is as el,it as tl,iu as nl,j as rl,ja as il,jc as al,jd as L,ji as ol,jl as sl,jn as cl,jo as ll,jr as ul,js as dl,jt as fl,ju as pl,k as ml,ka as hl,kc as gl,kd as _l,ki as vl,kl as yl,kn as bl,ko as xl,kr as Sl,ks as Cl,kt as wl,ku as Tl,l as El,la as Dl,lc as Ol,ld as kl,lf as Al,li as jl,ll as Ml,ln as Nl,lo as R,lr as Pl,ls as Fl,lt as Il,lu as Ll,m as Rl,ma as zl,mc as Bl,md as Vl,mf as Hl,mi as Ul,ml as Wl,mn as Gl,mo as Kl,mr as ql,ms as Jl,mt as Yl,mu as Xl,n as Zl,na as Ql,nc as $l,nd as eu,nf as tu,ni as nu,nl as ru,nn as iu,no as au,nr as ou,ns as su,nt as cu,nu as lu,o as uu,oa as du,oc as fu,od as pu,of as mu,oi as hu,ol as gu,on as _u,oo as vu,or as yu,os as z,ot as bu,ou as xu,p as Su,pa as Cu,pc as wu,pd as Tu,pf as Eu,pi as Du,pl as B,pn as Ou,po as ku,pr as Au,ps as ju,pt as Mu,pu as Nu,q as Pu,qa as Fu,qc as Iu,qd as Lu,qi as Ru,ql as zu,qn as Bu,qo as Vu,qr as Hu,qs as V,qt as Uu,qu as Wu,r as Gu,ra as Ku,rc as qu,rd as Ju,rf as Yu,ri as Xu,rl as Zu,rn as Qu,ro as $u,rr as ed,rs as td,rt as nd,ru as rd,s as id,sa as ad,sc as od,sd,sf as cd,si as ld,sl as ud,sn as dd,so as fd,sr as pd,ss as H,st as md,su as hd,t as gd,ta as _d,tc as U,td as vd,tf as yd,ti as bd,tl as xd,tn as Sd,to as Cd,tr as wd,ts as W,tt as Td,tu as Ed,u as Dd,ua as Od,uc as kd,ud as G,uf as Ad,ui as jd,ul as Md,un as Nd,uo as Pd,ur as Fd,us as Id,ut as Ld,uu as Rd,v as zd,va as Bd,vc as K,vd as Vd,vf as Hd,vi as Ud,vl as Wd,vn as Gd,vo as Kd,vr as qd,vs as Jd,vt as Yd,vu as Xd,w as Zd,wa as Qd,wc as $d,wd as ef,wi as tf,wl as nf,wn as rf,wo as af,wr as of,ws as sf,wt as cf,wu as lf,x as uf,xa as df,xc as ff,xd as pf,xi as mf,xl as hf,xn as gf,xo as _f,xr as vf,xs as yf,xt as bf,xu as xf,y as Sf,ya as Cf,yc as wf,yd as Tf,yi as Ef,yl as Df,yn as Of,yo as kf,yr as Af,ys as jf,yt as Mf,yu as Nf,z as Pf,za as Ff,zc as If,zd as Lf,zi as Rf,zl as zf,zn as Bf,zo as Vf,zr as Hf,zs as Uf,zt as Wf,zu as q}from"./editor.api-Rfucz3mk.js";import{t as J}from"./preload-helper-BLdHbfdN.js";import{i as Gf,t as Kf}from"./langs-DssLtjmH.js";import{t as qf}from"./engine-oniguruma-BMl9YtsA.js";import{t as Jf}from"./MinusSignIcon-DGIm2EHe.js";import{c as Yf}from"./tooltip-CVA2QYzo.js";var Xf=[[`path`,{d:`M17.4776 9.01106C17.485 9.01102 17.4925 9.01101 17.5 9.01101C19.9853 9.01101 22 11.0294 22 13.5193C22 15.8398 20.25 17.7508 18 18M17.4776 9.01106C17.4924 8.84606 17.5 8.67896 17.5 8.51009C17.5 5.46695 15.0376 3 12 3C9.12324 3 6.76233 5.21267 6.52042 8.03192M17.4776 9.01106C17.3753 10.1476 16.9286 11.1846 16.2428 12.0165M6.52042 8.03192C3.98398 8.27373 2 10.4139 2 13.0183C2 15.4417 3.71776 17.4632 6 17.9273M6.52042 8.03192C6.67826 8.01687 6.83823 8.00917 7 8.00917C8.12582 8.00917 9.16474 8.38194 10.0005 9.01101`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 21L12 13M12 21C11.2998 21 9.99153 19.0057 9.5 18.5M12 21C12.7002 21 14.0085 19.0057 14.5 18.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Zf=[[`path`,{d:`M4 12.0005L4 14.5446C4 17.7896 4 19.4122 4.88607 20.5111C5.06508 20.7331 5.26731 20.9354 5.48933 21.1144C6.58831 22.0005 8.21082 22.0005 11.4558 22.0005C12.1614 22.0005 12.5141 22.0005 12.8372 21.8865C12.9044 21.8627 12.9702 21.8355 13.0345 21.8047C13.3436 21.6569 13.593 21.4075 14.0919 20.9086L18.8284 16.172C19.4065 15.594 19.6955 15.3049 19.8478 14.9374C20 14.5699 20 14.1611 20 13.3436V10.0005C20 6.22922 20 4.34361 18.8284 3.17203C17.7693 2.11287 16.1265 2.01125 13.0345 2.0015M13 21.5005V21.0005C13 18.172 13 16.7578 13.8787 15.8791C14.7574 15.0005 16.1716 15.0005 19 15.0005H19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 5.99954H4M8 1.99954V9.99954`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Qf=[[`path`,{d:`M20 14V10.6569C20 9.83935 20 9.4306 19.8478 9.06306C19.6955 8.69552 19.4065 8.40649 18.8284 7.82843L14.0919 3.09188C13.593 2.593 13.3436 2.34355 13.0345 2.19575C12.9702 2.165 12.9044 2.13772 12.8372 2.11401C12.5141 2 12.1614 2 11.4558 2C8.21082 2 6.58831 2 5.48933 2.88607C5.26731 3.06508 5.06508 3.26731 4.88607 3.48933C4 4.58831 4 6.21082 4 9.45584V14C4 17.7712 4 19.6569 5.17157 20.8284C6.34315 22 8.22876 22 12 22M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M17 22C17.6068 21.4102 20 19.8403 20 19C20 18.1597 17.6068 16.5898 17 16M19 19H12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],$f=[[`path`,{d:`M13 20H8C5.17157 20 3.75736 20 2.87868 19.1213C2 18.2426 2 16.8284 2 14V8.49183C2 6.15409 2 4.98521 2.61604 4.17881C2.7778 3.96706 2.96706 3.7778 3.17881 3.61604C3.98521 3 5.15409 3 7.49183 3C8.16633 3 8.50358 3 8.81392 3.10442C8.8976 3.13257 8.97932 3.16623 9.05854 3.20518C9.35239 3.34965 9.59179 3.58719 10.0706 4.06227L10.8483 4.83389C11.4254 5.4066 11.714 5.69295 12.08 5.8437C12.446 5.99446 12.8525 5.99446 13.6656 5.99446H16C18.8284 5.99446 20.2426 5.99446 21.1213 6.87314C22 7.75182 22 9.16603 22 11.9945V12.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 15V21M22 18H16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ep=[[`path`,{d:`M13.6656 6.49446H16C18.8284 6.49446 20.2426 6.49446 21.1213 7.37314C22 8.25182 22 9.66603 22 12.4945V14.5C22 17.3284 22 18.7426 21.1213 19.6213C20.2426 20.5 18.8284 20.5 16 20.5H8C5.17157 20.5 3.75736 20.5 2.87868 19.6213C2 18.7426 2 17.3284 2 14.5V8.99183C2 6.65409 2 5.48521 2.61604 4.67881C2.7778 4.46706 2.96706 4.2778 3.17881 4.11604C3.98521 3.5 5.15409 3.5 7.49183 3.5C8.16633 3.5 8.50358 3.5 8.81392 3.60442C8.8976 3.63257 8.97932 3.66623 9.05854 3.70518C9.35239 3.84965 9.59179 4.08719 10.0706 4.56227L10.8483 5.33389C11.4254 5.9066 11.714 6.19295 12.08 6.3437C12.446 6.49446 12.8525 6.49446 13.6656 6.49446Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 10.5H17C18.8692 10.5 19.8038 10.5 20.5 10.9019C20.9561 11.1652 21.3348 11.5439 21.5981 12C22 12.6962 22 13.6308 22 15.5C22 17.3692 22 18.3038 21.5981 19C21.3348 19.4561 20.9561 19.8348 20.5 20.0981C19.8038 20.5 18.8692 20.5 17 20.5H7C5.13077 20.5 4.19615 20.5 3.5 20.0981C3.04394 19.8348 2.66523 19.4561 2.40192 19C2 18.3038 2 17.3692 2 15.5C2 13.6308 2 12.6962 2.40192 12C2.66523 11.5439 3.04394 11.1652 3.5 10.9019C4.19615 10.5 5.13077 10.5 7 10.5Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],tp=[[`path`,{d:`M12 8H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 12H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 20H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M12 16H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M3 4V11C3 12.8692 3 13.8038 3.40192 14.5C3.66523 14.9561 4.04394 15.3348 4.5 15.5981C5.19615 16 6.13077 16 8 16`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M8 8H7C6.07003 8 5.60504 8 5.22354 7.89778C4.18827 7.62038 3.37962 6.81173 3.10222 5.77646C3 5.39496 3 4.92997 3 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],np=[[`path`,{d:`M2 11.4C2 10.2417 2.24173 10 3.4 10H20.6C21.7583 10 22 10.2417 22 11.4V12.6C22 13.7583 21.7583 14 20.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2 19.4C2 18.2417 2.24173 18 3.4 18H20.6C21.7583 18 22 18.2417 22 19.4V20.6C22 21.7583 21.7583 22 20.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}]],rp=[[`path`,{d:`M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],ip=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.38886 15.1629C9.89331 15.5 10.5955 15.5 12 15.5C13.4045 15.5 14.1067 15.5 14.6111 15.1629C14.8295 15.017 15.017 14.8295 15.1629 14.6111C15.5 14.1067 15.5 13.4045 15.5 12C15.5 10.5955 15.5 9.89331 15.1629 9.38886C15.017 9.17048 14.8295 8.98298 14.6111 8.83706C14.1067 8.5 13.4045 8.5 12 8.5C10.5955 8.5 9.89331 8.5 9.38886 8.83706C9.17048 8.98298 8.98298 9.17048 8.83706 9.38886C8.5 9.89331 8.5 10.5955 8.5 12C8.5 13.4045 8.5 14.1067 8.83706 14.6111C8.98298 14.8295 9.17048 15.017 9.38886 15.1629Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],ap=[[`path`,{d:`M8 2H9.01472C10.241 2 10.8541 2 11.4054 2.22836C11.9567 2.45672 12.3903 2.89027 13.2574 3.75736L21.1262 11.6263C21.6841 12.1867 21.9982 12.9449 22 13.7357L22 13.75L22 13.7643C21.9982 14.5551 21.6841 15.3133 21.1262 15.8737L15.8737 21.1262C15.3133 21.6841 14.5551 21.9982 13.7643 22L13.75 22L13.7357 22C12.9449 21.9982 12.1867 21.6841 11.6263 21.1262L3.75736 13.2574C2.89027 12.3903 2.45672 11.9567 2.22836 11.4054C2 10.8541 2 10.241 2 9.01472V8C2 5.17157 2 3.75736 2.87868 2.87868C3.75736 2 5.17157 2 8 2Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 7.25V7.5M8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],op=[[`path`,{d:`M3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C8.79275 3 5.97733 4.67765 4.38341 7.20327M3.29339 3.00076L3.46556 5.05452C3.58958 6.53384 3.65159 7.27349 4.13359 7.68914C4.61559 8.10479 5.32673 8.03185 6.74899 7.88595L8.79339 7.67625`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],sp=[[`path`,{d:`M21.544 11.045C21.848 11.4713 22 11.6845 22 12C22 12.3155 21.848 12.5287 21.544 12.955C20.1779 14.8706 16.6892 19 12 19C7.31078 19 3.8221 14.8706 2.45604 12.955C2.15201 12.5287 2 12.3155 2 12C2 11.6845 2.15201 11.4713 2.45604 11.045C3.8221 9.12944 7.31078 5 12 5C16.6892 5 20.1779 9.12944 21.544 11.045Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15 12C15 10.3431 13.6569 9 12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}]],Y=e(Pe(),1),X=Ne();function cp(e){let t=lp(e.document,e.view);return t===null?null:(0,X.jsx)(`p`,{className:`text-muted-foreground grid size-full place-items-center p-6 text-center text-sm`,children:t})}function lp(e,t){return e===void 0?t===`explorer`?`Open a file from the explorer to start editing.`:`Select a change to see its diff.`:e.status===`large`?`This file is ${up(e.size)}, too large to open in the editor (limit ${up(e.limit)}).`:e.status===`binary`?`The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding.`:e.status===`error`?e.message:null}function up(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function dp(){let e=Ee(e=>e.errors);return e.length===0?null:(0,X.jsxs)(`div`,{role:`alert`,className:`bg-popover text-popover-foreground absolute right-3 bottom-9 z-20 flex w-96 max-w-[calc(100%-1.5rem)] items-start gap-2 rounded-md border p-3 text-[13px] shadow-lg`,children:[(0,X.jsx)(je,{icon:ne,className:`text-destructive mt-0.5 size-4 shrink-0`}),(0,X.jsx)(`p`,{className:`min-w-0 flex-1 break-words whitespace-pre-wrap`,children:e.at(-1)}),(0,X.jsx)(`button`,{type:`button`,title:`Dismiss`,"aria-label":`Dismiss`,className:`hover:bg-accent grid size-5 shrink-0 cursor-pointer place-items-center rounded-sm`,onClick:De,children:(0,X.jsx)(je,{icon:Oe,className:`size-3.5`})})]})}function fp(e,t){let n=localStorage.getItem(`editorWindow ${e} ${t}`);return n===null?{tabs:[],active:null,expanded:[],settings:{view:`explorer`,sidebar:!0,width:300,tree:!0,sort:`path`,messages:{},graphHeight:240,inline:!1,whitespace:!0,collapse:!1,smartCommit:!0,preview:!1}}:JSON.parse(n)}function pp(e,t,n){localStorage.setItem(`editorWindow ${e} ${t}`,JSON.stringify(n))}function mp(e){let t=(0,Y.useRef)(!1),n=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{let t=e.initial.lastIndexOf(`.`);n.current?.focus(),n.current?.setSelectionRange(0,t>0?t:e.initial.length)},[e.initial]),(0,X.jsx)(`input`,{ref:n,"aria-label":`Name`,defaultValue:e.initial,className:`border-primary bg-background text-foreground h-5 min-w-0 flex-1 border px-1 text-[13px] outline-none`,onKeyDown:n=>{n.key===`Enter`&&(t.current=!0,e.onCommit(n.currentTarget.value)),n.key===`Escape`&&(t.current=!0,e.onCancel())},onBlur:n=>{t.current||(t.current=!0,e.onCommit(n.currentTarget.value))}})}function hp(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(0),[s,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)({path:``,folder:!0}),[f,p]=(0,Y.useState)(null),[m,_]=(0,Y.useState)(null),v=(0,Y.useRef)(null),b=c();(0,Y.useEffect)(()=>{let t=!0;return Te(e.machine,`files.entries`,{projectId:e.projectId}).then(e=>{t&&(n(e),i(null))},e=>{t&&i(Le(e))}),()=>{t=!1}},[e.machine,e.projectId,a]);let ne=(0,Y.useMemo)(()=>gp(t?.files??[],t?.folders??[]),[t]),ie=s??e.active,se=s??(e.active===null?``:_p(e.active));function le(t,n){let r=t===``?[]:t.split(`/`);e.onExpanded([...new Set([...e.expanded,...r.map((e,t)=>r.slice(0,t+1).join(`/`))])]),p({kind:`create`,parent:t,folder:n})}async function fe(t){if(f===null)return;p(null);let n=t.trim();if(n!==``)try{if(f.kind===`create`){let t=f.parent===``?n:`${f.parent}/${n}`;await Te(e.machine,`files.create`,{projectId:e.projectId,path:t,folder:f.folder}),f.folder&&e.onExpanded(e=>[...e,t]),f.folder||e.onOpen(t)}if(f.kind===`rename`&&n!==vp(f.path)){let t=_p(f.path),r=t===``?n:`${t}/${n}`;await Te(e.machine,`files.rename`,{projectId:e.projectId,path:f.path,to:r}),e.onRenamed(f.path,r)}o(e=>e+1)}catch(e){Ae(e)}}async function me(t){try{await Te(e.machine,`files.delete`,{projectId:e.projectId,path:t.path}),e.onDeleted(t.path),o(e=>e+1)}catch(e){Ae(e)}}function ge(e,t,n){return(0,X.jsxs)(`div`,{className:`flex h-[22px] items-center gap-1.5 pr-2`,style:{paddingLeft:8+e*12},children:[(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),t&&(0,X.jsx)(je,{icon:ep,className:`text-muted-foreground size-4 shrink-0`}),!t&&(0,X.jsx)(He,{path:n}),(0,X.jsx)(mp,{initial:n,onCommit:e=>void fe(e),onCancel:()=>p(null)})]},`input`)}function ve(t,n,r,i){return f?.kind===`rename`&&f.path===t?ge(n,r,vp(t)):(0,X.jsxs)(`button`,{type:`button`,"data-path":t,"data-folder":r,className:Re(`text-sidebar-foreground hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] w-full cursor-pointer items-center gap-1.5 pr-2 text-left text-[13px] outline-none focus-visible:ring-1 focus-visible:ring-inset`,t===ie&&`bg-sidebar-row-active`),style:{paddingLeft:8+n*12},onClick:()=>{r?(l(t),e.onExpanded(i?e.expanded.filter(e=>e!==t):[...e.expanded,t])):(l(null),e.onOpen(t))},children:[Array.from({length:n},(e,t)=>(0,X.jsx)(`span`,{"aria-hidden":!0,className:`border-sidebar-border pointer-events-none absolute inset-y-0 border-l opacity-0 transition-opacity group-hover/tree:opacity-100`,style:{left:16+t*12}},t)),r&&(0,X.jsx)(je,{icon:We,"aria-hidden":!0,className:Re(`text-muted-foreground size-4 shrink-0 transition-transform`,i&&`rotate-90`)}),!r&&(0,X.jsx)(`span`,{"aria-hidden":!0,className:`size-4 shrink-0`}),r&&(0,X.jsx)(je,{icon:i?g:ep,className:`text-muted-foreground size-4 shrink-0`}),!r&&(0,X.jsx)(He,{path:t}),(0,X.jsx)(`span`,{className:`truncate`,children:vp(t)})]},t)}function be(t,n,r){return[f?.kind===`create`&&f.parent===n&&ge(r,f.folder,``),...[...t.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(t=>{let i=n===``?t[0]:`${n}/${t[0]}`,a=e.expanded.includes(i);return(0,X.jsxs)(`div`,{children:[ve(i,r,!0,a),a&&be(t[1],i,r+1)]},`dir:${i}`)}),...[...t.files].sort((e,t)=>e.localeCompare(t)).map(e=>ve(e,r,!1,!1))]}return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`New File…`,"aria-label":`New File`,onClick:()=>le(se,!1),children:(0,X.jsx)(je,{icon:Zf,className:`size-4`})}),(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`New Folder…`,"aria-label":`New Folder`,onClick:()=>le(se,!0),children:(0,X.jsx)(je,{icon:$f,className:`size-4`})}),(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`Refresh Explorer`,"aria-label":`Refresh Explorer`,onClick:()=>o(a+1),children:(0,X.jsx)(je,{icon:Ue,className:`size-4`})}),(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`Collapse Folders in Explorer`,"aria-label":`Collapse Folders in Explorer`,onClick:()=>e.onExpanded([]),children:(0,X.jsx)(je,{icon:Ke,className:`size-4`})})]}),(0,X.jsxs)(he,{children:[(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsxs)(`div`,{className:`group/tree min-h-0 flex-1 overflow-y-auto pb-6`,onContextMenu:e=>{let t=e.target instanceof Element?e.target.closest(`[data-path]`):null;d(t===null?{path:``,folder:!0}:{path:t.dataset.path??``,folder:t.dataset.folder===`true`})},children:[r!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:r}),r===null&&t===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),r===null&&t!==null&&be(ne,``,0)]})}),(0,X.jsxs)(ce,{className:`min-w-48`,onCloseAutoFocus:e=>{v.current!==null&&(e.preventDefault(),v.current(),v.current=null)},children:[!u.folder&&Ge(u.path)===`markdown`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(pe,{onSelect:()=>e.onPreview(u.path),children:`Open Preview`}),(0,X.jsx)(ue,{})]}),(0,X.jsx)(pe,{onSelect:()=>{v.current=()=>le(u.folder?u.path:_p(u.path),!1)},children:`New File…`}),(0,X.jsx)(pe,{onSelect:()=>{v.current=()=>le(u.folder?u.path:_p(u.path),!0)},children:`New Folder…`}),(0,X.jsx)(ue,{}),(0,X.jsx)(pe,{onSelect:()=>void b.copy(u.path===``?e.root:`${e.root}/${u.path}`),children:`Copy Path`}),u.path!==``&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(pe,{onSelect:()=>void b.copy(u.path),children:`Copy Relative Path`}),!u.folder&&(0,X.jsx)(pe,{onSelect:()=>void ae(e.machine,e.projectId,u.path).catch(Ae),children:`Download`}),(0,X.jsx)(ue,{}),(0,X.jsx)(pe,{onSelect:()=>{v.current=()=>p({kind:`rename`,path:u.path,folder:u.folder})},children:`Rename…`}),(0,X.jsx)(pe,{variant:`destructive`,onSelect:()=>{v.current=()=>_(u)},children:`Delete`})]})]})]}),(0,X.jsx)(y,{open:m!==null,onOpenChange:e=>{e||_(null)},children:(0,X.jsxs)(oe,{children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(ye,{children:`Delete '${m===null?``:vp(m.path)}'?`}),(0,X.jsx)(re,{children:m?.folder===!0?`This folder and everything in it will be permanently deleted.`:`This file will be permanently deleted.`})]}),(0,X.jsxs)(te,{children:[(0,X.jsx)(de,{children:`Cancel`}),(0,X.jsx)(ee,{variant:`destructive`,onClick:()=>{m!==null&&me(m)},children:`Delete`})]})]})})]})}function gp(e,t){let n={folders:new Map,files:[]};function r(e){let t=n;for(let n of e){let e=t.folders.get(n)??{folders:new Map,files:[]};t.folders.set(n,e),t=e}return t}for(let e of t)r(e.split(`/`));for(let t of e)r(t.split(`/`).slice(0,-1)).files.push(t);return n}function _p(e){return e.includes(`/`)?e.slice(0,e.lastIndexOf(`/`)):``}function vp(e){return e.slice(e.lastIndexOf(`/`)+1)}function yp(e){return(0,X.jsx)(`div`,{role:`tablist`,className:`flex h-full min-w-0 flex-1 [scrollbar-width:thin] overflow-x-auto`,children:e.tabs.map(t=>{let n=t.id===e.active,r=e.dirty.includes(t.id);return(0,X.jsxs)(`div`,{role:`tab`,tabIndex:0,"aria-selected":n,title:t.path,className:Re(`group/tab border-sidebar-border relative flex shrink-0 cursor-pointer items-center gap-1.5 border-r pr-1.5 pl-3 text-[13px] outline-none select-none`,n&&`bg-background text-foreground`,!n&&`text-muted-foreground hover:bg-background/50`),onClick:()=>e.onSelect(t.id),onAuxClick:n=>{n.button===1&&e.onClose(t.id)},onKeyDown:n=>{n.key===`Enter`&&e.onSelect(t.id)},children:[n&&(0,X.jsx)(`span`,{className:`bg-primary absolute inset-x-0 top-0 h-px`}),(0,X.jsx)(He,{path:t.path}),(0,X.jsx)(`span`,{className:`max-w-48 truncate`,children:t.label}),e.tabs.some(e=>e!==t&&e.label===t.label)&&(0,X.jsx)(`span`,{className:`text-muted-foreground max-w-40 truncate text-xs`,children:_p(t.path)}),(0,X.jsxs)(`button`,{type:`button`,title:`Close`,"aria-label":`Close ${t.label}`,className:Re(`group/close hover:bg-accent flex size-5 cursor-pointer items-center justify-center rounded opacity-0 group-hover/tab:opacity-100 focus-visible:opacity-100`,(n||r)&&`opacity-100`),onClick:n=>{n.stopPropagation(),e.onClose(t.id)},children:[r&&(0,X.jsx)(`span`,{className:`bg-foreground size-2 rounded-full group-hover/close:hidden`}),(0,X.jsx)(je,{icon:Oe,className:Re(`size-3.5`,r&&`hidden group-hover/close:block`)})]})]},t.id)})})}var bp=class e{_ruleStack;constructor(e){this._ruleStack=e}get ruleStack(){return this._ruleStack}clone(){return new e(this._ruleStack)}equals(t){return!(!t||!(t instanceof e)||t!==this||t._ruleStack!==this._ruleStack)}};function xp(e){if(Array.isArray(e)&&(e=e[0]),e)return e=(e.charCodeAt(0)===35?e.slice(1):e).toLowerCase(),(e.length===3||e.length===4)&&(e=e.split(``).map(e=>e+e).join(``)),e}var Sp=/[\s,]+/;function Cp(e){let t=`rules`in e?e.rules:void 0;if(!t){t=[];let n=e.settings||e.tokenColors;for(let{scope:e,settings:{foreground:r,background:i,fontStyle:a}={}}of n){if(!r&&!i&&!a)continue;let n=Array.isArray(e)?e:e?[e]:[],o=Op(a),s=xp(r),c=xp(i);t.push(...n.map(e=>({token:e,foreground:s,background:c,fontStyle:o})))}}let n=Object.fromEntries(Object.entries(e.colors||{}).map(([e,t])=>[e,`#${xp(t)}`]));return{base:e.type===`light`?`vs`:`vs-dark`,inherit:!1,colors:n,rules:t}}function wp(e,t,n={}){let r=new Map,i=e.getLoadedThemes();for(let n of i){let i=Cp(e.getTheme(n));r.set(n,i),t.editor.defineTheme(n,i)}let a=[],o=new Map,s=t.editor.setTheme.bind(t.editor);t.editor.setTheme=t=>{let n=e.setTheme(t),i=r.get(t);a.length=n.colorMap.length;for(let e=0;e<n.colorMap.length;e++)a[e]=n.colorMap[e];o.clear(),i?.rules.forEach(e=>{let t=xp(e.foreground);if(!t)return;let n=kp(t,Op(e.fontStyle));o.has(n)||o.set(n,e.token)}),s(t)};let c=t.editor.create;t.editor.create=(e,n,r)=>(n?.theme&&t.editor.setTheme(n.theme),c(e,n,r)),t.editor.setTheme(i[0]);function l(e,t){let n=kp(e,Tp(t));return o.get(n)}let{tokenizeMaxLineLength:u=2e4,tokenizeTimeLimit:d=500}=n,f=new Set(t.languages.getLanguages().map(e=>e.id));for(let n of e.getLoadedLanguages())f.has(n)&&t.languages.setTokensProvider(n,{getInitialState(){return new bp(qe)},tokenize(t,r){if(t.length>=u)return{endState:r,tokens:[{startIndex:0,scopes:``}]};let i=e.getLanguage(n).tokenizeLine2(t,r.ruleStack,d);i.stoppedEarly&&console.warn(`Time limit reached when tokenizing line: ${t.substring(0,100)}`);let o=i.tokens.length/2,s=[];for(let e=0;e<o;e++){let t=i.tokens[2*e],n=i.tokens[2*e+1],r=Je.getForeground(n),o=xp(a[r]||``),c=Je.getFontStyle(n),u=o&&l(o,c)||``;s.push({startIndex:t,scopes:u})}return{endState:new bp(i.ruleStack),tokens:s}}})}function Tp(e){if(e<=Ye.None)return``;let t=[];return e&Ye.Italic&&t.push(`italic`),e&Ye.Bold&&t.push(`bold`),e&Ye.Underline&&t.push(`underline`),e&Ye.Strikethrough&&t.push(`strikethrough`),t.join(` `)}var Ep=[`italic`,`bold`,`underline`,`strikethrough`],Dp={"line-through":`strikethrough`};function Op(e){if(!e)return``;let t=new Set(e.split(Sp).map(e=>e.trim().toLowerCase()).map(e=>Dp[e]||e).filter(Boolean));return Ep.filter(e=>t.has(e)).join(` `)}function kp(e,t){return t?`${e}|${t}`:e}var Ap={},jp={},Mp=class e{static getOrCreate(t){return jp[t]||(jp[t]=new e(t)),jp[t]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,Ap[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function Z(e){let t=e.id;Ap[t]=e,Wc.register(e);let n=Mp.getOrCreate(t);Wc.registerTokensProviderFactory(t,{create:async()=>(await n.load()).language}),Wc.onLanguageEncountered(t,async()=>{let e=await n.load();Wc.setLanguageConfiguration(t,e.conf)})}Z({id:`abap`,extensions:[`.abap`],aliases:[`abap`,`ABAP`],loader:()=>J(()=>import(`./abap-08VXUWAP.js`),[])}),Z({id:`apex`,extensions:[`.cls`],aliases:[`Apex`,`apex`],mimetypes:[`text/x-apex-source`,`text/x-apex`],loader:()=>J(()=>import(`./apex-BWPQTe0t.js`),[])}),Z({id:`azcli`,extensions:[`.azcli`],aliases:[`Azure CLI`,`azcli`],loader:()=>J(()=>import(`./azcli-Bc_sGQ0U.js`),[])}),Z({id:`bat`,extensions:[`.bat`,`.cmd`],aliases:[`Batch`,`bat`],loader:()=>J(()=>import(`./bat-i0X4ZdIN.js`),[])}),Z({id:`bicep`,extensions:[`.bicep`],aliases:[`Bicep`],loader:()=>J(()=>import(`./bicep-B5-_aFwp.js`),[])}),Z({id:`cameligo`,extensions:[`.mligo`],aliases:[`Cameligo`],loader:()=>J(()=>import(`./cameligo-DMUM7wLl.js`),[])}),Z({id:`clojure`,extensions:[`.clj`,`.cljs`,`.cljc`,`.edn`],aliases:[`clojure`,`Clojure`],loader:()=>J(()=>import(`./clojure-Cm7r79vr.js`),[])}),Z({id:`coffeescript`,extensions:[`.coffee`],aliases:[`CoffeeScript`,`coffeescript`,`coffee`],mimetypes:[`text/x-coffeescript`,`text/coffeescript`],loader:()=>J(()=>import(`./coffee-Ba7i2nA0.js`),[])}),Z({id:`c`,extensions:[`.c`,`.h`],aliases:[`C`,`c`],loader:()=>J(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`cpp`,extensions:[`.cpp`,`.cc`,`.cxx`,`.hpp`,`.hh`,`.hxx`],aliases:[`C++`,`Cpp`,`cpp`],loader:()=>J(()=>import(`./cpp-C7h46wYY.js`),[])}),Z({id:`csharp`,extensions:[`.cs`,`.csx`,`.cake`],aliases:[`C#`,`csharp`],loader:()=>J(()=>import(`./csharp-BKxtCVv1.js`),[])}),Z({id:`csp`,extensions:[`.csp`],aliases:[`CSP`,`csp`],loader:()=>J(()=>import(`./csp-bTuwJoIa.js`),[])}),Z({id:`css`,extensions:[`.css`],aliases:[`CSS`,`css`],mimetypes:[`text/css`],loader:()=>J(()=>import(`./css-DIMkf-bt.js`),[])}),Z({id:`cypher`,extensions:[`.cypher`,`.cyp`],aliases:[`Cypher`,`OpenCypher`],loader:()=>J(()=>import(`./cypher-CVaqCwHa.js`),[])}),Z({id:`dart`,extensions:[`.dart`],aliases:[`Dart`,`dart`],mimetypes:[`text/x-dart-source`,`text/x-dart`],loader:()=>J(()=>import(`./dart-onAF5SnQ.js`),[])}),Z({id:`dockerfile`,extensions:[`.dockerfile`],filenames:[`Dockerfile`],aliases:[`Dockerfile`],loader:()=>J(()=>import(`./dockerfile-DZFCIeNp.js`),[])}),Z({id:`ecl`,extensions:[`.ecl`],aliases:[`ECL`,`Ecl`,`ecl`],loader:()=>J(()=>import(`./ecl-94qehhXe.js`),[])}),Z({id:`elixir`,extensions:[`.ex`,`.exs`],aliases:[`Elixir`,`elixir`,`ex`],loader:()=>J(()=>import(`./elixir-6RTg0lbw.js`),[])}),Z({id:`flow9`,extensions:[`.flow`],aliases:[`Flow9`,`Flow`,`flow9`,`flow`],loader:()=>J(()=>import(`./flow9-C5_-GSwl.js`),[])}),Z({id:`fsharp`,extensions:[`.fs`,`.fsi`,`.ml`,`.mli`,`.fsx`,`.fsscript`],aliases:[`F#`,`FSharp`,`fsharp`],loader:()=>J(()=>import(`./fsharp-C8Ef5oNN.js`),[])}),Z({id:`freemarker2`,extensions:[`.ftl`,`.ftlh`,`.ftlx`],aliases:[`FreeMarker2`,`Apache FreeMarker2`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-dollar`,aliases:[`FreeMarker2 (Angle/Dollar)`,`Apache FreeMarker2 (Angle/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAngleInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-dollar`,aliases:[`FreeMarker2 (Bracket/Dollar)`,`Apache FreeMarker2 (Bracket/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagBracketInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-angle.interpolation-bracket`,aliases:[`FreeMarker2 (Angle/Bracket)`,`Apache FreeMarker2 (Angle/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAngleInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-bracket.interpolation-bracket`,aliases:[`FreeMarker2 (Bracket/Bracket)`,`Apache FreeMarker2 (Bracket/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagBracketInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-dollar`,aliases:[`FreeMarker2 (Auto/Dollar)`,`Apache FreeMarker2 (Auto/Dollar)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationDollar),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`freemarker2.tag-auto.interpolation-bracket`,aliases:[`FreeMarker2 (Auto/Bracket)`,`Apache FreeMarker2 (Auto/Bracket)`],loader:()=>J(()=>import(`./freemarker2-Bw62YruA.js`).then(e=>e.TagAutoInterpolationBracket),__vite__mapDeps([0,1,2,3,4]))}),Z({id:`go`,extensions:[`.go`],aliases:[`Go`],loader:()=>J(()=>import(`./go-C-y9NEjX.js`),[])}),Z({id:`graphql`,extensions:[`.graphql`,`.gql`],aliases:[`GraphQL`,`graphql`,`gql`],mimetypes:[`application/graphql`],loader:()=>J(()=>import(`./graphql-fmXr3nnJ.js`),[])}),Z({id:`handlebars`,extensions:[`.handlebars`,`.hbs`],aliases:[`Handlebars`,`handlebars`,`hbs`],mimetypes:[`text/x-handlebars-template`],loader:()=>J(()=>import(`./handlebars-84NJRWd6.js`),__vite__mapDeps([5,1,2,3,4]))}),Z({id:`hcl`,extensions:[`.tf`,`.tfvars`,`.hcl`],aliases:[`Terraform`,`tf`,`HCL`,`hcl`],loader:()=>J(()=>import(`./hcl-CpzslTdj.js`),[])}),Z({id:`html`,extensions:[`.html`,`.htm`,`.shtml`,`.xhtml`,`.mdoc`,`.jsp`,`.asp`,`.aspx`,`.jshtm`],aliases:[`HTML`,`htm`,`html`,`xhtml`],mimetypes:[`text/html`,`text/x-jshtm`,`text/template`,`text/ng-template`],loader:()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))}),Z({id:`ini`,extensions:[`.ini`,`.properties`,`.gitconfig`],filenames:[`config`,`.gitattributes`,`.gitconfig`,`.editorconfig`],aliases:[`Ini`,`ini`],loader:()=>J(()=>import(`./ini-sBoK_t0W.js`),[])}),Z({id:`java`,extensions:[`.java`,`.jav`],aliases:[`Java`,`java`],mimetypes:[`text/x-java-source`,`text/x-java`],loader:()=>J(()=>import(`./java-BEtHBSE6.js`),[])}),Z({id:`javascript`,extensions:[`.js`,`.es6`,`.jsx`,`.mjs`,`.cjs`],firstLine:`^#!.*\\bnode`,filenames:[`jakefile`],aliases:[`JavaScript`,`javascript`,`js`],mimetypes:[`text/javascript`],loader:()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))}),Z({id:`julia`,extensions:[`.jl`],aliases:[`julia`,`Julia`],loader:()=>J(()=>import(`./julia-Bri6UV-V.js`),[])}),Z({id:`kotlin`,extensions:[`.kt`,`.kts`],aliases:[`Kotlin`,`kotlin`],mimetypes:[`text/x-kotlin-source`,`text/x-kotlin`],loader:()=>J(()=>import(`./kotlin-BOotOW0E.js`),[])}),Z({id:`less`,extensions:[`.less`],aliases:[`Less`,`less`],mimetypes:[`text/x-less`,`text/less`],loader:()=>J(()=>import(`./less-B9JPFI3C.js`),[])}),Z({id:`lexon`,extensions:[`.lex`],aliases:[`Lexon`],loader:()=>J(()=>import(`./lexon-CfSJPG6W.js`),[])}),Z({id:`lua`,extensions:[`.lua`],aliases:[`Lua`,`lua`],loader:()=>J(()=>import(`./lua-CsQS60Ue.js`),[])}),Z({id:`liquid`,extensions:[`.liquid`,`.html.liquid`],aliases:[`Liquid`,`liquid`],mimetypes:[`application/liquid`],loader:()=>J(()=>import(`./liquid-Dcyd1pkL.js`),__vite__mapDeps([9,1,2,3,4]))}),Z({id:`m3`,extensions:[`.m3`,`.i3`,`.mg`,`.ig`],aliases:[`Modula-3`,`Modula3`,`modula3`,`m3`],loader:()=>J(()=>import(`./m3-D-oSqn_W.js`),[])}),Z({id:`markdown`,extensions:[`.md`,`.markdown`,`.mdown`,`.mkdn`,`.mkd`,`.mdwn`,`.mdtxt`,`.mdtext`],aliases:[`Markdown`,`markdown`],loader:()=>J(()=>import(`./markdown-Cimd5fb3.js`),[])}),Z({id:`mdx`,extensions:[`.mdx`],aliases:[`MDX`,`mdx`],loader:()=>J(()=>import(`./mdx-DR7vQeQJ.js`),__vite__mapDeps([10,1,2,3,4]))}),Z({id:`mips`,extensions:[`.s`],aliases:[`MIPS`,`MIPS-V`],mimetypes:[`text/x-mips`,`text/mips`,`text/plaintext`],loader:()=>J(()=>import(`./mips-CIPQ_RoX.js`),[])}),Z({id:`msdax`,extensions:[`.dax`,`.msdax`],aliases:[`DAX`,`MSDAX`],loader:()=>J(()=>import(`./msdax-DauUninz.js`),[])}),Z({id:`mysql`,extensions:[],aliases:[`MySQL`,`mysql`],loader:()=>J(()=>import(`./mysql-SOo6toE5.js`),[])}),Z({id:`objective-c`,extensions:[`.m`],aliases:[`Objective-C`],loader:()=>J(()=>import(`./objective-c-FvmIjYaQ.js`),[])}),Z({id:`pascal`,extensions:[`.pas`,`.p`,`.pp`],aliases:[`Pascal`,`pas`],mimetypes:[`text/x-pascal-source`,`text/x-pascal`],loader:()=>J(()=>import(`./pascal-DrH0SRf2.js`),[])}),Z({id:`pascaligo`,extensions:[`.ligo`],aliases:[`Pascaligo`,`ligo`],loader:()=>J(()=>import(`./pascaligo-D-ptJ9y-.js`),[])}),Z({id:`perl`,extensions:[`.pl`,`.pm`],aliases:[`Perl`,`pl`],loader:()=>J(()=>import(`./perl-oz_6vUea.js`),[])}),Z({id:`pgsql`,extensions:[],aliases:[`PostgreSQL`,`postgres`,`pg`,`postgre`],loader:()=>J(()=>import(`./pgsql-DTj74zXo.js`),[])}),Z({id:`php`,extensions:[`.php`,`.php4`,`.php5`,`.phtml`,`.ctp`],aliases:[`PHP`,`php`],mimetypes:[`application/x-php`],loader:()=>J(()=>import(`./php-nr791fC2.js`),[])}),Z({id:`pla`,extensions:[`.pla`],loader:()=>J(()=>import(`./pla-CopQ2nXW.js`),[])}),Z({id:`postiats`,extensions:[`.dats`,`.sats`,`.hats`],aliases:[`ATS`,`ATS/Postiats`],loader:()=>J(()=>import(`./postiats-43DmfD33.js`),[])}),Z({id:`powerquery`,extensions:[`.pq`,`.pqm`],aliases:[`PQ`,`M`,`Power Query`,`Power Query M`],loader:()=>J(()=>import(`./powerquery-D3hlyOfw.js`),[])}),Z({id:`powershell`,extensions:[`.ps1`,`.psm1`,`.psd1`],aliases:[`PowerShell`,`powershell`,`ps`,`ps1`],loader:()=>J(()=>import(`./powershell-DmHpPYUd.js`),[])}),Z({id:`proto`,extensions:[`.proto`],aliases:[`protobuf`,`Protocol Buffers`],loader:()=>J(()=>import(`./protobuf-C531GsRP.js`),[])}),Z({id:`pug`,extensions:[`.jade`,`.pug`],aliases:[`Pug`,`Jade`,`jade`],loader:()=>J(()=>import(`./pug-Z5eAx3Zn.js`),[])}),Z({id:`python`,extensions:[`.py`,`.rpy`,`.pyw`,`.cpy`,`.gyp`,`.gypi`],aliases:[`Python`,`py`],firstLine:`^#!/.*\\bpython[0-9.-]*\\b`,loader:()=>J(()=>import(`./python-CiSQgsVi.js`),__vite__mapDeps([11,1,2,3,4]))}),Z({id:`qsharp`,extensions:[`.qs`],aliases:[`Q#`,`qsharp`],loader:()=>J(()=>import(`./qsharp-DkqhCAOL.js`),[])}),Z({id:`r`,extensions:[`.r`,`.rhistory`,`.rmd`,`.rprofile`,`.rt`],aliases:[`R`,`r`],loader:()=>J(()=>import(`./r-BwWrilGY.js`),[])}),Z({id:`razor`,extensions:[`.cshtml`],aliases:[`Razor`,`razor`],mimetypes:[`text/x-cshtml`],loader:()=>J(()=>import(`./razor-WdSU-o-W.js`),__vite__mapDeps([12,1,2,3,4]))}),Z({id:`redis`,extensions:[`.redis`],aliases:[`redis`],loader:()=>J(()=>import(`./redis-ClamHrr6.js`),[])}),Z({id:`redshift`,extensions:[],aliases:[`Redshift`,`redshift`],loader:()=>J(()=>import(`./redshift-DT7zqm-g.js`),[])}),Z({id:`restructuredtext`,extensions:[`.rst`],aliases:[`reStructuredText`,`restructuredtext`],loader:()=>J(()=>import(`./restructuredtext-BYgofb2h.js`),[])}),Z({id:`ruby`,extensions:[`.rb`,`.rbx`,`.rjs`,`.gemspec`,`.pp`],filenames:[`rakefile`,`Gemfile`],aliases:[`Ruby`,`rb`],loader:()=>J(()=>import(`./ruby-DezsRK8O.js`),[])}),Z({id:`rust`,extensions:[`.rs`,`.rlib`],aliases:[`Rust`,`rust`],loader:()=>J(()=>import(`./rust-DdL9SqIa.js`),[])}),Z({id:`sb`,extensions:[`.sb`],aliases:[`Small Basic`,`sb`],loader:()=>J(()=>import(`./sb-CcwsVR0C.js`),[])}),Z({id:`scala`,extensions:[`.scala`,`.sc`,`.sbt`],aliases:[`Scala`,`scala`,`SBT`,`Sbt`,`sbt`,`Dotty`,`dotty`],mimetypes:[`text/x-scala-source`,`text/x-scala`,`text/x-sbt`,`text/x-dotty`],loader:()=>J(()=>import(`./scala-DHpiXF5c.js`),[])}),Z({id:`scheme`,extensions:[`.scm`,`.ss`,`.sch`,`.rkt`],aliases:[`scheme`,`Scheme`],loader:()=>J(()=>import(`./scheme-BeGwcela.js`),[])}),Z({id:`scss`,extensions:[`.scss`],aliases:[`Sass`,`sass`,`scss`],mimetypes:[`text/x-scss`,`text/scss`],loader:()=>J(()=>import(`./scss-gp-XZpBa.js`),[])}),Z({id:`shell`,extensions:[`.sh`,`.bash`],aliases:[`Shell`,`sh`],loader:()=>J(()=>import(`./shell-CC2rA5mh.js`),[])}),Z({id:`sol`,extensions:[`.sol`],aliases:[`sol`,`solidity`,`Solidity`],loader:()=>J(()=>import(`./solidity-BEEn4gHE.js`),[])}),Z({id:`aes`,extensions:[`.aes`],aliases:[`aes`,`sophia`,`Sophia`],loader:()=>J(()=>import(`./sophia-CRfGWb83.js`),[])}),Z({id:`sparql`,extensions:[`.rq`],aliases:[`sparql`,`SPARQL`],loader:()=>J(()=>import(`./sparql-D_Lu-MrJ.js`),[])}),Z({id:`sql`,extensions:[`.sql`],aliases:[`SQL`],loader:()=>J(()=>import(`./sql-NEE52Syq.js`),[])}),Z({id:`st`,extensions:[`.st`,`.iecst`,`.iecplc`,`.lc3lib`,`.TcPOU`,`.TcDUT`,`.TcGVL`,`.TcIO`],aliases:[`StructuredText`,`scl`,`stl`],loader:()=>J(()=>import(`./st-DbInun42.js`),[])}),Z({id:`swift`,aliases:[`Swift`,`swift`],extensions:[`.swift`],mimetypes:[`text/swift`],loader:()=>J(()=>import(`./swift-Bxkupp3x.js`),[])}),Z({id:`systemverilog`,extensions:[`.sv`,`.svh`],aliases:[`SV`,`sv`,`SystemVerilog`,`systemverilog`],loader:()=>J(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`verilog`,extensions:[`.v`,`.vh`],aliases:[`V`,`v`,`Verilog`,`verilog`],loader:()=>J(()=>import(`./systemverilog-Bz4Y3fRF.js`),[])}),Z({id:`tcl`,extensions:[`.tcl`],aliases:[`tcl`,`Tcl`,`tcltk`,`TclTk`,`tcl/tk`,`Tcl/Tk`],loader:()=>J(()=>import(`./tcl-DISqw1ZD.js`),[])}),Z({id:`twig`,extensions:[`.twig`],aliases:[`Twig`,`twig`],mimetypes:[`text/x-twig`],loader:()=>J(()=>import(`./twig-De2hgUGE.js`),[])}),Z({id:`typescript`,extensions:[`.ts`,`.tsx`,`.cts`,`.mts`],aliases:[`TypeScript`,`ts`,`typescript`],mimetypes:[`text/typescript`],loader:()=>J(()=>import(`./typescript-Dy13l_qr.js`),__vite__mapDeps([13,8,1,2,3,4]))}),Z({id:`typespec`,extensions:[`.tsp`],aliases:[`TypeSpec`],loader:()=>J(()=>import(`./typespec-B8J7ngcE.js`),[])}),Z({id:`vb`,extensions:[`.vb`],aliases:[`Visual Basic`,`vb`],loader:()=>J(()=>import(`./vb-DV3o63ZY.js`),[])}),Z({id:`wgsl`,extensions:[`.wgsl`],aliases:[`WebGPU Shading Language`,`WGSL`,`wgsl`],loader:()=>J(()=>import(`./wgsl-DpFanUEy.js`),[])}),Z({id:`xml`,extensions:[`.xml`,`.xsd`,`.dtd`,`.ascx`,`.csproj`,`.config`,`.props`,`.targets`,`.wxi`,`.wxl`,`.wxs`,`.xaml`,`.svg`,`.svgz`,`.opf`,`.xslt`,`.xsl`],firstLine:`(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)`,aliases:[`XML`,`xml`],mimetypes:[`text/xml`,`application/xml`,`application/xaml+xml`,`application/xml-dtd`],loader:()=>J(()=>import(`./xml-AovvXo6A.js`),__vite__mapDeps([14,1,2,3,4]))}),Z({id:`yaml`,extensions:[`.yaml`,`.yml`],aliases:[`YAML`,`yaml`,`YML`,`yml`],mimetypes:[`application/x-yaml`,`text/x-yaml`],loader:()=>J(()=>import(`./yaml-EESuZNdc.js`),__vite__mapDeps([15,1,2,3,4]))});var Np=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},Pp=function(e,t){return function(n,r){t(n,r,e)}},Fp,Ip=new j(`selectionAnchorSet`,!1),Lp=class{static{Fp=this}static{this.ID=`editor.contrib.selectionAnchorController`}static get(e){return e.getContribution(Fp.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Ip.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(q.fromPositions(e,e),{description:`selection-anchor`,stickiness:1,hoverMessage:new Oi().appendText(x(849,`Selection Anchor`)),className:`selection-anchor`})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),bo(x(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(q.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()}};Lp=Fp=Np([Pp(1,Fa)],Lp);var Rp=class extends W{constructor(){super({id:`editor.action.setSelectionAnchor`,label:L(851,`Set Selection Anchor`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:Or(2089,2080),weight:100}})}async run(e,t){Lp.get(t)?.setSelectionAnchor()}},zp=class extends W{constructor(){super({id:`editor.action.goToSelectionAnchor`,label:L(852,`Go to Selection Anchor`),precondition:Ip})}async run(e,t){Lp.get(t)?.goToSelectionAnchor()}},Bp=class extends W{constructor(){super({id:`editor.action.selectFromAnchorToCursor`,label:L(853,`Select from Anchor to Cursor`),precondition:Ip,kbOpts:{kbExpr:E.editorTextFocus,primary:Or(2089,2089),weight:100}})}async run(e,t){Lp.get(t)?.selectFromAnchorToCursor()}},Vp=class extends W{constructor(){super({id:`editor.action.cancelSelectionAnchor`,label:L(854,`Cancel Selection Anchor`),precondition:Ip,kbOpts:{kbExpr:E.editorTextFocus,primary:9,weight:100}})}async run(e,t){Lp.get(t)?.cancelSelectionAnchor()}};Ps(Lp.ID,Lp,4),z(Rp),z(zp),z(Bp),z(Vp);var Hp=O(`editorOverviewRuler.bracketMatchForeground`,`#A0A0A0`,x(855,`Overview ruler marker color for matching brackets.`)),Up=class extends W{constructor(){super({id:`editor.action.jumpToBracket`,label:L(857,`Go to Bracket`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:3165,weight:100}})}run(e,t){qp.get(t)?.jumpToBracket()}},Wp=class extends W{constructor(){super({id:`editor.action.selectToBracket`,label:L(858,`Select to Bracket`),precondition:void 0,metadata:{description:L(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),qp.get(t)?.selectToBracket(r)}},Gp=class extends W{constructor(){super({id:`editor.action.removeBrackets`,label:L(860,`Remove Brackets`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){qp.get(t)?.removeBrackets(this.id)}},Kp=class{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}},qp=class e extends G{static{this.ID=`editor.contrib.bracketMatchingController`}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 Pr(()=>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 q(i.lineNumber,i.column,i.lineNumber,i.column):new q(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(C.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 q(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())})}static{this._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=P.register({description:`bracket-match-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`,overviewRuler:{color:ro(Hp),position:Qi.Center}})}static{this._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=P.register({description:`bracket-match-no-overview`,stickiness:1,className:`bracket-match`,inlineClassName:`bracket-match-inline`})}_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(A.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 Kp(r,t,i)}}this._lastBracketsData=s,this._lastVersionId=r}};Ps(qp.ID,qp,1),z(Wp),z(Up),z(Gp),wn.appendMenuItem(D.MenubarGoMenu,{group:`5_infile_nav`,command:{id:`editor.action.jumpToBracket`,title:x(856,`Go to &&Bracket`)},order:2}),Pa((e,t)=>{let n=e.getColor(Hf);n&&t.addRule(`.monaco-editor .bracket-match-inline { color: ${n} !important; }`)}),z(class extends W{constructor(){super({id:`editor.action.transposeLetters`,label:L(863,`Transpose Letters`),precondition:E.writable,kbOpts:{kbExpr:E.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():Xu.rightPosition(n,e.getPosition().lineNumber,e.getPosition().column),s=Xu.leftPosition(n,o),c=Xu.leftPosition(n,s),l=n.getValueInRange(C.fromPositions(c,s)),u=n.getValueInRange(C.fromPositions(s,o)),d=C.fromPositions(c,o);r.push(new Yc(d,u+l))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}});var Jp=class e{static{this.sep=`.`}static{this.None=new e(`@@none@@`)}static{this.Empty=new 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))}},Yp=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},Xp=function(e,t){return function(n,r){t(n,r,e)}},Zp=P.register({description:`inline-progress-widget`,stickiness:1,showIfCollapsed:!0,after:{content:`\xA0`,inlineClassName:`inline-editor-progress-decoration`,inlineClassNameAffectsLetterSpacing:!0,widthInEm:1}}),Qp=class e extends G{static{this.baseId=`editor.widget.inlineProgressWidget`}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=M(`.inline-progress-widget`),this.domNode.role=`button`,this.domNode.title=e;let t=M(`span.icon`);this.domNode.append(t),t.classList.add(...V.asClassNameArray(k.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(I(this.domNode,Ol.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)}},$p=class extends G{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new lc),this._currentWidget=this._register(new lc),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=Ua(()=>{let n=C.fromPositions(e);this._currentDecorations.set([{range:n,options:Zp}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Qp,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()}};$p=Yp([Xp(2,U)],$p);var 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=class{static{nm=this}static{this.ID=`editor.contrib.messageController`}static{this.MESSAGE_VISIBLE=new j(`messageVisible`,!1,x(1353,`Whether the editor is currently showing an inline message`))}static get(e){return e.getContribution(nm.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new lc,this._messageListeners=new F,this._mouseOverMessage=!1,this._editor=e,this._visible=nm.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(bo(Fr(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),Fr(e)){let n=this._messageListeners.add(bl(e,{actionHandler:(e,t)=>{this.closeMessage(),ln(this._openerService,e,t.isTrusted)}}));this._messageWidget.value=new am(this._editor,t,n.element)}else this._messageWidget.value=new am(this._editor,t,e);this._messageListeners.add(pu.debounce(this._editor.onDidBlurEditorText,(e,t)=>t,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&_n(ff(),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(I(this._messageWidget.value.getDomNode(),Ol.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(I(this._messageWidget.value.getDomNode(),Ol.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 C(t.lineNumber-3,1,e.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(am.fadeOut(this._messageWidget.value))}};rm=nm=em([tm(1,Fa),tm(2,Xt)],rm);var im=td.bindToContribution(rm.get);H(new im({id:`leaveEditorMessage`,precondition:rm.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));var am=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)}};Ps(rm.ID,rm,4);var om=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},sm=function(e,t){return function(n,r){t(n,r,e)}},cm=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(){}}}},lm=class e extends cm{static{this.id=`text`}constructor(){super(Jp.Empty.append(`text`,`plain`)),this.id=e.id,this.dropMimeTypes=[Eo.text],this.pasteMimeTypes=[Eo.text]}async getEdit(e,t){let n=e.get(Eo.text);if(!n||e.has(Eo.uriList))return;let r=await n.asString();return{handledMimeType:Eo.text,title:x(980,`Insert Plain Text`),insertText:r,kind:this.kind}}},um=class extends cm{constructor(){super(Jp.Empty.append(`uri`,`path`,`absolute`)),this.dropMimeTypes=[Eo.uriList],this.pasteMimeTypes=[Eo.uriList]}async getEdit(e,t){let n=await pm(e);if(!n.length||t.isCancellationRequested)return;let r=0,i=n.map(({uri:e,originalText:t})=>e.scheme===sl.file?e.fsPath:(r++,t)).join(` `),a;return a=r>0?n.length>1?x(981,`Insert Uris`):x(982,`Insert Uri`):n.length>1?x(983,`Insert Paths`):x(984,`Insert Path`),{handledMimeType:Eo.uriList,insertText:i,title:a,kind:this.kind}}},dm=class extends cm{constructor(e){super(Jp.Empty.append(`uri`,`path`,`relative`)),this._workspaceContextService=e,this.dropMimeTypes=[Eo.uriList],this.pasteMimeTypes=[Eo.uriList]}async getEdit(e,t){let n=await pm(e);if(!n.length||t.isCancellationRequested)return;let r=mu(n.map(({uri:e})=>{let t=this._workspaceContextService.getWorkspaceFolder(e);return t?fn(t.uri,e):void 0}));if(r.length)return{handledMimeType:Eo.uriList,insertText:r.join(` `),title:n.length>1?x(985,`Insert Relative Paths`):x(986,`Insert Relative Path`),kind:this.kind}}};dm=om([sm(0,bu)],dm);var fm=class{constructor(){this.kind=new Jp(`html`),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=[`text/html`],this._yieldTo=[{mimeType:Eo.text}]}async provideDocumentPasteEdits(e,t,n,r,i){if(r.triggerKind!==pa.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:x(987,`Insert HTML`),kind:this.kind}]}}};async function pm(e){let t=e.get(Eo.uriList);if(!t)return[];let n=await t.asString(),r=[];for(let e of Ul.parse(n))try{r.push({uri:Yn.parse(e),originalText:e})}catch{}return r}var mm={scheme:`*`,hasAccessToAllModels:!0},hm=class extends G{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(mm,new lm)),this._register(e.documentDropEditProvider.register(mm,new um)),this._register(e.documentDropEditProvider.register(mm,new dm(t)))}};hm=om([sm(0,R),sm(1,bu)],hm);var gm=class extends G{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(mm,new lm)),this._register(e.documentPasteEditProvider.register(mm,new um)),this._register(e.documentPasteEditProvider.register(mm,new dm(t))),this._register(e.documentPasteEditProvider.register(mm,new fm))}};gm=om([sm(0,R),sm(1,bu)],gm);var _m=class e{constructor(){this.value=``,this.pos=0}static{this._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13}}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}}},vm=class{constructor(){this._children=[]}appendChild(e){return e instanceof ym&&this._children[this._children.length-1]instanceof ym?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 Dm)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),``)}len(){return 0}},ym=class e extends vm{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new e(this.value)}},bm=class extends vm{},xm=class e extends bm{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 Sm?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}},Sm=class e extends vm{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof ym&&(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}},Cm=class e extends vm{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 wm&&!!e.elseValue)&&(r=this._replace([])),r}_replace(e){let t=``;for(let n of this._children)if(n instanceof wm){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}},wm=class e extends vm{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)}},Tm=class e extends bm{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 ym(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 Em(e,t){let n=[...e];for(;n.length>0;){let e=n.shift();if(!t(e))break;n.unshift(...e.children)}}var Dm=class e extends vm{get placeholderInfo(){if(!this._placeholders){let e=[],t;this.walk(function(n){return n instanceof xm&&(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 Em([e],e=>(t+=e.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:n}=e;for(;n;)n instanceof xm&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Tm&&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){Em(this.children,e)}},Om=class{constructor(){this._scanner=new _m,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 Dm;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 xm&&(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 xm(e.index);o.transform=e.transform;for(let e of i){let t=e.clone();o.appendChild(t),t instanceof xm&&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 xm(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 ym(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 xm(Number(t)):new Tm(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 xm(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ym("${"+t+`:`)),r.children.forEach(e.appendChild,e),!0}else if(r.index>0&&this._accept(7)){let t=new Sm;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 ym(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 Tm(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(r),!0;if(!this._parse(r))return e.appendChild(new ym("${"+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 Cm,n=``,r=``;for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,n+=e;else if(this._token.type!==14)n+=this._accept(void 0,!0);else 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 ym(e));else if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);)if(this._token.type!==14)r+=this._accept(void 0,!0);else 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 wm(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 wm(Number(r),n)),!0)}if(this._accept(11)){let t=this._until(4);if(t)return e.appendChild(new wm(Number(r),void 0,t,void 0)),!0}else if(this._accept(12)){let t=this._until(4);if(t)return e.appendChild(new wm(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 wm(Number(r),void 0,t,n)),!0}}else{let t=this._until(4);if(t)return e.appendChild(new wm(Number(r),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14&&(e.appendChild(new ym(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}};function km(e,t,n){return(typeof n.insertText==`string`?n.insertText===``:n.insertText.snippet===``)?{edits:n.additionalEdit?.edits??[]}:{edits:[...t.map(t=>new tl(e,{range:t,text:typeof n.insertText==`string`?Om.escape(n.insertText)+`$0`:n.insertText.snippet,insertAsSnippet:!0})),...n.additionalEdit?.edits??[]]}}function Am(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 jm(e,t){return t&&(e.stack||e.stacktrace)?x(33,`{0}: {1}`,Nm(e),Mm(e.stack)||Mm(e.stacktrace)):Nm(e)}function Mm(e){return Array.isArray(e)?e.join(`
|
|
3
3
|
`):e}function Nm(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`?x(34,`A system error occurred ({0})`,e.message):e.message||x(35,`An unknown error occurred. Please consult the log for more details.`)}function Pm(e=null,t=!1){if(!e)return x(36,`An unknown error occurred. Please consult the log for more details.`);if(Array.isArray(e)){let n=mu(e),r=Pm(n[0],t);return n.length>1?x(37,`{0} ({1} errors in total)`,r,n.length):r}if(Hn(e))return e;if(e.detail){let n=e.detail;if(n.error)return jm(n.error,t);if(n.exception)return jm(n.exception,t)}return e.stack?jm(e,t):e.message?e.message:x(38,`An unknown error occurred. Please consult the log for more details.`)}var Fm=class extends G{constructor(e){super(),this._onChange=this._register(new N),this.onChange=this._onChange.event,this._checked=!!e.checked,this._title=e.title??e.ariaLabel,this.domNode=M(`button.monaco-switch`),this.domNode.type=`button`,this.domNode.setAttribute(`role`,`switch`),K(this.domNode,M(`.monaco-switch-thumb`)),this._register(lt().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}))),this.setAriaLabel(e.ariaLabel,e.title),this.disabled=!!e.disabled,this._applyState(),this._register(I(this.domNode,Ol.CLICK,e=>{Ds.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)}},Im=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},Lm=function(e,t){return function(n,r){t(n,r,e)}},Rm=class extends G{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=K(e,M(`a.monaco-link`,{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=n.hoverDelegate??ec(`mouse`),this.setTooltip(t.title),this.el.setAttribute(`role`,`button`);let a=this._register(new mf(this.el,`click`)),o=this._register(new mf(this.el,`keydown`)),s=pu.chain(o.event,e=>e.map(e=>new fr(e)).filter(e=>e.keyCode===3||e.keyCode===10)),c=this._register(new mf(this.el,va.Tap)).event;this._register(sn.addTarget(this.el));let l=pu.any(a.event,s,c);this._register(l(e=>{this.enabled&&(Ds.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)}};Rm=Im([Lm(3,ou),Lm(4,Xt)],Rm);var zm=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},Bm=function(e,t){return function(n,r){t(n,r,e)}},Vm,Hm=`acceptSelectedCodeAction`,Um=`previewSelectedCodeAction`,Wm=new Set([Hm,Um,`toggleSectionCodeAction`]),Gm=`actionList.remove`,Km=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){}},qm=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 Jm(e){return!!e.submenuActions?.length&&!e.hover?.content||!!e.hover?.expandable}function Ym(e){return Jm(e)&&e.hover?.showIndicator!==!1}var Xm=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 Pf(e,gs),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 F}}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=V.asClassName(e.group.icon),n.icon.style.color=e.group.icon.color?gn(e.group.icon.color.id):``):(n.icon.className=V.asClassName(k.lightBulb),n.icon.style.color=`var(--vscode-editorLightBulb-foreground)`),!e.item&&!e.standaloneToggle||!e.label)return;if(kn(!e.hideIcon,n.icon),e.isSectionToggle){let t=e.group?.icon===k.chevronDown;n.container.setAttribute(`aria-expanded`,String(t))}else n.container.removeAttribute(`aria-expanded`);n.previousClassNames?.length&&n.container.classList.remove(...n.previousClassNames);let r=e.className?.split(/\s+/).filter(e=>e.length>0)??[];if(n.container.classList.toggle(`action-list-custom`,r.length>0),r.length&&n.container.classList.add(...r),n.previousClassNames=r,n.text.textContent=nh(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(wf(n.description),typeof e.description==`string`)n.description.textContent=nh(e.description);else{let t=bl(e.description,{actionHandler:t=>{let n=Yn.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 i=this._groupTitleByIndex.get(t);i?(n.groupTitle.textContent=i,n.groupTitle.style.display=``):(n.groupTitle.textContent=``,n.groupTitle.style.display=`none`),e.detail?(n.detail.textContent=nh(e.detail),n.detail.style.display=``):(n.detail.textContent=``,n.detail.style.display=`none`),n.container.classList.toggle(`has-detail`,!!e.detail),wf(n.inlineToggleContainer);let a=e.standaloneToggle??e.inlineToggle;if(a){let t=document.createElement(`span`);t.className=`action-list-item-inline-toggle-label`,t.textContent=nh(a.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 Fm({ariaLabel:a.title??a.label,checked:a.checked,disabled:a.disabled}));n.inlineToggleContainer.append(r.domNode),e.standaloneToggle&&n.elementDisposables.add(this._registerStandaloneToggle(e,r)),n.elementDisposables.add(r.onChange(()=>a.onChange(r.checked))),n.elementDisposables.add(I(n.inlineToggleContainer,Ol.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 o=this._keybindingService.lookupKeybinding(Hm)?.getLabel(),s=this._keybindingService.lookupKeybinding(Um)?.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=``:o&&s?this._supportsPreview&&e.canPreview?n.container.title=x(1731,`{0} to Apply, {1} to Preview`,o,s):n.container.title=x(1732,`{0} to Apply`,o):n.container.title=``:n.container.title=``,wf(n.toolbar);let c=[...e.toolbarActions??[]];if(e.onRemove&&c.push(Bo({id:Gm,label:x(1733,`Remove`),class:V.asClassName(k.close),run:async()=>{await e.onRemove(),this._onRemoveItem?.(e)}})),n.container.classList.toggle(`has-toolbar`,c.length>0),c.length>0){let t=new zr(n.toolbar);n.elementDisposables.add(t),this._stopToolbarPointerPropagation?(n.elementDisposables.add(wu(n.toolbar,e=>{e.preventDefault(),e.stopPropagation()})),n.elementDisposables.add(I(n.toolbar,Ol.CLICK,e=>e.stopPropagation())),n.elementDisposables.add(I(n.toolbar,va.Tap,e=>e.stopPropagation()))):n.elementDisposables.add(wu(n.toolbar,e=>e.preventDefault())),t.push(c,{icon:!0,label:!1}),n.elementDisposables.add(this._registerToolbar(e,t))}Ym(e)?(n.submenuIndicator.className=`action-list-submenu-indicator has-submenu `+V.asClassName(k.chevronRight),n.submenuIndicator.style.display=``,n.submenuIndicator.style.visibility=``,n.elementDisposables.add(I(n.submenuIndicator,Ol.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`),Jm(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()}};Xm=zm([Bm(10,Sa),Bm(11,Xt)],Xm);var Zm=class extends UIEvent{constructor(){super(`acceptSelectedAction`)}},Qm=class extends UIEvent{constructor(){super(`previewSelectedAction`)}};function $m(e){if(e.kind===`action`)return e.label}var eh=Vm=class extends G{constructor(e,t,n,r,i,a,o,s,c){if(super(),this._supportsPreview=t,this._delegate=r,this._options=a,this._keybindingService=o,this._openerService=s,this._instantiationService=c,this._headerLineHeight=24,this._separatorLineHeight=8,this.cts=this._register(new Ao),this._submenuDisposables=this._register(new F),this._submenuHoverActionElements=[],this._itemMoveAnimation=this._register(new lc),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 lc),this._groupTitleByIndex=new Map,this._standaloneToggles=new Map,this._itemToolbars=new Map,this._onDidRequestLayout=this._register(new N),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(I(this._submenuContainer,`keydown`,e=>{if((e.key===`Enter`||e.key===` `)&&this._currentSubmenuElement?.hover?.tabThroughPanel){let t=qi(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;Ds.stop(e,!0);let t=e.key===`Escape`&&this._currentSubmenuWidget!==void 0;this._hideSubmenu(),t?this.hide():(this._setKeyboardNavigation(!0),this._list.domFocus())})),this._register(I(this._submenuContainer,`mouseenter`,()=>{this._cancelSubmenuHide(),this._usesSubmenuPointerIntent()&&(this._cancelSubmenuShow(),this._resetSubmenuPointer())})),this._register(I(this._submenuContainer,`mouseleave`,()=>{this._scheduleSubmenuHide()})),this._register(I(this.domNode,Ol.MOUSE_LEAVE,()=>{this._cancelSubmenuShow(),this._resetSubmenuPointer()})),this._usesSubmenuPointerIntent()&&this._register(I(this.domNode,Ol.MOUSE_MOVE,e=>{qi(e.target)&&this._expandedTrigger?.contains(e.target)&&this._updateSubmenuPointer(e)})),this._register(Ko(()=>{this._cancelSubmenuHide(),this._cancelSubmenuShow()})),this._options?.collapsedByDefault)for(let e of this._options.collapsedByDefault)this._collapsedSections.add(e);let l={getHeight:e=>this._getItemHeight(e),getTemplateId:e=>e.kind},u=()=>{let e=this._options?.reserveSubmenuSpace??!0;return e===`always`||e&&this._allMenuItems.some(Ym)};this._list=this._register(new Vo(e,this.domNode,l,[new Xm(this._supportsPreview,e=>this._removeItem(e),e=>this._showSubmenuForItem(e),u,this._groupTitleByIndex,this._options?.linkHandler,this._options?.hideDefaultKeybindingTooltip??!1,this._options?.stopToolbarPointerPropagation??!1,(e,t)=>(this._standaloneToggles.set(e,t),Ko(()=>{this._standaloneToggles.get(e)===t&&this._standaloneToggles.delete(e)})),(e,t)=>(this._itemToolbars.set(e,t),this._updateToolbarFocusability(),Ko(()=>{this._itemToolbars.get(e)===t&&this._itemToolbars.delete(e)})),this._keybindingService,this._openerService),new Km,new qm],{keyboardSupport:!1,typeNavigationEnabled:!this._options?.showFilter&&!this._options?.onType,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:$m},accessibilityProvider:{getAriaLabel:e=>{if(e.kind===`action`){let t=e.label?nh(e?.label):``;if(e.badge&&(t=t+`, `+nh(e.badge)),e.detail&&(t=t+`, `+nh(e.detail)),e.ariaDescription)t=t+`, `+nh(e.ariaDescription);else if(e.description){let n=typeof e.description==`string`?e.description:e.description.value;t=t+`, `+nh(n)}if(e.hover?.content&&!e.ariaDescription&&!e.description){let n=e.hover.content,r=typeof n==`string`?n:Fr(n)?n.value:qi(n)?n.textContent??void 0:void 0;r&&(!e.detail||nh(e.detail)!==nh(r))&&(t=t+`, `+nh(r))}e.group?.title&&(t=t+`, `+e.group.title);let n=e.standaloneToggle??e.inlineToggle;return n&&(t=e.standaloneToggle?n.checked?x(1734,`{0}, on`,n.label):x(1735,`{0}, off`,n.label):t+`, `+(n.checked?x(1736,`{0}, on`,n.label):x(1737,`{0}, off`,n.label))),e.disabled&&(t=x(1738,`{0}, Disabled Reason: {1}`,t,e.disabled)),e.submenuActions?.length&&(t=x(1739,`{0}, use right arrow to access options`,t)),t}return null},getWidgetAriaLabel:()=>x(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`,...i}})),this._list.style(Dr),this._register(this._list.onKeyDown(()=>this._setKeyboardNavigation(!0))),this._register(I(this._list.getHTMLElement(),Ol.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 d=this._register(new lc);if(d.value=this._list.onMouseMove(e=>{(e.browserEvent.movementX!==0||e.browserEvent.movementY!==0)&&(d.clear(),this._ignoreInitialHover=!1,this.onListHover(e))}),this._register(this._list.onMouseDown(()=>{d.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=K(this._filterContainer,M(`.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??x(1741,`Search...`),this._filterInput.value=this._filterText,this._filterInput.setAttribute(`aria-label`,x(1742,`Filter items`)),e.appendChild(this._filterInput),this._register(I(this._filterInput,Ol.KEY_DOWN,e=>{if(this._setKeyboardNavigation(!0),e.isComposing||!this._filterInput?.closest(`.action-list-submenu-panel`))return;let t=this._keybindingService.softDispatch(new fr(e),this._filterInput);(t.kind===2&&t.commandId!==null&&Wm.has(t.commandId)||e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey)&&e.stopPropagation()})),this._register(I(this._filterInput,Ol.MOUSE_DOWN,()=>this._setKeyboardNavigation(!1))),this._options.tabThroughItemActions&&this._register(I(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(I(this._filterInput,`focus`,()=>this._updateFilterActiveDescendant())),this._register(I(this._filterInput,`blur`,()=>this._updateFilterActiveDescendant())),this._register(Go(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;(t||e.keyCode===3)&&(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey?t&&e.stopPropagation():(Ds.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=K(e,M(`.action-list-filter-actions`));this._register(new zr(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(I(this._filterInput,`compositionstart`,()=>{this._imeSessionInProgress=!0,this._filterCts.value?.cancel()})),this._register(I(this._filterInput,`compositionend`,()=>{this._imeSessionInProgress=!1,n()})),this._register(I(this._filterInput,`input`,n))}if(this._options?.secondaryHeading){let t=K(e,M(`.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=K(this._headerContainer,M(`span.action-list-header-icon`));e.classList.add(...V.asClassNameArray(this._options.headerIcon)),e.setAttribute(`aria-hidden`,`true`)}let e=K(this._headerContainer,M(`span.action-list-header-text`));if(e.textContent=this._options.headerText,this._register(I(this._headerContainer,Ol.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(Rm,e,{label:t,href:n.toString(!0)},{}))}if(this._options.headerDismiss){let e=this._options.headerDismiss,t=K(this._headerContainer,M(`span.action-list-header-dismiss`));t.appendChild(M(V.asCSSSelector(k.close))),t.tabIndex=0,t.setAttribute(`role`,`button`),t.setAttribute(`aria-label`,x(1743,`Dismiss`));let n=()=>{e(),this.focus(),this._headerContainer?.remove(),this._headerContainer=void 0,this._onDidRequestLayout.fire()};this._register(Bl(t,()=>n())),this._register(I(t,Ol.KEY_DOWN,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())}))}}this._applyFilter(),this._list.length&&this._focusCheckedOrFirst(),this._register(I(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){Ds.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(I(this.domNode,`keydown`,e=>this._handleTabThroughPanelKeyDown(e),!0)),(this._filterInput||this._options?.onType)&&this._register(I(this.domNode,`keydown`,e=>{let t=e.target;(this._options?.onType||this._options?.filterAsCombobox)&&qi(t)&&(jr(t)||t.closest(`button, a, [contenteditable="true"], .action-list-submenu-panel`))||this._filterInput&&wi(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 Ao;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;else if(r.showAlways)t.push(r);else if(!r.isSectionToggle){if(r.filterItems){let e=o(r)?r.filterItems:r.filterItems.filter(o);e.length>0&&(n=!0,t.push(...e))}else o(r)&&(n=!0,t.push(r))}}i()}else for(let e of this._allMenuItems)if(e.kind===`header`)a.push(e);else if(e.kind===`separator`){if(e.section&&this._collapsedSections.has(e.section))continue;a.push(e)}else if(e.isSectionToggle&&e.section){let t=this._collapsedSections.has(e.section);a.push({...e,group:{...e.group,icon:t?k.chevronRight:k.chevronDown}})}else 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--)a[e].kind===`action`?d=!0: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&&wi(this._filterInput),p=Zn(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();wi(this._filterInput)&&e!==void 0?this._filterInput.setAttribute(`aria-activedescendant`,this._list.getElementID(e)):this._filterInput.removeAttribute(`aria-activedescendant`)}focus(){this._setKeyboardNavigation(void 0),this._filterInput&&this._options?.focusFilterOnOpen?(this._filterInput.focus(),this._focusCheckedOrFirst()):(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&&wi(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&&wi(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||!wi(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 Qm:new Zm;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=If(e.browserEvent)||e.browserEvent?.type===va.Tap;if(n){let t=e.browserEvent.target;if(qi(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 Zm))this._list.setSelection([]),this._showSubmenuForItem(t),n||this._currentSubmenuWidget?.focus();else if(t.item&&this.focusCondition(t)){let n=e.browserEvent instanceof Qm;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=ff();if(!i||!qi(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)){Ds.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()){Ds.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){Ds.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()){Ds.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()){Ds.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&&(Ds.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)}else 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,i=n?M(`.action-list-submenu-content`):this._submenuContainer,a=n?M(`.action-list-submenu-viewport`,void 0,i):void 0,o=a&&!r?this._submenuDisposables.add(new oa(a,{horizontal:2,vertical:1,consumeMouseWheelIfScrollbarIsNeeded:!0,useShadows:!1})):void 0;o&&a?(this._submenuContainer.appendChild(o.getDomNode()),this._submenuDisposables.add(I(a,Ol.SCROLL,()=>o.scanDomNode())),this._submenuDisposables.add(I(this._submenuContainer,Ol.KEY_DOWN,e=>{let t=new fr(e);(t.equals(12)||t.equals(11))&&(Ds.stop(e,!0),o.setScrollPosition({scrollTop:o.getScrollPosition().scrollTop+(t.equals(12)?1:-1)*a.clientHeight}))}))):a&&this._submenuContainer.appendChild(a);let s,c=typeof e.hover?.content==`function`?e.hover.content():e.hover?.content;if(c){if(qi(c))s=c,e.hover?.disposable&&this._register(e.hover.disposable);else{let t=typeof c==`string`?new Oi(c):c,n=this._options?.linkHandler,r=bl(t,{actionHandler:t=>{let r=Yn.parse(t);n?n(r,e):this._openerService.open(r,{allowCommands:!0})}});this._submenuDisposables.add(r),s=r.element}s.classList.add(`action-list-submenu-hover-header`),s.classList.toggle(`content-owns-padding`,e.hover?.contentOwnsPadding===!0),e.submenuActions?.length&&s.classList.add(`has-submenu`),i.appendChild(s)}if(e.hover?.actions?.length){let t=M(`.hover-row.status-bar`),n=K(t,M(`.actions`));for(let t of e.hover.actions){let e=this._keybindingService.lookupKeybinding(t.commandId),r=this._submenuDisposables.add(po.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 l=al(this.domNode),u=0,d=s?s.offsetWidth:0,f;if(r){let t=this._createSubmenuItems(e.submenuActions),n=this._submenuDisposables.add(this._instantiationService.createInstance(Vm,`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));f=n,n.headerContainer&&i.appendChild(n.headerContainer),n.filterContainer&&i.appendChild(n.filterContainer),i.appendChild(n.domNode),n.footerContainer&&i.appendChild(n.footerContainer),this._currentSubmenuWidget=n,n.clearFocus(),u=n.computeListHeight(),n.layout(u);let r=n.computeMaxWidth(0);d=Math.max(d,r,n.footerContainer?.offsetWidth??0),n.layout(u,d),n.domNode.style.width=`${d}px`,e.submenuOptions&&(this._submenuContainer.style.boxSizing=`border-box`,this._submenuContainer.style.width=`${d+10}px`),this._submenuDisposables.add(n.onDidRequestLayout(()=>{u=n.computeListHeight(),n.layout(u,d),this._layoutSubmenu?.()})),this._submenuDisposables.add(I(i,`keydown`,e=>{e.key===`Escape`?(Ds.stop(e,!0),this._hideSubmenu(),this.hide()):e.key===`ArrowLeft`?(Ds.stop(e,!0),this._hideSubmenu(),this._setKeyboardNavigation(!0),this._list.domFocus()):e.key===`Enter`||e.key===` `?(Ds.stop(e,!0),n.acceptSelected()):e.key===`ArrowDown`?(Ds.stop(e,!0),n.focusNext()):e.key===`ArrowUp`&&(Ds.stop(e,!0),n.focusPrevious())}))}let p,m,h=()=>{let e=this._currentSubmenuElement;if(!e||this._layoutSubmenu!==h)return;let t=this._list.indexOf(e),r=t>=0?this._getRowElement(t):null,s=this._options?.persistentHover;if(!r&&(!s||!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(),g=s||e.hover?.alignToParent,_=g?this.domNode.parentElement?.closest(`.action-widget`)?.getBoundingClientRect()??c:c,v=r?.getBoundingClientRect()??_,y=g||n?an(this.domNode):1;s&&(this._submenuContainer.style.width=`${_.width/y}px`);let b=this._submenuContainer.getBoundingClientRect(),ee=g?b.width:d+10,te=l.innerWidth-(g?_.right:v.right),ne=_.left,re=g?0:4;if(!g){let e=l.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;s&&this._submenuSide&&(this._submenuSide===`right`?te:ne)>=ee&&(ie=this._submenuSide===`right`),s&&(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>l.innerWidth-4&&(ae-=oe+ee-(l.innerWidth-4)),this._submenuContainer.style.left=`${ae/y}px`;let se=b.height;n&&(p??=se/y);let ce=p===void 0?se:p*y,le=m===void 0?r&&e.hover?.alignToAnchorTop?v.top-c.top:r?v.top-c.top+(v.height-ce)/2:b.top-c.top:m*y;if(n&&e.hover?.alignToAnchorTop&&a&&f){let e=b.height-a.getBoundingClientRect().height+((f.headerContainer?.offsetHeight??0)+(f.filterContainer?.offsetHeight??0)+(f.footerContainer?.offsetHeight??0)+u)*y;le=Math.min(le,l.innerHeight-c.top-e-8)}let ue=c.top+le+ce;if(ue>l.innerHeight&&!(n&&e.hover?.alignToAnchorTop)&&(le-=ue-l.innerHeight+8),c.top+le<0&&(le=-c.top),n&&(m??=le/y),a&&o){let e=(b.height-o.getDomNode().getBoundingClientRect().height)/y,t=Math.max(0,(l.innerHeight-c.top-le-8)/y-e);a.style.height=`${Math.min(i.getBoundingClientRect().height/y,t)}px`,o.scanDomNode()}else if(a&&f){let e=(b.height-a.getBoundingClientRect().height)/y,t=Math.max(0,(l.innerHeight-c.top-le-8)/y-e),n=(f.headerContainer?.offsetHeight??0)+(f.filterContainer?.offsetHeight??0)+(f.footerContainer?.offsetHeight??0),r=u===0?0:Math.max(this._actionLineHeight,Math.min(u,t-n));f.layout(r,d),a.style.height=`${n+r}px`}this._submenuContainer.style.top=`${le/y}px`};if(this._layoutSubmenu=h,h(),(this._options?.persistentHover||e.hover?.alignToParent||e.hover?.tabThroughPanel||n)&&this._currentSubmenuElement===e){if(!f){let e=this._submenuDisposables.add(new lc),t=this._submenuDisposables.add(new od(`ActionListWidget.hoverPanel`,()=>{e.value||=Za(l,()=>{e.clear(),h()})},l));this._submenuDisposables.add(t.observe(n?i:this._submenuContainer,{box:`border-box`}))}(this._options?.persistentHover||n)&&this._submenuDisposables.add(I(l,Ol.RESIZE,()=>{this._cancelSubmenuShow(),this._resetSubmenuPointer(),h()}))}}_createSubmenuItems(e){let t=[],n=e.filter(e=>e instanceof go).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??V.fromId(e.checked?k.check.id:k.blank.id),i=n.hoverContent,a=i?new Oi().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 go?[new go(e.id,``,e.actions)]:void 0})}e<n.length-1&&t.push({kind:`separator`,label:``})}for(let n of e)if(!(n instanceof go)){let e=n,r=e.icon??V.fromId(n.checked?k.check.id:k.blank.id),i=e.hoverContent,a=i?new Oi().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(ff())&&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,wf(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 zs(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=ff();if(this._options?.tabThroughItemActions&&this._list.getFocus()[0]!==e.index&&qi(r)&&this.domNode.contains(r)&&r.closest(`.action-list-item-toolbar`)&&this._list.domFocus(),qi(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([])}};eh=Vm=zm([Bm(6,Sa),Bm(7,Xt),Bm(8,U)],eh);var th=class extends G{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(eh,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=al(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=al(this.domNode),o;if(this.hasDynamicHeight()||this._preferredAnchorPosition!==void 0){let e=a.innerHeight,t=rf(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}};th=zm([Bm(7,wd),Bm(8,Rt),Bm(9,U)],th);function nh(e){return e.replace(/\r\n|\r|\n/g,` `)}var rh=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},ih=function(e,t){return function(n,r){t(n,r,e)}};O(`actionBar.toggledBackground`,Yi,x(1744,`Background color for toggled action items in action bar.`));var ah=`--action-widget-close-start-opacity`,oh=`--action-widget-close-start-transform`,sh={Visible:new j(`codeActionMenuVisible`,!1,x(1745,`Whether the action widget list is visible`)),FilterFocused:new j(`codeActionMenuFilterFocused`,!1,x(1746,`Whether the action widget filter input is focused`))},ch=$l(`actionWidgetService`),lh=class extends G{get isVisible(){return sh.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new lc),this._closeAnimation=this._register(new lc)}show(e,t,n,r,i,a,o,s,c){let l=sh.Visible.bindTo(this._contextKeyService),u=this._instantiationService.createInstance(th,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=al(n).getComputedStyle(n);n.style.setProperty(ah,i.opacity),n.style.setProperty(oh,i.transform),n.classList.add(r.className),t.hide(e,!1),this._closeAnimation.value=Ua(()=>{this._list.value===t&&this._contextViewService.hideContextView(e)},r.duration)}clear(){this._closeAnimation.clear(),this._closingList=void 0,this._widgetElement?.style.removeProperty(ah),this._widgetElement?.style.removeProperty(oh),this._widgetElement=void 0,this._list.clear()}_renderWidget(e,t,n,r){let i=document.createElement(`div`);i.classList.add(`action-widget`);let a=t.widgetClassName?.split(/\s+/).filter(Boolean);if(a?.length&&i.classList.add(...a),e.appendChild(i),this._widgetElement=i,this._list.value=t,this._list.value)this._list.value.headerContainer&&i.appendChild(this._list.value.headerContainer),this._list.value.filterContainer&&i.appendChild(this._list.value.filterContainer),i.appendChild(this._list.value.domNode),this._list.value.footerContainer&&i.appendChild(this._list.value.footerContainer);else throw Error(`List has no value`);let o=new F;r?.filterAsCombobox&&o.add(Go(i,`keydown`,e=>{e.keyCode===9&&!e.browserEvent.isComposing&&(Ds.stop(e,!0),this.hide(!0))}));let s=this._list.value.headerContainer;s&&o.add(wu(s,e=>e.preventDefault()));let c=0;o.add(wu(i,()=>{c=Date.now()+1e3}));let l=document.createElement(`div`),u=e.appendChild(l);u.classList.add(`context-view-block`),o.add(wu(u,e=>e.stopPropagation()));let d=0;if(n.length){let e=this._createActionBar(`.action-widget-action-bar`,n);e&&(i.appendChild(e.getContainer().parentElement),o.add(e),d=e.getContainer().offsetWidth)}let f=this._list.value?.layout(d);i.style.width=`${f}px`;let p=sh.FilterFocused.bindTo(this._contextKeyService);if(o.add({dispose:()=>p.reset()}),this._list.value?.filterInput){let e=this._list.value.filterInput;o.add(I(e,`focus`,()=>p.set(!0))),o.add(I(e,`blur`,()=>p.set(!1)))}let m=o.add(lr(e)),h=o.add(new lc);return o.add(m.onDidFocus(()=>h.clear())),o.add(m.onDidBlur(()=>{let t=()=>{let n=c-Date.now();if(n>0){h.value=Ua(t,n);return}let r=ff();r&&(e.contains(r)||r.closest(`.action-widget-hover`)||r.closest(`.action-list-submenu-panel`))||this.hide(!0)};h.value=Ua(t,75)})),o}_createActionBar(e,t){if(!t.length)return;let n=M(e),r=new zr(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){this._closingList===this._list.value?this.clear():(this._closeAnimation.clear(),this._closingList=void 0,this._widgetElement=void 0,this._list.value?.hide(e))}};lh=rh([ih(0,wd),ih(1,Fa),ih(2,U)],lh),mo(ch,lh,1);var uh=1100;ea(class extends dl{constructor(){super({id:`hideCodeActionWidget`,title:L(1747,`Hide action widget`),precondition:sh.Visible,keybinding:{weight:uh,primary:9,secondary:[1033]}})}run(e){e.get(ch).hide(!0)}}),ea(class extends dl{constructor(){super({id:`clearFilterCodeActionWidget`,title:L(1748,`Clear action widget filter`),precondition:w.and(sh.Visible,sh.FilterFocused),keybinding:{weight:1101,primary:9}})}run(e){let t=e.get(ch);t instanceof lh&&(t.clearFilter()||t.hide(!0))}}),ea(class extends dl{constructor(){super({id:`selectPrevCodeAction`,title:L(1749,`Select previous action`),precondition:sh.Visible,keybinding:{weight:uh,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){let t=e.get(ch);t instanceof lh&&t.focusPrevious()}}),ea(class extends dl{constructor(){super({id:`selectNextCodeAction`,title:L(1750,`Select next action`),precondition:sh.Visible,keybinding:{weight:uh,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){let t=e.get(ch);t instanceof lh&&t.focusNext()}}),ea(class extends dl{constructor(){super({id:`collapseSectionCodeAction`,title:L(1751,`Collapse section`),precondition:w.and(sh.Visible,sh.FilterFocused.negate()),keybinding:{weight:uh,primary:15}})}run(e){let t=e.get(ch);t instanceof lh&&t.collapseSection()}}),ea(class extends dl{constructor(){super({id:`expandSectionCodeAction`,title:L(1752,`Expand section`),precondition:w.and(sh.Visible,sh.FilterFocused.negate()),keybinding:{weight:uh,primary:17}})}run(e){let t=e.get(ch);t instanceof lh&&t.expandSection()}}),ea(class extends dl{constructor(){super({id:`toggleSectionCodeAction`,title:L(1753,`Toggle section`),precondition:w.and(sh.Visible,sh.FilterFocused.negate()),keybinding:{weight:uh,primary:10}})}run(e){let t=e.get(ch);t instanceof lh&&(t.toggleSection()||t.acceptSelected())}}),ea(class extends dl{constructor(){super({id:Hm,title:L(1754,`Accept selected action`),precondition:sh.Visible,keybinding:{weight:uh,primary:3,secondary:[2137]}})}run(e){let t=e.get(ch);t instanceof lh&&t.acceptSelected()}}),ea(class extends dl{constructor(){super({id:Um,title:L(1755,`Preview selected action`),precondition:sh.Visible,keybinding:{weight:uh,primary:2051}})}run(e){let t=e.get(ch);t instanceof lh&&t.acceptSelected(!0)}});var dh=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},fh=function(e,t){return function(n,r){t(n,r,e)}},ph,mh=class extends G{static{ph=this}static{this.baseId=`editor.widget.postEditWidget`}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(Ko(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ko((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(e=>{this.dispose()})),this._register(pu.runAndSubscribe(l.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){this.button.element.title=this._keybindingService.appendKeybinding(this.showCommand.label,this.showCommand.id)}create(){this.domNode=M(`.post-edit-widget`),this.button=this._register(new Ya(this.domNode,{supportIcons:!0})),this.button.label=`$(insert)`,this._register(I(this.domNode,Ol.CLICK,()=>this.showSelector()))}getId(){return ph.baseId+`.`+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){let e=ga(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:V.fromId(t===this.edits.activeEditIndex?k.check.id:k.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)}};mh=ph=dh([fh(8,Fa),fh(9,Sa),fh(10,ch)],mh);var hh=class extends G{constructor(e,t,n,r,i,a,o,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=r,this._getAdditionalActions=i,this._instantiationService=a,this._bulkEditService=o,this._notificationService=s,this._currentWidget=this._register(new lc),this._register(pu.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)=>{Li(r)||(this._notificationService.error(i),n&&this.show(e[0],t,s))},l=new Dd(this._editor,3,void 0,i),u;try{u=await eo(r(o,l.token),l.token)}catch(e){return c(e,x(991,`Error resolving edit '{0}':
|
|
4
4
|
{1}`,o.title,Pm(e)))}finally{l.dispose()}if(i.isCancellationRequested)return;let d=km(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,x(992,`Error applying edit '{0}':
|
|
5
5
|
{1}`,o.title,Pm(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(mh,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){this._currentWidget.value?.showSelector()}};hh=dh([fh(5,U),fh(6,nd),fh(7,vt)],hh);var gh=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},_h=function(e,t){return function(n,r){t(n,r,e)}},vh,yh=`editor.changePasteType`,bh=`editor.pasteAs.preferences`,xh=new j(`pasteWidgetVisible`,!1,x(971,`Whether the paste widget is showing`)),Sh=`application/vnd.code.copymetadata`,Ch=class extends G{static{vh=this}static{this.ID=`editor.contrib.copyPasteActionController`}static get(e){return e.getContribution(vh.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 $p(`pasteIntoEditor`,e,t)),this._postPasteWidgetManager=this._register(t.createInstance(hh,`pasteIntoEditor`,e,xh,{id:yh,label:x(972,`Show paste options...`)},()=>vh._configureDefaultAction?[vh._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 Ic,s=a.flatMap(e=>e.copyMimeTypes??[]),c=Ef();this.setCopyMetadata(e.clipboardData,{id:c,providerCopyMimeTypes:s,defaultPastePayload:i});let l=a.map(n=>({providerMimeTypes:n.copyMimeTypes,operation:Et(r=>n.prepareDocumentPaste(t,e.dataToCopy.sourceRanges,o,r).catch(e=>{console.error(e)}))}));vh._currentCopyOperation?.operations.forEach(e=>e.operation.cancel()),vh._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(Sh),rm.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??[],Eo.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=>Jo(e,o))});s.length?(e.setHandled(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,s,r,t,i):this.doPasteInline(s,r,t,i,e.browserEvent)):this._pasteAsActionContext?.preferred&&(this.showPasteAsNoEditMessage(r,this._pasteAsActionContext.preferred),e.setHandled())}showPasteAsNoEditMessage(e,t){let n=`only`in t?t.only.value:`preferences`in t?t.preferences.length?t.preferences.map(e=>e.value).join(`, `):x(973,`empty`):t.providerId;rm.get(this._editor)?.showMessage(x(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 Dd(a,3,void 0),s=Et(async a=>{let c=this._editor;if(!c.hasModel())return;let l=c.getModel(),u=new F,d=u.add(new Ao(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 lm)return this.applyDefaultPasteHandler(n,r,f,i);let o={triggerKind:pa.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 lm)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 bn,a=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),x(975,`Resolving paste edit for '{0}'. Click to cancel`,e.title),ja(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(),x(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=Et(async o=>{let s=this._editor;if(!s.hasModel())return;let c=s.getModel(),l=new F,u=l.add(new Dd(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:pa.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:x(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})),...vh._configureDefaultAction?[Qa({type:`separator`}),{label:vh._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:x(978,`Select Paste Action`)});if(t===e){vh._configureDefaultAction?.run();return}d=t?.edit}if(!d)return;let f=km(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:x(979,`Running paste handlers`)},()=>a)}setCopyMetadata(e,t){this._logService.trace(`CopyPasteController#setCopyMetadata new id : `,t.id),e.setData(Sh,JSON.stringify(t))}fetchCopyMetadata(e){this._logService.trace(`CopyPasteController#fetchCopyMetadata`);let t=e.clipboardData.getData(Sh);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&&vh._currentCopyOperation?.handle===n.id){let n=vh._currentCopyOperation.operations.filter(t=>e.some(e=>e.pasteMimeTypes.some(e=>Jo(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(Eo.uriList)){let e=await this._clipboardService.readResources();if(r.isCancellationRequested)return;e.length&&t.append(Eo.uriList,wc(Ul.create(e)))}}async getPasteEdits(e,t,n,r,i,a){let o=new F,s=await ja(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){Li(e)||console.error(e);return}})),a);return{edits:Am(mu(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(Eo.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(bh,{resource:e.uri});for(let e of Array.isArray(n)?n:[]){let n=new Jp(e),r=t.findIndex(e=>n.contains(e.kind));if(r>=0)return r}return 0}};Ch=vh=gh([_h(1,U),_h(2,ju),_h(3,nd),_h(4,ss),_h(5,Er),_h(6,Vi),_h(7,R),_h(8,Gd),_h(9,Mu)],Ch);var wh=`9_cutcopypaste`,Th=_a||document.queryCommandSupported&&document.queryCommandSupported(`cut`),Eh=_a||document.queryCommandSupported&&document.queryCommandSupported(`copy`),Dh=navigator.clipboard===void 0||wo?document.queryCommandSupported&&document.queryCommandSupported(`paste`):!0;function Oh(e){return e.register(),e}var kh=Th?Oh(new el({id:`editor.action.clipboardCutAction`,precondition:void 0,kbOpts:_a?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:D.MenubarEditMenu,group:`2_ccp`,title:x(864,`Cu&&t`),order:1},{menuId:D.EditorContext,group:wh,title:x(865,`Cut`),when:E.writable,order:1},{menuId:D.CommandPalette,group:``,title:x(866,`Cut`),order:1},{menuId:D.SimpleEditorContext,group:wh,title:x(867,`Cut`),when:E.writable,order:1}]})):void 0,Ah=Eh?Oh(new el({id:`editor.action.clipboardCopyAction`,precondition:void 0,kbOpts:_a?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:D.MenubarEditMenu,group:`2_ccp`,title:x(868,`&&Copy`),order:2},{menuId:D.EditorContext,group:wh,title:x(869,`Copy`),order:2},{menuId:D.CommandPalette,group:``,title:x(870,`Copy`),order:1},{menuId:D.SimpleEditorContext,group:wh,title:x(871,`Copy`),order:2}]})):void 0;wn.appendMenuItem(D.MenubarEditMenu,{submenu:D.MenubarCopy,title:L(876,`Copy As`),group:`2_ccp`,order:3}),wn.appendMenuItem(D.EditorContext,{submenu:D.EditorContextCopy,title:L(877,`Copy As`),group:wh,order:3}),wn.appendMenuItem(D.EditorContext,{submenu:D.EditorContextShare,title:L(878,`Share`),group:`11_share`,order:-1,when:w.and(w.notEquals(`resourceScheme`,`output`),E.editorTextFocus)}),wn.appendMenuItem(D.ExplorerContext,{submenu:D.ExplorerContextShare,title:L(879,`Share`),group:`11_share`,order:-1});var jh=Dh?Oh(new el({id:`editor.action.clipboardPasteAction`,precondition:void 0,kbOpts:_a?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:D.MenubarEditMenu,group:`2_ccp`,title:x(872,`&&Paste`),order:4},{menuId:D.EditorContext,group:wh,title:x(873,`Paste`),when:E.writable,order:4},{menuId:D.CommandPalette,group:``,title:x(874,`Paste`),order:1},{menuId:D.SimpleEditorContext,group:wh,title:x(875,`Paste`),when:E.writable,order:4}]})):void 0,Mh=class extends W{constructor(){super({id:`editor.action.clipboardCopyWithSyntaxHighlightingAction`,label:L(880,`Copy with Syntax Highlighting`),precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,weight:100}})}run(e,t){let n=e.get(ju),r=e.get(ss);n.trace(`ExecCommandCopyWithSyntaxHighlightingAction#run`),t.hasModel()&&(t.getOption(45)||!t.getSelection().isEmpty())&&(jl.forceCopyWithSyntaxHighlighting=!0,t.focus(),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)`),Nh(t,r),n.trace(`ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)`),jl.forceCopyWithSyntaxHighlighting=!1)}};function Nh(e,t){if(jl.electronBugWorkaroundCopyEventHasFired=!1,e.getContainerDomNode().ownerDocument.execCommand(`copy`),_a&&jl.electronBugWorkaroundCopyEventHasFired===!1){let{dataToCopy:n}=Vs(e._getViewModel(),void 0,wo);t.writeText(n.text)}}function Ph(e,t){e&&(e.addImplementation(1e4,`code-editor`,(e,n)=>{let r=e.get(ju),i=e.get(ss);r.trace(`registerExecCommandImpl (addImplementation code-editor for : `,t,`)`);let a=e.get(Xs).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`?(Fh(a),r.trace(`registerExecCommandImpl (before execCommand copy)`),Nh(a,i),a.trigger(void 0,`cut`,void 0),r.trace(`registerExecCommandImpl (after execCommand copy)`)):(Fh(a),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),t===`copy`?Nh(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(ju);return r.trace(`registerExecCommandImpl (addImplementation generic-dom for : `,t,`)`),r.trace(`registerExecCommandImpl (before execCommand `+t+`)`),hs().execCommand(t),r.trace(`registerExecCommandImpl (after execCommand `+t+`)`),!0}))}function Fh(e){if(e.getOption(171)){let t=of.get(e.getId());t&&t.handleWillCopy()}}Ph(kh,`cut`),Ph(Ah,`copy`),jh&&(jh.addImplementation(1e4,`code-editor`,(e,t)=>{let n=e.get(ju);n.trace(`registerExecCommandImpl (addImplementation code-editor for : paste)`);let r=e.get(Xs),i=e.get(ss),a=r.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(171)){let e=of.get(a.getId());e&&e.handleWillPaste()}n.trace(`registerExecCommandImpl (before triggerPaste)`);let e=i.triggerPaste(ia().vscodeWindowId);return e?(n.trace(`registerExecCommandImpl (triggerPaste defined)`),e.then(async()=>(n.trace(`registerExecCommandImpl (after triggerPaste)`),Ch.get(a)?.finishedPaste()??Promise.resolve()))):(n.trace(`registerExecCommandImpl (triggerPaste undefined)`),!on||(n.trace(`registerExecCommandImpl (Paste handling on web)`),(async()=>{let e=await i.readText();if(e!==``){let t=jd.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}),jh.addImplementation(0,`generic-dom`,(e,t)=>(e.get(ju).trace(`registerExecCommandImpl (addImplementation generic-dom for : paste)`),e.get(ss).triggerPaste(ia().vscodeWindowId)??!1))),Eh&&z(Mh);var Ih=new class{constructor(){this.QuickFix=new Jp(`quickfix`),this.Refactor=new Jp(`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 Jp(`notebook`),this.Source=new Jp(`source`),this.SourceOrganizeImports=this.Source.append(`organizeImports`),this.SourceFixAll=this.Source.append(`fixAll`),this.SurroundWith=this.Refactor.append(`surround`)}},Lh;(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`})(Lh||={});function Rh(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some(n=>Bh(t,n,e.include))||!e.includeSourceActions&&Ih.Source.contains(t))}function zh(e,t){let n=t.kind?new Jp(t.kind):void 0;return!(e.include&&(!n||!e.include.contains(n))||e.excludes&&n&&e.excludes.some(t=>Bh(n,t,e.include))||!e.includeSourceActions&&n&&Ih.Source.contains(n)||e.onlyIncludePreferredActions&&!t.isPreferred)}function Bh(e,t,n){return!(!t.contains(e)||n&&t.contains(n))}var Vh=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 Jp(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}},Hh=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){Zs(e)}t&&(this.action.edit=t.edit)}return this}},Uh=`editor.action.codeAction`,Wh=`editor.action.quickFix`,Gh=`editor.action.autoFix`,Kh=`editor.action.refactor`,qh=`editor.action.sourceAction`,Jh=`editor.action.organizeImports`,Yh=`editor.action.fixAll`,Xh=1e3,Zh=class e extends G{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:Eu(t.diagnostics)?Eu(n.diagnostics)?e.codeActionsPreferredComparator(t,n):-1:Eu(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&&Ih.QuickFix.contains(new Jp(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}},Qh={actions:[],documentation:void 0};async function $h(e,t,n,r,i,a){let o=r.filter||{},s={...o,excludes:[...o.excludes||[],Ih.Notebook]},c={only:o.include?.value,trigger:r.type},l=new Ls(t,a),u=eg(e,t,r.type===2?s:o),d=new F,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(),Qh;r&&d.add(r);let i=(r?.actions||[]).filter(e=>e&&zh(o,e)),a=ng(e,i,o.include);return{actions:i.map(t=>new Hh(t,e)),documentation:a}}catch(e){if(Li(e))throw e;return Zs(e),Qh}finally{clearTimeout(r)}}),p=e.onDidChange(()=>{let n=e.all(t);Ad(n,u)||l.cancel()});try{let n=await Promise.all(f),i=n.map(e=>e.actions).flat(),a=new Zh(i,[...mu(n.map(e=>e.documentation)),...tg(e,t,r,i)],d);return d.add(a),a}catch(e){throw d.dispose(),e}finally{p.dispose(),l.dispose()}}function eg(e,t,n){return e.all(t).filter(e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some(e=>Rh(n,new Jp(e))))}function*tg(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 ng(e,t,n){if(!e.documentation)return;let r=e.documentation.map(e=>({kind:new Jp(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 Jp(e.kind)))return t.command}}var rg;(function(e){e.OnSave=`onSave`,e.FromProblemsView=`fromProblemsView`,e.FromCodeActions=`fromCodeActions`,e.FromAILightbulb=`fromAILightbulb`,e.FromProblemsHover=`fromProblemsHover`})(rg||={});async function ig(e,t,n,r,i=T.None){let a=e.get(nd),o=e.get(Er),s=e.get(yt),c=e.get(vt),l=e.get(dd);if(s.publicLog2(`codeAction.applyCodeAction`,{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:n}),l.playSignal(_u.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!==rg.OnSave,showPreview:r?.preview,reason:xs.codeAction({kind:t.action.kind,providerId:pl.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=ag(e);c.error(typeof t==`string`?t:x(881,`An unknown error occurred while applying the code action`))}setTimeout(()=>l.playSignal(_u.codeActionApplied),Xh)}}function ag(e){if(typeof e==`string`)return e;if(e instanceof Error&&typeof e.message==`string`)return e.message}In.registerCommand(`_executeCodeActionProvider`,async function(e,t,n,r,i){if(!(t instanceof Yn))throw Po();let{codeActionProvider:a}=e.get(R),o=e.get(ct).getModel(t);if(!o)throw Po();let s=q.isISelection(n)?q.liftSelection(n):C.isIRange(n)?o.validateRange(n):void 0;if(!s)throw Po();let c=typeof r==`string`?new Jp(r):void 0,l=await $h(a,o,s,{type:1,triggerAction:Lh.Default,filter:{includeSourceActions:!0,include:c}},Yl.None,T.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(T.None));try{return await Promise.all(u),l.validActions.map(e=>e.action)}finally{setTimeout(()=>l.dispose(),100)}});var og=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},sg=function(e,t){return function(n,r){t(n,r,e)}},cg,lg=class{static{cg=this}static{this.codeActionCommands=[Kh,Uh,qh,Jh,Yh]}constructor(e){this.keybindingService=e}getResolver(){let e=new jc(()=>this.keybindingService.getKeybindings().filter(e=>cg.codeActionCommands.indexOf(e.command)>=0).filter(e=>e.resolvedKeybinding).map(e=>{let t=e.commandArgs;return e.command===`editor.action.organizeImports`?t={kind:Ih.SourceOrganizeImports.value}:e.command===`editor.action.fixAll`&&(t={kind:Ih.SourceFixAll.value}),{resolvedKeybinding:e.resolvedKeybinding,...Vh.fromUser(t,{kind:Jp.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 Jp(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)}};lg=cg=og([sg(0,Sa)],lg),O(`symbolIcon.arrayForeground`,ei,x(1569,`The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.booleanForeground`,ei,x(1570,`The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.classForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},x(1571,`The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.colorForeground`,ei,x(1572,`The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.constantForeground`,ei,x(1573,`The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.constructorForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},x(1574,`The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.enumeratorForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},x(1575,`The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.enumeratorMemberForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},x(1576,`The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.eventForeground`,{dark:`#EE9D28`,light:`#D67E00`,hcDark:`#EE9D28`,hcLight:`#D67E00`},x(1577,`The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.fieldForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},x(1578,`The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.fileForeground`,ei,x(1579,`The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.folderForeground`,ei,x(1580,`The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.functionForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},x(1581,`The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.interfaceForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},x(1582,`The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.keyForeground`,ei,x(1583,`The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.keywordForeground`,ei,x(1584,`The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.methodForeground`,{dark:`#B180D7`,light:`#652D90`,hcDark:`#B180D7`,hcLight:`#652D90`},x(1585,`The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.moduleForeground`,ei,x(1586,`The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.namespaceForeground`,ei,x(1587,`The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.nullForeground`,ei,x(1588,`The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.numberForeground`,ei,x(1589,`The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.objectForeground`,ei,x(1590,`The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.operatorForeground`,ei,x(1591,`The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.packageForeground`,ei,x(1592,`The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.propertyForeground`,ei,x(1593,`The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.referenceForeground`,ei,x(1594,`The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.snippetForeground`,ei,x(1595,`The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.stringForeground`,ei,x(1596,`The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.structForeground`,ei,x(1597,`The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.textForeground`,ei,x(1598,`The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.typeParameterForeground`,ei,x(1599,`The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.unitForeground`,ei,x(1600,`The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`)),O(`symbolIcon.variableForeground`,{dark:`#75BEFF`,light:`#007ACC`,hcDark:`#75BEFF`,hcLight:`#007ACC`},x(1601,`The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.`));var ug=Object.freeze({kind:Jp.Empty,title:x(917,`More Actions...`)}),dg=Object.freeze([{kind:Ih.QuickFix,title:x(918,`Quick Fix`)},{kind:Ih.RefactorExtract,title:x(919,`Extract`),icon:k.wrench},{kind:Ih.RefactorInline,title:x(920,`Inline`),icon:k.wrench},{kind:Ih.RefactorRewrite,title:x(921,`Rewrite`),icon:k.wrench},{kind:Ih.RefactorMove,title:x(922,`Move`),icon:k.wrench},{kind:Ih.SurroundWith,title:x(923,`Surround With`),icon:k.surroundWith},{kind:Ih.Source,title:x(924,`Source Action`),icon:k.symbolFile},ug]);function fg(e,t,n){if(!t)return e.map(e=>({kind:`action`,item:e,group:ug,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!e.action.edit?.edits.length}));let r=dg.map(e=>({group:e,actions:[]}));for(let t of e){let e=t.action.kind?new Jp(t.action.kind):Jp.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:k.sparkle}:r,label:t.action.title,disabled:!!t.action.disabled,keybinding:n(t.action)})}}return i}var pg=new j(`supportedCodeAction`,``),mg=class extends G{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new Xi),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=>Vt(e,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Lh.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!==ut.Off||this.ignoreLightbulbOff){if(n===ut.Off||n===ut.On)return t;if(n===ut.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}}},hg;(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(Li(e))return gg;throw e})}cancel(){this._cancellablePromise.cancel()}}e.Triggered=t})(hg||={});var gg=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1}),_g=class extends G{constructor(e,t,n,r,i,a){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=i,this._configurationService=a,this._codeActionOracle=this._register(new lc),this._state=hg.Empty,this._onDidChangeState=this._register(new N),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new lc),this._disposed=!1,this._ignoreLightbulbOff=!1,this._supportedCodeActions=pg.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(hg.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(hg.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 mg(this._editor,this._markerService,t=>{if(!t){this.setState(hg.Empty);return}let n=t.selection.getStartPosition(),r=Et(async n=>{if(this._settingEnabledNearbyQuickfixes()&&t.trigger.type===1&&(t.trigger.triggerAction===Lh.QuickFix||t.trigger.filter?.include?.contains(Ih.QuickFix))){let r=new F,i=!1;try{let a=r.add(await $h(this._registry,e,t.selection,t.trigger,Yl.None,n)),o=[...a.allActions];if(n.isCancellationRequested)return gg;let s=a.validActions?.some(e=>e.action.kind&&Ih.QuickFix.contains(new Jp(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 A(p,f);let i={type:t.trigger.type,triggerAction:t.trigger.triggerAction,filter:{include:t.trigger.filter?.include?t.trigger.filter?.include:Ih.QuickFix},autoApply:t.trigger.autoApply,context:{notAvailableMessage:t.trigger.context?.notAvailableMessage||``,position:l}},m=new q(l.lineNumber,l.column,l.lineNumber,l.column),h=r.add(await $h(this._registry,e,m,i,Yl.None,n));if(n.isCancellationRequested)return gg;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 $h(this._registry,e,t.selection,t.trigger,Yl.None,n);return n.isCancellationRequested?(r.dispose(),gg):this._setCodeActions(r)}let r=await $h(this._registry,e,t.selection,t.trigger,Yl.None,n);return n.isCancellationRequested?(r.dispose(),gg):this._setCodeActions(r)});t.trigger.type===1&&this._progressService?.showWhile(r,250);let i=new hg.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:Lh.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))}},vg=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},yg=function(e,t){return function(n,r){t(n,r,e)}},bg,xg=kr(`gutter-lightbulb`,k.lightBulb,x(925,`Icon which spawns code actions menu from the gutter when there is no space in the editor.`)),Sg=kr(`gutter-lightbulb-auto-fix`,k.lightbulbAutofix,x(926,`Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.`)),Cg=kr(`gutter-lightbulb-sparkle`,k.lightbulbSparkle,x(927,`Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.`)),wg=kr(`gutter-lightbulb-aifix-auto-fix`,k.lightbulbSparkleAutofix,x(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.`)),Tg=kr(`gutter-lightbulb-sparkle-filled`,k.sparkleFilled,x(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.`)),Eg;(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})(Eg||={});function Dg(e,t,n,r,i=!1){if(e.validActions.length<=0)return;let a,o=!1;e.allAIFixes?(a=i?Tg:k.sparkleFilled,e.validActions.length===1&&(o=!0)):a=e.hasAutoFix?e.hasAIFix?i?wg:k.lightbulbSparkleAutofix:i?Sg:k.lightbulbAutofix:e.hasAIFix?i?Cg:k.lightbulbSparkle:i?xg:k.lightBulb;let s;return s=o?x(930,`Run: {0}`,e.validActions[0].action.title):e.hasAutoFix&&n?x(931,`Show Code Actions. Preferred Quick Fix Available ({0})`,n):!e.hasAutoFix&&r?x(932,`Show Code Actions ({0})`,r):x(933,`Show Code Actions`),{actions:e,trigger:t,icon:a,autoRun:o,title:s,isGutter:i}}var Og=class extends G{static{bg=this}static{this.GUTTER_DECORATION=P.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:V.asClassName(k.lightBulb),glyphMargin:{position:nr.Left},stickiness:1})}static{this.ID=`editor.contrib.lightbulbWidget`}static{this._posPref=[0]}static _computeLightBulbInfo(e,t,n,r){if(e.type===1)return Dg(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 N),this.onClick=this._onClick.event,this._state=os(this,Eg.Hidden),this._gutterState=os(this,Eg.Hidden),this._combinedInfo=B(this,e=>{let t=this._gutterState.read(e);if(t.type===1)return bg._computeLightBulbInfo(t,!0,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e));let n=this._state.read(e);if(n.type===1)return bg._computeLightBulbInfo(n,!1,this._preferredKbLabel.read(e),this._quickFixKbLabel.read(e))}),this._iconClasses=[],this.lightbulbClasses=[`codicon-`+xg.id,`codicon-`+wg.id,`codicon-`+Sg.id,`codicon-`+Cg.id,`codicon-`+Tg.id],this._preferredKbLabel=os(this,void 0),this._quickFixKbLabel=os(this,void 0),this.gutterDecoration=bg.GUTTER_DECORATION,this._domNode=M(`div.lightBulbWidget`),this._domNode.role=`listbox`,this._register(sn.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(xc(this._domNode,e=>{let t=this._state.get();if(t.type!==1)return;this._editor.focus(),e.preventDefault();let{top:n,height:r}=ga(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(I(this._domNode,`mouseenter`,e=>{(e.buttons&1)==1&&this.hide()})),this._register(pu.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(Ml(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}=ga(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===ut.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=$i(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 Eg.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:bg._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 Eg.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:bg._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 Eg.Showing(e,t,n,{position:{lineNumber:m,column:h},preference:bg._posPref}),void 0),this._gutterDecorationID&&(this._removeGutterDecoration(this._gutterDecorationID),this.gutterHide());let g=e.validActions;e.validActions[0].action.kind,g.length,this._editor.layoutContentWidget(this)}hide(){this._state.get()!==Eg.Hidden&&(this._state.set(Eg.Hidden,void 0),this._editor.layoutContentWidget(this))}gutterHide(){this._gutterState.get()!==Eg.Hidden&&(this._gutterDecorationID&&this._removeGutterDecoration(this._gutterDecorationID),this._gutterState.set(Eg.Hidden,void 0))}_updateLightBulbTitleAndIcon(e){this._domNode.classList.remove(...this._iconClasses),this._iconClasses=[],e&&!e.isGutter&&(this._domNode.title=e.title,this._iconClasses=V.asClassNameArray(e.icon),this._domNode.classList.add(...this._iconClasses))}_updateGutterDecorationOptions(e){e&&e.isGutter&&(this.gutterDecoration=P.register({description:`codicon-gutter-lightbulb-decoration`,glyphMarginClassName:V.asClassName(e.icon),glyphMargin:{position:nr.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 C(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 C(t,0,t,0)),n.changeDecorationOptions(e,this.gutterDecoration)})}};Og=bg=vg([yg(1,Sa)],Og);var kg=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},Ag=function(e,t){return function(n,r){t(n,r,e)}},jg,Mg=`quickfix-edit-highlight`,Ng=class extends G{static{jg=this}static{this.ID=`editor.contrib.codeActionController`}static get(e){return e.getContribution(jg.ID)}constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(),this._commandService=o,this._configurationService=s,this._actionWidgetService=c,this._instantiationService=l,this._progressService=u,this._keybindingService=d,this._activeCodeActions=this._register(new lc),this._showDisabled=!1,this._disposed=!1,this._onlyLightBulbWithEmptySelection=!1,this._lightBulbInfoObs=os(this,void 0),this._preferredKbLabel=os(this,void 0),this._quickFixKbLabel=os(this,void 0),this._editor=e,this._model=this._register(new _g(this._editor,i.codeActionProvider,t,n,a,s)),this._register(this._model.onDidChangeState(e=>this.update(e))),this._register(pu.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 jc(()=>{let e=this._editor.getContribution(Og.ID);return e&&(this._register(e.onClick(e=>this.showCodeActionsFromLightbulb(e.actions,e))),e.onlyWithEmptySelection=this._onlyLightBulbWithEmptySelection),e}),this._resolver=r.createInstance(lg),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,rg.FromAILightbulb)}else 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;rm.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(ig,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Lh.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){nt(e);return}if(t){if(this._disposed)t.dispose();else if(this._editor.getSelection()?.startLineNumber!==e.position.lineNumber)t.dispose();else if(this._lightBulbWidget.value?.update(t,e.trigger,e.position),this._lightBulbInfoObs.set(Dg(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,rg.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){let n=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(n&&n.action.disabled){rm.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)){rm.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]}static{this.DECORATION=P.register({description:`quickfix-highlight`,className:Mg})}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=A.isIPosition(t)?this.toCoords(t):t;this._actionWidgetService.show(`codeActionWidget`,!0,fg(a,this._shouldShowHeaders(),this._resolver.getResolver()),{onSelect:async(e,t)=>{this.applyCodeAction(e,!0,!!t,n.fromLightbulb?rg.FromAILightbulb:rg.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 Jp(r);n=[Ih.RefactorExtract,Ih.RefactorInline,Ih.RefactorRewrite,Ih.RefactorMove,Ih.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:jg.DECORATION})):t.map(e=>({range:e,options:jg.DECORATION}));r.set(e)}else if(n&&n.length>0){let e=n.map(e=>({range:e,options:jg.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;so(x(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=ga(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:x(915,`Hide Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:`showMoreActions`,label:x(916,`Show Disabled`),enabled:!0,tooltip:``,class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}};Ng=jg=kg([Ag(1,Ac),Ag(2,Fa),Ag(3,U),Ag(4,R),Ag(5,_c),Ag(6,Er),Ag(7,Vi),Ag(8,ch),Ag(9,U),Ag(10,_c),Ag(11,Sa)],Ng),Pa((e,t)=>{((e,n)=>{n&&t.addRule(`.monaco-editor ${e} { background-color: ${n}; }`)})(`.quickfix-edit-highlight`,e.getColor(Ku));let n=e.getColor(Gc);n&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${mt(e.type)?`dotted`:`solid`} ${n}; box-sizing: border-box; }`)});function Pg(e){return w.regex(pg.keys()[0],RegExp(`(\\s|^)`+rd(e.value)+`\\b`))}var Fg={type:`object`,defaultSnippets:[{body:{kind:``}}],properties:{kind:{type:`string`,description:x(882,`Kind of the code action to run.`)},apply:{type:`string`,description:x(883,`Controls when the returned actions are applied.`),default:`ifSingle`,enum:[`first`,`ifSingle`,`never`],enumDescriptions:[x(884,`Always apply the first returned code action.`),x(885,`Apply the first returned code action if it is the only one.`),x(886,`Do not apply the returned code actions.`)]},preferred:{type:`boolean`,default:!1,description:x(887,`Controls if only preferred code actions should be returned.`)}}};function Ig(e,t,n,r,i=Lh.Default){e.hasModel()&&Ng.get(e)?.manualTriggerAtCurrentPosition(t,i,n,r)}var Lg=class extends su{constructor(){super({id:Wh,title:L(904,`Quick Fix...`),precondition:w.and(E.writable,E.hasCodeActionsProvider),icon:k.lightBulb,f1:!0,keybinding:{when:E.textInputFocus,primary:2137,weight:100},menu:{id:D.InlineChatEditorAffordance,group:`1_quickfix`,order:0,when:w.and(E.writable,E.hasCodeActionsProvider)}})}runEditorCommand(e,t){return Ig(t,x(888,`No code actions available`),void 0,void 0,Lh.QuickFix)}},Rg=class extends td{constructor(){super({id:Uh,precondition:w.and(E.writable,E.hasCodeActionsProvider),metadata:{description:`Trigger a code action`,args:[{name:`args`,schema:Fg}]}})}runEditorCommand(e,t,n){let r=Vh.fromUser(n,{kind:Jp.Empty,apply:`ifSingle`});return Ig(t,typeof n?.kind==`string`?r.preferred?x(889,`No preferred code actions for '{0}' available`,n.kind):x(890,`No code actions for '{0}' available`,n.kind):r.preferred?x(891,`No preferred code actions available`):x(892,`No code actions available`),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}},zg=class extends W{constructor(){super({id:Kh,label:L(905,`Refactor...`),precondition:w.and(E.writable,E.hasCodeActionsProvider),kbOpts:{kbExpr:E.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:`1_modification`,order:2,when:w.and(E.writable,Pg(Ih.Refactor))},metadata:{description:`Refactor...`,args:[{name:`args`,schema:Fg}]}})}run(e,t,n){let r=Vh.fromUser(n,{kind:Ih.Refactor,apply:`never`});return Ig(t,typeof n?.kind==`string`?r.preferred?x(893,`No preferred refactorings for '{0}' available`,n.kind):x(894,`No refactorings for '{0}' available`,n.kind):r.preferred?x(895,`No preferred refactorings available`):x(896,`No refactorings available`),{include:Ih.Refactor.contains(r.kind)?r.kind:Jp.None,onlyIncludePreferredActions:r.preferred},r.apply,Lh.Refactor)}},Bg=class extends W{constructor(){super({id:qh,label:L(906,`Source Action...`),precondition:w.and(E.writable,E.hasCodeActionsProvider),contextMenuOpts:{group:`1_modification`,order:2.1,when:w.and(E.writable,Pg(Ih.Source))},metadata:{description:`Source Action...`,args:[{name:`args`,schema:Fg}]}})}run(e,t,n){let r=Vh.fromUser(n,{kind:Ih.Source,apply:`never`});return Ig(t,typeof n?.kind==`string`?r.preferred?x(897,`No preferred source actions for '{0}' available`,n.kind):x(898,`No source actions for '{0}' available`,n.kind):r.preferred?x(899,`No preferred source actions available`):x(900,`No source actions available`),{include:Ih.Source.contains(r.kind)?r.kind:Jp.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Lh.SourceAction)}},Vg=class extends W{constructor(){super({id:Jh,label:L(907,`Organize Imports`),precondition:w.and(E.writable,Pg(Ih.SourceOrganizeImports)),kbOpts:{kbExpr:E.textInputFocus,primary:1581,weight:100},metadata:{description:L(908,`Organize imports in the current file. Also called 'Optimize Imports' by some tools`)}})}run(e,t){return Ig(t,x(901,`No organize imports action available`),{include:Ih.SourceOrganizeImports,includeSourceActions:!0},`ifSingle`,Lh.OrganizeImports)}},Hg=class extends W{constructor(){super({id:Yh,label:L(909,`Fix All`),precondition:w.and(E.writable,Pg(Ih.SourceFixAll))})}run(e,t){return Ig(t,x(902,`No fix all action available`),{include:Ih.SourceFixAll,includeSourceActions:!0},`ifSingle`,Lh.FixAll)}},Ug=class extends W{constructor(){super({id:Gh,label:L(910,`Auto Fix...`),precondition:w.and(E.writable,Pg(Ih.QuickFix)),kbOpts:{kbExpr:E.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Ig(t,x(903,`No auto fixes available`),{include:Ih.QuickFix,onlyIncludePreferredActions:!0},`ifSingle`,Lh.AutoFix)}};Ps(Ng.ID,Ng,3),Ps(Og.ID,Og,4),ea(Lg),z(zg),z(Bg),z(Vg),z(Ug),z(Hg),H(new Rg),At.as(Vu.Configuration).registerConfiguration({...Td,properties:{"editor.codeActionWidget.showHeaders":{type:`boolean`,scope:6,description:x(911,`Enable/disable showing group headers in the Code Action menu.`),default:!0}}}),At.as(Vu.Configuration).registerConfiguration({...Td,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:`boolean`,scope:6,description:x(912,`Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic.`),default:!0}}}),At.as(Vu.Configuration).registerConfiguration({...Td,properties:{"editor.codeActions.triggerOnFocusChange":{type:`boolean`,scope:6,markdownDescription:x(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 Wg=class e{constructor(){this.lenses=[]}static{this.Empty=new e}dispose(){this._store?.dispose()}get isDisposed(){return this._store?.isDisposed??!1}add(e,t){Sc(e)&&(this._store??=new F,this._store.add(e));for(let n of e.lenses)this.lenses.push({symbol:n,provider:t})}};async function Gg(e,t,n){let r=e.ordered(t),i=new Map,a=new Wg,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){Zs(e)}});return await Promise.all(o),n.isCancellationRequested?(a.dispose(),Wg.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)}In.registerCommand(`_executeCodeLensProvider`,function(e,...t){let[n,r]=t;Qn(Yn.isUri(n)),Qn(typeof r==`number`||!r);let{codeLensProvider:i}=e.get(R),a=e.get(ct).getModel(n);if(!a)throw Po();let o=[],s=new F;return Gg(i,a,T.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,T.None)).then(e=>o.push(e||n.symbol)));return Promise.all(t)}).then(()=>o).finally(()=>{setTimeout(()=>s.dispose(),100)})});var Kg=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},qg=function(e,t){return function(n,r){t(n,r,e)}},Jg=$l(`ICodeLensCache`),Yg=class{constructor(e,t){this.lineCount=e,this.data=t}},Xg=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw Error(`not supported`)}},this._cache=new yi(20,.75),Oa(Xd,()=>e.remove(`codelens/cache`,1));let t=`codelens/cache2`,n=e.get(t,1,`{}`);this._deserialize(n);let r=pu.filter(e.onWillSaveState,e=>e.reason===Xo.SHUTDOWN);pu.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 Wg;r.add({lenses:n},this._fakeProvider);let i=new Yg(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 C(e,1,e,11)});let i=new Wg;i.add({lenses:r},this._fakeProvider),this._cache.set(e,new Yg(n.lineCount,i))}}catch{}}};Xg=Kg([qg(0,Ec)],Xg),mo(Jg,Xg,1);var Zg=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`)}},Qg=class e{static{this._idPool=0}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=cl(a.command.title.trim());if(a.command.id){let t=`c${e._idPool++}`;r.push(M(`a`,{id:t,title:a.command.tooltip,role:`button`},...i)),this._commands.set(t,a.command)}else r.push(M(`span`,{title:a.command.tooltip},...i));n+1<t.length&&r.push(M(`span`,void 0,`\xA0|\xA0`))}}i?(Ba(this._domNode,...r),this._isEmpty&&n&&this._domNode.classList.add(`fadein`),this._isEmpty=!1):Ba(this._domNode,M(`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}},$g=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])}},e_=P.register({collapseOnReplaceEdit:!0,description:`codelens`}),t_=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:e_},e=>this._decorationIds[t]=e),o=o?C.plusRange(o,e.symbol.range):C.lift(e.symbol.range)}),this._viewZone=new Zg(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 Qg(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&&C.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:e_},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)))}}},n_=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},r_=function(e,t){return function(n,r){t(n,r,e)}},i_=class{static{this.ID=`css.editor.codeLens`}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 F,this._localToDispose=new F,this._lenses=[],this._oldCodeLensModels=new F,this._provideCodeLensDebounce=n.for(t.codeLensProvider,`CodeLensProvide`,{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,`CodeLensResolve`,{min:250,salt:`resolve`}),this._resolveCodeLensesScheduler=new Pr(()=>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`,Ju.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&&Ua(()=>{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 Pr(()=>{let t=Date.now();this._getCodeLensModelPromise?.cancel(),this._getCodeLensModelPromise=Et(t=>Gg(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()},nt)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(Ko(()=>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 $g;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(Ko(()=>{if(this._editor.getModel()){let e=dt.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 $g;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=dt.capture(this._editor),a=this._getLayoutInfo();this._editor.changeDecorations(e=>{this._editor.changeViewZones(t=>{let r=new $g,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 t_(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 t_(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=Et(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},Zs):(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=>{nt(e),i===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,this._currentCodeLensModel?.isDisposed?void 0:this._currentCodeLensModel}};i_=n_([r_(1,R),r_(2,Us),r_(3,Er),r_(4,vt),r_(5,Jg)],i_),Ps(i_.ID,i_,1),z(class extends W{constructor(){super({id:`codelens.showLensesInCurrentLine`,precondition:E.hasCodeLensProvider,label:L(935,`Show CodeLens Commands for Current Line`)})}async run(e,t){if(!t.hasModel())return;let n=e.get(Gd),r=e.get(Er),i=e.get(vt),a=t.getSelection().positionLineNumber,o=t.getContribution(i_.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:x(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 a_=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}},o_=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}},s_=class{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){for(let e of this.renderedHoverParts)e.dispose();this.disposables?.dispose()}},c_=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}},l_=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},u_=function(e,t){return function(n,r){t(n,r,e)}},d_=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 Ws(new ku(Math.round(255*i.red),Math.round(255*i.green),Math.round(255*i.blue),i.alpha)),o=Ws.Format.CSS.formatRGB(a),s=Ws.Format.CSS.formatHSL(a),c=Ws.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}};d_=l_([u_(0,cr)],d_);var f_=class extends G{constructor(e,t){super(),this._register(e.colorProvider.register(`*`,new d_(t)))}};f_=l_([u_(0,R),u_(1,cr)],f_);async function p_(e,t,n,r=`auto`){return v_(new h_,e,t,n,r)}function m_(e,t,n,r){return Promise.resolve(n.provideColorPresentations(e,t,r))}var h_=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)}},g_=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)}},__=class{constructor(e){this.colorInfo=e}async compute(e,t,n,r){let i=await e.provideColorPresentations(t,this.colorInfo,T.None);return Array.isArray(i)&&r.push(...i),Array.isArray(i)}};async function v_(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 d_)o=l;else try{await e.compute(l,n,r,s)&&(a=!0)}catch(e){Zs(e)}}return a?s:o&&i!==`never`?(await e.compute(o,n,r,s),s):[]}function y_(e,t){let{colorProvider:n}=e.get(R),r=e.get(ct).getModel(t);if(!r)throw Po();return{model:r,colorProviderRegistry:n,defaultColorDecoratorsEnablement:e.get(Vi).getValue(`editor.defaultColorDecorators`,{resource:t})}}var b_=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},x_=function(e,t){return function(n,r){t(n,r,e)}},S_,C_=Object.create({}),w_=class extends G{static{S_=this}static{this.ID=`editor.contrib.colorDetector`}static{this.RECOMPUTE_TIME=1e3}static{this.colorDecoratorInnerWidthInEm=.8}static{this.colorDecoratorMarginInEm=.2}constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new F),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new T_),this._colorDecorationClassRefs=this._register(new F),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new ol(this._editor));let i=this._editor.getContainerDomNode();i.style.setProperty(`--vscode-colorPicker-colorDecoratorWidth`,`${S_.colorDecoratorInnerWidthInEm}em`),i.style.setProperty(`--vscode-colorPicker-colorDecoratorMargin`,`${S_.colorDecoratorMarginInEm}em`),this._register(Ko(()=>{i.style.removeProperty(`--vscode-colorPicker-colorDecoratorWidth`),i.style.removeProperty(`--vscode-colorPicker-colorDecoratorMargin`)})),this._debounceInformation=r.for(n.colorProvider,`Document Colors`,{min:S_.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 Xi,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Et(async e=>{let t=this._editor.getModel();if(!t)return[];let n=new Os(!1),r=await p_(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){nt(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:P.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=S_.colorDecoratorInnerWidthInEm+2*S_.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 ku(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:C_,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(C.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)}};w_=S_=b_([x_(1,Vi),x_(2,R),x_(3,Us)],w_);var T_=class extends G{constructor(){super(...arguments),this._onDidChange=this._register(new N),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}},E_=`editor.action.showHover`,D_=`editor.action.showDefinitionPreviewHover`,O_=`editor.action.hideHover`,k_=`editor.action.scrollUpHover`,A_=`editor.action.scrollDownHover`,j_=`editor.action.scrollLeftHover`,M_=`editor.action.scrollRightHover`,N_=`editor.action.pageUpHover`,P_=`editor.action.pageDownHover`,F_=`editor.action.goToTopHover`,I_=`editor.action.goToBottomHover`,L_=`editor.action.increaseHoverVerbosityLevel`,R_=x(1160,`Increase Hover Verbosity Level`),z_=`editor.action.decreaseHoverVerbosityLevel`,B_=x(1161,`Decrease Hover Verbosity Level`),V_=`editor.action.hideLongLineWarningHover`,H_=`editor.action.inlineSuggest.commit`,U_=`editor.action.inlineSuggest.commitAlternativeAction`,W_=`editor.action.inlineSuggest.showPrevious`,G_=`editor.action.inlineSuggest.showNext`,K_=`editor.action.inlineSuggest.jump`,q_=`editor.action.inlineSuggest.hide`,J_=`editor.action.inlineSuggest.toggleShowCollapsed`,Y_=`editor.action.inlineSuggest.renameSymbol`,X_=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},Z_=function(e,t){return function(n,r){t(n,r,e)}},Q_,$_=class extends G{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=ru(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar===`always`),this.sessionPosition=void 0,this.position=B(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 A(t.lineNumber,Math.min(n,this.sessionPosition?.column??2**53-1));return this.sessionPosition=r,r}),this._register(Hs((t,n)=>{let r=this.model.read(t);if(!r||!this.alwaysShowToolbar.read(t))return;let i=B(t=>{let n=t.store.add(this.instantiationService.createInstance(nv.hot.read(t),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(n),t.store.add(Ko(()=>e.removeContentWidget(n))),t.store.add(Ml(e=>{this.position.read(e)&&r.lastTriggerKind.read(e)!==xi.Explicit&&r.triggerExplicitly()})),n}),a=No(this,(e,t)=>!!this.position.read(e)||!!t);n.add(Ml(e=>{a.read(e)&&i.read(e)}))}))}};$_=X_([Z_(2,U)],$_);var ev=kr(`inline-suggestion-hints-next`,k.chevronRight,x(1270,`Icon for show next parameter hint.`)),tv=kr(`inline-suggestion-hints-previous`,k.chevronLeft,x(1271,`Icon for show previous parameter hint.`)),nv=class extends G{static{Q_=this}static{this.hot=$r(this)}static{this._dropDownVisible=!1}static get dropDownVisible(){return this._dropDownVisible}static{this.id=0}createCommandAction(e,t,n){let r=new gr(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${Q_.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=B(e=>{let t=this._warning.read(e);if(t)return typeof t.message==`string`?t.message:e.store.add(bl(t.message)).element}),this._warningMessageNode=S.div({class:`warningMessage`,style:{maxWidth:400,margin:4,marginBottom:4,display:B(e=>this._warning.read(e)?`block`:`none`)}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=Ur(`div.inlineSuggestionsHints`,{className:this.withBorder?`monaco-hover monaco-hover-content`:``},[this._warningMessageNode.element,Ur(`div@toolBar`)]),this.previousAction=this._register(this.createCommandAction(W_,x(1272,`Previous`),V.asClassName(tv))),this.availableSuggestionCountAction=this._register(new gr(`inlineSuggestionHints.availableSuggestionCount`,``,void 0,!1)),this.nextAction=this._register(this.createCommandAction(G_,x(1273,`Next`),V.asClassName(ev))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(D.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Pr(()=>{this.availableSuggestionCountAction.label=``},100)),this.disableButtonsDebounced=this._register(new Pr(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(Ml(e=>{this._warningMessageContentNode.read(e),this._warningMessageNode.readEffect(e),this._relayout()})),this.toolBar=this._register(l.createInstance(av,this.nodes.toolBar,D.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith(`primary`)},actionViewItemProvider:(e,t)=>{if(e instanceof ji)return l.createInstance(iv,e,void 0);if(e===this.availableSuggestionCountAction){let t=new rv(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=>{Q_._dropDownVisible=e})),this._register(Ml(e=>{this._position.read(e),this.editor.layoutContentWidget(this)})),this._register(Ml(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(Ml(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 ji&&t.push(e);t.length>0&&t.unshift(new Oo),this.toolBar.setAdditionalSecondaryActions(t)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};nv=Q_=X_([Z_(8,Er),Z_(9,U),Z_(10,Sa),Z_(11,Fa),Z_(12,Xr)],nv);var rv=class extends _o{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(){}},iv=class extends ta{updateLabel(){let e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){let t=Ur(`div.keybinding`).root;this._register(new Pf(t,gs,{disableTitle:!0,...St})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add(`inlineSuggestionStatusBarItemLabel`)}}updateTooltip(){}},av=class extends Sf{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}=Ja(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){Ad(this.prependedPrimaryActions,e,(e,t)=>e===t)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Ad(this.additionalActions,e,(e,t)=>e===t)||(this.additionalActions=e,this.updateToolbar())}};av=X_([Z_(3,Xr),Z_(4,Fa),Z_(5,nc),Z_(6,Sa),Z_(7,Er),Z_(8,yt)],av);function ov(e,t,n){let r=ga(e);return!(t<r.left+3||t>r.left+r.width-3||n<r.top+3||n>r.top+r.height-3)}function sv(e,t,n){return e===`on`||e!==`off`&&cv(t,n.event)}function cv(e,t){return e===`altKey`?t.ctrlKey||t.metaKey:t.altKey}var lv=class{constructor(e,t,n,r){this.value=e,this.isComplete=t,this.hasLoadingMessage=n,this.options=r}},uv=class extends G{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new N),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new dv(e=>this._triggerAsyncComputation(e),0)),this._syncComputationScheduler=this._register(new dv(e=>this._triggerSyncComputation(e),0)),this._loadingMessageScheduler=this._register(new dv(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=zf(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){nt(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 lv(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}},dv=class extends G{constructor(e,t){super(),this._scheduler=this._register(new Pr(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}},fv=class{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new N,this._onDidResize=new N,this._sashListener=new F,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 ci(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new ci(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new ci(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:Zr.North}),this._southSash=new ci(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:Zr.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(pu.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(pu.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(pu.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(pu.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}},pv=30,mv=24,hv=class extends G{constructor(e,t=new fu(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new fv),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?A.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(t&&n)return ga(t).top+n.top-pv}_availableVerticalSpaceBelow(e){let t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;let r=ga(t),i=Pt(t.ownerDocument.body),a=r.top+n.top+n.height;return i.height-a-mv}_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)}},gv=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},_v=function(e,t){return function(n,r){t(n,r,e)}},vv,yv=30,bv=class extends hv{static{vv=this}static{this.ID=`editor.contrib.resizableContentHoverWidget`}static{this._lastDimensions=new fu(0,0)}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 Lo(!0)),this._onDidResize=this._register(new N),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new N),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new N),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=o,this._hoverVisibleKey=E.hoverVisible.bindTo(t),this._hoverFocusedKey=E.hoverFocused.bindTo(t),K(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(lr(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 vv.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 vv._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){let n=this._hover.containerDomNode;return vv._applyDimensions(n,e,t)}_setScrollableElementDimensions(e,t){let n=this._hover.scrollbar.getDomNode();return vv._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){vv._applyMaxDimensions(this._hover.contentsDomNode,e,t),vv._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),vv._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){vv._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?Pt(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=ga(this.getDomNode());this._renderedHover.closestMouseDistance===void 0&&(this._renderedHover.closestMouseDistance=xv(this._renderedHover.initialMousePosX,this._renderedHover.initialMousePosY,n.left,n.top,n.width,n.height));let r=xv(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,vv._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,vv._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=gl(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&&at(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=gl(e),n=pt(e)+2;if(this._resizableNode.layout(t,n),this._setHoverWidgetDimensions(n,t),t=gl(e),n=pt(e),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(t,n),this._renderedHover?.showAtPosition){let e=gl(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-yv})}scrollRight(){let e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+yv})}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})}};bv=vv=gv([_v(1,Fa),_v(2,Vi),_v(3,On),_v(4,Sa)],bv);function xv(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 Sv=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 Di.EMPTY;let i=e._getLineDecorations(this._editor,r);return Di.merge(this._participants.map(e=>e.computeAsync?e.computeAsync(r,i,t.source,n):Di.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 mu(i)}},Cv=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 wv(this,t,this.isComplete,this.options)}},wv=class extends Cv{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}},Tv=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},Ev=function(e,t){return function(n,r){t(n,r,e)}},Dv=M,Ov=class extends G{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=Dv(`div.hover-row.status-bar`),this.hoverElement.tabIndex=0,this.actionsElement=K(this.hoverElement,Dv(`div.actions`))}addAction(e){let t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;this._hasContent=!0;let r=this._register(po.render(this.actionsElement,e,n));return this._register(this._hoverService.setupManagedHover(ec(`element`),r.actionContainer,r.actionRenderedLabel)),this.actions.push(r),r}append(e){let t=K(this.actionsElement,e);return this._hasContent=!0,t}};Ov=Tv([Ev(0,Sa),Ev(1,ou)],Ov);var kv=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 C(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 C(s,1,c,1),options:e._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),s=r.startLineNumber,c=r.endLineNumber)}a.push({range:new C(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}static{this._CURRENT_FIND_MATCH_DECORATION=P.register({description:`current-find-match`,stickiness:1,zIndex:13,className:`currentFindMatch`,inlineClassName:`currentFindMatchInline`,showIfCollapsed:!0,overviewRuler:{color:ro(ha),position:Qi.Center},minimap:{color:ro(Ru),position:1}})}static{this._FIND_MATCH_DECORATION=P.register({description:`find-match`,stickiness:1,zIndex:10,className:`findMatch`,inlineClassName:`findMatchInline`,showIfCollapsed:!0,overviewRuler:{color:ro(ha),position:Qi.Center},minimap:{color:ro(Ru),position:1}})}static{this._FIND_MATCH_NO_OVERVIEW_DECORATION=P.register({description:`find-match-no-overview`,stickiness:1,className:`findMatch`,showIfCollapsed:!0})}static{this._FIND_MATCH_ONLY_OVERVIEW_DECORATION=P.register({description:`find-match-only-overview`,stickiness:1,overviewRuler:{color:ro(ha),position:Qi.Center}})}static{this._RANGE_HIGHLIGHT_DECORATION=P.register({description:`find-range-highlight`,stickiness:1,className:`rangeHighlight`,isWholeLine:!0})}static{this._FIND_SCOPE_DECORATION=P.register({description:`find-scope`,className:`findScope`,isWholeLine:!0})}},Av=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)=>C.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 jv(e,t){if(e&&e[0]!==``){let n=Mv(e,t,`-`),r=Mv(e,t,`_`);return n&&!r?Nv(e,t,`-`):!n&&r?Nv(e,t,`_`):e[0].toUpperCase()===e[0]?t.toUpperCase():e[0].toLowerCase()===e[0]?t.toLowerCase():lu(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 Mv(e,t,n){return e[0].indexOf(n)!==-1&&t.indexOf(n)!==-1&&e[0].split(n).length===t.split(n).length}function Nv(e,t,n){let r=t.split(n),i=e[0].split(n),a=``;return r.forEach((e,t)=>{a+=jv([i[t]],e)+n}),a.slice(0,-1)}var Pv=class{constructor(e){this.staticValue=e,this.kind=0}},Fv=class{constructor(e){this.pieces=e,this.kind=1}},Iv=class e{static fromStaticValue(t){return new e([Lv.staticValue(t)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){this._state=!e||e.length===0?new Pv(``):e.length===1&&e[0].staticValue!==null?new Pv(e[0].staticValue):new Fv(e)}buildReplaceString(t,n){if(this._state.kind===0)return n?jv(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}},Lv=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)}},Rv=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++]=Lv.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),this._result[this._resultLen++]=Lv.caseOps(e,n),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=Lv.staticValue(this._currentStaticPiece),this._currentStaticPiece=``),new Iv(this._result)}};function zv(e){if(!e||e.length===0)return new Iv(null);let t=[],n=new Rv(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(`
|
|
@@ -49,4 +49,4 @@ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{A as t,B as n,D as r,F
|
|
|
49
49
|
`);return new e(t,n,i,l,a,o,u)}constructor(e,t,n,r,i,a,o){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=n,this.searchText=r,this.wholeWord=i,this.matchCase=a,this.currentMatch=o}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;let e=this._getNextMatch();return e?new Az(this._editor.getSelections().concat(e),e,0):null}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;let e=this._getNextMatch();if(!e)return null;let t=this._editor.getSelections();return new Az(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){let e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();let e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return n?new q(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;let e=this._getPreviousMatch();return e?new Az(this._editor.getSelections().concat(e),e,0):null}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;let e=this._getPreviousMatch();if(!e)return null;let t=this._editor.getSelections();return new Az(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){let e=this.currentMatch;return this.currentMatch=null,e}this.findController.highlightFindOptions();let e=this._editor.getSelections(),t=e[e.length-1],n=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return n?new q(n.range.startLineNumber,n.range.startColumn,n.range.endLineNumber,n.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();let t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824)}},Mz=class e extends G{static{this.ID=`editor.contrib.multiCursorController`}static get(t){return t.getContribution(e.ID)}constructor(e){super(),this._sessionDispose=this._register(new F),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){let t=jz.create(this._editor,e);if(!t)return;this._session=t;let n={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(n.wholeWordOverride=1,n.matchCaseOverride=1,n.isRegexOverride=2),e.getState().change(n,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(e=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(e=>{(e.matchCase||e.wholeWord)&&this._endSession()}))}}_endSession(){this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController&&this._session.findController.getState().change({wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0},!1),this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;let n=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return n?new q(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){let t=this._editor.getSelections();if(t.length>1){let n=e.getState().matchCase;if(!Hz(this._editor.getModel(),t,n)){let e=this._editor.getModel(),n=[];for(let r=0,i=t.length;r<i;r++)n[r]=this._expandEmptyToWord(e,t[r]);this._editor.setSelections(n);return}}}this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToNextFindMatch())}}addSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.addSelectionToPreviousFindMatch())}moveSelectionToNextFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToNextFindMatch())}moveSelectionToPreviousFindMatch(e){this._beginSessionIfNeeded(e),this._session&&this._applySessionResult(this._session.moveSelectionToPreviousFindMatch())}selectAll(e){if(!this._editor.hasModel())return;let t=null,n=e.getState();if(n.isRevealed&&n.searchString.length>0&&n.isRegex){let e=this._editor.getModel();t=n.searchScope?e.findMatches(n.searchString,n.searchScope,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(148):null,!1,1073741824):e.findMatches(n.searchString,!0,n.isRegex,n.matchCase,n.wholeWord?this._editor.getOption(148):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(n.searchScope)}if(t.length>0){let e=this._editor.getSelection();for(let n=0,r=t.length;n<r;n++){let r=t[n];if(r.range.intersectRanges(e)){t[n]=t[0],t[0]=r;break}}this._setSelections(t.map(e=>new q(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn)))}}},Nz=class extends W{run(e,t){let n=Mz.get(t);if(!n)return;let r=t._getViewModel();if(r){let i=r.getCursorStates(),a=Ow.get(t);if(a)this._run(n,a);else{let r=e.get(U).createInstance(Ow,t);this._run(n,r),r.dispose()}wz(i,r.getCursorStates())}}},Pz=class extends Nz{constructor(){super({id:`editor.action.addSelectionToNextFindMatch`,label:L(1369,`Add Selection to Next Find Match`),precondition:void 0,kbOpts:{kbExpr:E.focus,primary:2082,weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:`3_multi`,title:x(1359,`Add &&Next Occurrence`),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}},Fz=class extends Nz{constructor(){super({id:`editor.action.addSelectionToPreviousFindMatch`,label:L(1370,`Add Selection to Previous Find Match`),precondition:void 0,menuOpts:{menuId:D.MenubarSelectionMenu,group:`3_multi`,title:x(1360,`Add P&&revious Occurrence`),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}},Iz=class extends Nz{constructor(){super({id:`editor.action.moveSelectionToNextFindMatch`,label:L(1371,`Move Last Selection to Next Find Match`),precondition:void 0,kbOpts:{kbExpr:E.focus,primary:Or(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}},Lz=class extends Nz{constructor(){super({id:`editor.action.moveSelectionToPreviousFindMatch`,label:L(1372,`Move Last Selection to Previous Find Match`),precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}},Rz=class extends Nz{constructor(){super({id:`editor.action.selectHighlights`,label:L(1373,`Select All Occurrences of Find Match`),precondition:void 0,kbOpts:{kbExpr:E.focus,primary:3114,weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:`3_multi`,title:x(1361,`Select All &&Occurrences`),order:7}})}_run(e,t){e.selectAll(t)}},zz=class extends Nz{constructor(){super({id:`editor.action.changeAll`,label:L(1374,`Change All Occurrences`),precondition:w.and(E.writable,E.editorTextFocus),kbOpts:{kbExpr:E.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:`1_modification`,order:1.2}})}_run(e,t){e.selectAll(t)}},Bz=class{constructor(e,t,n,r,i){this._model=e,this._searchText=t,this._matchCase=n,this._wordSeparators=r,this._cachedFindMatches=null,this._modelVersionId=this._model.getVersionId(),i&&this._model===i._model&&this._searchText===i._searchText&&this._matchCase===i._matchCase&&this._wordSeparators===i._wordSeparators&&this._modelVersionId===i._modelVersionId&&(this._cachedFindMatches=i._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(C.compareRangesUsingStarts)),this._cachedFindMatches}},Vz=class extends G{static{Cz=this}static{this.ID=`editor.contrib.selectionHighlighter`}constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Pr(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(t=>{this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123)})),this._register(e.onDidChangeCursorSelection(e=>{this._isEnabled&&(e.selection.isEmpty()?e.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(e=>{this._setState(null)})),this._register(e.onDidChangeModelContent(e=>{this._isEnabled&&this.updateSoon.schedule()}));let n=Ow.get(e);n&&this._register(n.getState().onFindReplaceStateChange(e=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(Cz._createState(this.state,this._isEnabled,this._isEnabledMultiline,this._maxLength,this.editor))}static _createState(e,t,n,r,i){if(!t||!i.hasModel())return null;if(!n){let e=i.getSelection();if(e.startLineNumber!==e.endLineNumber)return null}let a=Mz.get(i);if(!a)return null;let o=Ow.get(i);if(!o)return null;let s=a.getSession(o);if(!s){let e=i.getSelections();if(e.length>1){let t=o.getState().matchCase;if(!Hz(i.getModel(),e,t))return null}s=jz.create(i,o)}if(!s||s.currentMatch||/^[ \t]+$/.test(s.searchText)||r>0&&s.searchText.length>r)return null;let c=o.getState(),l=c.matchCase;if(c.isRevealed){let e=c.searchString;l||(e=e.toLowerCase());let t=s.searchText;if(l||(t=t.toLowerCase()),e===t&&s.matchCase===c.matchCase&&s.wholeWord===c.wholeWord&&!c.isRegex)return null}return new Bz(i.getModel(),s.searchText,s.matchCase,s.wholeWord?i.getOption(148):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;let t=this.editor.getModel();if(t.isTooLargeForTokenization())return;let n=this.state.findMatches(),r=this.editor.getSelections();r.sort(C.compareRangesUsingStarts);let i=[];for(let e=0,t=0,a=n.length,o=r.length;e<a;){let a=n[e];if(t>=o)i.push(a),e++;else{let n=C.compareRangesUsingStarts(a,r[t]);n<0?((r[t].isEmpty()||!C.areIntersecting(a,r[t]))&&i.push(a),e++):(n>0||e++,t++)}}let a=this.editor.getOption(90)!==`off`,o=this._languageFeaturesService.documentHighlightProvider.has(t)&&a,s=i.map(e=>({range:e,options:bz(o)}));this._decorations.set(s)}dispose(){this._setState(null),super.dispose()}};Vz=Cz=xz([Sz(1,R)],Vz);function Hz(e,t,n){let r=Uz(e,t[0],!n);for(let i=1,a=t.length;i<a;i++){let a=t[i];if(a.isEmpty()||r!==Uz(e,a,!n))return!1}return!0}function Uz(e,t,n){let r=e.getValueInRange(t);return n?r.toLowerCase():r}var Wz=class extends W{constructor(){super({id:`editor.action.focusNextCursor`,label:L(1375,`Focus Next Cursor`),metadata:{description:x(1362,`Focuses the next cursor`),args:[]},precondition:void 0})}run(e,t,n){if(!t.hasModel())return;let r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();let i=Array.from(r.getCursorStates()),a=i.shift();a&&(i.push(a),r.setCursorStates(n.source,3,i),r.revealPrimaryCursor(n.source,!0),wz(i,r.getCursorStates()))}},Gz=class extends W{constructor(){super({id:`editor.action.focusPreviousCursor`,label:L(1376,`Focus Previous Cursor`),metadata:{description:x(1363,`Focuses the previous cursor`),args:[]},precondition:void 0})}run(e,t,n){if(!t.hasModel())return;let r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();let i=Array.from(r.getCursorStates()),a=i.pop();a&&(i.unshift(a),r.setCursorStates(n.source,3,i),r.revealPrimaryCursor(n.source,!0),wz(i,r.getCursorStates()))}};Ps(Mz.ID,Mz,4),Ps(Vz.ID,Vz,1),z(Tz),z(Ez),z(Dz),z(Pz),z(Fz),z(Iz),z(Lz),z(Rz),z(zz),z(Oz),z(kz),z(Wz),z(Gz);var Kz={Visible:new j(`parameterHintsVisible`,!1),MultipleSignatures:new j(`parameterHintsMultipleSignatures`,!1)};async function qz(e,t,n,r,i){let a=e.ordered(t);for(let e of a)try{let a=await e.provideSignatureHelp(t,n,i,r);if(a)return a}catch(e){Zs(e)}}In.registerCommand(`_executeSignatureHelpProvider`,async(e,...t)=>{let[n,r,i]=t;Qn(Yn.isUri(n)),Qn(A.isIPosition(r)),Qn(typeof i==`string`||!i);let a=e.get(R),o=await e.get(Ui).createModelReference(n);try{let e=await qz(a.signatureHelpProvider,o.object.textEditorModel,A.lift(r),{triggerKind:li.Invoke,isRetrigger:!1,triggerCharacter:i},T.None);return e?(setTimeout(()=>e.dispose(),0),e.value):void 0}finally{o.dispose()}});var Jz;(function(e){e.Default={type:0};class t{constructor(e,t){this.request=e,this.previouslyActiveHints=t,this.type=2}}e.Pending=t;class n{constructor(e){this.hints=e,this.type=1}}e.Active=n})(Jz||={});var Yz=class e extends G{static{this.DEFAULT_DELAY=120}constructor(t,n,r=e.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new N),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Jz.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new lc),this.triggerChars=new Kn,this.retriggerChars=new Kn,this.triggerId=0,this.editor=t,this.providers=n,this.throttledDelayer=this._register(new er(r)),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(e=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(e=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(e=>this.onCursorChange(e))),this._register(this.editor.onDidChangeModelContent(e=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(e=>this.onDidType(e))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Jz.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){let n=this.editor.getModel();if(!n||!this.providers.has(n))return;let r=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(r),t).catch(nt)}next(){if(this.state.type!==1)return;let e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t%e===e-1,r=this.editor.getOption(98).cycle;(e<2||n)&&!r?this.cancel():this.updateActiveSignature(n&&r?0:t+1)}previous(){if(this.state.type!==1)return;let e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,n=t===0,r=this.editor.getOption(98).cycle;(e<2||n)&&!r?this.cancel():this.updateActiveSignature(n&&r?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Jz.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){let t=this.state.type===1||this.state.type===2,n=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;let r=this._pendingTriggers.reduce(Xz);this._pendingTriggers=[];let i={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:n};if(!this.editor.hasModel())return!1;let a=this.editor.getModel(),o=this.editor.getPosition();this.state=new Jz.Pending(Et(e=>qz(this.providers,a,o,i,e)),n);try{let t=await this.state.request;return e===this.triggerId?!t||!t.value.signatures||t.value.signatures.length===0?(t?.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Jz.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(t?.dispose(),!1)}catch(t){return e===this.triggerId&&(this.state=Jz.Default),nt(t),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();let e=this.editor.getModel();if(e)for(let t of this.providers.ordered(e)){for(let e of t.signatureHelpTriggerCharacters||[])if(e.length){let t=e.charCodeAt(0);this.triggerChars.add(t),this.retriggerChars.add(t)}for(let e of t.signatureHelpRetriggerCharacters||[])e.length&&this.retriggerChars.add(e.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;let t=e.length-1,n=e.charCodeAt(t);(this.triggerChars.has(n)||this.isTriggered&&this.retriggerChars.has(n))&&this.trigger({triggerKind:li.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source===`mouse`?this.cancel():this.isTriggered&&this.trigger({triggerKind:li.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:li.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(98).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};function Xz(e,t){switch(t.triggerKind){case li.Invoke:return t;case li.ContentChange:return e;case li.TriggerCharacter:default:return t}}var Zz=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},Qz=function(e,t){return function(n,r){t(n,r,e)}},$z,eB=M,tB=kr(`parameter-hints-next`,k.chevronDown,x(1378,`Icon for show next parameter hint.`)),nB=kr(`parameter-hints-previous`,k.chevronUp,x(1379,`Icon for show previous parameter hint.`)),rB=class extends G{static{$z=this}static{this.ID=`editor.widget.parameterHintsWidget`}constructor(e,t,n,r){super(),this.editor=e,this.model=t,this.markdownRendererService=r,this.renderDisposeables=this._register(new F),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.keyVisible=Kz.Visible.bindTo(n),this.keyMultipleSignatures=Kz.MultipleSignatures.bindTo(n)}createParameterHintDOMNodes(){let e=eB(`.editor-widget.parameter-hints-widget`),t=K(e,eB(`.phwrapper`));t.tabIndex=-1;let n=K(t,eB(`.controls`)),r=K(n,eB(`.button`+V.asCSSSelector(nB))),i=K(n,eB(`.overloads`)),a=K(n,eB(`.button`+V.asCSSSelector(tB)));this._register(I(r,`click`,e=>{Ds.stop(e),this.previous()})),this._register(I(a,`click`,e=>{Ds.stop(e),this.next()}));let o=eB(`.body`),s=new oa(o,{alwaysConsumeMouseWheel:!0});this._register(s),t.appendChild(s.getDomNode());let c=K(o,eB(`.signature`)),l=K(o,eB(`.docs`));e.style.userSelect=`text`,this.domNodes={element:e,signature:c,overloads:i,docs:l,scrollbar:s},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(e=>{this.visible&&this.editor.layoutContentWidget(this)}));let u=()=>{if(!this.domNodes)return;let e=this.editor.getOption(59),t=this.domNodes.element;t.style.fontSize=`${e.fontSize}px`,t.style.lineHeight=`${e.lineHeight/e.fontSize}`,t.style.setProperty(`--vscode-parameterHintsWidget-editorFontFamily`,e.fontFamily),t.style.setProperty(`--vscode-parameterHintsWidget-editorFontFamilyDefault`,Ju.fontFamily)};u(),this._register(pu.chain(this.editor.onDidChangeConfiguration.bind(this.editor),e=>e.filter(e=>e.hasChanged(59)))(u)),this._register(this.editor.onDidLayoutChange(e=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{this.domNodes?.element.classList.add(`visible`)},100),this.editor.layoutContentWidget(this))}hide(){this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,this.domNodes?.element.classList.remove(`visible`),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;let t=e.signatures.length>1;this.domNodes.element.classList.toggle(`multiple`,t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText=``,this.domNodes.docs.innerText=``;let n=e.signatures[e.activeSignature];if(!n)return;let r=K(this.domNodes.signature,eB(`.code`)),i=n.parameters.length>0,a=n.activeParameter??e.activeParameter;if(i)this.renderParameters(r,n,a);else{let e=K(r,eB(`span`));e.textContent=n.label}let o=n.parameters[a];if(o?.documentation){let e=eB(`span.documentation`);if(typeof o.documentation==`string`)e.textContent=o.documentation;else{let t=this.renderMarkdownDocs(o.documentation);e.appendChild(t.element)}K(this.domNodes.docs,eB(`p`,{},e))}if(n.documentation!==void 0){if(typeof n.documentation==`string`)K(this.domNodes.docs,eB(`p`,{},n.documentation));else{let e=this.renderMarkdownDocs(n.documentation);K(this.domNodes.docs,e.element)}}let s=this.hasDocs(n,o);if(this.domNodes.signature.classList.toggle(`has-docs`,s),this.domNodes.docs.classList.toggle(`empty`,!s),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,`0`)+`/`+e.signatures.length,o){let e=``,t=n.parameters[a];e=Array.isArray(t.label)?n.label.substring(t.label[0],t.label[1]):t.label,t.documentation&&(e+=typeof t.documentation==`string`?`, ${t.documentation}`:`, ${t.documentation.value}`),n.documentation&&(e+=typeof n.documentation==`string`?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==e&&(bo(x(1380,`{0}, hint`,e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){let t=this.renderDisposeables.add(this.markdownRendererService.render(e,{context:this.editor,asyncRenderCallback:()=>{this.domNodes?.scrollbar.scanDomNode()}}));return t.element.classList.add(`markdown-docs`),t}hasDocs(e,t){return!!(t&&typeof t.documentation==`string`&&vn(t.documentation).length>0||t&&typeof t.documentation==`object`&&vn(t.documentation).value.length>0||e.documentation&&typeof e.documentation==`string`&&vn(e.documentation).length>0||e.documentation&&typeof e.documentation==`object`&&vn(e.documentation.value).length>0)}renderParameters(e,t,n){let[r,i]=this.getParameterLabelOffsets(t,n),a=document.createElement(`span`);a.textContent=t.label.substring(0,r);let o=document.createElement(`span`);o.textContent=t.label.substring(r,i),o.className=`parameter active`;let s=document.createElement(`span`);s.textContent=t.label.substring(i),K(e,a,o,s)}getParameterLabelOffsets(e,t){let n=e.parameters[t];if(!n)return[0,0];if(Array.isArray(n.label))return n.label;if(n.label.length){let t=RegExp(`(\\W|^)${rd(n.label)}(?=\\W|$)`,`g`);t.test(e.label);let r=t.lastIndex-n.label.length;return r>=0?[r,t.lastIndex]:[0,0]}return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return $z.ID}updateMaxHeight(){if(!this.domNodes)return;let e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=e;let t=this.domNodes.element.getElementsByClassName(`phwrapper`);t.length&&(t[0].style.maxHeight=e)}};rB=$z=Zz([Qz(2,Fa),Qz(3,ba)],rB),O(`editorHoverWidget.highlightForeground`,Sr,x(1381,`Foreground color of the active item in the parameter hint.`));var iB=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},aB=function(e,t){return function(n,r){t(n,r,e)}},oB,sB=class extends G{static{oB=this}static{this.ID=`editor.controller.parameterHints`}static get(e){return e.getContribution(oB.ID)}constructor(e,t,n){super(),this.editor=e,this.model=this._register(new Yz(e,n.signatureHelpProvider)),this._register(this.model.onChangedHints(e=>{e?(this.widget.value.show(),this.widget.value.render(e)):this.widget.rawValue?.hide()})),this.widget=new jc(()=>this._register(t.createInstance(rB,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){this.widget.rawValue?.previous()}next(){this.widget.rawValue?.next()}trigger(e){this.model.trigger(e,0)}};sB=oB=iB([aB(1,U),aB(2,R)],sB);var cB=class extends W{constructor(){super({id:`editor.action.triggerParameterHints`,label:L(1377,`Trigger Parameter Hints`),precondition:E.hasSignatureHelpProvider,kbOpts:{kbExpr:E.editorTextFocus,primary:3082,weight:100}})}run(e,t){sB.get(t)?.trigger({triggerKind:li.Invoke})}};Ps(sB.ID,sB,2),z(cB);var lB=175,uB=td.bindToContribution(sB.get);H(new uB({id:`closeParameterHints`,precondition:Kz.Visible,handler:e=>e.cancel(),kbOpts:{weight:lB,kbExpr:E.focus,primary:9,secondary:[1033]}})),H(new uB({id:`showPrevParameterHint`,precondition:w.and(Kz.Visible,Kz.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:lB,kbExpr:E.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),H(new uB({id:`showNextParameterHint`,precondition:w.and(Kz.Visible,Kz.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:lB,kbExpr:E.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var dB=class extends G{static{this.ID=`editor.contrib.placeholderText`}constructor(e){super(),this._editor=e,this._editorObs=ps(this._editor),this._placeholderText=this._editorObs.getOption(100),this._state=Tc({owner:this,equalsFn:ya},e=>{let t=this._placeholderText.read(e);if(t&&this._editorObs.valueIsEmpty.read(e))return{placeholder:t}}),this._shouldViewBeAlive=fB(this,e=>this._state.read(e)?.placeholder!==void 0),this._view=B(e=>{if(!this._shouldViewBeAlive.read(e))return;let t=Ur(`div.editorPlaceholder`);e.store.add(Ml(e=>{let n=this._state.read(e),r=n?.placeholder!==void 0;t.root.style.display=r?`block`:`none`,t.root.innerText=n?.placeholder??``})),e.store.add(Ml(e=>{let n=this._editorObs.layoutInfo.read(e);t.root.style.left=`${n.contentLeft}px`,t.root.style.width=n.contentWidth-n.verticalScrollbarWidth+`px`,t.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),e.store.add(Ml(e=>{t.root.style.fontFamily=this._editorObs.getOption(58).read(e),t.root.style.fontSize=this._editorObs.getOption(61).read(e)+`px`,t.root.style.lineHeight=this._editorObs.getOption(75).read(e)+`px`})),e.store.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:Wi(0),position:Wi(null),domNode:t.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};function fB(e,t){return No(e,(e,n)=>n===!0||t(e))}var pB=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},mB=function(e,t){return function(n,r){t(n,r,e)}},hB=class{constructor(e){this.instantiationService=e}init(...e){}};function gB(e){return e()}var _B=class extends hB{constructor(e,t){super(t),this.init(e)}};_B=pB([mB(1,U)],_B),Ps(dB.ID,gB(()=>dB),0),O(`editor.placeholder.foreground`,kt,x(1400,`Foreground color of the placeholder text in the editor.`));function vB(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return t}var yB=class e{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){let n=this.computeEmbedding(e),r=new Map,i=[];for(let[e,a]of this.documents){if(t.isCancellationRequested)return[];for(let t of a.chunks){let a=this.computeSimilarityScore(t,n,r);a>0&&i.push({key:e,score:a})}}return i}static termFrequencies(t){return vB(e.splitTerms(t))}static*splitTerms(e){let t=e=>e.toLowerCase();for(let[n]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(n);let e=n.replace(/([a-z])([A-Z])/g,`$1 $2`).split(/\s+/g);if(e.length>1)for(let n of e)n.length>2&&/\p{Letter}{3,}/gu.test(n)&&(yield t(n))}}updateDocuments(t){for(let{key:e}of t)this.deleteDocument(e);for(let n of t){let t=[];for(let r of n.textChunks){let n=e.termFrequencies(r);for(let e of n.keys())this.chunkOccurrences.set(e,(this.chunkOccurrences.get(e)??0)+1);t.push({text:r,tf:n})}this.chunkCount+=t.length,this.documents.set(n.key,{chunks:t})}return this}deleteDocument(e){let t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(let e of t.chunks)for(let t of e.tf.keys()){let e=this.chunkOccurrences.get(t);if(typeof e==`number`){let n=e-1;n<=0?this.chunkOccurrences.delete(t):this.chunkOccurrences.set(t,n)}}}}computeSimilarityScore(e,t,n){let r=0;for(let[i,a]of Object.entries(t)){let t=e.tf.get(i);if(!t)continue;let o=n.get(i);typeof o!=`number`&&(o=this.computeIdf(i),n.set(i,o));let s=t*o;r+=s*a}return r}computeEmbedding(t){let n=e.termFrequencies(t);return this.computeTfidf(n)}computeIdf(e){let t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){let t=Object.create(null);for(let[n,r]of e){let e=this.computeIdf(n);e>0&&(t[n]=r*e)}return t}};function bB(e){let t=e.slice(0);t.sort((e,t)=>t.score-e.score);let n=t[0]?.score??0;if(n>0)for(let e of t)e.score/=n;return t}var xB;(function(e){e[e.NO_ACTION=0]=`NO_ACTION`,e[e.CLOSE_PICKER=1]=`CLOSE_PICKER`,e[e.REFRESH_PICKER=2]=`REFRESH_PICKER`,e[e.REMOVE_ITEM=3]=`REMOVE_ITEM`})(xB||={});function SB(e){let t=e;return Array.isArray(t.items)}function CB(e){let t=e;return!!t.picks&&t.additionalPicks instanceof Promise}var wB=class extends G{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,n){let r=new F;e.canAcceptInBackground=!!this.options?.canAcceptInBackground,e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let i,a=r.add(new lc),o=async()=>{i?.dispose(!0),e.busy=!1;let r=a.value=new F;i=r.add(new Ao(t));let o=i.token,s=e.value.substring(this.prefix.length);this.options?.shouldSkipTrimPickFilter||(s=s.trim());let c=this._getPicks(s,r,o,n),l=(t,n)=>{let r,i;if(SB(t)?(r=t.items,i=t.active):r=t,r.length===0){if(n)return!1;(s.length>0||e.hideInput)&&this.options?.noResultsPick&&(r=Lf(this.options.noResultsPick)?[this.options.noResultsPick(s)]:[this.options.noResultsPick])}return e.items=r,i&&(e.activeItems=[i]),!0},u=async t=>{let n=!1,r=!1;await Promise.all([(async()=>{typeof t.mergeDelay==`number`&&(await Cr(t.mergeDelay),o.isCancellationRequested)||r||(n=l(t.picks,!0))})(),(async()=>{e.busy=!0;try{let r=await t.additionalPicks;if(o.isCancellationRequested)return;let i,a;SB(t.picks)?(i=t.picks.items,a=t.picks.active):i=t.picks;let s,c;if(SB(r)?(s=r.items,c=r.active):s=r,s.length>0||!n){let t;if(!a&&!c){let n=e.activeItems[0];n&&i.indexOf(n)!==-1&&(t=n)}l({items:[...i,...s],active:a||c||t})}}finally{o.isCancellationRequested||(e.busy=!1),r=!0}})()])};if(c!==null){if(CB(c))await u(c);else if(!(c instanceof Promise))l(c);else{e.busy=!0;try{let e=await c;if(o.isCancellationRequested)return;CB(e)?await u(e):l(e)}finally{o.isCancellationRequested||(e.busy=!1)}}}};r.add(e.onDidChangeValue(()=>o())),o(),r.add(e.onDidAccept(t=>{if(n?.handleAccept){t.inBackground||e.hide(),n.handleAccept?.(e.activeItems[0],t.inBackground);return}let[r]=e.selectedItems;if(typeof r?.accept==`function`){if(gf(e.keyMods)&&r.attach){r.attach(e.keyMods,t);return}t.inBackground||e.hide(),r.accept(e.keyMods,t)}}));let s=async(n,r)=>{if(typeof r.trigger!=`function`)return;let i=r.buttons?.indexOf(n)??-1;if(i>=0){let n=r.trigger(i,e.keyMods),a=typeof n==`number`?n:await n;if(t.isCancellationRequested)return;switch(a){case xB.NO_ACTION:break;case xB.CLOSE_PICKER:e.hide();break;case xB.REFRESH_PICKER:o();break;case xB.REMOVE_ITEM:{let t=e.items.indexOf(r);if(t!==-1){let n=e.items.slice(),r=n.splice(t,1),i=e.activeItems.filter(e=>e!==r[0]),a=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=n,i&&(e.activeItems=i),e.keepScrollPosition=a}break}}}};return r.add(e.onDidTriggerItemButton(({button:e,item:t})=>s(e,t))),r.add(e.onDidTriggerSeparatorButton(({button:e,separator:t})=>s(e,t))),r}},TB=Object.freeze({View:L(1718,`View`),Help:L(1719,`Help`),Test:L(1720,`Test`),File:L(1721,`File`),Preferences:L(1722,`Preferences`),Developer:L(1723,`Developer`)}),EB=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},DB=function(e,t){return function(n,r){t(n,r,e)}},OB,kB,AB=class extends wB{static{OB=this}static{this.PREFIX=`>`}static{this.TFIDF_THRESHOLD=.5}static{this.TFIDF_MAX_RESULTS=5}static{this.WORD_FILTER=pr(Nn,Bu)}constructor(e,t,n,r,i,a){super(OB.PREFIX,e),this.keybindingService=n,this.commandService=r,this.telemetryService=i,this.dialogService=a,this.commandsHistory=this._register(t.createInstance(jB)),this.options=e}async _getPicks(e,t,n,r){let i=await this.getCommandPicks(n);if(n.isCancellationRequested)return[];let a=Tf(()=>{let t=new yB;return t.updateDocuments(i.map(e=>({key:e.commandId,textChunks:[this.getTfIdfChunk(e)]}))),bB(t.calculateScores(e,n)).filter(e=>e.score>OB.TFIDF_THRESHOLD).slice(0,OB.TFIDF_MAX_RESULTS)}),o=[];for(let t of i){let r=OB.WORD_FILTER(e,t.label)??void 0,i;if(t.commandAlias&&(i=OB.WORD_FILTER(e,t.commandAlias)??void 0),r||i)t.highlights={label:r,detail:this.options.showAlias?i:void 0},o.push(t);else if(e===t.commandId)o.push(t);else if(e.length>=3){let e=a();if(n.isCancellationRequested)return[];let r=e.find(e=>e.key===t.commandId);r&&(t.tfIdfScore=r.score,o.push(t))}}let s=new Map;for(let e of o){let t=s.get(e.label);t?(e.description=e.commandId,t.description=t.commandId):s.set(e.label,e)}o.sort((e,t)=>{if(e.tfIdfScore&&t.tfIdfScore)return e.tfIdfScore===t.tfIdfScore?e.label.localeCompare(t.label):t.tfIdfScore-e.tfIdfScore;if(e.tfIdfScore)return 1;if(t.tfIdfScore)return-1;let n=this.commandsHistory.peek(e.commandId),r=this.commandsHistory.peek(t.commandId);if(n&&r)return n>r?-1:1;if(n)return-1;if(r)return 1;if(this.options.suggestedCommandIds){let n=this.options.suggestedCommandIds.has(e.commandId),r=this.options.suggestedCommandIds.has(t.commandId);if(n&&r)return 0;if(n)return-1;if(r)return 1}let i=e.commandCategory===TB.Developer.value,a=t.commandCategory===TB.Developer.value;return i&&!a?1:!i&&a?-1:e.label.localeCompare(t.label)});let c=[],l=!1,u=!0,d=!!this.options.suggestedCommandIds;for(let e=0;e<o.length;e++){let t=o[e],n=!!this.commandsHistory.peek(t.commandId);e===0&&n&&(c.push({type:`separator`,label:x(1836,`recently used`)}),l=!0),u&&t.tfIdfScore!==void 0&&(c.push({type:`separator`,label:x(1837,`similar commands`)}),u=!1),d&&t.tfIdfScore===void 0&&!n&&this.options.suggestedCommandIds?.has(t.commandId)&&(c.push({type:`separator`,label:x(1838,`commonly used`)}),l=!0,d=!1),l&&t.tfIdfScore===void 0&&!n&&!this.options.suggestedCommandIds?.has(t.commandId)&&(c.push({type:`separator`,label:x(1839,`other commands`)}),l=!1),c.push(this.toCommandPick(t,r,n))}return this.hasAdditionalCommandPicks(e,n)?{picks:c,additionalPicks:(async()=>{let t=await this.getAdditionalCommandPicks(i,o,e,n);if(n.isCancellationRequested)return[];let a=t.map(e=>this.toCommandPick(e,r));return u&&a[0]?.type!==`separator`&&a.unshift({type:`separator`,label:x(1840,`similar commands`)}),a})()}:c}toCommandPick(e,t,n=!1){if(e.type===`separator`)return e;let r=e.tooltip??e.commandDescription?.value,i=this.keybindingService.lookupKeybinding(e.commandId),a=i?x(1841,`{0}, {1}`,e.label,i.getAriaLabel()):e.label,o=e.buttons||[],s=n?[...o,{iconClass:V.asClassName(k.close),tooltip:x(1842,`Remove from Recently Used`)}]:e.buttons;return{...e,id:e.commandId,tooltip:r,ariaLabel:a,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,buttons:s,accept:async()=>{this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2(`workbenchActionExecuted`,{id:e.commandId,from:t?.from??`quick open`});try{e.args?.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(t){Li(t)||this.dialogService.error(x(1843,`Command '{0}' resulted in an error`,e.label),Pm(t))}},trigger:n?(t,n)=>t===o.length?(this.commandsHistory.remove(e.commandId),xB.REMOVE_ITEM):e.trigger?e.trigger(t,n):xB.NO_ACTION:e.trigger}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:n}){let r=e;return t&&t!==e&&(r+=` - ${t}`),n&&n.value!==e&&(r+=` - ${n.value===n.original?n.value:`${n.value} (${n.original})`}`),r}};AB=OB=EB([DB(1,U),DB(2,Sa),DB(3,Er),DB(4,yt),DB(5,ca)],AB);var jB=class extends G{static{kB=this}static{this.DEFAULT_COMMANDS_HISTORY_LENGTH=50}static{this.PREF_KEY_CACHE=`commandPalette.mru.cache`}static{this.PREF_KEY_COUNTER=`commandPalette.mru.counter`}static{this.counter=1}static{this.hasChanges=!1}constructor(e,t,n){super(),this.storageService=e,this.configurationService=t,this.logService=n,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===Xo.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){(!e||e.affectsConfiguration(`workbench.commandPalette.history`))&&(this.configuredCommandsHistoryLength=kB.getConfiguredCommandHistoryLength(this.configurationService),kB.cache&&kB.cache.limit!==this.configuredCommandsHistoryLength&&(kB.cache.limit=this.configuredCommandsHistoryLength,kB.hasChanges=!0))}load(){let e=this.storageService.get(kB.PREF_KEY_CACHE,0),t;if(e)try{t=JSON.parse(e)}catch(e){this.logService.error(`[CommandsHistory] invalid data: ${e}`)}let n=kB.cache=new yi(this.configuredCommandsHistoryLength,1);if(t){let e;e=t.usesLRU?t.entries:t.entries.sort((e,t)=>e.value-t.value),e.forEach(e=>n.set(e.key,e.value))}kB.counter=this.storageService.getNumber(kB.PREF_KEY_COUNTER,0,kB.counter)}push(e){kB.cache&&(kB.cache.set(e,kB.counter++),kB.hasChanges=!0)}peek(e){return kB.cache?.peek(e)}remove(e){kB.cache&&(kB.cache.delete(e),kB.hasChanges=!0)}saveState(){if(!kB.cache||!kB.hasChanges)return;let e={usesLRU:!0,entries:[]};kB.cache.forEach((t,n)=>e.entries.push({key:n,value:t})),this.storageService.store(kB.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(kB.PREF_KEY_COUNTER,kB.counter,0,0),kB.hasChanges=!1}static getConfiguredCommandHistoryLength(e){let t=e.getValue().workbench?.commandPalette?.history;return typeof t==`number`?t:kB.DEFAULT_COMMANDS_HISTORY_LENGTH}};jB=kB=EB([DB(0,Ec),DB(1,Vi),DB(2,ju)],jB);var MB=class extends AB{constructor(e,t,n,r,i,a){super(e,t,n,r,i,a)}getCodeEditorCommandPicks(){let e=this.activeTextEditorControl;if(!e)return[];let t=[];for(let n of e.getSupportedActions()){let e;n.metadata?.description&&(e=ko(n.metadata.description)?n.metadata.description:{original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:e,label:Zi(n.label)||n.id})}return t}},NB=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},PB=function(e,t){return function(n,r){t(n,r,e)}},FB=class extends MB{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,n,r,i,a){super({showAlias:!1},e,n,r,i,a),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};FB=NB([PB(0,U),PB(1,Xs),PB(2,Sa),PB(3,Er),PB(4,yt),PB(5,ca)],FB);var IB=class e extends W{static{this.ID=`editor.action.quickCommand`}constructor(){super({id:e.ID,label:yo.quickCommandActionLabel,alias:`Command Palette`,precondition:void 0,kbOpts:{kbExpr:E.focus,primary:59,weight:100},contextMenuOpts:{group:`z_commands`,order:1}})}run(e){e.get(Gd).quickAccess.show(FB.PREFIX)}};z(IB),At.as(Dn.Quickaccess).registerQuickAccessProvider({ctor:FB,prefix:FB.PREFIX,helpEntries:[{description:yo.quickCommandHelp,commandId:IB.ID}]});var LB=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},RB=function(e,t){return function(n,r){t(n,r,e)}},zB,BB=class{static{zB=this}static{this.PREFIX=`?`}constructor(e,t,n){this.quickInputService=e,this.keybindingService=t,this.contextKeyService=n,this.registry=At.as(Dn.Quickaccess)}provide(e){let t=new F;return t.add(e.onDidAccept(()=>{let[t]=e.selectedItems;t&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(e=>{let t=this.registry.getQuickAccessProvider(e.substr(zB.PREFIX.length),this.contextKeyService);t?.prefix&&t.prefix!==zB.PREFIX&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(e=>e.prefix!==zB.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders(this.contextKeyService).sort((e,t)=>e.prefix.localeCompare(t.prefix)).flatMap(e=>this.createPicks(e))}createPicks(e){return e.helpEntries.map(t=>{let n=t.prefix||e.prefix,r=n||`…`;return{prefix:n,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:x(1844,`{0}, {1}`,r,t.description),description:t.description}})}};BB=zB=LB([RB(0,Gd),RB(1,Sa),RB(2,Fa)],BB),At.as(Dn.Quickaccess).registerQuickAccessProvider({ctor:BB,prefix:``,helpEntries:[{description:oo.helpQuickAccessActionLabel}]});var VB=[void 0,[]];function HB(e,t,n=0,r=0){let i=t;return i.values&&i.values.length>1?UB(e,i.values,n,r):WB(e,t,n,r)}function UB(e,t,n,r){let i=0,a=[];for(let o of t){let[t,s]=WB(e,o,n,r);if(typeof t!=`number`)return VB;i+=t,a.push(...s)}return[i,GB(a)]}function WB(e,t,n,r){let i=Ma(t.normalized,t.normalizedLowercase,n,e,e.toLowerCase(),r,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return i?[i[0],Gn(i)]:VB}new hi(`allowNonContiguousMatches`),new hi(`description`),new hi(`label`),new hi(`values`),new hi(`expectContiguousMatch`),new hi(`value`);function GB(e){let t=e.sort((e,t)=>e.start-t.start),n=[],r;for(let e of t)!r||!KB(r,e)?(r=e,n.push(e)):(r.start=Math.min(r.start,e.start),r.end=Math.max(r.end,e.end));return n}function KB(e,t){return!(e.end<t.start||t.end<e.start)}function qB(e){return e.startsWith(`"`)&&e.endsWith(`"`)}var JB=` `;function YB(e){typeof e!=`string`&&(e=``);let t=e.toLowerCase(),{pathNormalized:n,normalized:r,normalizedLowercase:i}=XB(e),a=n.indexOf(Rn)>=0,o=qB(e),s,c=e.split(JB);if(c.length>1)for(let e of c){let t=qB(e),{pathNormalized:n,normalized:r,normalizedLowercase:i}=XB(e);r&&(s||=[],s.push({original:e,originalLowercase:e.toLowerCase(),pathNormalized:n,normalized:r,normalizedLowercase:i,expectContiguousMatch:t}))}return{original:e,originalLowercase:t,pathNormalized:n,normalized:r,normalizedLowercase:i,values:s,containsPathSeparator:a,expectContiguousMatch:o}}function XB(e){let t;t=qt?e.replace(/\//g,Rn):e.replace(/\\/g,Rn);let n=t.replace(/[\*\u2026\s"]/g,``).replace(/(?<=.)#$/,``);return{pathNormalized:t,normalized:n,normalizedLowercase:n.toLowerCase()}}function ZB(e){return YB(Array.isArray(e)?e.map(e=>e.original).join(JB):e.original)}var QB=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},$B=function(e,t){return function(n,r){t(n,r,e)}},eV,tV=class extends ZE{static{eV=this}static{this.PREFIX=`@`}static{this.SCOPE_PREFIX=`:`}static{this.PREFIX_BY_CATEGORY=`${this.PREFIX}${this.SCOPE_PREFIX}`}constructor(e,t,n=Object.create(null)){super(n),this._languageFeaturesService=e,this._outlineModelService=t,this.options=n,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,x(1414,`To go to a symbol, first open a text editor with symbol information.`)),G.None}provideWithTextEditor(e,t,n,r){let i=e.editor,a=this.getModel(i);return a?this._languageFeaturesService.documentSymbolProvider.has(a)?this.doProvideWithEditorSymbols(e,a,t,n,r):this.doProvideWithoutEditorSymbols(e,a,t,n):G.None}doProvideWithoutEditorSymbols(e,t,n,r){let i=new F;return this.provideLabelPick(n,x(1415,`The active text editor does not provide symbol information.`)),(async()=>{await this.waitForLanguageSymbolRegistry(t,i)&&!r.isCancellationRequested&&i.add(this.doProvideWithEditorSymbols(e,t,n,r))})(),i}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;let n=new bn,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),n.complete(!0))}));return t.add(Ko(()=>n.complete(!1))),n.p}doProvideWithEditorSymbols(e,t,n,r,i){let a=e.editor,o=new F;o.add(n.onDidAccept(t=>{let[r]=n.selectedItems;if(r&&r.range){if(n.keyMods.shift&&r.attach){r.attach(n.keyMods,t);return}this.gotoLocation(e,{range:r.range.selection,keyMods:n.keyMods,preserveFocus:t.inBackground}),i?.handleAccept?.(r,t.inBackground),t.inBackground||n.hide()}})),o.add(n.onDidTriggerItemButton(({item:t})=>{t&&t.range&&(this.gotoLocation(e,{range:t.range.selection,keyMods:n.keyMods,forceSideBySide:!0}),n.hide())}));let s=this.getDocumentSymbols(t,r),c=o.add(new lc),l=async e=>{c?.value?.cancel(),n.busy=!1,c.value=new Ao,n.busy=!0;try{let i=YB(n.value.substr(eV.PREFIX.length).trim()),a=await this.doGetSymbolPicks(s,i,void 0,c.value.token,t);if(r.isCancellationRequested)return;if(a.length>0){if(n.items=a,e&&i.original.length===0){let t=_t(a,t=>!!(t.type!==`separator`&&t.range&&C.containsPosition(t.range.decoration,e)));t&&(n.activeItems=[t])}}else i.original.length>0?this.provideLabelPick(n,x(1416,`No matching editor symbols`)):this.provideLabelPick(n,x(1417,`No editor symbols`))}finally{r.isCancellationRequested||(n.busy=!1)}};return o.add(n.onDidChangeValue(()=>l(void 0))),l(a.getSelection()?.getPosition()),o.add(n.onDidChangeActive(()=>{let[e]=n.activeItems;e&&e.range&&(a.revealRangeInCenter(e.range.selection,0),this.addDecorations(a,e.range.decoration))})),o}async doGetSymbolPicks(e,t,n,r,i){let a=await e;if(r.isCancellationRequested)return[];let o=t.original.indexOf(eV.SCOPE_PREFIX)===0,s=+!!o,c,l;t.values&&t.values.length>1?(c=ZB(t.values[0]),l=ZB(t.values.slice(1))):c=t;let u,d=this.options?.openSideBySideDirection?.();d&&(u=[{iconClass:d===`right`?V.asClassName(k.splitHorizontal):V.asClassName(k.splitVertical),tooltip:d===`right`?x(1418,`Open to the Side`):x(1419,`Open to the Bottom`)}]);let f=[];for(let e=0;e<a.length;e++){let r=a[e],o=Uc(r.name),d=`$(${Ni.toIcon(r.kind).id}) ${o}`,p=d.length-o.length,m=r.containerName;n?.extraContainerLabel&&(m=m?`${n.extraContainerLabel} • ${m}`:n.extraContainerLabel);let h,g,_,v;if(t.original.length>s){let e=!1;if(c!==t&&([h,g]=HB(d,{...t,values:void 0},s,p),typeof h==`number`&&(e=!0)),typeof h!=`number`&&([h,g]=HB(d,c,s,p),typeof h!=`number`))continue;if(!e&&l){if(m&&l.original.length>0&&([_,v]=HB(m,l)),typeof _!=`number`)continue;typeof h==`number`&&(h+=_)}}let y=r.tags&&r.tags.indexOf(1)>=0;f.push({index:e,kind:r.kind,score:h,label:d,ariaLabel:or(r.name,r.kind),description:m,highlights:y?void 0:{label:g,description:v},range:{selection:C.collapseToStart(r.selectionRange),decoration:r.range},uri:i.uri,symbolName:o,strikethrough:y,buttons:u})}let p=f.sort((e,t)=>o?this.compareByKindAndScore(e,t):this.compareByScore(e,t)),m=[];if(o){let e,t,n=0;function r(){t&&typeof e==`number`&&n>0&&(t.label=fs(rV[e]||nV,n))}for(let i of p)e===i.kind?n++:(r(),e=i.kind,n=1,t={type:`separator`},m.push(t)),m.push(i);r()}else p.length>0&&(m=[{label:x(1420,`symbols ({0})`,f.length),type:`separator`},...p]);return m}compareByScore(e,t){if(typeof e.score!=`number`&&typeof t.score==`number`)return 1;if(typeof e.score==`number`&&typeof t.score!=`number`)return-1;if(typeof e.score==`number`&&typeof t.score==`number`){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:+(e.index>t.index)}compareByKindAndScore(e,t){let n=rV[e.kind]||nV,r=rV[t.kind]||nV,i=n.localeCompare(r);return i===0?this.compareByScore(e,t):i}async getDocumentSymbols(e,t){let n=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:n.asListOfDocumentSymbols()}};tV=eV=QB([$B(0,R),$B(1,JC)],tV);var nV=x(1421,`properties ({0})`),rV={5:x(1422,`methods ({0})`),11:x(1423,`functions ({0})`),8:x(1424,`constructors ({0})`),12:x(1425,`variables ({0})`),4:x(1426,`classes ({0})`),22:x(1427,`structs ({0})`),23:x(1428,`events ({0})`),24:x(1429,`operators ({0})`),10:x(1430,`interfaces ({0})`),2:x(1431,`namespaces ({0})`),3:x(1432,`packages ({0})`),25:x(1433,`type parameters ({0})`),1:x(1434,`modules ({0})`),6:x(1435,`properties ({0})`),9:x(1436,`enumerations ({0})`),21:x(1437,`enumeration members ({0})`),14:x(1438,`strings ({0})`),0:x(1439,`files ({0})`),17:x(1440,`arrays ({0})`),15:x(1441,`numbers ({0})`),16:x(1442,`booleans ({0})`),18:x(1443,`objects ({0})`),19:x(1444,`keys ({0})`),7:x(1445,`fields ({0})`),13:x(1446,`constants ({0})`)},iV=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},aV=function(e,t){return function(n,r){t(n,r,e)}},oV=class extends tV{constructor(e,t,n){super(t,n),this.editorService=e,this.onDidActiveTextEditorControlChange=pu.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};oV=iV([aV(0,Xs),aV(1,R),aV(2,JC)],oV);var sV=class e extends W{static{this.ID=`editor.action.quickOutline`}constructor(){super({id:e.ID,label:jo.quickOutlineActionLabel,alias:`Go to Symbol...`,precondition:E.hasDocumentSymbolProvider,kbOpts:{kbExpr:E.focus,primary:3117,weight:100},contextMenuOpts:{group:`navigation`,order:3}})}run(e){e.get(Gd).quickAccess.show(tV.PREFIX,{itemActivation:Of.NONE})}};z(sV),At.as(Dn.Quickaccess).registerQuickAccessProvider({ctor:oV,prefix:tV.PREFIX,helpEntries:[{description:jo.quickOutlineActionLabel,prefix:tV.PREFIX,commandId:sV.ID},{description:jo.quickOutlineByCategoryActionLabel,prefix:tV.PREFIX_BY_CATEGORY}]});var cV=class extends G{static{this.ID=`editor.contrib.readOnlyMessageController`}constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){let e=rm.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||=this.editor.isSimpleWidget?new Oi(x(1447,`Cannot edit in read-only input`)):new Oi(x(1448,`Cannot edit in read-only editor`)),e.showMessage(t,this.editor.getPosition())}}};Ps(cV.ID,cV,2);var lV=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},uV=function(e,t){return function(n,r){t(n,r,e)}},dV=class extends Wx{constructor(e,t,n,r,i,a,o){super(!0,e,t,n,r,i,a,o)}};dV=lV([uV(1,Fa),uV(2,Xs),uV(3,vt),uV(4,U),uV(5,Ec),uV(6,Vi)],dV),Ps(Wx.ID,dV,4);var fV=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},pV=function(e,t){return function(n,r){t(n,r,e)}},mV=class extends G{static{this.ID=`editor.sectionHeaderDetector`}constructor(e,t,n){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=n,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(t=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(t=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(t=>{let n=this.editor.getModel()?.getLanguageId();n&&t.affects(n)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(t=>{(!this.options||t.hasChanged(81))&&(this.options=this.createOptions(e.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(e=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(e=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new Pr(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;let t=this.editor.getModel().getLanguageId();if(!t)return;let n=this.languageConfigurationService.getLanguageConfiguration(t).comments,r=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(n||r?.markers)return{foldingRules:r,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){if(!this.editor.hasModel()||!this.options?.findMarkSectionHeaders&&!this.options?.findRegionSectionHeaders)return;let e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;let t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(n=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(n)})}updateDecorations(e){let t=this.editor.getModel();t&&(e=e.filter(e=>{if(!e.shouldBeInComments)return!0;let n=t.validateRange(e.range),r=t.tokenization.getLineTokens(n.startLineNumber),i=r.findTokenIndexAtOffset(n.startColumn-1),a=r.getStandardTokenType(i),o=t.getLanguageIdAtPosition(n.startLineNumber,n.startColumn);return r.getLanguageId(i)===o&&a===1}));let n=Object.values(this.currentOccurrences).map(e=>e.decorationId),r=e.map(e=>hV(e));this.editor.changeDecorations(t=>{let i=t.deltaDecorations(n,r);this.currentOccurrences={};for(let t=0,n=i.length;t<n;t++){let n={sectionHeader:e[t],decorationId:i[t]};this.currentOccurrences[n.decorationId]=n}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&=(this.computePromise.cancel(),null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}};mV=fV([pV(1,Pn),pV(2,cr)],mV);function hV(e){return{range:e.range,options:P.createDynamic({description:`section-header`,stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:e.hasSeparatorLine?2:1,sectionHeaderText:e.text}})}}Ps(mV.ID,mV,1);function gV(e){for(let t=0,n=e.length;t<n;t+=4){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];e[t+0]=a,e[t+1]=i,e[t+2]=r,e[t+3]=n}}function _V(e){let t=new Uint8Array(e.buffer,e.byteOffset,e.length*4);return Ft()||gV(t),ht.wrap(t)}function vV(e){let t=new Uint32Array(yV(e)),n=0;if(t[n++]=e.id,e.type===`full`)t[n++]=1,t[n++]=e.data.length,t.set(e.data,n),n+=e.data.length;else{t[n++]=2,t[n++]=e.deltas.length;for(let r of e.deltas)t[n++]=r.start,t[n++]=r.deleteCount,r.data?(t[n++]=r.data.length,t.set(r.data,n),n+=r.data.length):t[n++]=0}return _V(t)}function yV(e){let t=0;if(t+=2,e.type===`full`)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(let n of e.deltas)n.data&&(t+=n.data.length)}return t}function bV(e){return e&&!!e.data}function xV(e){return e&&Array.isArray(e.edits)}var SV=class{constructor(e,t,n){this.provider=e,this.tokens=t,this.error=n}};function CV(e,t){return e.has(t)}function wV(e,t){let n=e.orderedGroups(t);return n.length>0?n[0]:[]}async function TV(e,t,n,r,i){let a=wV(e,t),o=await Promise.all(a.map(async e=>{let a,o=null;try{a=await e.provideDocumentSemanticTokens(t,e===n?r:null,i)}catch(e){o=e,a=null}return a&&(bV(a)||xV(a))||(a=null),new SV(e,a,o)}));for(let e of o){if(e.error)throw e.error;if(e.tokens)return e}return o.length>0?o[0]:null}function EV(e,t){let n=e.orderedGroups(t);return n.length>0?n[0]:null}var DV=class{constructor(e,t){this.provider=e,this.tokens=t}};function OV(e,t){return e.has(t)}function kV(e,t){let n=e.orderedGroups(t);return n.length>0?n[0]:[]}async function AV(e,t,n,r){let i=kV(e,t),a=await Promise.all(i.map(async e=>{let i;try{i=await e.provideDocumentRangeSemanticTokens(t,n,r)}catch(e){Zs(e),i=null}return i&&bV(i)||(i=null),new DV(e,i)}));for(let e of a)if(e.tokens)return e;return a.length>0?a[0]:null}In.registerCommand(`_provideDocumentSemanticTokensLegend`,async(e,...t)=>{let[n]=t;Qn(n instanceof Yn);let r=e.get(ct).getModel(n);if(!r)return;let{documentSemanticTokensProvider:i}=e.get(R),a=EV(i,r);return a?a[0].getLegend():e.get(Er).executeCommand(`_provideDocumentRangeSemanticTokensLegend`,n)}),In.registerCommand(`_provideDocumentSemanticTokens`,async(e,...t)=>{let[n]=t;Qn(n instanceof Yn);let r=e.get(ct).getModel(n);if(!r)return;let{documentSemanticTokensProvider:i}=e.get(R);if(!CV(i,r))return e.get(Er).executeCommand(`_provideDocumentRangeSemanticTokens`,n,r.getFullModelRange());let a=await TV(i,r,null,null,T.None);if(!a)return;let{provider:o,tokens:s}=a;if(!s||!bV(s))return;let c=vV({id:0,type:`full`,data:s.data});return s.resultId&&o.releaseDocumentSemanticTokens(s.resultId),c}),In.registerCommand(`_provideDocumentRangeSemanticTokensLegend`,async(e,...t)=>{let[n,r]=t;Qn(n instanceof Yn);let i=e.get(ct).getModel(n);if(!i)return;let{documentRangeSemanticTokensProvider:a}=e.get(R),o=kV(a,i);if(o.length===0)return;if(o.length===1)return o[0].getLegend();if(!r||!C.isIRange(r))return console.warn(`provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in`),o[0].getLegend();let s=await AV(a,i,C.lift(r),T.None);if(s)return s.provider.getLegend()}),In.registerCommand(`_provideDocumentRangeSemanticTokens`,async(e,...t)=>{let[n,r]=t;Qn(n instanceof Yn),Qn(C.isIRange(r));let i=e.get(ct).getModel(n);if(!i)return;let{documentRangeSemanticTokensProvider:a}=e.get(R),o=await AV(a,i,C.lift(r),T.None);if(o&&o.tokens)return vV({id:0,type:`full`,data:o.tokens.data})});var jV=`editor.semanticHighlighting`;function MV(e,t,n){let r=n.getValue(jV,{overrideIdentifier:e.getLanguageId(),resource:e.uri})?.enabled;return typeof r==`boolean`?r:t.getColorTheme().semanticHighlighting}var NV=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},PV=function(e,t){return function(n,r){t(n,r,e)}},FV=class extends G{static{this.ID=`editor.contrib.viewportSemanticTokens`}constructor(e,t,n,r,i,a){super(),this._semanticTokensStylingService=t,this._themeService=n,this._configurationService=r,this._editor=e,this._provider=a.documentRangeSemanticTokensProvider,this._debounceInformation=i.for(this._provider,`DocumentRangeSemanticTokens`,{min:100,max:500}),this._tokenizeViewport=this._register(new Pr(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];let o=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},s=()=>{if(this._cleanupProviderListeners(),this._editor.hasModel()){let e=this._editor.getModel();for(let t of this._provider.all(e)){let e=t.onDidChange?.(()=>{this._cancelAll(),o()});e&&this._rangeProvidersChangeListeners.push(e)}}};this._register(this._editor.onDidScrollChange(()=>{o()})),this._register(this._editor.onDidChangeModel(()=>{s(),this._cancelAll(),o()})),this._register(this._editor.onDidChangeModelLanguage(()=>{s(),this._cancelAll(),o()})),this._register(this._editor.onDidChangeModelContent(e=>{this._cancelAll(),o()})),s(),this._register(this._provider.onDidChange(()=>{s(),this._cancelAll(),o()})),this._register(this._configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(`editor.semanticHighlighting`)&&(this._cancelAll(),o())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),o()})),o()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){Pc(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(let e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,n=this._outstandingRequests.length;t<n;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;let e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!MV(e,this._themeService,this._configurationService)||!OV(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}let t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(t=>this._requestRange(e,t)))}_requestRange(e,t){let n=e.getVersionId(),r=Et(n=>Promise.resolve(AV(this._provider,e,t,n))),i=new Os(!1);return r.then(r=>{if(this._debounceInformation.update(e,i.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==n)return;let{provider:a,tokens:o}=r,s=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,Nl(o,s,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};FV=NV([PV(1,Ms),PV(2,qn),PV(3,Vi),PV(4,Us),PV(5,R)],FV),Ps(FV.ID,FV,1);var IV=class{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){let n=[];for(let r of t){let t=[];n.push(t),this.selectSubwords&&this._addInWordRanges(t,e,r),this._addWordRanges(t,e,r),this._addWhitespaceLine(t,e,r),t.push({range:e.getFullModelRange()})}return n}_addInWordRanges(e,t,n){let r=t.getWordAtPosition(n);if(!r)return;let{word:i,startColumn:a}=r,o=n.column-a,s=o,c=o,l=0;for(;s>=0;s--){let e=i.charCodeAt(s);if(s!==o&&(e===95||e===45)||Js(e)&&vc(l))break;l=e}for(s+=1;c<i.length;c++){let e=i.charCodeAt(c);if(vc(e)&&Js(l)||e===95||e===45)break;l=e}s<c&&e.push({range:new C(n.lineNumber,a+s,n.lineNumber,a+c)})}_addWordRanges(e,t,n){let r=t.getWordAtPosition(n);r&&e.push({range:new C(n.lineNumber,r.startColumn,n.lineNumber,r.endColumn)})}_addWhitespaceLine(e,t,n){t.getLineLength(n.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(n.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(n.lineNumber)===0&&e.push({range:new C(n.lineNumber,1,n.lineNumber,t.getLineMaxColumn(n.lineNumber))})}},LV=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},RV=function(e,t){return function(n,r){t(n,r,e)}},zV,BV=class e{constructor(e,t){this.index=e,this.ranges=t}mov(t){let n=this.index+(t?1:-1);if(n<0||n>=this.ranges.length)return this;let r=new e(n,this.ranges);return r.ranges[n].equalsRange(this.ranges[this.index])?r.mov(t):r}},VV=class{static{zV=this}static{this.ID=`editor.contrib.smartSelectController`}static get(e){return e.getContribution(zV.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){this._selectionListener?.dispose()}async run(e){if(!this._editor.hasModel())return;let t=this._editor.getSelections(),n=this._editor.getModel();if(this._state||await GV(this._languageFeaturesService.selectionRangeProvider,n,t.map(e=>e.getPosition()),this._editor.getOption(129),T.None).then(e=>{if(Eu(e)&&e.length===t.length&&this._editor.hasModel()&&Ad(this._editor.getSelections(),t,(e,t)=>e.equalsSelection(t))){for(let n=0;n<e.length;n++)e[n]=e[n].filter(e=>e.containsPosition(t[n].getStartPosition())&&e.containsPosition(t[n].getEndPosition())),e[n].unshift(t[n]);this._state=e.map(e=>new BV(0,e)),this._selectionListener?.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{this._ignoreSelection||(this._selectionListener?.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(t=>t.mov(e));let r=this._state.map(e=>q.fromPositions(e.ranges[e.index].getStartPosition(),e.ranges[e.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}}};VV=zV=LV([RV(1,R)],VV);var HV=class extends W{constructor(e,t){super(t),this._forward=e}async run(e,t){let n=VV.get(t);n&&await n.run(this._forward)}},UV=class extends HV{constructor(){super(!0,{id:`editor.action.smartSelect.expand`,label:L(1469,`Expand Selection`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:`1_basic`,title:x(1467,`&&Expand Selection`),order:2}})}};In.registerCommandAlias(`editor.action.smartSelect.grow`,`editor.action.smartSelect.expand`);var WV=class extends HV{constructor(){super(!1,{id:`editor.action.smartSelect.shrink`,label:L(1470,`Shrink Selection`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:D.MenubarSelectionMenu,group:`1_basic`,title:x(1468,`&&Shrink Selection`),order:3}})}};Ps(VV.ID,VV,4),z(UV),z(WV);async function GV(e,t,n,r,i){let a=e.all(t).concat(new IV(r.selectSubwords));a.length===1&&a.unshift(new $M);let o=[],s=[];for(let e of a)o.push(Promise.resolve(e.provideSelectionRanges(t,n,i)).then(e=>{if(Eu(e)&&e.length===n.length)for(let t=0;t<n.length;t++){s[t]||(s[t]=[]);for(let r of e[t])C.isIRange(r.range)&&C.containsPosition(r.range,n[t])&&s[t].push(C.lift(r.range))}},Zs));return await Promise.all(o),s.map(e=>{if(e.length===0)return[];e.sort((e,t)=>A.isBefore(e.getStartPosition(),t.getStartPosition())?1:A.isBefore(t.getStartPosition(),e.getStartPosition())||A.isBefore(e.getEndPosition(),t.getEndPosition())?-1:+!!A.isBefore(t.getEndPosition(),e.getEndPosition()));let n=[],i;for(let t of e)(!i||C.containsRange(t,i)&&!C.equalsRange(t,i))&&(n.push(t),i=t);if(!r.selectLeadingAndTrailingWhitespace)return n;let a=[n[0]];for(let e=1;e<n.length;e++){let r=n[e-1],i=n[e];if(i.startLineNumber!==r.startLineNumber||i.endLineNumber!==r.endLineNumber){let e=new C(r.startLineNumber,t.getLineFirstNonWhitespaceColumn(r.startLineNumber),r.endLineNumber,t.getLineLastNonWhitespaceColumn(r.endLineNumber));e.containsRange(r)&&!e.equalsRange(r)&&i.containsRange(e)&&!i.equalsRange(e)&&a.push(e);let n=new C(r.startLineNumber,1,r.endLineNumber,t.getLineMaxColumn(r.endLineNumber));n.containsRange(r)&&!n.equalsRange(e)&&i.containsRange(n)&&!i.equalsRange(n)&&a.push(n)}a.push(i)}return a})}In.registerCommand(`_executeSelectionRangeProvider`,async function(e,...t){let[n,r]=t;Qn(Yn.isUri(n)),Qn(Mr(r,e=>A.isIPosition(e)));let i=e.get(R).selectionRangeProvider,a=await e.get(Ui).createModelReference(n);try{return GV(i,a.object.textEditorModel,r.map(A.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},T.None)}finally{a.dispose()}});var KV=class extends su{constructor(){super({id:`editor.action.toggleStickyScroll`,title:{...L(1518,`Toggle Editor Sticky Scroll`),mnemonicTitle:x(1514,`&&Toggle Editor Sticky Scroll`)},metadata:{description:L(1519,`Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport`)},category:TB.View,toggled:{condition:w.equals(`config.editor.stickyScroll.enabled`,!0),title:x(1515,`Sticky Scroll`),mnemonicTitle:x(1516,`&&Sticky Scroll`)},menu:[{id:D.CommandPalette},{id:D.MenubarAppearanceMenu,group:`4_editor`,order:3},{id:D.StickyScrollContext}]})}async runEditorCommand(e,t){let n=e.get(Vi),r=!n.getValue(`editor.stickyScroll.enabled`),i=GP.get(t)?.isFocused();n.updateValue(`editor.stickyScroll.enabled`,r),i&&t.focus()}},qV=100,JV=class extends su{constructor(){super({id:`editor.action.focusStickyScroll`,title:{...L(1520,`Focus Editor Sticky Scroll`),mnemonicTitle:x(1517,`&&Focus Editor Sticky Scroll`)},precondition:w.and(w.has(`config.editor.stickyScroll.enabled`),E.stickyScrollVisible),menu:[{id:D.CommandPalette}]})}runEditorCommand(e,t){GP.get(t)?.focus()}},YV=class extends su{constructor(){super({id:`editor.action.selectNextStickyScrollLine`,title:L(1521,`Select the next editor sticky scroll line`),precondition:E.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:qV,primary:18}})}runEditorCommand(e,t){GP.get(t)?.focusNext()}},XV=class extends su{constructor(){super({id:`editor.action.selectPreviousStickyScrollLine`,title:L(1522,`Select the previous sticky scroll line`),precondition:E.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:qV,primary:16}})}runEditorCommand(e,t){GP.get(t)?.focusPrevious()}},ZV=class extends su{constructor(){super({id:`editor.action.goToFocusedStickyScrollLine`,title:L(1523,`Go to the focused sticky scroll line`),precondition:E.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:qV,primary:3}})}runEditorCommand(e,t){GP.get(t)?.goToFocused()}},QV=class extends su{constructor(){super({id:`editor.action.selectEditor`,title:L(1524,`Select Editor`),precondition:E.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:qV,primary:9}})}runEditorCommand(e,t){GP.get(t)?.selectEditor()}};Ps(GP.ID,GP,1),ea(KV),ea(JV),ea(XV),ea(YV),ea(ZV),ea(QV);var $V=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},eH=function(e,t){return function(n,r){t(n,r,e)}},tH=class{constructor(e,t,n,r,i,a,o){this.range=e,this.insertText=t,this.filterText=n,this.additionalTextEdits=r,this.command=i,this.gutterMenuLinkAction=a,this.completion=o,this.doNotLog=!0}},nH=class extends Tu{constructor(e,t,n,r,i,a){super(i.disposable),this.model=e,this.line=t,this.word=n,this.completionModel=r,this._suggestMemoryService=a}canBeReused(e,t,n){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===n.startColumn&&this.word.endColumn<n.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){let e=[],{items:t}=this.completionModel,n=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),r=Vd.slice(t,n),i=Vd.slice(t,0,n),a=5;for(let t of Vd.concat(r,i)){if(t.score===Bf.Default)continue;let n=new C(t.editStart.lineNumber,t.editStart.column,t.editInsertEnd.lineNumber,t.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),r=t.completion.insertTextRules&&t.completion.insertTextRules&4?{snippet:t.completion.insertText}:t.completion.insertText;e.push(new tH(n,r,t.filterTextLow??t.labelLow,t.completion.additionalTextEdits,t.completion.command,t.completion.action,t)),a-->=0&&t.resolve(T.None)}return e}};nH=$V([eH(5,VM)],nH);var rH=class extends G{constructor(e,t,n,r){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=n,this._editorService=r,this._store.add(e.inlineCompletionsProvider.register(`*`,this))}async provideInlineCompletions(e,t,n,r){if(n.selectedSuggestionInfo)return;let i;for(let t of this._editorService.listCodeEditors())if(t.getModel()===e){i=t;break}if(!i)return;let a=i.getOption(102);if(GO.isAllOff(a))return;e.tokenization.tokenizeIfCheap(t.lineNumber);let o=e.tokenization.getLineTokens(t.lineNumber),s=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(GO.valueFor(a,s)!==`inline`)return;let c=e.getWordAtPosition(t),l;if(c?.word||(l=this._getTriggerCharacterInfo(e,t)),!c?.word&&!l||(c||=e.getWordUntilPosition(t),c.endColumn!==t.column))return;let u,d=e.getValueInRange(new C(t.lineNumber,1,t.lineNumber,t.column));if(!l&&this._lastResult?.canBeReused(e,t.lineNumber,c)){let e=new ZM(d,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=e,this._lastResult.acquire(),u=this._lastResult}else{let n=await RO(this._languageFeatureService.completionProvider,e,t,new IO(void 0,sN.createSuggestFilter(i).itemKind,l?.providers),l&&{triggerKind:1,triggerCharacter:l.ch},r),a;n.needsClipboard&&(a=await this._clipboardService.readText());let o=new QM(n.items,t.column,new ZM(d,0),eN.None,i.getOption(134),i.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},a);u=new nH(e,t.lineNumber,c,o,n,this._suggestMemoryService)}return this._lastResult=u,u}handleItemDidShow(e,t){t.completion.resolve(T.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){let n=e.getValueInRange(C.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),r=new Set;for(let t of this._languageFeatureService.completionProvider.all(e))t.triggerCharacters?.includes(n)&&r.add(t);if(r.size!==0)return{providers:r,ch:n}}};rH=$V([eH(0,R),eH(1,ss),eH(2,VM),eH(3,Xs)],rH),$e(rH),z(class extends W{constructor(){super({id:`editor.action.toggleHighContrast`,label:Pi.toggleHighContrast,alias:`Toggle High Contrast Theme`,precondition:void 0}),this._originalThemeName=null}run(e,t){let n=e.get(vr),r=n.getColorTheme();mt(r.type)?(n.setTheme(this._originalThemeName||(vl(r.type)?`vs-dark`:`vs`)),this._originalThemeName=null):(n.setTheme(vl(r.type)?Si:hn),this._originalThemeName=r.themeName)}});var iH=class e extends dl{static{this.ID=`editor.action.toggleTabFocusMode`}constructor(){super({id:e.ID,title:L(1604,`Toggle Tab Key Moves Focus`),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:L(1605,`Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.`)},f1:!0})}run(){let e=!yr.getTabFocusMode();yr.setTabFocusMode(e),bo(e?x(1602,`Pressing Tab will now move focus to the next focusable element`):x(1603,`Pressing Tab will now insert the tab character`))}};ea(iH),z(class extends W{constructor(){super({id:`editor.action.forceRetokenize`,label:L(1606,`Developer: Force Retokenize`),precondition:void 0})}run(e,t){if(!t.hasModel())return;let n=t.getModel();n.tokenization.resetTokenization();let r=new Os;n.tokenization.forceTokenization(n.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}});var aH=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},oH=function(e,t){return function(n,r){t(n,r,e)}},sH=26,cH=class extends G{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(lH))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{this.hide(),e.onClose?.()}}),this._editor.setBanner(this.banner.element,sH)}};cH=aH([oH(1,U)],cH);var lH=class extends G{constructor(e,t){super(),this.instantiationService=e,this.markdownRendererService=t,this.element=M(`div.editor-banner`),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message==`string`)return e.message}getBannerMessage(e){if(typeof e==`string`){let t=M(`span`);return t.innerText=e,t}return this.markdownRendererService.render(e).element}clear(){wf(this.element)}show(e){wf(this.element);let t=this.getAriaLabel(e);t&&this.element.setAttribute(`aria-label`,t);let n=K(this.element,M(`div.icon-container`));n.setAttribute(`aria-hidden`,`true`),e.icon&&n.appendChild(M(`div${V.asCSSSelector(e.icon)}`));let r=K(this.element,M(`div.message-container`));if(r.setAttribute(`aria-hidden`,`true`),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=K(this.element,M(`div.message-actions-container`)),e.actions)for(let t of e.actions)this._register(this.instantiationService.createInstance(Rm,this.messageActionsContainer,{...t,tabIndex:-1},{}));let i=K(this.element,M(`div.action-container`));this.actionBar=this._register(new zr(i)),this.actionBar.push(this._register(new gr(`banner.close`,x(1607,`Close Banner`),V.asClassName(Ki),!0,()=>{typeof e.onClose==`function`&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};lH=aH([oH(0,U),oH(1,ba)],lH);var uH=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},dH=function(e,t){return function(n,r){t(n,r,e)}},fH=kr(`extensions-warning-message`,k.warning,x(1608,`Icon shown with a warning message in the extensions editor.`)),pH=class extends G{static{this.ID=`editor.contrib.unicodeHighlighter`}constructor(e,t,n,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=n,this._highlighter=null,this._bannerClosed=!1,this._updateState=e=>{if(e&&e.hasMore){if(this._bannerClosed)return;let t=Math.max(e.ambiguousCharacterCount,e.nonBasicAsciiCharacterCount,e.invisibleCharacterCount),n;if(e.nonBasicAsciiCharacterCount>=t)n={message:x(1609,`This document contains many non-basic ASCII unicode characters`),command:new OH};else if(e.ambiguousCharacterCount>=t)n={message:x(1610,`This document contains many ambiguous unicode characters`),command:new EH};else if(e.invisibleCharacterCount>=t)n={message:x(1611,`This document contains many invisible unicode characters`),command:new DH};else throw Error(`Unreachable`);this._bannerController.show({id:`unicodeHighlightBanner`,message:n.message,icon:fH,actions:[{label:n.command.shortLabel,href:`command:${n.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(cH,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(142),this._register(n.onDidChangeTrust(e=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(142)&&(this._options=e.getOption(142),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&=(this._highlighter.dispose(),null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&=(this._highlighter.dispose(),null),!this._editor.hasModel())return;let e=mH(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(e=>e===!1))return;let t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(e=>e.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(e=>e===`_os`?Ga.NumberFormat().value.resolvedOptions().locale:e===`_vscode`?pi:e)};this._highlighter=this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?new hH(this._editor,t,this._updateState,this._editorWorkerService):new gH(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};pH=uH([dH(1,cr),dH(2,ds),dH(3,U)],pH);function mH(e,t){return{nonBasicASCII:t.nonBasicASCII===`inUntrustedWorkspace`?!e:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:t.includeComments===`inUntrustedWorkspace`?!e:t.includeComments,includeStrings:t.includeStrings===`inUntrustedWorkspace`?!e:t.includeStrings,allowedCharacters:t.allowedCharacters,allowedLocales:t.allowedLocales}}var hH=class extends G{constructor(e,t,n,r){super(),this._editor=e,this._options=t,this._updateState=n,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Pr(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}let e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);let n=[];if(!t.hasMore)for(let e of t.ranges)n.push({range:e,options:CH.instance.getDecorationFromOptions(this._options)});this._decorations.set(n)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;let t=this._editor.getModel();return Lr(t,e)?{reason:SH(t.getValueInRange(e.range),this._options),inComment:Cn(t,e),inString:rr(t,e)}:null}};hH=uH([dH(3,cr)],hH);var gH=class extends G{constructor(e,t,n){super(),this._editor=e,this._options=t,this._updateState=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Pr(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}let e=this._editor.getVisibleRanges(),t=[],n={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(let t of e){let e=ki.computeUnicodeHighlights(this._model,this._options,t);for(let t of e.ranges)n.ranges.push(t);n.ambiguousCharacterCount+=n.ambiguousCharacterCount,n.invisibleCharacterCount+=n.invisibleCharacterCount,n.nonBasicAsciiCharacterCount+=n.nonBasicAsciiCharacterCount,n.hasMore=n.hasMore||e.hasMore}if(!n.hasMore)for(let e of n.ranges)t.push({range:e,options:CH.instance.getDecorationFromOptions(this._options)});this._updateState(n),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;let t=this._editor.getModel(),n=t.getValueInRange(e.range);return Lr(t,e)?{reason:SH(n,this._options),inComment:Cn(t,e),inString:rr(t,e)}:null}},_H=x(1612,`Configure Unicode Highlight Options`),vH=class{constructor(e,t){this._editor=e,this._markdownRendererService=t,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];let n=this._editor.getModel(),r=this._editor.getContribution(pH.ID);if(!r)return[];let i=[],a=new Set,o=300;for(let e of t){let t=r.getDecorationInfo(e);if(!t)continue;let s=n.getValueInRange(e.range).codePointAt(0),c=bH(s),l;switch(t.reason.kind){case 0:l=hd(t.reason.confusableWith)?x(1613,`The character {0} could be confused with the ASCII character {1}, which is more common in source code.`,c,bH(t.reason.confusableWith.codePointAt(0))):x(1614,`The character {0} could be confused with the character {1}, which is more common in source code.`,c,bH(t.reason.confusableWith.codePointAt(0)));break;case 1:l=x(1615,`The character {0} is invisible.`,c);break;case 2:l=x(1616,`The character {0} is not a basic ASCII character.`,c)}if(a.has(l))continue;a.add(l);let u={codePoint:s,reason:t.reason,inComment:t.inComment,inString:t.inString},d=x(1617,`Adjust settings`),f=xn(kH.ID,u),p=new Oi(``,!0).appendMarkdown(l).appendText(` `).appendLink(f,d,_H);i.push(new ob(this,e.range,[p],!1,o++))}return i}renderHoverParts(e,t){return db(e,t,this._editor,this._markdownRendererService)}getAccessibleContent(e){return e.contents.map(e=>e.value).join(`
|
|
50
50
|
`)}};vH=uH([dH(1,ba)],vH);function yH(e){return`U+${e.toString(16).padStart(4,`0`)}`}function bH(e){let t=`\`${yH(e)}\``;return fo.isInvisibleCharacter(e)||(t+=` "${`${xH(e)}`}"`),t}function xH(e){return e===96?"`` ` ``":"`"+String.fromCodePoint(e)+"`"}function SH(e,t){return ki.computeUnicodeHighlightReason(e,t)}var CH=class e{constructor(){this.map=new Map}static{this.instance=new e}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){let n=`${e}${t}`,r=this.map.get(n);return r||(r=P.createDynamic({description:`unicode-highlight`,stickiness:1,className:`unicode-highlight`,showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(n,r)),r}},wH=class extends W{constructor(){super({id:EH.ID,label:L(1626,`Disable highlighting of characters in comments`),precondition:void 0}),this.shortLabel=x(1618,`Disable Highlight In Comments`)}async run(e,t){let n=e.get(Vi);n&&this.runAction(n)}async runAction(e){await e.updateValue(vd.includeComments,!1,2)}},TH=class extends W{constructor(){super({id:EH.ID,label:L(1627,`Disable highlighting of characters in strings`),precondition:void 0}),this.shortLabel=x(1619,`Disable Highlight In Strings`)}async run(e,t){let n=e.get(Vi);n&&this.runAction(n)}async runAction(e){await e.updateValue(vd.includeStrings,!1,2)}},EH=class e extends dl{static{this.ID=`editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters`}constructor(){super({id:e.ID,title:L(1628,`Disable highlighting of ambiguous characters`),precondition:void 0,f1:!1}),this.shortLabel=x(1620,`Disable Ambiguous Highlight`)}async run(e,t){let n=e.get(Vi);n&&this.runAction(n)}async runAction(e){await e.updateValue(vd.ambiguousCharacters,!1,2)}},DH=class e extends dl{static{this.ID=`editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters`}constructor(){super({id:e.ID,title:L(1629,`Disable highlighting of invisible characters`),precondition:void 0,f1:!1}),this.shortLabel=x(1621,`Disable Invisible Highlight`)}async run(e,t){let n=e.get(Vi);n&&this.runAction(n)}async runAction(e){await e.updateValue(vd.invisibleCharacters,!1,2)}},OH=class e extends dl{static{this.ID=`editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters`}constructor(){super({id:e.ID,title:L(1630,`Disable highlighting of non basic ASCII characters`),precondition:void 0,f1:!1}),this.shortLabel=x(1622,`Disable Non ASCII Highlight`)}async run(e,t){let n=e.get(Vi);n&&this.runAction(n)}async runAction(e){await e.updateValue(vd.nonBasicASCII,!1,2)}},kH=class e extends dl{static{this.ID=`editor.action.unicodeHighlight.showExcludeOptions`}constructor(){super({id:e.ID,title:L(1631,`Show Exclude Options`),precondition:void 0,f1:!1})}async run(e,t){let{codePoint:n,reason:r,inString:i,inComment:a}=t,o=String.fromCodePoint(n),s=e.get(Gd),c=e.get(Vi);function l(e){return fo.isInvisibleCharacter(e)?x(1623,`Exclude {0} (invisible character) from being highlighted`,yH(e)):x(1624,`Exclude {0} from being highlighted`,`${yH(e)} "${o}"`)}let u=[];if(r.kind===0)for(let e of r.notAmbiguousInLocales)u.push({label:x(1625,`Allow unicode characters that are more common in the language "{0}".`,e),run:async()=>{jH(c,[e])}});if(u.push({label:l(n),run:()=>AH(c,[n])}),a){let e=new wH;u.push({label:e.label,run:async()=>e.runAction(c)})}else if(i){let e=new TH;u.push({label:e.label,run:async()=>e.runAction(c)})}function d(e){return typeof e.desc.title==`string`?e.desc.title:e.desc.title.value}if(r.kind===0){let e=new EH;u.push({label:d(e),run:async()=>e.runAction(c)})}else if(r.kind===1){let e=new DH;u.push({label:d(e),run:async()=>e.runAction(c)})}else if(r.kind===2){let e=new OH;u.push({label:d(e),run:async()=>e.runAction(c)})}else MH(r);let f=await s.pick(u,{title:_H});f&&await f.run()}};async function AH(e,t){let n=e.getValue(vd.allowedCharacters),r;r=typeof n==`object`&&n?n:{};for(let e of t)r[String.fromCodePoint(e)]=!0;await e.updateValue(vd.allowedCharacters,r,2)}async function jH(e,t){let n=e.inspect(vd.allowedLocales).user?.value,r;r=typeof n==`object`&&n?Object.assign({},n):{};for(let e of t)r[e]=!0;await e.updateValue(vd.allowedLocales,r,2)}function MH(e){throw Error(`Unexpected value: ${e}`)}ea(EH),ea(DH),ea(OH),ea(kH),Ps(pH.ID,pH,1),c_.register(vH);var NH=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},PH=function(e,t){return function(n,r){t(n,r,e)}},FH=`ignoreUnusualLineTerminators`;function IH(e,t,n){e.setModelProperty(t.uri,FH,n)}function LH(e,t){return e.getModelProperty(t.uri,FH)}var RH=class extends G{static{this.ID=`editor.contrib.unusualLineTerminatorsDetector`}constructor(e,t,n){super(),this._editor=e,this._dialogService=t,this._codeEditorService=n,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(e=>{e.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(e=>{e.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config===`off`||!this._editor.hasModel())return;let e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||LH(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config===`auto`){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let t;try{this._isPresentingDialog=!0,t=await this._dialogService.confirm({title:x(1632,`Unusual Line Terminators`),message:x(1633,`Detected unusual line terminators`),detail:x(1634,`The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).
|
|
51
51
|
|
|
52
|
-
It is recommended to remove them from the file. This can be configured via \`editor.unusualLineTerminators\`.`,Jd(e.uri)),primaryButton:x(1635,`&&Remove Unusual Line Terminators`),cancelButton:x(1636,`Ignore`)})}finally{this._isPresentingDialog=!1}t.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):IH(this._codeEditorService,e,!0)}};RH=NH([PH(1,ca),PH(2,Xs)],RH),Ps(RH.ID,RH,1);var zH=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)}},VH=class{constructor(){this.selector={language:`*`}}provideDocumentHighlights(e,t,n){if(e.isDisposed())return;let r=[],i=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return i?e.findMatches(i.word,!0,!1,!0,eu,!1).map(e=>({range:e.range,kind:xf.Text})):Promise.resolve(r)}provideMultiDocumentHighlights(e,t,n,r){if(e.isDisposed())return;let i=new Cl,a=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!a)return Promise.resolve(i);for(let t of[e,...n]){if(t.isDisposed())continue;let e=t.findMatches(a.word,!0,!1,!0,eu,!1).map(e=>({range:e.range,kind:xf.Text}));e&&i.set(t.uri,e)}return i}},HH=class extends G{constructor(e){super(),this._register(e.documentHighlightProvider.register(`*`,new VH)),this._register(e.multiDocumentHighlightProvider.register(`*`,new VH))}};HH=zH([BH(0,R)],HH);var UH=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},WH=function(e,t){return function(n,r){t(n,r,e)}},GH,KH,qH=new j(`hasWordHighlights`,!1);function JH(e,t,n,r){let i=e.ordered(t);return Wn(i.map(e=>()=>Promise.resolve(e.provideDocumentHighlights(t,n,r)).then(void 0,Zs)),e=>e!=null).then(e=>{if(e){let n=new Cl;return n.set(t.uri,e),n}return new Cl})}function YH(e,t,n,r,i){let a=e.ordered(t);return Wn(a.map(e=>()=>{let a=i.filter(e=>Vf(e)).filter(t=>Nd(e.selector,t.uri,t.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(e.provideMultiDocumentHighlights(t,n,a,r)).then(void 0,Zs)}),e=>e!=null)}var XH=class{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||=Et(e=>this._compute(this._model,this._selection,this._wordSeparators,e)),this._result}_getCurrentWordRange(e,t){let n=e.getWordAtPosition(t.getPosition());return n?new C(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}cancel(){this.result.cancel()}},ZH=class extends XH{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return JH(this._providers,e,t.getPosition(),r).then(e=>e||new Cl)}},QH=class extends XH{constructor(e,t,n,r,i){super(e,t,n),this._providers=r,this._otherModels=i}_compute(e,t,n,r){return YH(this._providers,e,t.getPosition(),r,this._otherModels).then(e=>e||new Cl)}};function $H(e,t,n,r){return new ZH(t,n,r,e)}function eU(e,t,n,r,i){return new QH(t,n,r,e,i)}Id(`_executeDocumentHighlights`,async(e,t,n)=>(await JH(e.get(R).documentHighlightProvider,t,n,T.None))?.get(t.uri));var tU=class{static{GH=this}static{this.storedDecorationIDs=new Cl}static{this.query=null}constructor(e,t,n,r,i,a,o,s){this.toUnhook=new F,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Cl,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new er(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=a,this.textModelService=i,this.configurationService=o,this.logService=s,this._hasWordHighlights=qH.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue(`editor.occurrencesHighlightDelay`),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(e=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!==`off`&&this.runDelayer.trigger(()=>{this._onPositionChanged(e)}).catch(nt)})),this.toUnhook.add(e.onDidFocusEditorText(e=>{this.occurrencesHighlightEnablement!==`off`&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}).catch(nt))})),this.toUnhook.add(e.onDidChangeModelContent(e=>{Kr(this.model.uri,`output`)||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(e=>{!e.newModelUrl&&e.oldModelUrl?this._stopSingular():GH.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(e=>{let t=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==t)switch(this.occurrencesHighlightEnablement=t,t){case`off`:this._stopAll();break;case`singleFile`:this._stopAll(GH.query?.modelInfo?.modelURI);break;case`multiFile`:GH.query&&this._run(!0);break;default:console.warn(`Unknown occurrencesHighlight setting value:`,t)}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(`editor.occurrencesHighlightDelay`)){let e=o.getValue(`editor.occurrencesHighlightDelay`);this.occurrencesHighlightDelay!==e&&(this.occurrencesHighlightDelay=e)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{let e=this.codeEditorService.getFocusedCodeEditor();e?e.getModel()?.uri.scheme===sl.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==sl.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,GH.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!==`off`&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}).catch(nt))}stop(){this.occurrencesHighlightEnablement!==`off`&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(C.compareRangesUsingStarts)}moveNext(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);bo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);bo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;let e=GH.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),GH.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){let t=this.codeEditorService.listCodeEditors(),n=[];for(let r of t){if(!r.hasModel()||Vt(r.getModel().uri,e))continue;let t=GH.storedDecorationIDs.get(r.getModel().uri);if(!t)continue;r.removeDecorations(t),n.push(r.getModel().uri);let i=nU.get(r);i?.wordHighlighter&&i.wordHighlighter.decorations.length>0&&(i.wordHighlighter.decorations.clear(),i.wordHighlighter.workerRequest=null,i.wordHighlighter._hasWordHighlights.set(!1))}for(let e of n)GH.storedDecorationIDs.delete(e)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==sl.vscodeNotebookCell&&GH.query?.modelInfo?.modelURI.scheme!==sl.vscodeNotebookCell?(GH.query=null,this._run()):GH.query?.modelInfo&&(GH.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||=(this.workerRequestTokenId++,!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||=(this.workerRequestTokenId++,!0)}_onPositionChanged(e){this.occurrencesHighlightEnablement===`off`||e.source!==`api`&&e.reason!==3?this._stopAll():this._run()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===sl.vscodeNotebookCell){let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){let n=r.getModel();n&&n!==e&&n.uri.scheme===sl.vscodeNotebookCell&&t.push(n)}return t}let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){if(!Rl(r))continue;let n=r.getModel();n&&e===n.modified&&t.push(n.modified)}if(t.length)return t;if(this.occurrencesHighlightEnablement===`singleFile`)return[];for(let r of n){let n=r.getModel();n&&n!==e&&t.push(n)}return t}async _run(e,t){if(this.editor.hasTextFocus()){let e=this.editor.getSelection();if(!e||e.startLineNumber!==e.endLineNumber){GH.query=null,this._stopAll();return}let t=e.startColumn,n=e.endColumn,r=this._getWord();if(!r||r.startColumn>t||r.endColumn<n){GH.query=null,this._stopAll();return}GH.query={modelInfo:{modelURI:this.model.uri,selection:e}}}else if(!GH.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),Vt(this.editor.getModel().uri,GH.query.modelInfo?.modelURI)){if(!e){let e=this.decorations.getRanges();for(let t of e)if(t.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);let n=++this.workerRequestTokenId;this.workerRequestCompleted=!1;let r=this.getOtherModelsToHighlight(this.editor.getModel());if(!GH.query||!GH.query.modelInfo)return;let i=await this.textModelService.createModelReference(GH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(i.object.textEditorModel,GH.query.modelInfo.selection,r),this.workerRequest?.result.then(e=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=e||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},nt)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{i.dispose()}}else if(this.model.uri.scheme===sl.vscodeNotebookCell){let e=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!GH.query||!GH.query.modelInfo)return;let n=await this.textModelService.createModelReference(GH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(n.object.textEditorModel,GH.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then(n=>{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=n||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},nt)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{n.dispose()}}}computeWithModel(e,t,n){return n.length?eU(this.multiDocumentProviders,e,t,this.editor.getOption(148),n):$H(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){let t=new Date().getTime(),n=this.lastCursorPositionChangeTime+e;t>=n?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},n-t)}renderDecorations(){this.renderDecorationsTimer=void 0;let e=this.codeEditorService.listCodeEditors();for(let t of e){let e=nU.get(t);if(!e)continue;let n=[],r=t.getModel()?.uri;if(r&&this.workerRequestValue.has(r)){let i=GH.storedDecorationIDs.get(r),a=this.workerRequestValue.get(r);if(a)for(let e of a)e.range&&n.push({range:e.range,options:yz(e.kind)});let o=[];t.changeDecorations(e=>{o=e.deltaDecorations(i??[],n)}),GH.storedDecorationIDs=GH.storedDecorationIDs.set(r,o),n.length>0&&(e.wordHighlighter?.decorations.set(n),e.wordHighlighter?._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}};tU=GH=UH([WH(4,Ui),WH(5,Xs),WH(6,Vi),WH(7,ju)],tU);var nU=class extends G{static{KH=this}static{this.ID=`editor.contrib.wordHighlighter`}static get(e){return e.getContribution(KH.ID)}constructor(e,t,n,r,i,a,o){super(),this._wordHighlighter=null;let s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==sl.accessibleView&&(this._wordHighlighter=new tU(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,i,r,a,o))};this._register(e.onDidChangeModel(e=>{this._wordHighlighter&&=(!e.newModelUrl&&e.oldModelUrl?.scheme!==sl.vscodeNotebookCell&&this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),null),s()})),s()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&=(this._wordHighlighter.dispose(),null),super.dispose()}};nU=KH=UH([WH(1,Fa),WH(2,R),WH(3,Xs),WH(4,Ui),WH(5,Vi),WH(6,ju)],nU);var rU=class extends W{constructor(e,t){super(t),this._isNext=e}run(e,t){let n=nU.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}},iU=class extends rU{constructor(){super(!0,{id:`editor.action.wordHighlight.next`,label:L(1646,`Go to Next Symbol Highlight`),precondition:qH,kbOpts:{kbExpr:E.editorTextFocus,primary:65,weight:100}})}},aU=class extends rU{constructor(){super(!1,{id:`editor.action.wordHighlight.prev`,label:L(1647,`Go to Previous Symbol Highlight`),precondition:qH,kbOpts:{kbExpr:E.editorTextFocus,primary:1089,weight:100}})}},oU=class extends W{constructor(){super({id:`editor.action.wordHighlight.trigger`,label:L(1648,`Trigger Symbol Highlight`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:0,weight:100}})}run(e,t){let n=nU.get(t);n&&n.restoreViewState(!0)}};Ps(nU.ID,nU,0),z(iU),z(aU),z(oU),$e(HH);var sU=class extends td{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;let r=Ot(t.getOption(148),t.getOption(147)),i=t.getModel(),a=t.getSelections(),o=a.length>1,s=a.map(e=>{let t=new A(e.positionLineNumber,e.positionColumn),n=this._move(r,i,t,this._wordNavigationType,o);return this._moveTo(e,n,this._inSelectionMode)});if(i.pushStackElement(),t._getViewModel().setCursorStates(`moveWordCommand`,3,s.map(e=>ld.fromModelSelection(e))),s.length===1){let e=new A(s[0].positionLineNumber,s[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,n){return n?new q(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new q(t.lineNumber,t.column,t.lineNumber,t.column)}},cU=class extends sU{_move(e,t,n,r,i){return bd.moveWordLeft(e,t,n,r,i)}},lU=class extends sU{_move(e,t,n,r,i){return bd.moveWordRight(e,t,n,r)}},uU=class extends cU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartLeft`,precondition:void 0})}},dU=class extends cU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndLeft`,precondition:void 0})}},fU=class extends cU{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:`cursorWordLeft`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(Xa,Qu)?.negate()),primary:2063,mac:{primary:527},weight:100}})}},pU=class extends cU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartLeftSelect`,precondition:void 0})}},mU=class extends cU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndLeftSelect`,precondition:void 0})}},hU=class extends cU{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:`cursorWordLeftSelect`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(Xa,Qu)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}},gU=class extends cU{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityLeft`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Ot(Gi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},_U=class extends cU{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityLeftSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Ot(Gi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},vU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartRight`,precondition:void 0})}},yU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndRight`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(Xa,Qu)?.negate()),primary:2065,mac:{primary:529},weight:100}})}},bU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordRight`,precondition:void 0})}},xU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartRightSelect`,precondition:void 0})}},SU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndRightSelect`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(Xa,Qu)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}},CU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordRightSelect`,precondition:void 0})}},wU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityRight`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Ot(Gi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},TU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityRightSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Ot(Gi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},EU=class extends td{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){let r=e?.get(Pn);if(!t.hasModel()||!r)return;let i=Ot(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections(),s=t.getOption(10),c=t.getOption(15),l=r.getLanguageConfiguration(a.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),d=o.map(e=>{let n=this._delete({wordSeparators:i,model:a,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:s,autoClosingQuotes:c,autoClosingPairs:l,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Yc(n,``)});t.pushUndoStop(),t.executeCommands(this.id,d),t.pushUndoStop()}},DU=class extends EU{_delete(e,t){return bd.deleteWordLeft(e,t)||new C(1,1,1,1)}},OU=class extends EU{_delete(e,t){let n=bd.deleteWordRight(e,t);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new C(r,i,r,i)}},kU=class extends DU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartLeft`,precondition:E.writable})}},AU=class extends DU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndLeft`,precondition:E.writable})}},jU=class extends DU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordLeft`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}},MU=class extends OU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartRight`,precondition:E.writable})}},NU=class extends OU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndRight`,precondition:E.writable})}},PU=class extends OU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordRight`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}},FU=class extends W{constructor(){super({id:`deleteInsideWord`,precondition:E.writable,label:L(1650,`Delete Word`),metadata:{description:L(1651,`Delete the word at the cursor`),args:[{name:`args`,schema:{type:`object`,properties:{onlyWord:{type:`boolean`,default:!1,description:x(1649,`Delete only the word and leave surrounding whitespace`)}}}}]}})}run(e,t,n){if(!t.hasModel())return;let r=!!(n&&typeof n==`object`&&n.onlyWord),i=Ot(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections().map(e=>{let t=bd.deleteInsideWord(i,a,e,r);return new Yc(t,``)});t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}};H(new uU),H(new dU),H(new fU),H(new pU),H(new mU),H(new hU),H(new vU),H(new yU),H(new bU),H(new xU),H(new SU),H(new CU),H(new gU),H(new _U),H(new wU),H(new TU),H(new kU),H(new AU),H(new jU),H(new MU),H(new NU),H(new PU),z(FU);var IU=class extends EU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordPartLeft`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){return nu.deleteWordPartLeft(e)||new C(1,1,1,1)}},LU=class extends EU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordPartRight`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let n=nu.deleteWordPartRight(e);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new C(r,i,r,i)}},RU=class extends sU{_move(e,t,n,r,i){return nu.moveWordPartLeft(e,t,n,i)}},zU=class extends RU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordPartLeft`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:783},weight:100}})}};In.registerCommandAlias(`cursorWordPartStartLeft`,`cursorWordPartLeft`);var BU=class extends RU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordPartLeftSelect`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}};In.registerCommandAlias(`cursorWordPartStartLeftSelect`,`cursorWordPartLeftSelect`);var VU=class extends sU{_move(e,t,n,r,i){return nu.moveWordPartRight(e,t,n)}},HU=class extends VU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordPartRight`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:785},weight:100}})}},UU=class extends VU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordPartRightSelect`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}};H(new IU),H(new LU),H(new zU),H(new BU),H(new HU),H(new UU);var WU=[{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>J(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>J(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>J(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>J(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>J(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>J(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>J(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>J(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>J(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>J(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>J(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>J(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>J(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>J(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>J(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>J(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>J(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>J(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>J(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>J(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>J(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>J(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>J(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>J(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>J(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>J(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>J(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>J(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>J(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>J(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>J(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>J(()=>import(`./monokai-BscAjiQZ.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>J(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>J(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>J(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>J(()=>import(`./one-dark-pro-C6YyR8OD.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>J(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>J(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>J(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>J(()=>import(`./red-CYlAq2b0.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>J(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>J(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>J(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>J(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>J(()=>import(`./solarized-dark-b97czJOk.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>J(()=>import(`./solarized-light-DFPxpIYQ.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>J(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>J(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>J(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>J(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>J(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>J(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}],GU=Object.fromEntries(WU.map(e=>[e.id,e.import])),KU=Qe({langs:Kf,themes:GU,engine:()=>(0,qf.createOnigurumaEngine)(J(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:qU,codeToHast:JU,codeToTokens:YU,codeToTokensBase:XU,codeToTokensWithThemes:ZU,getSingletonHighlighter:QU,getLastGrammarState:$U}=Xe(KU,{guessEmbeddedLanguages:Ze});self.MonacoEnvironment={async getWorker(){return new(await(J(()=>import(`./editor.worker-CGG2Yh4v.js`),[]))).default}};function eW(e,t){let n=Zl.registerCommand(`offsite.block`,(e,n)=>t(n)),r=e===`stage`?`Stage`:`Unstage`,i={id:e===`stage`?`add`:`remove`},a=[wn.appendMenuItem(D.DiffEditorHunkToolbar,{command:{id:`offsite.block`,title:`${r} Block`,icon:i},group:`primary`,order:10}),wn.appendMenuItem(D.DiffEditorSelectionToolbar,{command:{id:`offsite.block`,title:`${r} Selection`,icon:i},group:`primary`,order:10})];return()=>{n.dispose();for(let e of a)e.dispose()}}function tW(e,t,n){let r=t.getValue();for(let i of n.innerChanges.slice().reverse()){let n=i.modifiedRange;r=r.slice(0,t.getOffsetAt({lineNumber:n.startLineNumber,column:n.startColumn}))+e.getValueInRange(i.originalRange)+r.slice(t.getOffsetAt({lineNumber:n.endLineNumber,column:n.endColumn}))}return r}var nW=KU({themes:[],langs:[]}),rW=new Map([[`tsx`,()=>J(()=>import(`./typescript-Dy13l_qr.js`),__vite__mapDeps([13,8,1,2,3,4]))],[`jsx`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`json`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`jsonc`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`shellscript`,()=>J(()=>import(`./shell-CC2rA5mh.js`),[])],[`docker`,()=>J(()=>import(`./dockerfile-DZFCIeNp.js`),[])],[`c`,()=>J(()=>import(`./cpp-C7h46wYY.js`),[])],[`objective-cpp`,()=>J(()=>import(`./cpp-C7h46wYY.js`),[])],[`vue`,()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))],[`svelte`,()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))]]);async function iW(e){let t=Ge(e),n=Gf.find(e=>e.id===t||e.aliases?.includes(t)===!0);if(n===void 0)return{id:`plaintext`,name:`Plain Text`};let r=await nW;if(!r.getLoadedLanguages().includes(n.id)){if(await r.loadLanguage(n.import),!Wc.getLanguages().some(e=>e.id===n.id)){Wc.register({id:n.id});let e=rW.get(n.id);e!==void 0&&Wc.setLanguageConfiguration(n.id,(await e()).conf)}await aW()}return{id:n.id,name:n.name}}async function aW(){let e=je(),t=WU.find(t=>t.id===e.codeTheme);if(t===void 0)throw Error(`unknown code theme ${e.codeTheme}`);let n=(await t.import()).default,r=await nW;await r.loadTheme({...n,colors:{...n.colors,"editor.background":e.background}}),wp(r,Gu),Zl.setTheme(e.codeTheme)}function oW(e){return{fontFamily:e.font.family,fontSize:e.font.size,lineHeight:e.font.lineHeight,fontLigatures:e.font.ligatures?e.font.features===``||e.font.features:!1,cursorStyle:e.cursor.style===`bar`?`line`:e.cursor.style,cursorBlinking:e.cursor.blink?`expand`:`solid`,tabSize:e.tabSize,insertSpaces:!0,detectIndentation:!1,trimAutoWhitespace:!1,wordWrap:e.wordWrap?`on`:`off`,wrappingStrategy:`advanced`,minimap:{enabled:!1},stickyScroll:{enabled:!1},overviewRulerBorder:!1,padding:{top:3,bottom:48},cursorSurroundingLines:2,copyWithSyntaxHighlighting:!1,accessibilitySupport:`off`,guides:{bracketPairs:!0,bracketPairsHorizontal:!1,highlightActiveBracketPair:!0,highlightActiveIndentation:!0},dragAndDrop:!1,glyphMargin:!1,useTabStops:!1,selectionHighlight:!1,emptySelectionClipboard:!1,renderWhitespace:`selection`,smartSelect:{selectLeadingAndTrailingWhitespace:!1},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},scrollBeyondLastLine:!1,smoothScrolling:!0,hover:{above:!1},find:{cursorMoveOnType:!1},acceptSuggestionOnCommitCharacter:!1,suggestSelection:`first`,suggest:{localityBonus:!0,insertMode:`replace`,snippetsPreventQuickSuggestions:!1},quickSuggestions:{comments:`on`,strings:`on`,other:`on`},quickSuggestionsDelay:0}}async function sW(e){await document.fonts.load(`${e.font.size}px ${e.font.family}`),Zl.remeasureFonts()}function cW(e){let t=e.model,n=e.editor,i=e.machine,a=e.projectId,o=e.path,s=(0,Y.useRef)(null),c=(0,Y.useCallback)(e=>{let n=t.onDidChangeContent(e);return()=>n.dispose()},[t]),l=(0,Y.useDeferredValue)((0,Y.useSyncExternalStore)(c,()=>t.getValue())),u=(0,Y.useMemo)(()=>({img(e){return(0,X.jsx)(lW,{machine:i,projectId:a,file:o,src:e.src,alt:e.alt,width:e.width,height:e.height})}}),[i,a,o]);return(0,Y.useEffect)(()=>{if(n===null)return;let e=n.onDidScrollChange(e=>{let t=s.current;t!==null&&e.scrollTopChanged&&!t.matches(`:hover`)&&(t.scrollTop=e.scrollTop/(n.getScrollHeight()-n.getLayoutInfo().height)*(t.scrollHeight-t.clientHeight))});return()=>e.dispose()},[n]),(0,X.jsx)(`div`,{ref:s,className:ke(`border-sidebar-border bg-background min-w-0 flex-1 overflow-y-auto p-6`,n!==null&&`border-l`),onScroll:e=>{let t=e.currentTarget;n!==null&&t.matches(`:hover`)&&n.setScrollTop(t.scrollTop/(t.scrollHeight-t.clientHeight)*(n.getScrollHeight()-n.getLayoutInfo().height),Zl.ScrollType.Immediate)},onClickCapture:t=>{let n=(t.target instanceof Element?t.target.closest(`a`):null)?.getAttribute(`href`)??null;n===null||uW(n)||(t.preventDefault(),t.stopPropagation(),n.startsWith(`#`)?fW(t.currentTarget,n.slice(1))?.scrollIntoView():e.onOpen(dW(o,n)))},children:(0,X.jsx)(r,{text:l.replace(/^---\r?\n[\s\S]*?\r?\n---(\r?\n|$)/,``),components:u})})}function lW(e){let n=e.src??``,r=uW(n),[i,a]=(0,Y.useState)(void 0);return(0,Y.useEffect)(()=>{if(r)return;let i=!0;async function o(){try{let r=await t(e.machine,e.projectId,dW(e.file,n));i&&a(r)}catch{i&&a(void 0)}}return o(),()=>{i=!1}},[r,e.machine,e.projectId,e.file,n]),(0,X.jsx)(`img`,{src:r?n:i,alt:e.alt,width:e.width,height:e.height,className:`max-w-full`})}function uW(e){return/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}function dW(e,t){let n=e.split(`/`).map(encodeURIComponent).join(`/`),r=new URL(t,`file:///${n}`).pathname.slice(1);try{return decodeURIComponent(r)}catch{return r}}function fW(e,t){return[...e.querySelectorAll(`h1, h2, h3, h4, h5, h6`)].find(e=>pW(e.textContent)===t.toLowerCase())}function pW(e){return e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s_-]/gu,``).replaceAll(/\s/g,`-`)}function mW(e){return(0,X.jsx)(y,{open:e.open,onOpenChange:t=>{t||e.onCancel()},children:(0,X.jsxs)(oe,{children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(ye,{children:e.paths.length===1?`Do you want to save the changes you made to ${vp(e.paths[0])}?`:`Do you want to save the changes to the following ${e.paths.length} files?`}),(0,X.jsxs)(re,{children:[e.paths.length>1&&`${e.paths.map(vp).join(`, `)}. `,`Your changes will be lost if you don't save them.`]})]}),(0,X.jsxs)(te,{children:[(0,X.jsx)(de,{children:`Cancel`}),(0,X.jsx)(ee,{variant:`outline`,onClick:()=>e.onFinish(!1),children:`Don't Save`}),(0,X.jsx)(ee,{onClick:()=>e.onFinish(!0),children:e.paths.length===1?`Save`:`Save All`})]})]})})}function hW(e){let[t,n]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{let t=e.editor;if(t===null)return;n(gW(t));let r=[t.onDidChangeCursorSelection(()=>n(gW(t))),t.onDidChangeModel(()=>n(gW(t))),t.onDidChangeModelOptions(()=>n(gW(t)))];return()=>{for(let e of r)e.dispose()}},[e.editor]),(0,X.jsxs)(`div`,{className:`bg-sidebar border-sidebar-border text-muted-foreground flex h-[22px] shrink-0 items-center justify-end gap-4 border-t px-3 text-xs whitespace-nowrap`,children:[e.children,e.language!==null&&t!==null&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{children:[`Ln `,t.line,`, Col `,t.column,t.selected>0&&` (${t.selected} selected)`]}),(0,X.jsxs)(`span`,{children:[t.spaces?`Spaces`:`Tab Size`,`: `,t.tabSize]}),(0,X.jsx)(`span`,{children:`UTF-8`}),(0,X.jsx)(`span`,{children:t.eol}),(0,X.jsx)(`span`,{children:e.language})]})]})}function gW(e){let t=e.getModel(),n=e.getSelection();if(t===null||n===null)return null;let r=t.getOptions();return{line:n.positionLineNumber,column:n.positionColumn,selected:t.getValueLengthInRange(n),tabSize:r.tabSize,spaces:r.insertSpaces,eol:t.getEndOfLineSequence()===Zl.EndOfLineSequence.LF?`LF`:`CRLF`}}function _W(e){let t=vW(e.spec),n=t?.kind??null,r=(0,Y.useEffectEvent)(n=>{let r=e.spec,i=e.original,a=e.modified;if(r===void 0||t===null||i===null||a===null)throw Error(`This diff has no blocks to stage`);e.onPerform(()=>Me(e.machine,`git.run`,{projectId:e.projectId,repo:r.repo,action:{kind:`stageContent`,path:t.path,content:t.kind===`stage`?n.originalWithModifiedChanges:tW(i,a,n.mapping)}}))});(0,Y.useEffect)(()=>{if(n!==null)return eW(n,r)},[n])}function vW(e){return e?.left?.kind===`git`&&e.left.ref===``&&e.right.kind===`worktree`?{kind:`stage`,path:e.left.path}:e?.left?.kind===`git`&&e.right.kind===`git`&&e.right.ref===``?{kind:`unstage`,path:e.right.path}:null}function yW(){let[e,t]=(0,Y.useState)(null),[n,r]=(0,Y.useState)(null);return{editor:e,diff:n,codeHost:(0,Y.useCallback)(e=>{if(e===null)return;let n=Zl.create(e,{automaticLayout:!0,model:null});return t(n),()=>n.dispose()},[]),diffHost:(0,Y.useCallback)(e=>{if(e===null)return;let t=Zl.createDiffEditor(e,{automaticLayout:!0,originalEditable:!1,experimental:{showMoves:!0},useInlineViewWhenSpaceIsLimited:!0});return r(t),()=>t.dispose()},[])}}var bW={M:`Modified`,T:`Type Changed`,A:`Added`,D:`Deleted`,R:`Renamed`,C:`Copied`,U:`Untracked`,"!":`Conflict`},xW={M:`text-warning`,T:`text-warning`,A:`text-success`,D:`text-destructive`,R:`text-success`,C:`text-success`,U:`text-success`,"!":`text-destructive`};function SW(e,t){return e===``?t:`${e}/${t}`}function CW(e){return e.slice(0,7)}function wW(e,t,n){let r=SW(e,n.path),i={kind:`git`,ref:``,path:n.path};function a(t,n,i){return{id:`${t}:${r}`,repo:e,path:r,label:`${vp(r)} (${t})`,left:n,right:i}}return t===`merge`?a(`Working Tree`,null,{kind:`worktree`}):t===`staged`&&n.status===`A`?a(`Index`,null,i):t===`staged`&&n.status===`D`?a(`Deleted`,null,{kind:`git`,ref:`HEAD`,path:n.path}):t===`staged`?a(`Index`,{kind:`git`,ref:`HEAD`,path:n.from??n.path},i):n.status===`U`?a(`Untracked`,null,{kind:`worktree`}):n.status===`A`?a(`Intent to Add`,null,{kind:`worktree`}):n.status===`D`?a(`Deleted`,null,i):a(`Working Tree`,i,{kind:`worktree`})}function TW(e,t){return{id:`File:${t}`,repo:e,path:t,label:vp(t),left:null,right:{kind:`worktree`}}}function EW(e,t){return{...TW(e,t),id:`Preview:${t}`,label:`${vp(t)} (Preview)`,preview:!0}}function DW(e,t){let n=SW(e,t.path);return{id:`HEAD:${n}`,repo:e,path:n,label:`${vp(n)} (HEAD)`,left:null,right:{kind:`git`,ref:`HEAD`,path:t.from??t.path}}}function OW(e,t,n){let r=SW(e,n.path),i=t.parents.at(0)??null;return{id:`${t.hash}:${r}`,repo:e,path:r,label:`${vp(r)} (${i===null?`empty`:CW(i)} ↔ ${CW(t.hash)})`,left:i===null||n.status===`A`?{kind:`empty`}:{kind:`git`,ref:i,path:n.from??n.path},right:n.status===`D`?{kind:`empty`}:{kind:`git`,ref:t.hash,path:n.path}}}function kW(e,t){return[...e].sort((e,n)=>t===`name`?vp(e.path).localeCompare(vp(n.path))||e.path.localeCompare(n.path):t===`status`&&e.status.localeCompare(n.status)||e.path.localeCompare(n.path))}function AW(e,t){let n={folders:new Map,files:[]};for(let t of e){let e=n,r=_p(t.path);for(let t of r===``?[]:r.split(`/`)){let n=e.folders.get(t)??{folders:new Map,files:[]};e.folders.set(t,n),e=n}e.files.push(t)}return jW(n,``,t)}function jW(e,t,n){return[...[...e.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(e=>{let r=e[0],i=e[1];for(;i.files.length===0&&i.folders.size===1;){let e=[...i.folders][0];r=`${r}/${e[0]}`,i=e[1]}let a=t===``?r:`${t}/${r}`,o=jW(i,a,n);return{kind:`folder`,path:a,label:r,children:o,resources:o.flatMap(e=>e.kind===`file`?[e.resource]:e.resources)}}),...kW(e.files,n).map(e=>({kind:`file`,resource:e}))]}var MW=new WeakSet;function NW(e){let[t,n]=(0,Y.useState)(()=>e.saved.tabs.map(e=>({spec:e.spec,document:{status:`loading`}}))),[r,i]=(0,Y.useState)(e.saved.active),[a,o]=(0,Y.useState)(null),s=t.filter(e=>e.document.status===`text`&&e.document.dirty),c=a?.kind===`tab`?t.filter(e=>e.spec.id===a.id):s;(0,Y.useEffect)(()=>{let e=new Set(t.flatMap(e=>e.document.status===`text`?[e.document.modified,e.document.original]:[]));for(let t of Zl.getModels())e.has(t)||t.dispose()},[t]),(0,Y.useEffect)(()=>()=>{for(let e of Zl.getModels())e.dispose()},[]);async function l(t,n){if(n.kind===`empty`)return``;if(n.kind===`git`)return Me(e.machine,`git.show`,{projectId:e.projectId,repo:t.repo,ref:n.ref,path:n.path});let r=await Me(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return r.kind===`text`?r.content:null}function u(e){return Promise.all([e.left===null?``:l(e,e.left),l(e,e.right)])}function d(e,t){n(n=>n.map(n=>n.spec.id===e?{...n,document:t}:n))}async function f(t){try{if(t.left===null&&t.right.kind===`worktree`){let n=await Me(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return n.kind===`image`?{status:`image`,src:`data:${n.mediaType};base64,${n.data}`}:n.kind===`large`?{status:`large`,size:n.size,limit:n.limit}:n.kind===`binary`?{status:`binary`}:await p(t,``,n.content)}let n=await u(t);return n[0]===null||n[1]===null?{status:`binary`}:await p(t,n[0],n[1])}catch(e){return{status:`error`,message:Oe(e)}}}async function p(e,t,r){let i=await iW(e.path),a=e.left===null?null:Zl.createModel(t,i.id),o=Zl.createModel(r,i.id);return o.onDidChangeContent(()=>{MW.has(o)||n(e=>{let t=e.find(e=>e.document.status===`text`&&e.document.modified===o);if(t===void 0||t.document.status!==`text`)return e;let n=o.getAlternativeVersionId()!==t.document.saved;return t.document.dirty===n?e:e.map(e=>e===t?{...t,document:{...t.document,dirty:n}}:e)})}),{status:`text`,original:a,modified:o,language:i.name,saved:o.getAlternativeVersionId(),dirty:!1}}async function m(e){let r=t.find(t=>t.spec.id===e);if(r?.document.status!==`text`||r.document.dirty)return;let i=r.document,a=i.modified.getAlternativeVersionId();try{let t=await u(r.spec);if(i.modified.isDisposed()||i.modified.getAlternativeVersionId()!==a)return;if(t[0]===null||t[1]===null){d(e,{status:`binary`});return}i.original!==null&&PW(i.original,t[0]),MW.add(i.modified),PW(i.modified,t[1]),MW.delete(i.modified);let o=i.modified.getAlternativeVersionId();o!==a&&n(e=>e.map(e=>e.document.status===`text`&&e.document.modified===i.modified?{...e,document:{...e.document,saved:o}}:e))}catch(t){d(e,{status:`error`,message:Oe(t)})}}async function h(e){i(e.id),t.some(t=>t.spec.id===e.id)||(n([...t,{spec:e,document:{status:`loading`}}]),await g(e))}async function g(e){let t=await f(e);n(n=>n.map(n=>n.spec.id===e.id&&n.document.status===`loading`?{...n,document:t}:n))}async function _(r){let i=t.find(e=>e.spec.id===r);if(i?.document.status!==`text`||i.spec.right.kind!==`worktree`||i.spec.preview===!0)return!0;let a=i.document.modified,o=a.getAlternativeVersionId();try{await Me(e.machine,`files.write`,{projectId:e.projectId,path:i.spec.path,content:a.getValue()})}catch(e){return Ae(e),!1}return n(e=>e.map(e=>e.document.status===`text`&&e.document.modified===a?{...e,document:{...e.document,saved:o,dirty:a.getAlternativeVersionId()!==o}}:e)),e.onSaved(),!0}function v(e){let a=t.filter(t=>!e(t.spec));n(a);let o=t.findIndex(e=>e.spec.id===r);o!==-1&&e(t[o].spec)&&i(a.at(Math.min(o,a.length-1))?.spec.id??null)}function y(e,a){function o(t){return t===e?a:t.startsWith(`${e}/`)?`${a}${t.slice(e.length)}`:t}let s=t.map(e=>e.spec.id===TW(e.spec.repo,e.spec.path).id?{...e,spec:TW(e.spec.repo,o(e.spec.path))}:e.spec.id===EW(e.spec.repo,e.spec.path).id?{...e,spec:EW(e.spec.repo,o(e.spec.path))}:e);n(s);let c=t.findIndex(e=>e.spec.id===r);c!==-1&&i(s[c].spec.id)}function b(e){v(t=>t.right.kind===`worktree`&&(t.path===e||t.path.startsWith(`${e}/`)))}function ee(e){s.some(t=>t.spec.id===e)?o({kind:`tab`,id:e}):v(t=>t.id===e)}function te(){s.length>0?o({kind:`dialog`}):e.onClose()}async function ne(t){a!==null&&(o(null),t&&(await Promise.all(c.map(e=>_(e.spec.id)))).includes(!1)||(a.kind===`tab`&&v(e=>e.id===a.id),a.kind===`dialog`&&e.onClose()))}let re=(0,Y.useEffectEvent)(()=>{for(let t of e.saved.tabs)g(t.spec)});return(0,Y.useEffect)(()=>re(),[]),{tabs:t,active:r,setActive:i,dirty:s,closing:a,setClosing:o,closingTabs:c,open:h,reload:m,save:_,close:ee,renamed:y,deleted:b,requestClose:te,finish:ne}}function PW(e,t){let n=e.getValue(),r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r++;let i=0;for(;i<n.length-r&&i<t.length-r&&n[n.length-1-i]===t[t.length-1-i];)i++;(r!==n.length||r!==t.length)&&e.applyEdits([{range:gd.fromPositions(e.getPositionAt(r),e.getPositionAt(n.length-i)),text:t.slice(r,t.length-i)}])}function FW(e){return(0,X.jsxs)(o,{children:[(0,X.jsxs)(m,{className:`hover:bg-accent data-[state=open]:bg-accent mr-auto ml-1 flex h-6 min-w-0 cursor-pointer items-center gap-1 rounded-sm px-1 text-[11px] font-bold tracking-wide uppercase outline-none`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.view===`explorer`?`Explorer`:`Source Control`}),(0,X.jsx)(Se,{icon:se,className:`size-3.5 shrink-0`})]}),(0,X.jsx)(l,{align:`start`,className:`bg-popover! w-44`,children:(0,X.jsxs)(d,{value:e.view,onValueChange:t=>{(t===`explorer`||t===`scm`)&&e.onView(t)},children:[(0,X.jsx)(be,{value:`explorer`,children:`Explorer`}),(0,X.jsx)(be,{value:`scm`,children:`Source Control`})]})})]})}function IW(e){return(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 pl-1.5`,children:[(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`Open File`,"aria-label":`Open File`,onClick:e.onOpenFile,children:(0,X.jsx)(Se,{icon:Qf,className:`size-4`})}),(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`Previous Change`,"aria-label":`Previous Change`,onClick:e.onPrevious,children:(0,X.jsx)(Se,{icon:b,className:`size-4`})}),(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`Next Change`,"aria-label":`Next Change`,onClick:e.onNext,children:(0,X.jsx)(Se,{icon:fe,className:`size-4`})}),(0,X.jsxs)(o,{children:[(0,X.jsx)(m,{asChild:!0,children:(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,children:(0,X.jsx)(Se,{icon:le,className:`size-4`})})}),(0,X.jsxs)(l,{align:`end`,className:`bg-popover! w-80`,children:[(0,X.jsx)(s,{checked:e.settings.inline,onCheckedChange:t=>e.onSettings({inline:t}),children:`Inline View`}),(0,X.jsx)(s,{checked:e.settings.whitespace,onCheckedChange:t=>e.onSettings({whitespace:t}),children:`Show Leading/Trailing Whitespace Differences`}),(0,X.jsx)(s,{checked:e.settings.collapse,onCheckedChange:t=>e.onSettings({collapse:t}),children:`Collapse Unchanged Regions`})]})]})]})}function LW(e){let t=e.repo;return(0,X.jsxs)(`div`,{className:`mr-auto -ml-1.5 flex h-full items-center`,children:[(0,X.jsxs)(`button`,{type:`button`,title:`${t.branch??`HEAD`} (Git) - Checkout Branch/Tag...`,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onCheckout,children:[(0,X.jsx)(Se,{icon:ie,className:`size-3.5`}),t.branch??(t.head===null?`HEAD`:CW(t.head)),t.changes.length>0&&`*`,t.staged.length>0&&`+`,t.merge.length>0&&`!`]}),t.upstream!==null&&(0,X.jsxs)(`button`,{type:`button`,title:`Synchronize Changes`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onSync,children:[(0,X.jsx)(Se,{icon:rp,className:ke(`size-3.5`,e.busy&&`animate-spin`)}),(t.behind>0||t.ahead>0)&&`${t.behind}↓ ${t.ahead}↑`]}),t.upstream===null&&t.branch!==null&&t.remote&&(0,X.jsx)(`button`,{type:`button`,title:`Publish Branch`,"aria-label":`Publish Branch`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onPublish,children:(0,X.jsx)(Se,{icon:me,className:`size-3.5`})})]})}var RW={all:null,amend:!1,then:null};function zW(e){let t=e.repo,n=t.merge.length+t.staged.length+t.changes.length>0,r=!n&&t.branch!==null&&t.upstream===null&&t.remote,a=!n&&t.upstream!==null&&(t.ahead>0||t.behind>0);return(0,X.jsxs)(`div`,{className:ke(`grid gap-1.5 pt-1.5 pr-2 pb-1.5`,e.nested?`pl-4`:`pl-2`),children:[(0,X.jsxs)(`div`,{className:`bg-input/40 border-input focus-within:border-primary relative rounded-sm border`,children:[(0,X.jsx)(`textarea`,{rows:7,"aria-label":`Source Control Input`,value:e.message,placeholder:`Message (${De===`⌘`?`⌘Enter`:`Ctrl+Enter`} to commit on "${t.branch??(t.head===null?`HEAD`:CW(t.head))}")`,className:`placeholder:text-muted-foreground block w-full resize-none bg-transparent py-1 pr-7 pl-2 text-[13px] leading-[18px] outline-none`,onChange:t=>e.onMessage(t.target.value),onKeyDown:t=>{(t.metaKey||t.ctrlKey)&&t.key===`Enter`&&(t.preventDefault(),e.onCommit({...RW,then:`push`}))}}),(0,X.jsx)(`button`,{type:`button`,title:e.generating?`Cancel`:`Generate Commit Message`,"aria-label":e.generating?`Cancel`:`Generate Commit Message`,className:`text-muted-foreground hover:text-foreground hover:bg-accent absolute top-[3px] right-[3px] grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:e.generating?e.onCancel:e.onGenerate,children:(0,X.jsx)(Se,{icon:e.generating?ip:u,className:`size-3.5`})})]}),r&&(0,X.jsxs)(Ce,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.push`),children:[(0,X.jsx)(Se,{icon:me}),`Publish Branch`]}),a&&(0,X.jsxs)(Ce,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.sync`),children:[(0,X.jsx)(Se,{icon:rp}),`Sync Changes`,t.behind>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[t.behind,(0,X.jsx)(Se,{icon:fe,className:`size-3`})]}),t.ahead>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[t.ahead,(0,X.jsx)(Se,{icon:b,className:`size-3`})]})]}),!r&&!a&&(0,X.jsxs)(`div`,{className:`flex`,children:[(0,X.jsxs)(Ce,{size:`xs`,className:`flex-1 rounded-sm rounded-r-none`,disabled:!n||e.busy,onClick:()=>e.onCommit({...RW,then:`push`}),children:[(0,X.jsx)(Se,{icon:ve}),`Commit & Push`]}),(0,X.jsxs)(o,{children:[(0,X.jsx)(m,{asChild:!0,children:(0,X.jsx)(Ce,{size:`xs`,className:`rounded-sm rounded-l-none px-1 before:absolute before:inset-y-1 before:-left-px before:w-px before:bg-white/10`,disabled:!n||e.busy,title:`More Actions...`,"aria-label":`More Commit Actions`,children:(0,X.jsx)(Se,{icon:se})})}),(0,X.jsxs)(l,{align:`end`,className:`bg-popover! w-48`,children:[(0,X.jsx)(i,{onSelect:()=>e.onCommit(RW),children:`Commit`}),(0,X.jsx)(i,{onSelect:()=>e.onCommit({...RW,amend:!0}),children:`Commit (Amend)`}),(0,X.jsx)(i,{onSelect:()=>e.onCommit({...RW,then:`push`}),children:`Commit & Push`}),(0,X.jsx)(i,{onSelect:()=>e.onCommit({...RW,then:`sync`}),children:`Commit & Sync`})]})]})]})]})}var BW=[{id:`merge`,title:`Merge Changes`},{id:`staged`,title:`Staged Changes`},{id:`changes`,title:`Changes`}];function VW(e){let[t,n]=(0,Y.useState)([]),[r,i]=(0,Y.useState)(null),a=c(),o=e.repo;function s(e){n(t.includes(e)?t.filter(t=>t!==e):[...t,e])}function l(t,n,r){let i=r===`group`?`All Changes`:`Changes`;return(0,X.jsxs)(X.Fragment,{children:[r===`file`&&n[0].status!==`D`&&(0,X.jsx)(UW,{title:`Open File`,icon:Qf,onClick:()=>e.onOpen(TW(o.path,SW(o.path,n[0].path)))}),t===`changes`&&(0,X.jsx)(UW,{title:`Discard ${i}`,icon:op,onClick:()=>e.onDiscard(n)}),t===`staged`&&(0,X.jsx)(UW,{title:`Unstage ${i}`,icon:Jf,onClick:()=>e.onUnstage(n)}),t!==`staged`&&(0,X.jsx)(UW,{title:t===`merge`&&r===`group`?`Stage All Merge Changes`:`Stage ${i}`,icon:Yf,onClick:()=>e.onStage(n)})]})}function u(t,n,r){let a=wW(o.path,t,n),s=SW(o.path,n.path);return(0,X.jsxs)(`div`,{"data-resource":!0,role:`button`,tabIndex:0,title:`${e.root}/${s} • ${bW[n.status]}`,className:ke(`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,a.id===e.active&&`bg-sidebar-row-active`),style:{paddingLeft:20+r*8},onClick:()=>e.onOpen(a),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(a)},onContextMenu:()=>i({group:t,resource:n}),children:[(0,X.jsx)(We,{path:n.path}),(0,X.jsx)(`span`,{className:ke(`min-w-0 shrink-0 truncate`,xW[n.status],n.status===`D`&&`line-through`),children:vp(n.path)}),!e.tree&&(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:_p(n.path)}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(t,[n],`file`)}),(0,X.jsx)(`span`,{className:ke(`w-3.5 text-center text-xs`,xW[n.status]),children:n.status})]})]},`${t}:${n.path}`)}function d(e,n,r){return n.map(n=>{if(n.kind===`file`)return u(e,n.resource,r);let i=`${o.path}:${e}:${n.path}`,a=!t.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:n.path,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+r*8},onClick:()=>s(i),onKeyDown:e=>{e.key===`Enter`&&s(i)},children:[(0,X.jsx)(HW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.label}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(e,n.resources,`folder`)})]}),a&&d(e,n.children,r+1)]},i)})}return(0,X.jsxs)(he,{children:[(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(`div`,{onContextMenu:e=>{e.target instanceof Element&&e.target.closest(`[data-resource]`)!==null||e.preventDefault()},children:BW.map(n=>{let r=o[n.id];if(r.length===0)return null;let i=`${o.path}:${n.id}`,a=!t.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+e.depth*8},onClick:()=>s(i),onKeyDown:e=>{e.key===`Enter`&&s(i)},children:[(0,X.jsx)(HW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.title}),(0,X.jsx)(`span`,{className:`hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(n.id,r,`group`)}),(0,X.jsx)(`span`,{className:`bg-muted text-foreground grid h-4.5 min-w-4.5 shrink-0 place-items-center rounded-full px-1 text-[11px] tabular-nums`,children:r.length})]}),a&&(e.tree?d(n.id,AW(r,e.sort),e.depth+1):kW(r,e.sort).map(t=>u(n.id,t,e.depth+1)))]},n.id)})})}),r!==null&&(0,X.jsxs)(ce,{className:`min-w-52`,children:[(0,X.jsx)(pe,{onSelect:()=>e.onOpen(wW(o.path,r.group,r.resource)),children:`Open Changes`}),r.resource.status!==`D`&&(0,X.jsx)(pe,{onSelect:()=>e.onOpen(TW(o.path,SW(o.path,r.resource.path))),children:`Open File`}),r.resource.status!==`U`&&r.resource.status!==`A`&&(0,X.jsx)(pe,{onSelect:()=>e.onOpen(DW(o.path,r.resource)),children:`Open File (HEAD)`}),(0,X.jsx)(ue,{}),r.group===`staged`&&(0,X.jsx)(pe,{onSelect:()=>e.onUnstage([r.resource]),children:`Unstage Changes`}),r.group!==`staged`&&(0,X.jsx)(pe,{onSelect:()=>e.onStage([r.resource]),children:`Stage Changes`}),r.group===`changes`&&(0,X.jsx)(pe,{onSelect:()=>e.onDiscard([r.resource]),children:`Discard Changes`}),r.resource.status===`U`&&(0,X.jsx)(pe,{onSelect:()=>e.onIgnore([r.resource]),children:`Add to .gitignore`}),(0,X.jsx)(ue,{}),(0,X.jsx)(pe,{onSelect:()=>void a.copy(`${e.root}/${SW(o.path,r.resource.path)}`),children:`Copy Path`}),(0,X.jsx)(pe,{onSelect:()=>void a.copy(SW(o.path,r.resource.path)),children:`Copy Relative Path`})]})]})}function HW(e){return(0,X.jsx)(Se,{icon:Be,"aria-hidden":!0,className:ke(`text-muted-foreground size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)})}function UW(e){return(0,X.jsx)(`button`,{type:`button`,title:e.title,"aria-label":e.title,className:`text-foreground hover:bg-accent grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:t=>{t.stopPropagation(),e.onClick()},children:(0,X.jsx)(Se,{icon:e.icon,className:`size-4`})})}var WW=50,GW=11,KW=22,qW=[`#59A4F9`,`#FFB000`,`#DC267F`,`#994F00`,`#40B0A6`,`#B66DFF`];function JW(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(WW),[l,u]=(0,Y.useState)(0),[d,f]=(0,Y.useState)([]),[p,m]=(0,Y.useState)({}),h=e.repos.find(e=>e.path===t)??e.repos.at(0),g=h?.path??null,_=h?.head??null,v=h?.upstream??null,y=h?.behind??0;(0,Y.useEffect)(()=>{if(g===null||_===null){i([]);return}let t=!0;return Me(e.machine,`git.history`,{projectId:e.projectId,repo:g,limit:s}).then(e=>{t&&(i(e),o(null))},e=>{t&&o(Oe(e))}),()=>{t=!1}},[e.machine,e.projectId,g,_,v,y,s,l]);async function b(t){if(d.includes(t.hash))f(d.filter(e=>e!==t.hash));else if(f([...d,t.hash]),h!==void 0&&p[t.hash]===void 0)try{let n=await Me(e.machine,`git.commitFiles`,{projectId:e.projectId,repo:h.path,hash:t.hash,parent:t.parents.at(0)??null});m(e=>({...e,[t.hash]:n}))}catch(e){Ae(e)}}let ee=$W(r??[]);return(0,X.jsxs)(`div`,{className:ke(`border-sidebar-border relative flex shrink-0 flex-col border-t`,e.open&&`min-h-20`),style:e.open?{height:e.height}:void 0,children:[e.open&&(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,className:`hover:bg-primary absolute inset-x-0 -top-0.5 z-10 h-1 cursor-row-resize touch-none transition-colors delay-100`,onPointerDown:t=>{let n=t.currentTarget.parentElement?.parentElement;if(n==null)return;let r=n.getBoundingClientRect();Ee(t,t=>e.onHeight(Math.min(Math.max(r.bottom-t.clientY,80),r.height-120)))}}),(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row text-sidebar-foreground flex h-[22px] shrink-0 cursor-pointer items-center gap-0.5 pr-2 pl-0.5 outline-none select-none`,onClick:e.onToggle,onKeyDown:t=>{t.key===`Enter`&&e.onToggle()},children:[(0,X.jsx)(Se,{icon:Be,"aria-hidden":!0,className:ke(`size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-bold tracking-wide uppercase`,children:`Graph`}),e.repos.length>1&&(0,X.jsx)(`select`,{"aria-label":`Repository`,value:h?.path??``,className:`bg-sidebar text-muted-foreground max-w-28 cursor-pointer truncate text-xs outline-none`,onClick:e=>e.stopPropagation(),onChange:e=>{n(e.target.value),f([]),c(WW)},children:e.repos.map(e=>(0,X.jsx)(`option`,{value:e.path,children:e.path===``?`.`:e.path},e.path))}),e.open&&h!==void 0&&(0,X.jsxs)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex`,children:[(0,X.jsx)(UW,{title:`Fetch From All Remotes`,icon:Xf,onClick:()=>e.onFetch(h)}),(0,X.jsx)(UW,{title:`Refresh`,icon:ze,onClick:()=>u(l+1)})]})]}),e.open&&(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[a!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:a}),a===null&&ee.length===0&&r!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:`No commits yet.`}),a===null&&h!==void 0&&ee.map(t=>{let n=t.commit,r=d.includes(n.hash);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${n.author}, ${new Date(n.date).toLocaleString()}\n\n${n.subject}\n\n${CW(n.hash)}`,className:`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,onClick:()=>void b(n),onKeyDown:e=>{e.key===`Enter`&&b(n)},children:[(0,X.jsx)(YW,{row:t,child:!1}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.subject}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 shrink-[2] truncate text-xs`,children:n.author}),(0,X.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:n.refs.map(e=>XW(e,h))})]}),r&&(p[n.hash]??[]).map(r=>{let i=OW(h.path,n,r);return(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${r.path} • ${bW[r.status]}`,className:ke(`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,i.id===e.active&&`bg-sidebar-row-active`),onClick:()=>e.onOpen(i),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(i)},children:[(0,X.jsx)(YW,{row:t,child:!0}),(0,X.jsx)(We,{path:r.path}),(0,X.jsx)(`span`,{className:ke(`min-w-0 shrink-0 truncate`,xW[r.status],r.status===`D`&&`line-through`),children:vp(r.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:_p(r.path)}),(0,X.jsx)(`span`,{className:ke(`ml-auto w-3.5 shrink-0 text-center text-xs`,xW[r.status]),children:r.status})]},r.path)})]},n.hash)}),r!==null&&r.length===s&&(0,X.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground w-full cursor-pointer px-4 py-1 text-left text-xs`,onClick:()=>c(s+WW),children:`Load More…`})]})]})}function YW(e){let t=e.row,n=KW/2,r=ZW(t.lane);return e.child?(0,X.jsx)(`svg`,{"aria-hidden":!0,width:GW*(t.width+1),height:KW,className:`shrink-0`,children:t.after.map(e=>(0,X.jsx)(`line`,{x1:ZW(e),x2:ZW(e),y1:0,y2:KW,stroke:QW(e),strokeWidth:1},e))}):(0,X.jsxs)(`svg`,{"aria-hidden":!0,width:GW*(t.width+1),height:KW,className:`shrink-0`,children:[t.through.map(e=>(0,X.jsx)(`line`,{x1:ZW(e),x2:ZW(e),y1:0,y2:KW,stroke:QW(e),strokeWidth:1},`through-${e}`)),t.up.map(e=>(0,X.jsx)(`path`,{d:`M ${ZW(e)} 0 Q ${ZW(e)} ${n} ${r} ${n}`,fill:`none`,stroke:QW(e),strokeWidth:1},`up-${e}`)),t.down.map(e=>(0,X.jsx)(`path`,{d:`M ${r} ${n} Q ${ZW(e)} ${n} ${ZW(e)} ${KW}`,fill:`none`,stroke:QW(e),strokeWidth:1},`down-${e}`)),(0,X.jsx)(`circle`,{cx:r,cy:n,r:t.commit.parents.length>1?3.5:4,fill:t.commit.parents.length>1?`var(--sidebar)`:QW(t.lane),stroke:QW(t.lane),strokeWidth:t.commit.parents.length>1?2:0})]})}function XW(e,t){if(e.endsWith(`/HEAD`))return null;let n=e===`HEAD`||e.startsWith(`HEAD -> `),r=e.startsWith(`tag: `),i=e===t.upstream,a=e.replace(/^HEAD -> /,``).replace(/^tag: /,``);return(0,X.jsxs)(`span`,{title:a,className:ke(`inline-flex h-4 max-w-32 items-center gap-0.5 rounded-full px-1.5 text-[11px] font-medium`,n&&`text-background bg-[#59A4F9]`,i&&`text-background bg-[#B180D7]`,!n&&!i&&`bg-muted text-foreground`),children:[(0,X.jsx)(Se,{icon:r?ap:i?v:ie,className:`size-3 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:a})]},e)}function ZW(e){return GW*(e+1)}function QW(e){return qW[e%qW.length]}function $W(e){let t=[];return e.map(e=>{let n=t,r=n.indexOf(e.hash),i=n.indexOf(null),a=r===-1?i===-1?n.length:i:r,o=n.map(t=>t===e.hash?null:t);o[a]=e.parents.at(0)??null;let s=e.parents.length>0?[a]:[];for(let t of e.parents.slice(1)){let e=o.indexOf(t);if(e!==-1){s.push(e);continue}let n=o.indexOf(null),r=n===-1?o.length:n;o[r]=t,s.push(r)}for(;o.length>0&&o.at(-1)===null;)o.pop();return t=o,{commit:e,lane:a,up:n.flatMap((t,n)=>t===e.hash?[n]:[]),through:n.flatMap((t,n)=>t!==null&&t!==e.hash?[n]:[]),down:s,after:o.flatMap((e,t)=>e===null?[]:[t]),width:Math.max(n.length,o.length,a+1)}})}function eG(e){let t=e.repo;function r(t,n){return(0,X.jsx)(i,{onSelect:()=>e.onCommit({...RW,...n}),children:t})}return(0,X.jsxs)(o,{children:[(0,X.jsx)(m,{asChild:!0,children:(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(Se,{icon:le,className:`size-4`})})}),(0,X.jsxs)(l,{align:`end`,className:`bg-popover! w-56`,children:[(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`View & Sort`}),(0,X.jsxs)(a,{className:`w-44`,children:[(0,X.jsxs)(d,{value:e.settings.tree?`tree`:`list`,onValueChange:t=>e.onSettings({tree:t===`tree`}),children:[(0,X.jsx)(be,{value:`list`,children:`View as List`}),(0,X.jsx)(be,{value:`tree`,children:`View as Tree`})]}),(0,X.jsx)(n,{}),(0,X.jsxs)(d,{value:e.settings.sort,onValueChange:t=>{(t===`name`||t===`path`||t===`status`)&&e.onSettings({sort:t})},children:[(0,X.jsx)(be,{value:`name`,children:`Sort by Name`}),(0,X.jsx)(be,{value:`path`,children:`Sort by Path`}),(0,X.jsx)(be,{value:`status`,children:`Sort by Status`})]})]})]}),(0,X.jsx)(n,{}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(i,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(i,{onSelect:e.onCheckout,children:`Checkout to...`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(n,{}),(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`Commit`}),(0,X.jsxs)(a,{className:`w-52`,children:[r(`Commit`,{}),r(`Commit Staged`,{all:!1}),r(`Commit All`,{all:!0}),(0,X.jsx)(i,{disabled:t.head===null,onSelect:e.onUndo,children:`Undo Last Commit`}),(0,X.jsx)(n,{}),r(`Commit (Amend)`,{amend:!0}),r(`Commit Staged (Amend)`,{all:!1,amend:!0}),r(`Commit All (Amend)`,{all:!0,amend:!0})]})]}),(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`Changes`}),(0,X.jsxs)(a,{className:`w-52`,children:[(0,X.jsx)(i,{onSelect:()=>e.onStage([...t.merge,...t.changes]),children:`Stage All Changes`}),(0,X.jsx)(i,{onSelect:()=>e.onUnstage(t.staged),children:`Unstage All Changes`}),(0,X.jsx)(i,{disabled:t.changes.length===0,onSelect:()=>e.onDiscard(t.changes),children:`Discard All Changes`})]})]}),(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`Pull, Push`}),(0,X.jsxs)(a,{className:`w-52`,children:[(0,X.jsx)(i,{onSelect:()=>e.onRemote(`git.sync`),children:`Sync`}),(0,X.jsx)(n,{}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`pull`,rebase:!0}),children:`Pull (Rebase)`}),(0,X.jsx)(n,{}),(0,X.jsx)(i,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(n,{}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`fetch`,prune:!0,all:!1}),children:`Fetch (Prune)`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!0}),children:`Fetch From All Remotes`})]})]}),(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`Branch`}),(0,X.jsxs)(a,{className:`w-52`,children:[(0,X.jsx)(i,{onSelect:e.onCheckout,children:`Create Branch...`}),(0,X.jsx)(i,{disabled:t.branch===null||t.upstream!==null,onSelect:()=>e.onRemote(`git.push`),children:`Publish Branch...`})]})]}),(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`Stash`}),(0,X.jsxs)(a,{className:`w-56`,children:[(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`stash`,mode:`tracked`}),children:`Stash`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`stash`,mode:`untracked`}),children:`Stash (Include Untracked)`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`stash`,mode:`staged`}),children:`Stash Staged`}),(0,X.jsx)(n,{}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`unstash`,pop:!1}),children:`Apply Latest Stash`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`unstash`,pop:!0}),children:`Pop Latest Stash`})]})]})]})]})}function tG(e){let[t,n]=(0,Y.useState)([]),r=(0,Y.useRef)(new Map),[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=e.repos??[],l=c.length===1?c[0]:null,u=e.settings,d=Fe(e=>e.prefs);function f(e){return u.messages[e.path]??``}function p(t,n){return e.onPerform(()=>Me(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:n}))}function m(t,n){return e.onPerform(()=>Me(e.machine,n,{projectId:e.projectId,repo:t.path}))}async function g(t,n){let r=f(t).trim();if(r===``&&!n.amend){Ae(`Please provide a commit message.`);return}let i=t.changes.length+t.merge.length>0;if(n.all===null&&!n.amend&&t.staged.length===0){if(!i){Ae(`There are no changes to commit.`);return}if(!u.smartCommit){a({repo:t,options:n});return}}let o=n.all??(t.staged.length===0&&!n.amend&&i);await e.onPerform(async()=>{await Me(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:{kind:`commit`,message:r,all:o,amend:n.amend}}),e.onMessage(t.path,``),n.then!==null&&await Me(e.machine,n.then===`push`?`git.push`:`git.sync`,{projectId:e.projectId,repo:t.path})})}async function _(t){let i={};r.current.set(t.path,i),n(e=>[...e,t.path]);try{let n=await Me(e.machine,`git.message`,{projectId:e.projectId,repo:t.path,staged:t.staged.length>0});r.current.get(t.path)===i&&e.onMessage(t.path,n)}catch(e){r.current.get(t.path)===i&&Ae(e)}finally{r.current.get(t.path)===i&&v(t)}}function v(e){r.current.delete(e.path),n(t=>t.filter(t=>t!==e.path))}function b(t){e.onPerform(async()=>{e.onMessage(t.path,await Me(e.machine,`git.undoCommit`,{projectId:e.projectId,repo:t.path}))})}function ne(e,t){p(e,{kind:`unstage`,paths:t.flatMap(e=>e.from===null?[e.path]:[e.path,e.from])})}function ie(e,t){p(e,{kind:`stage`,paths:t.map(e=>e.path)})}function ae(t){return(0,X.jsx)(eG,{repo:t,settings:u,onSettings:e.onSettings,onCommit:e=>void g(t,e),onUndo:()=>b(t),onRun:e=>void p(t,e),onRemote:e=>void m(t,e),onStage:e=>ie(t,e),onUnstage:e=>ne(t,e),onDiscard:e=>s({repo:t,resources:e}),onCheckout:()=>e.onCheckout(t)})}let se=o?.resources??[],ce=se.filter(e=>e.status===`U`);return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border relative flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:u.tree?`View as List`:`View as Tree`,"aria-label":u.tree?`View as List`:`View as Tree`,onClick:()=>e.onSettings({tree:!u.tree}),children:(0,X.jsx)(Se,{icon:u.tree?np:tp,className:`size-4`})}),l!==null&&(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`Commit`,"aria-label":`Commit`,disabled:e.busy,onClick:()=>void g(l,RW),children:(0,X.jsx)(Se,{icon:ve,className:`size-4`})}),(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`Refresh`,"aria-label":`Refresh`,onClick:e.onRefresh,children:(0,X.jsx)(Se,{icon:ze,className:`size-4`})}),l!==null&&ae(l),(e.busy||t.length>0)&&(0,X.jsx)(`span`,{className:`absolute inset-x-0 -bottom-px h-0.5 overflow-hidden`,children:(0,X.jsx)(`span`,{className:`bg-primary block h-full w-[2%] animate-[progress_4s_linear_infinite]`})})]}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[e.error!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:e.error}),e.error===null&&e.repos===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),e.error===null&&e.repos?.length===0&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`The folder currently open doesn't have a git repository.`}),c.map(n=>(0,X.jsxs)(`div`,{children:[l===null&&(0,X.jsxs)(`div`,{className:`group/row text-sidebar-foreground flex h-[22px] items-center gap-1.5 pr-1 pl-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`truncate font-semibold`,children:n.path===``?e.name:vp(n.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,children:n.branch??(n.head===null?``:CW(n.head))}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex`,children:(0,X.jsx)(UW,{title:`Commit`,icon:ve,onClick:()=>void g(n,RW)})}),ae(n)]}),(0,X.jsx)(zW,{repo:n,message:f(n),generating:t.includes(n.path),busy:e.busy,nested:l===null,onMessage:t=>e.onMessage(n.path,t),onGenerate:()=>void _(n),onCancel:()=>v(n),onCommit:e=>void g(n,e),onRemote:e=>void m(n,e)}),(0,X.jsx)(VW,{repo:n,root:e.root,tree:u.tree,sort:u.sort,depth:+(l===null),active:e.active,onOpen:e.onOpen,onStage:e=>ie(n,e),onUnstage:e=>ne(n,e),onDiscard:e=>s({repo:n,resources:e}),onIgnore:e=>void p(n,{kind:`ignore`,paths:e.map(e=>e.path)})})]},n.path))]}),c.length>0&&(0,X.jsx)(JW,{machine:e.machine,projectId:e.projectId,repos:c,open:d.editor.graph,height:u.graphHeight,active:e.active,onToggle:()=>Pe({...d,editor:{...d.editor,graph:!d.editor.graph}}),onHeight:t=>e.onSettings({graphHeight:t}),onOpen:e.onOpen,onFetch:e=>void p(e,{kind:`fetch`,prune:!1,all:!0})}),(0,X.jsx)(y,{open:i!==null,onOpenChange:e=>{e||a(null)},children:(0,X.jsxs)(oe,{children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(ye,{children:`There are no staged changes to commit.`}),(0,X.jsx)(re,{children:`Would you like to stage all your changes and commit them directly?`})]}),(0,X.jsxs)(te,{children:[(0,X.jsx)(de,{children:`Cancel`}),(0,X.jsx)(ee,{variant:`outline`,onClick:()=>{i!==null&&(e.onSettings({smartCommit:!0}),g(i.repo,{...i.options,all:!0}))},children:`Always`}),(0,X.jsx)(ee,{onClick:()=>{i!==null&&g(i.repo,{...i.options,all:!0})},children:`Yes`})]})]})}),(0,X.jsx)(y,{open:o!==null,onOpenChange:e=>{e||s(null)},children:(0,X.jsxs)(oe,{children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(ye,{children:se.length>1?`Are you sure you want to discard ALL changes in ${se.length} files?`:ce.length===1?`Are you sure you want to DELETE the following untracked file: '${vp(se[0].path)}'?`:`Are you sure you want to discard changes in '${vp(se.at(0)?.path??``)}'?`}),(0,X.jsxs)(re,{children:[se.length>1&&`This is IRREVERSIBLE! Your current working set will be FOREVER LOST if you proceed.`,se.length===1&&ce.length===1&&`This is IRREVERSIBLE! This file will be FOREVER LOST if you proceed.`]})]}),(0,X.jsxs)(te,{children:[(0,X.jsx)(de,{children:`Cancel`}),(0,X.jsx)(ee,{variant:`destructive`,onClick:()=>{o!==null&&p(o.repo,{kind:`discard`,tracked:se.filter(e=>e.status!==`U`).map(e=>e.path),untracked:ce.map(e=>e.path)})},children:se.length>1?`Discard All ${se.length} Files`:ce.length===1?`Delete File`:`Discard File`})]})]})})]})}var nG=3e3;function rG(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),a=(0,Y.useEffectEvent)(e.onLoaded);return(0,Y.useEffect)(()=>{let t=!0,r=!1;async function o(){if(!r){r=!0;try{let r=await Me(e.machine,`git.changes`,{projectId:e.projectId});if(!t)return;i(null),n(e=>Ie(e,r)?e:r),a()}catch(e){t&&i(Oe(e))}finally{r=!1}}}function s(){document.hidden||o()}o();let c=window.setInterval(s,nG);return window.addEventListener(`focus`,s),()=>{t=!1,window.clearInterval(c),window.removeEventListener(`focus`,s)}},[e.machine,e.projectId,e.version]),{repos:t,error:r}}var iG=(0,Y.lazy)(async()=>({default:(await J(async()=>{let{ZoomableImage:e}=await import(`./zoomable-image-DkYN4OSU.js`);return{ZoomableImage:e}},__vite__mapDeps([16,17,2,18,19,20,21,22]))).ZoomableImage}));function aG(e){let t=Fe(t=>Le(t,e.machine,e.projectId)),n=Ne(),r=Fe(e=>e.prefs.editor),[i]=(0,Y.useState)(()=>fp(e.machine,e.projectId)),[a]=(0,Y.useState)(()=>new Map(i.tabs.map(e=>[e.spec.id,e.view]))),[o,s]=(0,Y.useState)(()=>({...i.settings,width:Math.min(i.settings.width,window.innerWidth*.6)})),[c,l]=(0,Y.useState)(i.expanded),[u,d]=(0,Y.useState)(0),[f,p]=(0,Y.useState)(0),[m,h]=(0,Y.useState)(null),g=yW(),v=g.editor,y=g.diff,b=(0,Y.useRef)(null),ee=(0,Y.useCallback)(()=>d(e=>e+1),[]),te=NW({machine:e.machine,projectId:e.projectId,saved:i,onSaved:ee,onClose:()=>{ye(),e.onClose()}}),ne=te.active;function re(){ne!==null&&te.reload(ne)}let ie=rG({machine:e.machine,projectId:e.projectId,version:u,onLoaded:re}),ae=ie.repos,oe=te.tabs.find(e=>e.spec.id===ne),se=oe?.document.status===`text`&&oe.spec.preview!==!0?oe.document:null,ce=oe?.document.status===`text`&&oe.spec.preview===!0?oe.document.modified:null,le=se?.original??null,ue=se?.modified??null,de=oe?.spec.right.kind===`worktree`,fe=ae?.find(e=>e.path===oe?.spec.repo)??ae?.at(0)??null,pe=le===null&&ue?.getLanguageId()===`markdown`?ue:null;(0,Y.useEffect)(()=>{aW().catch(Ae)},[n]),(0,Y.useEffect)(()=>{v?.updateOptions(oW(r)),y?.updateOptions(oW(r)),sW(r).catch(Ae)},[v,y,r]),(0,Y.useEffect)(()=>{y?.updateOptions({renderSideBySide:!o.inline,ignoreTrimWhitespace:!o.whitespace,hideUnchangedRegions:{enabled:o.collapse}})},[y,o.inline,o.whitespace,o.collapse]),(0,Y.useEffect)(()=>{if(v===null||y===null||(b.current!==null&&a.set(b.current.id,b.current.editor.saveViewState()),b.current=null,v.setModel(le===null?ue:null),y.setModel(le===null||ue===null?null:{original:le,modified:ue}),ue===null||ne===null))return;let e=le===null?v:y.getModifiedEditor();e.updateOptions({readOnly:!de}),y.updateOptions({readOnly:!de}),e.restoreViewState(a.get(ne)??null),e.focus(),b.current={id:ne,editor:e}},[v,y,le,ue,ne,de,a]);let me=(0,Y.useEffectEvent)(re);(0,Y.useEffect)(()=>me(),[ne]),_W({machine:e.machine,projectId:e.projectId,spec:oe?.spec,original:le,modified:ue,onPerform:_e});function he(e){window.innerWidth<640&&ve({sidebar:!1}),te.open(e)}async function _e(e){p(e=>e+1);try{await e()}catch(e){Ae(e)}finally{p(e=>e-1),ee()}}function ve(e){s(t=>({...t,...e}))}function ye(){b.current!==null&&a.set(b.current.id,b.current.editor.saveViewState()),pp(e.machine,e.projectId,{tabs:te.tabs.map(e=>({spec:e.spec,view:a.get(e.spec.id)??null})),active:ne,expanded:c,settings:o})}(0,Y.useEffect)(ye);let be=(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,title:`Toggle Primary Side Bar`,"aria-label":`Toggle Primary Side Bar`,"aria-pressed":o.sidebar,onClick:()=>ve({sidebar:!o.sidebar}),children:(0,X.jsx)(Se,{icon:ge,className:`size-4`})}),we=(0,X.jsxs)(X.Fragment,{children:[be,(0,X.jsx)(FW,{view:o.view,onView:e=>ve({view:e})})]});return(0,X.jsx)(Ue,{open:!0,onOpenChange:()=>te.requestClose(),children:(0,X.jsxs)(Ve,{"aria-describedby":void 0,showCloseButton:!1,className:`top-0 left-0 flex h-dvh w-dvw max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none border-0 p-0 sm:max-w-none`,onEscapeKeyDown:e=>e.preventDefault(),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),ne!==null&&te.save(ne)),(e.metaKey||e.ctrlKey)&&e.key===`w`&&(e.preventDefault(),ne!==null&&te.close(ne)),(e.metaKey||e.ctrlKey)&&e.shiftKey&&e.key.toLowerCase()===`v`&&pe!==null&&(e.preventDefault(),ve({preview:!o.preview}))},children:[(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:ke(`border-sidebar-border relative shrink-0 border-r`,!o.sidebar&&`hidden`),style:{width:o.width},children:[o.view===`explorer`&&(0,X.jsx)(hp,{machine:e.machine,projectId:e.projectId,root:t?.path??``,header:we,expanded:c,onExpanded:l,active:oe?.spec.path??null,onOpen:e=>he(TW(``,e)),onPreview:e=>he(EW(``,e)),onRenamed:te.renamed,onDeleted:te.deleted}),o.view===`scm`&&(0,X.jsx)(tG,{machine:e.machine,projectId:e.projectId,name:t?.name??``,root:t?.path??``,header:we,repos:ae,error:ie.error,busy:f>0,settings:o,onSettings:ve,onMessage:(e,t)=>s(n=>({...n,messages:{...n.messages,[e]:t}})),active:ne,onOpen:he,onRefresh:ee,onPerform:_e,onCheckout:h}),(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:`hover:bg-primary absolute inset-y-0 -right-0.5 z-10 w-1 cursor-col-resize touch-none transition-colors delay-100`,onPointerDown:e=>Ee(e,e=>ve({width:Math.min(Math.max(e.clientX,200),window.innerWidth-240)}))})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-9 shrink-0 items-center shadow-[inset_0_-1px_0_var(--sidebar-border)]`,children:[!o.sidebar&&(0,X.jsx)(`div`,{className:`shrink-0 px-1.5`,children:be}),(0,X.jsx)(He,{className:`sr-only`,children:`Editor`}),(0,X.jsx)(yp,{tabs:te.tabs.map(e=>({id:e.spec.id,path:e.spec.path,label:e.spec.label})),active:ne,dirty:te.dirty.map(e=>e.spec.id),onSelect:te.setActive,onClose:te.close}),oe!==void 0&&le!==null&&(0,X.jsx)(IW,{settings:o,onSettings:ve,onOpenFile:()=>he(TW(oe.spec.repo,oe.spec.path)),onPrevious:()=>y?.goToDiff(`previous`),onNext:()=>y?.goToDiff(`next`)}),pe!==null&&(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,className:`ml-1.5 shrink-0`,title:`Toggle Preview`,"aria-label":`Toggle Preview`,"aria-pressed":o.preview,onClick:()=>ve({preview:!o.preview}),children:(0,X.jsx)(Se,{icon:sp,className:`size-4`})}),(0,X.jsx)(Ce,{size:`icon-micro`,variant:`ghost`,className:`mx-1.5 shrink-0`,title:`Close`,"aria-label":`Close`,onClick:te.requestClose,children:(0,X.jsx)(Se,{icon:xe,className:`size-4`})})]}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:ke(`relative min-w-0 flex-1`,pe!==null&&o.preview&&`max-sm:hidden`,ce!==null&&`hidden`),children:[(0,X.jsx)(`div`,{ref:g.codeHost,className:ke(`absolute inset-0`,(ue===null||le!==null)&&`hidden`)}),(0,X.jsx)(`div`,{ref:g.diffHost,className:ke(`absolute inset-0`,(ue===null||le===null)&&`hidden`)}),oe?.document.status===`image`&&(0,X.jsx)(Y.Suspense,{children:(0,X.jsx)(iG,{src:oe.document.src,alt:oe.spec.path})}),(0,X.jsx)(cp,{document:oe?.document,view:o.view})]}),pe!==null&&o.preview&&v!==null&&oe!==void 0&&(0,X.jsx)(cW,{machine:e.machine,projectId:e.projectId,path:oe.spec.path,model:pe,editor:v,onOpen:e=>he(TW(``,e))}),ce!==null&&oe!==void 0&&(0,X.jsx)(cW,{machine:e.machine,projectId:e.projectId,path:oe.spec.path,model:ce,editor:null,onOpen:e=>he(TW(``,e))},oe.spec.id)]})]})]}),(0,X.jsx)(hW,{editor:ue===null?null:le===null?v:y?.getModifiedEditor()??null,language:se?.language??null,children:fe!==null&&(0,X.jsx)(LW,{repo:fe,busy:f>0,onCheckout:()=>h(fe),onSync:()=>void _e(()=>Me(e.machine,`git.sync`,{projectId:e.projectId,repo:fe.path})),onPublish:()=>void _e(()=>Me(e.machine,`git.push`,{projectId:e.projectId,repo:fe.path}))})}),(0,X.jsx)(dp,{}),(0,X.jsx)(mW,{open:te.closing!==null,paths:te.closingTabs.map(e=>e.spec.path),onCancel:()=>te.setClosing(null),onFinish:e=>void te.finish(e)}),m!==null&&(0,X.jsx)(_,{machine:e.machine,projectId:e.projectId,repo:{...m,changed:m.merge.length+m.staged.length+m.changes.length},onRefresh:ee,onClose:()=>h(null)})]})})}export{aG as EditorDialog};
|
|
52
|
+
It is recommended to remove them from the file. This can be configured via \`editor.unusualLineTerminators\`.`,Jd(e.uri)),primaryButton:x(1635,`&&Remove Unusual Line Terminators`),cancelButton:x(1636,`Ignore`)})}finally{this._isPresentingDialog=!1}t.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):IH(this._codeEditorService,e,!0)}};RH=NH([PH(1,ca),PH(2,Xs)],RH),Ps(RH.ID,RH,1);var zH=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)}},VH=class{constructor(){this.selector={language:`*`}}provideDocumentHighlights(e,t,n){if(e.isDisposed())return;let r=[],i=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return i?e.findMatches(i.word,!0,!1,!0,eu,!1).map(e=>({range:e.range,kind:xf.Text})):Promise.resolve(r)}provideMultiDocumentHighlights(e,t,n,r){if(e.isDisposed())return;let i=new Cl,a=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!a)return Promise.resolve(i);for(let t of[e,...n]){if(t.isDisposed())continue;let e=t.findMatches(a.word,!0,!1,!0,eu,!1).map(e=>({range:e.range,kind:xf.Text}));e&&i.set(t.uri,e)}return i}},HH=class extends G{constructor(e){super(),this._register(e.documentHighlightProvider.register(`*`,new VH)),this._register(e.multiDocumentHighlightProvider.register(`*`,new VH))}};HH=zH([BH(0,R)],HH);var UH=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},WH=function(e,t){return function(n,r){t(n,r,e)}},GH,KH,qH=new j(`hasWordHighlights`,!1);function JH(e,t,n,r){let i=e.ordered(t);return Wn(i.map(e=>()=>Promise.resolve(e.provideDocumentHighlights(t,n,r)).then(void 0,Zs)),e=>e!=null).then(e=>{if(e){let n=new Cl;return n.set(t.uri,e),n}return new Cl})}function YH(e,t,n,r,i){let a=e.ordered(t);return Wn(a.map(e=>()=>{let a=i.filter(e=>Vf(e)).filter(t=>Nd(e.selector,t.uri,t.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(e.provideMultiDocumentHighlights(t,n,a,r)).then(void 0,Zs)}),e=>e!=null)}var XH=class{constructor(e,t,n){this._model=e,this._selection=t,this._wordSeparators=n,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||=Et(e=>this._compute(this._model,this._selection,this._wordSeparators,e)),this._result}_getCurrentWordRange(e,t){let n=e.getWordAtPosition(t.getPosition());return n?new C(t.startLineNumber,n.startColumn,t.startLineNumber,n.endColumn):null}cancel(){this.result.cancel()}},ZH=class extends XH{constructor(e,t,n,r){super(e,t,n),this._providers=r}_compute(e,t,n,r){return JH(this._providers,e,t.getPosition(),r).then(e=>e||new Cl)}},QH=class extends XH{constructor(e,t,n,r,i){super(e,t,n),this._providers=r,this._otherModels=i}_compute(e,t,n,r){return YH(this._providers,e,t.getPosition(),r,this._otherModels).then(e=>e||new Cl)}};function $H(e,t,n,r){return new ZH(t,n,r,e)}function eU(e,t,n,r,i){return new QH(t,n,r,e,i)}Id(`_executeDocumentHighlights`,async(e,t,n)=>(await JH(e.get(R).documentHighlightProvider,t,n,T.None))?.get(t.uri));var tU=class{static{GH=this}static{this.storedDecorationIDs=new Cl}static{this.query=null}constructor(e,t,n,r,i,a,o,s){this.toUnhook=new F,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Cl,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new er(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=n,this.codeEditorService=a,this.textModelService=i,this.configurationService=o,this.logService=s,this._hasWordHighlights=qH.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue(`editor.occurrencesHighlightDelay`),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(e=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!==`off`&&this.runDelayer.trigger(()=>{this._onPositionChanged(e)}).catch(nt)})),this.toUnhook.add(e.onDidFocusEditorText(e=>{this.occurrencesHighlightEnablement!==`off`&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}).catch(nt))})),this.toUnhook.add(e.onDidChangeModelContent(e=>{Kr(this.model.uri,`output`)||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(e=>{!e.newModelUrl&&e.oldModelUrl?this._stopSingular():GH.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(e=>{let t=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==t)switch(this.occurrencesHighlightEnablement=t,t){case`off`:this._stopAll();break;case`singleFile`:this._stopAll(GH.query?.modelInfo?.modelURI);break;case`multiFile`:GH.query&&this._run(!0);break;default:console.warn(`Unknown occurrencesHighlight setting value:`,t)}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(e=>{if(e.affectsConfiguration(`editor.occurrencesHighlightDelay`)){let e=o.getValue(`editor.occurrencesHighlightDelay`);this.occurrencesHighlightDelay!==e&&(this.occurrencesHighlightDelay=e)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{let e=this.codeEditorService.getFocusedCodeEditor();e?e.getModel()?.uri.scheme===sl.vscodeNotebookCell&&this.editor.getModel()?.uri.scheme!==sl.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,GH.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!==`off`&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}).catch(nt))}stop(){this.occurrencesHighlightEnablement!==`off`&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(C.compareRangesUsingStarts)}moveNext(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);bo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){let e=this._getSortedHighlights(),t=(e.findIndex(e=>e.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[t];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);let r=this._getWord();if(r){let i=this.editor.getModel().getLineContent(n.startLineNumber);bo(`${i}, ${t+1} of ${e.length} for '${r.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;let e=GH.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),GH.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){let t=this.codeEditorService.listCodeEditors(),n=[];for(let r of t){if(!r.hasModel()||Vt(r.getModel().uri,e))continue;let t=GH.storedDecorationIDs.get(r.getModel().uri);if(!t)continue;r.removeDecorations(t),n.push(r.getModel().uri);let i=nU.get(r);i?.wordHighlighter&&i.wordHighlighter.decorations.length>0&&(i.wordHighlighter.decorations.clear(),i.wordHighlighter.workerRequest=null,i.wordHighlighter._hasWordHighlights.set(!1))}for(let e of n)GH.storedDecorationIDs.delete(e)}_stopSingular(){this._removeSingleDecorations(),this.editor.hasTextFocus()&&(this.editor.getModel()?.uri.scheme!==sl.vscodeNotebookCell&&GH.query?.modelInfo?.modelURI.scheme!==sl.vscodeNotebookCell?(GH.query=null,this._run()):GH.query?.modelInfo&&(GH.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||=(this.workerRequestTokenId++,!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||=(this.workerRequestTokenId++,!0)}_onPositionChanged(e){this.occurrencesHighlightEnablement===`off`||e.source!==`api`&&e.reason!==3?this._stopAll():this._run()}_getWord(){let e=this.editor.getSelection(),t=e.startLineNumber,n=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:n})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===sl.vscodeNotebookCell){let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){let n=r.getModel();n&&n!==e&&n.uri.scheme===sl.vscodeNotebookCell&&t.push(n)}return t}let t=[],n=this.codeEditorService.listCodeEditors();for(let r of n){if(!Rl(r))continue;let n=r.getModel();n&&e===n.modified&&t.push(n.modified)}if(t.length)return t;if(this.occurrencesHighlightEnablement===`singleFile`)return[];for(let r of n){let n=r.getModel();n&&n!==e&&t.push(n)}return t}async _run(e,t){if(this.editor.hasTextFocus()){let e=this.editor.getSelection();if(!e||e.startLineNumber!==e.endLineNumber){GH.query=null,this._stopAll();return}let t=e.startColumn,n=e.endColumn,r=this._getWord();if(!r||r.startColumn>t||r.endColumn<n){GH.query=null,this._stopAll();return}GH.query={modelInfo:{modelURI:this.model.uri,selection:e}}}else if(!GH.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),Vt(this.editor.getModel().uri,GH.query.modelInfo?.modelURI)){if(!e){let e=this.decorations.getRanges();for(let t of e)if(t.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);let n=++this.workerRequestTokenId;this.workerRequestCompleted=!1;let r=this.getOtherModelsToHighlight(this.editor.getModel());if(!GH.query||!GH.query.modelInfo)return;let i=await this.textModelService.createModelReference(GH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(i.object.textEditorModel,GH.query.modelInfo.selection,r),this.workerRequest?.result.then(e=>{n===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=e||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},nt)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{i.dispose()}}else if(this.model.uri.scheme===sl.vscodeNotebookCell){let e=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!GH.query||!GH.query.modelInfo)return;let n=await this.textModelService.createModelReference(GH.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(n.object.textEditorModel,GH.query.modelInfo.selection,[this.model]),this.workerRequest?.result.then(n=>{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=n||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},nt)}catch(e){this.logService.error(`Unexpected error during occurrence request. Log: `,e)}finally{n.dispose()}}}computeWithModel(e,t,n){return n.length?eU(this.multiDocumentProviders,e,t,this.editor.getOption(148),n):$H(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){let t=new Date().getTime(),n=this.lastCursorPositionChangeTime+e;t>=n?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},n-t)}renderDecorations(){this.renderDecorationsTimer=void 0;let e=this.codeEditorService.listCodeEditors();for(let t of e){let e=nU.get(t);if(!e)continue;let n=[],r=t.getModel()?.uri;if(r&&this.workerRequestValue.has(r)){let i=GH.storedDecorationIDs.get(r),a=this.workerRequestValue.get(r);if(a)for(let e of a)e.range&&n.push({range:e.range,options:yz(e.kind)});let o=[];t.changeDecorations(e=>{o=e.deltaDecorations(i??[],n)}),GH.storedDecorationIDs=GH.storedDecorationIDs.set(r,o),n.length>0&&(e.wordHighlighter?.decorations.set(n),e.wordHighlighter?._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}};tU=GH=UH([WH(4,Ui),WH(5,Xs),WH(6,Vi),WH(7,ju)],tU);var nU=class extends G{static{KH=this}static{this.ID=`editor.contrib.wordHighlighter`}static get(e){return e.getContribution(KH.ID)}constructor(e,t,n,r,i,a,o){super(),this._wordHighlighter=null;let s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==sl.accessibleView&&(this._wordHighlighter=new tU(e,n.documentHighlightProvider,n.multiDocumentHighlightProvider,t,i,r,a,o))};this._register(e.onDidChangeModel(e=>{this._wordHighlighter&&=(!e.newModelUrl&&e.oldModelUrl?.scheme!==sl.vscodeNotebookCell&&this.wordHighlighter?.stop(),this._wordHighlighter.dispose(),null),s()})),s()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){this._wordHighlighter?.moveNext()}moveBack(){this._wordHighlighter?.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&=(this._wordHighlighter.dispose(),null),super.dispose()}};nU=KH=UH([WH(1,Fa),WH(2,R),WH(3,Xs),WH(4,Ui),WH(5,Vi),WH(6,ju)],nU);var rU=class extends W{constructor(e,t){super(t),this._isNext=e}run(e,t){let n=nU.get(t);n&&(this._isNext?n.moveNext():n.moveBack())}},iU=class extends rU{constructor(){super(!0,{id:`editor.action.wordHighlight.next`,label:L(1646,`Go to Next Symbol Highlight`),precondition:qH,kbOpts:{kbExpr:E.editorTextFocus,primary:65,weight:100}})}},aU=class extends rU{constructor(){super(!1,{id:`editor.action.wordHighlight.prev`,label:L(1647,`Go to Previous Symbol Highlight`),precondition:qH,kbOpts:{kbExpr:E.editorTextFocus,primary:1089,weight:100}})}},oU=class extends W{constructor(){super({id:`editor.action.wordHighlight.trigger`,label:L(1648,`Trigger Symbol Highlight`),precondition:void 0,kbOpts:{kbExpr:E.editorTextFocus,primary:0,weight:100}})}run(e,t){let n=nU.get(t);n&&n.restoreViewState(!0)}};Ps(nU.ID,nU,0),z(iU),z(aU),z(oU),$e(HH);var sU=class extends td{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){if(!t.hasModel())return;let r=Ot(t.getOption(148),t.getOption(147)),i=t.getModel(),a=t.getSelections(),o=a.length>1,s=a.map(e=>{let t=new A(e.positionLineNumber,e.positionColumn),n=this._move(r,i,t,this._wordNavigationType,o);return this._moveTo(e,n,this._inSelectionMode)});if(i.pushStackElement(),t._getViewModel().setCursorStates(`moveWordCommand`,3,s.map(e=>ld.fromModelSelection(e))),s.length===1){let e=new A(s[0].positionLineNumber,s[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,n){return n?new q(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new q(t.lineNumber,t.column,t.lineNumber,t.column)}},cU=class extends sU{_move(e,t,n,r,i){return bd.moveWordLeft(e,t,n,r,i)}},lU=class extends sU{_move(e,t,n,r,i){return bd.moveWordRight(e,t,n,r)}},uU=class extends cU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartLeft`,precondition:void 0})}},dU=class extends cU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndLeft`,precondition:void 0})}},fU=class extends cU{constructor(){super({inSelectionMode:!1,wordNavigationType:1,id:`cursorWordLeft`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(Xa,Qu)?.negate()),primary:2063,mac:{primary:527},weight:100}})}},pU=class extends cU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartLeftSelect`,precondition:void 0})}},mU=class extends cU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndLeftSelect`,precondition:void 0})}},hU=class extends cU{constructor(){super({inSelectionMode:!0,wordNavigationType:1,id:`cursorWordLeftSelect`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(Xa,Qu)?.negate()),primary:3087,mac:{primary:1551},weight:100}})}},gU=class extends cU{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityLeft`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Ot(Gi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},_U=class extends cU{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityLeftSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Ot(Gi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},vU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordStartRight`,precondition:void 0})}},yU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordEndRight`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(Xa,Qu)?.negate()),primary:2065,mac:{primary:529},weight:100}})}},bU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordRight`,precondition:void 0})}},xU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordStartRightSelect`,precondition:void 0})}},SU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordEndRightSelect`,precondition:void 0,kbOpts:{kbExpr:w.and(E.textInputFocus,w.and(Xa,Qu)?.negate()),primary:3089,mac:{primary:1553},weight:100}})}},CU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordRightSelect`,precondition:void 0})}},wU=class extends lU{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:`cursorWordAccessibilityRight`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Ot(Gi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},TU=class extends lU{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:`cursorWordAccessibilityRightSelect`,precondition:void 0})}_move(e,t,n,r,i){return super._move(Ot(Gi.wordSeparators.defaultValue,e.intlSegmenterLocales),t,n,r,i)}},EU=class extends td{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,n){let r=e?.get(Pn);if(!t.hasModel()||!r)return;let i=Ot(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections(),s=t.getOption(10),c=t.getOption(15),l=r.getLanguageConfiguration(a.getLanguageId()).getAutoClosingPairs(),u=t._getViewModel(),d=o.map(e=>{let n=this._delete({wordSeparators:i,model:a,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:s,autoClosingQuotes:c,autoClosingPairs:l,autoClosedCharacters:u.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Yc(n,``)});t.pushUndoStop(),t.executeCommands(this.id,d),t.pushUndoStop()}},DU=class extends EU{_delete(e,t){return bd.deleteWordLeft(e,t)||new C(1,1,1,1)}},OU=class extends EU{_delete(e,t){let n=bd.deleteWordRight(e,t);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new C(r,i,r,i)}},kU=class extends DU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartLeft`,precondition:E.writable})}},AU=class extends DU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndLeft`,precondition:E.writable})}},jU=class extends DU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordLeft`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}},MU=class extends OU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:`deleteWordStartRight`,precondition:E.writable})}},NU=class extends OU{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:`deleteWordEndRight`,precondition:E.writable})}},PU=class extends OU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordRight`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}},FU=class extends W{constructor(){super({id:`deleteInsideWord`,precondition:E.writable,label:L(1650,`Delete Word`),metadata:{description:L(1651,`Delete the word at the cursor`),args:[{name:`args`,schema:{type:`object`,properties:{onlyWord:{type:`boolean`,default:!1,description:x(1649,`Delete only the word and leave surrounding whitespace`)}}}}]}})}run(e,t,n){if(!t.hasModel())return;let r=!!(n&&typeof n==`object`&&n.onlyWord),i=Ot(t.getOption(148),t.getOption(147)),a=t.getModel(),o=t.getSelections().map(e=>{let t=bd.deleteInsideWord(i,a,e,r);return new Yc(t,``)});t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}};H(new uU),H(new dU),H(new fU),H(new pU),H(new mU),H(new hU),H(new vU),H(new yU),H(new bU),H(new xU),H(new SU),H(new CU),H(new gU),H(new _U),H(new wU),H(new TU),H(new kU),H(new AU),H(new jU),H(new MU),H(new NU),H(new PU),z(FU);var IU=class extends EU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:`deleteWordPartLeft`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){return nu.deleteWordPartLeft(e)||new C(1,1,1,1)}},LU=class extends EU{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:`deleteWordPartRight`,precondition:E.writable,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){let n=nu.deleteWordPartRight(e);if(n)return n;let r=e.model.getLineCount(),i=e.model.getLineMaxColumn(r);return new C(r,i,r,i)}},RU=class extends sU{_move(e,t,n,r,i){return nu.moveWordPartLeft(e,t,n,i)}},zU=class extends RU{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:`cursorWordPartLeft`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:783},weight:100}})}};In.registerCommandAlias(`cursorWordPartStartLeft`,`cursorWordPartLeft`);var BU=class extends RU{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:`cursorWordPartLeftSelect`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}};In.registerCommandAlias(`cursorWordPartStartLeftSelect`,`cursorWordPartLeftSelect`);var VU=class extends sU{_move(e,t,n,r,i){return nu.moveWordPartRight(e,t,n)}},HU=class extends VU{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:`cursorWordPartRight`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:785},weight:100}})}},UU=class extends VU{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:`cursorWordPartRightSelect`,precondition:void 0,kbOpts:{kbExpr:E.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}};H(new IU),H(new LU),H(new zU),H(new BU),H(new HU),H(new UU);var WU=[{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>J(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>J(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>J(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>J(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>J(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>J(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>J(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>J(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>J(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>J(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>J(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>J(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>J(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>J(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>J(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>J(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>J(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>J(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>J(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>J(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>J(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>J(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>J(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>J(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>J(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>J(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>J(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>J(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>J(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>J(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>J(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>J(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>J(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>J(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>J(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>J(()=>import(`./monokai-BscAjiQZ.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>J(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>J(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>J(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>J(()=>import(`./one-dark-pro-C6YyR8OD.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>J(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>J(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>J(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>J(()=>import(`./red-CYlAq2b0.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>J(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>J(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>J(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>J(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>J(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>J(()=>import(`./solarized-dark-b97czJOk.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>J(()=>import(`./solarized-light-DFPxpIYQ.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>J(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>J(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>J(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>J(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>J(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>J(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}],GU=Object.fromEntries(WU.map(e=>[e.id,e.import])),KU=Qe({langs:Kf,themes:GU,engine:()=>(0,qf.createOnigurumaEngine)(J(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:qU,codeToHast:JU,codeToTokens:YU,codeToTokensBase:XU,codeToTokensWithThemes:ZU,getSingletonHighlighter:QU,getLastGrammarState:$U}=Xe(KU,{guessEmbeddedLanguages:Ze});self.MonacoEnvironment={async getWorker(){return new(await(J(()=>import(`./editor.worker-CGG2Yh4v.js`),[]))).default}};function eW(e,t){let n=Zl.registerCommand(`offsite.block`,(e,n)=>t(n)),r=e===`stage`?`Stage`:`Unstage`,i={id:e===`stage`?`add`:`remove`},a=[wn.appendMenuItem(D.DiffEditorHunkToolbar,{command:{id:`offsite.block`,title:`${r} Block`,icon:i},group:`primary`,order:10}),wn.appendMenuItem(D.DiffEditorSelectionToolbar,{command:{id:`offsite.block`,title:`${r} Selection`,icon:i},group:`primary`,order:10})];return()=>{n.dispose();for(let e of a)e.dispose()}}function tW(e,t,n){let r=t.getValue();for(let i of n.innerChanges.slice().reverse()){let n=i.modifiedRange;r=r.slice(0,t.getOffsetAt({lineNumber:n.startLineNumber,column:n.startColumn}))+e.getValueInRange(i.originalRange)+r.slice(t.getOffsetAt({lineNumber:n.endLineNumber,column:n.endColumn}))}return r}var nW=KU({themes:[],langs:[]}),rW=new Map([[`tsx`,()=>J(()=>import(`./typescript-Dy13l_qr.js`),__vite__mapDeps([13,8,1,2,3,4]))],[`jsx`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`json`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`jsonc`,()=>J(()=>import(`./javascript-MI6i-TIC.js`),__vite__mapDeps([7,8,1,2,3,4]))],[`shellscript`,()=>J(()=>import(`./shell-CC2rA5mh.js`),[])],[`docker`,()=>J(()=>import(`./dockerfile-DZFCIeNp.js`),[])],[`c`,()=>J(()=>import(`./cpp-C7h46wYY.js`),[])],[`objective-cpp`,()=>J(()=>import(`./cpp-C7h46wYY.js`),[])],[`vue`,()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))],[`svelte`,()=>J(()=>import(`./html-86U_8x8W.js`),__vite__mapDeps([6,1,2,3,4]))]]);async function iW(e){let t=Ge(e),n=Gf.find(e=>e.id===t||e.aliases?.includes(t)===!0);if(n===void 0)return{id:`plaintext`,name:`Plain Text`};let r=await nW;if(!r.getLoadedLanguages().includes(n.id)){if(await r.loadLanguage(n.import),!Wc.getLanguages().some(e=>e.id===n.id)){Wc.register({id:n.id});let e=rW.get(n.id);e!==void 0&&Wc.setLanguageConfiguration(n.id,(await e()).conf)}await aW()}return{id:n.id,name:n.name}}async function aW(){let e=Se(),t=WU.find(t=>t.id===e.codeTheme);if(t===void 0)throw Error(`unknown code theme ${e.codeTheme}`);let n=(await t.import()).default,r=await nW;await r.loadTheme({...n,colors:{...n.colors,"editor.background":e.background}}),wp(r,Gu),Zl.setTheme(e.codeTheme)}function oW(e){return{fontFamily:e.font.family,fontSize:e.font.size,lineHeight:e.font.lineHeight,fontLigatures:e.font.ligatures?e.font.features===``||e.font.features:!1,cursorStyle:e.cursor.style===`bar`?`line`:e.cursor.style,cursorBlinking:e.cursor.blink?`expand`:`solid`,tabSize:e.tabSize,insertSpaces:!0,detectIndentation:!1,trimAutoWhitespace:!1,wordWrap:e.wordWrap?`on`:`off`,wrappingStrategy:`advanced`,minimap:{enabled:!1},stickyScroll:{enabled:!1},overviewRulerBorder:!1,padding:{top:3,bottom:48},cursorSurroundingLines:2,copyWithSyntaxHighlighting:!1,accessibilitySupport:`off`,guides:{bracketPairs:!0,bracketPairsHorizontal:!1,highlightActiveBracketPair:!0,highlightActiveIndentation:!0},dragAndDrop:!1,glyphMargin:!1,useTabStops:!1,selectionHighlight:!1,emptySelectionClipboard:!1,renderWhitespace:`selection`,smartSelect:{selectLeadingAndTrailingWhitespace:!1},scrollbar:{verticalScrollbarSize:8,horizontalScrollbarSize:8},scrollBeyondLastLine:!1,smoothScrolling:!0,hover:{above:!1},find:{cursorMoveOnType:!1},acceptSuggestionOnCommitCharacter:!1,suggestSelection:`first`,suggest:{localityBonus:!0,insertMode:`replace`,snippetsPreventQuickSuggestions:!1},quickSuggestions:{comments:`on`,strings:`on`,other:`on`},quickSuggestionsDelay:0}}async function sW(e){await document.fonts.load(`${e.font.size}px ${e.font.family}`),Zl.remeasureFonts()}function cW(e){let t=e.model,n=e.editor,i=e.machine,a=e.projectId,o=e.path,s=(0,Y.useRef)(null),c=(0,Y.useCallback)(e=>{let n=t.onDidChangeContent(e);return()=>n.dispose()},[t]),l=(0,Y.useDeferredValue)((0,Y.useSyncExternalStore)(c,()=>t.getValue())),u=(0,Y.useMemo)(()=>({img(e){return(0,X.jsx)(lW,{machine:i,projectId:a,file:o,src:e.src,alt:e.alt,width:e.width,height:e.height})}}),[i,a,o]);return(0,Y.useEffect)(()=>{if(n===null)return;let e=n.onDidScrollChange(e=>{let t=s.current;t!==null&&e.scrollTopChanged&&!t.matches(`:hover`)&&(t.scrollTop=e.scrollTop/(n.getScrollHeight()-n.getLayoutInfo().height)*(t.scrollHeight-t.clientHeight))});return()=>e.dispose()},[n]),(0,X.jsx)(`div`,{ref:s,className:Re(`border-sidebar-border bg-background min-w-0 flex-1 overflow-y-auto p-6`,n!==null&&`border-l`),onScroll:e=>{let t=e.currentTarget;n!==null&&t.matches(`:hover`)&&n.setScrollTop(t.scrollTop/(t.scrollHeight-t.clientHeight)*(n.getScrollHeight()-n.getLayoutInfo().height),Zl.ScrollType.Immediate)},onClickCapture:t=>{let n=(t.target instanceof Element?t.target.closest(`a`):null)?.getAttribute(`href`)??null;n===null||uW(n)||(t.preventDefault(),t.stopPropagation(),n.startsWith(`#`)?fW(t.currentTarget,n.slice(1))?.scrollIntoView():e.onOpen(dW(o,n)))},children:(0,X.jsx)(r,{text:l.replace(/^---\r?\n[\s\S]*?\r?\n---(\r?\n|$)/,``),components:u})})}function lW(e){let n=e.src??``,r=uW(n),[i,a]=(0,Y.useState)(void 0);return(0,Y.useEffect)(()=>{if(r)return;let i=!0;async function o(){try{let r=await t(e.machine,e.projectId,dW(e.file,n));i&&a(r)}catch{i&&a(void 0)}}return o(),()=>{i=!1}},[r,e.machine,e.projectId,e.file,n]),(0,X.jsx)(`img`,{src:r?n:i,alt:e.alt,width:e.width,height:e.height,className:`max-w-full`})}function uW(e){return/^([a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}function dW(e,t){let n=e.split(`/`).map(encodeURIComponent).join(`/`),r=new URL(t,`file:///${n}`).pathname.slice(1);try{return decodeURIComponent(r)}catch{return r}}function fW(e,t){return[...e.querySelectorAll(`h1, h2, h3, h4, h5, h6`)].find(e=>pW(e.textContent)===t.toLowerCase())}function pW(e){return e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s_-]/gu,``).replaceAll(/\s/g,`-`)}function mW(e){return(0,X.jsx)(y,{open:e.open,onOpenChange:t=>{t||e.onCancel()},children:(0,X.jsxs)(oe,{children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(ye,{children:e.paths.length===1?`Do you want to save the changes you made to ${vp(e.paths[0])}?`:`Do you want to save the changes to the following ${e.paths.length} files?`}),(0,X.jsxs)(re,{children:[e.paths.length>1&&`${e.paths.map(vp).join(`, `)}. `,`Your changes will be lost if you don't save them.`]})]}),(0,X.jsxs)(te,{children:[(0,X.jsx)(de,{children:`Cancel`}),(0,X.jsx)(ee,{variant:`outline`,onClick:()=>e.onFinish(!1),children:`Don't Save`}),(0,X.jsx)(ee,{onClick:()=>e.onFinish(!0),children:e.paths.length===1?`Save`:`Save All`})]})]})})}function hW(e){let[t,n]=(0,Y.useState)(null);return(0,Y.useEffect)(()=>{let t=e.editor;if(t===null)return;n(gW(t));let r=[t.onDidChangeCursorSelection(()=>n(gW(t))),t.onDidChangeModel(()=>n(gW(t))),t.onDidChangeModelOptions(()=>n(gW(t)))];return()=>{for(let e of r)e.dispose()}},[e.editor]),(0,X.jsxs)(`div`,{className:`bg-sidebar border-sidebar-border text-muted-foreground flex h-[22px] shrink-0 items-center justify-end gap-4 border-t px-3 text-xs whitespace-nowrap`,children:[e.children,e.language!==null&&t!==null&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{children:[`Ln `,t.line,`, Col `,t.column,t.selected>0&&` (${t.selected} selected)`]}),(0,X.jsxs)(`span`,{children:[t.spaces?`Spaces`:`Tab Size`,`: `,t.tabSize]}),(0,X.jsx)(`span`,{children:`UTF-8`}),(0,X.jsx)(`span`,{children:t.eol}),(0,X.jsx)(`span`,{children:e.language})]})]})}function gW(e){let t=e.getModel(),n=e.getSelection();if(t===null||n===null)return null;let r=t.getOptions();return{line:n.positionLineNumber,column:n.positionColumn,selected:t.getValueLengthInRange(n),tabSize:r.tabSize,spaces:r.insertSpaces,eol:t.getEndOfLineSequence()===Zl.EndOfLineSequence.LF?`LF`:`CRLF`}}function _W(e){let t=vW(e.spec),n=t?.kind??null,r=(0,Y.useEffectEvent)(n=>{let r=e.spec,i=e.original,a=e.modified;if(r===void 0||t===null||i===null||a===null)throw Error(`This diff has no blocks to stage`);e.onPerform(()=>Te(e.machine,`git.run`,{projectId:e.projectId,repo:r.repo,action:{kind:`stageContent`,path:t.path,content:t.kind===`stage`?n.originalWithModifiedChanges:tW(i,a,n.mapping)}}))});(0,Y.useEffect)(()=>{if(n!==null)return eW(n,r)},[n])}function vW(e){return e?.left?.kind===`git`&&e.left.ref===``&&e.right.kind===`worktree`?{kind:`stage`,path:e.left.path}:e?.left?.kind===`git`&&e.right.kind===`git`&&e.right.ref===``?{kind:`unstage`,path:e.right.path}:null}function yW(){let[e,t]=(0,Y.useState)(null),[n,r]=(0,Y.useState)(null);return{editor:e,diff:n,codeHost:(0,Y.useCallback)(e=>{if(e===null)return;let n=Zl.create(e,{automaticLayout:!0,model:null});return t(n),()=>n.dispose()},[]),diffHost:(0,Y.useCallback)(e=>{if(e===null)return;let t=Zl.createDiffEditor(e,{automaticLayout:!0,originalEditable:!1,experimental:{showMoves:!0},useInlineViewWhenSpaceIsLimited:!0});return r(t),()=>t.dispose()},[])}}var bW={M:`Modified`,T:`Type Changed`,A:`Added`,D:`Deleted`,R:`Renamed`,C:`Copied`,U:`Untracked`,"!":`Conflict`},xW={M:`text-warning`,T:`text-warning`,A:`text-success`,D:`text-destructive`,R:`text-success`,C:`text-success`,U:`text-success`,"!":`text-destructive`};function SW(e,t){return e===``?t:`${e}/${t}`}function CW(e){return e.slice(0,7)}function wW(e,t,n){let r=SW(e,n.path),i={kind:`git`,ref:``,path:n.path};function a(t,n,i){return{id:`${t}:${r}`,repo:e,path:r,label:`${vp(r)} (${t})`,left:n,right:i}}return t===`merge`?a(`Working Tree`,null,{kind:`worktree`}):t===`staged`&&n.status===`A`?a(`Index`,null,i):t===`staged`&&n.status===`D`?a(`Deleted`,null,{kind:`git`,ref:`HEAD`,path:n.path}):t===`staged`?a(`Index`,{kind:`git`,ref:`HEAD`,path:n.from??n.path},i):n.status===`U`?a(`Untracked`,null,{kind:`worktree`}):n.status===`A`?a(`Intent to Add`,null,{kind:`worktree`}):n.status===`D`?a(`Deleted`,null,i):a(`Working Tree`,i,{kind:`worktree`})}function TW(e,t){return{id:`File:${t}`,repo:e,path:t,label:vp(t),left:null,right:{kind:`worktree`}}}function EW(e,t){return{...TW(e,t),id:`Preview:${t}`,label:`${vp(t)} (Preview)`,preview:!0}}function DW(e,t){let n=SW(e,t.path);return{id:`HEAD:${n}`,repo:e,path:n,label:`${vp(n)} (HEAD)`,left:null,right:{kind:`git`,ref:`HEAD`,path:t.from??t.path}}}function OW(e,t,n){let r=SW(e,n.path),i=t.parents.at(0)??null;return{id:`${t.hash}:${r}`,repo:e,path:r,label:`${vp(r)} (${i===null?`empty`:CW(i)} ↔ ${CW(t.hash)})`,left:i===null||n.status===`A`?{kind:`empty`}:{kind:`git`,ref:i,path:n.from??n.path},right:n.status===`D`?{kind:`empty`}:{kind:`git`,ref:t.hash,path:n.path}}}function kW(e,t){return[...e].sort((e,n)=>t===`name`?vp(e.path).localeCompare(vp(n.path))||e.path.localeCompare(n.path):t===`status`&&e.status.localeCompare(n.status)||e.path.localeCompare(n.path))}function AW(e,t){let n={folders:new Map,files:[]};for(let t of e){let e=n,r=_p(t.path);for(let t of r===``?[]:r.split(`/`)){let n=e.folders.get(t)??{folders:new Map,files:[]};e.folders.set(t,n),e=n}e.files.push(t)}return jW(n,``,t)}function jW(e,t,n){return[...[...e.folders].sort((e,t)=>e[0].localeCompare(t[0])).map(e=>{let r=e[0],i=e[1];for(;i.files.length===0&&i.folders.size===1;){let e=[...i.folders][0];r=`${r}/${e[0]}`,i=e[1]}let a=t===``?r:`${t}/${r}`,o=jW(i,a,n);return{kind:`folder`,path:a,label:r,children:o,resources:o.flatMap(e=>e.kind===`file`?[e.resource]:e.resources)}}),...kW(e.files,n).map(e=>({kind:`file`,resource:e}))]}var MW=new WeakSet;function NW(e){let[t,n]=(0,Y.useState)(()=>e.saved.tabs.map(e=>({spec:e.spec,document:{status:`loading`}}))),[r,i]=(0,Y.useState)(e.saved.active),[a,o]=(0,Y.useState)(null),s=t.filter(e=>e.document.status===`text`&&e.document.dirty),c=a?.kind===`tab`?t.filter(e=>e.spec.id===a.id):s;(0,Y.useEffect)(()=>{let e=new Set(t.flatMap(e=>e.document.status===`text`?[e.document.modified,e.document.original]:[]));for(let t of Zl.getModels())e.has(t)||t.dispose()},[t]),(0,Y.useEffect)(()=>()=>{for(let e of Zl.getModels())e.dispose()},[]);async function l(t,n){if(n.kind===`empty`)return``;if(n.kind===`git`)return Te(e.machine,`git.show`,{projectId:e.projectId,repo:t.repo,ref:n.ref,path:n.path});let r=await Te(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return r.kind===`text`?r.content:null}function u(e){return Promise.all([e.left===null?``:l(e,e.left),l(e,e.right)])}function d(e,t){n(n=>n.map(n=>n.spec.id===e?{...n,document:t}:n))}async function f(t){try{if(t.left===null&&t.right.kind===`worktree`){let n=await Te(e.machine,`files.read`,{projectId:e.projectId,path:t.path});return n.kind===`image`?{status:`image`,src:`data:${n.mediaType};base64,${n.data}`}:n.kind===`large`?{status:`large`,size:n.size,limit:n.limit}:n.kind===`binary`?{status:`binary`}:await p(t,``,n.content)}let n=await u(t);return n[0]===null||n[1]===null?{status:`binary`}:await p(t,n[0],n[1])}catch(e){return{status:`error`,message:Le(e)}}}async function p(e,t,r){let i=await iW(e.path),a=e.left===null?null:Zl.createModel(t,i.id),o=Zl.createModel(r,i.id);return o.onDidChangeContent(()=>{MW.has(o)||n(e=>{let t=e.find(e=>e.document.status===`text`&&e.document.modified===o);if(t===void 0||t.document.status!==`text`)return e;let n=o.getAlternativeVersionId()!==t.document.saved;return t.document.dirty===n?e:e.map(e=>e===t?{...t,document:{...t.document,dirty:n}}:e)})}),{status:`text`,original:a,modified:o,language:i.name,saved:o.getAlternativeVersionId(),dirty:!1}}async function m(e){let r=t.find(t=>t.spec.id===e);if(r?.document.status!==`text`||r.document.dirty)return;let i=r.document,a=i.modified.getAlternativeVersionId();try{let t=await u(r.spec);if(i.modified.isDisposed()||i.modified.getAlternativeVersionId()!==a)return;if(t[0]===null||t[1]===null){d(e,{status:`binary`});return}i.original!==null&&PW(i.original,t[0]),MW.add(i.modified),PW(i.modified,t[1]),MW.delete(i.modified);let o=i.modified.getAlternativeVersionId();o!==a&&n(e=>e.map(e=>e.document.status===`text`&&e.document.modified===i.modified?{...e,document:{...e.document,saved:o}}:e))}catch(t){d(e,{status:`error`,message:Le(t)})}}async function h(e){i(e.id),t.some(t=>t.spec.id===e.id)||(n([...t,{spec:e,document:{status:`loading`}}]),await g(e))}async function g(e){let t=await f(e);n(n=>n.map(n=>n.spec.id===e.id&&n.document.status===`loading`?{...n,document:t}:n))}async function _(r){let i=t.find(e=>e.spec.id===r);if(i?.document.status!==`text`||i.spec.right.kind!==`worktree`||i.spec.preview===!0)return!0;let a=i.document.modified,o=a.getAlternativeVersionId();try{await Te(e.machine,`files.write`,{projectId:e.projectId,path:i.spec.path,content:a.getValue()})}catch(e){return Ae(e),!1}return n(e=>e.map(e=>e.document.status===`text`&&e.document.modified===a?{...e,document:{...e.document,saved:o,dirty:a.getAlternativeVersionId()!==o}}:e)),e.onSaved(),!0}function v(e){let a=t.filter(t=>!e(t.spec));n(a);let o=t.findIndex(e=>e.spec.id===r);o!==-1&&e(t[o].spec)&&i(a.at(Math.min(o,a.length-1))?.spec.id??null)}function y(e,a){function o(t){return t===e?a:t.startsWith(`${e}/`)?`${a}${t.slice(e.length)}`:t}let s=t.map(e=>e.spec.id===TW(e.spec.repo,e.spec.path).id?{...e,spec:TW(e.spec.repo,o(e.spec.path))}:e.spec.id===EW(e.spec.repo,e.spec.path).id?{...e,spec:EW(e.spec.repo,o(e.spec.path))}:e);n(s);let c=t.findIndex(e=>e.spec.id===r);c!==-1&&i(s[c].spec.id)}function b(e){v(t=>t.right.kind===`worktree`&&(t.path===e||t.path.startsWith(`${e}/`)))}function ee(e){s.some(t=>t.spec.id===e)?o({kind:`tab`,id:e}):v(t=>t.id===e)}function te(){s.length>0?o({kind:`dialog`}):e.onClose()}async function ne(t){a!==null&&(o(null),t&&(await Promise.all(c.map(e=>_(e.spec.id)))).includes(!1)||(a.kind===`tab`&&v(e=>e.id===a.id),a.kind===`dialog`&&e.onClose()))}let re=(0,Y.useEffectEvent)(()=>{for(let t of e.saved.tabs)g(t.spec)});return(0,Y.useEffect)(()=>re(),[]),{tabs:t,active:r,setActive:i,dirty:s,closing:a,setClosing:o,closingTabs:c,open:h,reload:m,save:_,close:ee,renamed:y,deleted:b,requestClose:te,finish:ne}}function PW(e,t){let n=e.getValue(),r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r++;let i=0;for(;i<n.length-r&&i<t.length-r&&n[n.length-1-i]===t[t.length-1-i];)i++;(r!==n.length||r!==t.length)&&e.applyEdits([{range:gd.fromPositions(e.getPositionAt(r),e.getPositionAt(n.length-i)),text:t.slice(r,t.length-i)}])}function FW(e){return(0,X.jsxs)(o,{children:[(0,X.jsxs)(m,{className:`hover:bg-accent data-[state=open]:bg-accent mr-auto ml-1 flex h-6 min-w-0 cursor-pointer items-center gap-1 rounded-sm px-1 text-[11px] font-bold tracking-wide uppercase outline-none`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:e.view===`explorer`?`Explorer`:`Source Control`}),(0,X.jsx)(je,{icon:se,className:`size-3.5 shrink-0`})]}),(0,X.jsx)(l,{align:`start`,className:`bg-popover! w-44`,children:(0,X.jsxs)(d,{value:e.view,onValueChange:t=>{(t===`explorer`||t===`scm`)&&e.onView(t)},children:[(0,X.jsx)(be,{value:`explorer`,children:`Explorer`}),(0,X.jsx)(be,{value:`scm`,children:`Source Control`})]})})]})}function IW(e){return(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 pl-1.5`,children:[(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`Open File`,"aria-label":`Open File`,onClick:e.onOpenFile,children:(0,X.jsx)(je,{icon:Qf,className:`size-4`})}),(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`Previous Change`,"aria-label":`Previous Change`,onClick:e.onPrevious,children:(0,X.jsx)(je,{icon:b,className:`size-4`})}),(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`Next Change`,"aria-label":`Next Change`,onClick:e.onNext,children:(0,X.jsx)(je,{icon:fe,className:`size-4`})}),(0,X.jsxs)(o,{children:[(0,X.jsx)(m,{asChild:!0,children:(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,children:(0,X.jsx)(je,{icon:le,className:`size-4`})})}),(0,X.jsxs)(l,{align:`end`,className:`bg-popover! w-80`,children:[(0,X.jsx)(s,{checked:e.settings.inline,onCheckedChange:t=>e.onSettings({inline:t}),children:`Inline View`}),(0,X.jsx)(s,{checked:e.settings.whitespace,onCheckedChange:t=>e.onSettings({whitespace:t}),children:`Show Leading/Trailing Whitespace Differences`}),(0,X.jsx)(s,{checked:e.settings.collapse,onCheckedChange:t=>e.onSettings({collapse:t}),children:`Collapse Unchanged Regions`})]})]})]})}function LW(e){let t=e.repo;return(0,X.jsxs)(`div`,{className:`mr-auto -ml-1.5 flex h-full items-center`,children:[(0,X.jsxs)(`button`,{type:`button`,title:`${t.branch??`HEAD`} (Git) - Checkout Branch/Tag...`,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onCheckout,children:[(0,X.jsx)(je,{icon:ie,className:`size-3.5`}),t.branch??(t.head===null?`HEAD`:CW(t.head)),t.changes.length>0&&`*`,t.staged.length>0&&`+`,t.merge.length>0&&`!`]}),t.upstream!==null&&(0,X.jsxs)(`button`,{type:`button`,title:`Synchronize Changes`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onSync,children:[(0,X.jsx)(je,{icon:rp,className:Re(`size-3.5`,e.busy&&`animate-spin`)}),(t.behind>0||t.ahead>0)&&`${t.behind}↓ ${t.ahead}↑`]}),t.upstream===null&&t.branch!==null&&t.remote&&(0,X.jsx)(`button`,{type:`button`,title:`Publish Branch`,"aria-label":`Publish Branch`,disabled:e.busy,className:`hover:bg-accent hover:text-foreground flex h-full cursor-pointer items-center gap-1 px-1.5 tabular-nums`,onClick:e.onPublish,children:(0,X.jsx)(je,{icon:me,className:`size-3.5`})})]})}var RW={all:null,amend:!1,then:null};function zW(e){let t=e.repo,n=t.merge.length+t.staged.length+t.changes.length>0,r=!n&&t.branch!==null&&t.upstream===null&&t.remote,a=!n&&t.upstream!==null&&(t.ahead>0||t.behind>0);return(0,X.jsxs)(`div`,{className:Re(`grid gap-1.5 pt-1.5 pr-2 pb-1.5`,e.nested?`pl-4`:`pl-2`),children:[(0,X.jsxs)(`div`,{className:`bg-input/40 border-input focus-within:border-primary relative rounded-sm border`,children:[(0,X.jsx)(`textarea`,{rows:7,"aria-label":`Source Control Input`,value:e.message,placeholder:`Message (${Ie===`⌘`?`⌘Enter`:`Ctrl+Enter`} to commit on "${t.branch??(t.head===null?`HEAD`:CW(t.head))}")`,className:`placeholder:text-muted-foreground block w-full resize-none bg-transparent py-1 pr-7 pl-2 text-[13px] leading-[18px] outline-none`,onChange:t=>e.onMessage(t.target.value),onKeyDown:t=>{(t.metaKey||t.ctrlKey)&&t.key===`Enter`&&(t.preventDefault(),e.onCommit({...RW,then:`push`}))}}),(0,X.jsx)(`button`,{type:`button`,title:e.generating?`Cancel`:`Generate Commit Message`,"aria-label":e.generating?`Cancel`:`Generate Commit Message`,className:`text-muted-foreground hover:text-foreground hover:bg-accent absolute top-[3px] right-[3px] grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:e.generating?e.onCancel:e.onGenerate,children:(0,X.jsx)(je,{icon:e.generating?ip:u,className:`size-3.5`})})]}),r&&(0,X.jsxs)(Me,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.push`),children:[(0,X.jsx)(je,{icon:me}),`Publish Branch`]}),a&&(0,X.jsxs)(Me,{size:`xs`,className:`w-full rounded-sm`,disabled:e.busy,onClick:()=>e.onRemote(`git.sync`),children:[(0,X.jsx)(je,{icon:rp}),`Sync Changes`,t.behind>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[t.behind,(0,X.jsx)(je,{icon:fe,className:`size-3`})]}),t.ahead>0&&(0,X.jsxs)(`span`,{className:`inline-flex items-center tabular-nums`,children:[t.ahead,(0,X.jsx)(je,{icon:b,className:`size-3`})]})]}),!r&&!a&&(0,X.jsxs)(`div`,{className:`flex`,children:[(0,X.jsxs)(Me,{size:`xs`,className:`flex-1 rounded-sm rounded-r-none`,disabled:!n||e.busy,onClick:()=>e.onCommit({...RW,then:`push`}),children:[(0,X.jsx)(je,{icon:ve}),`Commit & Push`]}),(0,X.jsxs)(o,{children:[(0,X.jsx)(m,{asChild:!0,children:(0,X.jsx)(Me,{size:`xs`,className:`rounded-sm rounded-l-none px-1 before:absolute before:inset-y-1 before:-left-px before:w-px before:bg-white/10`,disabled:!n||e.busy,title:`More Actions...`,"aria-label":`More Commit Actions`,children:(0,X.jsx)(je,{icon:se})})}),(0,X.jsxs)(l,{align:`end`,className:`bg-popover! w-48`,children:[(0,X.jsx)(i,{onSelect:()=>e.onCommit(RW),children:`Commit`}),(0,X.jsx)(i,{onSelect:()=>e.onCommit({...RW,amend:!0}),children:`Commit (Amend)`}),(0,X.jsx)(i,{onSelect:()=>e.onCommit({...RW,then:`push`}),children:`Commit & Push`}),(0,X.jsx)(i,{onSelect:()=>e.onCommit({...RW,then:`sync`}),children:`Commit & Sync`})]})]})]})]})}var BW=[{id:`merge`,title:`Merge Changes`},{id:`staged`,title:`Staged Changes`},{id:`changes`,title:`Changes`}];function VW(e){let[t,n]=(0,Y.useState)([]),[r,i]=(0,Y.useState)(null),a=c(),o=e.repo;function s(e){n(t.includes(e)?t.filter(t=>t!==e):[...t,e])}function l(t,n,r){let i=r===`group`?`All Changes`:`Changes`;return(0,X.jsxs)(X.Fragment,{children:[r===`file`&&n[0].status!==`D`&&(0,X.jsx)(UW,{title:`Open File`,icon:Qf,onClick:()=>e.onOpen(TW(o.path,SW(o.path,n[0].path)))}),t===`changes`&&(0,X.jsx)(UW,{title:`Discard ${i}`,icon:op,onClick:()=>e.onDiscard(n)}),t===`staged`&&(0,X.jsx)(UW,{title:`Unstage ${i}`,icon:Jf,onClick:()=>e.onUnstage(n)}),t!==`staged`&&(0,X.jsx)(UW,{title:t===`merge`&&r===`group`?`Stage All Merge Changes`:`Stage ${i}`,icon:Yf,onClick:()=>e.onStage(n)})]})}function u(t,n,r){let a=wW(o.path,t,n),s=SW(o.path,n.path);return(0,X.jsxs)(`div`,{"data-resource":!0,role:`button`,tabIndex:0,title:`${e.root}/${s} • ${bW[n.status]}`,className:Re(`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,a.id===e.active&&`bg-sidebar-row-active`),style:{paddingLeft:20+r*8},onClick:()=>e.onOpen(a),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(a)},onContextMenu:()=>i({group:t,resource:n}),children:[(0,X.jsx)(He,{path:n.path}),(0,X.jsx)(`span`,{className:Re(`min-w-0 shrink-0 truncate`,xW[n.status],n.status===`D`&&`line-through`),children:vp(n.path)}),!e.tree&&(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:_p(n.path)}),(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(t,[n],`file`)}),(0,X.jsx)(`span`,{className:Re(`w-3.5 text-center text-xs`,xW[n.status]),children:n.status})]})]},`${t}:${n.path}`)}function d(e,n,r){return n.map(n=>{if(n.kind===`file`)return u(e,n.resource,r);let i=`${o.path}:${e}:${n.path}`,a=!t.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:n.path,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+r*8},onClick:()=>s(i),onKeyDown:e=>{e.key===`Enter`&&s(i)},children:[(0,X.jsx)(HW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.label}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(e,n.resources,`folder`)})]}),a&&d(e,n.children,r+1)]},i)})}return(0,X.jsxs)(he,{children:[(0,X.jsx)(_e,{asChild:!0,children:(0,X.jsx)(`div`,{onContextMenu:e=>{e.target instanceof Element&&e.target.closest(`[data-resource]`)!==null||e.preventDefault()},children:BW.map(n=>{let r=o[n.id];if(r.length===0)return null;let i=`${o.path}:${n.id}`,a=!t.includes(i);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row hover:bg-sidebar-row-hover focus-visible:ring-ring relative flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none focus-visible:ring-1 focus-visible:ring-inset`,style:{paddingLeft:4+e.depth*8},onClick:()=>s(i),onKeyDown:e=>{e.key===`Enter`&&s(i)},children:[(0,X.jsx)(HW,{open:a}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:n.title}),(0,X.jsx)(`span`,{className:`hidden shrink-0 items-center gap-0.5 group-hover/row:flex group-focus-visible/row:flex`,children:l(n.id,r,`group`)}),(0,X.jsx)(`span`,{className:`bg-muted text-foreground grid h-4.5 min-w-4.5 shrink-0 place-items-center rounded-full px-1 text-[11px] tabular-nums`,children:r.length})]}),a&&(e.tree?d(n.id,AW(r,e.sort),e.depth+1):kW(r,e.sort).map(t=>u(n.id,t,e.depth+1)))]},n.id)})})}),r!==null&&(0,X.jsxs)(ce,{className:`min-w-52`,children:[(0,X.jsx)(pe,{onSelect:()=>e.onOpen(wW(o.path,r.group,r.resource)),children:`Open Changes`}),r.resource.status!==`D`&&(0,X.jsx)(pe,{onSelect:()=>e.onOpen(TW(o.path,SW(o.path,r.resource.path))),children:`Open File`}),r.resource.status!==`U`&&r.resource.status!==`A`&&(0,X.jsx)(pe,{onSelect:()=>e.onOpen(DW(o.path,r.resource)),children:`Open File (HEAD)`}),(0,X.jsx)(ue,{}),r.group===`staged`&&(0,X.jsx)(pe,{onSelect:()=>e.onUnstage([r.resource]),children:`Unstage Changes`}),r.group!==`staged`&&(0,X.jsx)(pe,{onSelect:()=>e.onStage([r.resource]),children:`Stage Changes`}),r.group===`changes`&&(0,X.jsx)(pe,{onSelect:()=>e.onDiscard([r.resource]),children:`Discard Changes`}),r.resource.status===`U`&&(0,X.jsx)(pe,{onSelect:()=>e.onIgnore([r.resource]),children:`Add to .gitignore`}),(0,X.jsx)(ue,{}),(0,X.jsx)(pe,{onSelect:()=>void a.copy(`${e.root}/${SW(o.path,r.resource.path)}`),children:`Copy Path`}),(0,X.jsx)(pe,{onSelect:()=>void a.copy(SW(o.path,r.resource.path)),children:`Copy Relative Path`})]})]})}function HW(e){return(0,X.jsx)(je,{icon:We,"aria-hidden":!0,className:Re(`text-muted-foreground size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)})}function UW(e){return(0,X.jsx)(`button`,{type:`button`,title:e.title,"aria-label":e.title,className:`text-foreground hover:bg-accent grid size-5 cursor-pointer place-items-center rounded-sm`,onClick:t=>{t.stopPropagation(),e.onClick()},children:(0,X.jsx)(je,{icon:e.icon,className:`size-4`})})}var WW=50,GW=11,KW=22,qW=[`#59A4F9`,`#FFB000`,`#DC267F`,`#994F00`,`#40B0A6`,`#B66DFF`];function JW(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(WW),[l,u]=(0,Y.useState)(0),[d,f]=(0,Y.useState)([]),[p,m]=(0,Y.useState)({}),h=e.repos.find(e=>e.path===t)??e.repos.at(0),g=h?.path??null,_=h?.head??null,v=h?.upstream??null,y=h?.behind??0;(0,Y.useEffect)(()=>{if(g===null||_===null){i([]);return}let t=!0;return Te(e.machine,`git.history`,{projectId:e.projectId,repo:g,limit:s}).then(e=>{t&&(i(e),o(null))},e=>{t&&o(Le(e))}),()=>{t=!1}},[e.machine,e.projectId,g,_,v,y,s,l]);async function b(t){if(d.includes(t.hash))f(d.filter(e=>e!==t.hash));else if(f([...d,t.hash]),h!==void 0&&p[t.hash]===void 0)try{let n=await Te(e.machine,`git.commitFiles`,{projectId:e.projectId,repo:h.path,hash:t.hash,parent:t.parents.at(0)??null});m(e=>({...e,[t.hash]:n}))}catch(e){Ae(e)}}let ee=$W(r??[]);return(0,X.jsxs)(`div`,{className:Re(`border-sidebar-border relative flex shrink-0 flex-col border-t`,e.open&&`min-h-20`),style:e.open?{height:e.height}:void 0,children:[e.open&&(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,className:`hover:bg-primary absolute inset-x-0 -top-0.5 z-10 h-1 cursor-row-resize touch-none transition-colors delay-100`,onPointerDown:t=>{let n=t.currentTarget.parentElement?.parentElement;if(n==null)return;let r=n.getBoundingClientRect();Fe(t,t=>e.onHeight(Math.min(Math.max(r.bottom-t.clientY,80),r.height-120)))}}),(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group/row text-sidebar-foreground flex h-[22px] shrink-0 cursor-pointer items-center gap-0.5 pr-2 pl-0.5 outline-none select-none`,onClick:e.onToggle,onKeyDown:t=>{t.key===`Enter`&&e.onToggle()},children:[(0,X.jsx)(je,{icon:We,"aria-hidden":!0,className:Re(`size-4 shrink-0 transition-transform`,e.open&&`rotate-90`)}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[11px] font-bold tracking-wide uppercase`,children:`Graph`}),e.repos.length>1&&(0,X.jsx)(`select`,{"aria-label":`Repository`,value:h?.path??``,className:`bg-sidebar text-muted-foreground max-w-28 cursor-pointer truncate text-xs outline-none`,onClick:e=>e.stopPropagation(),onChange:e=>{n(e.target.value),f([]),c(WW)},children:e.repos.map(e=>(0,X.jsx)(`option`,{value:e.path,children:e.path===``?`.`:e.path},e.path))}),e.open&&h!==void 0&&(0,X.jsxs)(`span`,{className:`hidden items-center gap-0.5 group-hover/row:flex`,children:[(0,X.jsx)(UW,{title:`Fetch From All Remotes`,icon:Xf,onClick:()=>e.onFetch(h)}),(0,X.jsx)(UW,{title:`Refresh`,icon:Ue,onClick:()=>u(l+1)})]})]}),e.open&&(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[a!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:a}),a===null&&ee.length===0&&r!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground px-4 py-1 text-xs`,children:`No commits yet.`}),a===null&&h!==void 0&&ee.map(t=>{let n=t.commit,r=d.includes(n.hash);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${n.author}, ${new Date(n.date).toLocaleString()}\n\n${n.subject}\n\n${CW(n.hash)}`,className:`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,onClick:()=>void b(n),onKeyDown:e=>{e.key===`Enter`&&b(n)},children:[(0,X.jsx)(YW,{row:t,child:!1}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:n.subject}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 shrink-[2] truncate text-xs`,children:n.author}),(0,X.jsx)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:n.refs.map(e=>XW(e,h))})]}),r&&(p[n.hash]??[]).map(r=>{let i=OW(h.path,n,r);return(0,X.jsxs)(`div`,{role:`button`,tabIndex:0,title:`${r.path} • ${bW[r.status]}`,className:Re(`hover:bg-sidebar-row-hover flex h-[22px] cursor-pointer items-center gap-1.5 pr-2 text-[13px] outline-none select-none`,i.id===e.active&&`bg-sidebar-row-active`),onClick:()=>e.onOpen(i),onKeyDown:t=>{t.key===`Enter`&&e.onOpen(i)},children:[(0,X.jsx)(YW,{row:t,child:!0}),(0,X.jsx)(He,{path:r.path}),(0,X.jsx)(`span`,{className:Re(`min-w-0 shrink-0 truncate`,xW[r.status],r.status===`D`&&`line-through`),children:vp(r.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-xs`,children:_p(r.path)}),(0,X.jsx)(`span`,{className:Re(`ml-auto w-3.5 shrink-0 text-center text-xs`,xW[r.status]),children:r.status})]},r.path)})]},n.hash)}),r!==null&&r.length===s&&(0,X.jsx)(`button`,{type:`button`,className:`text-muted-foreground hover:text-foreground w-full cursor-pointer px-4 py-1 text-left text-xs`,onClick:()=>c(s+WW),children:`Load More…`})]})]})}function YW(e){let t=e.row,n=KW/2,r=ZW(t.lane);return e.child?(0,X.jsx)(`svg`,{"aria-hidden":!0,width:GW*(t.width+1),height:KW,className:`shrink-0`,children:t.after.map(e=>(0,X.jsx)(`line`,{x1:ZW(e),x2:ZW(e),y1:0,y2:KW,stroke:QW(e),strokeWidth:1},e))}):(0,X.jsxs)(`svg`,{"aria-hidden":!0,width:GW*(t.width+1),height:KW,className:`shrink-0`,children:[t.through.map(e=>(0,X.jsx)(`line`,{x1:ZW(e),x2:ZW(e),y1:0,y2:KW,stroke:QW(e),strokeWidth:1},`through-${e}`)),t.up.map(e=>(0,X.jsx)(`path`,{d:`M ${ZW(e)} 0 Q ${ZW(e)} ${n} ${r} ${n}`,fill:`none`,stroke:QW(e),strokeWidth:1},`up-${e}`)),t.down.map(e=>(0,X.jsx)(`path`,{d:`M ${r} ${n} Q ${ZW(e)} ${n} ${ZW(e)} ${KW}`,fill:`none`,stroke:QW(e),strokeWidth:1},`down-${e}`)),(0,X.jsx)(`circle`,{cx:r,cy:n,r:t.commit.parents.length>1?3.5:4,fill:t.commit.parents.length>1?`var(--sidebar)`:QW(t.lane),stroke:QW(t.lane),strokeWidth:t.commit.parents.length>1?2:0})]})}function XW(e,t){if(e.endsWith(`/HEAD`))return null;let n=e===`HEAD`||e.startsWith(`HEAD -> `),r=e.startsWith(`tag: `),i=e===t.upstream,a=e.replace(/^HEAD -> /,``).replace(/^tag: /,``);return(0,X.jsxs)(`span`,{title:a,className:Re(`inline-flex h-4 max-w-32 items-center gap-0.5 rounded-full px-1.5 text-[11px] font-medium`,n&&`text-background bg-[#59A4F9]`,i&&`text-background bg-[#B180D7]`,!n&&!i&&`bg-muted text-foreground`),children:[(0,X.jsx)(je,{icon:r?ap:i?v:ie,className:`size-3 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate`,children:a})]},e)}function ZW(e){return GW*(e+1)}function QW(e){return qW[e%qW.length]}function $W(e){let t=[];return e.map(e=>{let n=t,r=n.indexOf(e.hash),i=n.indexOf(null),a=r===-1?i===-1?n.length:i:r,o=n.map(t=>t===e.hash?null:t);o[a]=e.parents.at(0)??null;let s=e.parents.length>0?[a]:[];for(let t of e.parents.slice(1)){let e=o.indexOf(t);if(e!==-1){s.push(e);continue}let n=o.indexOf(null),r=n===-1?o.length:n;o[r]=t,s.push(r)}for(;o.length>0&&o.at(-1)===null;)o.pop();return t=o,{commit:e,lane:a,up:n.flatMap((t,n)=>t===e.hash?[n]:[]),through:n.flatMap((t,n)=>t!==null&&t!==e.hash?[n]:[]),down:s,after:o.flatMap((e,t)=>e===null?[]:[t]),width:Math.max(n.length,o.length,a+1)}})}function eG(e){let t=e.repo;function r(t,n){return(0,X.jsx)(i,{onSelect:()=>e.onCommit({...RW,...n}),children:t})}return(0,X.jsxs)(o,{children:[(0,X.jsx)(m,{asChild:!0,children:(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`More Actions...`,"aria-label":`More Actions`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(je,{icon:le,className:`size-4`})})}),(0,X.jsxs)(l,{align:`end`,className:`bg-popover! w-56`,children:[(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`View & Sort`}),(0,X.jsxs)(a,{className:`w-44`,children:[(0,X.jsxs)(d,{value:e.settings.tree?`tree`:`list`,onValueChange:t=>e.onSettings({tree:t===`tree`}),children:[(0,X.jsx)(be,{value:`list`,children:`View as List`}),(0,X.jsx)(be,{value:`tree`,children:`View as Tree`})]}),(0,X.jsx)(n,{}),(0,X.jsxs)(d,{value:e.settings.sort,onValueChange:t=>{(t===`name`||t===`path`||t===`status`)&&e.onSettings({sort:t})},children:[(0,X.jsx)(be,{value:`name`,children:`Sort by Name`}),(0,X.jsx)(be,{value:`path`,children:`Sort by Path`}),(0,X.jsx)(be,{value:`status`,children:`Sort by Status`})]})]})]}),(0,X.jsx)(n,{}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(i,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(i,{onSelect:e.onCheckout,children:`Checkout to...`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(n,{}),(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`Commit`}),(0,X.jsxs)(a,{className:`w-52`,children:[r(`Commit`,{}),r(`Commit Staged`,{all:!1}),r(`Commit All`,{all:!0}),(0,X.jsx)(i,{disabled:t.head===null,onSelect:e.onUndo,children:`Undo Last Commit`}),(0,X.jsx)(n,{}),r(`Commit (Amend)`,{amend:!0}),r(`Commit Staged (Amend)`,{all:!1,amend:!0}),r(`Commit All (Amend)`,{all:!0,amend:!0})]})]}),(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`Changes`}),(0,X.jsxs)(a,{className:`w-52`,children:[(0,X.jsx)(i,{onSelect:()=>e.onStage([...t.merge,...t.changes]),children:`Stage All Changes`}),(0,X.jsx)(i,{onSelect:()=>e.onUnstage(t.staged),children:`Unstage All Changes`}),(0,X.jsx)(i,{disabled:t.changes.length===0,onSelect:()=>e.onDiscard(t.changes),children:`Discard All Changes`})]})]}),(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`Pull, Push`}),(0,X.jsxs)(a,{className:`w-52`,children:[(0,X.jsx)(i,{onSelect:()=>e.onRemote(`git.sync`),children:`Sync`}),(0,X.jsx)(n,{}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`pull`,rebase:!1}),children:`Pull`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`pull`,rebase:!0}),children:`Pull (Rebase)`}),(0,X.jsx)(n,{}),(0,X.jsx)(i,{onSelect:()=>e.onRemote(`git.push`),children:`Push`}),(0,X.jsx)(n,{}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!1}),children:`Fetch`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`fetch`,prune:!0,all:!1}),children:`Fetch (Prune)`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`fetch`,prune:!1,all:!0}),children:`Fetch From All Remotes`})]})]}),(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`Branch`}),(0,X.jsxs)(a,{className:`w-52`,children:[(0,X.jsx)(i,{onSelect:e.onCheckout,children:`Create Branch...`}),(0,X.jsx)(i,{disabled:t.branch===null||t.upstream!==null,onSelect:()=>e.onRemote(`git.push`),children:`Publish Branch...`})]})]}),(0,X.jsxs)(p,{children:[(0,X.jsx)(f,{children:`Stash`}),(0,X.jsxs)(a,{className:`w-56`,children:[(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`stash`,mode:`tracked`}),children:`Stash`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`stash`,mode:`untracked`}),children:`Stash (Include Untracked)`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`stash`,mode:`staged`}),children:`Stash Staged`}),(0,X.jsx)(n,{}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`unstash`,pop:!1}),children:`Apply Latest Stash`}),(0,X.jsx)(i,{onSelect:()=>e.onRun({kind:`unstash`,pop:!0}),children:`Pop Latest Stash`})]})]})]})]})}function tG(e){let[t,n]=(0,Y.useState)([]),r=(0,Y.useRef)(new Map),[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null),c=e.repos??[],l=c.length===1?c[0]:null,u=e.settings,d=Ee(e=>e.prefs);function f(e){return u.messages[e.path]??``}function p(t,n){return e.onPerform(()=>Te(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:n}))}function m(t,n){return e.onPerform(()=>Te(e.machine,n,{projectId:e.projectId,repo:t.path}))}async function g(t,n){let r=f(t).trim();if(r===``&&!n.amend){Ae(`Please provide a commit message.`);return}let i=t.changes.length+t.merge.length>0;if(n.all===null&&!n.amend&&t.staged.length===0){if(!i){Ae(`There are no changes to commit.`);return}if(!u.smartCommit){a({repo:t,options:n});return}}let o=n.all??(t.staged.length===0&&!n.amend&&i);await e.onPerform(async()=>{await Te(e.machine,`git.run`,{projectId:e.projectId,repo:t.path,action:{kind:`commit`,message:r,all:o,amend:n.amend}}),e.onMessage(t.path,``),n.then!==null&&await Te(e.machine,n.then===`push`?`git.push`:`git.sync`,{projectId:e.projectId,repo:t.path})})}async function _(t){let i={};r.current.set(t.path,i),n(e=>[...e,t.path]);try{let n=await Te(e.machine,`git.message`,{projectId:e.projectId,repo:t.path,staged:t.staged.length>0});r.current.get(t.path)===i&&e.onMessage(t.path,n)}catch(e){r.current.get(t.path)===i&&Ae(e)}finally{r.current.get(t.path)===i&&v(t)}}function v(e){r.current.delete(e.path),n(t=>t.filter(t=>t!==e.path))}function b(t){e.onPerform(async()=>{e.onMessage(t.path,await Te(e.machine,`git.undoCommit`,{projectId:e.projectId,repo:t.path}))})}function ne(e,t){p(e,{kind:`unstage`,paths:t.flatMap(e=>e.from===null?[e.path]:[e.path,e.from])})}function ie(e,t){p(e,{kind:`stage`,paths:t.map(e=>e.path)})}function ae(t){return(0,X.jsx)(eG,{repo:t,settings:u,onSettings:e.onSettings,onCommit:e=>void g(t,e),onUndo:()=>b(t),onRun:e=>void p(t,e),onRemote:e=>void m(t,e),onStage:e=>ie(t,e),onUnstage:e=>ne(t,e),onDiscard:e=>s({repo:t,resources:e}),onCheckout:()=>e.onCheckout(t)})}let se=o?.resources??[],ce=se.filter(e=>e.status===`U`);return(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-full min-h-0 flex-col`,children:[(0,X.jsxs)(`div`,{className:`text-sidebar-foreground border-sidebar-border relative flex h-9 shrink-0 items-center gap-0.5 border-b px-1.5`,children:[e.header,(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:u.tree?`View as List`:`View as Tree`,"aria-label":u.tree?`View as List`:`View as Tree`,onClick:()=>e.onSettings({tree:!u.tree}),children:(0,X.jsx)(je,{icon:u.tree?np:tp,className:`size-4`})}),l!==null&&(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`Commit`,"aria-label":`Commit`,disabled:e.busy,onClick:()=>void g(l,RW),children:(0,X.jsx)(je,{icon:ve,className:`size-4`})}),(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`Refresh`,"aria-label":`Refresh`,onClick:e.onRefresh,children:(0,X.jsx)(je,{icon:Ue,className:`size-4`})}),l!==null&&ae(l),(e.busy||t.length>0)&&(0,X.jsx)(`span`,{className:`absolute inset-x-0 -bottom-px h-0.5 overflow-hidden`,children:(0,X.jsx)(`span`,{className:`bg-primary block h-full w-[2%] animate-[progress_4s_linear_infinite]`})})]}),(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto pb-2`,children:[e.error!==null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:e.error}),e.error===null&&e.repos===null&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`Loading…`}),e.error===null&&e.repos?.length===0&&(0,X.jsx)(`p`,{className:`text-muted-foreground p-4 text-xs`,children:`The folder currently open doesn't have a git repository.`}),c.map(n=>(0,X.jsxs)(`div`,{children:[l===null&&(0,X.jsxs)(`div`,{className:`group/row text-sidebar-foreground flex h-[22px] items-center gap-1.5 pr-1 pl-2 text-[13px]`,children:[(0,X.jsx)(`span`,{className:`truncate font-semibold`,children:n.path===``?e.name:vp(n.path)}),(0,X.jsx)(`span`,{className:`text-muted-foreground truncate text-xs`,children:n.branch??(n.head===null?``:CW(n.head))}),(0,X.jsx)(`span`,{className:`ml-auto hidden shrink-0 items-center gap-0.5 group-hover/row:flex`,children:(0,X.jsx)(UW,{title:`Commit`,icon:ve,onClick:()=>void g(n,RW)})}),ae(n)]}),(0,X.jsx)(zW,{repo:n,message:f(n),generating:t.includes(n.path),busy:e.busy,nested:l===null,onMessage:t=>e.onMessage(n.path,t),onGenerate:()=>void _(n),onCancel:()=>v(n),onCommit:e=>void g(n,e),onRemote:e=>void m(n,e)}),(0,X.jsx)(VW,{repo:n,root:e.root,tree:u.tree,sort:u.sort,depth:+(l===null),active:e.active,onOpen:e.onOpen,onStage:e=>ie(n,e),onUnstage:e=>ne(n,e),onDiscard:e=>s({repo:n,resources:e}),onIgnore:e=>void p(n,{kind:`ignore`,paths:e.map(e=>e.path)})})]},n.path))]}),c.length>0&&(0,X.jsx)(JW,{machine:e.machine,projectId:e.projectId,repos:c,open:d.editor.graph,height:u.graphHeight,active:e.active,onToggle:()=>xe({...d,editor:{...d.editor,graph:!d.editor.graph}}),onHeight:t=>e.onSettings({graphHeight:t}),onOpen:e.onOpen,onFetch:e=>void p(e,{kind:`fetch`,prune:!1,all:!0})}),(0,X.jsx)(y,{open:i!==null,onOpenChange:e=>{e||a(null)},children:(0,X.jsxs)(oe,{children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(ye,{children:`There are no staged changes to commit.`}),(0,X.jsx)(re,{children:`Would you like to stage all your changes and commit them directly?`})]}),(0,X.jsxs)(te,{children:[(0,X.jsx)(de,{children:`Cancel`}),(0,X.jsx)(ee,{variant:`outline`,onClick:()=>{i!==null&&(e.onSettings({smartCommit:!0}),g(i.repo,{...i.options,all:!0}))},children:`Always`}),(0,X.jsx)(ee,{onClick:()=>{i!==null&&g(i.repo,{...i.options,all:!0})},children:`Yes`})]})]})}),(0,X.jsx)(y,{open:o!==null,onOpenChange:e=>{e||s(null)},children:(0,X.jsxs)(oe,{children:[(0,X.jsxs)(h,{children:[(0,X.jsx)(ye,{children:se.length>1?`Are you sure you want to discard ALL changes in ${se.length} files?`:ce.length===1?`Are you sure you want to DELETE the following untracked file: '${vp(se[0].path)}'?`:`Are you sure you want to discard changes in '${vp(se.at(0)?.path??``)}'?`}),(0,X.jsxs)(re,{children:[se.length>1&&`This is IRREVERSIBLE! Your current working set will be FOREVER LOST if you proceed.`,se.length===1&&ce.length===1&&`This is IRREVERSIBLE! This file will be FOREVER LOST if you proceed.`]})]}),(0,X.jsxs)(te,{children:[(0,X.jsx)(de,{children:`Cancel`}),(0,X.jsx)(ee,{variant:`destructive`,onClick:()=>{o!==null&&p(o.repo,{kind:`discard`,tracked:se.filter(e=>e.status!==`U`).map(e=>e.path),untracked:ce.map(e=>e.path)})},children:se.length>1?`Discard All ${se.length} Files`:ce.length===1?`Delete File`:`Discard File`})]})]})})]})}var nG=3e3;function rG(e){let[t,n]=(0,Y.useState)(null),[r,i]=(0,Y.useState)(null),a=(0,Y.useEffectEvent)(e.onLoaded);return(0,Y.useEffect)(()=>{let t=!0,r=!1;async function o(){if(!r){r=!0;try{let r=await Te(e.machine,`git.changes`,{projectId:e.projectId});if(!t)return;i(null),n(e=>we(e,r)?e:r),a()}catch(e){t&&i(Le(e))}finally{r=!1}}}function s(){document.hidden||o()}o();let c=window.setInterval(s,nG);return window.addEventListener(`focus`,s),()=>{t=!1,window.clearInterval(c),window.removeEventListener(`focus`,s)}},[e.machine,e.projectId,e.version]),{repos:t,error:r}}var iG=(0,Y.lazy)(async()=>({default:(await J(async()=>{let{ZoomableImage:e}=await import(`./zoomable-image-DkYN4OSU.js`);return{ZoomableImage:e}},__vite__mapDeps([16,17,2,18,19,20,21,22]))).ZoomableImage}));function aG(e){let t=Ee(t=>ke(t,e.machine,e.projectId)),n=Ce(),r=Ee(e=>e.prefs.editor),[i]=(0,Y.useState)(()=>fp(e.machine,e.projectId)),[a]=(0,Y.useState)(()=>new Map(i.tabs.map(e=>[e.spec.id,e.view]))),[o,s]=(0,Y.useState)(()=>({...i.settings,width:Math.min(i.settings.width,window.innerWidth*.6)})),[c,l]=(0,Y.useState)(i.expanded),[u,d]=(0,Y.useState)(0),[f,p]=(0,Y.useState)(0),[m,h]=(0,Y.useState)(null),g=yW(),v=g.editor,y=g.diff,b=(0,Y.useRef)(null),ee=(0,Y.useCallback)(()=>d(e=>e+1),[]),te=NW({machine:e.machine,projectId:e.projectId,saved:i,onSaved:ee,onClose:()=>{ye(),e.onClose()}}),ne=te.active;function re(){ne!==null&&te.reload(ne)}let ie=rG({machine:e.machine,projectId:e.projectId,version:u,onLoaded:re}),ae=ie.repos,oe=te.tabs.find(e=>e.spec.id===ne),se=oe?.document.status===`text`&&oe.spec.preview!==!0?oe.document:null,ce=oe?.document.status===`text`&&oe.spec.preview===!0?oe.document.modified:null,le=se?.original??null,ue=se?.modified??null,de=oe?.spec.right.kind===`worktree`,fe=ae?.find(e=>e.path===oe?.spec.repo)??ae?.at(0)??null,pe=le===null&&ue?.getLanguageId()===`markdown`?ue:null;(0,Y.useEffect)(()=>{aW().catch(Ae)},[n]),(0,Y.useEffect)(()=>{v?.updateOptions(oW(r)),y?.updateOptions(oW(r)),sW(r).catch(Ae)},[v,y,r]),(0,Y.useEffect)(()=>{y?.updateOptions({renderSideBySide:!o.inline,ignoreTrimWhitespace:!o.whitespace,hideUnchangedRegions:{enabled:o.collapse}})},[y,o.inline,o.whitespace,o.collapse]),(0,Y.useEffect)(()=>{if(v===null||y===null||(b.current!==null&&a.set(b.current.id,b.current.editor.saveViewState()),b.current=null,v.setModel(le===null?ue:null),y.setModel(le===null||ue===null?null:{original:le,modified:ue}),ue===null||ne===null))return;let e=le===null?v:y.getModifiedEditor();e.updateOptions({readOnly:!de}),y.updateOptions({readOnly:!de}),e.restoreViewState(a.get(ne)??null),e.focus(),b.current={id:ne,editor:e}},[v,y,le,ue,ne,de,a]);let me=(0,Y.useEffectEvent)(re);(0,Y.useEffect)(()=>me(),[ne]),_W({machine:e.machine,projectId:e.projectId,spec:oe?.spec,original:le,modified:ue,onPerform:_e});function he(e){window.innerWidth<640&&ve({sidebar:!1}),te.open(e)}async function _e(e){p(e=>e+1);try{await e()}catch(e){Ae(e)}finally{p(e=>e-1),ee()}}function ve(e){s(t=>({...t,...e}))}function ye(){b.current!==null&&a.set(b.current.id,b.current.editor.saveViewState()),pp(e.machine,e.projectId,{tabs:te.tabs.map(e=>({spec:e.spec,view:a.get(e.spec.id)??null})),active:ne,expanded:c,settings:o})}(0,Y.useEffect)(ye);let be=(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,title:`Toggle Primary Side Bar`,"aria-label":`Toggle Primary Side Bar`,"aria-pressed":o.sidebar,onClick:()=>ve({sidebar:!o.sidebar}),children:(0,X.jsx)(je,{icon:ge,className:`size-4`})}),xe=(0,X.jsxs)(X.Fragment,{children:[be,(0,X.jsx)(FW,{view:o.view,onView:e=>ve({view:e})})]});return(0,X.jsx)(Ve,{open:!0,onOpenChange:()=>te.requestClose(),children:(0,X.jsxs)(ze,{"aria-describedby":void 0,showCloseButton:!1,className:`top-0 left-0 flex h-dvh w-dvw max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none border-0 p-0 sm:max-w-none`,onEscapeKeyDown:e=>e.preventDefault(),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),ne!==null&&te.save(ne)),(e.metaKey||e.ctrlKey)&&e.key===`w`&&(e.preventDefault(),ne!==null&&te.close(ne)),(e.metaKey||e.ctrlKey)&&e.shiftKey&&e.key.toLowerCase()===`v`&&pe!==null&&(e.preventDefault(),ve({preview:!o.preview}))},children:[(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:Re(`border-sidebar-border relative shrink-0 border-r`,!o.sidebar&&`hidden`),style:{width:o.width},children:[o.view===`explorer`&&(0,X.jsx)(hp,{machine:e.machine,projectId:e.projectId,root:t?.path??``,header:xe,expanded:c,onExpanded:l,active:oe?.spec.path??null,onOpen:e=>he(TW(``,e)),onPreview:e=>he(EW(``,e)),onRenamed:te.renamed,onDeleted:te.deleted}),o.view===`scm`&&(0,X.jsx)(tG,{machine:e.machine,projectId:e.projectId,name:t?.name??``,root:t?.path??``,header:xe,repos:ae,error:ie.error,busy:f>0,settings:o,onSettings:ve,onMessage:(e,t)=>s(n=>({...n,messages:{...n.messages,[e]:t}})),active:ne,onOpen:he,onRefresh:ee,onPerform:_e,onCheckout:h}),(0,X.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:`hover:bg-primary absolute inset-y-0 -right-0.5 z-10 w-1 cursor-col-resize touch-none transition-colors delay-100`,onPointerDown:e=>Fe(e,e=>ve({width:Math.min(Math.max(e.clientX,200),window.innerWidth-240)}))})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:`bg-sidebar flex h-9 shrink-0 items-center shadow-[inset_0_-1px_0_var(--sidebar-border)]`,children:[!o.sidebar&&(0,X.jsx)(`div`,{className:`shrink-0 px-1.5`,children:be}),(0,X.jsx)(Be,{className:`sr-only`,children:`Editor`}),(0,X.jsx)(yp,{tabs:te.tabs.map(e=>({id:e.spec.id,path:e.spec.path,label:e.spec.label})),active:ne,dirty:te.dirty.map(e=>e.spec.id),onSelect:te.setActive,onClose:te.close}),oe!==void 0&&le!==null&&(0,X.jsx)(IW,{settings:o,onSettings:ve,onOpenFile:()=>he(TW(oe.spec.repo,oe.spec.path)),onPrevious:()=>y?.goToDiff(`previous`),onNext:()=>y?.goToDiff(`next`)}),pe!==null&&(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,className:`ml-1.5 shrink-0`,title:`Toggle Preview`,"aria-label":`Toggle Preview`,"aria-pressed":o.preview,onClick:()=>ve({preview:!o.preview}),children:(0,X.jsx)(je,{icon:sp,className:`size-4`})}),(0,X.jsx)(Me,{size:`icon-micro`,variant:`ghost`,className:`mx-1.5 shrink-0`,title:`Close`,"aria-label":`Close`,onClick:te.requestClose,children:(0,X.jsx)(je,{icon:Oe,className:`size-4`})})]}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:Re(`relative min-w-0 flex-1`,pe!==null&&o.preview&&`max-sm:hidden`,ce!==null&&`hidden`),children:[(0,X.jsx)(`div`,{ref:g.codeHost,className:Re(`absolute inset-0`,(ue===null||le!==null)&&`hidden`)}),(0,X.jsx)(`div`,{ref:g.diffHost,className:Re(`absolute inset-0`,(ue===null||le===null)&&`hidden`)}),oe?.document.status===`image`&&(0,X.jsx)(Y.Suspense,{children:(0,X.jsx)(iG,{src:oe.document.src,alt:oe.spec.path})}),(0,X.jsx)(cp,{document:oe?.document,view:o.view})]}),pe!==null&&o.preview&&v!==null&&oe!==void 0&&(0,X.jsx)(cW,{machine:e.machine,projectId:e.projectId,path:oe.spec.path,model:pe,editor:v,onOpen:e=>he(TW(``,e))}),ce!==null&&oe!==void 0&&(0,X.jsx)(cW,{machine:e.machine,projectId:e.projectId,path:oe.spec.path,model:ce,editor:null,onOpen:e=>he(TW(``,e))},oe.spec.id)]})]})]}),(0,X.jsx)(hW,{editor:ue===null?null:le===null?v:y?.getModifiedEditor()??null,language:se?.language??null,children:fe!==null&&(0,X.jsx)(LW,{repo:fe,busy:f>0,onCheckout:()=>h(fe),onSync:()=>void _e(()=>Te(e.machine,`git.sync`,{projectId:e.projectId,repo:fe.path})),onPublish:()=>void _e(()=>Te(e.machine,`git.push`,{projectId:e.projectId,repo:fe.path}))})}),(0,X.jsx)(dp,{}),(0,X.jsx)(mW,{open:te.closing!==null,paths:te.closingTabs.map(e=>e.spec.path),onCancel:()=>te.setClosing(null),onFinish:e=>void te.finish(e)}),m!==null&&(0,X.jsx)(_,{machine:e.machine,projectId:e.projectId,repo:{...m,changed:m.merge.length+m.staged.length+m.changes.length},onRefresh:ee,onClose:()=>h(null)})]})})}export{aG as EditorDialog};
|