smart-home-engine 1.53.0 → 1.53.1
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/dist/web/assets/{index-COKTfw7g.js → index-CBrAPut6.js} +4 -4
- package/dist/web/assets/{tsMode-BIGdBOAo.js → tsMode-CzP5eDeL.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/src/index.js +15 -0
- package/src/web/ai-tools.js +1 -1
- package/src/web/prompts/tools.md +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-BRIqcXAV.js","assets/monaco-langs-DKJI_o9J.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-BRIqcXAV.js","assets/monaco-langs-DKJI_o9J.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-CzP5eDeL.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var _F=Object.defineProperty;var L2=r=>{throw TypeError(r)};var bF=(r,e,t)=>e in r?_F(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var cs=(r,e,t)=>bF(r,typeof e!="symbol"?e+"":e,t),Sb=(r,e,t)=>e.has(r)||L2("Cannot "+t);var qt=(r,e,t)=>(Sb(r,e,"read from private field"),t?t.call(r):e.get(r)),is=(r,e,t)=>e.has(r)?L2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),ns=(r,e,t,i)=>(Sb(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),zs=(r,e,t)=>(Sb(r,e,"access private method"),t);import{_ as s6,m as o6,l as dn,A as vr,C as ri,I as $s,D as Z0,a as ho,g as r6,M as Qi,b as An,E as el,c as pe,r as Ss,d as Sa,e as F,f as CF,h as Os,R as ss,S as En,i as Zo,j as ka,k as hs,n as Kn,o as Yt,p as Si,K as po,q as rn,s as Hi,t as Co,u as Ye,v as Jn,O as Bl,w as mo,P as un,x as kb,y as Y0,z as a6,B as lc,F as tl,G as ny,H as Mo,U as Bs,J as ap,L as hn,N as pc,Q as yF,T as ur,V as sy,W as wF,X as l6,$ as on,Y as xs,Z as us,a0 as Ys,a1 as Nn,a2 as qr,a3 as t0,a4 as Oi,a5 as wx,a6 as EF,a7 as SF,a8 as bo,a9 as kF,aa as il,ab as xr,ac as gn,ad as c6,ae as Ws,af as DF,ag as AF,ah as fr,ai as Hp,aj as go,ak as p1,al as or,am as Id,an as LS,ao as g1,ap as Fo,aq as lp,ar as Lo,as as v1,at as x1,au as BF,av as X0,aw as zp,ax as Sc,ay as FF,az as Wp,aA as LF,aB as IS,aC as IF,aD as PF,aE as I2,aF as uo,aG as cc,aH as rr,aI as Vn,aJ as nc,aK as TF,aL as Tl,aM as jr,aN as ko,aO as nl,aP as PS,aQ as yo,aR as lo,aS as Qx,aT as jn,aU as d6,aV as MF,aW as TS,aX as m1,aY as MS,aZ as RS,a_ as lu,a$ as RF,b0 as NS,b1 as NF,b2 as OS,b3 as kc,b4 as Dc,b5 as cp,b6 as i0,b7 as Ar,b8 as Q0,b9 as Jx,ba as Db,bb as Ps,bc as HS,bd as J0,be as _1,bf as OF,bg as u6,bh as n0,bi as dp,bj as s0,bk as ev,bl as b1,bm as ps,bn as Pd,bo as tv,bp as HF,bq as zF,br as zS,bs as WF,bt as em,bu as na,bv as WS,bw as up,bx as Ac,by as jp,bz as Xn,bA as hp,bB as h6,bC as iv,bD as jF,bE as cu,bF as Ji,bG as P2,bH as Ex,bI as f6,bJ as Ba,bK as Ya,bL as Ts,bM as fp,bN as ma,bO as pp,bP as Zs,bQ as o0,bR as Sh,bS as oy,bT as p6,bU as g6,bV as v6,bW as jS,bX as yr,bY as ws,bZ as nv,b_ as x6,b$ as dc,c0 as C1,c1 as VF,c2 as vf,c3 as T2,c4 as sv,c5 as m6,c6 as xf,c7 as $F,c8 as ca,c9 as y1,ca as qF,cb as mr,cc as sl,cd as ov,ce as r0,cf as _6,cg as Jr,ch as rv,ci as w1,cj as UF,ck as GF,cl as KF,cm as Vp,cn as Ml,co as Do,cp as ZF,cq as VS,cr as YF,cs as XF,ct as M2,cu as QF,cv as av,cw as gc,cx as ry,cy as rh,cz as vc,cA as JF,cB as Fl,cC as _a,cD as Hr,cE as R2,cF as Xo,cG as lv,cH as yd,cI as Rl,cJ as eL,cK as ol,cL as a0,cM as E1,cN as b6,cO as tL,cP as iL,cQ as $S,cR as nL,cS as l0,cT as sL,cU as Xc,cV as c0,cW as N2,cX as oL,cY as rL,cZ as Hl,c_ as aL,c$ as qS,d0 as C6,d1 as y6,d2 as w6,d3 as E6,d4 as lL,d5 as cL,d6 as S6,d7 as k6,d8 as dL,d9 as US,da as uL,db as hL,dc as io,dd as fL,de as GS,df as pL,dg as mf,dh as O2,di as gL,dj as vL,dk as xL,dl as mL,dm as _L,dn as bL,dp as gp,dq as S1,dr as ay,ds as CL,dt as yL,du as H2,dv as ly,dw as wL,dx as z2,dy as Ab,dz as EL,dA as D6,dB as SL,dC as A6,dD as cy,dE as kL,dF as DL,dG as AL,dH as B6,dI as F6,dJ as BL,dK as tm,dL as L6,dM as k1,dN as FL,dO as LL,dP as wd,dQ as KS,dR as IL,dS as W2,dT as j2,dU as PL,dV as _f,dW as I6,dX as TL,dY as ML,dZ as RL,d_ as NL,d$ as P6,e0 as T6,e1 as M6,e2 as R6,e3 as OL,e4 as Ll,e5 as V2,e6 as HL,e7 as cv,e8 as zL,e9 as mg,ea as N6,eb as $2,ec as d0,ed as O6,ee as im,ef as WL,eg as H6,eh as jL,ei as z6,ej as VL,ek as $L,el as W6,em as j6,en as xc,eo as D1,ep as qL,eq as V6,er as Vr,es as du,et as $6,eu as UL,ev as GL,ew as q6,ex as U6,ey as KL,ez as G6,eA as K6,eB as u0,eC as ZL,eD as YL,eE as XL,eF as QL,eG as ag,eH as q2,eI as JL,eJ as eI,eK as tI,eL as nm,eM as Ho,eN as iI,eO as dy,eP as kh,eQ as nI,eR as ic,eS as sI,eT as oI,eU as Z6,eV as rI,eW as Mg,eX as aI,eY as lI,eZ as cI,e_ as dI,e$ as U2,f0 as G2,f1 as K2,f2 as Dh,f3 as ZS,f4 as Y6,f5 as uy,f6 as Sx,f7 as X6,f8 as sm,f9 as uI,fa as hI,fb as fI,fc as pI,fd as YS,fe as Q6,ff as gI,fg as om,fh as J6,fi as e5,fj as vI,fk as xI,fl as mI,fm as _I,fn as bI,fo as CI,fp as yI,fq as wI,fr as t5,fs as EI,ft as rm,fu as i5,fv as SI,fw as n5,fx as kI,fy as s5,fz as o5,fA as DI,fB as Z2,fC as r5,fD as Y2,fE as AI,fF as Bb,fG as X2,fH as BI,fI as FI,fJ as LI,fK as wl,fL as Ed,fM as II,fN as Q2,fO as kx,fP as PI,fQ as sc,fR as A1,fS as hy,fT as TI,fU as a5,fV as l5,fW as Qo,fX as J2,fY as Wv,fZ as XS,f_ as MI,f$ as RI,g0 as NI,g1 as OI,g2 as HI,g3 as zI,g4 as WI,g5 as jI,g6 as e8,g7 as VI,g8 as $I,g9 as qI,ga as vp,gb as Rg,gc as c5,gd as UI,ge as QS,gf as Dx,gg as jv,gh as Fb,gi as GI,gj as KI,gk as d5,gl as ZI,gm as JS,gn as YI,go as XI,gp as u5,gq as B1,gr as QI,gs as am,gt as e9,gu as t9,gv as i9,gw as h5,gx as f5,gy as p5,gz as g5,gA as v5,gB as x5,gC as m5,gD as t8,gE as _5,gF as qh,gG as JI,gH as eP,gI as tP,gJ as iP,gK as b5,gL as nP,gM as sP,gN as i8,gO as fy,gP as nd,gQ as oP,gR as rP,gS as aP,gT as lP,gU as cP,gV as dP,gW as n8,gX as n9,gY as py,gZ as uP,g_ as gy,g$ as hP,h0 as fP,h1 as pP,h2 as gP,h3 as s9,h4 as C5,h5 as s8,h6 as o8,h7 as vP,h8 as xP,h9 as mP,ha as r8,hb as Lb,hc as _P,hd as bP,he as CP,hf as Ib,hg as y5,hh as w5,hi as E5,hj as S5,hk as mc,hl as k5,hm as o9,hn as a8,ho as yP,hp as D5,hq as wP,hr as EP,hs as F1,ht as L1,hu as Ah,hv as I1,hw as dv,hx as SP,hy as P1,hz as kP,hA as DP,hB as AP,hC as A5,hD as lg,hE as BP,hF as FP,hG as LP,hH as IP,hI as uv,hJ as PP,hK as B5,hL as F5,hM as L5,hN as vy,hO as TP,hP as MP,hQ as RP,hR as NP,hS as OP,hT as xy,hU as HP,hV as zP,hW as WP,hX as jP,hY as VP,hZ as $P,h_ as qP,h$ as UP,i0 as I5,i1 as GP,i2 as KP,i3 as ZP,i4 as l8,i5 as YP,i6 as XP,i7 as Ka,i8 as Ko,i9 as my,ia as P5,ib as QP,ic as JP}from"./monaco-langs-DKJI_o9J.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function t(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=t(n);fetch(n.href,s)}})();const T5=!1;var r9=Array.isArray,eT=Array.prototype.indexOf,lm=Array.prototype.includes,T1=Array.from,tT=Object.defineProperty,Mf=Object.getOwnPropertyDescriptor,iT=Object.getOwnPropertyDescriptors,nT=Object.prototype,sT=Array.prototype,M5=Object.getPrototypeOf,c8=Object.isExtensible;const $o=()=>{};function oT(r){for(var e=0;e<r.length;e++)r[e]()}function R5(){var r,e,t=new Promise((i,n)=>{r=i,e=n});return{promise:t,resolve:r,reject:e}}function rT(r,e,t=!1){return r===void 0?t?e():e:r}function cm(r,e){if(Array.isArray(r))return r;if(!(Symbol.iterator in r))return Array.from(r);const t=[];for(const i of r)if(t.push(i),t.length===e)break;return t}const nr=2,xp=4,M1=8,N5=1<<24,Xa=16,Ja=32,Sd=64,_y=128,ya=512,zo=1024,qo=2048,Nl=4096,Er=8192,wa=16384,$p=32768,by=1<<25,mp=65536,dm=1<<17,aT=1<<18,qp=1<<19,lT=1<<20,Dl=1<<25,ah=65536,um=1<<21,Rf=1<<22,sd=1<<23,uu=Symbol("$state"),cT=Symbol("legacy props"),dT=Symbol(""),Ax=Symbol("attributes"),Cy=Symbol("class"),yy=Symbol("style"),_g=Symbol("text"),Bx=Symbol("form reset"),R1=new class extends Error{constructor(){super(...arguments);cs(this,"name","StaleReactionError");cs(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var t6;const uT=!!((t6=globalThis.document)!=null&&t6.contentType)&&globalThis.document.contentType.includes("xml");function O5(r){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function hT(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function fT(r,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function pT(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function gT(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function vT(r){throw new Error("https://svelte.dev/e/effect_orphan")}function xT(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function mT(r){throw new Error("https://svelte.dev/e/props_invalid_value")}function _T(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function bT(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function CT(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function yT(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const wT=1,ET=2,H5=4,ST=8,kT=16,DT=1,AT=4,BT=8,FT=16,z5=1,LT=2,Oo=Symbol("uninitialized"),W5="http://www.w3.org/1999/xhtml",IT="http://www.w3.org/2000/svg",PT="http://www.w3.org/1998/Math/MathML";function TT(){console.warn("https://svelte.dev/e/derived_inert")}function MT(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function RT(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function j5(r){return r===this.v}function NT(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function V5(r){return!NT(r,this.v)}let OT=!1,ir=null;function _p(r){ir=r}function _s(r,e=!1,t){ir={p:ir,i:!1,c:null,e:null,s:r,x:null,r:Es,l:null}}function bs(r){var e=ir,t=e.e;if(t!==null){e.e=null;for(var i of t)h3(i)}return r!==void 0&&(e.x=r),e.i=!0,ir=e.p,r??{}}function $5(){return!0}let Jd=[];function q5(){var r=Jd;Jd=[],oT(r)}function Il(r){if(Jd.length===0&&!Og){var e=Jd;queueMicrotask(()=>{e===Jd&&q5()})}Jd.push(r)}function HT(){for(;Jd.length>0;)q5()}function U5(r){var e=Es;if(e===null)return ys.f|=sd,r;if((e.f&$p)===0&&(e.f&xp)===0)throw r;Qc(r,e)}function Qc(r,e){for(;e!==null;){if((e.f&_y)!==0){if((e.f&$p)===0)throw r;try{e.b.error(r);return}catch(t){r=t}}e=e.parent}throw r}const zT=-7169;function Eo(r,e){r.f=r.f&zT|e}function a9(r){(r.f&ya)!==0||r.deps===null?Eo(r,zo):Eo(r,Nl)}function G5(r){if(r!==null)for(const e of r)(e.f&nr)===0||(e.f&ah)===0||(e.f^=ah,G5(e.deps))}function K5(r,e,t){(r.f&qo)!==0?e.add(r):(r.f&Nl)!==0&&t.add(r),G5(r.deps),Eo(r,zo)}let Vv=!1;function WT(r){var e=Vv;try{return Vv=!1,[r(),Vv]}finally{Vv=e}}let Pb=null,Uh=null,zn=null,Ng=null,Yo=null,wy=null,Og=!1,Tb=!1,bf=null,Fx=null;var d8=0;let jT=1;var Vf,Kc,nu,$f,qf,Uf,Ql,Gf,Rr,V0,Jl,Ha,_l,Kf,su,no,Ey,bg,Sy,Z5,Y5,df,VT,Cg;const C_=class C_{constructor(){is(this,no);cs(this,"id",jT++);is(this,Vf,!1);cs(this,"linked",!0);is(this,Kc,null);is(this,nu,null);cs(this,"async_deriveds",new Map);cs(this,"current",new Map);cs(this,"previous",new Map);is(this,$f,new Set);is(this,qf,new Set);is(this,Uf,0);is(this,Ql,new Map);is(this,Gf,null);is(this,Rr,[]);is(this,V0,[]);is(this,Jl,new Set);is(this,Ha,new Set);is(this,_l,new Map);is(this,Kf,new Set);cs(this,"is_fork",!1);is(this,su,!1);Uh===null?Pb=Uh=this:(ns(Uh,nu,this),ns(this,Kc,Uh)),Uh=this}skip_effect(e){qt(this,_l).has(e)||qt(this,_l).set(e,{d:[],m:[]}),qt(this,Kf).delete(e)}unskip_effect(e,t=i=>this.schedule(i)){var i=qt(this,_l).get(e);if(i){qt(this,_l).delete(e);for(var n of i.d)Eo(n,qo),t(n);for(n of i.m)Eo(n,Nl),t(n)}qt(this,Kf).add(e)}capture(e,t,i=!1){e.v!==Oo&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&sd)===0&&(this.current.set(e,[t,i]),Yo==null||Yo.set(e,t)),this.is_fork||(e.v=t)}activate(){zn=this}deactivate(){zn=null,Yo=null}flush(){try{Tb=!0,zn=this,zs(this,no,bg).call(this)}finally{d8=0,wy=null,bf=null,Fx=null,Tb=!1,zn=null,Yo=null,hu.clear()}}discard(){var e;for(const t of qt(this,qf))t(this);qt(this,qf).clear(),zs(this,no,Cg).call(this),(e=qt(this,Gf))==null||e.resolve()}register_created_effect(e){qt(this,V0).push(e)}increment(e,t){if(ns(this,Uf,qt(this,Uf)+1),e){let i=qt(this,Ql).get(t)??0;qt(this,Ql).set(t,i+1)}}decrement(e,t){if(ns(this,Uf,qt(this,Uf)-1),e){let i=qt(this,Ql).get(t)??0;i===1?qt(this,Ql).delete(t):qt(this,Ql).set(t,i-1)}qt(this,su)||(ns(this,su,!0),Il(()=>{ns(this,su,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(const i of e)qt(this,Jl).add(i);for(const i of t)qt(this,Ha).add(i);e.clear(),t.clear()}oncommit(e){qt(this,$f).add(e)}ondiscard(e){qt(this,qf).add(e)}settled(){return(qt(this,Gf)??ns(this,Gf,R5())).promise}static ensure(){if(zn===null){const e=zn=new C_;!Tb&&!Og&&Il(()=>{qt(e,Vf)||e.flush()})}return zn}apply(){{Yo=null;return}}schedule(e){var n;if(wy=e,(n=e.b)!=null&&n.is_pending&&(e.f&(xp|M1|N5))!==0&&(e.f&$p)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var i=t.f;if(bf!==null&&t===Es&&(ys===null||(ys.f&nr)===0))return;if((i&(Sd|Ja))!==0){if((i&zo)===0)return;t.f^=zo}}qt(this,Rr).push(t)}};Vf=new WeakMap,Kc=new WeakMap,nu=new WeakMap,$f=new WeakMap,qf=new WeakMap,Uf=new WeakMap,Ql=new WeakMap,Gf=new WeakMap,Rr=new WeakMap,V0=new WeakMap,Jl=new WeakMap,Ha=new WeakMap,_l=new WeakMap,Kf=new WeakMap,su=new WeakMap,no=new WeakSet,Ey=function(){if(this.is_fork)return!0;for(const i of qt(this,Ql).keys()){for(var e=i,t=!1;e.parent!==null;){if(qt(this,_l).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},bg=function(){var d,u,g,x;ns(this,Vf,!0),d8++>1e3&&(zs(this,no,Cg).call(this),qT());for(const m of qt(this,Jl))qt(this,Ha).delete(m),Eo(m,qo),this.schedule(m);for(const m of qt(this,Ha))Eo(m,Nl),this.schedule(m);const e=qt(this,Rr);ns(this,Rr,[]),this.apply();var t=bf=[],i=[],n=Fx=[];for(const m of e)try{zs(this,no,Sy).call(this,m,t,i)}catch(C){throw J5(m),zs(this,no,Ey).call(this)||this.discard(),C}if(zn=null,n.length>0){var s=C_.ensure();for(const m of n)s.schedule(m)}if(bf=null,Fx=null,zs(this,no,Ey).call(this)){zs(this,no,df).call(this,i),zs(this,no,df).call(this,t);for(const[m,C]of qt(this,_l))Q5(m,C);n.length>0&&zs(d=zn,no,bg).call(d);return}const a=zs(this,no,Z5).call(this);if(a){zs(this,no,df).call(this,i),zs(this,no,df).call(this,t),zs(u=a,no,Y5).call(u,this);return}qt(this,Jl).clear(),qt(this,Ha).clear();for(const m of qt(this,$f))m(this);qt(this,$f).clear(),Ng=this,u8(i),u8(t),Ng=null,(g=qt(this,Gf))==null||g.resolve();var l=zn;if(qt(this,Uf)===0&&(qt(this,Rr).length===0||l!==null)&&zs(this,no,Cg).call(this),qt(this,Rr).length>0)if(l!==null){const m=l;qt(m,Rr).push(...qt(this,Rr).filter(C=>!qt(m,Rr).includes(C)))}else l=this;l!==null&&zs(x=l,no,bg).call(x)},Sy=function(e,t,i){e.f^=zo;for(var n=e.first;n!==null;){var s=n.f,a=(s&(Ja|Sd))!==0,l=a&&(s&zo)!==0,d=l||(s&Er)!==0||qt(this,_l).has(n);if(!d&&n.fn!==null){a?n.f^=zo:(s&xp)!==0?t.push(n):pv(n)&&((s&Xa)!==0&&qt(this,Ha).add(n),Cp(n));var u=n.first;if(u!==null){n=u;continue}}for(;n!==null;){var g=n.next;if(g!==null){n=g;break}n=n.parent}}},Z5=function(){for(var e=qt(this,Kc);e!==null;){if(!e.is_fork){for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e}e=qt(e,Kc)}return null},Y5=function(e){var i;for(const[n,s]of e.current)!this.previous.has(n)&&e.previous.has(n)&&this.previous.set(n,e.previous.get(n)),this.current.set(n,s);for(const[n,s]of e.async_deriveds){const a=this.async_deriveds.get(n);a&&s.promise.then(a.resolve).catch(a.reject)}this.transfer_effects(qt(e,Jl),qt(e,Ha));const t=n=>{var s=n.reactions;if(s!==null)for(const d of s){var a=d.f;if((a&nr)!==0)t(d);else{var l=d;a&(Rf|Xa)&&!this.async_deriveds.has(l)&&(qt(this,Ha).delete(l),Eo(l,qo),this.schedule(l))}}};for(const n of this.current.keys())t(n);this.oncommit(()=>e.discard()),zs(i=e,no,Cg).call(i),zn=this,zs(this,no,bg).call(this)},df=function(e){for(var t=0;t<e.length;t+=1)K5(e[t],qt(this,Jl),qt(this,Ha))},VT=function(){var g;for(let x=Pb;x!==null;x=qt(x,nu)){var e=x.id<this.id,t=[];for(const[m,[C,_]]of this.current){if(x.current.has(m)){var i=x.current.get(m)[0];if(e&&C!==i)x.current.set(m,[C,_]);else continue}t.push(m)}if(e)for(const[m,C]of this.async_deriveds){const _=x.async_deriveds.get(m);_&&C.promise.then(_.resolve).catch(_.reject)}if(qt(x,Vf)){var n=[...x.current.keys()].filter(m=>!x.current.get(m)[1]&&!this.current.has(m));if(n.length===0)e&&x.discard();else if(t.length>0){if(e)for(const m of qt(this,Kf))x.unskip_effect(m,C=>{var _;(C.f&(Xa|Rf))!==0?x.schedule(C):zs(_=x,no,df).call(_,[C])});x.activate();var s=new Set,a=new Map;for(var l of t)X5(l,n,s,a);a=new Map;var d=[...x.current].filter(([m,C])=>{const _=this.current.get(m);return _?_[0]!==C[0]||_[1]!==C[1]:!0}).map(([m])=>m);if(d.length>0)for(const m of qt(this,V0))(m.f&(wa|Er|dm))===0&&l9(m,d,a)&&((m.f&(Rf|Xa))!==0?(Eo(m,qo),x.schedule(m)):qt(x,Jl).add(m));if(qt(x,Rr).length>0&&!qt(x,su)){x.apply();for(var u of qt(x,Rr))zs(g=x,no,Sy).call(g,u,[],[]);ns(x,Rr,[])}x.deactivate()}}}},Cg=function(){if(this.linked){var e=qt(this,Kc),t=qt(this,nu);e===null?Pb=t:ns(e,nu,t),t===null?Uh=e:ns(t,Kc,e),this.linked=!1}};let lh=C_;function $T(r){var e=Og;Og=!0;try{for(var t;;){if(HT(),zn===null)return t;zn.flush()}}finally{Og=e}}function qT(){try{xT()}catch(r){Qc(r,wy)}}let Ra=null;function u8(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var i=r[t++];if((i.f&(wa|Er))===0&&pv(i)&&(Ra=new Set,Cp(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&g3(i),(Ra==null?void 0:Ra.size)>0)){hu.clear();for(const n of Ra){if((n.f&(wa|Er))!==0)continue;const s=[n];let a=n.parent;for(;a!==null;)Ra.has(a)&&(Ra.delete(a),s.push(a)),a=a.parent;for(let l=s.length-1;l>=0;l--){const d=s[l];(d.f&(wa|Er))===0&&Cp(d)}}Ra.clear()}}Ra=null}}function X5(r,e,t,i){if(!t.has(r)&&(t.add(r),r.reactions!==null))for(const n of r.reactions){const s=n.f;(s&nr)!==0?X5(n,e,t,i):(s&(Rf|Xa))!==0&&(s&qo)===0&&l9(n,e,i)&&(Eo(n,qo),c9(n))}}function l9(r,e,t){const i=t.get(r);if(i!==void 0)return i;if(r.deps!==null)for(const n of r.deps){if(lm.call(e,n))return!0;if((n.f&nr)!==0&&l9(n,e,t))return t.set(n,!0),!0}return t.set(r,!1),!1}function c9(r){zn.schedule(r)}function Q5(r,e){if(!((r.f&Ja)!==0&&(r.f&zo)!==0)){(r.f&qo)!==0?e.d.push(r):(r.f&Nl)!==0&&e.m.push(r),Eo(r,zo);for(var t=r.first;t!==null;)Q5(t,e),t=t.next}}function J5(r){Eo(r,zo);for(var e=r.first;e!==null;)J5(e),e=e.next}function UT(r){let e=0,t=ch(0),i;return()=>{h9()&&(o(t),fv(()=>(e===0&&(i=Io(()=>r(()=>Hg(t)))),e+=1,()=>{Il(()=>{e-=1,e===0&&(i==null||i(),i=void 0,Hg(t))})})))}}var GT=mp|qp;function KT(r,e,t,i){new ZT(r,e,t,i)}var ua,FS,ha,ou,Nr,fa,br,Zr,ec,ru,Zc,Zf,$0,q0,tc,y_,So,YT,XT,QT,ky,Lx,Ix,Dy,Ay;class ZT{constructor(e,t,i,n){is(this,So);cs(this,"parent");cs(this,"is_pending",!1);cs(this,"transform_error");is(this,ua);is(this,FS,null);is(this,ha);is(this,ou);is(this,Nr);is(this,fa,null);is(this,br,null);is(this,Zr,null);is(this,ec,null);is(this,ru,0);is(this,Zc,0);is(this,Zf,!1);is(this,$0,new Set);is(this,q0,new Set);is(this,tc,null);is(this,y_,UT(()=>(ns(this,tc,ch(qt(this,ru))),()=>{ns(this,tc,null)})));var s;ns(this,ua,e),ns(this,ha,t),ns(this,ou,a=>{var l=Es;l.b=this,l.f|=_y,i(a)}),this.parent=Es.b,this.transform_error=n??((s=this.parent)==null?void 0:s.transform_error)??(a=>a),ns(this,Nr,z1(()=>{zs(this,So,ky).call(this)},GT))}defer_effect(e){K5(e,qt(this,$0),qt(this,q0))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!qt(this,ha).pending}update_pending_count(e,t){zs(this,So,Dy).call(this,e,t),ns(this,ru,qt(this,ru)+e),!(!qt(this,tc)||qt(this,Zf))&&(ns(this,Zf,!0),Il(()=>{ns(this,Zf,!1),qt(this,tc)&&bp(qt(this,tc),qt(this,ru))}))}get_effect_pending(){return qt(this,y_).call(this),o(qt(this,tc))}error(e){if(!qt(this,ha).onerror&&!qt(this,ha).failed)throw e;zn!=null&&zn.is_fork?(qt(this,fa)&&zn.skip_effect(qt(this,fa)),qt(this,br)&&zn.skip_effect(qt(this,br)),qt(this,Zr)&&zn.skip_effect(qt(this,Zr)),zn.oncommit(()=>{zs(this,So,Ay).call(this,e)})):zs(this,So,Ay).call(this,e)}}ua=new WeakMap,FS=new WeakMap,ha=new WeakMap,ou=new WeakMap,Nr=new WeakMap,fa=new WeakMap,br=new WeakMap,Zr=new WeakMap,ec=new WeakMap,ru=new WeakMap,Zc=new WeakMap,Zf=new WeakMap,$0=new WeakMap,q0=new WeakMap,tc=new WeakMap,y_=new WeakMap,So=new WeakSet,YT=function(){try{ns(this,fa,pa(()=>qt(this,ou).call(this,qt(this,ua))))}catch(e){this.error(e)}},XT=function(e){const t=qt(this,ha).failed;t&&ns(this,Zr,pa(()=>{t(qt(this,ua),()=>e,()=>()=>{})}))},QT=function(){const e=qt(this,ha).pending;e&&(this.is_pending=!0,ns(this,br,pa(()=>e(qt(this,ua)))),Il(()=>{var t=ns(this,ec,document.createDocumentFragment()),i=uc();t.append(i),ns(this,fa,zs(this,So,Ix).call(this,()=>pa(()=>qt(this,ou).call(this,i)))),qt(this,Zc)===0&&(qt(this,ua).before(t),ns(this,ec,null),fu(qt(this,br),()=>{ns(this,br,null)}),zs(this,So,Lx).call(this,zn))}))},ky=function(){try{if(this.is_pending=this.has_pending_snippet(),ns(this,Zc,0),ns(this,ru,0),ns(this,fa,pa(()=>{qt(this,ou).call(this,qt(this,ua))})),qt(this,Zc)>0){var e=ns(this,ec,document.createDocumentFragment());g9(qt(this,fa),e);const t=qt(this,ha).pending;ns(this,br,pa(()=>t(qt(this,ua))))}else zs(this,So,Lx).call(this,zn)}catch(t){this.error(t)}},Lx=function(e){this.is_pending=!1,e.transfer_effects(qt(this,$0),qt(this,q0))},Ix=function(e){var t=Es,i=ys,n=ir;Ol(qt(this,Nr)),Da(qt(this,Nr)),_p(qt(this,Nr).ctx);try{return lh.ensure(),e()}catch(s){return U5(s),null}finally{Ol(t),Da(i),_p(n)}},Dy=function(e,t){var i;if(!this.has_pending_snippet()){this.parent&&zs(i=this.parent,So,Dy).call(i,e,t);return}ns(this,Zc,qt(this,Zc)+e),qt(this,Zc)===0&&(zs(this,So,Lx).call(this,t),qt(this,br)&&fu(qt(this,br),()=>{ns(this,br,null)}),qt(this,ec)&&(qt(this,ua).before(qt(this,ec)),ns(this,ec,null)))},Ay=function(e){qt(this,fa)&&($r(qt(this,fa)),ns(this,fa,null)),qt(this,br)&&($r(qt(this,br)),ns(this,br,null)),qt(this,Zr)&&($r(qt(this,Zr)),ns(this,Zr,null));var t=qt(this,ha).onerror;let i=qt(this,ha).failed;var n=!1,s=!1;const a=()=>{if(n){RT();return}n=!0,s&&yT(),qt(this,Zr)!==null&&fu(qt(this,Zr),()=>{ns(this,Zr,null)}),zs(this,So,Ix).call(this,()=>{zs(this,So,ky).call(this)})},l=d=>{try{s=!0,t==null||t(d,a),s=!1}catch(u){Qc(u,qt(this,Nr)&&qt(this,Nr).parent)}i&&ns(this,Zr,zs(this,So,Ix).call(this,()=>{try{return pa(()=>{var u=Es;u.b=this,u.f|=_y,i(qt(this,ua),()=>d,()=>a)})}catch(u){return Qc(u,qt(this,Nr).parent),null}}))};Il(()=>{var d;try{d=this.transform_error(e)}catch(u){Qc(u,qt(this,Nr)&&qt(this,Nr).parent);return}d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(l,u=>Qc(u,qt(this,Nr)&&qt(this,Nr).parent)):l(d)})};function JT(r,e,t,i){const n=h0;var s=r.filter(m=>!m.settled);if(t.length===0&&s.length===0){i(e.map(n));return}var a=Es,l=eM(),d=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(m=>m.promise)):null;function u(m){if((a.f&wa)===0){l();try{i(m)}catch(C){Qc(C,a)}hm()}}var g=e3();if(t.length===0){d.then(()=>u(e.map(n))).finally(g);return}function x(){Promise.all(t.map(m=>tM(m))).then(m=>u([...e.map(n),...m])).catch(m=>Qc(m,a)).finally(g)}d?d.then(()=>{l(),x(),hm()}):x()}function eM(){var r=Es,e=ys,t=ir,i=zn;return function(s=!0){Ol(r),Da(e),_p(t),s&&(r.f&wa)===0&&(i==null||i.activate(),i==null||i.apply())}}function hm(r=!0){Ol(null),Da(null),_p(null),r&&(zn==null||zn.deactivate())}function e3(){var r=Es,e=r.b,t=zn,i=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,t),t.increment(i,r),()=>{e==null||e.update_pending_count(-1,t),t.decrement(i,r)}}function h0(r){var e=nr|qo;return Es!==null&&(Es.f|=qp),{ctx:ir,deps:null,effects:null,equals:j5,f:e,fn:r,reactions:null,rv:0,v:Oo,wv:0,parent:Es,ac:null}}const $v=Symbol("obsolete");function tM(r,e,t){let i=Es;i===null&&hT();var n=void 0,s=ch(Oo),a=!ys,l=new Set;return hM(()=>{var C,_;var d=Es,u=R5();n=u.promise;try{Promise.resolve(r()).then(u.resolve,E=>{E!==R1&&u.reject(E)}).finally(hm)}catch(E){u.reject(E),hm()}var g=zn;if(a){if((d.f&$p)!==0)var x=e3();if((C=i.b)!=null&&C.is_rendered())(_=g.async_deriveds.get(d))==null||_.reject($v);else for(const E of l.values())E.reject($v);l.add(u),g.async_deriveds.set(d,u)}const m=(E,k=void 0)=>{x==null||x(),l.delete(u),k!==$v&&(g.activate(),k?(s.f|=sd,bp(s,k)):((s.f&sd)!==0&&(s.f^=sd),bp(s,E)),g.deactivate())};u.promise.then(m,E=>m(null,E||"unknown"))}),H1(()=>{for(const d of l)d.reject($v)}),new Promise(d=>{function u(g){function x(){g===n?d(s):u(n)}g.then(x,x)}u(n)})}function rt(r){const e=h0(r);return m3(e),e}function d9(r){const e=h0(r);return e.equals=V5,e}function iM(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)$r(e[t])}}function u9(r){var e,t=Es,i=r.parent;if(!_c&&i!==null&&r.v!==Oo&&(i.f&(wa|Er))!==0)return TT(),r.v;Ol(i);try{r.f&=~ah,iM(r),e=y3(r)}finally{Ol(t)}return e}function t3(r){var e=u9(r);if(!r.equals(e)&&(r.wv=b3(),(!(zn!=null&&zn.is_fork)||r.deps===null)&&(zn!==null?(zn.capture(r,e,!0),Ng==null||Ng.capture(r,e,!0)):r.v=e,r.deps===null))){Eo(r,zo);return}_c||(Yo!==null?(h9()||zn!=null&&zn.is_fork)&&Yo.set(r,e):a9(r))}function nM(r){var e,t;if(r.effects!==null)for(const i of r.effects)(i.teardown||i.ac)&&((e=i.teardown)==null||e.call(i),(t=i.ac)==null||t.abort(R1),i.fn!==null&&(i.teardown=$o),i.ac=null,f0(i,0),p9(i))}function i3(r){if(r.effects!==null)for(const e of r.effects)e.teardown&&e.fn!==null&&Cp(e)}let fm=new Set;const hu=new Map;let n3=!1;function ch(r,e){var t={f:0,v:r,reactions:null,equals:j5,rv:0,wv:0};return t}function A(r,e){const t=ch(r);return m3(t),t}function sM(r,e=!1,t=!0){const i=ch(r);return e||(i.equals=V5),i}function p(r,e,t=!1){ys!==null&&(!Qa||(ys.f&dm)!==0)&&$5()&&(ys.f&(nr|Xa|Rf|dm))!==0&&(Pl===null||!Pl.has(r))&&CT();let i=t?wi(e):e;return bp(r,i,Fx)}function bp(r,e,t=null){if(!r.equals(e)){hu.set(r,_c?e:r.v);var i=lh.ensure();if(i.capture(r,e),(r.f&nr)!==0){const n=r;(r.f&qo)!==0&&u9(n),Yo===null&&a9(n)}r.wv=b3(),s3(r,qo,t),Es!==null&&(Es.f&zo)!==0&&(Es.f&(Ja|Sd))===0&&(da===null?pM([r]):da.push(r)),!i.is_fork&&fm.size>0&&!n3&&oM()}return e}function oM(){n3=!1;for(const r of fm){(r.f&zo)!==0&&Eo(r,Nl);let e;try{e=pv(r)}catch{e=!0}e&&Cp(r)}fm.clear()}function By(r,e=1){var t=o(r),i=e===1?t++:t--;return p(r,t),i}function Hg(r){p(r,r.v+1)}function s3(r,e,t){var i=r.reactions;if(i!==null)for(var n=i.length,s=0;s<n;s++){var a=i[s],l=a.f,d=(l&qo)===0;if(d&&Eo(a,e),(l&dm)!==0)fm.add(a);else if((l&nr)!==0){var u=a;Yo==null||Yo.delete(u),(l&ah)===0&&(l&ya&&(Es===null||(Es.f&um)===0)&&(a.f|=ah),s3(u,Nl,t))}else if(d){var g=a;(l&Xa)!==0&&Ra!==null&&Ra.add(g),t!==null?t.push(g):c9(g)}}}function wi(r){if(typeof r!="object"||r===null||uu in r)return r;const e=M5(r);if(e!==nT&&e!==sT)return r;var t=new Map,i=r9(r),n=A(0),s=pu,a=l=>{if(pu===s)return l();var d=ys,u=pu;Da(null),g8(s);var g=l();return Da(d),g8(u),g};return i&&t.set("length",A(r.length)),new Proxy(r,{defineProperty(l,d,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&_T();var g=t.get(d);return g===void 0?a(()=>{var x=A(u.value);return t.set(d,x),x}):p(g,u.value,!0),!0},deleteProperty(l,d){var u=t.get(d);if(u===void 0){if(d in l){const g=a(()=>A(Oo));t.set(d,g),Hg(n)}}else p(u,Oo),Hg(n);return!0},get(l,d,u){var C;if(d===uu)return r;var g=t.get(d),x=d in l;if(g===void 0&&(!x||(C=Mf(l,d))!=null&&C.writable)&&(g=a(()=>{var _=wi(x?l[d]:Oo),E=A(_);return E}),t.set(d,g)),g!==void 0){var m=o(g);return m===Oo?void 0:m}return Reflect.get(l,d,u)},getOwnPropertyDescriptor(l,d){var u=Reflect.getOwnPropertyDescriptor(l,d);if(u&&"value"in u){var g=t.get(d);g&&(u.value=o(g))}else if(u===void 0){var x=t.get(d),m=x==null?void 0:x.v;if(x!==void 0&&m!==Oo)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return u},has(l,d){var m;if(d===uu)return!0;var u=t.get(d),g=u!==void 0&&u.v!==Oo||Reflect.has(l,d);if(u!==void 0||Es!==null&&(!g||(m=Mf(l,d))!=null&&m.writable)){u===void 0&&(u=a(()=>{var C=g?wi(l[d]):Oo,_=A(C);return _}),t.set(d,u));var x=o(u);if(x===Oo)return!1}return g},set(l,d,u,g){var N;var x=t.get(d),m=d in l;if(i&&d==="length")for(var C=u;C<x.v;C+=1){var _=t.get(C+"");_!==void 0?p(_,Oo):C in l&&(_=a(()=>A(Oo)),t.set(C+"",_))}if(x===void 0)(!m||(N=Mf(l,d))!=null&&N.writable)&&(x=a(()=>A(void 0)),p(x,wi(u)),t.set(d,x));else{m=x.v!==Oo;var E=a(()=>wi(u));p(x,E)}var k=Reflect.getOwnPropertyDescriptor(l,d);if(k!=null&&k.set&&k.set.call(g,u),!m){if(i&&typeof d=="string"){var I=t.get("length"),M=Number(d);Number.isInteger(M)&&M>=I.v&&p(I,M+1)}Hg(n)}return!0},ownKeys(l){o(n);var d=Reflect.ownKeys(l).filter(x=>{var m=t.get(x);return m===void 0||m.v!==Oo});for(var[u,g]of t)g.v!==Oo&&!(u in l)&&d.push(u);return d},setPrototypeOf(){bT()}})}function h8(r){try{if(r!==null&&typeof r=="object"&&uu in r)return r[uu]}catch{}return r}function o3(r,e){return Object.is(h8(r),h8(e))}var Ea,r3,a3,l3,c3;function rM(){if(Ea===void 0){Ea=window,r3=document,a3=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;l3=Mf(e,"firstChild").get,c3=Mf(e,"nextSibling").get,c8(r)&&(r[Cy]=void 0,r[Ax]=null,r[yy]=void 0,r.__e=void 0),c8(t)&&(t[_g]=void 0)}}function uc(r=""){return document.createTextNode(r)}function ta(r){return l3.call(r)}function hv(r){return c3.call(r)}function f(r,e){return ta(r)}function Ct(r,e=!1){{var t=ta(r);return t instanceof Comment&&t.data===""?hv(t):t}}function h(r,e=1,t=!1){let i=r;for(;e--;)i=hv(i);return i}function aM(r){r.textContent=""}function d3(){return!1}function u3(r,e,t){return e==null||e===W5?t?document.createElement(r,{is:t}):document.createElement(r):t?document.createElementNS(e,r,{is:t}):document.createElementNS(e,r)}let f8=!1;function lM(){f8||(f8=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var e;if(!r.defaultPrevented)for(const t of r.target.elements)(e=t[Bx])==null||e.call(t)})},{capture:!0}))}function N1(r){var e=ys,t=Es;Da(null),Ol(null);try{return r()}finally{Da(e),Ol(t)}}function O1(r,e,t,i=t){r.addEventListener(e,()=>N1(t));const n=r[Bx];n?r[Bx]=()=>{n(),i(!0)}:r[Bx]=()=>i(!0),lM()}function cM(r){Es===null&&(ys===null&&vT(),gT()),_c&&pT()}function dM(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Bc(r,e){var t=Es;t!==null&&(t.f&Er)!==0&&(r|=Er);var i={ctx:ir,deps:null,nodes:null,f:r|qo|ya,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};zn==null||zn.register_created_effect(i);var n=i;if((r&xp)!==0)bf!==null?bf.push(i):lh.ensure().schedule(i);else if(e!==null){try{Cp(i)}catch(a){throw $r(i),a}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&qp)===0&&(n=n.first,(r&Xa)!==0&&(r&mp)!==0&&n!==null&&(n.f|=mp))}if(n!==null&&(n.parent=t,t!==null&&dM(n,t),ys!==null&&(ys.f&nr)!==0&&(r&Sd)===0)){var s=ys;(s.effects??(s.effects=[])).push(n)}return i}function h9(){return ys!==null&&!Qa}function H1(r){const e=Bc(M1,null);return Eo(e,zo),e.teardown=r,e}function cn(r){cM();var e=Es.f,t=!ys&&(e&Ja)!==0&&ir!==null&&!ir.i;if(t){var i=ir;(i.e??(i.e=[])).push(r)}else return h3(r)}function h3(r){return Bc(xp|lT,r)}function uM(r){lh.ensure();const e=Bc(Sd|qp,r);return(t={})=>new Promise(i=>{t.outro?fu(e,()=>{$r(e),i(void 0)}):($r(e),i(void 0))})}function f9(r){return Bc(xp,r)}function hM(r){return Bc(Rf|qp,r)}function fv(r,e=0){return Bc(M1|e,r)}function T(r,e=[],t=[],i=[]){JT(i,e,t,n=>{Bc(M1,()=>r(...n.map(o)))})}function z1(r,e=0){var t=Bc(Xa|e,r);return t}function pa(r){return Bc(Ja|qp,r)}function f3(r){var e=r.teardown;if(e!==null){const t=_c,i=ys;p8(!0),Da(null);try{e.call(null)}finally{p8(t),Da(i)}}}function p9(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){const n=t.ac;n!==null&&N1(()=>{n.abort(R1)});var i=t.next;(t.f&Sd)!==0?t.parent=null:$r(t,e),t=i}}function fM(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&Ja)===0&&$r(e),e=t}}function $r(r,e=!0){var t=!1;(e||(r.f&aT)!==0)&&r.nodes!==null&&r.nodes.end!==null&&(p3(r.nodes.start,r.nodes.end),t=!0),Eo(r,by),p9(r,e&&!t),f0(r,0);var i=r.nodes&&r.nodes.t;if(i!==null)for(const s of i)s.stop();f3(r),r.f^=by,r.f|=wa;var n=r.parent;n!==null&&n.first!==null&&g3(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes=r.ac=r.b=null}function p3(r,e){for(;r!==null;){var t=r===e?null:hv(r);r.remove(),r=t}}function g3(r){var e=r.parent,t=r.prev,i=r.next;t!==null&&(t.next=i),i!==null&&(i.prev=t),e!==null&&(e.first===r&&(e.first=i),e.last===r&&(e.last=t))}function fu(r,e,t=!0){var i=[];v3(r,i,!0);var n=()=>{t&&$r(r),e&&e()},s=i.length;if(s>0){var a=()=>--s||n();for(var l of i)l.out(a)}else n()}function v3(r,e,t){if((r.f&Er)===0){r.f^=Er;var i=r.nodes&&r.nodes.t;if(i!==null)for(const l of i)(l.is_global||t)&&e.push(l);for(var n=r.first;n!==null;){var s=n.next;if((n.f&Sd)===0){var a=(n.f&mp)!==0||(n.f&Ja)!==0&&(r.f&Xa)!==0;v3(n,e,a?t:!1)}n=s}}}function pm(r){x3(r,!0)}function x3(r,e){if((r.f&Er)!==0){r.f^=Er,(r.f&zo)===0&&(Eo(r,qo),lh.ensure().schedule(r));for(var t=r.first;t!==null;){var i=t.next,n=(t.f&mp)!==0||(t.f&Ja)!==0;x3(t,n?e:!1),t=i}var s=r.nodes&&r.nodes.t;if(s!==null)for(const a of s)(a.is_global||e)&&a.in()}}function g9(r,e){if(r.nodes)for(var t=r.nodes.start,i=r.nodes.end;t!==null;){var n=t===i?null:hv(t);e.append(t),t=n}}let Px=!1,_c=!1;function p8(r){_c=r}let ys=null,Qa=!1;function Da(r){ys=r}let Es=null;function Ol(r){Es=r}let Pl=null;function m3(r){ys!==null&&(Pl??(Pl=new Set)).add(r)}let Or=null,Gr=0,da=null;function pM(r){da=r}let _3=1,eu=0,pu=eu;function g8(r){pu=r}function b3(){return++_3}function pv(r){var e=r.f;if((e&qo)!==0)return!0;if(e&nr&&(r.f&=~ah),(e&Nl)!==0){for(var t=r.deps,i=t.length,n=0;n<i;n++){var s=t[n];if(pv(s)&&t3(s),s.wv>r.wv)return!0}(e&ya)!==0&&Yo===null&&Eo(r,zo)}return!1}function C3(r,e,t=!0){var i=r.reactions;if(i!==null&&!(Pl!==null&&Pl.has(r)))for(var n=0;n<i.length;n++){var s=i[n];(s.f&nr)!==0?C3(s,e,!1):e===s&&(t?Eo(s,qo):(s.f&zo)!==0&&Eo(s,Nl),c9(s))}}function y3(r){var E;var e=Or,t=Gr,i=da,n=ys,s=Pl,a=ir,l=Qa,d=pu,u=r.f;Or=null,Gr=0,da=null,ys=(u&(Ja|Sd))===0?r:null,Pl=null,_p(r.ctx),Qa=!1,pu=++eu,r.ac!==null&&(N1(()=>{r.ac.abort(R1)}),r.ac=null);try{r.f|=um;var g=r.fn,x=g();r.f|=$p;var m=r.deps,C=zn==null?void 0:zn.is_fork;if(Or!==null){var _;if(C||f0(r,Gr),m!==null&&Gr>0)for(m.length=Gr+Or.length,_=0;_<Or.length;_++)m[Gr+_]=Or[_];else r.deps=m=Or;if(h9()&&(r.f&ya)!==0)for(_=Gr;_<m.length;_++)((E=m[_]).reactions??(E.reactions=[])).push(r)}else!C&&m!==null&&Gr<m.length&&(f0(r,Gr),m.length=Gr);if($5()&&da!==null&&!Qa&&m!==null&&(r.f&(nr|Nl|qo))===0)for(_=0;_<da.length;_++)C3(da[_],r);if(n!==null&&n!==r){if(eu++,n.deps!==null)for(let k=0;k<t;k+=1)n.deps[k].rv=eu;if(e!==null)for(const k of e)k.rv=eu;da!==null&&(i===null?i=da:i.push(...da))}return(r.f&sd)!==0&&(r.f^=sd),x}catch(k){return U5(k)}finally{r.f^=um,Or=e,Gr=t,da=i,ys=n,Pl=s,_p(a),Qa=l,pu=d}}function gM(r,e){let t=e.reactions;if(t!==null){var i=eT.call(t,r);if(i!==-1){var n=t.length-1;n===0?t=e.reactions=null:(t[i]=t[n],t.pop())}}if(t===null&&(e.f&nr)!==0&&(Or===null||!lm.call(Or,e))){var s=e;(s.f&ya)!==0&&(s.f^=ya,s.f&=~ah),s.v!==Oo&&a9(s),nM(s),f0(s,0)}}function f0(r,e){var t=r.deps;if(t!==null)for(var i=e;i<t.length;i++)gM(r,t[i])}function Cp(r){var e=r.f;if((e&wa)===0){Eo(r,zo);var t=Es,i=Px;Es=r,Px=!0;try{(e&(Xa|N5))!==0?fM(r):p9(r),f3(r);var n=y3(r);r.teardown=typeof n=="function"?n:null,r.wv=_3;var s;T5&&OT&&(r.f&qo)!==0&&r.deps}finally{Px=i,Es=t}}}async function va(){await Promise.resolve(),$T()}function o(r){var e=r.f,t=(e&nr)!==0;if(ys!==null&&!Qa){var i=Es!==null&&(Es.f&wa)!==0;if(!i&&(Pl===null||!Pl.has(r))){var n=ys.deps;if((ys.f&um)!==0)r.rv<eu&&(r.rv=eu,Or===null&&n!==null&&n[Gr]===r?Gr++:Or===null?Or=[r]:Or.push(r));else{ys.deps??(ys.deps=[]),lm.call(ys.deps,r)||ys.deps.push(r);var s=r.reactions;s===null?r.reactions=[ys]:lm.call(s,ys)||s.push(ys)}}}if(_c&&hu.has(r))return hu.get(r);if(t){var a=r;if(_c){var l=a.v;return((a.f&zo)===0&&a.reactions!==null||E3(a))&&(l=u9(a)),hu.set(a,l),l}var d=(a.f&ya)===0&&!Qa&&ys!==null&&(Px||(ys.f&ya)!==0),u=(a.f&$p)===0;pv(a)&&(d&&(a.f|=ya),t3(a)),d&&!u&&(i3(a),w3(a))}if(Yo!=null&&Yo.has(r))return Yo.get(r);if((r.f&sd)!==0)throw r.v;return r.v}function w3(r){if(r.f|=ya,r.deps!==null)for(const e of r.deps)(e.reactions??(e.reactions=[])).push(r),(e.f&nr)!==0&&(e.f&ya)===0&&(i3(e),w3(e))}function E3(r){if(r.v===Oo)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(hu.has(e)||(e.f&nr)!==0&&E3(e))return!0;return!1}function Io(r){var e=Qa;try{return Qa=!0,r()}finally{Qa=e}}const vM=["touchstart","touchmove"];function xM(r){return vM.includes(r)}const tu=Symbol("events"),S3=new Set,Fy=new Set;function mM(r,e,t,i={}){function n(s){if(i.capture||Ly.call(e,s),!s.cancelBubble)return N1(()=>t==null?void 0:t.call(this,s))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?Il(()=>{e.addEventListener(r,n,i)}):e.addEventListener(r,n,i),n}function Ls(r,e,t,i,n){var s={capture:i,passive:n},a=mM(r,e,t,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&H1(()=>{e.removeEventListener(r,a,s)})}function H(r,e,t){(e[tu]??(e[tu]={}))[r]=t}function ks(r){for(var e=0;e<r.length;e++)S3.add(r[e]);for(var t of Fy)t(r)}let v8=null;function Ly(r){var E,k;var e=this,t=e.ownerDocument,i=r.type,n=((E=r.composedPath)==null?void 0:E.call(r))||[],s=n[0]||r.target;v8=r;var a=0,l=v8===r&&r[tu];if(l){var d=n.indexOf(l);if(d!==-1&&(e===document||e===window)){r[tu]=e;return}var u=n.indexOf(e);if(u===-1)return;d<=u&&(a=d)}if(s=n[a]||r.target,s!==e){tT(r,"currentTarget",{configurable:!0,get(){return s||t}});var g=ys,x=Es;Da(null),Ol(null);try{for(var m,C=[];s!==null&&s!==e;){try{var _=(k=s[tu])==null?void 0:k[i];_!=null&&(!s.disabled||r.target===s)&&_.call(s,r)}catch(I){m?C.push(I):m=I}if(r.cancelBubble)break;a++,s=a<n.length?n[a]:null}if(m){for(let I of C)queueMicrotask(()=>{throw I});throw m}}finally{r[tu]=e,delete r.currentTarget,Da(g),Ol(x)}}}var i6;const Mb=((i6=globalThis==null?void 0:globalThis.window)==null?void 0:i6.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:r=>r});function _M(r){return(Mb==null?void 0:Mb.createHTML(r))??r}function k3(r){var e=u3("template");return e.innerHTML=_M(r.replaceAll("<!>","<!---->")),e.content}function kd(r,e){var t=Es;t.nodes===null&&(t.nodes={start:r,end:e,a:null,t:null})}function S(r,e){var t=(e&z5)!==0,i=(e<)!==0,n,s=!r.startsWith("<!>");return()=>{n===void 0&&(n=k3(s?r:"<!>"+r),t||(n=ta(n)));var a=i||a3?document.importNode(n,!0):n.cloneNode(!0);if(t){var l=ta(a),d=a.lastChild;kd(l,d)}else kd(a,a);return a}}function bM(r,e,t="svg"){var i=!r.startsWith("<!>"),n=(e&z5)!==0,s=`<${t}>${i?r:"<!>"+r}</${t}>`,a;return()=>{if(!a){var l=k3(s),d=ta(l);if(n)for(a=document.createDocumentFragment();ta(d);)a.appendChild(ta(d));else a=ta(d)}var u=a.cloneNode(!0);if(n){var g=ta(u),x=u.lastChild;kd(g,x)}else kd(u,u);return u}}function Go(r,e){return bM(r,e,"svg")}function Ln(r=""){{var e=uc(r+"");return kd(e,e),e}}function Rs(){var r=document.createDocumentFragment(),e=document.createComment(""),t=uc();return r.append(e,t),kd(e,t),r}function y(r,e){r!==null&&r.before(e)}function B(r,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(r[_g]??(r[_g]=r.nodeValue))&&(r[_g]=t,r.nodeValue=`${t}`)}function CM(r,e){return yM(r,e)}const qv=new Map;function yM(r,{target:e,anchor:t,props:i={},events:n,context:s,intro:a=!0,transformError:l}){rM();var d=void 0,u=uM(()=>{var g=t??e.appendChild(uc());KT(g,{pending:()=>{}},C=>{_s({});var _=ir;s&&(_.c=s),n&&(i.$$events=n),d=r(C,i)||{},bs()},l);var x=new Set,m=C=>{for(var _=0;_<C.length;_++){var E=C[_];if(!x.has(E)){x.add(E);var k=xM(E);for(const N of[e,document]){var I=qv.get(N);I===void 0&&(I=new Map,qv.set(N,I));var M=I.get(E);M===void 0?(N.addEventListener(E,Ly,{passive:k}),I.set(E,1)):I.set(E,M+1)}}}};return m(T1(S3)),Fy.add(m),()=>{var k;for(var C of x)for(const I of[e,document]){var _=qv.get(I),E=_.get(C);--E==0?(I.removeEventListener(C,Ly),_.delete(C),_.size===0&&qv.delete(I)):_.set(C,E)}Fy.delete(m),g!==t&&((k=g.parentNode)==null||k.removeChild(g))}});return wM.set(d,u),d}let wM=new WeakMap;var za,bl,Yr,au,U0,G0,w_;class D3{constructor(e,t=!0){cs(this,"anchor");is(this,za,new Map);is(this,bl,new Map);is(this,Yr,new Map);is(this,au,new Set);is(this,U0,!0);is(this,G0,e=>{if(qt(this,za).has(e)){var t=qt(this,za).get(e),i=qt(this,bl).get(t);if(i)pm(i),qt(this,au).delete(t);else{var n=qt(this,Yr).get(t);n&&(pm(n.effect),qt(this,bl).set(t,n.effect),qt(this,Yr).delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[s,a]of qt(this,za)){if(qt(this,za).delete(s),s===e)break;const l=qt(this,Yr).get(a);l&&($r(l.effect),qt(this,Yr).delete(a))}for(const[s,a]of qt(this,bl)){if(s===t||qt(this,au).has(s))continue;const l=()=>{if(Array.from(qt(this,za).values()).includes(s)){var u=document.createDocumentFragment();g9(a,u),u.append(uc()),qt(this,Yr).set(s,{effect:a,fragment:u})}else $r(a);qt(this,au).delete(s),qt(this,bl).delete(s)};qt(this,U0)||!i?(qt(this,au).add(s),fu(a,l,!1)):l()}}});is(this,w_,e=>{qt(this,za).delete(e);const t=Array.from(qt(this,za).values());for(const[i,n]of qt(this,Yr))t.includes(i)||($r(n.effect),qt(this,Yr).delete(i))});this.anchor=e,ns(this,U0,t)}ensure(e,t){var i=zn,n=d3();if(t&&!qt(this,bl).has(e)&&!qt(this,Yr).has(e))if(n){var s=document.createDocumentFragment(),a=uc();s.append(a),qt(this,Yr).set(e,{effect:pa(()=>t(a)),fragment:s})}else qt(this,bl).set(e,pa(()=>t(this.anchor)));if(qt(this,za).set(i,e),n){for(const[l,d]of qt(this,bl))l===e?i.unskip_effect(d):i.skip_effect(d);for(const[l,d]of qt(this,Yr))l===e?i.unskip_effect(d.effect):i.skip_effect(d.effect);i.oncommit(qt(this,G0)),i.ondiscard(qt(this,w_))}else qt(this,G0).call(this,i)}}za=new WeakMap,bl=new WeakMap,Yr=new WeakMap,au=new WeakMap,U0=new WeakMap,G0=new WeakMap,w_=new WeakMap;function P(r,e,t=!1){var i=new D3(r),n=t?mp:0;function s(a,l){i.ensure(a,l)}z1(()=>{var a=!1;e((l,d=0)=>{a=!0,s(d,l)}),a||s(-1,null)},n)}const EM=Symbol("NaN");function A3(r,e,t){var i=new D3(r);z1(()=>{var n=e();n!==n&&(n=EM),i.ensure(n,t)})}function sn(r,e){return e}function SM(r,e,t){for(var i=[],n=e.length,s,a=e.length,l=0;l<n;l++){let x=e[l];fu(x,()=>{if(s){if(s.pending.delete(x),s.done.add(x),s.pending.size===0){var m=r.outrogroups;Iy(r,T1(s.done)),m.delete(s),m.size===0&&(r.outrogroups=null)}}else a-=1},!1)}if(a===0){var d=i.length===0&&t!==null;if(d){var u=t,g=u.parentNode;aM(g),g.append(u),r.items.clear()}Iy(r,e,!d)}else s={pending:new Set(e),done:new Set},(r.outrogroups??(r.outrogroups=new Set)).add(s)}function Iy(r,e,t=!0){var i;if(r.pending.size>0){i=new Set;for(const a of r.pending.values())for(const l of a)i.add(r.items.get(l).e)}for(var n=0;n<e.length;n++){var s=e[n];if(i!=null&&i.has(s)){s.f|=Dl;const a=document.createDocumentFragment();g9(s,a)}else $r(e[n],t)}}var x8;function xi(r,e,t,i,n,s=null){var a=r,l=new Map,d=(e&H5)!==0;if(d){var u=r;a=u.appendChild(uc())}var g=null,x=d9(()=>{var N=t();return r9(N)?N:N==null?[]:T1(N)}),m,C=new Map,_=!0;function E(N){(M.effect.f&wa)===0&&(M.pending.delete(N),M.fallback=g,kM(M,m,a,e,i),g!==null&&(m.length===0?(g.f&Dl)===0?pm(g):(g.f^=Dl,yg(g,null,a)):fu(g,()=>{g=null})))}function k(N){M.pending.delete(N)}var I=z1(()=>{m=o(x);for(var N=m.length,O=new Set,z=zn,U=d3(),q=0;q<N;q+=1){var se=m[q],Ee=i(se,q),ge=_?null:l.get(Ee);ge?(ge.v&&bp(ge.v,se),ge.i&&bp(ge.i,q),U&&z.unskip_effect(ge.e)):(ge=DM(l,_?a:x8??(x8=uc()),se,Ee,q,n,e,t),_||(ge.e.f|=Dl),l.set(Ee,ge)),O.add(Ee)}if(N===0&&s&&!g&&(_?g=pa(()=>s(a)):(g=pa(()=>s(x8??(x8=uc()))),g.f|=Dl)),N>O.size&&fT(),!_)if(C.set(z,O),U){for(const[he,Ve]of l)O.has(he)||z.skip_effect(Ve.e);z.oncommit(E),z.ondiscard(k)}else E(z);o(x)}),M={effect:I,items:l,pending:C,outrogroups:null,fallback:g};_=!1}function cg(r){for(;r!==null&&(r.f&Ja)===0;)r=r.next;return r}function kM(r,e,t,i,n){var ge,he,Ve,nt,ue,$e,me,Xe,be;var s=(i&ST)!==0,a=e.length,l=r.items,d=cg(r.effect.first),u,g=null,x,m=[],C=[],_,E,k,I;if(s)for(I=0;I<a;I+=1)_=e[I],E=n(_,I),k=l.get(E).e,(k.f&Dl)===0&&((he=(ge=k.nodes)==null?void 0:ge.a)==null||he.measure(),(x??(x=new Set)).add(k));for(I=0;I<a;I+=1){if(_=e[I],E=n(_,I),k=l.get(E).e,r.outrogroups!==null)for(const Pt of r.outrogroups)Pt.pending.delete(k),Pt.done.delete(k);if((k.f&Er)!==0&&(pm(k),s&&((nt=(Ve=k.nodes)==null?void 0:Ve.a)==null||nt.unfix(),(x??(x=new Set)).delete(k))),(k.f&Dl)!==0)if(k.f^=Dl,k===d)yg(k,null,t);else{var M=g?g.next:d;k===r.effect.last&&(r.effect.last=k.prev),k.prev&&(k.prev.next=k.next),k.next&&(k.next.prev=k.prev),Tc(r,g,k),Tc(r,k,M),yg(k,M,t),g=k,m=[],C=[],d=cg(g.next);continue}if(k!==d){if(u!==void 0&&u.has(k)){if(m.length<C.length){var N=C[0],O;g=N.prev;var z=m[0],U=m[m.length-1];for(O=0;O<m.length;O+=1)yg(m[O],N,t);for(O=0;O<C.length;O+=1)u.delete(C[O]);Tc(r,z.prev,U.next),Tc(r,g,z),Tc(r,U,N),d=N,g=U,I-=1,m=[],C=[]}else u.delete(k),yg(k,d,t),Tc(r,k.prev,k.next),Tc(r,k,g===null?r.effect.first:g.next),Tc(r,g,k),g=k;continue}for(m=[],C=[];d!==null&&d!==k;)(u??(u=new Set)).add(d),C.push(d),d=cg(d.next);if(d===null)continue}(k.f&Dl)===0&&m.push(k),g=k,d=cg(k.next)}if(r.outrogroups!==null){for(const Pt of r.outrogroups)Pt.pending.size===0&&(Iy(r,T1(Pt.done)),(ue=r.outrogroups)==null||ue.delete(Pt));r.outrogroups.size===0&&(r.outrogroups=null)}if(d!==null||u!==void 0){var q=[];if(u!==void 0)for(k of u)(k.f&Er)===0&&q.push(k);for(;d!==null;)(d.f&Er)===0&&d!==r.fallback&&q.push(d),d=cg(d.next);var se=q.length;if(se>0){var Ee=(i&H5)!==0&&a===0?t:null;if(s){for(I=0;I<se;I+=1)(me=($e=q[I].nodes)==null?void 0:$e.a)==null||me.measure();for(I=0;I<se;I+=1)(be=(Xe=q[I].nodes)==null?void 0:Xe.a)==null||be.fix()}SM(r,q,Ee)}}s&&Il(()=>{var Pt,Ne;if(x!==void 0)for(k of x)(Ne=(Pt=k.nodes)==null?void 0:Pt.a)==null||Ne.apply()})}function DM(r,e,t,i,n,s,a,l){var d=(a&wT)!==0?(a&kT)===0?sM(t,!1,!1):ch(t):null,u=(a&ET)!==0?ch(n):null;return{v:d,i:u,e:pa(()=>(s(e,d??t,u??n,l),()=>{r.delete(i)}))}}function yg(r,e,t){if(r.nodes)for(var i=r.nodes.start,n=r.nodes.end,s=e&&(e.f&Dl)===0?e.nodes.start:t;i!==null;){var a=hv(i);if(s.before(i),i===n)return;i=a}}function Tc(r,e,t){e===null?r.effect.first=t:e.next=t,t===null?r.effect.last=e:t.prev=e}function Jc(r,e,t=!1,i=!1,n=!1,s=!1){var a=r,l="";if(t)var d=r;T(()=>{var u=Es;if(l!==(l=e()??"")){if(t){u.nodes=null,d.innerHTML=l,l!==""&&kd(ta(d),d.lastChild);return}if(u.nodes!==null&&(p3(u.nodes.start,u.nodes.end),u.nodes=null),l!==""){var g=i?IT:n?PT:void 0,x=u3(i?"svg":n?"math":"template",g);x.innerHTML=l;var m=i||n?x:x.content;if(kd(ta(m),m.lastChild),i||n)for(;ta(m);)a.before(ta(m));else a.before(m)}}})}function B3(r){var e,t,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(t=B3(r[e]))&&(i&&(i+=" "),i+=t)}else for(t in r)r[t]&&(i&&(i+=" "),i+=t);return i}function AM(){for(var r,e,t=0,i="",n=arguments.length;t<n;t++)(r=arguments[t])&&(e=B3(r))&&(i&&(i+=" "),i+=e);return i}function Nf(r){return typeof r=="object"?AM(r):r??""}const m8=[...`
|
|
3
3
|
\r\f \v\uFEFF`];function BM(r,e,t){var i=r==null?"":""+r;if(e&&(i=i?i+" "+e:e),t){for(var n of Object.keys(t))if(t[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,a=0;(a=i.indexOf(n,a))>=0;){var l=a+s;(a===0||m8.includes(i[a-1]))&&(l===i.length||m8.includes(i[l]))?i=(a===0?"":i.substring(0,a))+i.substring(l+1):a=l}}return i===""?null:i}function _8(r,e=!1){var t=e?" !important;":";",i="";for(var n of Object.keys(r)){var s=r[n];s!=null&&s!==""&&(i+=" "+n+": "+s+t)}return i}function Rb(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function FM(r,e){if(e){var t="",i,n;if(Array.isArray(e)?(i=e[0],n=e[1]):i=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,l=!1,d=[];i&&d.push(...Object.keys(i).map(Rb)),n&&d.push(...Object.keys(n).map(Rb));var u=0,g=-1;const E=r.length;for(var x=0;x<E;x++){var m=r[x];if(l?m==="/"&&r[x-1]==="*"&&(l=!1):s?s===m&&(s=!1):m==="/"&&r[x+1]==="*"?l=!0:m==='"'||m==="'"?s=m:m==="("?a++:m===")"&&a--,!l&&s===!1&&a===0){if(m===":"&&g===-1)g=x;else if(m===";"||x===E-1){if(g!==-1){var C=Rb(r.substring(u,g).trim());if(!d.includes(C)){m!==";"&&x++;var _=r.substring(u,x).trim();t+=" "+_+";"}}u=x+1,g=-1}}}}return i&&(t+=_8(i)),n&&(t+=_8(n,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function Ht(r,e,t,i,n,s){var a=r[Cy];if(a!==t||a===void 0){var l=BM(t,i,s);l==null?r.removeAttribute("class"):e?r.className=l:r.setAttribute("class",l),r[Cy]=t}else if(s&&n!==s)for(var d in s){var u=!!s[d];(n==null||u!==!!n[d])&&r.classList.toggle(d,u)}return s}function Nb(r,e={},t,i){for(var n in t){var s=t[n];e[n]!==s&&(t[n]==null?r.style.removeProperty(n):r.style.setProperty(n,s,i))}}function To(r,e,t,i){var n=r[yy];if(n!==e){var s=FM(e,i);s==null?r.removeAttribute("style"):r.style.cssText=s,r[yy]=e}else i&&(Array.isArray(i)?(Nb(r,t==null?void 0:t[0],i[0]),Nb(r,t==null?void 0:t[1],i[1],"important")):Nb(r,t,i));return i}function dh(r,e,t=!1){if(r.multiple){if(e==null)return;if(!r9(e))return MT();for(var i of r.options)i.selected=e.includes(zg(i));return}for(i of r.options){var n=zg(i);if(o3(n,e)){i.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function yp(r){var e=new MutationObserver(()=>{dh(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),H1(()=>{e.disconnect()})}function oo(r,e,t=e){var i=new WeakSet,n=!0;O1(r,"change",s=>{var a=s?"[selected]":":checked",l;if(r.multiple)l=[].map.call(r.querySelectorAll(a),zg);else{var d=r.querySelector(a)??r.querySelector("option:not([disabled])");l=d&&zg(d)}t(l),r.__value=l,zn!==null&&i.add(zn)}),f9(()=>{var s=e();if(r===document.activeElement){var a=zn;if(i.has(a))return}if(dh(r,s,n),n&&s===void 0){var l=r.querySelector(":checked");l!==null&&(s=zg(l),t(s))}r.__value=s,n=!1}),yp(r)}function zg(r){return"__value"in r?r.__value:r.value}const LM=Symbol("is custom element"),IM=Symbol("is html"),PM=uT?"progress":"PROGRESS";function Za(r,e){var t=v9(r);t.value===(t.value=e??void 0)||r.value===e&&(e!==0||r.nodeName!==PM)||(r.value=e??"")}function Jo(r,e){var t=v9(r);t.checked!==(t.checked=e??void 0)&&(r.checked=e)}function _i(r,e,t,i){var n=v9(r);n[e]!==(n[e]=t)&&(e==="loading"&&(r[dT]=t),t==null?r.removeAttribute(e):typeof t!="string"&&TM(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function v9(r){return r[Ax]??(r[Ax]={[LM]:r.nodeName.includes("-"),[IM]:r.namespaceURI===W5})}var b8=new Map;function TM(r){var e=r.getAttribute("is")||r.nodeName,t=b8.get(e);if(t)return t;b8.set(e,t=[]);for(var i,n=r,s=Element.prototype;s!==n;){i=iT(n);for(var a in i)i[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&t.push(a);n=M5(n)}return t}function ci(r,e,t=e){var i=new WeakSet;O1(r,"input",async n=>{var s=n?r.defaultValue:r.value;if(s=Hb(r)?zb(s):s,t(s),zn!==null&&i.add(zn),await va(),s!==(s=e())){var a=r.selectionStart,l=r.selectionEnd,d=r.value.length;if(r.value=s??"",l!==null){var u=r.value.length;a===l&&l===d&&u>d?(r.selectionStart=u,r.selectionEnd=u):(r.selectionStart=a,r.selectionEnd=Math.min(l,u))}}}),Io(e)==null&&r.value&&(t(Hb(r)?zb(r.value):r.value),zn!==null&&i.add(zn)),fv(()=>{var n=e();if(r===document.activeElement){var s=zn;if(i.has(s))return}Hb(r)&&n===zb(r.value)||r.type==="date"&&!n&&!r.value||n!==r.value&&(r.value=n??"")})}const Ob=new Set;function gu(r,e,t,i,n=i){var s=t.getAttribute("type")==="checkbox",a=r;if(e!==null)for(var l of e)a=a[l]??(a[l]=[]);a.push(t),O1(t,"change",()=>{var d=t.__value;s&&(d=MM(a,d,t.checked)),n(d)},()=>n(s?[]:null)),fv(()=>{var d=i();s?(d=d||[],t.checked=d.includes(t.__value)):t.checked=o3(t.__value,d)}),H1(()=>{var d=a.indexOf(t);d!==-1&&a.splice(d,1)}),Ob.has(a)||(Ob.add(a),Il(()=>{a.sort((d,u)=>d.compareDocumentPosition(u)===4?-1:1),Ob.delete(a)})),Il(()=>{})}function As(r,e,t=e){O1(r,"change",i=>{var n=i?r.defaultChecked:r.checked;t(n)}),Io(e)==null&&t(r.checked),fv(()=>{var i=e();r.checked=!!i})}function MM(r,e,t){for(var i=new Set,n=0;n<r.length;n+=1)r[n].checked&&i.add(r[n].__value);return t||i.delete(e),Array.from(i)}function Hb(r){var e=r.type;return e==="number"||e==="range"}function zb(r){return r===""?null:+r}var Yc,Yf,K0,E_,F3;const S_=class S_{constructor(e){is(this,E_);is(this,Yc,new WeakMap);is(this,Yf);is(this,K0);ns(this,K0,e)}observe(e,t){var i=qt(this,Yc).get(e)||new Set;return i.add(t),qt(this,Yc).set(e,i),zs(this,E_,F3).call(this).observe(e,qt(this,K0)),()=>{var n=qt(this,Yc).get(e);n.delete(t),n.size===0&&(qt(this,Yc).delete(e),qt(this,Yf).unobserve(e))}}};Yc=new WeakMap,Yf=new WeakMap,K0=new WeakMap,E_=new WeakSet,F3=function(){return qt(this,Yf)??ns(this,Yf,new ResizeObserver(e=>{for(var t of e){S_.entries.set(t.target,t);for(var i of qt(this,Yc).get(t.target)||[])i(t)}}))},cs(S_,"entries",new WeakMap);let Py=S_;var RM=new Py({box:"border-box"});function NM(r,e,t){var i=RM.observe(r,()=>t(r[e]));f9(()=>(Io(()=>t(r[e])),i))}function Wb(r,e){return r===e||(r==null?void 0:r[uu])===e}function ds(r={},e,t,i){var n=ir.r,s=Es;return f9(()=>{var a,l;return fv(()=>{a=l,l=[],Io(()=>{Wb(t(...l),r)||(e(r,...l),a&&Wb(t(...a),r)&&e(null,...a))})}),()=>{let d=s;for(;d!==n&&d.parent!==null&&d.parent.f&by;)d=d.parent;const u=()=>{l&&Wb(t(...l),r)&&e(null,...l)},g=d.teardown;d.teardown=()=>{u(),g==null||g()}}}),r}function Rn(r,e,t,i){var O;var n=!0,s=(t&BT)!==0,a=(t&FT)!==0,l=i,d=!0,u=void 0,g=()=>a&&n?(u??(u=h0(i)),o(u)):(d&&(d=!1,l=a?Io(i):i),l);let x;if(s){var m=uu in r||cT in r;x=((O=Mf(r,e))==null?void 0:O.set)??(m&&e in r?z=>r[e]=z:void 0)}var C,_=!1;s?[C,_]=WT(()=>r[e]):C=r[e],C===void 0&&i!==void 0&&(C=g(),x&&(mT(),x(C)));var E;if(E=()=>{var z=r[e];return z===void 0?g():(d=!0,z)},(t&AT)===0)return E;if(x){var k=r.$$legacy;return(function(z,U){return arguments.length>0?((!U||k||_)&&x(U?E():z),z):E()})}var I=!1,M=((t&DT)!==0?h0:d9)(()=>(I=!1,E()));s&&o(M);var N=Es;return(function(z,U){if(arguments.length>0){const q=U?o(M):s?wi(z):z;return p(M,q),I=!0,l!==void 0&&(l=q),z}return _c&&I||(N.f&wa)!==0?M.v:o(M)})}function Vs(r){ir===null&&O5(),cn(()=>{const e=Io(r);if(typeof e=="function")return e})}function Bh(r){ir===null&&O5(),Vs(()=>()=>Io(r))}const OM="5";var n6;typeof window<"u"&&((n6=window.__svelte??(window.__svelte={})).v??(n6.v=new Set)).add(OM);/*!-----------------------------------------------------------------------------
|
|
4
4
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10,7 +10,7 @@ var _F=Object.defineProperty;var L2=r=>{throw TypeError(r)};var bF=(r,e,t)=>e in
|
|
|
10
10
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
11
11
|
* Released under the MIT license
|
|
12
12
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
13
|
-
*-----------------------------------------------------------------------------*/var ZM=Object.defineProperty,YM=Object.getOwnPropertyDescriptor,XM=Object.getOwnPropertyNames,QM=Object.prototype.hasOwnProperty,JM=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of XM(e))!QM.call(r,n)&&n!==t&&ZM(r,n,{get:()=>e[n],enumerable:!(i=YM(e,n))||i.enumerable});return r},eR=(r,e,t)=>(JM(r,e,"default"),t),tR="5.4.5",wp={};eR(wp,o6);var P3=(r=>(r[r.None=0]="None",r[r.CommonJS=1]="CommonJS",r[r.AMD=2]="AMD",r[r.UMD=3]="UMD",r[r.System=4]="System",r[r.ES2015=5]="ES2015",r[r.ESNext=99]="ESNext",r))(P3||{}),T3=(r=>(r[r.None=0]="None",r[r.Preserve=1]="Preserve",r[r.React=2]="React",r[r.ReactNative=3]="ReactNative",r[r.ReactJSX=4]="ReactJSX",r[r.ReactJSXDev=5]="ReactJSXDev",r))(T3||{}),M3=(r=>(r[r.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",r[r.LineFeed=1]="LineFeed",r))(M3||{}),R3=(r=>(r[r.ES3=0]="ES3",r[r.ES5=1]="ES5",r[r.ES2015=2]="ES2015",r[r.ES2016=3]="ES2016",r[r.ES2017=4]="ES2017",r[r.ES2018=5]="ES2018",r[r.ES2019=6]="ES2019",r[r.ES2020=7]="ES2020",r[r.ESNext=99]="ESNext",r[r.JSON=100]="JSON",r[r.Latest=99]="Latest",r))(R3||{}),N3=(r=>(r[r.Classic=1]="Classic",r[r.NodeJs=2]="NodeJs",r))(N3||{}),O3=class{constructor(r,e,t,i,n){this._onDidChange=new wp.Emitter,this._onDidExtraLibsChange=new wp.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(r),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(r,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===r)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:r,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(r){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),r&&r.length>0)for(const e of r){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(r){this._compilerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(r){this._workerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(r){this._inlayHintsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(r){}setEagerModelSync(r){this._eagerModelSync=r}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(void 0)}},iR=tR,H3={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},z3=new O3({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},H3),W3=new O3({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},H3),nR=()=>W1().then(r=>r.getTypeScriptWorker()),sR=()=>W1().then(r=>r.getJavaScriptWorker());wp.languages.typescript={ModuleKind:P3,JsxEmit:T3,NewLineKind:M3,ScriptTarget:R3,ModuleResolutionKind:N3,typescriptVersion:iR,typescriptDefaults:z3,javascriptDefaults:W3,getTypeScriptWorker:nR,getJavaScriptWorker:sR};function W1(){return s6(()=>import("./tsMode-BIGdBOAo.js"),__vite__mapDeps([3,1,2]))}wp.languages.onLanguage("typescript",()=>W1().then(r=>r.setupTypeScript(z3)));wp.languages.onLanguage("javascript",()=>W1().then(r=>r.setupJavaScript(W3)));class oR extends vr{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:dn("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:An.map,toggled:ri.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ri.has("isInDiffEditor"),menu:{when:ri.has("isInDiffEditor"),id:Qi.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get($s),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class j3 extends vr{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:dn("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ri.has("isInDiffEditor")})}run(e,...t){const i=e.get($s),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class V3 extends vr{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:dn("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ri.has("isInDiffEditor")})}run(e,...t){const i=e.get($s),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const vv=dn("diffEditor","Diff Editor");class rR extends el{constructor(){super({id:"diffEditor.switchSide",title:dn("switchSide","Switch Side"),icon:An.arrowSwap,precondition:ri.has("isInDiffEditor"),f1:!0,category:vv})}runEditorCommand(e,t,i){const n=Up(e);if(n instanceof Z0){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class aR extends el{constructor(){super({id:"diffEditor.exitCompareMove",title:dn("exitCompareMove","Exit Compare Move"),icon:An.close,precondition:pe.comparingMovedCode,f1:!1,category:vv,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Up(e);n instanceof Z0&&n.exitCompareMove()}}class lR extends el{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:dn("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:An.fold,precondition:ri.has("isInDiffEditor"),f1:!0,category:vv})}runEditorCommand(e,t,...i){const n=Up(e);n instanceof Z0&&n.collapseAllUnchangedRegions()}}class cR extends el{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:dn("showAllUnchangedRegions","Show All Unchanged Regions"),icon:An.unfold,precondition:ri.has("isInDiffEditor"),f1:!0,category:vv})}runEditorCommand(e,t,...i){const n=Up(e);n instanceof Z0&&n.showAllUnchangedRegions()}}class Ty extends vr{constructor(){super({id:"diffEditor.revert",title:dn("revert","Revert"),f1:!1,category:vv})}run(e,t){const i=dR(e,t.originalUri,t.modifiedUri);i instanceof Z0&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const $3=dn("accessibleDiffViewer","Accessible Diff Viewer"),k_=class k_ extends vr{constructor(){super({id:k_.id,title:dn("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:$3,precondition:ri.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Up(e);t==null||t.accessibleDiffViewerNext()}};k_.id="editor.action.accessibleDiffViewer.next";let p0=k_;const D_=class D_ extends vr{constructor(){super({id:D_.id,title:dn("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:$3,precondition:ri.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Up(e);t==null||t.accessibleDiffViewerPrev()}};D_.id="editor.action.accessibleDiffViewer.prev";let gm=D_;function dR(r,e,t){return r.get(ho).listDiffEditors().find(s=>{var d,u;const a=s.getModifiedEditor(),l=s.getOriginalEditor();return a&&((d=a.getModel())==null?void 0:d.uri.toString())===t.toString()&&l&&((u=l.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function Up(r){const t=r.get(ho).listDiffEditors(),i=r6();if(i)for(const n of t){const s=n.getContainerDomNode();if(uR(s,i))return n}return null}function uR(r,e){let t=e;for(;t;){if(t===r)return!0;t=t.parentElement}return!1}Ss(oR);Ss(j3);Ss(V3);Sa.appendMenuItem(Qi.EditorTitle,{command:{id:new V3().desc.id,title:F("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ri.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ri.has("isInDiffEditor")},order:11,group:"1_diff",when:ri.and(pe.diffEditorRenderSideBySideInlineBreakpointReached,ri.has("isInDiffEditor"))});Sa.appendMenuItem(Qi.EditorTitle,{command:{id:new j3().desc.id,title:F("showMoves","Show Moved Code Blocks"),icon:An.move,toggled:CF.create("config.diffEditor.experimental.showMoves",!0),precondition:ri.has("isInDiffEditor")},order:10,group:"1_diff",when:ri.has("isInDiffEditor")});Ss(Ty);for(const r of[{icon:An.arrowRight,key:pe.diffEditorInlineMode.toNegated()},{icon:An.discard,key:pe.diffEditorInlineMode}])Sa.appendMenuItem(Qi.DiffEditorHunkToolbar,{command:{id:new Ty().desc.id,title:F("revertHunk","Revert Block"),icon:r.icon},when:ri.and(pe.diffEditorModifiedWritable,r.key),order:5,group:"primary"}),Sa.appendMenuItem(Qi.DiffEditorSelectionToolbar,{command:{id:new Ty().desc.id,title:F("revertSelection","Revert Selection"),icon:r.icon},when:ri.and(pe.diffEditorModifiedWritable,r.key),order:5,group:"primary"});Ss(rR);Ss(aR);Ss(lR);Ss(cR);Sa.appendMenuItem(Qi.EditorTitle,{command:{id:p0.id,title:F("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ri.has("isInDiffEditor")},order:10,group:"2_diff",when:ri.and(pe.accessibleDiffViewerVisible.negate(),ri.has("isInDiffEditor"))});Os.registerCommandAlias("editor.action.diffReview.next",p0.id);Ss(p0);Os.registerCommandAlias("editor.action.diffReview.prev",gm.id);Ss(gm);var hR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fR=function(r,e){return function(t,i){e(t,i,r)}},My;const j1=new ss("selectionAnchorSet",!1);var _u;let Dd=(_u=class{static get(e){return e.getContribution(My.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=j1.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(En.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Zo().appendText(F("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ka(F("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(En.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},My=_u,_u.ID="editor.contrib.selectionAnchorController",_u);Dd=My=hR([fR(1,hs)],Dd);class pR extends Si{constructor(){super({id:"editor.action.setSelectionAnchor",label:F("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:pe.editorTextFocus,primary:po(2089,2080),weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.setSelectionAnchor()}}class gR extends Si{constructor(){super({id:"editor.action.goToSelectionAnchor",label:F("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:j1})}async run(e,t){var i;(i=Dd.get(t))==null||i.goToSelectionAnchor()}}class vR extends Si{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:F("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:j1,kbOpts:{kbExpr:pe.editorTextFocus,primary:po(2089,2089),weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.selectFromAnchorToCursor()}}class xR extends Si{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:F("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:j1,kbOpts:{kbExpr:pe.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.cancelSelectionAnchor()}}Kn(Dd.ID,Dd,4);Yt(pR);Yt(gR);Yt(vR);Yt(xR);const mR=rn("editorOverviewRuler.bracketMatchForeground","#A0A0A0",F("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class _R extends Si{constructor(){super({id:"editor.action.jumpToBracket",label:F("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:pe.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=uh.get(t))==null||i.jumpToBracket()}}class bR extends Si{constructor(){super({id:"editor.action.selectToBracket",label:F("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:dn("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=uh.get(t))==null||s.selectToBracket(n)}}class CR extends Si{constructor(){super({id:"editor.action.removeBrackets",label:F("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:pe.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=uh.get(t))==null||i.removeBrackets(this.id)}}class yR{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const jc=class jc extends Hi{static get(e){return e.getContribution(jc.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Co(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),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;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let a=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?a=s[1].getStartPosition():s[1].containsPosition(n)&&(a=s[0].getStartPosition());else{const l=e.bracketPairs.findEnclosingBrackets(n);if(l)a=l[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(a=d.range.getStartPosition())}}return a?new En(a.lineNumber,a.column,a.lineNumber,a.column):new En(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let a=t.bracketPairs.matchBracket(s);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(s),!a)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(a=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let l=null,d=null;if(a){a.sort(Ye.compareRangesUsingStarts);const[u,g]=a;if(l=e?u.getStartPosition():u.getEndPosition(),d=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(s)){const x=l;l=d,d=x}}l&&d&&i.push(new En(l.lineNumber,l.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let a=0;for(let x=0,m=e.length;x<m;x++){const C=e[x];C.isEmpty()&&(s[a++]=C.getStartPosition())}s.length>1&&s.sort(un.compare);const l=[];let d=0,u=0;const g=n.length;for(let x=0,m=s.length;x<m;x++){const C=s[x];for(;u<g&&n[u].position.isBefore(C);)u++;if(u<g&&n[u].position.equals(C))l[d++]=n[u];else{let _=t.bracketPairs.matchBracket(C,20),E=jc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(C,20),E=jc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),l[d++]=new yR(C,_,E)}}this._lastBracketsData=l,this._lastVersionId=i}};jc.ID="editor.contrib.bracketMatchingController",jc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Jn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:mo(mR),position:Bl.Center}}),jc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Jn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let uh=jc;Kn(uh.ID,uh,1);Yt(bR);Yt(_R);Yt(CR);Sa.appendMenuItem(Qi.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:F({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class wR{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const a=new Ye(i,n-1,i,n),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Ye(i,s,i,s),l)}else{const a=new Ye(i,s,i,s+1),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Ye(i,n,i,n),l)}}computeCursorState(e,t){return this._isMovingLeft?new En(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new En(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class q3 extends Si{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new wR(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class ER extends q3{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:F("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:pe.writable})}}class SR extends q3{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:F("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:pe.writable})}}Yt(ER);Yt(SR);class kR extends Si{constructor(){super({id:"editor.action.transposeLetters",label:F("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:pe.writable,kbOpts:{kbExpr:pe.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const a of s){if(!a.isEmpty())continue;const l=a.startLineNumber,d=a.startColumn,u=i.getLineMaxColumn(l);if(l===1&&(d===1||d===2&&u===2))continue;const g=d===u?a.getPosition():kb.rightPosition(i,a.getPosition().lineNumber,a.getPosition().column),x=kb.leftPosition(i,g),m=kb.leftPosition(i,x),C=i.getValueInRange(Ye.fromPositions(m,x)),_=i.getValueInRange(Ye.fromPositions(x,g)),E=Ye.fromPositions(m,g);n.push(new Y0(E,_+C))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Yt(kR);const V1=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?r=crypto.getRandomValues.bind(crypto):r=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}})();function x9(r){return{asString:async()=>r,asFile:()=>{},value:typeof r=="string"?r:void 0}}function DR(r,e,t){const i={id:V1(),name:r,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class U3{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return lc.some(this,([i,n])=>n.asFile())&&t.push("files"),K3(vm(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return vm(e)}}function vm(r){return r.toLowerCase()}function G3(r,e){return K3(vm(r),e.map(vm))}function K3(r,e){if(r==="*/*")return e.length>0;if(e.includes(r))return!0;const t=r.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(a=>a.startsWith(n+"/")):!1}const $1=Object.freeze({create:r=>a6(r.map(e=>e.toString())).join(`\r
|
|
13
|
+
*-----------------------------------------------------------------------------*/var ZM=Object.defineProperty,YM=Object.getOwnPropertyDescriptor,XM=Object.getOwnPropertyNames,QM=Object.prototype.hasOwnProperty,JM=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of XM(e))!QM.call(r,n)&&n!==t&&ZM(r,n,{get:()=>e[n],enumerable:!(i=YM(e,n))||i.enumerable});return r},eR=(r,e,t)=>(JM(r,e,"default"),t),tR="5.4.5",wp={};eR(wp,o6);var P3=(r=>(r[r.None=0]="None",r[r.CommonJS=1]="CommonJS",r[r.AMD=2]="AMD",r[r.UMD=3]="UMD",r[r.System=4]="System",r[r.ES2015=5]="ES2015",r[r.ESNext=99]="ESNext",r))(P3||{}),T3=(r=>(r[r.None=0]="None",r[r.Preserve=1]="Preserve",r[r.React=2]="React",r[r.ReactNative=3]="ReactNative",r[r.ReactJSX=4]="ReactJSX",r[r.ReactJSXDev=5]="ReactJSXDev",r))(T3||{}),M3=(r=>(r[r.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",r[r.LineFeed=1]="LineFeed",r))(M3||{}),R3=(r=>(r[r.ES3=0]="ES3",r[r.ES5=1]="ES5",r[r.ES2015=2]="ES2015",r[r.ES2016=3]="ES2016",r[r.ES2017=4]="ES2017",r[r.ES2018=5]="ES2018",r[r.ES2019=6]="ES2019",r[r.ES2020=7]="ES2020",r[r.ESNext=99]="ESNext",r[r.JSON=100]="JSON",r[r.Latest=99]="Latest",r))(R3||{}),N3=(r=>(r[r.Classic=1]="Classic",r[r.NodeJs=2]="NodeJs",r))(N3||{}),O3=class{constructor(r,e,t,i,n){this._onDidChange=new wp.Emitter,this._onDidExtraLibsChange=new wp.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(r),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(r,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===r)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:r,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(r){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),r&&r.length>0)for(const e of r){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(r){this._compilerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(r){this._workerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(r){this._inlayHintsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(r){}setEagerModelSync(r){this._eagerModelSync=r}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(void 0)}},iR=tR,H3={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},z3=new O3({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},H3),W3=new O3({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},H3),nR=()=>W1().then(r=>r.getTypeScriptWorker()),sR=()=>W1().then(r=>r.getJavaScriptWorker());wp.languages.typescript={ModuleKind:P3,JsxEmit:T3,NewLineKind:M3,ScriptTarget:R3,ModuleResolutionKind:N3,typescriptVersion:iR,typescriptDefaults:z3,javascriptDefaults:W3,getTypeScriptWorker:nR,getJavaScriptWorker:sR};function W1(){return s6(()=>import("./tsMode-CzP5eDeL.js"),__vite__mapDeps([3,1,2]))}wp.languages.onLanguage("typescript",()=>W1().then(r=>r.setupTypeScript(z3)));wp.languages.onLanguage("javascript",()=>W1().then(r=>r.setupJavaScript(W3)));class oR extends vr{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:dn("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:An.map,toggled:ri.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ri.has("isInDiffEditor"),menu:{when:ri.has("isInDiffEditor"),id:Qi.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get($s),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class j3 extends vr{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:dn("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ri.has("isInDiffEditor")})}run(e,...t){const i=e.get($s),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class V3 extends vr{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:dn("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ri.has("isInDiffEditor")})}run(e,...t){const i=e.get($s),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const vv=dn("diffEditor","Diff Editor");class rR extends el{constructor(){super({id:"diffEditor.switchSide",title:dn("switchSide","Switch Side"),icon:An.arrowSwap,precondition:ri.has("isInDiffEditor"),f1:!0,category:vv})}runEditorCommand(e,t,i){const n=Up(e);if(n instanceof Z0){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class aR extends el{constructor(){super({id:"diffEditor.exitCompareMove",title:dn("exitCompareMove","Exit Compare Move"),icon:An.close,precondition:pe.comparingMovedCode,f1:!1,category:vv,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Up(e);n instanceof Z0&&n.exitCompareMove()}}class lR extends el{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:dn("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:An.fold,precondition:ri.has("isInDiffEditor"),f1:!0,category:vv})}runEditorCommand(e,t,...i){const n=Up(e);n instanceof Z0&&n.collapseAllUnchangedRegions()}}class cR extends el{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:dn("showAllUnchangedRegions","Show All Unchanged Regions"),icon:An.unfold,precondition:ri.has("isInDiffEditor"),f1:!0,category:vv})}runEditorCommand(e,t,...i){const n=Up(e);n instanceof Z0&&n.showAllUnchangedRegions()}}class Ty extends vr{constructor(){super({id:"diffEditor.revert",title:dn("revert","Revert"),f1:!1,category:vv})}run(e,t){const i=dR(e,t.originalUri,t.modifiedUri);i instanceof Z0&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const $3=dn("accessibleDiffViewer","Accessible Diff Viewer"),k_=class k_ extends vr{constructor(){super({id:k_.id,title:dn("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:$3,precondition:ri.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Up(e);t==null||t.accessibleDiffViewerNext()}};k_.id="editor.action.accessibleDiffViewer.next";let p0=k_;const D_=class D_ extends vr{constructor(){super({id:D_.id,title:dn("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:$3,precondition:ri.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Up(e);t==null||t.accessibleDiffViewerPrev()}};D_.id="editor.action.accessibleDiffViewer.prev";let gm=D_;function dR(r,e,t){return r.get(ho).listDiffEditors().find(s=>{var d,u;const a=s.getModifiedEditor(),l=s.getOriginalEditor();return a&&((d=a.getModel())==null?void 0:d.uri.toString())===t.toString()&&l&&((u=l.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function Up(r){const t=r.get(ho).listDiffEditors(),i=r6();if(i)for(const n of t){const s=n.getContainerDomNode();if(uR(s,i))return n}return null}function uR(r,e){let t=e;for(;t;){if(t===r)return!0;t=t.parentElement}return!1}Ss(oR);Ss(j3);Ss(V3);Sa.appendMenuItem(Qi.EditorTitle,{command:{id:new V3().desc.id,title:F("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ri.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ri.has("isInDiffEditor")},order:11,group:"1_diff",when:ri.and(pe.diffEditorRenderSideBySideInlineBreakpointReached,ri.has("isInDiffEditor"))});Sa.appendMenuItem(Qi.EditorTitle,{command:{id:new j3().desc.id,title:F("showMoves","Show Moved Code Blocks"),icon:An.move,toggled:CF.create("config.diffEditor.experimental.showMoves",!0),precondition:ri.has("isInDiffEditor")},order:10,group:"1_diff",when:ri.has("isInDiffEditor")});Ss(Ty);for(const r of[{icon:An.arrowRight,key:pe.diffEditorInlineMode.toNegated()},{icon:An.discard,key:pe.diffEditorInlineMode}])Sa.appendMenuItem(Qi.DiffEditorHunkToolbar,{command:{id:new Ty().desc.id,title:F("revertHunk","Revert Block"),icon:r.icon},when:ri.and(pe.diffEditorModifiedWritable,r.key),order:5,group:"primary"}),Sa.appendMenuItem(Qi.DiffEditorSelectionToolbar,{command:{id:new Ty().desc.id,title:F("revertSelection","Revert Selection"),icon:r.icon},when:ri.and(pe.diffEditorModifiedWritable,r.key),order:5,group:"primary"});Ss(rR);Ss(aR);Ss(lR);Ss(cR);Sa.appendMenuItem(Qi.EditorTitle,{command:{id:p0.id,title:F("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ri.has("isInDiffEditor")},order:10,group:"2_diff",when:ri.and(pe.accessibleDiffViewerVisible.negate(),ri.has("isInDiffEditor"))});Os.registerCommandAlias("editor.action.diffReview.next",p0.id);Ss(p0);Os.registerCommandAlias("editor.action.diffReview.prev",gm.id);Ss(gm);var hR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},fR=function(r,e){return function(t,i){e(t,i,r)}},My;const j1=new ss("selectionAnchorSet",!1);var _u;let Dd=(_u=class{static get(e){return e.getContribution(My.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=j1.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(En.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Zo().appendText(F("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ka(F("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(En.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},My=_u,_u.ID="editor.contrib.selectionAnchorController",_u);Dd=My=hR([fR(1,hs)],Dd);class pR extends Si{constructor(){super({id:"editor.action.setSelectionAnchor",label:F("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:pe.editorTextFocus,primary:po(2089,2080),weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.setSelectionAnchor()}}class gR extends Si{constructor(){super({id:"editor.action.goToSelectionAnchor",label:F("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:j1})}async run(e,t){var i;(i=Dd.get(t))==null||i.goToSelectionAnchor()}}class vR extends Si{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:F("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:j1,kbOpts:{kbExpr:pe.editorTextFocus,primary:po(2089,2089),weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.selectFromAnchorToCursor()}}class xR extends Si{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:F("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:j1,kbOpts:{kbExpr:pe.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.cancelSelectionAnchor()}}Kn(Dd.ID,Dd,4);Yt(pR);Yt(gR);Yt(vR);Yt(xR);const mR=rn("editorOverviewRuler.bracketMatchForeground","#A0A0A0",F("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class _R extends Si{constructor(){super({id:"editor.action.jumpToBracket",label:F("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:pe.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=uh.get(t))==null||i.jumpToBracket()}}class bR extends Si{constructor(){super({id:"editor.action.selectToBracket",label:F("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:dn("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=uh.get(t))==null||s.selectToBracket(n)}}class CR extends Si{constructor(){super({id:"editor.action.removeBrackets",label:F("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:pe.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=uh.get(t))==null||i.removeBrackets(this.id)}}class yR{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const jc=class jc extends Hi{static get(e){return e.getContribution(jc.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new Co(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),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;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let a=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?a=s[1].getStartPosition():s[1].containsPosition(n)&&(a=s[0].getStartPosition());else{const l=e.bracketPairs.findEnclosingBrackets(n);if(l)a=l[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(a=d.range.getStartPosition())}}return a?new En(a.lineNumber,a.column,a.lineNumber,a.column):new En(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let a=t.bracketPairs.matchBracket(s);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(s),!a)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(a=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let l=null,d=null;if(a){a.sort(Ye.compareRangesUsingStarts);const[u,g]=a;if(l=e?u.getStartPosition():u.getEndPosition(),d=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(s)){const x=l;l=d,d=x}}l&&d&&i.push(new En(l.lineNumber,l.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let a=0;for(let x=0,m=e.length;x<m;x++){const C=e[x];C.isEmpty()&&(s[a++]=C.getStartPosition())}s.length>1&&s.sort(un.compare);const l=[];let d=0,u=0;const g=n.length;for(let x=0,m=s.length;x<m;x++){const C=s[x];for(;u<g&&n[u].position.isBefore(C);)u++;if(u<g&&n[u].position.equals(C))l[d++]=n[u];else{let _=t.bracketPairs.matchBracket(C,20),E=jc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(C,20),E=jc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),l[d++]=new yR(C,_,E)}}this._lastBracketsData=l,this._lastVersionId=i}};jc.ID="editor.contrib.bracketMatchingController",jc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Jn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:mo(mR),position:Bl.Center}}),jc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Jn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let uh=jc;Kn(uh.ID,uh,1);Yt(bR);Yt(_R);Yt(CR);Sa.appendMenuItem(Qi.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:F({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class wR{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const a=new Ye(i,n-1,i,n),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Ye(i,s,i,s),l)}else{const a=new Ye(i,s,i,s+1),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Ye(i,n,i,n),l)}}computeCursorState(e,t){return this._isMovingLeft?new En(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new En(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class q3 extends Si{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new wR(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class ER extends q3{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:F("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:pe.writable})}}class SR extends q3{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:F("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:pe.writable})}}Yt(ER);Yt(SR);class kR extends Si{constructor(){super({id:"editor.action.transposeLetters",label:F("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:pe.writable,kbOpts:{kbExpr:pe.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const a of s){if(!a.isEmpty())continue;const l=a.startLineNumber,d=a.startColumn,u=i.getLineMaxColumn(l);if(l===1&&(d===1||d===2&&u===2))continue;const g=d===u?a.getPosition():kb.rightPosition(i,a.getPosition().lineNumber,a.getPosition().column),x=kb.leftPosition(i,g),m=kb.leftPosition(i,x),C=i.getValueInRange(Ye.fromPositions(m,x)),_=i.getValueInRange(Ye.fromPositions(x,g)),E=Ye.fromPositions(m,g);n.push(new Y0(E,_+C))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Yt(kR);const V1=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?r=crypto.getRandomValues.bind(crypto):r=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}})();function x9(r){return{asString:async()=>r,asFile:()=>{},value:typeof r=="string"?r:void 0}}function DR(r,e,t){const i={id:V1(),name:r,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class U3{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return lc.some(this,([i,n])=>n.asFile())&&t.push("files"),K3(vm(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return vm(e)}}function vm(r){return r.toLowerCase()}function G3(r,e){return K3(vm(r),e.map(vm))}function K3(r,e){if(r==="*/*")return e.length>0;if(e.includes(r))return!0;const t=r.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(a=>a.startsWith(n+"/")):!1}const $1=Object.freeze({create:r=>a6(r.map(e=>e.toString())).join(`\r
|
|
14
14
|
`),split:r=>r.split(`\r
|
|
15
15
|
`),parse:r=>$1.split(r).filter(e=>!e.startsWith("#"))}),gl=class gl{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+gl.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new gl((this.value?[this.value,...e]:e).join(gl.sep))}};gl.sep=".",gl.None=new gl("@@none@@"),gl.Empty=new gl("");let js=gl;const C8={EDITORS:"CodeEditors",FILES:"CodeFiles"};class AR{}const BR={DragAndDropContribution:"workbench.contributions.dragAndDrop"};tl.add(BR.DragAndDropContribution,new AR);const Xg=class Xg{constructor(){}static getInstance(){return Xg.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};Xg.INSTANCE=new Xg;let Ry=Xg;function Z3(r){const e=new U3;for(const t of r.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,x9(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,FR(n))}}return e}function FR(r){const e=r.path?Bs.parse(r.path):void 0;return DR(r.name,e,async()=>new Uint8Array(await r.arrayBuffer()))}const LR=Object.freeze([C8.EDITORS,C8.FILES,ny.RESOURCES,ny.INTERNAL_URI_LIST]);function Y3(r,e=!1){const t=Z3(r),i=t.get(ny.INTERNAL_URI_LIST);if(i)t.replace(Mo.uriList,i);else if(e||!t.has(Mo.uriList)){const n=[];for(const s of r.items){const a=s.getAsFile();if(a){const l=a.path;try{l?n.push(Bs.file(l).toString()):n.push(Bs.parse(a.name,!0).toString())}catch{}}}n.length&&t.replace(Mo.uriList,x9($1.create(n)))}for(const n of LR)t.delete(n);return t}var m9=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},g0=function(r,e){return function(t,i){e(t,i,r)}};class _9{async provideDocumentPasteEdits(e,t,i,n,s){const a=await this.getEdit(i,s);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const Qg=class Qg extends _9{constructor(){super(...arguments),this.kind=Qg.kind,this.dropMimeTypes=[Mo.text],this.pasteMimeTypes=[Mo.text]}async getEdit(e,t){const i=e.get(Mo.text);if(!i||e.has(Mo.uriList))return;const n=await i.asString();return{handledMimeType:Mo.text,title:F("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};Qg.id="text",Qg.kind=new js("text.plain");let hh=Qg;class X3 extends _9{constructor(){super(...arguments),this.kind=new js("uri.absolute"),this.dropMimeTypes=[Mo.uriList],this.pasteMimeTypes=[Mo.uriList]}async getEdit(e,t){const i=await Q3(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:l,originalText:d})=>l.scheme===ur.file?l.fsPath:(n++,d)).join(" ");let a;return n>0?a=i.length>1?F("defaultDropProvider.uriList.uris","Insert Uris"):F("defaultDropProvider.uriList.uri","Insert Uri"):a=i.length>1?F("defaultDropProvider.uriList.paths","Insert Paths"):F("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Mo.uriList,insertText:s,title:a,kind:this.kind}}}let xm=class extends _9{constructor(e){super(),this._workspaceContextService=e,this.kind=new js("uri.relative"),this.dropMimeTypes=[Mo.uriList],this.pasteMimeTypes=[Mo.uriList]}async getEdit(e,t){const i=await Q3(e);if(!i.length||t.isCancellationRequested)return;const n=pc(i.map(({uri:s})=>{const a=this._workspaceContextService.getWorkspaceFolder(s);return a?yF(a.uri,s):void 0}));if(n.length)return{handledMimeType:Mo.uriList,insertText:n.join(" "),title:i.length>1?F("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):F("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};xm=m9([g0(0,ap)],xm);class IR{constructor(){this.kind=new js("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Mo.text}]}async provideDocumentPasteEdits(e,t,i,n,s){var d;if(n.triggerKind!==sy.PasteAs&&!((d=n.only)!=null&&d.contains(this.kind)))return;const a=i.get("text/html"),l=await(a==null?void 0:a.asString());if(!(!l||s.isCancellationRequested))return{dispose(){},edits:[{insertText:l,yieldTo:this._yieldTo,title:F("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function Q3(r){const e=r.get(Mo.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of $1.parse(t))try{i.push({uri:Bs.parse(n),originalText:n})}catch{}return i}let Ny=class extends Hi{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new hh)),this._register(e.documentDropEditProvider.register("*",new X3)),this._register(e.documentDropEditProvider.register("*",new xm(t)))}};Ny=m9([g0(0,hn),g0(1,ap)],Ny);let Oy=class extends Hi{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new hh)),this._register(e.documentPasteEditProvider.register("*",new X3)),this._register(e.documentPasteEditProvider.register("*",new xm(t))),this._register(e.documentPasteEditProvider.register("*",new IR))}};Oy=m9([g0(0,hn),g0(1,ap)],Oy);const ra=class ra{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=ra._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(ra.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(ra.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(ra.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(ra.isVariableCharacter(i)||ra.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof ra._table[i]>"u"&&!ra.isDigitCharacter(i)&&!ra.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};ra._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let Hy=ra;class Gp{constructor(){this._children=[]}appendChild(e){return e instanceof wr&&this._children[this._children.length-1]instanceof wr?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,(function a(l,d){for(const u of l)u.parent=d,a(u.children,u)})(t,i)}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 xv)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}let wr=class J3 extends Gp{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new J3(this.value)}};class e4 extends Gp{}class ea extends e4{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Kp?this._children[0]:void 0}clone(){const e=new ea(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Kp extends Gp{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof wr&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Kp;return this.options.forEach(e.appendChild,e),e}}class b9 extends Gp{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof Wa&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Wa){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new b9;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Wa extends Gp{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}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):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new Wa(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class v0 extends e4{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 wr(t)],!0):!1}clone(){const e=new v0(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function y8(r,e){const t=[...r];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class xv extends Gp{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof ea&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return y8([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof ea&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof v0&&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(){const e=new xv;return this._children=this.children.map(t=>t.clone()),e}walk(e){y8(this.children,e)}}class fh{constructor(){this._scanner=new Hy,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,i){const n=new xv;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(d=>(d instanceof ea&&(d.isFinalTabstop?n.set(0,void 0):!n.has(d.index)&&d.children.length>0?n.set(d.index,d.children):s.push(d)),!0));const a=(d,u)=>{const g=n.get(d.index);if(!g)return;const x=new ea(d.index);x.transform=d.transform;for(const m of g){const C=m.clone();x.appendChild(C),C instanceof ea&&n.has(C.index)&&!u.has(C.index)&&(u.add(C.index),a(C,u),u.delete(C.index))}t.replace(d,[x])},l=new Set;for(const d of s)a(d,l);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new ea(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_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 wr(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new ea(Number(t)):new v0(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new ea(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new wr("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const a=new Kp;for(;;){if(this._parseChoiceElement(a)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(a),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new wr(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new v0(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new wr("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new b9;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new wr(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Wa(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Wa(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Wa(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new Wa(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new Wa(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const a=this._until(4);if(a)return e.appendChild(new Wa(Number(n),void 0,s,a)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new Wa(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new wr(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function t4(r,e,t){var i,n;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(s=>new wF(r,{range:s,text:typeof t.insertText=="string"?fh.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function i4(r){function e(a,l){return"mimeType"in a?a.mimeType===l.handledMimeType:!!l.kind&&a.kind.contains(l.kind)}const t=new Map;for(const a of r)for(const l of a.yieldTo??[])for(const d of r)if(d!==a&&e(l,d)){let u=t.get(a);u||(u=[],t.set(a,u)),u.push(d)}if(!t.size)return Array.from(r);const i=new Set,n=[];function s(a){if(!a.length)return[];const l=a[0];if(n.includes(l))return console.warn("Yield to cycle detected",l),a;if(i.has(l))return s(a.slice(1));let d=[];const u=t.get(l);return u&&(n.push(l),d=s(u),n.pop()),i.add(l),[...d,l,...s(a.slice(1))]}return s(Array.from(r))}var PR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},TR=function(r,e){return function(t,i){e(t,i,r)}};const MR=Jn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:l6,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),A_=class A_ extends Hi{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=on(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=on("span.icon");this.domNode.append(t),t.classList.add(...xs.asClassNameArray(An.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(67);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(67))&&i()})),this._register(us(this.domNode,Ys.CLICK,n=>{this.delegate.cancel()}))}getId(){return A_.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)}};A_.baseId="editor.widget.inlineProgressWidget";let zy=A_,mm=class extends Hi{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new qr),this._currentWidget=this._register(new qr),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=t0(()=>{const l=Ye.fromPositions(e);this._currentDecorations.set([{range:l,options:MR}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(zy,this.id,this._editor,l,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};mm=PR([TR(2,Nn)],mm);var RR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},w8=function(r,e){return function(t,i){e(t,i,r)}},Tx,rd;let Sr=(rd=class{static get(e){return e.getContribution(Tx.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new qr,this._messageListeners=new Oi,this._mouseOverMessage=!1,this._editor=e,this._visible=Tx.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)==null||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){ka(wx(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=wx(e)?EF(e,{actionHandler:{callback:n=>{this.closeMessage(),SF(this._openerService,n,wx(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new E8(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(bo.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&kF(r6(),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(us(this._messageWidget.value.getDomNode(),Ys.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(us(this._messageWidget.value.getDomNode(),Ys.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new Ye(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(E8.fadeOut(this._messageWidget.value))}},Tx=rd,rd.ID="editor.contrib.messageController",rd.MESSAGE_VISIBLE=new ss("messageVisible",!1,F("messageVisible","Whether the editor is currently showing an inline message")),rd);Sr=Tx=RR([w8(1,hs),w8(2,il)],Sr);const NR=xr.bindToContribution(Sr.get);gn(new NR({id:"leaveEditorMessage",precondition:Sr.MESSAGE_VISIBLE,handler:r=>r.closeMessage(),kbOpts:{weight:130,primary:9}}));let E8=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const a=document.createElement("div");typeof n=="string"?(a.classList.add("message"),a.textContent=n):(n.classList.add("message"),a.appendChild(n)),this._domNode.appendChild(a);const l=document.createElement("div");l.classList.add("anchor","below"),this._domNode.appendChild(l),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)}};Kn(Sr.ID,Sr,4);function jb(r,e){return e&&(r.stack||r.stacktrace)?F("stackTrace.format","{0}: {1}",k8(r),S8(r.stack)||S8(r.stacktrace)):k8(r)}function S8(r){return Array.isArray(r)?r.join(`
|
|
16
16
|
`):r}function k8(r){return r.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${r.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof r.code=="string"&&typeof r.errno=="number"&&typeof r.syscall=="string"?F("nodeExceptionMessage","A system error occurred ({0})",r.message):r.message||F("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function _m(r=null,e=!1){if(!r)return F("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(r)){const t=pc(r),i=_m(t[0],e);return t.length>1?F("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(c6(r))return r;if(r.detail){const t=r.detail;if(t.error)return jb(t.error,e);if(t.exception)return jb(t.exception,e)}return r.stack?jb(r,e):r.message?r.message:F("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var n4=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Of=function(r,e){return function(t,i){e(t,i,r)}},Wy,bu;let jy=(bu=class extends Hi{constructor(e,t,i,n,s,a,l,d,u,g){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=a,this.onSelectNewEdit=l,this._contextMenuService=d,this._keybindingService=g,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(u),this.visibleContext.set(!0),this._register(Ws(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ws((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(x=>{s.containsPosition(x.position)||this.dispose()})),this._register(bo.runAndSubscribe(g.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=on(".post-edit-widget"),this.button=this._register(new DF(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(us(this.domNode,Ys.CLICK,()=>this.showSelector()))}getId(){return Wy.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=fr(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>AF({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},Wy=bu,bu.baseId="editor.widget.postEditWidget",bu);jy=Wy=n4([Of(7,Hp),Of(8,hs),Of(9,go)],jy);let bm=class extends Hi{constructor(e,t,i,n,s,a,l){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=a,this._notificationService=l,this._currentWidget=this._register(new qr),this._register(bo.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits.at(t.activeEditIndex);if(!l)return;const d=async k=>{const I=this._editor.getModel();I&&(await I.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:k,allEdits:t.allEdits},i,n,s))},u=(k,I)=>{Id(k)||(this._notificationService.error(I),i&&this.show(e[0],t,d))};let g;try{g=await n(l,s)}catch(k){return u(k,F("resolveError",`Error resolving edit '{0}':
|
|
@@ -76,7 +76,7 @@ var _F=Object.defineProperty;var L2=r=>{throw TypeError(r)};var bF=(r,e,t)=>e in
|
|
|
76
76
|
`):void 0}:{range:Ye.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
|
|
77
77
|
`):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join(`
|
|
78
78
|
`)};const a=await s.provideRenameEdits(this.model,this.position,e,n);if(a){if(a.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(a.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(F("no result","No result.")),n);return a}}async function iq(r,e,t,i){const n=new e2(e,t,r),s=await n.resolveRenameLocation(Vn.None);return s!=null&&s.rejectReason?{edits:[],rejectReason:s.rejectReason}:n.provideRenameEdits(i,Vn.None)}var Ju;let Fd=(Ju=class{static get(e){return e.getContribution(zE.ID)}constructor(e,t,i,n,s,a,l,d,u){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=a,this._configService=l,this._languageFeaturesService=d,this._telemetryService=u,this._disposableStore=new Oi,this._cts=new Lo,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(HE,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var _,E;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new Lo,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new e2(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new lp(this.editor,5,void 0,this._cts.token);let s;try{e("resolving rename location");const k=i.resolveRenameLocation(n.token);this._progressService.showWhile(k,250),s=await k,e("resolved rename location")}catch(k){k instanceof x1?e("resolve rename location cancelled",JSON.stringify(k,null," ")):(e("resolve rename location failed",k instanceof Error?k:JSON.stringify(k,null," ")),(typeof k=="string"||wx(k))&&((_=Sr.get(this.editor))==null||_.showMessage(k||F("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),t)));return}finally{n.dispose()}if(!s){e("returning early - no loc");return}if(s.rejectReason){e(`returning early - rejected with reason: ${s.rejectReason}`,s.rejectReason),(E=Sr.get(this.editor))==null||E.showMessage(s.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const a=new lp(this.editor,5,s.range,this._cts.token),l=this.editor.getModel(),d=this._languageFeaturesService.newSymbolNamesProvider.all(l),u=await Promise.all(d.map(async k=>[k,await k.supportsAutomaticNewSymbolNamesTriggerKind??!1])),g=(k,I)=>{let M=u.slice();return k===py.Automatic&&(M=M.filter(([N,O])=>O)),M.map(([N])=>N.provideNewSymbolNames(l,s.range,k,I))};e("creating rename input field and awaiting its result");const x=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),m=await this._renameWidget.getInput(s.range,s.text,x,d.length>0?g:void 0,a);if(e("received response from rename input field"),d.length>0&&this._reportTelemetry(d.length,l.getLanguageId(),m),typeof m=="boolean"){e(`returning early - rename input field response - ${m}`),m&&this.editor.focus(),a.dispose();return}this.editor.focus(),e("requesting rename edits");const C=X0(i.provideRenameEdits(m.newName,a.token),a.token).then(async k=>{if(!k){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(k.rejectReason){e(`returning early - rejected with reason: ${k.rejectReason}`),this._notificationService.info(k.rejectReason);return}this.editor.setSelection(Ye.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(k,{editor:this.editor,showPreview:m.wantsPreview,label:F("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,m.newName),code:"undoredo.rename",quotableLabel:F("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,m.newName),respectAutoSaveConfig:!0}).then(I=>{e("edits applied"),I.ariaSummary&&ka(F("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,m.newName,I.ariaSummary))}).catch(I=>{e(`error when applying edits ${JSON.stringify(I,null," ")}`),this._notificationService.error(F("rename.failedApply","Rename failed to apply edits")),this._logService.error(I)})},k=>{e("error when providing rename edits",JSON.stringify(k,null," ")),this._notificationService.error(F("rename.failed","Rename failed to compute edits")),this._logService.error(k)}).finally(()=>{a.dispose()});return e("returning rename operation"),this._progressService.showWhile(C,250),C}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}_reportTelemetry(e,t,i){const n=typeof i=="boolean"?{kind:"cancelled",languageId:t,nRenameSuggestionProviders:e}:{kind:"accepted",languageId:t,nRenameSuggestionProviders:e,source:i.stats.source.k,nRenameSuggestions:i.stats.nRenameSuggestions,timeBeforeFirstInputFieldEdit:i.stats.timeBeforeFirstInputFieldEdit,wantsPreview:i.wantsPreview,nRenameSuggestionsInvocations:i.stats.nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:i.stats.hadAutomaticRenameSuggestionsInvocation};this._telemetryService.publicLog2("renameInvokedEvent",n)}},zE=Ju,Ju.ID="editor.contrib.renameController",Ju);Fd=zE=tq([Nc(1,Nn),Nc(2,or),Nc(3,p1),Nc(4,J0),Nc(5,Dh),Nc(6,fP),Nc(7,hn),Nc(8,nl)],Fd);class nq extends Si{constructor(){super({id:"editor.action.rename",label:F("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:ri.and(pe.writable,pe.hasRenameProvider),kbOpts:{kbExpr:pe.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(ho),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return Bs.isUri(n)&&un.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(a=>{a&&(a.setPosition(s),a.invokeWithinContext(l=>(this.reportTelemetry(l,a),this.run(l,a))))},Ps):super.runCommand(e,t)}run(e,t){const i=e.get(Dh),n=Fd.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}Kn(Fd.ID,Fd,4);Yt(nq);const t2=xr.bindToContribution(Fd.get);gn(new t2({id:"acceptRenameInput",precondition:Xp,handler:r=>r.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:ri.and(pe.focus,ri.not("isComposing")),primary:3}}));gn(new t2({id:"acceptRenameInputWithPreview",precondition:ri.and(Xp,ri.has("config.editor.rename.enablePreview")),handler:r=>r.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:ri.and(pe.focus,ri.not("isComposing")),primary:2051}}));gn(new t2({id:"cancelRenameInput",precondition:Xp,handler:r=>r.cancelRenameInput(),kbOpts:{weight:199,kbExpr:pe.focus,primary:9,secondary:[1033]}}));Ss(class extends vr{constructor(){super({id:"focusNextRenameSuggestion",title:{...dn("focusNextRenameSuggestion","Focus Next Rename Suggestion")},precondition:Xp,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(ho).getFocusedCodeEditor();if(!t)return;const i=Fd.get(t);i&&i.focusNextRenameSuggestion()}});Ss(class extends vr{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...dn("focusPreviousRenameSuggestion","Focus Previous Rename Suggestion")},precondition:Xp,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(ho).getFocusedCodeEditor();if(!t)return;const i=Fd.get(t);i&&i.focusPreviousRenameSuggestion()}});mr("_executeDocumentRenameProvider",function(r,e,t,...i){const[n]=i;ps(typeof n=="string");const{renameProvider:s}=r.get(hn);return iq(s,e,t,n)});mr("_executePrepareRename",async function(r,e,t){const{renameProvider:i}=r.get(hn),s=await new e2(e,t,i).resolveRenameLocation(Vn.None);if(s!=null&&s.rejectReason)throw new Error(s.rejectReason);return s});tl.as(ev.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:F("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var sq=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},$k=function(r,e){return function(t,i){e(t,i,r)}},np;let o_=(np=class extends Hi{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(73)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{var a;const s=(a=this.editor.getModel())==null?void 0:a.getLanguageId();s&&n.affects(s)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(73)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(73)||(this.options=this.createOptions(e.getOption(73)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new Co(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(n!=null&&n.markers)))return{foldingRules:n,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,n;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((n=this.options)!=null&&n.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(s=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(s)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(s=>{if(!s.shouldBeInComments)return!0;const a=t.validateRange(s.range),l=t.tokenization.getLineTokens(a.startLineNumber),d=l.findTokenIndexAtOffset(a.startColumn-1),u=l.getStandardTokenType(d);return l.getLanguageId(d)===t.getLanguageId()&&u===1}));const i=Object.values(this.currentOccurrences).map(s=>s.decorationId),n=e.map(s=>oq(s));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(i,n);this.currentOccurrences={};for(let l=0,d=a.length;l<d;l++){const u={sectionHeader:e[l],decorationId:a[l]};this.currentOccurrences[u.decorationId]=u}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},np.ID="editor.sectionHeaderDetector",np);o_=sq([$k(1,Do),$k(2,Ac)],o_);function oq(r){return{range:r.range,options:Jn.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:r.hasSeparatorLine?2:1,sectionHeaderText:r.text}})}}Kn(o_.ID,o_,1);function rq(r){for(let e=0,t=r.length;e<t;e+=4){const i=r[e+0],n=r[e+1],s=r[e+2],a=r[e+3];r[e+0]=a,r[e+1]=s,r[e+2]=n,r[e+3]=i}}function aq(r){const e=new Uint8Array(r.buffer,r.byteOffset,r.length*4);return pP()||rq(e),gP.wrap(e)}function V7(r){const e=new Uint32Array(lq(r));let t=0;if(e[t++]=r.id,r.type==="full")e[t++]=1,e[t++]=r.data.length,e.set(r.data,t),t+=r.data.length;else{e[t++]=2,e[t++]=r.deltas.length;for(const i of r.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return aq(e)}function lq(r){let e=0;if(e+=2,r.type==="full")e+=1+r.data.length;else{e+=1,e+=3*r.deltas.length;for(const t of r.deltas)t.data&&(e+=t.data.length)}return e}function sb(r){return r&&!!r.data}function $7(r){return r&&Array.isArray(r.edits)}class cq{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function q7(r,e){return r.has(e)}function dq(r,e){const t=r.orderedGroups(e);return t.length>0?t[0]:[]}async function U7(r,e,t,i,n){const s=dq(r,e),a=await Promise.all(s.map(async l=>{let d,u=null;try{d=await l.provideDocumentSemanticTokens(e,l===t?i:null,n)}catch(g){u=g,d=null}return(!d||!sb(d)&&!$7(d))&&(d=null),new cq(l,d,u)}));for(const l of a){if(l.error)throw l.error;if(l.tokens)return l}return a.length>0?a[0]:null}function uq(r,e){const t=r.orderedGroups(e);return t.length>0?t[0]:null}class hq{constructor(e,t){this.provider=e,this.tokens=t}}function fq(r,e){return r.has(e)}function G7(r,e){const t=r.orderedGroups(e);return t.length>0?t[0]:[]}async function i2(r,e,t,i){const n=G7(r,e),s=await Promise.all(n.map(async a=>{let l;try{l=await a.provideDocumentRangeSemanticTokens(e,t,i)}catch(d){uo(d),l=null}return(!l||!sb(l))&&(l=null),new hq(a,l)}));for(const a of s)if(a.tokens)return a;return s.length>0?s[0]:null}Os.registerCommand("_provideDocumentSemanticTokensLegend",async(r,...e)=>{const[t]=e;ps(t instanceof Bs);const i=r.get(rr).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=r.get(hn),s=uq(n,i);return s?s[0].getLegend():r.get(ko).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});Os.registerCommand("_provideDocumentSemanticTokens",async(r,...e)=>{const[t]=e;ps(t instanceof Bs);const i=r.get(rr).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=r.get(hn);if(!q7(n,i))return r.get(ko).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const s=await U7(n,i,null,null,Vn.None);if(!s)return;const{provider:a,tokens:l}=s;if(!l||!sb(l))return;const d=V7({id:0,type:"full",data:l.data});return l.resultId&&a.releaseDocumentSemanticTokens(l.resultId),d});Os.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(r,...e)=>{const[t,i]=e;ps(t instanceof Bs);const n=r.get(rr).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=r.get(hn),a=G7(s,n);if(a.length===0)return;if(a.length===1)return a[0].getLegend();if(!i||!Ye.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),a[0].getLegend();const l=await i2(s,n,Ye.lift(i),Vn.None);if(l)return l.provider.getLegend()});Os.registerCommand("_provideDocumentRangeSemanticTokens",async(r,...e)=>{const[t,i]=e;ps(t instanceof Bs),ps(Ye.isIRange(i));const n=r.get(rr).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:s}=r.get(hn),a=await i2(s,n,Ye.lift(i),Vn.None);if(!(!a||!a.tokens))return V7({id:0,type:"full",data:a.tokens.data})});const n2="editor.semanticHighlighting";function $x(r,e,t){var n;const i=(n=t.getValue(n2,{overrideIdentifier:r.getLanguageId(),resource:r.uri}))==null?void 0:n.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var K7=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},yl=function(r,e){return function(t,i){e(t,i,r)}},zc;let WE=class extends Hi{constructor(e,t,i,n,s,a){super(),this._watchers=Object.create(null);const l=g=>{this._watchers[g.uri.toString()]=new jE(g,e,i,s,a)},d=(g,x)=>{x.dispose(),delete this._watchers[g.uri.toString()]},u=()=>{for(const g of t.getModels()){const x=this._watchers[g.uri.toString()];$x(g,i,n)?x||l(g):x&&d(g,x)}};t.getModels().forEach(g=>{$x(g,i,n)&&l(g)}),this._register(t.onModelAdded(g=>{$x(g,i,n)&&l(g)})),this._register(t.onModelRemoved(g=>{const x=this._watchers[g.uri.toString()];x&&d(g,x)})),this._register(n.onDidChangeConfiguration(g=>{g.affectsConfiguration(n2)&&u()})),this._register(i.onDidColorThemeChange(u))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};WE=K7([yl(0,s9),yl(1,rr),yl(2,Ba),yl(3,$s),yl(4,na),yl(5,hn)],WE);var bd;let jE=(bd=class extends Hi{constructor(e,t,i,n,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:zc.REQUEST_MIN_DELAY,max:zc.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Co(()=>this._fetchDocumentSemanticTokensNow(),zc.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const a=()=>{Xo(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const l of this._provider.all(e))typeof l.onDidChange=="function"&&this._documentProvidersChangeListeners.push(l.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};a(),this._register(this._provider.onDidChange(()=>{a(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(l=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),Xo(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!q7(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Lo,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=U7(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],a=this._model.onDidChangeContent(d=>{s.push(d)}),l=new Ar(!1);n.then(d=>{if(this._debounceInformation.update(this._model,l.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,a.dispose(),!d)this._setDocumentSemanticTokens(null,null,null,s);else{const{provider:u,tokens:g}=d,x=this._semanticTokensStylingService.getStyling(u);this._setDocumentSemanticTokens(u,g||null,x,s)}},d=>{d&&(Id(d)||typeof d.message=="string"&&d.message.indexOf("busy")!==-1)||Ps(d),this._currentDocumentRequestCancellationTokenSource=null,a.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,s){s=Math.min(s,i.length-n,e.length-t);for(let a=0;a<s;a++)i[n+a]=e[t+a]}_setDocumentSemanticTokens(e,t,i,n){const s=this._currentDocumentResponse,a=()=>{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),a();return}if($7(t)){if(!s){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:s.data};else{let l=0;for(const m of t.edits)l+=(m.data?m.data.length:0)-m.deleteCount;const d=s.data,u=new Uint32Array(d.length+l);let g=d.length,x=u.length;for(let m=t.edits.length-1;m>=0;m--){const C=t.edits[m];if(C.start>d.length){i.warnInvalidEditStart(s.resultId,t.resultId,m,C.start,d.length),this._model.tokenization.setSemanticTokens(null,!0);return}const _=g-(C.start+C.deleteCount);_>0&&(zc._copy(d,g-_,u,x-_,_),x-=_),C.data&&(zc._copy(C.data,0,u,x-C.data.length,C.data.length),x-=C.data.length),g=C.start}g>0&&zc._copy(d,0,u,0,g),t={resultId:t.resultId,data:u}}}if(sb(t)){this._currentDocumentResponse=new pq(e,t.resultId,t.data);const l=C5(t,i,this._model.getLanguageId());if(n.length>0)for(const d of n)for(const u of l)for(const g of d.changes)u.applyEdit(g.range,g.text);this._model.tokenization.setSemanticTokens(l,!0)}else this._model.tokenization.setSemanticTokens(null,!0);a()}},zc=bd,bd.REQUEST_MIN_DELAY=300,bd.REQUEST_MAX_DELAY=2e3,bd);jE=zc=K7([yl(1,s9),yl(2,Ba),yl(3,na),yl(4,hn)],jE);class pq{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}jp(WE);var gq=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},gg=function(r,e){return function(t,i){e(t,i,r)}},sp;let r_=(sp=class extends Hi{constructor(e,t,i,n,s,a){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=a.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Co(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const l=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{l()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),l()})),this._register(this._editor.onDidChangeModelContent(d=>{this._cancelAll(),l()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),l()})),this._register(this._configurationService.onDidChangeConfiguration(d=>{d.affectsConfiguration(n2)&&(this._cancelAll(),l())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),l()})),l()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!$x(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!fq(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=Fo(a=>Promise.resolve(i2(this._provider,e,t,a))),s=new Ar(!1);return n.then(a=>{if(this._debounceInformation.update(e,s.elapsed()),!a||!a.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:l,tokens:d}=a,u=this._semanticTokensStylingService.getStyling(l);e.tokenization.setPartialSemanticTokens(t,C5(d,u,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},sp.ID="editor.contrib.viewportSemanticTokens",sp);r_=gq([gg(1,s9),gg(2,Ba),gg(3,$s),gg(4,na),gg(5,hn)],r_);Kn(r_.ID,r_,1);class vq{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const s=[];i.push(s),this.selectSubwords&&this._addInWordRanges(s,e,n),this._addWordRanges(s,e,n),this._addWhitespaceLine(s,e,n),s.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:s,startColumn:a}=n,l=i.column-a;let d=l,u=l,g=0;for(;d>=0;d--){const x=s.charCodeAt(d);if(d!==l&&(x===95||x===45))break;if(s8(x)&&o8(g))break;g=x}for(d+=1;u<s.length;u++){const x=s.charCodeAt(u);if(o8(x)&&s8(g))break;if(x===95||x===45)break;g=x}d<u&&e.push({range:new Ye(i.lineNumber,a+d,i.lineNumber,a+u)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new Ye(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new Ye(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var xq=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},mq=function(r,e){return function(t,i){e(t,i,r)}},VE;class s2{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new s2(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var eh;let T0=(eh=class{static get(e){return e.getContribution(VE.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await Y7(this._languageFeaturesService.selectionRangeProvider,i,t.map(s=>s.getPosition()),this._editor.getOption(114),Vn.None).then(s=>{var a;if(!(!jr(s)||s.length!==t.length)&&!(!this._editor.hasModel()||!Tl(this._editor.getSelections(),t,(l,d)=>l.equalsSelection(d)))){for(let l=0;l<s.length;l++)s[l]=s[l].filter(d=>d.containsPosition(t[l].getStartPosition())&&d.containsPosition(t[l].getEndPosition())),s[l].unshift(t[l]);this._state=s.map(l=>new s2(0,l)),(a=this._selectionListener)==null||a.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var l;this._ignoreSelection||((l=this._selectionListener)==null||l.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(s=>s.mov(e));const n=this._state.map(s=>En.fromPositions(s.ranges[s.index].getStartPosition(),s.ranges[s.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},VE=eh,eh.ID="editor.contrib.smartSelectController",eh);T0=VE=xq([mq(1,hn)],T0);class Z7 extends Si{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=T0.get(t);i&&await i.run(this._forward)}}class _q extends Z7{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:F("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:pe.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:Qi.MenubarSelectionMenu,group:"1_basic",title:F({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Os.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class bq extends Z7{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:F("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:pe.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:Qi.MenubarSelectionMenu,group:"1_basic",title:F({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}Kn(T0.ID,T0,4);Yt(_q);Yt(bq);async function Y7(r,e,t,i,n){const s=r.all(e).concat(new vq(i.selectSubwords));s.length===1&&s.unshift(new $m);const a=[],l=[];for(const d of s)a.push(Promise.resolve(d.provideSelectionRanges(e,t,n)).then(u=>{if(jr(u)&&u.length===t.length)for(let g=0;g<t.length;g++){l[g]||(l[g]=[]);for(const x of u[g])Ye.isIRange(x.range)&&Ye.containsPosition(x.range,t[g])&&l[g].push(Ye.lift(x.range))}},uo));return await Promise.all(a),l.map(d=>{if(d.length===0)return[];d.sort((m,C)=>un.isBefore(m.getStartPosition(),C.getStartPosition())?1:un.isBefore(C.getStartPosition(),m.getStartPosition())||un.isBefore(m.getEndPosition(),C.getEndPosition())?-1:un.isBefore(C.getEndPosition(),m.getEndPosition())?1:0);const u=[];let g;for(const m of d)(!g||Ye.containsRange(m,g)&&!Ye.equalsRange(m,g))&&(u.push(m),g=m);if(!i.selectLeadingAndTrailingWhitespace)return u;const x=[u[0]];for(let m=1;m<u.length;m++){const C=u[m-1],_=u[m];if(_.startLineNumber!==C.startLineNumber||_.endLineNumber!==C.endLineNumber){const E=new Ye(C.startLineNumber,e.getLineFirstNonWhitespaceColumn(C.startLineNumber),C.endLineNumber,e.getLineLastNonWhitespaceColumn(C.endLineNumber));E.containsRange(C)&&!E.equalsRange(C)&&_.containsRange(E)&&!_.equalsRange(E)&&x.push(E);const k=new Ye(C.startLineNumber,1,C.endLineNumber,e.getLineMaxColumn(C.endLineNumber));k.containsRange(C)&&!k.equalsRange(E)&&_.containsRange(k)&&!_.equalsRange(k)&&x.push(k)}x.push(_)}return x})}Os.registerCommand("_executeSelectionRangeProvider",async function(r,...e){const[t,i]=e;ps(Bs.isUri(t));const n=r.get(hn).selectionRangeProvider,s=await r.get(ol).createModelReference(t);try{return Y7(n,s.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},Vn.None)}finally{s.dispose()}});const Cq=Object.freeze({View:dn("view","View"),Help:dn("help","Help"),Test:dn("test","Test"),File:dn("file","File"),Preferences:dn("preferences","Preferences"),Developer:dn({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer")});class Gg{constructor(e,t,i,n=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=n}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Tl(this.startLineNumbers,e.startLineNumbers)&&Tl(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new Gg([],[],0)}}const qk=V6("stickyScrollViewLayer",{createHTML:r=>r}),fC="data-sticky-line-index",Uk="data-sticky-is-line",yq="data-sticky-is-line-number",Gk="data-sticky-is-folding-icon";class wq extends Hi{constructor(e){super(),this._editor=e,this._foldingIconStore=new Oi,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(67),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof Aa),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(116).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(116)&&t(),i.hasChanged(67)&&(this._lineHeight=this._editor.getOption(67))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){if(i===void 0&&(!this._previousState&&!e||this._previousState&&this._previousState.equals(e)))return;const n=this._isWidgetHeightZero(e),s=n?void 0:e,a=n?0:this._findLineToRebuildWidgetFrom(e,i);this._renderRootNode(s,t,a),this._previousState=e}_isWidgetHeightZero(e){if(!e)return!0;const t=e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition;if(t>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const i=[...e.startLineNumbers];e.showEndForLine!==null&&(i[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=i}else this._lastLineRelativePosition=0,this._lineNumbers=[];return t===0}_findLineToRebuildWidgetFrom(e,t){if(!e||!this._previousState)return 0;if(t!==void 0)return t;const i=this._previousState,n=e.startLineNumbers.findIndex(s=>!i.startLineNumbers.includes(s));return n===-1?0:n}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyLinesFromLine(e){this._foldingIconStore.clear();for(let t=e;t<this._renderedStickyLines.length;t++){const i=this._renderedStickyLines[t];i.lineNumberDomNode.remove(),i.lineDomNode.remove()}this._renderedStickyLines=this._renderedStickyLines.slice(0,e),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i){if(this._clearStickyLinesFromLine(i),!e)return;for(const l of this._renderedStickyLines)this._updateTopAndZIndexOfStickyLine(l);const n=this._editor.getLayoutInfo(),s=this._lineNumbers.slice(i);for(const[l,d]of s.entries()){const u=this._renderChildNode(l+i,d,t,n);u&&(this._linesDomNode.appendChild(u.lineDomNode),this._lineNumbersDomNode.appendChild(u.lineNumberDomNode),this._renderedStickyLines.push(u))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const a=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${a}px`,this._linesDomNodeScrollable.style.height=`${a}px`,this._rootDomNode.style.height=`${a}px`,this._rootDomNode.style.marginLeft="0px",this._minContentWidthInPx=Math.max(...this._renderedStickyLines.map(l=>l.scrollWidth))+n.verticalScrollbarWidth,this._editor.layoutOverlayWidget(this)}_setFoldingHoverListeners(){this._editor.getOption(111)==="mouseover"&&(this._foldingIconStore.add(us(this._lineNumbersDomNode,Ys.MOUSE_ENTER,()=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(us(this._lineNumbersDomNode,Ys.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,n){const s=this._editor._getViewModel();if(!s)return;const a=s.coordinatesConverter.convertModelPositionToViewPosition(new un(t,1)).lineNumber,l=s.getViewLineRenderingData(a),d=this._editor.getOption(68);let u;try{u=u0.filter(l.inlineDecorations,a,l.minColumn,l.maxColumn)}catch{u=[]}const g=new U6(!0,!0,l.content,l.continuesWithWrappedLine,l.isBasicASCII,l.containsRTL,0,l.tokens,u,l.tabSize,l.startVisibleColumn,1,1,1,500,"none",!0,!0,null),x=new $6(2e3),m=q6(g,x);let C;qk?C=qk.createHTML(x.build()):C=x.build();const _=document.createElement("span");_.setAttribute(fC,String(e)),_.setAttribute(Uk,""),_.setAttribute("role","listitem"),_.tabIndex=0,_.className="sticky-line-content",_.classList.add(`stickyLine${t}`),_.style.lineHeight=`${this._lineHeight}px`,_.innerHTML=C;const E=document.createElement("span");E.setAttribute(fC,String(e)),E.setAttribute(yq,""),E.className="sticky-line-number",E.style.lineHeight=`${this._lineHeight}px`;const k=n.contentLeft;E.style.width=`${k}px`;const I=document.createElement("span");d.renderType===1||d.renderType===3&&t%10===0?I.innerText=t.toString():d.renderType===2&&(I.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),I.className="sticky-line-number-inner",I.style.lineHeight=`${this._lineHeight}px`,I.style.width=`${n.lineNumbersWidth}px`,I.style.paddingLeft=`${n.lineNumbersLeft}px`,E.appendChild(I);const M=this._renderFoldingIconForLine(i,t);M&&E.appendChild(M.domNode),this._editor.applyFontInfo(_),this._editor.applyFontInfo(I),E.style.lineHeight=`${this._lineHeight}px`,_.style.lineHeight=`${this._lineHeight}px`,E.style.height=`${this._lineHeight}px`,_.style.height=`${this._lineHeight}px`;const N=new Eq(e,t,_,E,M,m.characterMapping,_.scrollWidth);return this._updateTopAndZIndexOfStickyLine(N)}_updateTopAndZIndexOfStickyLine(e){var g;const t=e.index,i=e.lineDomNode,n=e.lineNumberDomNode,s=t===this._lineNumbers.length-1,a="0",l="1";i.style.zIndex=s?a:l,n.style.zIndex=s?a:l;const d=`${t*this._lineHeight+this._lastLineRelativePosition+((g=e.foldingIcon)!=null&&g.isCollapsed?1:0)}px`,u=`${t*this._lineHeight}px`;return i.style.top=s?d:u,n.style.top=s?d:u,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(111);if(!e||i==="never")return;const n=e.regions,s=n.findRange(t),a=n.getStartLineNumber(s);if(!(t===a))return;const d=n.isCollapsed(s),u=new Sq(d,a,n.getEndLineNumber(s),this._lineHeight);return u.setVisible(this._isOnGlyphMargin?!0:d||i==="always"),u.domNode.setAttribute(Gk,""),u}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._renderedStickyLines.length&&this._renderedStickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=vP(t.characterMapping,e,0);return new un(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,fC);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Uk)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Gk)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class Eq{constructor(e,t,i,n,s,a,l){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=s,this.characterMapping=a,this.scrollWidth=l}}class Sq{constructor(e,t,i,n){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=n,this.domNode=document.createElement("div"),this.domNode.style.width=`${n}px`,this.domNode.style.height=`${n}px`,this.domNode.className=xs.asClassName(e?Pm:Im)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class Kg{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class a_{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class X7{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var ob=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},M0=function(r,e){return function(t,i){e(t,i,r)}},Zg;(function(r){r.OUTLINE_MODEL="outlineModel",r.FOLDING_PROVIDER_MODEL="foldingProviderModel",r.INDENTATION_MODEL="indentationModel"})(Zg||(Zg={}));var id;(function(r){r[r.VALID=0]="VALID",r[r.INVALID=1]="INVALID",r[r.CANCELED=2]="CANCELED"})(id||(id={}));let $E=class extends Hi{constructor(e,t,i,n){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new wd(300)),this._updateOperation=this._register(new Oi),this._editor.getOption(116).defaultModel){case Zg.OUTLINE_MODEL:this._modelProviders.push(new qE(this._editor,n));case Zg.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new GE(this._editor,t,n));case Zg.INDENTATION_MODEL:this._modelProviders.push(new UE(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:n}=t.computeStickyModel(e);this._modelPromise=n;const s=await i;if(this._modelPromise!==n)return null;switch(s){case id.CANCELED:return this._updateOperation.clear(),null;case id.VALID:return t.stickyModel}}return null}).catch(t=>(Ps(t),null))}};$E=ob([M0(2,Nn),M0(3,hn)],$E);class Q7 extends Hi{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,id.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=Fo(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?id.CANCELED:(this._stickyModel=this.createStickyModel(e,i),id.VALID):this._invalid()).then(void 0,i=>(Ps(i),id.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let qE=class extends Q7{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Xl.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var a;const{stickyOutlineElement:i,providerID:n}=this._stickyModelFromOutlineModel(t,(a=this._stickyModel)==null?void 0:a.outlineProviderId),s=this._editor.getModel();return new X7(s.uri,s.getVersionId(),i,n)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(lc.first(e.children.values())instanceof _7){const l=lc.find(e.children.values(),d=>d.id===t);if(l)i=l.children;else{let d="",u=-1,g;for(const[x,m]of e.children.entries()){const C=this._findSumOfRangesOfGroup(m);C>u&&(g=m,u=C,d=m.id)}t=d,i=g.children}}else i=e.children;const n=[],s=Array.from(i.values()).sort((l,d)=>{const u=new Kg(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber),g=new Kg(d.symbol.range.startLineNumber,d.symbol.range.endLineNumber);return this._comparator(u,g)});for(const l of s)n.push(this._stickyModelFromOutlineElement(l,l.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new a_(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const a of s.children.values())i.push(this._stickyModelFromOutlineElement(a,s.symbol.selectionRange.startLineNumber));i.sort((s,a)=>this._comparator(s.range,a.range));const n=new Kg(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new a_(n,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof Tw?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};qE=ob([M0(1,hn)],qE);class J7 extends Q7{constructor(e){super(e),this._foldingLimitReporter=new v7(e)}createStickyModel(e,t){const i=this._fromFoldingRegions(t),n=this._editor.getModel();return new X7(n.uri,n.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],n=new a_(void 0,[],void 0);for(let s=0;s<t;s++){const a=e.getParentIndex(s);let l;a!==-1?l=i[a]:l=n;const d=new a_(new Kg(e.getStartLineNumber(s),e.getEndLineNumber(s)+1),[],l);l.children.push(d),i.push(d)}return n}}let UE=class extends J7{constructor(e,t){super(e),this._languageConfigurationService=t,this.provider=this._register(new V9(e.getModel(),this._languageConfigurationService,this._foldingLimitReporter))}async createModelFromProvider(e){return this.provider.compute(e)}};UE=ob([M0(1,Do)],UE);let GE=class extends J7{constructor(e,t,i){super(e),this._languageFeaturesService=i;const n=Bd.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());n.length>0&&(this.provider=this._register(new $9(e.getModel(),n,t,this._foldingLimitReporter,void 0)))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider)==null?void 0:t.compute(e))??null}};GE=ob([M0(2,hn)],GE);var kq=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Kk=function(r,e){return function(t,i){e(t,i,r)}};class Dq{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let KE=class extends Hi{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new jn),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new Oi),this._updateSoon=this._register(new Co(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(116)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(116).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Ws(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null;const e=this._editor;e.hasModel()&&(this._stickyModelProvider=new $E(e,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new Lo,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,s){if(t.children.length===0)return;let a=s;const l=[];for(let g=0;g<t.children.length;g++){const x=t.children[g];x.range&&l.push(x.range.startLineNumber)}const d=this.updateIndex(om(l,e.startLineNumber,(g,x)=>g-x)),u=this.updateIndex(om(l,e.startLineNumber+n,(g,x)=>g-x));for(let g=d;g<=u;g++){const x=t.children[g];if(!x)return;if(x.range){const m=x.range.startLineNumber,C=x.range.endLineNumber;e.startLineNumber<=C+1&&m-1<=e.endLineNumber&&m!==a&&(a=m,i.push(new Dq(m,C-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,x,i,n+1,m))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,x,i,n,s)}}getCandidateStickyLinesIntersecting(e){var n,s;if(!((n=this._model)!=null&&n.element))return[];let t=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,-1);const i=(s=this._editor._getViewModel())==null?void 0:s.getHiddenAreas();if(i)for(const a of i)t=t.filter(l=>!(l.startLineNumber>=a.startLineNumber&&l.endLineNumber<=a.endLineNumber+1));return t}};KE=kq([Kk(1,hn),Kk(2,Do)],KE);var Aq=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},nf=function(r,e){return function(t,i){e(t,i,r)}},ZE,th;let wc=(th=class extends Hi{constructor(e,t,i,n,s,a,l){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=l,this._sessionStore=new Oi,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._stickyScrollWidget=new wq(this._editor),this._stickyLineCandidateProvider=new KE(this._editor,i,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=Gg.Empty,this._onDidResize(),this._readConfiguration();const d=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(g=>{this._readConfigurationChange(g)})),this._register(us(d,Ys.CONTEXT_MENU,async g=>{this._onContextMenu(cu(d),g)})),this._stickyScrollFocusedContextKey=pe.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=pe.stickyScrollVisible.bindTo(this._contextKeyService);const u=this._register(cp(d));this._register(u.onDidBlur(g=>{this._positionRevealed===!1&&d.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(u.onDidFocus(g=>{this.focus()})),this._registerMouseListeners(),this._register(us(d,Ys.MOUSE_DOWN,g=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(ZE.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new Oi,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(Ye.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new Oi),t=this._register(new K1(this._editor,{extractLineNumberFromMouseEvent:s=>{const a=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);return a?a.lineNumber:0}})),i=s=>{if(!this._editor.hasModel()||s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return null;const a=s.target.element;if(!a||a.innerText!==a.innerHTML)return null;const l=this._stickyScrollWidget.getEditorPositionFromNode(a);return l?{range:new Ye(l.lineNumber,l.column,l.lineNumber,l.column+a.innerText.length),textElement:a}:null},n=this._stickyScrollWidget.getDomNode();this._register(vc(n,Ys.CLICK,s=>{if(s.ctrlKey||s.altKey||s.metaKey||!s.leftButton)return;if(s.shiftKey){const u=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(u===null)return;const g=new un(this._endLineNumbers[u],1);this._revealLineInCenterIfOutsideViewport(g);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(s.target)){const u=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);this._toggleFoldingRegionForLine(u);return}if(!this._stickyScrollWidget.isInStickyLine(s.target))return;let d=this._stickyScrollWidget.getEditorPositionFromNode(s.target);if(!d){const u=this._stickyScrollWidget.getLineNumberFromChildDomNode(s.target);if(u===null)return;d=new un(u,1)}this._revealPosition(d)})),this._register(vc(n,Ys.MOUSE_MOVE,s=>{if(s.shiftKey){const a=this._stickyScrollWidget.getLineIndexFromChildDomNode(s.target);if(a===null||this._showEndForLine!==null&&this._showEndForLine===a)return;this._showEndForLine=a,this._renderStickyScroll();return}this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(us(n,Ys.MOUSE_LEAVE,s=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([s,a])=>{const l=i(s);if(!l||!s.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:d,textElement:u}=l;if(!d.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=d,e.clear();else if(u.style.textDecoration==="underline")return;const g=new Lo;e.add(Ws(()=>g.dispose(!0)));let x;Cv(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new un(d.startLineNumber,d.startColumn+1),!1,g.token).then((m=>{if(!g.token.isCancellationRequested)if(m.length!==0){this._candidateDefinitionsLength=m.length;const C=u;x!==C?(e.clear(),x=C,x.style.textDecoration="underline",e.add(Ws(()=>{x.style.textDecoration="none"}))):x||(x=C,x.style.textDecoration="underline",e.add(Ws(()=>{x.style.textDecoration="none"})))}else e.clear()}))})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async s=>{if(s.target.type!==12||s.target.detail!==this._stickyScrollWidget.getId())return;const a=this._stickyScrollWidget.getEditorPositionFromNode(s.target.element);a&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:a.lineNumber,column:1})),this._instaService.invokeFunction(J4,s,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new xP(e,t);this._contextMenuService.showContextMenu({menuId:Qi.StickyScrollContext,getAnchor:()=>i})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;z9(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const n=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(67)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(116);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(68).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(116)||e.hasChanged(73)||e.hasChanged(67)||e.hasChanged(111)||e.hasChanged(68))&&this._readConfiguration(),e.hasChanged(68)&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const n of e.ranges)if(i>=n.fromLineNumber&&i<=n.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(67);this._maxStickyLines=Math.round(t*.25)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),n=this._stickyLineCandidateProvider.getVersionId();if(n===void 0||n===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const a=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(a)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var i;this._minRebuildFromLine=void 0,this._foldingModel=await((i=Bd.get(this._editor))==null?void 0:i.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=Gg.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=this._editor.getOption(67),t=Math.min(this._maxStickyLines,this._editor.getOption(116).maxLineCount),i=this._editor.getScrollTop();let n=0;const s=[],a=[],l=this._editor.getVisibleRanges();if(l.length!==0){const d=new Kg(l[0].startLineNumber,l[l.length-1].endLineNumber),u=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(d);for(const g of u){const x=g.startLineNumber,m=g.endLineNumber,C=g.nestingDepth;if(m-x>0){const _=(C-1)*e,E=C*e,k=this._editor.getBottomForLineNumber(x)-i,I=this._editor.getTopForLineNumber(m)-i,M=this._editor.getBottomForLineNumber(m)-i;if(_>I&&_<=M){s.push(x),a.push(m+1),n=M-E;break}else E>k&&E<=M&&(s.push(x),a.push(m+1));if(s.length===t)break}}}return this._endLineNumbers=a,new Gg(s,a,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},ZE=th,th.ID="store.contrib.stickyScrollController",th);wc=ZE=Aq([nf(1,Hp),nf(2,hn),nf(3,Nn),nf(4,Do),nf(5,na),nf(6,hs)],wc);class Bq extends vr{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...dn("toggleEditorStickyScroll","Toggle Editor Sticky Scroll"),mnemonicTitle:F({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Editor Sticky Scroll")},metadata:{description:dn("toggleEditorStickyScroll.description","Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:Cq.View,toggled:{condition:ri.equals("config.editor.stickyScroll.enabled",!0),title:F("stickyScroll","Sticky Scroll"),mnemonicTitle:F({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:Qi.CommandPalette},{id:Qi.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Qi.StickyScrollContext}]})}async run(e){const t=e.get($s),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}}const rb=100;class Fq extends el{constructor(){super({id:"editor.action.focusStickyScroll",title:{...dn("focusStickyScroll","Focus on the editor sticky scroll"),mnemonicTitle:F({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll")},precondition:ri.and(ri.has("config.editor.stickyScroll.enabled"),pe.stickyScrollVisible),menu:[{id:Qi.CommandPalette}]})}runEditorCommand(e,t){var i;(i=wc.get(t))==null||i.focus()}}class Lq extends el{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:dn("selectNextStickyScrollLine.title","Select the next editor sticky scroll line"),precondition:pe.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:rb,primary:18}})}runEditorCommand(e,t){var i;(i=wc.get(t))==null||i.focusNext()}}class Iq extends el{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:dn("selectPreviousStickyScrollLine.title","Select the previous sticky scroll line"),precondition:pe.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:rb,primary:16}})}runEditorCommand(e,t){var i;(i=wc.get(t))==null||i.focusPrevious()}}class Pq extends el{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:dn("goToFocusedStickyScrollLine.title","Go to the focused sticky scroll line"),precondition:pe.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:rb,primary:3}})}runEditorCommand(e,t){var i;(i=wc.get(t))==null||i.goToFocused()}}class Tq extends el{constructor(){super({id:"editor.action.selectEditor",title:dn("selectEditor.title","Select Editor"),precondition:pe.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:rb,primary:9}})}runEditorCommand(e,t){var i;(i=wc.get(t))==null||i.selectEditor()}}Kn(wc.ID,wc,1);Ss(Bq);Ss(Fq);Ss(Iq);Ss(Lq);Ss(Pq);Ss(Tq);var eB=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Lg=function(r,e){return function(t,i){e(t,i,r)}};class Mq{constructor(e,t,i,n,s,a){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=s,this.completion=a}}let YE=class extends mP{constructor(e,t,i,n,s,a){super(s.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=a}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),n=lc.slice(t,i),s=lc.slice(t,0,i);let a=5;for(const l of lc.concat(n,s)){if(l.score===l0.Default)continue;const d=new Ye(l.editStart.lineNumber,l.editStart.column,l.editInsertEnd.lineNumber,l.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),u=l.completion.insertTextRules&&l.completion.insertTextRules&4?{snippet:l.completion.insertText}:l.completion.insertText;e.push(new Mq(d,u,l.filterTextLow??l.labelLow,l.completion.additionalTextEdits,l.completion.command,l)),a-->=0&&l.resolve(Vn.None)}return e}};YE=eB([Lg(5,tb)],YE);let XE=class extends Hi{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){var C;if(i.selectedSuggestionInfo)return;let s;for(const _ of this._editorService.listCodeEditors())if(_.getModel()===e){s=_;break}if(!s)return;const a=s.getOption(90);if(Sf.isAllOff(a))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const l=e.tokenization.getLineTokens(t.lineNumber),d=l.getStandardTokenType(l.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(Sf.valueFor(a,d)!=="inline")return;let u=e.getWordAtPosition(t),g;if(u!=null&&u.word||(g=this._getTriggerCharacterInfo(e,t)),!(u!=null&&u.word)&&!g||(u||(u=e.getWordUntilPosition(t)),u.endColumn!==t.column))return;let x;const m=e.getValueInRange(new Ye(t.lineNumber,1,t.lineNumber,t.column));if(!g&&((C=this._lastResult)!=null&&C.canBeReused(e,t.lineNumber,u))){const _=new Pk(m,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=_,this._lastResult.acquire(),x=this._lastResult}else{const _=await q9(this._languageFeatureService.completionProvider,e,t,new k0(void 0,Um.createSuggestFilter(s).itemKind,g==null?void 0:g.providers),g&&{triggerKind:1,triggerCharacter:g.ch},n);let E;_.needsClipboard&&(E=await this._clipboardService.readText());const k=new qc(_.items,t.column,new Pk(m,0),qm.None,s.getOption(119),s.getOption(113),{boostFullMatch:!1,firstMatchCanBeWeak:!1},E);x=new YE(e,t.lineNumber,u,k,_,this._suggestMemoryService)}return this._lastResult=x,x}handleItemDidShow(e,t){t.completion.resolve(Vn.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var s;const i=e.getValueInRange(Ye.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const a of this._languageFeatureService.completionProvider.all(e))(s=a.triggerCharacters)!=null&&s.includes(i)&&n.add(a);if(n.size!==0)return{providers:n,ch:i}}};XE=eB([Lg(0,hn),Lg(1,zp),Lg(2,tb),Lg(3,ho)],XE);jp(XE);class Rq extends Si{constructor(){super({id:"editor.action.forceRetokenize",label:F("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new Ar;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}Yt(Rq);const n1=class n1 extends vr{constructor(){super({id:n1.ID,title:dn({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:dn("tabMovesFocusDescriptions","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(){const t=!r8.getTabFocusMode();r8.setTabFocusMode(t),t?ka(F("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element")):ka(F("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}};n1.ID="editor.action.toggleTabFocusMode";let QE=n1;Ss(QE);var Nq=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Zk=function(r,e){return function(t,i){e(t,i,r)}};let JE=class extends Hi{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,s){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=Ji(e,on("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??k1("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const a=this._register(new Lb(this.el,"click")),l=this._register(new Lb(this.el,"keypress")),d=bo.chain(l.event,x=>x.map(m=>new n9(m)).filter(m=>m.keyCode===3)),u=this._register(new Lb(this.el,_P.Tap)).event;this._register(d6.addTarget(this.el));const g=bo.any(a.event,d,u);this._register(g(x=>{this.enabled&&(tm.stop(x,!0),i!=null&&i.opener?i.opener(this._link.href):s.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){this.hoverDelegate.showNativeHover?this.el.title=e??"":!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};JE=Nq([Zk(3,ov),Zk(4,il)],JE);var tB=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},iB=function(r,e){return function(t,i){e(t,i,r)}};const Oq=26;let eS=class extends Hi{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(tS))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,Oq)}};eS=tB([iB(1,Nn)],eS);let tS=class extends Hi{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Vp,{}),this.element=on("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"){const t=on("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Fl(this.element)}show(e){Fl(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Ji(this.element,on("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(on(`div${xs.asCSSSelector(e.icon)}`));const n=Ji(this.element,on("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ji(this.element,on("div.message-actions-container")),e.actions)for(const a of e.actions)this._register(this.instantiationService.createInstance(JE,this.messageActionsContainer,{...a,tabIndex:-1},{}));const s=Ji(this.element,on("div.action-container"));this.actionBar=this._register(new i0(s)),this.actionBar.push(this._register(new fp("banner.close","Close Banner",xs.asClassName(I6),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};tS=tB([iB(0,Nn)],tS);var o2=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},zf=function(r,e){return function(t,i){e(t,i,r)}};const Hq=lo("extensions-warning-message",An.warning,F("warningIcon","Icon shown with a warning message in the extensions editor."));var op;let R0=(op=class extends Hi{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=s=>{if(s&&s.hasMore){if(this._bannerClosed)return;const a=Math.max(s.ambiguousCharacterCount,s.nonBasicAsciiCharacterCount,s.invisibleCharacterCount);let l;if(s.nonBasicAsciiCharacterCount>=a)l={message:F("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new O0};else if(s.ambiguousCharacterCount>=a)l={message:F("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new yh};else if(s.invisibleCharacterCount>=a)l={message:F("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new N0};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:l.message,icon:Hq,actions:[{label:l.command.shortLabel,href:`command:${l.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(eS,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(126),this._register(i.onDidChangeTrust(s=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(s=>{s.hasChanged(126)&&(this._options=e.getOption(126),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=zq(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?bP:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new iS(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new Wq(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},op.ID="editor.contrib.unicodeHighlighter",op);R0=o2([zf(1,Ac),zf(2,CP),zf(3,Nn)],R0);function zq(r,e){return{nonBasicASCII:e.nonBasicASCII===Ib?!r:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Ib?!r:e.includeComments,includeStrings:e.includeStrings===Ib?!r:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let iS=class extends Hi{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Co(()=>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}const 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);const i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:l_.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!y5(t,e))return null;const i=t.getValueInRange(e.range);return{reason:sB(i,this._options),inComment:E5(t,e),inString:w5(t,e)}}};iS=o2([zf(3,Ac)],iS);class Wq extends Hi{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Co(()=>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}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const s=S5.computeUnicodeHighlights(this._model,this._options,n);for(const a of s.ranges)i.ranges.push(a);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||s.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:l_.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return y5(t,e)?{reason:sB(i,this._options),inComment:E5(t,e),inString:w5(t,e)}:null}}const nB=F("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options");let nS=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(R0.ID);if(!n)return[];const s=[],a=new Set;let l=300;for(const d of t){const u=n.getDecorationInfo(d);if(!u)continue;const x=i.getValueInRange(d.range).codePointAt(0),m=pC(x);let C;switch(u.reason.kind){case 0:{K6(u.reason.confusableWith)?C=F("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",m,pC(u.reason.confusableWith.codePointAt(0))):C=F("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",m,pC(u.reason.confusableWith.codePointAt(0)));break}case 1:C=F("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",m);break;case 2:C=F("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",m);break}if(a.has(C))continue;a.add(C);const _={codePoint:x,reason:u.reason,inComment:u.inComment,inString:u.inString},E=F("unicodeHighlight.adjustSettings","Adjust settings"),k=`command:${c_.ID}?${encodeURIComponent(JSON.stringify(_))}`,I=new Zo("",!0).appendMarkdown(C).appendText(" ").appendLink(k,E,nB);s.push(new ba(this,d.range,[I],!1,l++))}return s}renderHoverParts(e,t){return vO(e,t,this._editor,this._languageService,this._openerService)}};nS=o2([zf(1,sl),zf(2,il)],nS);function sS(r){return`U+${r.toString(16).padStart(4,"0")}`}function pC(r){let e=`\`${sS(r)}\``;return k5.isInvisibleCharacter(r)||(e+=` "${`${jq(r)}`}"`),e}function jq(r){return r===96?"`` ` ``":"`"+String.fromCodePoint(r)+"`"}function sB(r,e){return S5.computeUnicodeHighlightReason(r,e)}const s1=class s1{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=Jn.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};s1.instance=new s1;let l_=s1;class Vq extends Si{constructor(){super({id:yh.ID,label:F("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=F("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}async run(e,t,i){const n=e==null?void 0:e.get($s);n&&this.runAction(n)}async runAction(e){await e.updateValue(mc.includeComments,!1,2)}}class $q extends Si{constructor(){super({id:yh.ID,label:F("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=F("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}async run(e,t,i){const n=e==null?void 0:e.get($s);n&&this.runAction(n)}async runAction(e){await e.updateValue(mc.includeStrings,!1,2)}}const o1=class o1 extends Si{constructor(){super({id:o1.ID,label:F("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=F("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}async run(e,t,i){const n=e==null?void 0:e.get($s);n&&this.runAction(n)}async runAction(e){await e.updateValue(mc.ambiguousCharacters,!1,2)}};o1.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let yh=o1;const r1=class r1 extends Si{constructor(){super({id:r1.ID,label:F("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=F("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}async run(e,t,i){const n=e==null?void 0:e.get($s);n&&this.runAction(n)}async runAction(e){await e.updateValue(mc.invisibleCharacters,!1,2)}};r1.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let N0=r1;const a1=class a1 extends Si{constructor(){super({id:a1.ID,label:F("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=F("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}async run(e,t,i){const n=e==null?void 0:e.get($s);n&&this.runAction(n)}async runAction(e){await e.updateValue(mc.nonBasicASCII,!1,2)}};a1.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let O0=a1;const l1=class l1 extends Si{constructor(){super({id:l1.ID,label:F("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}async run(e,t,i){const{codePoint:n,reason:s,inString:a,inComment:l}=i,d=String.fromCodePoint(n),u=e.get(Sc),g=e.get($s);function x(_){return k5.isInvisibleCharacter(_)?F("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",sS(_)):F("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${sS(_)} "${d}"`)}const m=[];if(s.kind===0)for(const _ of s.notAmbiguousInLocales)m.push({label:F("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',_),run:async()=>{Uq(g,[_])}});if(m.push({label:x(n),run:()=>qq(g,[n])}),l){const _=new Vq;m.push({label:_.label,run:async()=>_.runAction(g)})}else if(a){const _=new $q;m.push({label:_.label,run:async()=>_.runAction(g)})}if(s.kind===0){const _=new yh;m.push({label:_.label,run:async()=>_.runAction(g)})}else if(s.kind===1){const _=new N0;m.push({label:_.label,run:async()=>_.runAction(g)})}else if(s.kind===2){const _=new O0;m.push({label:_.label,run:async()=>_.runAction(g)})}else Gq(s);const C=await u.pick(m,{title:nB});C&&await C.run()}};l1.ID="editor.action.unicodeHighlight.showExcludeOptions";let c_=l1;async function qq(r,e){const t=r.getValue(mc.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await r.updateValue(mc.allowedCharacters,i,2)}async function Uq(r,e){var n;const t=(n=r.inspect(mc.allowedLocales).user)==null?void 0:n.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const s of e)i[s]=!0;await r.updateValue(mc.allowedLocales,i,2)}function Gq(r){throw new Error(`Unexpected value: ${r}`)}Yt(yh);Yt(N0);Yt(O0);Yt(c_);Kn(R0.ID,R0,1);Ih.register(nS);var Kq=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Yk=function(r,e){return function(t,i){e(t,i,r)}};const oB="ignoreUnusualLineTerminators";function Zq(r,e,t){r.setModelProperty(e.uri,oB,t)}function Yq(r,e){return r.getModelProperty(e.uri,oB)}var rp;let d_=(rp=class extends Hi{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(127),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(127)&&(this._config=this._editor.getOption(127),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||Yq(this._codeEditorService,e)===!0||this._editor.getOption(92))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:F("unusualLineTerminators.title","Unusual Line Terminators"),message:F("unusualLineTerminators.message","Detected unusual line terminators"),detail:F("unusualLineTerminators.detail","The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",Rl(e.uri)),primaryButton:F({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:F("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){Zq(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},rp.ID="editor.contrib.unusualLineTerminatorsDetector",rp);d_=Kq([Yk(1,o9),Yk(2,ho)],d_);Kn(d_.ID,d_,1);var Xq=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Qq=function(r,e){return function(t,i){e(t,i,r)}};class Xk{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],s=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return s?e.isDisposed()?void 0:e.findMatches(s.word,!0,!1,!0,a8,!1).map(l=>({range:l.range,kind:am.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const s=new yd,a=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!a)return Promise.resolve(s);for(const l of[e,...i]){if(l.isDisposed())continue;const u=l.findMatches(a.word,!0,!1,!0,a8,!1).map(g=>({range:g.range,kind:am.Text}));u&&s.set(l.uri,u)}return s}}let oS=class extends Hi{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new Xk)),this._register(e.multiDocumentHighlightProvider.register("*",new Xk))}};oS=Xq([Qq(0,hn)],oS);var rB=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},qx=function(r,e){return function(t,i){e(t,i,r)}},so,rS;const r2=new ss("hasWordHighlights",!1);function aB(r,e,t,i){const n=r.ordered(e);return JS(n.map(s=>()=>Promise.resolve(s.provideDocumentHighlights(e,t,i)).then(void 0,uo)),s=>s!=null).then(s=>{if(s){const a=new yd;return a.set(e.uri,s),a}return new yd})}function Jq(r,e,t,i,n,s){const a=r.ordered(e);return JS(a.map(l=>()=>{const d=s.filter(u=>wP(u)).filter(u=>EP(l.selector,u.uri,u.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(l.provideMultiDocumentHighlights(e,t,d,n)).then(void 0,uo)}),l=>l!=null)}class lB{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=Fo(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new Ye(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,s=t.startColumn,a=t.endColumn,l=this._getCurrentWordRange(e,t);let d=!!(this._wordRange&&this._wordRange.equalsRange(l));for(let u=0,g=i.length;!d&&u<g;u++){const x=i.getRange(u);x&&x.startLineNumber===n&&x.startColumn<=s&&x.endColumn>=a&&(d=!0)}return d}cancel(){this.result.cancel()}}class eU extends lB{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return aB(this._providers,e,t.getPosition(),n).then(s=>s||new yd)}}class tU extends lB{constructor(e,t,i,n,s){super(e,t,i),this._providers=n,this._otherModels=s}_compute(e,t,i,n){return Jq(this._providers,e,t.getPosition(),i,n,this._otherModels).then(s=>s||new yd)}}function iU(r,e,t,i,n){return new eU(e,t,n,r)}function nU(r,e,t,i,n,s){return new tU(e,t,n,r,s)}mr("_executeDocumentHighlights",async(r,e,t)=>{const i=r.get(hn),n=await aB(i.documentHighlightProvider,e,t,Vn.None);return n==null?void 0:n.get(e.uri)});var Cd;let aS=(Cd=class{constructor(e,t,i,n,s){this.toUnhook=new Oi,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new yd,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.runDelayer=this.toUnhook.add(new wd(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=s,this._hasWordHighlights=r2.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(81),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(a=>{this._ignorePositionChangeEvent||this.occurrencesHighlight!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(a)})})),this.toUnhook.add(e.onDidFocusEditorText(a=>{this.occurrencesHighlight!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(a=>{yP(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(a=>{!a.newModelUrl&&a.oldModelUrl?this._stopSingular():so.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(a=>{var d,u;const l=this.editor.getOption(81);if(this.occurrencesHighlight!==l)switch(this.occurrencesHighlight=l,l){case"off":this._stopAll();break;case"singleFile":this._stopAll((u=(d=so.query)==null?void 0:d.modelInfo)==null?void 0:u.model);break;case"multiFile":so.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",l);break}})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,so.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight!=="off"&&(this.runDelayer.cancel(),this._run())}_getSortedHighlights(){return this.decorations.getRanges().sort(Ye.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const a=this.editor.getModel().getLineContent(n.startLineNumber);ka(`${a}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(s=>s.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const s=this._getWord();if(s){const a=this.editor.getModel().getLineContent(n.startLineNumber);ka(`${a}, ${i+1} of ${e.length} for '${s.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=so.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),so.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||Jx(n.getModel().uri,e==null?void 0:e.uri))continue;const s=so.storedDecorationIDs.get(n.getModel().uri);if(!s)continue;n.removeDecorations(s),i.push(n.getModel().uri);const a=Ld.get(n);a!=null&&a.wordHighlighter&&a.wordHighlighter.decorations.length>0&&(a.wordHighlighter.decorations.clear(),a.wordHighlighter.workerRequest=null,a.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)so.storedDecorationIDs.delete(n)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==ur.vscodeNotebookCell&&((i=(t=so.query)==null?void 0:t.modelInfo)==null?void 0:i.model.uri.scheme)!==ur.vscodeNotebookCell?(so.query=null,this._run()):(n=so.query)!=null&&n.modelInfo&&(so.query.modelInfo=null)),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){var t;if(this.occurrencesHighlight==="off"){this._stopAll();return}if(e.reason!==3&&((t=this.editor.getModel())==null?void 0:t.uri.scheme)!==ur.vscodeNotebookCell){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===ur.vscodeNotebookCell){const s=[],a=this.codeEditorService.listCodeEditors();for(const l of a){const d=l.getModel();d&&d!==e&&d.uri.scheme===ur.vscodeNotebookCell&&s.push(d)}return s}const i=[],n=this.codeEditorService.listCodeEditors();for(const s of n){if(!D5(s))continue;const a=s.getModel();a&&e===a.modified&&i.push(a.modified)}if(i.length)return i;if(this.occurrencesHighlight==="singleFile")return[];for(const s of n){const a=s.getModel();a&&a!==e&&i.push(a)}return i}_run(e){var n,s;let t;if(this.editor.hasTextFocus()){const a=this.editor.getSelection();if(!a||a.startLineNumber!==a.endLineNumber){so.query=null,this._stopAll();return}const l=a.startColumn,d=a.endColumn,u=this._getWord();if(!u||u.startColumn>l||u.endColumn<d){so.query=null,this._stopAll();return}t=this.workerRequest&&this.workerRequest.isValid(this.model,a,this.decorations),so.query={modelInfo:{model:this.model,selection:a},word:u}}else if(!so.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),t)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else if(Jx(this.editor.getModel().uri,(n=so.query.modelInfo)==null?void 0:n.model.uri)){if(!e){const d=this.decorations.getRanges();for(const u of d)if(u.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model:void 0);const a=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const l=this.getOtherModelsToHighlight(this.editor.getModel());if(!so.query||!so.query.modelInfo||so.query.modelInfo.model.isDisposed())return;this.workerRequest=this.computeWithModel(so.query.modelInfo.model,so.query.modelInfo.selection,so.query.word,l),(s=this.workerRequest)==null||s.result.then(d=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=d||[],this._beginRenderDecorations())},Ps)}}computeWithModel(e,t,i,n){return n.length?nU(this.multiDocumentProviders,e,t,i,this.editor.getOption(132),n):iU(this.providers,e,t,i,this.editor.getOption(132))}_beginRenderDecorations(){const e=new Date().getTime(),t=this.lastCursorPositionChangeTime+250;e>=t?(this.renderDecorationsTimer=-1,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},t-e)}renderDecorations(){var t,i,n;this.renderDecorationsTimer=-1;const e=this.codeEditorService.listCodeEditors();for(const s of e){const a=Ld.get(s);if(!a)continue;const l=[],d=(t=s.getModel())==null?void 0:t.uri;if(d&&this.workerRequestValue.has(d)){const u=so.storedDecorationIDs.get(d),g=this.workerRequestValue.get(d);if(g)for(const m of g)m.range&&l.push({range:m.range,options:qV(m.kind)});let x=[];s.changeDecorations(m=>{x=m.deltaDecorations(u??[],l)}),so.storedDecorationIDs=so.storedDecorationIDs.set(d,x),l.length>0&&((i=a.wordHighlighter)==null||i.decorations.set(l),(n=a.wordHighlighter)==null||n._hasWordHighlights.set(!0))}}}dispose(){this._stopSingular(),this.toUnhook.dispose()}},so=Cd,Cd.storedDecorationIDs=new yd,Cd.query=null,Cd);aS=so=rB([qx(4,ho)],aS);var ih;let Ld=(ih=class extends Hi{static get(e){return e.getContribution(rS.ID)}constructor(e,t,i,n){super(),this._wordHighlighter=null;const s=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this._wordHighlighter=new aS(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,n))};this._register(e.onDidChangeModel(a=>{this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),s()})),s()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore()}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},rS=ih,ih.ID="editor.contrib.wordHighlighter",ih);Ld=rS=rB([qx(1,hs),qx(2,hn),qx(3,ho)],Ld);class cB extends Si{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=Ld.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class sU extends cB{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:F("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:r2,kbOpts:{kbExpr:pe.editorTextFocus,primary:65,weight:100}})}}class oU extends cB{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:F("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:r2,kbOpts:{kbExpr:pe.editorTextFocus,primary:1089,weight:100}})}}class rU extends Si{constructor(){super({id:"editor.action.wordHighlight.trigger",label:F("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:void 0,kbOpts:{kbExpr:pe.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=Ld.get(t);n&&n.restoreViewState(!0)}}Kn(Ld.ID,Ld,0);Yt(sU);Yt(oU);Yt(rU);jp(oS);class ab extends xr{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Ah(t.getOption(132),t.getOption(131)),s=t.getModel(),a=t.getSelections(),l=a.length>1,d=a.map(u=>{const g=new un(u.positionLineNumber,u.positionColumn),x=this._move(n,s,g,this._wordNavigationType,l);return this._moveTo(u,x,this._inSelectionMode)});if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,d.map(u=>SP.fromModelSelection(u))),d.length===1){const u=new un(d[0].positionLineNumber,d[0].positionColumn);t.revealPosition(u,0)}}_moveTo(e,t,i){return i?new En(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new En(t.lineNumber,t.column,t.lineNumber,t.column)}}class Md extends ab{_move(e,t,i,n,s){return dv.moveWordLeft(e,t,i,n,s)}}class Rd extends ab{_move(e,t,i,n,s){return dv.moveWordRight(e,t,i,n)}}class aU extends Md{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class lU extends Md{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class cU extends Md{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ri.and(pe.textInputFocus,(e=ri.and(F1,L1))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class dU extends Md{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class uU extends Md{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class hU extends Md{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ri.and(pe.textInputFocus,(e=ri.and(F1,L1))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class fU extends Md{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,s){return super._move(Ah(I1.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class pU extends Md{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,s){return super._move(Ah(I1.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class gU extends Rd{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class vU extends Rd{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ri.and(pe.textInputFocus,(e=ri.and(F1,L1))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class xU extends Rd{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class mU extends Rd{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class _U extends Rd{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ri.and(pe.textInputFocus,(e=ri.and(F1,L1))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class bU extends Rd{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class CU extends Rd{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,s){return super._move(Ah(I1.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class yU extends Rd{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,s){return super._move(Ah(I1.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,s)}}class lb extends xr{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Do);if(!t.hasModel())return;const s=Ah(t.getOption(132),t.getOption(131)),a=t.getModel(),l=t.getSelections(),d=t.getOption(6),u=t.getOption(11),g=n.getLanguageConfiguration(a.getLanguageId()).getAutoClosingPairs(),x=t._getViewModel(),m=l.map(C=>{const _=this._delete({wordSeparators:s,model:a,selection:C,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:d,autoClosingQuotes:u,autoClosingPairs:g,autoClosedCharacters:x.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Y0(_,"")});t.pushUndoStop(),t.executeCommands(this.id,m),t.pushUndoStop()}}class a2 extends lb{_delete(e,t){const i=dv.deleteWordLeft(e,t);return i||new Ye(1,1,1,1)}}class l2 extends lb{_delete(e,t){const i=dv.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new Ye(n,s,n,s)}}class wU extends a2{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:pe.writable})}}class EU extends a2{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:pe.writable})}}class SU extends a2{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:pe.writable,kbOpts:{kbExpr:pe.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class kU extends l2{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:pe.writable})}}class DU extends l2{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:pe.writable})}}class AU extends l2{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:pe.writable,kbOpts:{kbExpr:pe.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class BU extends Si{constructor(){super({id:"deleteInsideWord",precondition:pe.writable,label:F("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Ah(t.getOption(132),t.getOption(131)),s=t.getModel(),l=t.getSelections().map(d=>{const u=dv.deleteInsideWord(n,s,d);return new Y0(u,"")});t.pushUndoStop(),t.executeCommands(this.id,l),t.pushUndoStop()}}gn(new aU);gn(new lU);gn(new cU);gn(new dU);gn(new uU);gn(new hU);gn(new gU);gn(new vU);gn(new xU);gn(new mU);gn(new _U);gn(new bU);gn(new fU);gn(new pU);gn(new CU);gn(new yU);gn(new wU);gn(new EU);gn(new SU);gn(new kU);gn(new DU);gn(new AU);Yt(BU);class FU extends lb{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:pe.writable,kbOpts:{kbExpr:pe.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=P1.deleteWordPartLeft(e);return i||new Ye(1,1,1,1)}}class LU extends lb{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:pe.writable,kbOpts:{kbExpr:pe.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=P1.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new Ye(n,s,n,s)}}class dB extends ab{_move(e,t,i,n,s){return P1.moveWordPartLeft(e,t,i,s)}}class IU extends dB{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:pe.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Os.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class PU extends dB{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:pe.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Os.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class uB extends ab{_move(e,t,i,n,s){return P1.moveWordPartRight(e,t,i)}}class TU extends uB{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:pe.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class MU extends uB{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:pe.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}gn(new FU);gn(new LU);gn(new IU);gn(new PU);gn(new TU);gn(new MU);const A2=class A2 extends Hi{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=Sr.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(93);t||(this.editor.isSimpleWidget?t=new Zo(F("editor.simple.readonly","Cannot edit in read-only input")):t=new Zo(F("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};A2.ID="editor.contrib.readOnlyMessageController";let u_=A2;Kn(u_.ID,u_,2);var RU=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Qk=function(r,e){return function(t,i){e(t,i,r)}};let lS=class extends Hi{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Vr(this,void 0);const n=du("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=du("_textModel.onDidChangeContent",bo.debounce(a=>this._textModel.onDidChangeContent(a),()=>{},100));this._register(nv(async(a,l)=>{n.read(a),s.read(a);const d=l.add(new AP),u=await this._outlineModelService.getOrCreate(this._textModel,d.token);l.isDisposed||this._currentModel.set(u,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(s=>e.contains(s.range.startLineNumber)&&!e.contains(s.range.endLineNumber));return n.sort(DP(rv(s=>s.range.endLineNumber-s.range.startLineNumber,w1))),n.map(s=>({name:s.name,kind:s.kind,startLineNumber:s.range.startLineNumber}))}};lS=RU([Qk(1,hn),Qk(2,Ev)],lS);kP.setBreadcrumbsSourceFactory((r,e)=>e.createInstance(lS,r));const B2=class B2 extends Hi{constructor(e){super(),this.editor=e,this.widget=null,ly&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(92);!this.widget&&e?this.widget=new cS(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};B2.ID="editor.contrib.iPadShowKeyboard";let h_=B2;const c1=class c1 extends Hi{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(us(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(us(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return c1.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};c1.ID="editor.contrib.ShowKeyboardWidget";let cS=c1;Kn(h_.ID,h_,3);var NU=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Jk=function(r,e){return function(t,i){e(t,i,r)}},dS,nh;let H0=(nh=class extends Hi{static get(e){return e.getContribution(dS.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(S1.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new uS(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},dS=nh,nh.ID="editor.contrib.inspectTokens",nh);H0=dS=NU([Jk(1,A5),Jk(2,sl)],H0);class OU extends Si{constructor(){super({id:"editor.action.inspectTokens",label:IP.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=H0.get(t);i==null||i.launch()}}function HU(r){let e="";for(let t=0,i=r.length;t<i;t++){const n=r.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function zU(r,e){const t=S1.get(e);if(t)return t;const i=r.encodeLanguageId(e);return{getInitialState:()=>BP,tokenize:(n,s,a)=>LP(e,a),tokenizeEncoded:(n,s,a)=>FP(i,a)}}const d1=class d1 extends Hi{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=zU(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return d1._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let d=t.tokens1.length-1;d>=0;d--){const u=t.tokens1[d];if(e.column-1>=u.offset){i=d;break}}let n=0;for(let d=t.tokens2.length>>>1;d>=0;d--)if(e.column-1>=t.tokens2[d<<1]){n=d;break}const s=this._model.getLineContent(e.lineNumber);let a="";if(i<t.tokens1.length){const d=t.tokens1[i].offset,u=i+1<t.tokens1.length?t.tokens1[i+1].offset:s.length;a=s.substring(d,u)}em(this._domNode,on("h2.tm-token",void 0,HU(a),on("span.tm-token-length",void 0,`${a.length} ${a.length===1?"char":"chars"}`))),Ji(this._domNode,on("hr.tokens-inspect-separator",{style:"clear:both"}));const l=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;Ji(this._domNode,on("table.tm-metadata-table",void 0,on("tbody",void 0,on("tr",void 0,on("td.tm-metadata-key",void 0,"language"),on("td.tm-metadata-value",void 0,`${l?l.languageId:"-?-"}`)),on("tr",void 0,on("td.tm-metadata-key",void 0,"token type"),on("td.tm-metadata-value",void 0,`${l?this._tokenTypeToString(l.tokenType):"-?-"}`)),on("tr",void 0,on("td.tm-metadata-key",void 0,"font style"),on("td.tm-metadata-value",void 0,`${l?this._fontStyleToString(l.fontStyle):"-?-"}`)),on("tr",void 0,on("td.tm-metadata-key",void 0,"foreground"),on("td.tm-metadata-value",void 0,`${l?Xn.Format.CSS.formatHex(l.foreground):"-?-"}`)),on("tr",void 0,on("td.tm-metadata-key",void 0,"background"),on("td.tm-metadata-value",void 0,`${l?Xn.Format.CSS.formatHex(l.background):"-?-"}`))))),Ji(this._domNode,on("hr.tokens-inspect-separator")),i<t.tokens1.length&&Ji(this._domNode,on("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=S1.getColorMap(),i=lg.getLanguageId(e),n=lg.getTokenType(e),s=lg.getFontStyle(e),a=lg.getForeground(e),l=lg.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:s,foreground:t[a],background:t[l]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};d1._ID="editor.contrib.inspectTokensWidget";let uS=d1;Kn(H0.ID,H0,4);Yt(OU);var WU=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},eD=function(r,e){return function(t,i){e(t,i,r)}},Ig,sh;let hS=(sh=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=tl.as(uv.Quickaccess)}provide(e){const t=new Oi;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(Ig.PREFIX.length));n&&n.prefix&&n.prefix!==Ig.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==Ig.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:F("helpPickAriaLabel","{0}, {1}",n,t.description),description:t.description}})}},Ig=sh,sh.PREFIX="?",sh);hS=Ig=WU([eD(0,Sc),eD(1,go)],hS);tl.as(uv.Quickaccess).registerQuickAccessProvider({ctor:hS,prefix:"",helpEntries:[{description:PP.helpQuickAccessActionLabel}]});class hB{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var a;const n=new Oi;e.canAcceptInBackground=!!((a=this.options)!=null&&a.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=n.add(new qr);return s.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{s.value=void 0,s.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new Oi,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const a={editor:s},l=B5(s);if(l){let d=s.saveViewState()??void 0;n.add(l.onDidChangeCursorPosition(()=>{d=s.saveViewState()??void 0})),a.restoreViewState=()=>{d&&s===this.activeTextEditorControl&&s.restoreViewState(d)},n.add(F5(t.onCancellationRequested)(()=>{var u;return(u=a.restoreViewState)==null?void 0:u.call(a)}))}n.add(Ws(()=>this.clearDecorations(s))),n.add(this.provideWithTextEditor(a,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&dp(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return D5(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const s=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:mo(M6),position:Bl.Full}}}],[a,l]=i.deltaDecorations(n,s);this.rangeHighlightDecorationId={rangeHighlightId:a,overviewRulerDecorationId:l}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const u1=class u1 extends hB{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=F("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,Hi.None}provideWithTextEditor(e,t,i){const n=e.editor,s=new Oi;s.add(t.onDidAccept(d=>{const[u]=t.selectedItems;if(u){if(!this.isValidLineNumber(n,u.lineNumber))return;this.gotoLocation(e,{range:this.toRange(u.lineNumber,u.column),keyMods:t.keyMods,preserveFocus:d.inBackground}),d.inBackground||t.hide()}}));const a=()=>{const d=this.parsePosition(n,t.value.trim().substr(u1.PREFIX.length)),u=this.getPickLabel(n,d.lineNumber,d.column);if(t.items=[{lineNumber:d.lineNumber,column:d.column,label:u}],t.ariaLabel=u,!this.isValidLineNumber(n,d.lineNumber)){this.clearDecorations(n);return}const g=this.toRange(d.lineNumber,d.column);n.revealRangeInCenter(g,0),this.addDecorations(n,g)};a(),s.add(t.onDidChangeValue(()=>a()));const l=B5(n);return l&&l.getOptions().get(68).renderType===2&&(l.updateOptions({lineNumbers:"on"}),s.add(Ws(()=>l.updateOptions({lineNumbers:"relative"})))),s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(s=>parseInt(s,10)).filter(s=>!isNaN(s)),n=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:n+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?F("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):F("gotoLineLabel","Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},s=this.lineCount(e);return s>1?F("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,s):F("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const n=this.getModel(e);if(!n)return!1;const s={lineNumber:t,column:i};return n.validatePosition(s).equals(s)}lineCount(e){var t;return((t=this.getModel(e))==null?void 0:t.getLineCount())??0}};u1.PREFIX=":";let fS=u1;var jU=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},VU=function(r,e){return function(t,i){e(t,i,r)}};let z0=class extends fS{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=bo.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};z0=jU([VU(0,ho)],z0);var oh;let fB=(oh=class extends Si{constructor(){super({id:oh.ID,label:L5.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:pe.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Sc).quickAccess.show(z0.PREFIX)}},oh.ID="editor.action.gotoLine",oh);Yt(fB);tl.as(uv.Quickaccess).registerQuickAccessProvider({ctor:z0,prefix:z0.PREFIX,helpEntries:[{description:L5.gotoLineActionLabel,commandId:fB.ID}]});const pB=[void 0,[]];function gC(r,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?$U(r,n.values,t,i):gB(r,e,t,i)}function $U(r,e,t,i){let n=0;const s=[];for(const a of e){const[l,d]=gB(r,a,t,i);if(typeof l!="number")return pB;n+=l,s.push(...d)}return[n,qU(s)]}function gB(r,e,t,i){const n=e5(e.original,e.originalLowercase,t,r,r.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],E1(n)]:pB}function qU(r){const e=r.sort((n,s)=>n.start-s.start),t=[];let i;for(const n of e)!i||!UU(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function UU(r,e){return!(r.end<e.start||e.end<r.start)}function tD(r){return r.startsWith('"')&&r.endsWith('"')}const vB=" ";function pS(r){typeof r!="string"&&(r="");const e=r.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=iD(r),s=t.indexOf(vy)>=0,a=tD(r);let l;const d=r.split(vB);if(d.length>1)for(const u of d){const g=tD(u),{pathNormalized:x,normalized:m,normalizedLowercase:C}=iD(u);m&&(l||(l=[]),l.push({original:u,originalLowercase:u.toLowerCase(),pathNormalized:x,normalized:m,normalizedLowercase:C,expectContiguousMatch:g}))}return{original:r,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:l,containsPathSeparator:s,expectContiguousMatch:a}}function iD(r){let e;g1?e=r.replace(/\//g,vy):e=r.replace(/\\/g,vy);const t=TP(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function nD(r){return Array.isArray(r)?pS(r.map(e=>e.original).join(vB)):pS(r.original)}var GU=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sD=function(r,e){return function(t,i){e(t,i,r)}},Ux,Ua;let mu=(Ua=class extends hB{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,F("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),Hi.None}provideWithTextEditor(e,t,i,n){const s=e.editor,a=this.getModel(s);return a?this._languageFeaturesService.documentSymbolProvider.has(a)?this.doProvideWithEditorSymbols(e,a,t,i,n):this.doProvideWithoutEditorSymbols(e,a,t,i):Hi.None}doProvideWithoutEditorSymbols(e,t,i,n){const s=new Oi;return this.provideLabelPick(i,F("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,s)||n.isCancellationRequested||s.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),s}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;const i=new v1,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(Ws(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,s){var x;const a=e.editor,l=new Oi;l.add(i.onDidAccept(m=>{var _;const[C]=i.selectedItems;C&&C.range&&(this.gotoLocation(e,{range:C.range.selection,keyMods:i.keyMods,preserveFocus:m.inBackground}),(_=s==null?void 0:s.handleAccept)==null||_.call(s,C),m.inBackground||i.hide())})),l.add(i.onDidTriggerItemButton(({item:m})=>{m&&m.range&&(this.gotoLocation(e,{range:m.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const d=this.getDocumentSymbols(t,n);let u;const g=async m=>{u==null||u.dispose(!0),i.busy=!1,u=new Lo(n),i.busy=!0;try{const C=pS(i.value.substr(Ux.PREFIX.length).trim()),_=await this.doGetSymbolPicks(d,C,void 0,u.token,t);if(n.isCancellationRequested)return;if(_.length>0){if(i.items=_,m&&C.original.length===0){const E=OP(_,k=>!!(k.type!=="separator"&&k.range&&Ye.containsPosition(k.range.decoration,m)));E&&(i.activeItems=[E])}}else C.original.length>0?this.provideLabelPick(i,F("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,F("noSymbolResults","No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return l.add(i.onDidChangeValue(()=>g(void 0))),g((x=a.getSelection())==null?void 0:x.getPosition()),l.add(i.onDidChangeActive(()=>{const[m]=i.activeItems;m&&m.range&&(a.revealRangeInCenter(m.range.selection,0),this.addDecorations(a,m.range.decoration))})),l}async doGetSymbolPicks(e,t,i,n,s){var k,I;const a=await e;if(n.isCancellationRequested)return[];const l=t.original.indexOf(Ux.SCOPE_PREFIX)===0,d=l?1:0;let u,g;t.values&&t.values.length>1?(u=nD(t.values[0]),g=nD(t.values.slice(1))):u=t;let x;const m=(I=(k=this.options)==null?void 0:k.openSideBySideDirection)==null?void 0:I.call(k);m&&(x=[{iconClass:m==="right"?xs.asClassName(An.splitHorizontal):xs.asClassName(An.splitVertical),tooltip:m==="right"?F("openToSide","Open to the Side"):F("openToBottom","Open to the Bottom")}]);const C=[];for(let M=0;M<a.length;M++){const N=a[M],O=MP(N.name),z=`$(${RP.toIcon(N.kind).id}) ${O}`,U=z.length-O.length;let q=N.containerName;i!=null&&i.extraContainerLabel&&(q?q=`${i.extraContainerLabel} • ${q}`:q=i.extraContainerLabel);let se,Ee,ge,he;if(t.original.length>d){let nt=!1;if(u!==t&&([se,Ee]=gC(z,{...t,values:void 0},d,U),typeof se=="number"&&(nt=!0)),typeof se!="number"&&([se,Ee]=gC(z,u,d,U),typeof se!="number"))continue;if(!nt&&g){if(q&&g.original.length>0&&([ge,he]=gC(q,g)),typeof ge!="number")continue;typeof se=="number"&&(se+=ge)}}const Ve=N.tags&&N.tags.indexOf(1)>=0;C.push({index:M,kind:N.kind,score:se,label:z,ariaLabel:NP(N.name,N.kind),description:q,highlights:Ve?void 0:{label:Ee,description:he},range:{selection:Ye.collapseToStart(N.selectionRange),decoration:N.range},uri:s.uri,symbolName:O,strikethrough:Ve,buttons:x})}const _=C.sort((M,N)=>l?this.compareByKindAndScore(M,N):this.compareByScore(M,N));let E=[];if(l){let z=function(){N&&typeof M=="number"&&O>0&&(N.label=KS(xC[M]||vC,O))},M,N,O=0;for(const U of _)M!==U.kind?(z(),M=U.kind,O=1,N={type:"separator"},E.push(N)):O++,E.push(U);z()}else _.length>0&&(E=[{label:F("symbols","symbols ({0})",C.length),type:"separator"},..._]);return E}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=xC[e.kind]||vC,n=xC[t.kind]||vC,s=i.localeCompare(n);return s===0?this.compareByScore(e,t):s}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},Ux=Ua,Ua.PREFIX="@",Ua.SCOPE_PREFIX=":",Ua.PREFIX_BY_CATEGORY=`${Ua.PREFIX}${Ua.SCOPE_PREFIX}`,Ua);mu=Ux=GU([sD(0,hn),sD(1,Ev)],mu);const vC=F("property","properties ({0})"),xC={5:F("method","methods ({0})"),11:F("function","functions ({0})"),8:F("_constructor","constructors ({0})"),12:F("variable","variables ({0})"),4:F("class","classes ({0})"),22:F("struct","structs ({0})"),23:F("event","events ({0})"),24:F("operator","operators ({0})"),10:F("interface","interfaces ({0})"),2:F("namespace","namespaces ({0})"),3:F("package","packages ({0})"),25:F("typeParameter","type parameters ({0})"),1:F("modules","modules ({0})"),6:F("property","properties ({0})"),9:F("enum","enumerations ({0})"),21:F("enumMember","enumeration members ({0})"),14:F("string","strings ({0})"),0:F("file","files ({0})"),17:F("array","arrays ({0})"),15:F("number","numbers ({0})"),16:F("boolean","booleans ({0})"),18:F("object","objects ({0})"),19:F("key","keys ({0})"),7:F("field","fields ({0})"),13:F("constant","constants ({0})")};var KU=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},mC=function(r,e){return function(t,i){e(t,i,r)}};let gS=class extends mu{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=bo.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};gS=KU([mC(0,ho),mC(1,hn),mC(2,Ev)],gS);const h1=class h1 extends Si{constructor(){super({id:h1.ID,label:xy.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:pe.hasDocumentSymbolProvider,kbOpts:{kbExpr:pe.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Sc).quickAccess.show(mu.PREFIX,{itemActivation:HP.NONE})}};h1.ID="editor.action.quickOutline";let f_=h1;Yt(f_);tl.as(uv.Quickaccess).registerQuickAccessProvider({ctor:gS,prefix:mu.PREFIX,helpEntries:[{description:xy.quickOutlineActionLabel,prefix:mu.PREFIX,commandId:f_.ID},{description:xy.quickOutlineByCategoryActionLabel,prefix:mu.PREFIX_BY_CATEGORY}]});function ZU(r){const e=new Map;for(const t of r)e.set(t,(e.get(t)??0)+1);return e}class Yg{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,s=[];for(const[a,l]of this.documents){if(t.isCancellationRequested)return[];for(const d of l.chunks){const u=this.computeSimilarityScore(d,i,n);u>0&&s.push({key:a,score:u})}}return s}static termFrequencies(e){return ZU(Yg.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const s of n)s.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(s)&&(yield t(s))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const s=Yg.termFrequencies(n);for(const a of s.keys())this.chunkOccurrences.set(a,(this.chunkOccurrences.get(a)??0)+1);i.push({text:n,tf:s})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const s=this.chunkOccurrences.get(n);if(typeof s=="number"){const a=s-1;a<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,a)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[s,a]of Object.entries(t)){const l=e.tf.get(s);if(!l)continue;let d=i.get(s);typeof d!="number"&&(d=this.computeIdf(s),i.set(s,d));const u=l*d;n+=u*a}return n}computeEmbedding(e){const t=Yg.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const s=this.computeIdf(i);s>0&&(t[i]=n*s)}return t}}function YU(r){var i;const e=r.slice(0);e.sort((n,s)=>s.score-n.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const n of e)n.score/=t;return e}var Df;(function(r){r[r.NO_ACTION=0]="NO_ACTION",r[r.CLOSE_PICKER=1]="CLOSE_PICKER",r[r.REFRESH_PICKER=2]="REFRESH_PICKER",r[r.REMOVE_ITEM=3]="REMOVE_ITEM"})(Df||(Df={}));function _C(r){return Array.isArray(r.items)}function oD(r){const e=r;return!!e.picks&&e.additionalPicks instanceof Promise}class XU extends Hi{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var u;const n=new Oi;e.canAcceptInBackground=!!((u=this.options)!=null&&u.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=n.add(new qr),l=async()=>{var k;const g=a.value=new Oi;s==null||s.dispose(!0),e.busy=!1,s=new Lo(t);const x=s.token;let m=e.value.substring(this.prefix.length);(k=this.options)!=null&&k.shouldSkipTrimPickFilter||(m=m.trim());const C=this._getPicks(m,g,x,i),_=(I,M)=>{var z;let N,O;if(_C(I)?(N=I.items,O=I.active):N=I,N.length===0){if(M)return!1;(m.length>0||e.hideInput)&&((z=this.options)!=null&&z.noResultsPick)&&(zP(this.options.noResultsPick)?N=[this.options.noResultsPick(m)]:N=[this.options.noResultsPick])}return e.items=N,O&&(e.activeItems=[O]),!0},E=async I=>{let M=!1,N=!1;await Promise.all([(async()=>{typeof I.mergeDelay=="number"&&(await A1(I.mergeDelay),x.isCancellationRequested)||N||(M=_(I.picks,!0))})(),(async()=>{e.busy=!0;try{const O=await I.additionalPicks;if(x.isCancellationRequested)return;let z,U;_C(I.picks)?(z=I.picks.items,U=I.picks.active):z=I.picks;let q,se;if(_C(O)?(q=O.items,se=O.active):q=O,q.length>0||!M){let Ee;if(!U&&!se){const ge=e.activeItems[0];ge&&z.indexOf(ge)!==-1&&(Ee=ge)}_({items:[...z,...q],active:U||se||Ee})}}finally{x.isCancellationRequested||(e.busy=!1),N=!0}})()])};if(C!==null)if(oD(C))await E(C);else if(!(C instanceof Promise))_(C);else{e.busy=!0;try{const I=await C;if(x.isCancellationRequested)return;oD(I)?await E(I):_(I)}finally{x.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>l())),l(),n.add(e.onDidAccept(g=>{var m;if(i!=null&&i.handleAccept){g.inBackground||e.hide(),(m=i.handleAccept)==null||m.call(i,e.activeItems[0]);return}const[x]=e.selectedItems;typeof(x==null?void 0:x.accept)=="function"&&(g.inBackground||e.hide(),x.accept(e.keyMods,g))}));const d=async(g,x)=>{var C;if(typeof x.trigger!="function")return;const m=((C=x.buttons)==null?void 0:C.indexOf(g))??-1;if(m>=0){const _=x.trigger(m,e.keyMods),E=typeof _=="number"?_:await _;if(t.isCancellationRequested)return;switch(E){case Df.NO_ACTION:break;case Df.CLOSE_PICKER:e.hide();break;case Df.REFRESH_PICKER:l();break;case Df.REMOVE_ITEM:{const k=e.items.indexOf(x);if(k!==-1){const I=e.items.slice(),M=I.splice(k,1),N=e.activeItems.filter(z=>z!==M[0]),O=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=I,N&&(e.activeItems=N),e.keepScrollPosition=O}break}}}};return n.add(e.onDidTriggerItemButton(({button:g,item:x})=>d(g,x))),n.add(e.onDidTriggerSeparatorButton(({button:g,separator:x})=>d(g,x))),n}}var xB=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Uc=function(r,e){return function(t,i){e(t,i,r)}},Kd,fo,kl;let vS=(kl=class extends XU{constructor(e,t,i,n,s,a){super(Kd.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=s,this.dialogService=a,this.commandsHistory=this._register(this.instantiationService.createInstance(xS)),this.options=e}async _getPicks(e,t,i,n){var C,_;const s=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const a=F5(()=>{const E=new Yg;E.updateDocuments(s.map(I=>({key:I.commandId,textChunks:[this.getTfIdfChunk(I)]})));const k=E.calculateScores(e,i);return YU(k).filter(I=>I.score>Kd.TFIDF_THRESHOLD).slice(0,Kd.TFIDF_MAX_RESULTS)}),l=[];for(const E of s){const k=Kd.WORD_FILTER(e,E.label)??void 0,I=E.commandAlias?Kd.WORD_FILTER(e,E.commandAlias)??void 0:void 0;if(k||I)E.highlights={label:k,detail:this.options.showAlias?I:void 0},l.push(E);else if(e===E.commandId)l.push(E);else if(e.length>=3){const M=a();if(i.isCancellationRequested)return[];const N=M.find(O=>O.key===E.commandId);N&&(E.tfIdfScore=N.score,l.push(E))}}const d=new Map;for(const E of l){const k=d.get(E.label);k?(E.description=E.commandId,k.description=k.commandId):d.set(E.label,E)}l.sort((E,k)=>{if(E.tfIdfScore&&k.tfIdfScore)return E.tfIdfScore===k.tfIdfScore?E.label.localeCompare(k.label):k.tfIdfScore-E.tfIdfScore;if(E.tfIdfScore)return 1;if(k.tfIdfScore)return-1;const I=this.commandsHistory.peek(E.commandId),M=this.commandsHistory.peek(k.commandId);if(I&&M)return I>M?-1:1;if(I)return-1;if(M)return 1;if(this.options.suggestedCommandIds){const N=this.options.suggestedCommandIds.has(E.commandId),O=this.options.suggestedCommandIds.has(k.commandId);if(N&&O)return 0;if(N)return-1;if(O)return 1}return E.label.localeCompare(k.label)});const u=[];let g=!1,x=!0,m=!!this.options.suggestedCommandIds;for(let E=0;E<l.length;E++){const k=l[E];E===0&&this.commandsHistory.peek(k.commandId)&&(u.push({type:"separator",label:F("recentlyUsed","recently used")}),g=!0),x&&k.tfIdfScore!==void 0&&(u.push({type:"separator",label:F("suggested","similar commands")}),x=!1),m&&k.tfIdfScore===void 0&&!this.commandsHistory.peek(k.commandId)&&((C=this.options.suggestedCommandIds)!=null&&C.has(k.commandId))&&(u.push({type:"separator",label:F("commonlyUsed","commonly used")}),g=!0,m=!1),g&&k.tfIdfScore===void 0&&!this.commandsHistory.peek(k.commandId)&&!((_=this.options.suggestedCommandIds)!=null&&_.has(k.commandId))&&(u.push({type:"separator",label:F("morecCommands","other commands")}),g=!1),u.push(this.toCommandPick(k,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:u,additionalPicks:(async()=>{var I;const E=await this.getAdditionalCommandPicks(s,l,e,i);if(i.isCancellationRequested)return[];const k=E.map(M=>this.toCommandPick(M,n));return x&&((I=k[0])==null?void 0:I.type)!=="separator"&&k.unshift({type:"separator",label:F("suggested","similar commands")}),k})()}:u}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?F("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(s=e.args)!=null&&s.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(a){Id(a)||this.dialogService.error(F("canNotRun","Command '{0}' resulted in an error",e.label),_m(a))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}},Kd=kl,kl.PREFIX=">",kl.TFIDF_THRESHOLD=.5,kl.TFIDF_MAX_RESULTS=5,kl.WORD_FILTER=WP($P,VP,jP),kl);vS=Kd=xB([Uc(1,Nn),Uc(2,go),Uc(3,ko),Uc(4,nl),Uc(5,o9)],vS);var Ga;let xS=(Ga=class extends Hi{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,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===zS.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=fo.getConfiguredCommandHistoryLength(this.configurationService),fo.cache&&fo.cache.limit!==this.configuredCommandsHistoryLength&&(fo.cache.limit=this.configuredCommandsHistoryLength,fo.hasChanges=!0))}load(){const e=this.storageService.get(fo.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=fo.cache=new tv(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((s,a)=>s.value-a.value),n.forEach(s=>i.set(s.key,s.value))}fo.counter=this.storageService.getNumber(fo.PREF_KEY_COUNTER,0,fo.counter)}push(e){fo.cache&&(fo.cache.set(e,fo.counter++),fo.hasChanges=!0)}peek(e){var t;return(t=fo.cache)==null?void 0:t.peek(e)}saveState(){if(!fo.cache||!fo.hasChanges)return;const e={usesLRU:!0,entries:[]};fo.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(fo.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(fo.PREF_KEY_COUNTER,fo.counter,0,0),fo.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var n,s;const i=(s=(n=e.getValue().workbench)==null?void 0:n.commandPalette)==null?void 0:s.history;return typeof i=="number"?i:fo.DEFAULT_COMMANDS_HISTORY_LENGTH}},fo=Ga,Ga.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Ga.PREF_KEY_CACHE="commandPalette.mru.cache",Ga.PREF_KEY_COUNTER="commandPalette.mru.counter",Ga.counter=1,Ga.hasChanges=!1,Ga);xS=fo=xB([Uc(0,Pd),Uc(1,$s),Uc(2,Dh)],xS);class QU extends vS{constructor(e,t,i,n,s,a){super(e,t,i,n,s,a)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let s;(i=n.metadata)!=null&&i.description&&(qP(n.metadata.description)?s=n.metadata.description:s={original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:s,label:UP(n.label)||n.id})}return t}}var JU=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sf=function(r,e){return function(t,i){e(t,i,r)}};let W0=class extends QU{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,s,a){super({showAlias:!1},e,i,n,s,a),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};W0=JU([sf(0,Nn),sf(1,ho),sf(2,go),sf(3,ko),sf(4,nl),sf(5,o9)],W0);const f1=class f1 extends Si{constructor(){super({id:f1.ID,label:I5.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:pe.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Sc).quickAccess.show(W0.PREFIX)}};f1.ID="editor.action.quickCommand";let p_=f1;Yt(p_);tl.as(uv.Quickaccess).registerQuickAccessProvider({ctor:W0,prefix:W0.PREFIX,helpEntries:[{description:I5.quickCommandHelp,commandId:p_.ID}]});var eG=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},of=function(r,e){return function(t,i){e(t,i,r)}};let mS=class extends mh{constructor(e,t,i,n,s,a,l){super(!0,e,t,i,n,s,a,l)}};mS=eG([of(1,hs),of(2,ho),of(3,or),of(4,Nn),of(5,Pd),of(6,$s)],mS);Kn(mh.ID,mS,4);class tG extends Si{constructor(){super({id:"editor.action.toggleHighContrast",label:GP.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(A5),n=i.getColorTheme();n0(n.type)?(i.setTheme(this._originalThemeName||(l8(n.type)?KP:ZP)),this._originalThemeName=null):(i.setTheme(l8(n.type)?YP:XP),this._originalThemeName=n.themeName)}}Yt(tG);const mB="she-theme";function iG(){return localStorage.getItem(mB)??"system"}function nG(r){localStorage.setItem(mB,r);const e=document.documentElement;r==="system"?e.removeAttribute("data-theme"):e.setAttribute("data-theme",r),window.dispatchEvent(new CustomEvent("she:theme-changed"))}function Af(){const r=document.documentElement.getAttribute("data-theme");return r==="light"?"vs":r==="dark"||window.matchMedia("(prefers-color-scheme: dark)").matches?"vs-dark":"vs"}let _S=null;function sG(r){_S=r}function oG(r={}){return{"Content-Type":"application/json",...r}}async function ei(r,e,t){const i=await fetch(e,{method:r,headers:oG(),body:t!==void 0?JSON.stringify(t):void 0});if(i.status===401)throw _S&&_S(),new Error("Unauthorized");if(!i.ok){const n=await i.json().catch(()=>({error:i.statusText}));throw new Error(n.error??i.statusText)}return i.json()}async function rG(){return await(await fetch("/she/auth/mode")).json()}async function aG(r){const e=await fetch("/she/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:r})});if(!e.ok){const t=await e.json().catch(()=>({error:e.statusText}));throw new Error(t.error??"Login failed")}}async function lG(){await fetch("/she/auth/logout",{method:"POST"})}async function cG(r,e,t,i){const n=await fetch("/she/auth/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:r,password:e,proxyHeader:t,proxyLogoutUrl:i})});if(!n.ok){const s=await n.json().catch(()=>({error:n.statusText}));throw new Error(s.error??"Setup failed")}}function _B(){return ei("GET","/she/scripts/tree")}function px(r){return ei("GET",`/she/scripts/${r}`)}function Kl(r,e){return ei("PUT",`/she/scripts/${r}`,{content:e})}function rD(r,e={}){const t=new URLSearchParams({q:r});return e.regex&&t.set("regex","true"),e.caseSensitive&&t.set("caseSensitive","true"),e.mode&&t.set("mode",e.mode),ei("GET",`/she/scripts/search?${t}`)}function gx(r){return ei("DELETE",`/she/scripts/${r}`)}function aD(r,e){return ei("POST",`/she/scripts/${r}/rename`,{newPath:e})}function dG(r){return ei("POST","/she/scripts/mkdir",{path:r})}function uG(){return ei("GET","/she/git/status")}function Gc(){return ei("GET","/she/status")}function hG(){return ei("GET","/she/secrets")}function fG(r,e,t,i=!0){return ei("PUT",`/she/secrets/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,{value:t,secret:i})}function pG(r,e){return ei("POST",`/she/secrets/${encodeURIComponent(r)}/${encodeURIComponent(e)}/secret`)}function lD(r,e){return ei("DELETE",`/she/secrets/${encodeURIComponent(r)}`+(e?`/${encodeURIComponent(e)}`:""))}function bB(){return ei("POST","/she/restart")}function gG(){return ei("POST","/she/update")}function vG(){return ei("POST","/she/check-update")}function xG(r,e){return ei("POST","/she/git/commit",{path:r,message:e})}function cD(r,e){return ei("POST","/she/git/commit",{files:r,message:e})}function dD(r){return ei("POST","/she/git/commit",{message:r})}function vx(r){return ei("POST","/she/git/push",{remote:r})}function mG(r,e){return ei("GET",`/she/git/log?path=${encodeURIComponent(r)}&limit=${e}`)}function _G(r,e){return ei("GET",`/she/git/show?hash=${encodeURIComponent(r)}&path=${encodeURIComponent(e)}`)}function Ec(){return ei("GET","/she/config")}function bG(r){return ei("PUT","/she/config",r)}function j0(r,e){return ei("PATCH","/she/config",e===void 0?{path:r}:{path:r,value:e})}function Rh(r){return r.split("/").map(encodeURIComponent).join("/")}function CB(){return ei("GET","/she/db/docs")}function CG(r){return ei("GET",`/she/db/docs/${Rh(r)}`)}function uD(r,e){return ei("PUT",`/she/db/docs/${Rh(r)}`,e)}function yG(r){return ei("DELETE",`/she/db/docs/${Rh(r)}`)}function yB(){return ei("GET","/she/db/views")}function wG(r){return ei("GET",`/she/db/views/${Rh(r)}`)}function hD(r,e){return ei("PUT",`/she/db/views/${Rh(r)}`,e)}function EG(r){return ei("DELETE",`/she/db/views/${Rh(r)}`)}function SG(){return ei("GET","/she/deps")}function kG(r){return ei("GET",`/she/deps/search?q=${encodeURIComponent(r)}`)}function DG(r,e){return ei("POST","/she/deps/install",{name:r,version:null})}function AG(r){return ei("POST","/she/deps/remove",{name:r})}function BG(r){return ei("POST","/she/deps/update",{name:r})}function wB(){return ei("GET","/she/deps/outdated")}function FG(){return ei("POST","/she/deps/check-outdated")}function LG(){return ei("GET","/she/ai/conversations")}function fD(r){return ei("GET",`/she/ai/conversations/${encodeURIComponent(r)}`)}function IG(r,e,t){return ei("PUT",`/she/ai/conversations/${encodeURIComponent(r)}`,{title:e,messages:t})}function PG(r){return ei("DELETE",`/she/ai/conversations/${encodeURIComponent(r)}`)}function bC(r){return ei("GET",`/she/db/views/${Rh(r)}/result`)}function c2(){return ei("GET","/she/matter/devices")}function Gx(r){return ei("GET",`/she/matter/devices/${r}`)}function TG(r){return ei("POST","/she/matter/commission",r)}function MG(r){return ei("DELETE",`/she/matter/devices/${r}`)}function RG(r,e){return ei("POST",`/she/matter/devices/${r}/rename`,{name:e})}function NG(r,e,t,i,n){return ei("POST",`/she/matter/devices/${r}/command`,{endpointId:e,clusterName:t,command:i,args:n})}function EB(){return ei("GET","/she/mqtt/state")}function pD(r,e,t=!1,i=0){return ei("POST","/she/mqtt/publish",{topic:r,payload:e,retain:t,qos:i})}function OG(r){const e=r?`?prefix=${encodeURIComponent(r)}`:"";return ei("GET",`/she/mqtt/ha-discovery${e}`)}function HG(r){return ei("DELETE","/she/mqtt/ha-discovery",{topics:r})}function zG(r,e){return ei("POST",`/she/ai/publish/${encodeURIComponent(r)}`,{ok:e})}function WG(r){return ei("GET",`/she/ai/drafts/${encodeURIComponent(r)}`)}function gD(r,e){return ei("POST",`/she/ai/drafts/${encodeURIComponent(r)}/status`,{status:e})}function jG(){return ei("GET","/she/ai/memory")}function VG(r){return ei("POST","/she/ai/memory",{text:r})}function $G(r,e){return ei("PUT",`/she/ai/memory/${encodeURIComponent(r)}`,{text:e})}function qG(r){return ei("DELETE",`/she/ai/memory/${encodeURIComponent(r)}`)}function SB(){return ei("GET","/she/ai/config")}function kB(r){return ei("GET","/she/ai/models"+(r?"?provider="+encodeURIComponent(r):""))}function bS(r){return ei("GET",`/she/ai/model-info?model=${encodeURIComponent(r)}`)}function DB(r){return ei("POST","/she/ai/prompt",r)}async function AB(r,e,t,i){const s=await fetch("/she/ai/chat/stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:t});if(!s.ok){const u=await s.json().catch(()=>({error:s.statusText}));throw new Error(u.error??s.statusText)}const a=s.body.getReader(),l=new TextDecoder;let d="";try{for(;;){const{done:u,value:g}=await a.read();if(u)break;d+=l.decode(g,{stream:!0});const x=d.split(`
|
|
79
|
-
`);d=x.pop()??"";for(const m of x){if(!m.startsWith("data: "))continue;const C=m.slice(6).trim();if(C==="[DONE]")return;try{const _=JSON.parse(C);if(_.error)throw new Error(_.error);if(_.type==="tool_call"||_.type==="tool_result"){i==null||i({type:_.type,name:_.name??"",args:_.args,content:_.content});continue}if(_.type==="draft"||_.type==="publish_request"||_.type==="publish_decided"||_.type==="analysis"){i==null||i({..._,type:_.type,name:_.type});continue}_.token&&e(_.token)}catch(_){if(_ instanceof SyntaxError)continue;throw _}}}}finally{a.releaseLock()}}function cb(){return ei("GET","/she/broker/status")}function UG(){return ei("GET","/she/broker/local/check")}function GG(){return ei("GET","/she/broker/ip-addresses")}function kv(){return ei("GET","/she/broker/config")}function KG(r=500){return ei("GET",`/she/broker/logs?limit=${r}`)}function BB(r){return ei("PUT","/she/broker/config",r)}function ZG(r,e){return ei("PUT","/she/broker/config/raw",{content:r,checksum:e})}function YG(){return ei("GET","/she/broker/config/backups")}function XG(r){return ei("POST","/she/broker/config/restore",{backup:r})}function db(){return ei("POST","/she/broker/reload")}function QG(){return ei("POST","/she/broker/restart")}function JG(){return ei("POST","/she/broker/wizard/deactivate")}function eK(){return ei("POST","/she/broker/wizard/reinit")}function tK(){return ei("GET","/she/broker/wizard/diagnose")}function iK(r){return ei("GET",`/she/broker/passwd?file=${encodeURIComponent(r)}`)}function vD(r,e,t){return ei("POST","/she/broker/passwd",{file:r,username:e,password:t})}function nK(r,e){return ei("DELETE",`/she/broker/passwd/${encodeURIComponent(e)}`,{file:r})}function sK(r){return ei("GET",`/she/broker/acl?file=${encodeURIComponent(r)}`)}function oK(r,e){return ei("PUT","/she/broker/acl",{file:r,content:e})}function rK(){return ei("GET","/she/broker/users")}function aK(r,e){return ei("POST","/she/broker/users",{username:r,password:e})}function lK(r){return ei("DELETE",`/she/broker/users/${encodeURIComponent(r)}`)}function cK(r,e){return ei("PUT",`/she/broker/users/${encodeURIComponent(r)}/password`,{password:e})}function dK(r,e){return ei("POST",`/she/broker/users/${encodeURIComponent(r)}/roles`,{rolename:e})}function uK(r,e){return ei("DELETE",`/she/broker/users/${encodeURIComponent(r)}/roles/${encodeURIComponent(e)}`)}function FB(){return ei("GET","/she/broker/roles")}function hK(r){return ei("POST","/she/broker/roles",{rolename:r})}function fK(r){return ei("DELETE",`/she/broker/roles/${encodeURIComponent(r)}`)}function pK(r,e){return ei("POST",`/she/broker/roles/${encodeURIComponent(r)}/acls`,e)}function gK(r,e,t){return ei("DELETE",`/she/broker/roles/${encodeURIComponent(r)}/acls`,{acltype:e,topic:t})}function vK(){return ei("GET","/she/broker/groups")}function xK(r){return ei("POST","/she/broker/groups",{groupname:r})}function mK(r){return ei("DELETE",`/she/broker/groups/${encodeURIComponent(r)}`)}function xD(r,e){return ei("POST",`/she/broker/groups/${encodeURIComponent(r)}/clients`,{username:e})}function mD(r,e){return ei("DELETE",`/she/broker/groups/${encodeURIComponent(r)}/clients/${encodeURIComponent(e)}`)}function _K(r,e){return ei("POST",`/she/broker/groups/${encodeURIComponent(r)}/roles`,{rolename:e})}function bK(r,e){return ei("DELETE",`/she/broker/groups/${encodeURIComponent(r)}/roles/${encodeURIComponent(e)}`)}function CK(){return ei("GET","/she/broker/acl-defaults")}function yK(r){return ei("PUT","/she/broker/acl-defaults",{acls:r})}function wK(r){return ei("GET",`/she/broker/acl-check?${new URLSearchParams({topic:r})}`)}function EK(){return ei("GET","/she/broker/anonymous-group")}function SK(r){return ei("PUT","/she/broker/anonymous-group",{groupname:r})}function kK(){return ei("GET","/she/broker/ca/server")}function DK(r){return ei("POST","/she/broker/ca/server/generate",r)}function AK(r){return ei("POST","/she/broker/ca/server/csr",r)}function CC(r){return ei("POST","/she/broker/ca/server/import",r)}function BK(){return ei("GET","/she/broker/ca/trusted")}function FK(r){return ei("POST","/she/broker/ca/trusted",{pem:r})}function LK(r){return ei("DELETE",`/she/broker/ca/trusted/${encodeURIComponent(r)}`)}function IK(r){return ei("GET",`/she/broker/fs/complete?path=${encodeURIComponent(r)}`)}function PK(r){return ei("POST","/she/broker/ca/server/pathlink",r)}function TK(r){return ei("POST","/she/broker/ca/trusted/addpath",{path:r})}function LB(r=!1){return ei("GET","/she/services/instances"+(r?"?refresh=1":""))}function MK(r){return ei("POST",`/she/services/instances/${encodeURIComponent(r)}/restart`)}function RK(r,e){return ei("POST",`/she/services/instances/${encodeURIComponent(r)}/loglevel`,{level:e})}function NK(r){return ei("GET",`/she/services/instances/${encodeURIComponent(r)}/retained`)}function OK(r,e=!0){return ei("DELETE",`/she/services/instances/${encodeURIComponent(r)}/retained`,{discovery:e})}const CS="-";function HK(r,e,t){return ei("POST",`${Fa(r,e,CS)}/migrate`,{name:t})}function zK(r,e,t={}){return ei("POST",`/she/services/hosts/${encodeURIComponent(r)}/adapters/${encodeURIComponent(e)}/discover`,t)}const Nd=r=>`/she/services/hosts/${encodeURIComponent(r)}`,Fa=(r,e,t)=>`${Nd(r)}/units/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,Dv=(r,e)=>`${Nd(r)}/adapters/${encodeURIComponent(e)}`;function ga(r=!1){return ei("GET",r?"/she/services/hosts?refresh=1":"/she/services/hosts")}function WK(r,e,t=!1){return ei("GET",`${Dv(r,e)}/schema${t?"?refresh=1":""}`)}function jK(r,e,t,i,n="own"){return ei("POST",`${Dv(r,e)}/install`,{instance:t,env:i,brokerMode:n})}function _D(r,e,t=!1){return ei("POST",`${Dv(r,e)}/update`,{force:t})}function bD(r,e,t,i){return ei("POST",`${Fa(r,e,t)}/${i}`)}function VK(r,e){return ei("POST",`${Nd(r)}/adapters/${encodeURIComponent(e)}/uninstall`)}function $K(r,e,t){return ei("DELETE",Fa(r,e,t))}function qK(r,e,t,i=200){return ei("GET",`${Fa(r,e,t)}/logs?n=${i}`)}function CD(r,e,t){return ei("POST",`${Fa(r,e,t)}/logs/follow`)}function UK(r,e,t){return ei("DELETE",`${Fa(r,e,t)}/logs/follow`)}function GK(r,e,t){return ei("GET",`${Fa(r,e,t)}/env`)}function KK(r,e,t,i,n,s,a={}){return ei("PUT",`${Fa(r,e,t)}/env`,{env:i,restart:n,brokerMode:s,rotate:a.rotate===!0})}function ZK(){return ei("GET","/she/services/ssh/pubkey")}function YK(){return ei("POST","/she/services/ssh/keygen")}function XK(r){return ei("POST",`${Nd(r)}/test`)}function QK(r,e="lts",t=null){return ei("POST",`${Nd(r)}/node/update`,{channel:e,version:t})}function JK(r=!1){return ei("GET",`/she/services/node/releases${r?"?refresh=1":""}`)}function eZ(r){return ei("POST",`${Nd(r)}/instances/restart-all`)}function tZ(r){return ei("POST","/she/services/setup/token",{origin:r})}function iZ(r){return ei("GET",`/she/services/setup/token/${encodeURIComponent(r)}`)}function yD(r){return ei("POST","/she/services/ssh/test",r)}function wD(r){return ei("POST",`${Nd(r)}/helper/deploy`)}function nZ(r,e,t=!1){return ei("POST",`${Nd(r)}/helper/remove`,{mode:e,force:t})}function sZ(r,e,t){return ei("GET",`${Fa(r,e,t)}/files`)}function oZ(r,e,t,i){return ei("GET",`${Fa(r,e,t)}/file?path=${encodeURIComponent(i)}`)}function rZ(r,e,t,i,n,s=!1){return ei("PUT",`${Fa(r,e,t)}/file`,{path:i,content:n,restart:s})}function aZ(r,e,t,i,n){return ei("POST",`${Fa(r,e,t)}/file/create`,{option:i,path:n})}function lZ(r,e,t){return ei("GET",`${Dv(r,e)}/asset?path=${encodeURIComponent(t)}`)}function cZ(r=!1){return ei("GET",r?"/she/services/catalog?refresh=1":"/she/services/catalog")}function dZ(r,e){return ei("POST",`${Dv(r,e)}/install-package`)}const uZ=2e3,Kx=[],hZ=500,Zx=[];function IB(){return Kx.slice()}function fZ(){return Zx.slice()}let oc=null;const g_=new Set,Bf=new Map;let Wf=null,Yx=null;function d2(){return Yx||(Yx=fetch("/she/logs/history").then(r=>r.ok?r.json():[]).catch(()=>[])),Yx}function Op(){let r=g_.size;for(const e of Bf.values())r+=e.size;return r}function pZ(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/she/ws`}function ub(){if(oc)return;d2();const r=pZ(),e=new WebSocket(r);oc=e,e.onmessage=t=>{try{const i=JSON.parse(t.data);if(i.type==="log"){const s={level:i.level,msg:i.msg,ts:i.ts};Kx.length>=uZ&&Kx.shift(),Kx.push(s),g_.forEach(a=>a(s))}if(i.type==="brokerLog"){const s={level:i.level,msg:i.msg,ts:i.ts};Zx.length>=hZ&&Zx.shift(),Zx.push(s)}const n=Bf.get(i.type);n&&n.forEach(s=>s(i))}catch{}},e.onclose=()=>{oc===e&&(oc=null,Yx=null),Op()>0&&(Wf=setTimeout(ub,3e3))},e.onerror=()=>{e.close()}}function gZ(){oc||Op()===0||(Wf&&(clearTimeout(Wf),Wf=null),ub())}function PB(){Wf&&clearTimeout(Wf),oc==null||oc.close(),oc=null}function u2(r){return g_.add(r),Op()===1&&ub(),()=>{g_.delete(r),Op()===0&&PB()}}function tr(r,e){return Bf.has(r)||Bf.set(r,new Set),Bf.get(r).add(e),Op()===1&&ub(),()=>{var t;(t=Bf.get(r))==null||t.delete(e),Op()===0&&PB()}}function hb(r){const e=new Date(r);return e.toTimeString().slice(0,8)+"."+String(e.getMilliseconds()).padStart(3,"0")}const yC=/([^\s():,]+\.js)(?::(\d+)(?::(\d+))?)?/g;function TB(r,e){const t=[];let i=0;yC.lastIndex=0;for(let n=yC.exec(r);n!==null;n=yC.exec(r)){const s=e(n[1]);s&&(n.index>i&&t.push({text:r.slice(i,n.index)}),t.push({text:n[0],link:{path:s,line:n[2]?Number(n[2]):void 0,column:n[3]?Number(n[3]):void 0}}),i=n.index+n[0].length)}return i<r.length&&t.push({text:r.slice(i)}),t}function MB(r){return e=>{const t=e.replace(/\\/g,"/");if(r.has(t))return t;for(const i of r)if(t.endsWith("/"+i))return i;return null}}function h2(r,e=new Set){for(const t of r)t.type==="file"?e.add(t.path):t.children&&h2(t.children,e);return e}var vZ=S('<button class="cancel svelte-1eh8v5n">Cancel</button>'),xZ=S('<div class="backdrop svelte-1eh8v5n" role="presentation"></div> <div class="dialog svelte-1eh8v5n" role="dialog" aria-modal="true"><p class="svelte-1eh8v5n"> </p> <div class="actions svelte-1eh8v5n"><!> <button> </button></div></div>',1);function Fr(r,e){_s(e,!0);let t=A(!1),i=A(""),n=A("Confirm"),s=A(!1),a=A(!1),l=null;function d(E,k){return p(i,E,!0),p(n,(k==null?void 0:k.confirm)??(k!=null&&k.alert?"OK":"Confirm"),!0),p(s,(k==null?void 0:k.danger)??!1,!0),p(a,(k==null?void 0:k.alert)??!1,!0),p(t,!0),new Promise(I=>l=I)}function u(E){p(t,!1),l==null||l(E),l=null}function g(E){o(t)&&(E.key==="Escape"&&u(!1),E.key==="Enter"&&u(!0))}var x={show:d},m=Rs();Ls("keydown",Ea,g);var C=Ct(m);{var _=E=>{var k=xZ(),I=Ct(k),M=h(I,2),N=f(M),O=f(N),z=h(N,2),U=f(z);{var q=he=>{var Ve=vZ();H("click",Ve,()=>u(!1)),y(he,Ve)};P(U,he=>{o(a)||he(q)})}var se=h(U,2);let Ee;var ge=f(se);T(()=>{B(O,o(i)),Ee=Ht(se,1,"svelte-1eh8v5n",null,Ee,{danger:o(s)}),B(ge,o(n))}),H("click",I,()=>u(!1)),H("click",se,()=>u(!0)),y(E,k)};P(C,E=>{o(t)&&E(_)})}return y(r,m),bs(x)}ks(["click"]);var mZ=S('<div class="backdrop svelte-1vi95tb" role="presentation"></div> <div class="dialog svelte-1vi95tb" role="dialog" aria-modal="true"><p class="svelte-1vi95tb"> </p> <input class="svelte-1vi95tb"/> <div class="actions svelte-1vi95tb"><button class="cancel svelte-1vi95tb">Cancel</button> <button class="svelte-1vi95tb"> </button></div></div>',1);function f2(r,e){_s(e,!0);let t=A(!1),i=A(""),n=A(""),s=A("OK"),a=A(""),l=null,d=A(void 0);function u(I,M){return p(i,I,!0),p(n,(M==null?void 0:M.placeholder)??"",!0),p(s,(M==null?void 0:M.confirm)??"OK",!0),p(a,(M==null?void 0:M.initial)??"",!0),p(t,!0),setTimeout(()=>{if(o(d)){o(d).focus();const N=o(d).value.length;o(d).setSelectionRange(N,N)}},0),new Promise(N=>l=N)}function g(){const I=o(a).trim();I&&(p(t,!1),l==null||l(I),l=null,p(a,""))}function x(){p(t,!1),l==null||l(null),l=null,p(a,"")}function m(I){o(t)&&I.key==="Escape"&&(I.stopPropagation(),x())}var C={show:u},_=Rs();Ls("keydown",Ea,m);var E=Ct(_);{var k=I=>{var M=mZ(),N=Ct(M),O=h(N,2),z=f(O),U=f(z),q=h(z,2);ds(q,Ve=>p(d,Ve),()=>o(d));var se=h(q,2),Ee=f(se),ge=h(Ee,2),he=f(ge);T(Ve=>{B(U,o(i)),_i(q,"placeholder",o(n)),ge.disabled=Ve,B(he,o(s))},[()=>!o(a).trim()]),H("click",N,x),H("keydown",q,Ve=>{Ve.key==="Enter"&&(Ve.preventDefault(),g())}),ci(q,()=>o(a),Ve=>p(a,Ve)),H("click",Ee,x),H("click",ge,g),y(I,M)};P(E,I=>{o(t)&&I(k)})}return y(r,_),bs(C)}ks(["click","keydown"]);function p2(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var wC,ED;function _Z(){if(ED)return wC;ED=1;function r($){return $ instanceof Map?$.clear=$.delete=$.set=function(){throw new Error("map is read-only")}:$ instanceof Set&&($.add=$.clear=$.delete=function(){throw new Error("set is read-only")}),Object.freeze($),Object.getOwnPropertyNames($).forEach(we=>{const He=$[we],bt=typeof He;(bt==="object"||bt==="function")&&!Object.isFrozen(He)&&r(He)}),$}class e{constructor(we){we.data===void 0&&(we.data={}),this.data=we.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i($,...we){const He=Object.create(null);for(const bt in $)He[bt]=$[bt];return we.forEach(function(bt){for(const xt in bt)He[xt]=bt[xt]}),He}const n="</span>",s=$=>!!$.scope,a=($,{prefix:we})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){const He=$.split(".");return[`${we}${He.shift()}`,...He.map((bt,xt)=>`${bt}${"_".repeat(xt+1)}`)].join(" ")}return`${we}${$}`};class l{constructor(we,He){this.buffer="",this.classPrefix=He.classPrefix,we.walk(this)}addText(we){this.buffer+=t(we)}openNode(we){if(!s(we))return;const He=a(we.scope,{prefix:this.classPrefix});this.span(He)}closeNode(we){s(we)&&(this.buffer+=n)}value(){return this.buffer}span(we){this.buffer+=`<span class="${we}">`}}const d=($={})=>{const we={children:[]};return Object.assign(we,$),we};class u{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(we){this.top.children.push(we)}openNode(we){const He=d({scope:we});this.add(He),this.stack.push(He)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(we){return this.constructor._walk(we,this.rootNode)}static _walk(we,He){return typeof He=="string"?we.addText(He):He.children&&(we.openNode(He),He.children.forEach(bt=>this._walk(we,bt)),we.closeNode(He)),we}static _collapse(we){typeof we!="string"&&we.children&&(we.children.every(He=>typeof He=="string")?we.children=[we.children.join("")]:we.children.forEach(He=>{u._collapse(He)}))}}class g extends u{constructor(we){super(),this.options=we}addText(we){we!==""&&this.add(we)}startScope(we){this.openNode(we)}endScope(){this.closeNode()}__addSublanguage(we,He){const bt=we.root;He&&(bt.scope=`language:${He}`),this.add(bt)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function x($){return $?typeof $=="string"?$:$.source:null}function m($){return E("(?=",$,")")}function C($){return E("(?:",$,")*")}function _($){return E("(?:",$,")?")}function E(...$){return $.map(He=>x(He)).join("")}function k($){const we=$[$.length-1];return typeof we=="object"&&we.constructor===Object?($.splice($.length-1,1),we):{}}function I(...$){return"("+(k($).capture?"":"?:")+$.map(bt=>x(bt)).join("|")+")"}function M($){return new RegExp($.toString()+"|").exec("").length-1}function N($,we){const He=$&&$.exec(we);return He&&He.index===0}const O=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function z($,{joinWith:we}){let He=0;return $.map(bt=>{He+=1;const xt=He;let Rt=x(bt),ne="";for(;Rt.length>0;){const Q=O.exec(Rt);if(!Q){ne+=Rt;break}ne+=Rt.substring(0,Q.index),Rt=Rt.substring(Q.index+Q[0].length),Q[0][0]==="\\"&&Q[1]?ne+="\\"+String(Number(Q[1])+xt):(ne+=Q[0],Q[0]==="("&&He++)}return ne}).map(bt=>`(${bt})`).join(we)}const U=/\b\B/,q="[a-zA-Z]\\w*",se="[a-zA-Z_]\\w*",Ee="\\b\\d+(\\.\\d+)?",ge="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",he="\\b(0b[01]+)",Ve="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",nt=($={})=>{const we=/^#![ ]*\//;return $.binary&&($.begin=E(we,/.*\b/,$.binary,/\b.*/)),i({scope:"meta",begin:we,end:/$/,relevance:0,"on:begin":(He,bt)=>{He.index!==0&&bt.ignoreMatch()}},$)},ue={begin:"\\\\[\\s\\S]",relevance:0},$e={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ue]},me={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ue]},Xe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},be=function($,we,He={}){const bt=i({scope:"comment",begin:$,end:we,contains:[]},He);bt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const xt=I("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return bt.contains.push({begin:E(/[ ]+/,"(",xt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),bt},Pt=be("//","$"),Ne=be("/\\*","\\*/"),Fe=be("#","$"),Pe={scope:"number",begin:Ee,relevance:0},Lt={scope:"number",begin:ge,relevance:0},xe={scope:"number",begin:he,relevance:0},ke={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ue,{begin:/\[/,end:/\]/,relevance:0,contains:[ue]}]},Te={scope:"title",begin:q,relevance:0},Qe={scope:"title",begin:se,relevance:0},Ue={begin:"\\.\\s*"+se,relevance:0};var ii=Object.freeze({__proto__:null,APOS_STRING_MODE:$e,BACKSLASH_ESCAPE:ue,BINARY_NUMBER_MODE:xe,BINARY_NUMBER_RE:he,COMMENT:be,C_BLOCK_COMMENT_MODE:Ne,C_LINE_COMMENT_MODE:Pt,C_NUMBER_MODE:Lt,C_NUMBER_RE:ge,END_SAME_AS_BEGIN:function($){return Object.assign($,{"on:begin":(we,He)=>{He.data._beginMatch=we[1]},"on:end":(we,He)=>{He.data._beginMatch!==we[1]&&He.ignoreMatch()}})},HASH_COMMENT_MODE:Fe,IDENT_RE:q,MATCH_NOTHING_RE:U,METHOD_GUARD:Ue,NUMBER_MODE:Pe,NUMBER_RE:Ee,PHRASAL_WORDS_MODE:Xe,QUOTE_STRING_MODE:me,REGEXP_MODE:ke,RE_STARTERS_RE:Ve,SHEBANG:nt,TITLE_MODE:Te,UNDERSCORE_IDENT_RE:se,UNDERSCORE_TITLE_MODE:Qe});function Vt($,we){$.input[$.index-1]==="."&&we.ignoreMatch()}function Oe($,we){$.className!==void 0&&($.scope=$.className,delete $.className)}function lt($,we){we&&$.beginKeywords&&($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=Vt,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0&&($.relevance=0))}function zt($,we){Array.isArray($.illegal)&&($.illegal=I(...$.illegal))}function Ft($,we){if($.match){if($.begin||$.end)throw new Error("begin & end are not supported with match");$.begin=$.match,delete $.match}}function oi($,we){$.relevance===void 0&&($.relevance=1)}const Z=($,we)=>{if(!$.beforeMatch)return;if($.starts)throw new Error("beforeMatch cannot be used with starts");const He=Object.assign({},$);Object.keys($).forEach(bt=>{delete $[bt]}),$.keywords=He.keywords,$.begin=E(He.beforeMatch,m(He.begin)),$.starts={relevance:0,contains:[Object.assign(He,{endsParent:!0})]},$.relevance=0,delete He.beforeMatch},oe=["of","and","for","in","not","or","if","then","parent","list","value"],ce="keyword";function ct($,we,He=ce){const bt=Object.create(null);return typeof $=="string"?xt(He,$.split(" ")):Array.isArray($)?xt(He,$):Object.keys($).forEach(function(Rt){Object.assign(bt,ct($[Rt],we,Rt))}),bt;function xt(Rt,ne){we&&(ne=ne.map(Q=>Q.toLowerCase())),ne.forEach(function(Q){const G=Q.split("|");bt[G[0]]=[Rt,Je(G[0],G[1])]})}}function Je($,we){return we?Number(we):Dt($)?0:1}function Dt($){return oe.includes($.toLowerCase())}const _t={},$t=$=>{console.error($)},Ie=($,...we)=>{console.log(`WARN: ${$}`,...we)},Se=($,we)=>{_t[`${$}/${we}`]||(console.log(`Deprecated as of ${$}. ${we}`),_t[`${$}/${we}`]=!0)},et=new Error;function w($,we,{key:He}){let bt=0;const xt=$[He],Rt={},ne={};for(let Q=1;Q<=we.length;Q++)ne[Q+bt]=xt[Q],Rt[Q+bt]=!0,bt+=M(we[Q-1]);$[He]=ne,$[He]._emit=Rt,$[He]._multi=!0}function j($){if(Array.isArray($.begin)){if($.skip||$.excludeBegin||$.returnBegin)throw $t("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),et;if(typeof $.beginScope!="object"||$.beginScope===null)throw $t("beginScope must be object"),et;w($,$.begin,{key:"beginScope"}),$.begin=z($.begin,{joinWith:""})}}function te($){if(Array.isArray($.end)){if($.skip||$.excludeEnd||$.returnEnd)throw $t("skip, excludeEnd, returnEnd not compatible with endScope: {}"),et;if(typeof $.endScope!="object"||$.endScope===null)throw $t("endScope must be object"),et;w($,$.end,{key:"endScope"}),$.end=z($.end,{joinWith:""})}}function _e($){$.scope&&typeof $.scope=="object"&&$.scope!==null&&($.beginScope=$.scope,delete $.scope)}function De($){_e($),typeof $.beginScope=="string"&&($.beginScope={_wrap:$.beginScope}),typeof $.endScope=="string"&&($.endScope={_wrap:$.endScope}),j($),te($)}function st($){function we(ne,Q){return new RegExp(x(ne),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(Q?"g":""))}class He{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Q,G){G.position=this.position++,this.matchIndexes[this.matchAt]=G,this.regexes.push([G,Q]),this.matchAt+=M(Q)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Q=this.regexes.map(G=>G[1]);this.matcherRe=we(z(Q,{joinWith:"|"}),!0),this.lastIndex=0}exec(Q){this.matcherRe.lastIndex=this.lastIndex;const G=this.matcherRe.exec(Q);if(!G)return null;const de=G.findIndex((Ze,At)=>At>0&&Ze!==void 0),ot=this.matchIndexes[de];return G.splice(0,de),Object.assign(G,ot)}}class bt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Q){if(this.multiRegexes[Q])return this.multiRegexes[Q];const G=new He;return this.rules.slice(Q).forEach(([de,ot])=>G.addRule(de,ot)),G.compile(),this.multiRegexes[Q]=G,G}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Q,G){this.rules.push([Q,G]),G.type==="begin"&&this.count++}exec(Q){const G=this.getMatcher(this.regexIndex);G.lastIndex=this.lastIndex;let de=G.exec(Q);if(this.resumingScanAtSamePosition()&&!(de&&de.index===this.lastIndex)){const ot=this.getMatcher(0);ot.lastIndex=this.lastIndex+1,de=ot.exec(Q)}return de&&(this.regexIndex+=de.position+1,this.regexIndex===this.count&&this.considerAll()),de}}function xt(ne){const Q=new bt;return ne.contains.forEach(G=>Q.addRule(G.begin,{rule:G,type:"begin"})),ne.terminatorEnd&&Q.addRule(ne.terminatorEnd,{type:"end"}),ne.illegal&&Q.addRule(ne.illegal,{type:"illegal"}),Q}function Rt(ne,Q){const G=ne;if(ne.isCompiled)return G;[Oe,Ft,De,Z].forEach(ot=>ot(ne,Q)),$.compilerExtensions.forEach(ot=>ot(ne,Q)),ne.__beforeBegin=null,[lt,zt,oi].forEach(ot=>ot(ne,Q)),ne.isCompiled=!0;let de=null;return typeof ne.keywords=="object"&&ne.keywords.$pattern&&(ne.keywords=Object.assign({},ne.keywords),de=ne.keywords.$pattern,delete ne.keywords.$pattern),de=de||/\w+/,ne.keywords&&(ne.keywords=ct(ne.keywords,$.case_insensitive)),G.keywordPatternRe=we(de,!0),Q&&(ne.begin||(ne.begin=/\B|\b/),G.beginRe=we(G.begin),!ne.end&&!ne.endsWithParent&&(ne.end=/\B|\b/),ne.end&&(G.endRe=we(G.end)),G.terminatorEnd=x(G.end)||"",ne.endsWithParent&&Q.terminatorEnd&&(G.terminatorEnd+=(ne.end?"|":"")+Q.terminatorEnd)),ne.illegal&&(G.illegalRe=we(ne.illegal)),ne.contains||(ne.contains=[]),ne.contains=[].concat(...ne.contains.map(function(ot){return Ke(ot==="self"?ne:ot)})),ne.contains.forEach(function(ot){Rt(ot,G)}),ne.starts&&Rt(ne.starts,Q),G.matcher=xt(G),G}if($.compilerExtensions||($.compilerExtensions=[]),$.contains&&$.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=i($.classNameAliases||{}),Rt($)}function V($){return $?$.endsWithParent||V($.starts):!1}function Ke($){return $.variants&&!$.cachedVariants&&($.cachedVariants=$.variants.map(function(we){return i($,{variants:null},we)})),$.cachedVariants?$.cachedVariants:V($)?i($,{starts:$.starts?i($.starts):null}):Object.isFrozen($)?i($):$}var mt="11.11.1";class ve extends Error{constructor(we,He){super(we),this.name="HTMLInjectionError",this.html=He}}const Ge=t,ht=i,wt=Symbol("nomatch"),Wt=7,Be=function($){const we=Object.create(null),He=Object.create(null),bt=[];let xt=!0;const Rt="Could not find the language '{}', did you forget to load/include a language module?",ne={disableAutodetect:!0,name:"Plain text",contains:[]};let Q={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function G(W){return Q.noHighlightRe.test(W)}function de(W){let Y=W.className+" ";Y+=W.parentNode?W.parentNode.className:"";const Ce=Q.languageDetectRe.exec(Y);if(Ce){const je=le(Ce[1]);return je||(Ie(Rt.replace("{}",Ce[1])),Ie("Falling back to no-highlight mode for this block.",W)),je?Ce[1]:"no-highlight"}return Y.split(/\s+/).find(je=>G(je)||le(je))}function ot(W,Y,Ce){let je="",ye="";typeof Y=="object"?(je=W,Ce=Y.ignoreIllegals,ye=Y.language):(Se("10.7.0","highlight(lang, code, ...args) has been deprecated."),Se("10.7.0",`Please use highlight(code, options) instead.
|
|
79
|
+
`);d=x.pop()??"";for(const m of x){if(!m.startsWith("data: "))continue;const C=m.slice(6).trim();if(C==="[DONE]")return;try{const _=JSON.parse(C);if(_.error&&!_.type)throw new Error(_.error);if(_.type==="tool_call"||_.type==="tool_result"){i==null||i({type:_.type,name:_.name??"",args:_.args,content:_.content});continue}if(_.type==="draft"||_.type==="publish_request"||_.type==="publish_decided"||_.type==="analysis"){i==null||i({..._,type:_.type,name:_.type});continue}_.token&&e(_.token)}catch(_){if(_ instanceof SyntaxError)continue;throw _}}}}finally{a.releaseLock()}}function cb(){return ei("GET","/she/broker/status")}function UG(){return ei("GET","/she/broker/local/check")}function GG(){return ei("GET","/she/broker/ip-addresses")}function kv(){return ei("GET","/she/broker/config")}function KG(r=500){return ei("GET",`/she/broker/logs?limit=${r}`)}function BB(r){return ei("PUT","/she/broker/config",r)}function ZG(r,e){return ei("PUT","/she/broker/config/raw",{content:r,checksum:e})}function YG(){return ei("GET","/she/broker/config/backups")}function XG(r){return ei("POST","/she/broker/config/restore",{backup:r})}function db(){return ei("POST","/she/broker/reload")}function QG(){return ei("POST","/she/broker/restart")}function JG(){return ei("POST","/she/broker/wizard/deactivate")}function eK(){return ei("POST","/she/broker/wizard/reinit")}function tK(){return ei("GET","/she/broker/wizard/diagnose")}function iK(r){return ei("GET",`/she/broker/passwd?file=${encodeURIComponent(r)}`)}function vD(r,e,t){return ei("POST","/she/broker/passwd",{file:r,username:e,password:t})}function nK(r,e){return ei("DELETE",`/she/broker/passwd/${encodeURIComponent(e)}`,{file:r})}function sK(r){return ei("GET",`/she/broker/acl?file=${encodeURIComponent(r)}`)}function oK(r,e){return ei("PUT","/she/broker/acl",{file:r,content:e})}function rK(){return ei("GET","/she/broker/users")}function aK(r,e){return ei("POST","/she/broker/users",{username:r,password:e})}function lK(r){return ei("DELETE",`/she/broker/users/${encodeURIComponent(r)}`)}function cK(r,e){return ei("PUT",`/she/broker/users/${encodeURIComponent(r)}/password`,{password:e})}function dK(r,e){return ei("POST",`/she/broker/users/${encodeURIComponent(r)}/roles`,{rolename:e})}function uK(r,e){return ei("DELETE",`/she/broker/users/${encodeURIComponent(r)}/roles/${encodeURIComponent(e)}`)}function FB(){return ei("GET","/she/broker/roles")}function hK(r){return ei("POST","/she/broker/roles",{rolename:r})}function fK(r){return ei("DELETE",`/she/broker/roles/${encodeURIComponent(r)}`)}function pK(r,e){return ei("POST",`/she/broker/roles/${encodeURIComponent(r)}/acls`,e)}function gK(r,e,t){return ei("DELETE",`/she/broker/roles/${encodeURIComponent(r)}/acls`,{acltype:e,topic:t})}function vK(){return ei("GET","/she/broker/groups")}function xK(r){return ei("POST","/she/broker/groups",{groupname:r})}function mK(r){return ei("DELETE",`/she/broker/groups/${encodeURIComponent(r)}`)}function xD(r,e){return ei("POST",`/she/broker/groups/${encodeURIComponent(r)}/clients`,{username:e})}function mD(r,e){return ei("DELETE",`/she/broker/groups/${encodeURIComponent(r)}/clients/${encodeURIComponent(e)}`)}function _K(r,e){return ei("POST",`/she/broker/groups/${encodeURIComponent(r)}/roles`,{rolename:e})}function bK(r,e){return ei("DELETE",`/she/broker/groups/${encodeURIComponent(r)}/roles/${encodeURIComponent(e)}`)}function CK(){return ei("GET","/she/broker/acl-defaults")}function yK(r){return ei("PUT","/she/broker/acl-defaults",{acls:r})}function wK(r){return ei("GET",`/she/broker/acl-check?${new URLSearchParams({topic:r})}`)}function EK(){return ei("GET","/she/broker/anonymous-group")}function SK(r){return ei("PUT","/she/broker/anonymous-group",{groupname:r})}function kK(){return ei("GET","/she/broker/ca/server")}function DK(r){return ei("POST","/she/broker/ca/server/generate",r)}function AK(r){return ei("POST","/she/broker/ca/server/csr",r)}function CC(r){return ei("POST","/she/broker/ca/server/import",r)}function BK(){return ei("GET","/she/broker/ca/trusted")}function FK(r){return ei("POST","/she/broker/ca/trusted",{pem:r})}function LK(r){return ei("DELETE",`/she/broker/ca/trusted/${encodeURIComponent(r)}`)}function IK(r){return ei("GET",`/she/broker/fs/complete?path=${encodeURIComponent(r)}`)}function PK(r){return ei("POST","/she/broker/ca/server/pathlink",r)}function TK(r){return ei("POST","/she/broker/ca/trusted/addpath",{path:r})}function LB(r=!1){return ei("GET","/she/services/instances"+(r?"?refresh=1":""))}function MK(r){return ei("POST",`/she/services/instances/${encodeURIComponent(r)}/restart`)}function RK(r,e){return ei("POST",`/she/services/instances/${encodeURIComponent(r)}/loglevel`,{level:e})}function NK(r){return ei("GET",`/she/services/instances/${encodeURIComponent(r)}/retained`)}function OK(r,e=!0){return ei("DELETE",`/she/services/instances/${encodeURIComponent(r)}/retained`,{discovery:e})}const CS="-";function HK(r,e,t){return ei("POST",`${Fa(r,e,CS)}/migrate`,{name:t})}function zK(r,e,t={}){return ei("POST",`/she/services/hosts/${encodeURIComponent(r)}/adapters/${encodeURIComponent(e)}/discover`,t)}const Nd=r=>`/she/services/hosts/${encodeURIComponent(r)}`,Fa=(r,e,t)=>`${Nd(r)}/units/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,Dv=(r,e)=>`${Nd(r)}/adapters/${encodeURIComponent(e)}`;function ga(r=!1){return ei("GET",r?"/she/services/hosts?refresh=1":"/she/services/hosts")}function WK(r,e,t=!1){return ei("GET",`${Dv(r,e)}/schema${t?"?refresh=1":""}`)}function jK(r,e,t,i,n="own"){return ei("POST",`${Dv(r,e)}/install`,{instance:t,env:i,brokerMode:n})}function _D(r,e,t=!1){return ei("POST",`${Dv(r,e)}/update`,{force:t})}function bD(r,e,t,i){return ei("POST",`${Fa(r,e,t)}/${i}`)}function VK(r,e){return ei("POST",`${Nd(r)}/adapters/${encodeURIComponent(e)}/uninstall`)}function $K(r,e,t){return ei("DELETE",Fa(r,e,t))}function qK(r,e,t,i=200){return ei("GET",`${Fa(r,e,t)}/logs?n=${i}`)}function CD(r,e,t){return ei("POST",`${Fa(r,e,t)}/logs/follow`)}function UK(r,e,t){return ei("DELETE",`${Fa(r,e,t)}/logs/follow`)}function GK(r,e,t){return ei("GET",`${Fa(r,e,t)}/env`)}function KK(r,e,t,i,n,s,a={}){return ei("PUT",`${Fa(r,e,t)}/env`,{env:i,restart:n,brokerMode:s,rotate:a.rotate===!0})}function ZK(){return ei("GET","/she/services/ssh/pubkey")}function YK(){return ei("POST","/she/services/ssh/keygen")}function XK(r){return ei("POST",`${Nd(r)}/test`)}function QK(r,e="lts",t=null){return ei("POST",`${Nd(r)}/node/update`,{channel:e,version:t})}function JK(r=!1){return ei("GET",`/she/services/node/releases${r?"?refresh=1":""}`)}function eZ(r){return ei("POST",`${Nd(r)}/instances/restart-all`)}function tZ(r){return ei("POST","/she/services/setup/token",{origin:r})}function iZ(r){return ei("GET",`/she/services/setup/token/${encodeURIComponent(r)}`)}function yD(r){return ei("POST","/she/services/ssh/test",r)}function wD(r){return ei("POST",`${Nd(r)}/helper/deploy`)}function nZ(r,e,t=!1){return ei("POST",`${Nd(r)}/helper/remove`,{mode:e,force:t})}function sZ(r,e,t){return ei("GET",`${Fa(r,e,t)}/files`)}function oZ(r,e,t,i){return ei("GET",`${Fa(r,e,t)}/file?path=${encodeURIComponent(i)}`)}function rZ(r,e,t,i,n,s=!1){return ei("PUT",`${Fa(r,e,t)}/file`,{path:i,content:n,restart:s})}function aZ(r,e,t,i,n){return ei("POST",`${Fa(r,e,t)}/file/create`,{option:i,path:n})}function lZ(r,e,t){return ei("GET",`${Dv(r,e)}/asset?path=${encodeURIComponent(t)}`)}function cZ(r=!1){return ei("GET",r?"/she/services/catalog?refresh=1":"/she/services/catalog")}function dZ(r,e){return ei("POST",`${Dv(r,e)}/install-package`)}const uZ=2e3,Kx=[],hZ=500,Zx=[];function IB(){return Kx.slice()}function fZ(){return Zx.slice()}let oc=null;const g_=new Set,Bf=new Map;let Wf=null,Yx=null;function d2(){return Yx||(Yx=fetch("/she/logs/history").then(r=>r.ok?r.json():[]).catch(()=>[])),Yx}function Op(){let r=g_.size;for(const e of Bf.values())r+=e.size;return r}function pZ(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/she/ws`}function ub(){if(oc)return;d2();const r=pZ(),e=new WebSocket(r);oc=e,e.onmessage=t=>{try{const i=JSON.parse(t.data);if(i.type==="log"){const s={level:i.level,msg:i.msg,ts:i.ts};Kx.length>=uZ&&Kx.shift(),Kx.push(s),g_.forEach(a=>a(s))}if(i.type==="brokerLog"){const s={level:i.level,msg:i.msg,ts:i.ts};Zx.length>=hZ&&Zx.shift(),Zx.push(s)}const n=Bf.get(i.type);n&&n.forEach(s=>s(i))}catch{}},e.onclose=()=>{oc===e&&(oc=null,Yx=null),Op()>0&&(Wf=setTimeout(ub,3e3))},e.onerror=()=>{e.close()}}function gZ(){oc||Op()===0||(Wf&&(clearTimeout(Wf),Wf=null),ub())}function PB(){Wf&&clearTimeout(Wf),oc==null||oc.close(),oc=null}function u2(r){return g_.add(r),Op()===1&&ub(),()=>{g_.delete(r),Op()===0&&PB()}}function tr(r,e){return Bf.has(r)||Bf.set(r,new Set),Bf.get(r).add(e),Op()===1&&ub(),()=>{var t;(t=Bf.get(r))==null||t.delete(e),Op()===0&&PB()}}function hb(r){const e=new Date(r);return e.toTimeString().slice(0,8)+"."+String(e.getMilliseconds()).padStart(3,"0")}const yC=/([^\s():,]+\.js)(?::(\d+)(?::(\d+))?)?/g;function TB(r,e){const t=[];let i=0;yC.lastIndex=0;for(let n=yC.exec(r);n!==null;n=yC.exec(r)){const s=e(n[1]);s&&(n.index>i&&t.push({text:r.slice(i,n.index)}),t.push({text:n[0],link:{path:s,line:n[2]?Number(n[2]):void 0,column:n[3]?Number(n[3]):void 0}}),i=n.index+n[0].length)}return i<r.length&&t.push({text:r.slice(i)}),t}function MB(r){return e=>{const t=e.replace(/\\/g,"/");if(r.has(t))return t;for(const i of r)if(t.endsWith("/"+i))return i;return null}}function h2(r,e=new Set){for(const t of r)t.type==="file"?e.add(t.path):t.children&&h2(t.children,e);return e}var vZ=S('<button class="cancel svelte-1eh8v5n">Cancel</button>'),xZ=S('<div class="backdrop svelte-1eh8v5n" role="presentation"></div> <div class="dialog svelte-1eh8v5n" role="dialog" aria-modal="true"><p class="svelte-1eh8v5n"> </p> <div class="actions svelte-1eh8v5n"><!> <button> </button></div></div>',1);function Fr(r,e){_s(e,!0);let t=A(!1),i=A(""),n=A("Confirm"),s=A(!1),a=A(!1),l=null;function d(E,k){return p(i,E,!0),p(n,(k==null?void 0:k.confirm)??(k!=null&&k.alert?"OK":"Confirm"),!0),p(s,(k==null?void 0:k.danger)??!1,!0),p(a,(k==null?void 0:k.alert)??!1,!0),p(t,!0),new Promise(I=>l=I)}function u(E){p(t,!1),l==null||l(E),l=null}function g(E){o(t)&&(E.key==="Escape"&&u(!1),E.key==="Enter"&&u(!0))}var x={show:d},m=Rs();Ls("keydown",Ea,g);var C=Ct(m);{var _=E=>{var k=xZ(),I=Ct(k),M=h(I,2),N=f(M),O=f(N),z=h(N,2),U=f(z);{var q=he=>{var Ve=vZ();H("click",Ve,()=>u(!1)),y(he,Ve)};P(U,he=>{o(a)||he(q)})}var se=h(U,2);let Ee;var ge=f(se);T(()=>{B(O,o(i)),Ee=Ht(se,1,"svelte-1eh8v5n",null,Ee,{danger:o(s)}),B(ge,o(n))}),H("click",I,()=>u(!1)),H("click",se,()=>u(!0)),y(E,k)};P(C,E=>{o(t)&&E(_)})}return y(r,m),bs(x)}ks(["click"]);var mZ=S('<div class="backdrop svelte-1vi95tb" role="presentation"></div> <div class="dialog svelte-1vi95tb" role="dialog" aria-modal="true"><p class="svelte-1vi95tb"> </p> <input class="svelte-1vi95tb"/> <div class="actions svelte-1vi95tb"><button class="cancel svelte-1vi95tb">Cancel</button> <button class="svelte-1vi95tb"> </button></div></div>',1);function f2(r,e){_s(e,!0);let t=A(!1),i=A(""),n=A(""),s=A("OK"),a=A(""),l=null,d=A(void 0);function u(I,M){return p(i,I,!0),p(n,(M==null?void 0:M.placeholder)??"",!0),p(s,(M==null?void 0:M.confirm)??"OK",!0),p(a,(M==null?void 0:M.initial)??"",!0),p(t,!0),setTimeout(()=>{if(o(d)){o(d).focus();const N=o(d).value.length;o(d).setSelectionRange(N,N)}},0),new Promise(N=>l=N)}function g(){const I=o(a).trim();I&&(p(t,!1),l==null||l(I),l=null,p(a,""))}function x(){p(t,!1),l==null||l(null),l=null,p(a,"")}function m(I){o(t)&&I.key==="Escape"&&(I.stopPropagation(),x())}var C={show:u},_=Rs();Ls("keydown",Ea,m);var E=Ct(_);{var k=I=>{var M=mZ(),N=Ct(M),O=h(N,2),z=f(O),U=f(z),q=h(z,2);ds(q,Ve=>p(d,Ve),()=>o(d));var se=h(q,2),Ee=f(se),ge=h(Ee,2),he=f(ge);T(Ve=>{B(U,o(i)),_i(q,"placeholder",o(n)),ge.disabled=Ve,B(he,o(s))},[()=>!o(a).trim()]),H("click",N,x),H("keydown",q,Ve=>{Ve.key==="Enter"&&(Ve.preventDefault(),g())}),ci(q,()=>o(a),Ve=>p(a,Ve)),H("click",Ee,x),H("click",ge,g),y(I,M)};P(E,I=>{o(t)&&I(k)})}return y(r,_),bs(C)}ks(["click","keydown"]);function p2(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var wC,ED;function _Z(){if(ED)return wC;ED=1;function r($){return $ instanceof Map?$.clear=$.delete=$.set=function(){throw new Error("map is read-only")}:$ instanceof Set&&($.add=$.clear=$.delete=function(){throw new Error("set is read-only")}),Object.freeze($),Object.getOwnPropertyNames($).forEach(we=>{const He=$[we],bt=typeof He;(bt==="object"||bt==="function")&&!Object.isFrozen(He)&&r(He)}),$}class e{constructor(we){we.data===void 0&&(we.data={}),this.data=we.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t($){return $.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i($,...we){const He=Object.create(null);for(const bt in $)He[bt]=$[bt];return we.forEach(function(bt){for(const xt in bt)He[xt]=bt[xt]}),He}const n="</span>",s=$=>!!$.scope,a=($,{prefix:we})=>{if($.startsWith("language:"))return $.replace("language:","language-");if($.includes(".")){const He=$.split(".");return[`${we}${He.shift()}`,...He.map((bt,xt)=>`${bt}${"_".repeat(xt+1)}`)].join(" ")}return`${we}${$}`};class l{constructor(we,He){this.buffer="",this.classPrefix=He.classPrefix,we.walk(this)}addText(we){this.buffer+=t(we)}openNode(we){if(!s(we))return;const He=a(we.scope,{prefix:this.classPrefix});this.span(He)}closeNode(we){s(we)&&(this.buffer+=n)}value(){return this.buffer}span(we){this.buffer+=`<span class="${we}">`}}const d=($={})=>{const we={children:[]};return Object.assign(we,$),we};class u{constructor(){this.rootNode=d(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(we){this.top.children.push(we)}openNode(we){const He=d({scope:we});this.add(He),this.stack.push(He)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(we){return this.constructor._walk(we,this.rootNode)}static _walk(we,He){return typeof He=="string"?we.addText(He):He.children&&(we.openNode(He),He.children.forEach(bt=>this._walk(we,bt)),we.closeNode(He)),we}static _collapse(we){typeof we!="string"&&we.children&&(we.children.every(He=>typeof He=="string")?we.children=[we.children.join("")]:we.children.forEach(He=>{u._collapse(He)}))}}class g extends u{constructor(we){super(),this.options=we}addText(we){we!==""&&this.add(we)}startScope(we){this.openNode(we)}endScope(){this.closeNode()}__addSublanguage(we,He){const bt=we.root;He&&(bt.scope=`language:${He}`),this.add(bt)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function x($){return $?typeof $=="string"?$:$.source:null}function m($){return E("(?=",$,")")}function C($){return E("(?:",$,")*")}function _($){return E("(?:",$,")?")}function E(...$){return $.map(He=>x(He)).join("")}function k($){const we=$[$.length-1];return typeof we=="object"&&we.constructor===Object?($.splice($.length-1,1),we):{}}function I(...$){return"("+(k($).capture?"":"?:")+$.map(bt=>x(bt)).join("|")+")"}function M($){return new RegExp($.toString()+"|").exec("").length-1}function N($,we){const He=$&&$.exec(we);return He&&He.index===0}const O=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function z($,{joinWith:we}){let He=0;return $.map(bt=>{He+=1;const xt=He;let Rt=x(bt),ne="";for(;Rt.length>0;){const Q=O.exec(Rt);if(!Q){ne+=Rt;break}ne+=Rt.substring(0,Q.index),Rt=Rt.substring(Q.index+Q[0].length),Q[0][0]==="\\"&&Q[1]?ne+="\\"+String(Number(Q[1])+xt):(ne+=Q[0],Q[0]==="("&&He++)}return ne}).map(bt=>`(${bt})`).join(we)}const U=/\b\B/,q="[a-zA-Z]\\w*",se="[a-zA-Z_]\\w*",Ee="\\b\\d+(\\.\\d+)?",ge="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",he="\\b(0b[01]+)",Ve="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",nt=($={})=>{const we=/^#![ ]*\//;return $.binary&&($.begin=E(we,/.*\b/,$.binary,/\b.*/)),i({scope:"meta",begin:we,end:/$/,relevance:0,"on:begin":(He,bt)=>{He.index!==0&&bt.ignoreMatch()}},$)},ue={begin:"\\\\[\\s\\S]",relevance:0},$e={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ue]},me={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ue]},Xe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},be=function($,we,He={}){const bt=i({scope:"comment",begin:$,end:we,contains:[]},He);bt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const xt=I("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return bt.contains.push({begin:E(/[ ]+/,"(",xt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),bt},Pt=be("//","$"),Ne=be("/\\*","\\*/"),Fe=be("#","$"),Pe={scope:"number",begin:Ee,relevance:0},Lt={scope:"number",begin:ge,relevance:0},xe={scope:"number",begin:he,relevance:0},ke={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ue,{begin:/\[/,end:/\]/,relevance:0,contains:[ue]}]},Te={scope:"title",begin:q,relevance:0},Qe={scope:"title",begin:se,relevance:0},Ue={begin:"\\.\\s*"+se,relevance:0};var ii=Object.freeze({__proto__:null,APOS_STRING_MODE:$e,BACKSLASH_ESCAPE:ue,BINARY_NUMBER_MODE:xe,BINARY_NUMBER_RE:he,COMMENT:be,C_BLOCK_COMMENT_MODE:Ne,C_LINE_COMMENT_MODE:Pt,C_NUMBER_MODE:Lt,C_NUMBER_RE:ge,END_SAME_AS_BEGIN:function($){return Object.assign($,{"on:begin":(we,He)=>{He.data._beginMatch=we[1]},"on:end":(we,He)=>{He.data._beginMatch!==we[1]&&He.ignoreMatch()}})},HASH_COMMENT_MODE:Fe,IDENT_RE:q,MATCH_NOTHING_RE:U,METHOD_GUARD:Ue,NUMBER_MODE:Pe,NUMBER_RE:Ee,PHRASAL_WORDS_MODE:Xe,QUOTE_STRING_MODE:me,REGEXP_MODE:ke,RE_STARTERS_RE:Ve,SHEBANG:nt,TITLE_MODE:Te,UNDERSCORE_IDENT_RE:se,UNDERSCORE_TITLE_MODE:Qe});function Vt($,we){$.input[$.index-1]==="."&&we.ignoreMatch()}function Oe($,we){$.className!==void 0&&($.scope=$.className,delete $.className)}function lt($,we){we&&$.beginKeywords&&($.begin="\\b("+$.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",$.__beforeBegin=Vt,$.keywords=$.keywords||$.beginKeywords,delete $.beginKeywords,$.relevance===void 0&&($.relevance=0))}function zt($,we){Array.isArray($.illegal)&&($.illegal=I(...$.illegal))}function Ft($,we){if($.match){if($.begin||$.end)throw new Error("begin & end are not supported with match");$.begin=$.match,delete $.match}}function oi($,we){$.relevance===void 0&&($.relevance=1)}const Z=($,we)=>{if(!$.beforeMatch)return;if($.starts)throw new Error("beforeMatch cannot be used with starts");const He=Object.assign({},$);Object.keys($).forEach(bt=>{delete $[bt]}),$.keywords=He.keywords,$.begin=E(He.beforeMatch,m(He.begin)),$.starts={relevance:0,contains:[Object.assign(He,{endsParent:!0})]},$.relevance=0,delete He.beforeMatch},oe=["of","and","for","in","not","or","if","then","parent","list","value"],ce="keyword";function ct($,we,He=ce){const bt=Object.create(null);return typeof $=="string"?xt(He,$.split(" ")):Array.isArray($)?xt(He,$):Object.keys($).forEach(function(Rt){Object.assign(bt,ct($[Rt],we,Rt))}),bt;function xt(Rt,ne){we&&(ne=ne.map(Q=>Q.toLowerCase())),ne.forEach(function(Q){const G=Q.split("|");bt[G[0]]=[Rt,Je(G[0],G[1])]})}}function Je($,we){return we?Number(we):Dt($)?0:1}function Dt($){return oe.includes($.toLowerCase())}const _t={},$t=$=>{console.error($)},Ie=($,...we)=>{console.log(`WARN: ${$}`,...we)},Se=($,we)=>{_t[`${$}/${we}`]||(console.log(`Deprecated as of ${$}. ${we}`),_t[`${$}/${we}`]=!0)},et=new Error;function w($,we,{key:He}){let bt=0;const xt=$[He],Rt={},ne={};for(let Q=1;Q<=we.length;Q++)ne[Q+bt]=xt[Q],Rt[Q+bt]=!0,bt+=M(we[Q-1]);$[He]=ne,$[He]._emit=Rt,$[He]._multi=!0}function j($){if(Array.isArray($.begin)){if($.skip||$.excludeBegin||$.returnBegin)throw $t("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),et;if(typeof $.beginScope!="object"||$.beginScope===null)throw $t("beginScope must be object"),et;w($,$.begin,{key:"beginScope"}),$.begin=z($.begin,{joinWith:""})}}function te($){if(Array.isArray($.end)){if($.skip||$.excludeEnd||$.returnEnd)throw $t("skip, excludeEnd, returnEnd not compatible with endScope: {}"),et;if(typeof $.endScope!="object"||$.endScope===null)throw $t("endScope must be object"),et;w($,$.end,{key:"endScope"}),$.end=z($.end,{joinWith:""})}}function _e($){$.scope&&typeof $.scope=="object"&&$.scope!==null&&($.beginScope=$.scope,delete $.scope)}function De($){_e($),typeof $.beginScope=="string"&&($.beginScope={_wrap:$.beginScope}),typeof $.endScope=="string"&&($.endScope={_wrap:$.endScope}),j($),te($)}function st($){function we(ne,Q){return new RegExp(x(ne),"m"+($.case_insensitive?"i":"")+($.unicodeRegex?"u":"")+(Q?"g":""))}class He{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Q,G){G.position=this.position++,this.matchIndexes[this.matchAt]=G,this.regexes.push([G,Q]),this.matchAt+=M(Q)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Q=this.regexes.map(G=>G[1]);this.matcherRe=we(z(Q,{joinWith:"|"}),!0),this.lastIndex=0}exec(Q){this.matcherRe.lastIndex=this.lastIndex;const G=this.matcherRe.exec(Q);if(!G)return null;const de=G.findIndex((Ze,At)=>At>0&&Ze!==void 0),ot=this.matchIndexes[de];return G.splice(0,de),Object.assign(G,ot)}}class bt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Q){if(this.multiRegexes[Q])return this.multiRegexes[Q];const G=new He;return this.rules.slice(Q).forEach(([de,ot])=>G.addRule(de,ot)),G.compile(),this.multiRegexes[Q]=G,G}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Q,G){this.rules.push([Q,G]),G.type==="begin"&&this.count++}exec(Q){const G=this.getMatcher(this.regexIndex);G.lastIndex=this.lastIndex;let de=G.exec(Q);if(this.resumingScanAtSamePosition()&&!(de&&de.index===this.lastIndex)){const ot=this.getMatcher(0);ot.lastIndex=this.lastIndex+1,de=ot.exec(Q)}return de&&(this.regexIndex+=de.position+1,this.regexIndex===this.count&&this.considerAll()),de}}function xt(ne){const Q=new bt;return ne.contains.forEach(G=>Q.addRule(G.begin,{rule:G,type:"begin"})),ne.terminatorEnd&&Q.addRule(ne.terminatorEnd,{type:"end"}),ne.illegal&&Q.addRule(ne.illegal,{type:"illegal"}),Q}function Rt(ne,Q){const G=ne;if(ne.isCompiled)return G;[Oe,Ft,De,Z].forEach(ot=>ot(ne,Q)),$.compilerExtensions.forEach(ot=>ot(ne,Q)),ne.__beforeBegin=null,[lt,zt,oi].forEach(ot=>ot(ne,Q)),ne.isCompiled=!0;let de=null;return typeof ne.keywords=="object"&&ne.keywords.$pattern&&(ne.keywords=Object.assign({},ne.keywords),de=ne.keywords.$pattern,delete ne.keywords.$pattern),de=de||/\w+/,ne.keywords&&(ne.keywords=ct(ne.keywords,$.case_insensitive)),G.keywordPatternRe=we(de,!0),Q&&(ne.begin||(ne.begin=/\B|\b/),G.beginRe=we(G.begin),!ne.end&&!ne.endsWithParent&&(ne.end=/\B|\b/),ne.end&&(G.endRe=we(G.end)),G.terminatorEnd=x(G.end)||"",ne.endsWithParent&&Q.terminatorEnd&&(G.terminatorEnd+=(ne.end?"|":"")+Q.terminatorEnd)),ne.illegal&&(G.illegalRe=we(ne.illegal)),ne.contains||(ne.contains=[]),ne.contains=[].concat(...ne.contains.map(function(ot){return Ke(ot==="self"?ne:ot)})),ne.contains.forEach(function(ot){Rt(ot,G)}),ne.starts&&Rt(ne.starts,Q),G.matcher=xt(G),G}if($.compilerExtensions||($.compilerExtensions=[]),$.contains&&$.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return $.classNameAliases=i($.classNameAliases||{}),Rt($)}function V($){return $?$.endsWithParent||V($.starts):!1}function Ke($){return $.variants&&!$.cachedVariants&&($.cachedVariants=$.variants.map(function(we){return i($,{variants:null},we)})),$.cachedVariants?$.cachedVariants:V($)?i($,{starts:$.starts?i($.starts):null}):Object.isFrozen($)?i($):$}var mt="11.11.1";class ve extends Error{constructor(we,He){super(we),this.name="HTMLInjectionError",this.html=He}}const Ge=t,ht=i,wt=Symbol("nomatch"),Wt=7,Be=function($){const we=Object.create(null),He=Object.create(null),bt=[];let xt=!0;const Rt="Could not find the language '{}', did you forget to load/include a language module?",ne={disableAutodetect:!0,name:"Plain text",contains:[]};let Q={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function G(W){return Q.noHighlightRe.test(W)}function de(W){let Y=W.className+" ";Y+=W.parentNode?W.parentNode.className:"";const Ce=Q.languageDetectRe.exec(Y);if(Ce){const je=le(Ce[1]);return je||(Ie(Rt.replace("{}",Ce[1])),Ie("Falling back to no-highlight mode for this block.",W)),je?Ce[1]:"no-highlight"}return Y.split(/\s+/).find(je=>G(je)||le(je))}function ot(W,Y,Ce){let je="",ye="";typeof Y=="object"?(je=W,Ce=Y.ignoreIllegals,ye=Y.language):(Se("10.7.0","highlight(lang, code, ...args) has been deprecated."),Se("10.7.0",`Please use highlight(code, options) instead.
|
|
80
80
|
https://github.com/highlightjs/highlight.js/issues/2277`),ye=W,je=Y),Ce===void 0&&(Ce=!0);const it={code:je,language:ye};re("before:highlight",it);const pt=it.result?it.result:Ze(it.language,it.code,Ce);return pt.code=it.code,re("after:highlight",pt),pt}function Ze(W,Y,Ce,je){const ye=Object.create(null);function it(Ut,si){return Ut.keywords[si]}function pt(){if(!yi.keywords){Me.addText(dt);return}let Ut=0;yi.keywordPatternRe.lastIndex=0;let si=yi.keywordPatternRe.exec(dt),ki="";for(;si;){ki+=dt.substring(Ut,si.index);const Ki=ai.case_insensitive?si[0].toLowerCase():si[0],Mi=it(yi,Ki);if(Mi){const[_n,ln]=Mi;if(Me.addText(ki),ki="",ye[Ki]=(ye[Ki]||0)+1,ye[Ki]<=Wt&&(ti+=ln),_n.startsWith("_"))ki+=si[0];else{const Pn=ai.classNameAliases[_n]||_n;Bt(si[0],Pn)}}else ki+=si[0];Ut=yi.keywordPatternRe.lastIndex,si=yi.keywordPatternRe.exec(dt)}ki+=dt.substring(Ut),Me.addText(ki)}function It(){if(dt==="")return;let Ut=null;if(typeof yi.subLanguage=="string"){if(!we[yi.subLanguage]){Me.addText(dt);return}Ut=Ze(yi.subLanguage,dt,!0,Jt[yi.subLanguage]),Jt[yi.subLanguage]=Ut._top}else Ut=St(dt,yi.subLanguage.length?yi.subLanguage:null);yi.relevance>0&&(ti+=Ut.relevance),Me.__addSublanguage(Ut._emitter,Ut.language)}function Et(){yi.subLanguage!=null?It():pt(),dt=""}function Bt(Ut,si){Ut!==""&&(Me.startScope(si),Me.addText(Ut),Me.endScope())}function Nt(Ut,si){let ki=1;const Ki=si.length-1;for(;ki<=Ki;){if(!Ut._emit[ki]){ki++;continue}const Mi=ai.classNameAliases[Ut[ki]]||Ut[ki],_n=si[ki];Mi?Bt(_n,Mi):(dt=_n,pt(),dt=""),ki++}}function Ot(Ut,si){return Ut.scope&&typeof Ut.scope=="string"&&Me.openNode(ai.classNameAliases[Ut.scope]||Ut.scope),Ut.beginScope&&(Ut.beginScope._wrap?(Bt(dt,ai.classNameAliases[Ut.beginScope._wrap]||Ut.beginScope._wrap),dt=""):Ut.beginScope._multi&&(Nt(Ut.beginScope,si),dt="")),yi=Object.create(Ut,{parent:{value:yi}}),yi}function Qt(Ut,si,ki){let Ki=N(Ut.endRe,ki);if(Ki){if(Ut["on:end"]){const Mi=new e(Ut);Ut["on:end"](si,Mi),Mi.isMatchIgnored&&(Ki=!1)}if(Ki){for(;Ut.endsParent&&Ut.parent;)Ut=Ut.parent;return Ut}}if(Ut.endsWithParent)return Qt(Ut.parent,si,ki)}function Fi(Ut){return yi.matcher.regexIndex===0?(dt+=Ut[0],1):(Wi=!0,0)}function Ui(Ut){const si=Ut[0],ki=Ut.rule,Ki=new e(ki),Mi=[ki.__beforeBegin,ki["on:begin"]];for(const _n of Mi)if(_n&&(_n(Ut,Ki),Ki.isMatchIgnored))return Fi(si);return ki.skip?dt+=si:(ki.excludeBegin&&(dt+=si),Et(),!ki.returnBegin&&!ki.excludeBegin&&(dt=si)),Ot(ki,Ut),ki.returnBegin?0:si.length}function hi(Ut){const si=Ut[0],ki=Y.substring(Ut.index),Ki=Qt(yi,Ut,ki);if(!Ki)return wt;const Mi=yi;yi.endScope&&yi.endScope._wrap?(Et(),Bt(si,yi.endScope._wrap)):yi.endScope&&yi.endScope._multi?(Et(),Nt(yi.endScope,Ut)):Mi.skip?dt+=si:(Mi.returnEnd||Mi.excludeEnd||(dt+=si),Et(),Mi.excludeEnd&&(dt=si));do yi.scope&&Me.closeNode(),!yi.skip&&!yi.subLanguage&&(ti+=yi.relevance),yi=yi.parent;while(yi!==Ki.parent);return Ki.starts&&Ot(Ki.starts,Ut),Mi.returnEnd?0:si.length}function Ri(){const Ut=[];for(let si=yi;si!==ai;si=si.parent)si.scope&&Ut.unshift(si.scope);Ut.forEach(si=>Me.openNode(si))}let Yi={};function Re(Ut,si){const ki=si&&si[0];if(dt+=Ut,ki==null)return Et(),0;if(Yi.type==="begin"&&si.type==="end"&&Yi.index===si.index&&ki===""){if(dt+=Y.slice(si.index,si.index+1),!xt){const Ki=new Error(`0 width match regex (${W})`);throw Ki.languageName=W,Ki.badRule=Yi.rule,Ki}return 1}if(Yi=si,si.type==="begin")return Ui(si);if(si.type==="illegal"&&!Ce){const Ki=new Error('Illegal lexeme "'+ki+'" for mode "'+(yi.scope||"<unnamed>")+'"');throw Ki.mode=yi,Ki}else if(si.type==="end"){const Ki=hi(si);if(Ki!==wt)return Ki}if(si.type==="illegal"&&ki==="")return dt+=`
|
|
81
81
|
`,1;if(Ni>1e5&&Ni>si.index*3)throw new Error("potential infinite loop, way more iterations than matches");return dt+=ki,ki.length}const ai=le(W);if(!ai)throw $t(Rt.replace("{}",W)),new Error('Unknown language: "'+W+'"');const vi=st(ai);let Vi="",yi=je||vi;const Jt={},Me=new Q.__emitter(Q);Ri();let dt="",ti=0,$i=0,Ni=0,Wi=!1;try{if(ai.__emitTokens)ai.__emitTokens(Y,Me);else{for(yi.matcher.considerAll();;){Ni++,Wi?Wi=!1:yi.matcher.considerAll(),yi.matcher.lastIndex=$i;const Ut=yi.matcher.exec(Y);if(!Ut)break;const si=Y.substring($i,Ut.index),ki=Re(si,Ut);$i=Ut.index+ki}Re(Y.substring($i))}return Me.finalize(),Vi=Me.toHTML(),{language:W,value:Vi,relevance:ti,illegal:!1,_emitter:Me,_top:yi}}catch(Ut){if(Ut.message&&Ut.message.includes("Illegal"))return{language:W,value:Ge(Y),illegal:!0,relevance:0,_illegalBy:{message:Ut.message,index:$i,context:Y.slice($i-100,$i+100),mode:Ut.mode,resultSoFar:Vi},_emitter:Me};if(xt)return{language:W,value:Ge(Y),illegal:!1,relevance:0,errorRaised:Ut,_emitter:Me,_top:yi};throw Ut}}function At(W){const Y={value:Ge(W),illegal:!1,relevance:0,_top:ne,_emitter:new Q.__emitter(Q)};return Y._emitter.addText(W),Y}function St(W,Y){Y=Y||Q.languages||Object.keys(we);const Ce=At(W),je=Y.filter(le).filter(fe).map(Et=>Ze(Et,W,!1));je.unshift(Ce);const ye=je.sort((Et,Bt)=>{if(Et.relevance!==Bt.relevance)return Bt.relevance-Et.relevance;if(Et.language&&Bt.language){if(le(Et.language).supersetOf===Bt.language)return 1;if(le(Bt.language).supersetOf===Et.language)return-1}return 0}),[it,pt]=ye,It=it;return It.secondBest=pt,It}function ze(W,Y,Ce){const je=Y&&He[Y]||Ce;W.classList.add("hljs"),W.classList.add(`language-${je}`)}function Kt(W){let Y=null;const Ce=de(W);if(G(Ce))return;if(re("before:highlightElement",{el:W,language:Ce}),W.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",W);return}if(W.children.length>0&&(Q.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(W)),Q.throwUnescapedHTML))throw new ve("One of your code blocks includes unescaped HTML.",W.innerHTML);Y=W;const je=Y.textContent,ye=Ce?ot(je,{language:Ce,ignoreIllegals:!0}):St(je);W.innerHTML=ye.value,W.dataset.highlighted="yes",ze(W,Ce,ye.language),W.result={language:ye.language,re:ye.relevance,relevance:ye.relevance},ye.secondBest&&(W.secondBest={language:ye.secondBest.language,relevance:ye.secondBest.relevance}),re("after:highlightElement",{el:W,result:ye,text:je})}function Xt(W){Q=ht(Q,W)}const Ci=()=>{We(),Se("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Li(){We(),Se("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let J=!1;function We(){function W(){We()}if(document.readyState==="loading"){J||window.addEventListener("DOMContentLoaded",W,!1),J=!0;return}document.querySelectorAll(Q.cssSelector).forEach(Kt)}function kt(W,Y){let Ce=null;try{Ce=Y($)}catch(je){if($t("Language definition for '{}' could not be registered.".replace("{}",W)),xt)$t(je);else throw je;Ce=ne}Ce.name||(Ce.name=W),we[W]=Ce,Ce.rawDefinition=Y.bind(null,$),Ce.aliases&&ee(Ce.aliases,{languageName:W})}function Mt(W){delete we[W];for(const Y of Object.keys(He))He[Y]===W&&delete He[Y]}function X(){return Object.keys(we)}function le(W){return W=(W||"").toLowerCase(),we[W]||we[He[W]]}function ee(W,{languageName:Y}){typeof W=="string"&&(W=[W]),W.forEach(Ce=>{He[Ce.toLowerCase()]=Y})}function fe(W){const Y=le(W);return Y&&!Y.disableAutodetect}function qe(W){W["before:highlightBlock"]&&!W["before:highlightElement"]&&(W["before:highlightElement"]=Y=>{W["before:highlightBlock"](Object.assign({block:Y.el},Y))}),W["after:highlightBlock"]&&!W["after:highlightElement"]&&(W["after:highlightElement"]=Y=>{W["after:highlightBlock"](Object.assign({block:Y.el},Y))})}function Ae(W){qe(W),bt.push(W)}function yt(W){const Y=bt.indexOf(W);Y!==-1&&bt.splice(Y,1)}function re(W,Y){const Ce=W;bt.forEach(function(je){je[Ce]&&je[Ce](Y)})}function ae(W){return Se("10.7.0","highlightBlock will be removed entirely in v12.0"),Se("10.7.0","Please use highlightElement now."),Kt(W)}Object.assign($,{highlight:ot,highlightAuto:St,highlightAll:We,highlightElement:Kt,highlightBlock:ae,configure:Xt,initHighlighting:Ci,initHighlightingOnLoad:Li,registerLanguage:kt,unregisterLanguage:Mt,listLanguages:X,getLanguage:le,registerAliases:ee,autoDetection:fe,inherit:ht,addPlugin:Ae,removePlugin:yt}),$.debugMode=function(){xt=!1},$.safeMode=function(){xt=!0},$.versionString=mt,$.regex={concat:E,lookahead:m,either:I,optional:_,anyNumberOfTimes:C};for(const W in ii)typeof ii[W]=="object"&&r(ii[W]);return Object.assign($,ii),$},ft=Be({});return ft.newInstance=()=>Be({}),wC=ft,ft.HighlightJS=ft,ft.default=ft,wC}var bZ=_Z();const v_=p2(bZ),SD="[A-Za-z$_][0-9A-Za-z$_]*",CZ=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],yZ=["true","false","null","undefined","NaN","Infinity"],RB=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],NB=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],OB=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],wZ=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],EZ=[].concat(OB,RB,NB);function HB(r){const e=r.regex,t=(be,{after:Pt})=>{const Ne="</"+be[0].slice(1);return be.input.indexOf(Ne,Pt)!==-1},i=SD,n={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(be,Pt)=>{const Ne=be[0].length+be.index,Fe=be.input[Ne];if(Fe==="<"||Fe===","){Pt.ignoreMatch();return}Fe===">"&&(t(be,{after:Ne})||Pt.ignoreMatch());let Pe;const Lt=be.input.substring(Ne);if(Pe=Lt.match(/^\s*=/)){Pt.ignoreMatch();return}if((Pe=Lt.match(/^\s+extends\s+/))&&Pe.index===0){Pt.ignoreMatch();return}}},l={$pattern:SD,keyword:CZ,literal:yZ,built_in:EZ,"variable.language":wZ},d="[0-9](_?[0-9])*",u=`\\.(${d})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${g})((${u})|\\.)?|(${u}))[eE][+-]?(${d})\\b`},{begin:`\\b(${g})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,m],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},k={className:"string",begin:"`",end:"`",contains:[r.BACKSLASH_ESCAPE,m]},M={className:"comment",variants:[r.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),r.C_BLOCK_COMMENT_MODE,r.C_LINE_COMMENT_MODE]},N=[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,C,_,E,k,{match:/\$\d+/},x];m.contains=N.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(N)});const O=[].concat(M,m.contains),z=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),U={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:z},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,e.concat(i,"(",e.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},se={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...RB,...NB]}},Ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ge={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[U],illegal:/%/},he={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ve(be){return e.concat("(?!",be.join("|"),")")}const nt={match:e.concat(/\b/,Ve([...OB,"super","import"].map(be=>`${be}\\s*\\(`)),i,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},ue={begin:e.concat(/\./,e.lookahead(e.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$e={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},U]},me="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+r.UNDERSCORE_IDENT_RE+")\\s*=>",Xe={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(me)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[U]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:se},illegal:/#(?![$_A-z])/,contains:[r.SHEBANG({label:"shebang",binary:"node",relevance:5}),Ee,r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,C,_,E,k,M,{match:/\$\d+/},x,se,{scope:"attr",match:i+e.lookahead(":"),relevance:0},Xe,{begin:"("+r.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,r.REGEXP_MODE,{className:"function",begin:me,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:r.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},ge,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+r.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[U,r.inherit(r.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ue,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[U]},nt,he,q,$e,{match:/\$[(.]/}]}}function g2(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nh=g2();function zB(r){Nh=r}var Yd={exec:()=>null};function rf(r){let e=[];return t=>{let i=Math.max(0,Math.min(3,t-1)),n=e[i];return n||(n=r(i),e[i]=n),n}}function Ns(r,e=""){let t=typeof r=="string"?r:r.source,i={replace:(n,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(hr.caret,"$1"),t=t.replace(n,a),i},getRegex:()=>new RegExp(t,e)};return i}var SZ=((r="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+r)}catch{return!1}})(),hr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:rf(r=>new RegExp(`^ {0,${r}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:rf(r=>new RegExp(`^ {0,${r}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:rf(r=>new RegExp(`^ {0,${r}}(?:\`\`\`|~~~)`)),headingBeginRegex:rf(r=>new RegExp(`^ {0,${r}}#`)),htmlBeginRegex:rf(r=>new RegExp(`^ {0,${r}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:rf(r=>new RegExp(`^ {0,${r}}>`))},kZ=/^(?:[ \t]*(?:\n|$))+/,DZ=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,AZ=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Av=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,BZ=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,v2=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,WB=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jB=Ns(WB).replace(/bull/g,v2).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),FZ=Ns(WB).replace(/bull/g,v2).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),x2=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,LZ=/^[^\n]+/,m2=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,IZ=Ns(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",m2).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),PZ=Ns(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,v2).getRegex(),fb="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",_2=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,TZ=Ns("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",_2).replace("tag",fb).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),VB=Ns(x2).replace("hr",Av).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fb).getRegex(),MZ=Ns(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",VB).getRegex(),b2={blockquote:MZ,code:DZ,def:IZ,fences:AZ,heading:BZ,hr:Av,html:TZ,lheading:jB,list:PZ,newline:kZ,paragraph:VB,table:Yd,text:LZ},kD=Ns("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Av).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fb).getRegex(),RZ={...b2,lheading:FZ,table:kD,paragraph:Ns(x2).replace("hr",Av).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",kD).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",fb).getRegex()},NZ={...b2,html:Ns(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_2).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Yd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ns(x2).replace("hr",Av).replace("heading",` *#{1,6} *[^
|
|
82
82
|
]`).replace("lheading",jB).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},OZ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,HZ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$B=/^( {2,}|\\)\n(?!\s*$)/,zZ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Qp=/[\p{P}\p{S}]/u,pb=/[\s\p{P}\p{S}]/u,C2=/[^\s\p{P}\p{S}]/u,WZ=Ns(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,pb).getRegex(),qB=/(?!~)[\p{P}\p{S}]/u,jZ=/(?!~)[\s\p{P}\p{S}]/u,VZ=/(?:[^\s\p{P}\p{S}]|~)/u,$Z=Ns(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",SZ?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),UB=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,qZ=Ns(UB,"u").replace(/punct/g,Qp).getRegex(),UZ=Ns(UB,"u").replace(/punct/g,qB).getRegex(),GB="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",GZ=Ns(GB,"gu").replace(/notPunctSpace/g,C2).replace(/punctSpace/g,pb).replace(/punct/g,Qp).getRegex(),KZ=Ns(GB,"gu").replace(/notPunctSpace/g,VZ).replace(/punctSpace/g,jZ).replace(/punct/g,qB).getRegex(),ZZ=Ns("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,C2).replace(/punctSpace/g,pb).replace(/punct/g,Qp).getRegex(),YZ=Ns(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Qp).getRegex(),XZ="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",QZ=Ns(XZ,"gu").replace(/notPunctSpace/g,C2).replace(/punctSpace/g,pb).replace(/punct/g,Qp).getRegex(),JZ=Ns(/\\(punct)/,"gu").replace(/punct/g,Qp).getRegex(),eY=Ns(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tY=Ns(_2).replace("(?:-->|$)","-->").getRegex(),iY=Ns("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tY).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),x_=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,nY=Ns(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",x_).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),KB=Ns(/^!?\[(label)\]\[(ref)\]/).replace("label",x_).replace("ref",m2).getRegex(),ZB=Ns(/^!?\[(ref)\](?:\[\])?/).replace("ref",m2).getRegex(),sY=Ns("reflink|nolink(?!\\()","g").replace("reflink",KB).replace("nolink",ZB).getRegex(),DD=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,y2={_backpedal:Yd,anyPunctuation:JZ,autolink:eY,blockSkip:$Z,br:$B,code:HZ,del:Yd,delLDelim:Yd,delRDelim:Yd,emStrongLDelim:qZ,emStrongRDelimAst:GZ,emStrongRDelimUnd:ZZ,escape:OZ,link:nY,nolink:ZB,punctuation:WZ,reflink:KB,reflinkSearch:sY,tag:iY,text:zZ,url:Yd},oY={...y2,link:Ns(/^!?\[(label)\]\((.*?)\)/).replace("label",x_).getRegex(),reflink:Ns(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",x_).getRegex()},yS={...y2,emStrongRDelimAst:KZ,emStrongLDelim:UZ,delLDelim:YZ,delRDelim:QZ,url:Ns(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",DD).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ns(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",DD).getRegex()},rY={...yS,br:Ns($B).replace("{2,}","*").getRegex(),text:Ns(yS.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xx={normal:b2,gfm:RZ,pedantic:NZ},vg={normal:y2,gfm:yS,breaks:rY,pedantic:oY},aY={"&":"&","<":"<",">":">",'"':""","'":"'"},AD=r=>aY[r];function pl(r,e){if(e){if(hr.escapeTest.test(r))return r.replace(hr.escapeReplace,AD)}else if(hr.escapeTestNoEncode.test(r))return r.replace(hr.escapeReplaceNoEncode,AD);return r}function BD(r){try{r=encodeURI(r).replace(hr.percentDecode,"%")}catch{return null}return r}function FD(r,e){var s;let t=r.replace(hr.findPipe,(a,l,d)=>{let u=!1,g=l;for(;--g>=0&&d[g]==="\\";)u=!u;return u?"|":" |"}),i=t.split(hr.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(hr.slashPipe,"|");return i}function Oc(r,e,t){let i=r.length;if(i===0)return"";let n=0;for(;n<i&&r.charAt(i-n-1)===e;)n++;return r.slice(0,i-n)}function LD(r){let e=r.split(`
|
|
@@ -295,4 +295,4 @@ ${Pe.length===1?"There is an instance":"There are "+Pe.length+" instances"} of i
|
|
|
295
295
|
`)]),y(We,kt)};P(Xt,We=>{"error"in o(At)&&o(At).error&&!("ok"in o(At))?We(Ci):"ok"in o(At)&&o(At).ok?We(Li,1):"ok"in o(At)&&We(J,2)})}T(()=>ze=Ht(St,1,"deploy-box in-card svelte-ns6riw",null,ze,{"deploy-ok":"ok"in o(At)&&o(At).ok})),y(Ze,St)};P(de,Ze=>{o(se)[Q()]&&Ze(ot)})}y(ne,G)};let a=Rn(e,"generation",3,0),l=Rn(e,"origin",3,null),d=A(wi([])),u=A(""),g=A(wi([])),x=A(!0),m=A(!1),C=A(""),_=A(""),E=A(""),k=A(void 0),I=A("list"),M=A(null),N=A(null),O=A(wi({})),z=A(null),U=rt(()=>o(g).filter(ne=>ne.ok&&ne.helperOutdated).length);cn(()=>{var ne;(ne=e.onupdates)==null||ne.call(e,o(U))});let q=A(null),se=A(wi({}));async function Ee(ne){var Q;p(q,ne,!0);try{const G=await wD(ne);p(se,{...o(se),[ne]:G},!0),G.ok&&(p(g,(await ga(!0)).hosts,!0),(Q=e.onchanged)==null||Q.call(e))}catch(G){p(se,{...o(se),[ne]:{error:G.message??String(G)}},!0)}finally{p(q,null)}}let ge=A(!1),he=A(""),Ve=rt(()=>o(g).filter(ne=>ne.ok&&ne.helperOutdated).map(ne=>ne.name));async function nt(){var Q;const ne=o(Ve);if(!(ne.length===0||o(ge))){p(ge,!0);try{for(const[G,de]of ne.entries()){p(he,`${G+1} of ${ne.length}: ${de}`);try{p(se,{...o(se),[de]:await wD(de)},!0)}catch(ot){p(se,{...o(se),[de]:{error:ot.message??String(ot)}},!0)}}p(g,(await ga(!0)).hosts,!0),(Q=e.onchanged)==null||Q.call(e)}finally{p(ge,!1),p(he,"")}}}let ue=A(null),$e=A(wi({})),me=A(null),Xe=A(wi({})),be=A(null);const Pt=[{key:"stable",label:"stable"},{key:"lts",label:"LTS"},{key:"latest",label:"latest"}],Ne=ne=>{var Q,G;return(ne==null?void 0:ne.arch)&&((G=(Q=o(be))==null?void 0:Q.byArch)==null?void 0:G[ne.arch])||o(be)||null},Fe=(ne,Q)=>{const G=Ne(Q);return(ne==="latest"?G==null?void 0:G.latest:G==null?void 0:G.lts)??null};function Pe(ne,Q){if(!ne||!Q)return null;const G=Ze=>Ze.replace(/^v/,"").split(".").map(At=>Number(At)||0),[de,ot]=[G(ne),G(Q)];for(let Ze=0;Ze<Math.max(de.length,ot.length);Ze++)if((de[Ze]??0)!==(ot[Ze]??0))return(de[Ze]??0)<(ot[Ze]??0)?-1:1;return 0}const Lt=ne=>ne&&Number(ne.replace(/^v/,"").split(".")[0])||0;let xe=rt(()=>o(g).filter(ne=>{if(!ne.ok||!ne.node||!o(be))return!1;const Q=Ne(ne),de=!!(Q!=null&&Q.latest)&&Lt(ne.node)===Lt(Q.latest)?Q==null?void 0:Q.latest:Q==null?void 0:Q.lts;return!!de&&Pe(de,ne.node)===1}).length);cn(()=>{var ne;(ne=e.onnodeupdates)==null||ne.call(e,o(xe))});function ke(ne){return Pt.map(Q=>{const G=Fe(Q.key,ne);return{...Q,target:G,current:!!G&&G===ne.node,downgrade:Pe(G,ne.node)===-1}})}async function Te(ne,Q){var At,St;const G=$t(ne)??null,de=(G==null?void 0:G.local)===!0,ot=Fe(Q,G);if(await((At=o(k))==null?void 0:At.show(`Install Node.js ${ot??`"${Q}"`} on ${ne} with n install ${ot??Q}? This replaces the host's node binary; running adapters keep the current version until they are restarted.`+(de?" she runs on this host too — it keeps the old binary until the daemon itself is restarted.":""),{confirm:"Update Node.js"}))){p(ue,ne,!0),p(Xe,{...o(Xe),[ne]:void 0},!0);try{const ze=await QK(ne,Q,ot);p($e,{...o($e),[ne]:ze},!0),p(g,(await ga(!0)).hosts,!0),(St=e.onchanged)==null||St.call(e)}catch(ze){p($e,{...o($e),[ne]:{error:ze.message??String(ze)}},!0)}finally{p(ue,null)}}}async function Qe(ne){var Q;p(me,ne,!0);try{p(Xe,{...o(Xe),[ne]:await eZ(ne)},!0),(Q=e.onchanged)==null||Q.call(e)}catch(G){p(Xe,{...o(Xe),[ne]:{error:G.message??String(G)}},!0)}finally{p(me,null)}}let Ue=A(null),vt=A(""),ii=A(!1),Vt=A(!1),Oe=A(wi({host:"",port:"",user:"",identityFile:"",hostname:""})),lt=A(null),zt=A(!1),Ft=A(wi(location.origin)),oi=A(null),Z=A(null),oe=A(""),ce=A(!1),ct=A(""),Je=A(!1),Dt=null;const _t=rt(()=>JSON.stringify({remotes:o(d)})!==o(u)),$t=ne=>o(g).find(Q=>Q.name===ne)??null,Ie=rt(()=>o(g).find(ne=>ne.local)??null),Se=(ne,Q)=>(ne.hostname||ne.host).localeCompare(Q.hostname||Q.host,void 0,{numeric:!0,sensitivity:"base"});function et(ne){const Q=ne.services,G=Array.isArray(Q==null?void 0:Q.hosts)?Q.hosts:null;p(d,(G??[]).filter(de=>de&&de.ssh).map(de=>({host:String(de.ssh.host??""),port:typeof de.ssh.port=="number"?de.ssh.port:"",user:String(de.ssh.user??""),identityFile:String(de.ssh.identityFile??""),hostname:String(de.hostname??"")})).sort(Se),!0),p(u,JSON.stringify({remotes:o(d)}),!0)}async function w(ne=!1){p(x,!0),p(C,"");try{const[Q,G]=await Promise.all([Ec(),ga(ne).catch(()=>({hosts:[]}))]);et(Q),p(g,G.hosts,!0)}catch(Q){p(C,Q.message??String(Q),!0)}finally{p(x,!1)}j()}async function j(){try{const ne=await ZK();p(Ue,ne.publicKey,!0),p(vt,ne.identityFile,!0)}catch{}try{p(E,(await Gc()).user??"",!0)}catch{}}Vs(()=>w());let te=0;cn(()=>{const ne=a();ne!==te&&(te=ne,Io(()=>{l()!=="hostsconf"&&(async()=>{if(o(_t))try{p(g,(await ga(!0)).hosts,!0)}catch{}else await w(!0)})()}))}),Vs(async()=>{try{p(be,await JK(),!0)}catch{}}),Bh(()=>wt());function _e(ne){p(_,ne,!0),setTimeout(()=>{o(_)===ne&&p(_,"")},3e3)}async function De(){var ne;p(m,!0),p(C,"");try{const Q=[{name:"local"}];for(const G of o(d)){if(!G.host.trim())continue;const de={host:G.host.trim()};G.port!==""&&Number(G.port)>0&&(de.port=Number(G.port)),G.user.trim()&&(de.user=G.user.trim()),G.identityFile.trim()&&(de.identityFile=G.identityFile.trim()),Q.push({...G.hostname.trim()?{hostname:G.hostname.trim()}:{},ssh:de})}await j0("services.hosts",Q),window.dispatchEvent(new CustomEvent("she:config-changed")),p(u,JSON.stringify({remotes:o(d)}),!0),p(M,null),_e("saved"),(ne=e.onchanged)==null||ne.call(e),p(g,(await ga(!0)).hosts,!0)}catch(Q){p(C,Q.message??String(Q),!0)}finally{p(m,!1)}}function st(){const ne=JSON.parse(o(u));p(d,ne.remotes,!0),p(M,null)}async function V(ne){const Q=ne.host;p(z,Q,!0);try{const G=await yD({host:ne.host.trim(),port:ne.port,user:ne.user.trim(),identityFile:ne.identityFile.trim()});p(O,{...o(O),[Q]:G.ok?{ok:!0,msg:`helper v${G.helper??"?"}`}:{ok:!1,msg:`${G.code}: ${G.error}`}},!0)}catch(G){p(O,{...o(O),[Q]:{ok:!1,msg:G.message??String(G)}},!0)}finally{p(z,null)}}async function Ke(){p(z,"local");try{const ne=await XK("local");p(O,{...o(O),local:ne.ok?{ok:!0,msg:`helper v${ne.helper??"?"}`}:{ok:!1,msg:`${ne.code}: ${ne.error}`}},!0)}catch(ne){p(O,{...o(O),local:{ok:!1,msg:ne.message??String(ne)}},!0)}finally{p(z,null)}}async function mt(ne){var G;const Q=o(d)[ne];await((G=o(k))==null?void 0:G.show(`Remove ${Q.hostname||Q.host} from the list? she stops managing it; nothing on the host is changed (use "Remove from host…" for that).`,{confirm:"Remove",danger:!0}))&&(p(d,o(d).filter((de,ot)=>ot!==ne),!0),o(M)===ne&&p(M,null))}function ve(){p(Oe,{host:"",port:"",user:"",identityFile:"",hostname:""},!0),p(lt,null),p(ct,""),p(I,"add")}async function Ge(){if(!o(Oe).host.trim()){p(lt,{ok:!1,msg:"enter a host first"},!0);return}p(zt,!0);try{const ne=await yD({host:o(Oe).host.trim(),port:o(Oe).port,user:o(Oe).user.trim(),identityFile:o(Oe).identityFile.trim()});p(lt,ne.ok?{ok:!0,msg:`helper v${ne.helper??"?"}`}:{ok:!1,msg:`${ne.code}: ${ne.error}`},!0)}catch(ne){p(lt,{ok:!1,msg:ne.message??String(ne)},!0)}finally{p(zt,!1)}}function ht(){o(Oe).host.trim()&&(p(d,[...o(d),{...o(Oe),host:o(Oe).host.trim(),user:o(Oe).user.trim(),identityFile:o(Oe).identityFile.trim(),hostname:o(Oe).hostname.trim()}].sort(Se),!0),p(I,"list"),_e("host added — Save to keep it"))}function wt(){Dt&&(clearInterval(Dt),Dt=null)}async function Wt(){p(ce,!0),p(ct,""),p(oi,null),p(Z,null),p(oe,""),p(Je,!1),wt();try{p(oi,await tZ(o(Ft).trim().replace(/\/+$/,"")),!0),p(Z,"pending"),j(),Dt=setInterval(async()=>{var ne;if(!o(oi))return wt();try{const Q=await iZ(o(oi).token);p(Z,Q.status,!0),Q.status==="done"?(p(oe,Q.host??"",!0),wt(),et(await Ec()),p(g,(await ga(!0)).hosts,!0),(ne=e.onchanged)==null||ne.call(e)):Q.status==="expired"&&wt()}catch{}},3e3)}catch(ne){p(ct,ne.message??String(ne),!0)}finally{p(ce,!1)}}async function Be(ne,Q){try{await navigator.clipboard.writeText(ne),Q(!0),setTimeout(()=>Q(!1),2e3)}catch{}}async function ft(){var ne;if(!(o(Ue)&&!await((ne=o(k))==null?void 0:ne.show("Regenerate the services SSH key? Every remote host then needs the new public key (re-run the setup command, or replace it in authorized_keys).",{confirm:"Regenerate",danger:!0})))){p(ii,!0);try{const Q=await YK();p(Ue,Q.publicKey,!0),p(vt,Q.identityFile,!0),_e("key generated")}catch(Q){p(C,Q.message??String(Q),!0)}finally{p(ii,!1)}}}var $=oue(),we=Ct($);ds(Fr(we,{}),ne=>p(k,ne,!0),()=>o(k));var He=h(we,2),bt=f(He);{var xt=ne=>{var Q=Wde(),G=Ct(Q),de=f(G),ot=h(G,2),Ze=f(ot),At=h(f(Ze),4),St=h(f(At),2),ze=h(St,2),Kt=f(ze),Xt=h(At,2);{var Ci=ye=>{var it=Rde(),pt=f(it);T(()=>B(pt,o(ct))),y(ye,it)};P(Xt,ye=>{o(ct)&&ye(Ci)})}var Li=h(Xt,2);{var J=ye=>{var it=zde(),pt=Ct(it),It=f(pt),Et=f(It),Bt=h(It),Nt=f(Bt),Ot=h(pt,2),Qt=f(Ot),Fi=h(Qt),Ui=f(Fi),hi=h(Fi,2),Ri=f(hi),Yi=h(Ot,2),Re=f(Yi);{var ai=Jt=>{var Me=Nde();y(Jt,Me)},vi=Jt=>{var Me=Ode();y(Jt,Me)},Vi=Jt=>{var Me=Hde(),dt=Ct(Me),ti=f(dt),$i=h(ti),Ni=f($i),Wi=h(dt,2);T(()=>{B(ti,`✓ ${o(oe)??""} registered as `),B(Ni,o(oi).user)}),H("click",Wi,()=>p(I,"list")),y(Jt,Me)},yi=Jt=>{var Me=Ln("command expired — create a new one.");y(Jt,Me)};P(Re,Jt=>{o(Z)==="pending"?Jt(ai):o(Z)==="fetched"?Jt(vi,1):o(Z)==="done"?Jt(Vi,2):o(Z)==="expired"&&Jt(yi,3)})}T(Jt=>{B(Et,o(oi).command),B(Nt,o(Je)?"Copied":"Copy"),B(Qt,`Valid until ${Jt??""}, single use. To read it first: `),B(Ui,`curl -fsSL '${o(oi).scriptUrl??""}' -o she-setup.sh`),B(Ri,o(oi).sha256)},[()=>new Date(o(oi).expires).toLocaleTimeString()]),H("click",Bt,()=>Be(o(oi).command,Jt=>p(Je,Jt,!0))),y(ye,it)};P(Li,ye=>{o(oi)&&ye(J)})}var We=h(Ze,2),kt=h(f(We),4),Mt=f(kt),X=h(f(Mt)),le=h(Mt,2),ee=h(f(le)),fe=h(le,2),qe=h(f(fe)),Ae=h(fe,2),yt=h(f(Ae)),re=h(kt,2),ae=f(re),W=f(ae),Y=h(ae,2);{var Ce=ye=>{var it=XA();let pt;var It=f(it);T(()=>{pt=Ht(it,1,"test-mark svelte-ns6riw",null,pt,{ok:o(lt).ok,err:!o(lt).ok}),B(It,o(lt).ok?`✓ ${o(lt).msg}`:`✗ ${o(lt).msg}`)}),y(ye,it)};P(Y,ye=>{o(lt)&&ye(Ce)})}var je=h(Y,4);T(ye=>{ze.disabled=o(ce),B(Kt,o(ce)?"Preparing…":"Create setup command"),_i(qe,"placeholder",o(E)?`${o(E)} (default)`:"user she runs as"),ae.disabled=o(zt),B(W,o(zt)?"Testing…":"Test connection"),je.disabled=ye},[()=>!o(Oe).host.trim()]),H("click",de,()=>p(I,"list")),ci(St,()=>o(Ft),ye=>p(Ft,ye)),H("click",ze,Wt),ci(X,()=>o(Oe).host,ye=>o(Oe).host=ye),ci(ee,()=>o(Oe).port,ye=>o(Oe).port=ye),ci(qe,()=>o(Oe).user,ye=>o(Oe).user=ye),ci(yt,()=>o(Oe).identityFile,ye=>o(Oe).identityFile=ye),H("click",ae,Ge),H("click",je,ht),y(ne,Q)},Rt=ne=>{var Q=sue(),G=Ct(Q),de=f(G),ot=f(de);let Ze;var At=h(de,2),St=h(At,2),ze=f(St),Kt=h(St,2);{var Xt=Jt=>{var Me=jde();y(Jt,Me)};P(Kt,Jt=>{o(x)&&Jt(Xt)})}var Ci=h(Kt,2);{var Li=Jt=>{var Me=Vde(),dt=f(Me);T(()=>{Me.disabled=o(ge)||o(q)!==null,B(dt,o(ge)?`Updating ${o(he)}…`:`Update all helpers (${o(Ve).length})`)}),H("click",Me,nt),y(Jt,Me)};P(Ci,Jt=>{o(Ve).length>1&&Jt(Li)})}var J=h(Ci,4);{var We=Jt=>{var Me=$de(),dt=f(Me);T(()=>B(dt,o(_))),y(Jt,Me)};P(J,Jt=>{o(_)&&Jt(We)})}var kt=h(J,2);{var Mt=Jt=>{var Me=qde(),dt=h(Ct(Me),2),ti=h(dt,2),$i=f(ti);T(()=>{dt.disabled=o(m),ti.disabled=o(m),B($i,o(m)?"Saving…":"Save")}),H("click",dt,st),H("click",ti,De),y(Jt,Me)};P(kt,Jt=>{o(_t)&&Jt(Mt)})}var X=h(G,2);{var le=Jt=>{var Me=Ude(),dt=f(Me);T(()=>B(dt,o(C))),y(Jt,Me)};P(X,Jt=>{o(C)&&Jt(le)})}var ee=h(X,2),fe=f(ee),qe=f(fe),Ae=f(qe);let yt;var re=h(Ae,2),ae=f(re),W=h(re,2);{var Y=Jt=>{YA(Jt,()=>o(Ie).arch)};P(W,Jt=>{var Me;(Me=o(Ie))!=null&&Me.arch&&Jt(Y)})}var Ce=h(W,6);{var je=Jt=>{i(Jt,()=>"local",()=>o(Ie))};P(Ce,Jt=>{var Me;(Me=o(Ie))!=null&&Me.ok&&Jt(je)})}var ye=h(Ce,2),it=h(ye);t(it,()=>"local");var pt=h(qe,2);{var It=Jt=>{n(Jt,()=>"local",()=>o(Ie))};P(pt,Jt=>{var Me;(Me=o(Ie))!=null&&Me.ok&&Jt(It)})}var Et=h(pt,2);s(Et,()=>"local");var Bt=h(Et,2);{var Nt=Jt=>{var Me=Kde(),dt=f(Me),ti=h(dt);{var $i=Ni=>{var Wi=Gde(),Ut=Ct(Wi);Ut.nodeValue=" — run ",y(Ni,Wi)};P(ti,Ni=>{o(Ie).code==="HELPER_MISSING"&&Ni($i)})}T(()=>B(dt,o(Ie).error)),y(Jt,Me)};P(Bt,Jt=>{o(Ie)&&!o(Ie).ok&&Jt(Nt)})}var Ot=h(fe,2);xi(Ot,17,()=>o(d),sn,(Jt,Me,dt)=>{const ti=rt(()=>$t(o(Me).host));var $i=eue(),Ni=f($i),Wi=f(Ni);let Ut;var si=h(Wi,2),ki=f(si),Ki=h(si,2);{var Mi=Gt=>{YA(Gt,()=>o(ti).arch)};P(Ki,Gt=>{var fi;(fi=o(ti))!=null&&fi.arch&&Gt(Mi)})}var _n=h(Ki,2),ln=f(_n),Pn=h(_n,2);{var mn=Gt=>{var fi=Zde();T(()=>_i(fi,"title",o(Me).identityFile)),y(Gt,fi)};P(Pn,Gt=>{o(Me).identityFile&&Gt(mn)})}var Zi=h(Pn,4);{var qn=Gt=>{i(Gt,()=>o(Me).host,()=>o(ti))},os=Gt=>{var fi=Yde(),bi=f(fi);T(()=>{fi.disabled=o(q)!==null,B(bi,o(q)===o(Me).host?"Deploying…":"Deploy helper")}),H("click",fi,()=>Ee(o(Me).host)),y(Gt,fi)};P(Zi,Gt=>{var fi;(fi=o(ti))!=null&&fi.ok?Gt(qn):o(ti)&&!o(ti).ok&&Gt(os,1)})}var fs=h(Zi,2),Xs=h(fs);t(Xs,()=>o(Me).host);var rs=h(Xs,2);let ro;var Le=h(rs,2);let ut;var at=h(Le,2),ni=h(Ni,2);{var li=Gt=>{n(Gt,()=>o(Me).host,()=>o(ti))};P(ni,Gt=>{var fi;(fi=o(ti))!=null&&fi.ok&&Gt(li)})}var Ii=h(ni,2);s(Ii,()=>o(Me).host);var zi=h(Ii,2);{var Tt=Gt=>{var fi=Xde(),bi=f(fi);T(()=>B(bi,o(ti).error)),y(Gt,fi)};P(zi,Gt=>{o(ti)&&!o(ti).ok&&Gt(Tt)})}var Ei=h(zi,2);{var ui=Gt=>{var fi=Qde(),bi=f(fi),qi=h(f(bi)),an=h(bi,2),fn=h(f(an)),pn=h(an,2),Cn=h(f(pn)),en=h(pn,2),Fn=h(f(en)),vn=h(en,2),tn=h(f(vn));T(()=>_i(Cn,"placeholder",o(E)?`${o(E)} (default)`:"user she runs as")),ci(qi,()=>o(Me).host,ji=>o(Me).host=ji),ci(fn,()=>o(Me).port,ji=>o(Me).port=ji),ci(Cn,()=>o(Me).user,ji=>o(Me).user=ji),ci(Fn,()=>o(Me).identityFile,ji=>o(Me).identityFile=ji),ci(tn,()=>o(Me).hostname,ji=>o(Me).hostname=ji),y(Gt,fi)};P(Ei,Gt=>{o(M)===dt&&Gt(ui)})}var Di=h(Ei,2);{var Bi=Gt=>{var fi=Jde(),bi=f(fi);{let qi=rt(()=>o(Me).hostname||o(Me).host);mde(bi,{get host(){return o(Me).host},get label(){return o(qi)},onclose:()=>p(N,null),ondone:()=>{var an;p(N,null),w(!0),(an=e.onchanged)==null||an.call(e)}})}y(Gt,fi)};P(Di,Gt=>{o(N)===dt&&Gt(Bi)})}T(Gt=>{var fi,bi;Ut=Ht(Wi,1,"dot svelte-ns6riw",null,Ut,{ok:(fi=o(ti))==null?void 0:fi.ok,err:o(ti)&&!o(ti).ok}),B(ki,o(Me).hostname||((bi=o(ti))==null?void 0:bi.hostname)||o(Me).host),B(ln,`${(o(Me).user||o(E)||"?")??""}@${o(Me).host??""}${o(Me).port?`:${o(Me).port}`:""}`),fs.disabled=Gt,ro=Ht(rs,1,"ghost sm svelte-ns6riw",null,ro,{active:o(M)===dt}),ut=Ht(Le,1,"ghost sm svelte-ns6riw",null,ut,{active:o(N)===dt})},[()=>o(z)!==null||!o(Me).host.trim()]),H("click",fs,()=>V(o(Me))),H("click",rs,()=>p(M,o(M)===dt?null:dt,!0)),H("click",Le,()=>p(N,o(N)===dt?null:dt,!0)),H("click",at,()=>mt(dt)),y(Jt,$i)});var Qt=h(Ot,2);{var Fi=Jt=>{var Me=tue();y(Jt,Me)};P(Qt,Jt=>{o(d).length===0&&!o(x)&&Jt(Fi)})}var Ui=h(Qt,2),hi=f(Ui),Ri=h(f(hi),6);{var Yi=Jt=>{var Me=iue(),dt=f(Me);T(()=>B(dt,o(Vt)?"Copied":"Copy public key")),H("click",Me,()=>Be(o(Ue),ti=>p(Vt,ti,!0))),y(Jt,Me)};P(Ri,Jt=>{o(Ue)&&Jt(Yi)})}var Re=h(Ri,2),ai=f(Re),vi=h(hi,2);{var Vi=Jt=>{var Me=nue(),dt=Ct(Me),ti=f(dt),$i=h(dt,2),Ni=f($i);T(()=>{B(ti,o(Ue)),B(Ni,o(vt))}),y(Jt,Me)},yi=Jt=>{var Me=QA(),dt=f(Me);T(()=>B(dt,`No services key yet (${(o(vt)||"data-dir/ssh/services_id_ed25519")??""}) — the setup command creates it.`)),y(Jt,Me)};P(vi,Jt=>{o(Ue)?Jt(Vi):Jt(yi,-1)})}T(()=>{var Jt,Me;de.disabled=o(x),Ze=Ht(ot,1,"svelte-ns6riw",null,Ze,{spinning:o(x)}),B(ze,`${o(d).length+1} host${o(d).length===0?"":"s"}`),yt=Ht(Ae,1,"dot svelte-ns6riw",null,yt,{ok:(Jt=o(Ie))==null?void 0:Jt.ok,err:o(Ie)&&!o(Ie).ok}),B(ae,((Me=o(Ie))==null?void 0:Me.hostname)??"this host"),ye.disabled=o(z)!==null,Re.disabled=o(ii),B(ai,o(ii)?"Generating…":o(Ue)?"Regenerate":"Generate key")}),H("click",de,()=>w(!0)),H("click",At,ve),H("click",ye,Ke),H("click",Re,ft),y(ne,Q)};P(bt,ne=>{o(I)==="add"?ne(xt):ne(Rt,-1)})}y(r,$),bs()}ks(["click"]);var JA=S('<span class="tab-dot svelte-ymmv06"></span>'),aue=S('<div class="services-page svelte-ymmv06"><div class="sub-nav svelte-ymmv06"><button>Instances</button> <button>Installations <!></button> <button>Catalog</button> <button>Hosts <!></button></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></div>');function lue(r,e){_s(e,!0);let t=Rn(e,"active",3,!1),i=Rn(e,"sub",3,null);const n=["instances","hosts","catalog","hostsconf"],s="she-services-tab",a=localStorage.getItem(s);let l=A(wi(a&&n.includes(a)?a:"instances"));cn(()=>{localStorage.setItem(s,o(l))});const d={instances:"instances",hosts:"installations",catalog:"catalog",hostsconf:"hosts"},u=lt=>Object.keys(d).find(zt=>d[zt]===lt)??null;let g;cn(()=>{if(i()===g)return;g=i();const lt=u(i());lt&&Io(()=>{lt!==o(l)&&p(l,lt,!0)})}),cn(()=>{var lt;t()&&((lt=e.onsub)==null||lt.call(e,d[o(l)]))});let x=A(0),m=A(null);function C(lt){p(m,lt,!0),By(x)}let _=A(null),E=0;function k(lt,zt){p(_,{host:lt,adapter:zt,n:++E},!0),C("catalog"),p(l,"hosts")}let I=A(0),M=A(0),N=A(0),O=A("none"),z=A(""),U=rt(()=>[o(I)>0?`${o(I)} adapter update${o(I)===1?"":"s"} available`:"",o(M)>0?`${o(M)} host${o(M)===1?"":"s"} with an outdated helper`:"",o(N)>0?`${o(N)} host${o(N)===1?"":"s"} with a newer Node.js`:""].filter(Boolean).join(" · "));cn(()=>{var lt,zt;o(U)?(lt=e.onstatus)==null||lt.call(e,"warn",o(U)):(zt=e.onstatus)==null||zt.call(e,o(O),o(z))});var q=aue(),se=f(q),Ee=f(se);let ge;var he=h(Ee,2);let Ve;var nt=h(f(he));{var ue=lt=>{var zt=JA();T(()=>_i(zt,"title",`${o(I)??""} adapter update${o(I)===1?"":"s"} available`)),y(lt,zt)};P(nt,lt=>{o(I)>0&<(ue)})}var $e=h(he,2);let me;var Xe=h($e,2);let be;var Pt=h(f(Xe));{var Ne=lt=>{var zt=JA();T(Ft=>_i(zt,"title",Ft),[()=>[o(M)>0?`${o(M)} host${o(M)===1?"":"s"} running an outdated she-servicectl`:"",o(N)>0?`${o(N)} host${o(N)===1?"":"s"} with a newer Node.js available`:""].filter(Boolean).join(" · ")]),y(lt,zt)};P(Pt,lt=>{o(M)+o(N)>0&<(Ne)})}var Fe=h(se,2);let Pe;var Lt=f(Fe);Dle(Lt,{onstatus:(lt,zt)=>{p(O,lt,!0),p(z,zt,!0)},get generation(){return o(x)},get origin(){return o(m)},onchanged:()=>C("instances")});var xe=h(Fe,2);let ke;var Te=f(xe);zce(Te,{onchanged:()=>C("hosts"),onupdates:lt=>p(I,lt,!0),get generation(){return o(x)},get origin(){return o(m)},get addPreset(){return o(_)}});var Qe=h(xe,2);let Ue;var vt=f(Qe);{let lt=rt(()=>t()&&o(l)==="catalog");fde(vt,{get active(){return o(lt)},oninstalled:k,get generation(){return o(x)},get origin(){return o(m)}})}var ii=h(Qe,2);let Vt;var Oe=f(ii);rue(Oe,{onchanged:()=>C("hostsconf"),onupdates:lt=>p(M,lt,!0),onnodeupdates:lt=>p(N,lt,!0),get generation(){return o(x)},get origin(){return o(m)}}),T(()=>{ge=Ht(Ee,1,"svelte-ymmv06",null,ge,{active:o(l)==="instances"}),Ve=Ht(he,1,"svelte-ymmv06",null,Ve,{active:o(l)==="hosts"}),me=Ht($e,1,"svelte-ymmv06",null,me,{active:o(l)==="catalog"}),be=Ht(Xe,1,"svelte-ymmv06",null,be,{active:o(l)==="hostsconf"}),Pe=Ht(Fe,1,"tab-wrap svelte-ymmv06",null,Pe,{hidden:o(l)!=="instances"}),ke=Ht(xe,1,"tab-wrap svelte-ymmv06",null,ke,{hidden:o(l)!=="hosts"}),Ue=Ht(Qe,1,"tab-wrap svelte-ymmv06",null,Ue,{hidden:o(l)!=="catalog"}),Vt=Ht(ii,1,"tab-wrap svelte-ymmv06",null,Vt,{hidden:o(l)!=="hostsconf"})}),H("click",Ee,()=>p(l,"instances")),H("click",he,()=>p(l,"hosts")),H("click",$e,()=>p(l,"catalog")),H("click",Xe,()=>p(l,"hostsconf")),y(r,q),bs()}ks(["click"]);const iy=(r,e=$o)=>{var t=uue(),i=h(f(t));{var n=a=>{var l=cue();y(a,l)},s=a=>{var l=due();y(a,l)};P(i,a=>{e()?a(n):a(s,-1)})}y(r,t)};var cue=Go('<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2"></path>'),due=Go('<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0"></path>'),uue=Go('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="7" width="10" height="7" rx="1.5"></rect><!></svg>'),hue=S('<span class="ok svelte-1az45ix"> </span>'),fue=S('<span class="muted svelte-1az45ix"> </span>'),pue=S('<div class="err-box svelte-1az45ix"> <button class="ghost sm svelte-1az45ix">×</button></div>'),gue=S(`<div class="err-box svelte-1az45ix"><b>Secrets store locked:</b> <code class="svelte-1az45ix">SHE_SECRETS_KEY</code> in the daemon's environment or restore <code class="svelte-1az45ix"> </code>, then restart she. Starting over means deleting <code class="svelte-1az45ix"> </code>.</div>`),vue=S('<button><span class="name svelte-1az45ix"> </span> <span class="count svelte-1az45ix"> </span></button>'),xue=S('<div class="muted empty svelte-1az45ix">No secrets yet.</div>'),mue=S("<!> <!>",1),_ue=S('<button type="button" class="lock is-secret svelte-1az45ix" disabled="" title="secret — write-only, never shown again"><!></button> <input placeholder="•••••• (type to replace)" autocomplete="off" spellcheck="false" class="svelte-1az45ix"/>',1),bue=S('<textarea spellcheck="false" class="svelte-1az45ix"></textarea>'),Cue=S('<input type="text" autocomplete="off" spellcheck="false" class="svelte-1az45ix"/>'),yue=S('<button type="button" class="lock svelte-1az45ix" title="plain — shown in clear; click to mark it secret (never shown again)"><!></button> <!>',1),wue=S('<tr><td class="mono svelte-1az45ix"> </td><td class="svelte-1az45ix"><form class="val svelte-1az45ix"><!> <button type="submit" class="sm svelte-1az45ix">Save</button></form></td><td class="muted svelte-1az45ix"> </td><td class="c-act svelte-1az45ix"><button class="ghost sm svelte-1az45ix" title="Delete">×</button></td></tr>'),Eue=S('<textarea placeholder="value" spellcheck="false" class="svelte-1az45ix"></textarea>'),Sue=S('<input type="password" placeholder="value" autocomplete="off" class="svelte-1az45ix"/>'),kue=S('<div class="fields-head svelte-1az45ix"><span class="title svelte-1az45ix"> </span> <span class="muted svelte-1az45ix"> </span> <span class="spacer svelte-1az45ix"></span> <label class="reveal check-label svelte-1az45ix"><input type="checkbox" class="svelte-1az45ix"/><span class="checkmark svelte-1az45ix"></span> show while typing</label> <button class="ghost sm danger svelte-1az45ix">Delete group</button></div> <table class="svelte-1az45ix"><colgroup><col class="c-name svelte-1az45ix"/><col class="c-value"/><col class="c-changed svelte-1az45ix"/><col class="c-act svelte-1az45ix"/></colgroup><thead><tr><th class="svelte-1az45ix">field</th><th class="svelte-1az45ix">value</th><th class="svelte-1az45ix">changed</th><th class="svelte-1az45ix"></th></tr></thead><tbody><!><tr class="new svelte-1az45ix"><td class="svelte-1az45ix"><input type="text" placeholder="new field" spellcheck="false" class="svelte-1az45ix"/></td><td class="svelte-1az45ix"><form class="val svelte-1az45ix"><button type="button"><!></button> <!> <button type="submit" class="sm svelte-1az45ix">Add</button></form></td><td class="muted svelte-1az45ix" colspan="2">the lock decides the kind: secret fields are write-only forever, plain fields (user names, hosts) stay readable here. Multi-line values: tick <i>show while typing</i> and paste.</td></tr></tbody></table> <div class="hint svelte-1az45ix"><code class="svelte-1az45ix"> </code> returns the string, <code class="svelte-1az45ix"> </code> the whole group as a frozen object, <code class="svelte-1az45ix">she.secrets.has(…)</code> checks without a warning. Scripts that read a secret at load time keep the old value until they are reloaded.</div>',1),Due=S('Create a group on the left, then add fields to it — e.g. group <code class="svelte-1az45ix">smtp</code> with <code class="svelte-1az45ix">host</code>, <code class="svelte-1az45ix">user</code>, <code class="svelte-1az45ix">password</code>.',1),Aue=S('<div class="muted empty svelte-1az45ix"><!></div>'),Bue=S(`<!> <div class="sec-shell svelte-1az45ix"><div class="bar svelte-1az45ix"><span class="muted svelte-1az45ix">Values are stored encrypted and never sent back to the browser — scripts read them with <code class="svelte-1az45ix">she.secrets.get('group/field')</code>.</span> <span class="spacer svelte-1az45ix"></span> <!> <!> <button class="ghost svelte-1az45ix" title="Reload">↺</button></div> <!> <!> <div class="body svelte-1az45ix"><div class="groups svelte-1az45ix"><div class="groups-head svelte-1az45ix">Groups</div> <!> <form class="add-group svelte-1az45ix"><input type="text" placeholder="new group" spellcheck="false" class="svelte-1az45ix"/> <button type="submit" class="ghost sm svelte-1az45ix">+</button></form></div> <div class="fields svelte-1az45ix"><!></div></div></div>`,1);function Fue(r,e){_s(e,!0);let t=Rn(e,"active",3,!0),i=Rn(e,"sub",3,null),n=A(null),s=A(null),a=A(""),l=A(""),d=A(!1),u=A(""),g=A(""),x=A(""),m=A(!0),C=A(wi({})),_=A(!1),E=A(void 0),k=!1;const I=/^[A-Za-z0-9_.-]{1,64}$/,M=rt(()=>{var Z;return((Z=o(n))==null?void 0:Z.groups.find(oe=>oe.name===o(s)))??null}),N=rt(()=>{var Z,oe;return((Z=o(n))==null?void 0:Z.status)==="locked"||((oe=o(n))==null?void 0:oe.status)==="error"});async function O(){try{p(n,await hG(),!0),p(a,""),o(s)&&!o(n).groups.some(Z=>Z.name===o(s))&&p(s,null),!o(s)&&o(n).groups.length>0&&p(s,o(n).groups[0].name,!0)}catch(Z){p(a,Z.message??String(Z),!0)}}cn(()=>{t()&&!k&&(k=!0,O())});let z;cn(()=>{const Z=i();Z!==z&&(z=Z,Z&&Z!==o(s)&&p(s,Z,!0))}),cn(()=>{var Z;t()&&(z=o(s)??"",(Z=e.onsub)==null||Z.call(e,o(s)??""))});function U(Z){p(l,Z,!0),setTimeout(()=>{o(l)===Z&&p(l,"")},2500)}async function q(Z,oe,ce,ct=!0){if(ce){p(d,!0);try{await fG(Z,oe,ce,ct),p(C,{...o(C),[`${Z}/${oe}`]:""},!0),p(g,""),p(x,""),p(m,!0),U(`saved ${Z}/${oe}`),await O(),p(s,Z,!0)}catch(Je){p(a,Je.message??String(Je),!0)}finally{p(d,!1)}}}async function se(){var oe;const Z=o(u).trim();if(!I.test(Z)){p(a,"group name: letters, digits, _ . - (max 64)");return}(oe=o(n))!=null&&oe.groups.some(ce=>ce.name===Z)||p(n,o(n)?{...o(n),groups:[...o(n).groups,{name:Z,changed:0,fields:[]}].sort((ce,ct)=>ce.name.localeCompare(ct.name))}:o(n),!0),p(s,Z,!0),p(u,""),p(a,"")}async function Ee(Z,oe){var ce;if(await((ce=o(E))==null?void 0:ce.show(`Mark ${Z}/${oe} as secret? Its value will never be shown again — not here, not through the API. Scripts keep reading it. This cannot be undone (delete and re-create to change your mind).`,{confirm:"Mark secret",danger:!0}))){p(d,!0);try{await pG(Z,oe),p(C,{...o(C),[`${Z}/${oe}`]:""},!0),U(`${Z}/${oe} is secret now`),await O()}catch(ct){p(a,ct.message??String(ct),!0)}finally{p(d,!1)}}}async function ge(Z,oe){var ce;if(await((ce=o(E))==null?void 0:ce.show(`Delete secret ${Z}/${oe}? Scripts reading it get undefined from now on.`,{confirm:"Delete",danger:!0}))){p(d,!0);try{await lD(Z,oe),U(`deleted ${Z}/${oe}`),await O()}catch(ct){p(a,ct.message??String(ct),!0)}finally{p(d,!1)}}}async function he(Z){var ce,ct,Je,Dt;const oe=((ce=o(M))==null?void 0:ce.fields.length)??0;if(oe===0){p(n,o(n)?{...o(n),groups:o(n).groups.filter(_t=>_t.name!==Z)}:o(n),!0),p(s,((Je=(ct=o(n))==null?void 0:ct.groups[0])==null?void 0:Je.name)??null,!0);return}if(await((Dt=o(E))==null?void 0:Dt.show(`Delete the group ${Z} with its ${oe} secret${oe===1?"":"s"}?`,{confirm:"Delete group",danger:!0}))){p(d,!0);try{await lD(Z),U(`deleted ${Z}`),p(s,null),await O()}catch(_t){p(a,_t.message??String(_t),!0)}finally{p(d,!1)}}}function Ve(Z){return Z?new Date(Z).toLocaleString():"—"}var nt=Bue(),ue=Ct(nt);ds(Fr(ue,{}),Z=>p(E,Z,!0),()=>o(E));var $e=h(ue,2),me=f($e),Xe=h(f(me),4);{var be=Z=>{var oe=hue(),ce=f(oe);T(()=>B(ce,o(l))),y(Z,oe)};P(Xe,Z=>{o(l)&&Z(be)})}var Pt=h(Xe,2);{var Ne=Z=>{var oe=fue(),ce=f(oe);T(()=>{_i(oe,"title",o(n).file),B(ce,`key: ${(o(n).keySource==="env"?"SHE_SECRETS_KEY":o(n).keySource==="file"?o(n).keyFile:"none yet — generated on first save")??""}`)}),y(Z,oe)};P(Pt,Z=>{o(n)&&Z(Ne)})}var Fe=h(Pt,2),Pe=h(me,2);{var Lt=Z=>{var oe=pue(),ce=f(oe),ct=h(ce);T(()=>B(ce,`${o(a)??""} `)),H("click",ct,()=>p(a,"")),y(Z,oe)};P(Pe,Z=>{o(a)&&Z(Lt)})}var xe=h(Pe,2);{var ke=Z=>{var oe=gue(),ce=h(f(oe)),ct=h(ce,3),Je=f(ct),Dt=h(ct,2),_t=f(Dt);T(()=>{B(ce,` ${o(n).error??""}. Values cannot be read or changed until the key is back — set `),B(Je,o(n).keyFile),B(_t,o(n).file)}),y(Z,oe)};P(xe,Z=>{o(N)&&o(n)&&Z(ke)})}var Te=h(xe,2),Qe=f(Te),Ue=h(f(Qe),2);{var vt=Z=>{var oe=mue(),ce=Ct(oe);xi(ce,17,()=>o(n).groups,Dt=>Dt.name,(Dt,_t)=>{var $t=vue();let Ie;var Se=f($t),et=f(Se),w=h(Se,2),j=f(w);T(()=>{Ie=Ht($t,1,"group svelte-1az45ix",null,Ie,{active:o(s)===o(_t).name}),B(et,o(_t).name),B(j,o(_t).fields.length)}),H("click",$t,()=>p(s,o(_t).name,!0)),y(Dt,$t)});var ct=h(ce,2);{var Je=Dt=>{var _t=xue();y(Dt,_t)};P(ct,Dt=>{o(n).groups.length===0&&Dt(Je)})}y(Z,oe)};P(Ue,Z=>{o(n)&&Z(vt)})}var ii=h(Ue,2),Vt=f(ii),Oe=h(Vt,2),lt=h(Qe,2),zt=f(lt);{var Ft=Z=>{var oe=kue(),ce=Ct(oe),ct=f(ce),Je=f(ct),Dt=h(ct,2),_t=f(Dt),$t=h(Dt,4),Ie=f($t),Se=h($t,2),et=h(ce,2),w=h(f(et),2),j=f(w);xi(j,17,()=>o(M).fields,xt=>xt.name,(xt,Rt)=>{const ne=rt(()=>`${o(M).name}/${o(Rt).name}`),Q=rt(()=>o(C)[o(ne)]??(o(Rt).secret?"":o(Rt).value??"")),G=rt(()=>o(Rt).secret?o(Q)!=="":o(Q)!==(o(Rt).value??""));var de=wue(),ot=f(de),Ze=f(ot),At=h(ot),St=f(At),ze=f(St);{var Kt=Mt=>{var X=_ue(),le=Ct(X),ee=f(le);iy(ee,()=>!0);var fe=h(le,2);T(()=>{_i(fe,"type",o(_)?"text":"password"),Za(fe,o(Q)),fe.disabled=o(N)}),H("input",fe,qe=>p(C,{...o(C),[o(ne)]:qe.target.value},!0)),y(Mt,X)},Xt=Mt=>{var X=yue(),le=Ct(X),ee=f(le);iy(ee,()=>!1);var fe=h(le,2);{var qe=re=>{var ae=bue();_i(ae,"rows",4),T(()=>{Za(ae,o(Q)),ae.disabled=o(N)}),H("input",ae,W=>p(C,{...o(C),[o(ne)]:W.target.value},!0)),y(re,ae)},Ae=rt(()=>o(Q).includes(`
|
|
296
296
|
`)),yt=re=>{var ae=Cue();T(()=>{Za(ae,o(Q)),ae.disabled=o(N)}),H("input",ae,W=>p(C,{...o(C),[o(ne)]:W.target.value},!0)),y(re,ae)};P(fe,re=>{o(Ae)?re(qe):re(yt,-1)})}T(()=>le.disabled=o(d)||o(N)),H("click",le,()=>Ee(o(M).name,o(Rt).name)),y(Mt,X)};P(ze,Mt=>{o(Rt).secret?Mt(Kt):Mt(Xt,-1)})}var Ci=h(ze,2),Li=h(At),J=f(Li),We=h(Li),kt=f(We);T(Mt=>{_i(ot,"title",`she.secrets.get('${o(ne)??""}')`),B(Ze,o(Rt).name),Ci.disabled=o(d)||o(N)||!o(G)||!o(Q),B(J,Mt),kt.disabled=o(d)||o(N)},[()=>Ve(o(Rt).changed)]),Ls("submit",St,Mt=>{Mt.preventDefault(),o(G)&&q(o(M).name,o(Rt).name,o(Q),o(Rt).secret)}),H("click",kt,()=>ge(o(M).name,o(Rt).name)),y(xt,de)});var te=h(j),_e=f(te),De=f(_e),st=h(_e),V=f(st),Ke=f(V);let mt;var ve=f(Ke);iy(ve,()=>o(m));var Ge=h(Ke,2);{var ht=xt=>{var Rt=Eue();T(ne=>{_i(Rt,"rows",ne),Rt.disabled=o(N)},[()=>o(x).includes(`
|
|
297
297
|
`)?4:1]),ci(Rt,()=>o(x),ne=>p(x,ne)),y(xt,Rt)},wt=rt(()=>o(x).includes(`
|
|
298
|
-
`)||o(_)||!o(m)),Wt=xt=>{var Rt=Sue();T(()=>Rt.disabled=o(N)),ci(Rt,()=>o(x),ne=>p(x,ne)),y(xt,Rt)};P(Ge,xt=>{o(wt)?xt(ht):xt(Wt,-1)})}var Be=h(Ge,2),ft=h(et,2),$=f(ft),we=f($),He=h($,2),bt=f(He);T((xt,Rt)=>{B(Je,o(M).name),B(_t,`changed ${xt??""}`),Se.disabled=o(d)||o(N),De.disabled=o(N),mt=Ht(Ke,1,"lock svelte-1az45ix",null,mt,{"is-secret":o(m)}),Ke.disabled=o(N),_i(Ke,"title",o(m)?"secret — write-only once saved (click for a plain field, e.g. a user name)":"plain — shown in clear (click for a secret)"),Be.disabled=Rt,B(we,`she.secrets.get('${o(M).name??""}/<field>')`),B(bt,`she.secrets.get('${o(M).name??""}')`)},[()=>Ve(o(M).changed),()=>o(d)||o(N)||!o(g).trim()||!o(x)]),As(Ie,()=>o(_),xt=>p(_,xt)),H("click",Se,()=>he(o(M).name)),ci(De,()=>o(g),xt=>p(g,xt)),Ls("submit",V,xt=>{xt.preventDefault(),I.test(o(g).trim())?q(o(M).name,o(g).trim(),o(x),o(m)):p(a,"field name: letters, digits, _ . - (max 64)")}),H("click",Ke,()=>p(m,!o(m))),y(Z,oe)},oi=Z=>{var oe=Aue(),ce=f(oe);{var ct=Dt=>{var _t=Due();y(Dt,_t)},Je=Dt=>{var _t=Ln("Select a group.");y(Dt,_t)};P(ce,Dt=>{o(n).groups.length===0?Dt(ct):Dt(Je,-1)})}y(Z,oe)};P(zt,Z=>{o(M)?Z(Ft):o(n)&&!o(N)&&Z(oi,1)})}T(Z=>{Vt.disabled=o(N),Oe.disabled=Z},[()=>o(N)||!o(u).trim()]),H("click",Fe,O),Ls("submit",ii,Z=>{Z.preventDefault(),se()}),ci(Vt,()=>o(u),Z=>p(u,Z)),y(r,nt),bs()}ks(["click","input"]);var Lue=S('<div class="safe-banner svelte-1n46o8q"><strong class="svelte-1n46o8q">⚠ SAFE MODE</strong> — no user script is running and the script directory is not watched. She was killed instead of stopped last time, which usually means a script blocked the event loop. Edit or delete it, then restart. <button class="safe-restart svelte-1n46o8q">Restart daemon</button></div>'),e6=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),Iue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),Pue=S('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),Tue=S('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),Mue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" class="svelte-1n46o8q"><path d="M8.36,5.73 A2.6,2.6 0 0,1 9.38,10.50" class="svelte-1n46o8q"></path><path d="M7.64,5.73 A2.6,2.6 0 0,0 6.62,10.50" class="svelte-1n46o8q"></path><path d="M9.16,3.95 A4.5,4.5 0 0,1 10.38,12.12" class="svelte-1n46o8q"></path><path d="M6.84,3.95 A4.5,4.5 0 0,0 5.62,12.12" class="svelte-1n46o8q"></path><path d="M10.40,2.37 A6.4,6.4 0 0,1 11.39,13.73" class="svelte-1n46o8q"></path><path d="M5.60,2.37 A6.4,6.4 0 0,0 4.61,13.73" class="svelte-1n46o8q"></path><path d="M7.15,8.3 L8,15.4 L8.85,8.3 Z" fill="currentColor" stroke="none" class="svelte-1n46o8q"></path><circle cx="8" cy="8.3" r="1.45" fill="currentColor" stroke="none" class="svelte-1n46o8q"></circle></svg> Broker</button>'),Rue=S('<span class="nav-dot nav-dot--none svelte-1n46o8q"></span>'),Nue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="2" y="2" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><rect x="2" y="10" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><circle cx="4.5" cy="4" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle><circle cx="4.5" cy="12" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle></svg> Adapters <!></button>'),Oue=S('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),Hue=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),zue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),Wue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M8,2 L8,7" class="svelte-1n46o8q"></path><path d="M6,5 L8,7.5 L10,5" class="svelte-1n46o8q"></path><path d="M2.5,14 L6,10" class="svelte-1n46o8q"></path><path d="M6.2,12.8 L6,10 L3.2,10.2" class="svelte-1n46o8q"></path><path d="M13.5,14 L10,10" class="svelte-1n46o8q"></path><path d="M9.8,12.8 L10,10 L12.8,10.2" class="svelte-1n46o8q"></path></svg> Matter <!></button>'),jue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><ellipse cx="8" cy="4.5" rx="5" ry="1.8" class="svelte-1n46o8q"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7" class="svelte-1n46o8q"></path><path d="M3,8 a5,1.8 0,0,0 10,0" class="svelte-1n46o8q"></path></svg> DB</button>'),Vue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),$ue=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),que=S('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),Uue=S('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),Gue=S('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),Kue=S('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button>'),Zue=S('<div class="version-popup svelte-1n46o8q"><dl class="svelte-1n46o8q"><dt class="svelte-1n46o8q">Installed</dt><dd class="svelte-1n46o8q"></dd> <!></dl> <div class="version-actions svelte-1n46o8q"><!> <button class="check-btn svelte-1n46o8q" title="Check for updates now"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button></div></div>'),Yue=S('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),Xue=S('<dt class="svelte-1n46o8q">Matter nodes</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Matter endpoints</dt><dd class="svelte-1n46o8q"> </dd>',1),Que=S('<dt class="svelte-1n46o8q">DB docs</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">DB views</dt><dd class="svelte-1n46o8q"> </dd>',1),Jue=S('<dl class="svelte-1n46o8q"><!> <dt class="svelte-1n46o8q">Scripts</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT topics</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT msg/s</dt><dd class="svelte-1n46o8q"> </dd> <!> <!> <dt class="svelte-1n46o8q">Handlers</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Memory</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">CPU</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL util</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag mean</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag max</dt><dd class="svelte-1n46o8q"> </dd></dl>'),ehe=S('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),the=S('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M18.36 6.64a9 9 0 1 1-12.73 0" class="svelte-1n46o8q"></path><line x1="12" y1="2" x2="12" y2="12" class="svelte-1n46o8q"></line></svg> Restart daemon</button>'),ihe=S('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),nhe=S('<button class="nav-logout svelte-1n46o8q" title="Logout"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" class="svelte-1n46o8q"></path><polyline points="16 17 21 12 16 7" class="svelte-1n46o8q"></polyline><line x1="21" y1="12" x2="9" y2="12" class="svelte-1n46o8q"></line></svg></button>'),she=S("<div><!></div>"),ohe=S('<div class="shell svelte-1n46o8q"><!> <nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="5,3 1,8 5,13" class="svelte-1n46o8q"></polyline><polyline points="11,3 15,8 11,13" class="svelte-1n46o8q"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" class="svelte-1n46o8q"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1" class="svelte-1n46o8q"></rect><path d="M2,11 V5 H5 V11" class="svelte-1n46o8q"></path><path d="M6,12 V5 H9 V8 H6" class="svelte-1n46o8q"></path><path d="M10,11 V5 H15 V11" class="svelte-1n46o8q"></path><line x1="12.5" y1="5" x2="12.5" y2="11" class="svelte-1n46o8q"></line></svg> Packages <!></button> <button><svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle" class="svelte-1n46o8q"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z" class="svelte-1n46o8q"></path></svg> MQTT <!></button> <!> <!> <!> <!> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="3" y="7" width="10" height="7" rx="1.5" class="svelte-1n46o8q"></rect><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" class="svelte-1n46o8q"></path><circle cx="8" cy="9.9" r="1.15" stroke-width="1.1" class="svelte-1n46o8q"></circle><path d="M8 11v1.2" stroke-width="1.1" class="svelte-1n46o8q"></path></svg> Secrets</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" class="svelte-1n46o8q"><line x1="2" y1="5" x2="14" y2="5" class="svelte-1n46o8q"></line><line x1="2" y1="8" x2="14" y2="8" class="svelte-1n46o8q"></line><line x1="2" y1="11" x2="9" y2="11" class="svelte-1n46o8q"></line></svg> Logs <!></button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" class="svelte-1n46o8q"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><line x1="18" y1="20" x2="18" y2="10" class="svelte-1n46o8q"></line><line x1="12" y1="20" x2="12" y2="4" class="svelte-1n46o8q"></line><line x1="6" y1="20" x2="6" y2="14" class="svelte-1n46o8q"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" class="svelte-1n46o8q"></path><circle cx="12" cy="12" r="3" class="svelte-1n46o8q"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <!> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),rhe=S('<div class="login-error svelte-1n46o8q"> </div>'),ahe=S('<div class="login-overlay svelte-1n46o8q"><form class="login-box svelte-1n46o8q"><div class="login-brand svelte-1n46o8q">she</div> <h2 class="svelte-1n46o8q">Sign in</h2> <div class="login-field svelte-1n46o8q"><label for="she-password" class="svelte-1n46o8q">Password</label> <input id="she-password" type="password" placeholder="Enter password" autocomplete="current-password" class="svelte-1n46o8q"/></div> <!> <button type="submit" class="login-btn svelte-1n46o8q"> </button></form></div>'),lhe=S('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Restarting smart-home-engine…</div></div>'),che=S('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Updating smart-home-engine…</div></div>'),dhe=S("<!> <!> <!> <!>",1);function uhe(r,e){_s(e,!0);const t=["scripts","mqtt","matter","broker","adapters","secrets","db","logs","config","packages"],i={services:"adapters",security:"broker"};function n(){const Je=location.hash.replace(/^#\/?/,""),[Dt,..._t]=Je.split("/"),$t=i[Dt]??Dt;if(!t.includes($t))return{page:"scripts",sub:null};const Ie=_t.map(Se=>{try{return decodeURIComponent(Se)}catch{return Se}}).join("/");return{page:$t,sub:Ie||null}}let s=A(wi(n().page)),a=A(wi(n().sub)),l=A(null),d=A(!1),u=A(!1),g=A(!1),x=A(!1),m=A("none"),C=A(""),_=A(!1),E=A(""),k=A(""),I=A(!1),M=A(!1);sG(()=>{p(_,!0)});async function N(){p(k,""),p(I,!0);try{await aG(o(E)),p(E,""),p(_,!1)}catch(Je){p(k,Je.message??"Login failed",!0)}finally{p(I,!1)}}async function O(){if(o(m)==="proxy"&&o(C)){window.location.href=o(C);return}await lG(),p(_,!0)}let z=A(null),U=A(!1),q=A(!1),se=A(!1),Ee=A(!1),ge=A(wi([])),he=A(0),Ve=A(!1),nt=A(!1),ue=A("none"),$e=A(""),me=A(wi([]));const Xe=rt(()=>o(me).filter(Je=>Je.online).length),be=rt(()=>o(me).length===0?"none":o(Xe)===o(me).length?"all":o(Xe)>0?"some":"offline");let Pt=A(!1),Ne=A(!1);async function Fe(){if(!await o(z).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;p(U,!0);let Je;try{Je=(await Gc()).startedAt}catch{}try{await bB()}catch{}const Dt=Date.now()+6e4;for(;Date.now()<Dt;){await new Promise(_t=>setTimeout(_t,250));try{const _t=await Gc();if(Je===void 0||_t.startedAt!==Je){location.reload();return}}catch{}}location.reload()}async function Pe(){p(g,!0);try{const Je=await vG();o(l)&&p(l,{...o(l),latestVersion:Je.latestVersion??void 0},!0)}catch{}finally{p(g,!1)}}async function Lt(){var _t,$t;if(!await o(z).show(`Update to v${(_t=o(l))==null?void 0:_t.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;p(u,!1),p(x,!0);const Je=($t=o(l))==null?void 0:$t.startedAt;try{await gG()}catch{}const Dt=Date.now()+18e4;for(;Date.now()<Dt;){await new Promise(Ie=>setTimeout(Ie,1e3));try{const Ie=await Gc();if(Je===void 0||Ie.startedAt!==Je){location.reload();return}}catch{p(x,!1),p(U,!0)}}location.reload()}let xe=A(void 0),ke=A(0);function Te(){if(!o(xe))return;const Je=getComputedStyle(o(xe)),Dt=parseFloat(Je.columnGap)||0,_t=[...o(xe).children];let $t=parseFloat(Je.paddingLeft)+parseFloat(Je.paddingRight)+Dt*Math.max(0,_t.length-1);for(const Se of _t)Se.classList.contains("nav-spacer")||($t+=Se.getBoundingClientRect().width);const Ie=Math.ceil($t)+8;Ie>0&&Ie!==o(ke)&&p(ke,Ie)}let Qe=null;function Ue(){if(!(!o(xe)||!Qe)){Qe.disconnect(),Qe.observe(o(xe));for(const Je of o(xe).children)Qe.observe(Je);Te()}}Vs(()=>(Qe=new ResizeObserver(()=>Te()),Ue(),()=>{Qe==null||Qe.disconnect(),Qe=null})),cn(()=>{var Je,Dt,_t,$t;o(Ve),o(nt),(Je=o(l))==null||Je.matterEnabled,(Dt=o(l))==null||Dt.dbEnabled,(_t=o(l))==null||_t.latestVersion,($t=o(l))==null||$t.docker,va().then(()=>Io(Ue))});function vt(Je){p(s,Je,!0),p(a,null),location.hash=ii(Je,null)}function ii(Je,Dt){const _t=Dt?Dt.split("/").map(encodeURIComponent).join("/"):"";return`#/${Je}${_t?"/"+_t:""}`}function Vt(Je,Dt){const _t=Dt||null;o(s)!==Je||o(a)===_t||(p(a,_t,!0),history.replaceState(null,"",ii(Je,_t)))}Vs(async()=>{const Je=ii(o(s),o(a));location.hash!==Je&&history.replaceState(null,"",Je);const Dt=()=>{const _e=n();p(s,_e.page,!0),p(a,_e.sub,!0)};window.addEventListener("hashchange",Dt);const _t=()=>{document.visibilityState==="visible"&&(gZ(),Gc().then(_e=>{p(l,_e,!0)}).catch(()=>{}),requestAnimationFrame(()=>{document.body.style.display="none",document.body.offsetHeight,document.body.style.display="",window.dispatchEvent(new Event("she:visible"))}))};document.addEventListener("visibilitychange",_t);try{const _e=await rG();p(m,_e.mode,!0),p(C,_e.proxyLogoutUrl??"",!0),o(m)==="password"&&(await fetch("/she/scripts")).status===401&&p(_,!0)}catch{}p(M,!0);async function $t(){var _e,De,st,V;try{p(l,await Gc(),!0)}catch{}try{const[Ke,mt]=await Promise.all([wB(),Ec()]);p(ge,Array.isArray(mt.pinnedPackages)?mt.pinnedPackages:[],!0),p(he,Object.keys(Ke).filter(ht=>!o(ge).includes(ht)).length,!0);const ve=o(Ve);p(Ve,((_e=mt.broker)==null?void 0:_e.enabled)===!0),ve&&!o(Ve)&&o(s)==="broker"&&vt("scripts");const Ge=o(nt);p(nt,((De=mt.services)==null?void 0:De.enabled)===!0),Ge&&!o(nt)&&o(s)==="adapters"&&vt("scripts")}catch{}!((st=o(l))!=null&&st.matterEnabled)&&o(s)==="matter"&&vt("scripts"),!((V=o(l))!=null&&V.dbEnabled)&&o(s)==="db"&&vt("scripts")}$t();const Ie=setInterval($t,5e3),Se=tr("mqtt:status",_e=>{_e.connected===!1?(p(Ee,!0),p(q,!1),p(se,!1)):(p(Ee,!1),p(q,_e.ready===!1),p(se,_e.ready===!0))}),et=tr("matter:deviceList",_e=>{Array.isArray(_e.devices)&&p(me,_e.devices.map(De=>({nodeId:String(De.nodeId),online:!!De.online})),!0)}),w=tr("matter:deviceStatus",_e=>{if(_e.nodeId===void 0)return;const De=String(_e.nodeId),st=!!_e.online;p(me,o(me).map(V=>V.nodeId===De?{...V,online:st}:V),!0)}),j=IB();p(Pt,j.some(_e=>_e.level==="error"),!0),p(Ne,!o(Pt)&&j.some(_e=>_e.level==="warn"),!0);const te=u2(_e=>{_e.level==="error"?(p(Pt,!0),p(Ne,!1)):_e.level==="warn"&&!o(Pt)&&p(Ne,!0)});return()=>{window.removeEventListener("hashchange",Dt),document.removeEventListener("visibilitychange",_t),clearInterval(Ie),Se(),et(),w(),te()}});var Oe=dhe();Ls("click",r3,()=>{o(d)&&p(d,!1),o(u)&&p(u,!1)});var lt=Ct(Oe);{var zt=Je=>{var Dt=ohe(),_t=f(Dt);{var $t=Me=>{var dt=Lue(),ti=h(f(dt),2);H("click",ti,Fe),y(Me,dt)};P(_t,Me=>{var dt;(dt=o(l))!=null&&dt.safeMode&&Me($t)})}var Ie=h(_t,2),Se=h(f(Ie),2);let et;var w=h(Se,2);let j;var te=h(f(w),2);{var _e=Me=>{var dt=e6();T(()=>_i(dt,"title",`${o(he)??""} package update${o(he)===1?"":"s"} available`)),y(Me,dt)};P(te,Me=>{o(he)>0&&Me(_e)})}var De=h(w,2);let st;var V=h(f(De),2);{var Ke=Me=>{var dt=Iue();y(Me,dt)},mt=Me=>{var dt=Pue();y(Me,dt)},ve=Me=>{var dt=Tue();y(Me,dt)};P(V,Me=>{o(Ee)?Me(Ke):o(q)?Me(mt,1):o(se)&&Me(ve,2)})}var Ge=h(De,2);{var ht=Me=>{var dt=Mue();let ti;T(()=>ti=Ht(dt,1,"svelte-1n46o8q",null,ti,{active:o(s)==="broker"})),H("click",dt,()=>vt("broker")),y(Me,dt)};P(Ge,Me=>{o(Ve)&&Me(ht)})}var wt=h(Ge,2);{var Wt=Me=>{var dt=Nue();let ti;var $i=h(f(dt),2);{var Ni=Ut=>{var si=e6();T(()=>_i(si,"title",o($e))),y(Ut,si)},Wi=Ut=>{var si=Rue();y(Ut,si)};P($i,Ut=>{o(ue)==="warn"?Ut(Ni):Ut(Wi,-1)})}T(()=>ti=Ht(dt,1,"svelte-1n46o8q",null,ti,{active:o(s)==="adapters"})),H("click",dt,()=>vt("adapters")),y(Me,dt)};P(wt,Me=>{o(nt)&&Me(Wt)})}var Be=h(wt,2);{var ft=Me=>{var dt=Wue();let ti;var $i=h(f(dt),2);{var Ni=si=>{var ki=Oue();y(si,ki)},Wi=si=>{var ki=Hue();y(si,ki)},Ut=si=>{var ki=zue();y(si,ki)};P($i,si=>{o(be)==="all"?si(Ni):o(be)==="some"?si(Wi,1):o(be)==="offline"&&si(Ut,2)})}T(()=>ti=Ht(dt,1,"svelte-1n46o8q",null,ti,{active:o(s)==="matter"})),H("click",dt,()=>vt("matter")),y(Me,dt)};P(Be,Me=>{var dt;(dt=o(l))!=null&&dt.matterEnabled&&Me(ft)})}var $=h(Be,2);{var we=Me=>{var dt=jue();let ti;T(()=>ti=Ht(dt,1,"svelte-1n46o8q",null,ti,{active:o(s)==="db"})),H("click",dt,()=>vt("db")),y(Me,dt)};P($,Me=>{var dt;(dt=o(l))!=null&&dt.dbEnabled&&Me(we)})}var He=h($,2);let bt;var xt=h(He,2);let Rt;var ne=h(f(xt),2);{var Q=Me=>{var dt=Vue();y(Me,dt)},G=Me=>{var dt=$ue();y(Me,dt)};P(ne,Me=>{o(Pt)?Me(Q):o(Ne)&&Me(G,1)})}var de=h(xt,4),ot=h(f(de),2),Ze=f(ot),At=f(Ze);At.nodeValue="v1.53.0 ";var St=h(At);{var ze=Me=>{var dt=que();y(Me,dt)};P(St,Me=>{var dt,ti;(dt=o(l))!=null&&dt.latestVersion&&!((ti=o(l))!=null&&ti.docker)&&Me(ze)})}var Kt=h(Ze,2);{var Xt=Me=>{var dt=Zue(),ti=f(dt),$i=h(f(ti));$i.textContent="v1.53.0";var Ni=h($i,2);{var Wi=mn=>{var Zi=Uue(),qn=h(Ct(Zi)),os=f(qn);T(()=>B(os,`v${o(l).latestVersion??""}`)),y(mn,Zi)},Ut=mn=>{var Zi=Gue();y(mn,Zi)};P(Ni,mn=>{var Zi;(Zi=o(l))!=null&&Zi.latestVersion?mn(Wi):mn(Ut,-1)})}var si=h(ti,2),ki=f(si);{var Ki=mn=>{var Zi=Kue(),qn=h(f(Zi));T(()=>B(qn,` Update to v${o(l).latestVersion??""}`)),H("click",Zi,Lt),y(mn,Zi)};P(ki,mn=>{var Zi;(Zi=o(l))!=null&&Zi.latestVersion&&mn(Ki)})}var Mi=h(ki,2),_n=f(Mi);let ln;var Pn=h(_n);T(()=>{Mi.disabled=o(g),ln=Ht(_n,0,"svelte-1n46o8q",null,ln,{spinning:o(g)}),B(Pn,` ${o(g)?"Checking…":"Check for updates"}`)}),H("click",dt,mn=>mn.stopPropagation()),H("click",Mi,Pe),y(Me,dt)};P(Kt,Me=>{var dt;o(u)&&!((dt=o(l))!=null&&dt.docker)&&Me(Xt)})}var Ci=h(ot,2),Li=f(Ci),J=h(Li,2);{var We=Me=>{var dt=ihe(),ti=f(dt);{var $i=ki=>{var Ki=Jue(),Mi=f(Ki);{var _n=Gt=>{const fi=rt(()=>Math.floor((Date.now()-o(l).startedAt)/1e3)),bi=rt(()=>Math.floor(o(fi)/86400)),qi=rt(()=>Math.floor(o(fi)%86400/3600)),an=rt(()=>Math.floor(o(fi)%3600/60));var fn=Yue(),pn=h(Ct(fn)),Cn=f(pn);T(()=>B(Cn,`${o(bi)>0?o(bi)+"d ":""}${o(qi)>0||o(bi)>0?o(qi)+"h ":""}${o(an)??""}m`)),y(Gt,fn)};P(Mi,Gt=>{o(l).startedAt&&Gt(_n)})}var ln=h(Mi,3),Pn=f(ln),mn=h(ln,3),Zi=f(mn),qn=h(mn,3),os=f(qn),fs=h(qn,2);{var Xs=Gt=>{var fi=Xue(),bi=h(Ct(fi)),qi=f(bi),an=h(bi,3),fn=f(an);T(()=>{B(qi,o(l).matterNodes??0),B(fn,o(l).matterEndpoints??0)}),y(Gt,fi)};P(fs,Gt=>{o(l).matterEnabled&&Gt(Xs)})}var rs=h(fs,2);{var ro=Gt=>{var fi=Que(),bi=h(Ct(fi)),qi=f(bi),an=h(bi,3),fn=f(an);T(()=>{B(qi,o(l).dbDocs??"—"),B(fn,o(l).dbViews??"—")}),y(Gt,fi)};P(rs,Gt=>{o(l).dbEnabled&&Gt(ro)})}var Le=h(rs,3),ut=f(Le),at=h(Le,3),ni=f(at),li=h(at,3),Ii=f(li),zi=h(li,3),Tt=f(zi),Ei=h(zi,3),ui=f(Ei),Di=h(Ei,3),Bi=f(Di);T(()=>{B(Pn,o(l).scripts),B(Zi,o(l).topics),B(os,o(l).mqttMsgPerSec??"—"),B(ut,o(l).handlers??"—"),B(ni,o(l).memMb!=null?o(l).memMb+" MB":"—"),B(Ii,o(l).cpuPercent!=null?o(l).cpuPercent+" %":"—"),B(Tt,o(l).eluPercent!=null?o(l).eluPercent+" %":"—"),B(ui,o(l).elMeanMs!=null?o(l).elMeanMs+" ms":"—"),B(Bi,o(l).elMaxMs!=null?o(l).elMaxMs+" ms":"—")}),y(ki,Ki)},Ni=ki=>{var Ki=ehe();y(ki,Ki)};P(ti,ki=>{o(l)?ki($i):ki(Ni,-1)})}var Wi=h(ti,2),Ut=f(Wi);{var si=ki=>{var Ki=the();H("click",Ki,()=>{p(d,!1),Fe()}),y(ki,Ki)};P(Ut,ki=>{var Ki;(Ki=o(l))!=null&&Ki.docker||ki(si)})}H("click",dt,ki=>ki.stopPropagation()),y(Me,dt)};P(J,Me=>{o(d)&&Me(We)})}var kt=h(Ci,2);let Mt;var X=h(kt,2);{var le=Me=>{var dt=nhe();H("click",dt,O),y(Me,dt)};P(X,Me=>{o(m)==="password"&&Me(le)})}ds(Ie,Me=>p(xe,Me),()=>o(xe));var ee=h(Ie,2),fe=f(ee);ds(Fr(fe,{}),Me=>p(z,Me,!0),()=>o(z));var qe=h(fe,2);let Ae;var yt=f(qe);{let Me=rt(()=>o(s)==="scripts"),dt=rt(()=>o(s)==="scripts"?o(a):null);iJ(yt,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("scripts",ti)})}var re=h(qe,2);let ae;var W=f(re);Pne(W,{});var Y=h(re,2);let Ce;var je=f(Y);{let Me=rt(()=>o(s)==="mqtt"),dt=rt(()=>o(s)==="mqtt"?o(a):null);pne(je,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("mqtt",ti)})}var ye=h(Y,2);let it;var pt=f(ye);{let Me=rt(()=>o(s)==="matter"),dt=rt(()=>o(s)==="matter"?o(a):null);aie(pt,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("matter",ti)})}var It=h(ye,2);let Et;var Bt=f(It);{let Me=rt(()=>o(s)==="broker"),dt=rt(()=>o(s)==="broker"?o(a):null);ure(Bt,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("broker",ti)})}var Nt=h(It,2);{var Ot=Me=>{var dt=she();let ti;var $i=f(dt);{let Ni=rt(()=>o(s)==="adapters"),Wi=rt(()=>o(s)==="adapters"?o(a):null);lue($i,{onstatus:(Ut,si)=>{p(ue,Ut,!0),p($e,si,!0)},get active(){return o(Ni)},get sub(){return o(Wi)},onsub:Ut=>Vt("adapters",Ut)})}T(()=>ti=Ht(dt,1,"page-wrap svelte-1n46o8q",null,ti,{hidden:o(s)!=="adapters"})),y(Me,dt)};P(Nt,Me=>{o(nt)&&Me(Ot)})}var Qt=h(Nt,2);let Fi;var Ui=f(Qt);{let Me=rt(()=>o(s)==="secrets"),dt=rt(()=>o(s)==="secrets"?o(a):null);Fue(Ui,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("secrets",ti)})}var hi=h(Qt,2);let Ri;var Yi=f(hi);{let Me=rt(()=>o(s)==="db"),dt=rt(()=>o(s)==="db"?o(a):null);lte(Yi,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("db",ti)})}var Re=h(hi,2);let ai;var vi=f(Re);YJ(vi,{});var Vi=h(Re,2);let yi;var Jt=f(Vi);iee(Jt,{}),T(()=>{To(Dt,o(ke)?`min-width: ${o(ke)}px`:void 0),et=Ht(Se,1,"svelte-1n46o8q",null,et,{active:o(s)==="scripts"}),j=Ht(w,1,"svelte-1n46o8q",null,j,{active:o(s)==="packages"}),st=Ht(De,1,"svelte-1n46o8q",null,st,{active:o(s)==="mqtt"}),bt=Ht(He,1,"svelte-1n46o8q",null,bt,{active:o(s)==="secrets"}),Rt=Ht(xt,1,"svelte-1n46o8q",null,Rt,{active:o(s)==="logs"}),Mt=Ht(kt,1,"nav-settings svelte-1n46o8q",null,Mt,{active:o(s)==="config"}),Ae=Ht(qe,1,"page-wrap svelte-1n46o8q",null,Ae,{hidden:o(s)!=="scripts"}),ae=Ht(re,1,"page-wrap svelte-1n46o8q",null,ae,{hidden:o(s)!=="packages"}),Ce=Ht(Y,1,"page-wrap svelte-1n46o8q",null,Ce,{hidden:o(s)!=="mqtt"}),it=Ht(ye,1,"page-wrap svelte-1n46o8q",null,it,{hidden:o(s)!=="matter"}),Et=Ht(It,1,"page-wrap svelte-1n46o8q",null,Et,{hidden:o(s)!=="broker"}),Fi=Ht(Qt,1,"page-wrap svelte-1n46o8q",null,Fi,{hidden:o(s)!=="secrets"}),Ri=Ht(hi,1,"page-wrap svelte-1n46o8q",null,Ri,{hidden:o(s)!=="db"}),ai=Ht(Re,1,"page-wrap svelte-1n46o8q",null,ai,{hidden:o(s)!=="config"}),yi=Ht(Vi,1,"page-wrap svelte-1n46o8q",null,yi,{hidden:o(s)!=="logs"})}),H("click",Se,()=>vt("scripts")),H("click",w,()=>vt("packages")),H("click",De,()=>vt("mqtt")),H("click",He,()=>vt("secrets")),H("click",xt,()=>{vt("logs"),p(Pt,!1),p(Ne,!1)}),H("click",Ze,Me=>{Me.stopPropagation(),p(u,!o(u)),p(d,!1)}),H("click",Li,Me=>{Me.stopPropagation(),p(d,!o(d)),p(u,!1)}),H("click",kt,()=>vt("config")),y(Je,Dt)};P(lt,Je=>{o(M)&&!o(_)&&Je(zt)})}var Ft=h(lt,2);{var oi=Je=>{var Dt=ahe(),_t=f(Dt),$t=h(f(_t),4),Ie=h(f($t),2),Se=h($t,2);{var et=te=>{var _e=rhe(),De=f(_e);T(()=>B(De,o(k))),y(te,_e)};P(Se,te=>{o(k)&&te(et)})}var w=h(Se,2),j=f(w);T(()=>{Ie.disabled=o(I),w.disabled=o(I)||!o(E),B(j,o(I)?"Signing in…":"Sign in")}),Ls("submit",_t,te=>{te.preventDefault(),N()}),ci(Ie,()=>o(E),te=>p(E,te)),y(Je,Dt)};P(Ft,Je=>{o(_)&&Je(oi)})}var Z=h(Ft,2);{var oe=Je=>{var Dt=lhe();y(Je,Dt)};P(Z,Je=>{o(U)&&Je(oe)})}var ce=h(Z,2);{var ct=Je=>{var Dt=che();y(Je,Dt)};P(ce,Je=>{o(x)&&Je(ct)})}y(r,Oe),bs()}ks(["click"]);CM(uhe,{target:document.getElementById("app")});export{z3 as t};
|
|
298
|
+
`)||o(_)||!o(m)),Wt=xt=>{var Rt=Sue();T(()=>Rt.disabled=o(N)),ci(Rt,()=>o(x),ne=>p(x,ne)),y(xt,Rt)};P(Ge,xt=>{o(wt)?xt(ht):xt(Wt,-1)})}var Be=h(Ge,2),ft=h(et,2),$=f(ft),we=f($),He=h($,2),bt=f(He);T((xt,Rt)=>{B(Je,o(M).name),B(_t,`changed ${xt??""}`),Se.disabled=o(d)||o(N),De.disabled=o(N),mt=Ht(Ke,1,"lock svelte-1az45ix",null,mt,{"is-secret":o(m)}),Ke.disabled=o(N),_i(Ke,"title",o(m)?"secret — write-only once saved (click for a plain field, e.g. a user name)":"plain — shown in clear (click for a secret)"),Be.disabled=Rt,B(we,`she.secrets.get('${o(M).name??""}/<field>')`),B(bt,`she.secrets.get('${o(M).name??""}')`)},[()=>Ve(o(M).changed),()=>o(d)||o(N)||!o(g).trim()||!o(x)]),As(Ie,()=>o(_),xt=>p(_,xt)),H("click",Se,()=>he(o(M).name)),ci(De,()=>o(g),xt=>p(g,xt)),Ls("submit",V,xt=>{xt.preventDefault(),I.test(o(g).trim())?q(o(M).name,o(g).trim(),o(x),o(m)):p(a,"field name: letters, digits, _ . - (max 64)")}),H("click",Ke,()=>p(m,!o(m))),y(Z,oe)},oi=Z=>{var oe=Aue(),ce=f(oe);{var ct=Dt=>{var _t=Due();y(Dt,_t)},Je=Dt=>{var _t=Ln("Select a group.");y(Dt,_t)};P(ce,Dt=>{o(n).groups.length===0?Dt(ct):Dt(Je,-1)})}y(Z,oe)};P(zt,Z=>{o(M)?Z(Ft):o(n)&&!o(N)&&Z(oi,1)})}T(Z=>{Vt.disabled=o(N),Oe.disabled=Z},[()=>o(N)||!o(u).trim()]),H("click",Fe,O),Ls("submit",ii,Z=>{Z.preventDefault(),se()}),ci(Vt,()=>o(u),Z=>p(u,Z)),y(r,nt),bs()}ks(["click","input"]);var Lue=S('<div class="safe-banner svelte-1n46o8q"><strong class="svelte-1n46o8q">⚠ SAFE MODE</strong> — no user script is running and the script directory is not watched. She was killed instead of stopped last time, which usually means a script blocked the event loop. Edit or delete it, then restart. <button class="safe-restart svelte-1n46o8q">Restart daemon</button></div>'),e6=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),Iue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),Pue=S('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),Tue=S('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),Mue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" class="svelte-1n46o8q"><path d="M8.36,5.73 A2.6,2.6 0 0,1 9.38,10.50" class="svelte-1n46o8q"></path><path d="M7.64,5.73 A2.6,2.6 0 0,0 6.62,10.50" class="svelte-1n46o8q"></path><path d="M9.16,3.95 A4.5,4.5 0 0,1 10.38,12.12" class="svelte-1n46o8q"></path><path d="M6.84,3.95 A4.5,4.5 0 0,0 5.62,12.12" class="svelte-1n46o8q"></path><path d="M10.40,2.37 A6.4,6.4 0 0,1 11.39,13.73" class="svelte-1n46o8q"></path><path d="M5.60,2.37 A6.4,6.4 0 0,0 4.61,13.73" class="svelte-1n46o8q"></path><path d="M7.15,8.3 L8,15.4 L8.85,8.3 Z" fill="currentColor" stroke="none" class="svelte-1n46o8q"></path><circle cx="8" cy="8.3" r="1.45" fill="currentColor" stroke="none" class="svelte-1n46o8q"></circle></svg> Broker</button>'),Rue=S('<span class="nav-dot nav-dot--none svelte-1n46o8q"></span>'),Nue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="2" y="2" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><rect x="2" y="10" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><circle cx="4.5" cy="4" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle><circle cx="4.5" cy="12" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle></svg> Adapters <!></button>'),Oue=S('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),Hue=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),zue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),Wue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M8,2 L8,7" class="svelte-1n46o8q"></path><path d="M6,5 L8,7.5 L10,5" class="svelte-1n46o8q"></path><path d="M2.5,14 L6,10" class="svelte-1n46o8q"></path><path d="M6.2,12.8 L6,10 L3.2,10.2" class="svelte-1n46o8q"></path><path d="M13.5,14 L10,10" class="svelte-1n46o8q"></path><path d="M9.8,12.8 L10,10 L12.8,10.2" class="svelte-1n46o8q"></path></svg> Matter <!></button>'),jue=S('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><ellipse cx="8" cy="4.5" rx="5" ry="1.8" class="svelte-1n46o8q"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7" class="svelte-1n46o8q"></path><path d="M3,8 a5,1.8 0,0,0 10,0" class="svelte-1n46o8q"></path></svg> DB</button>'),Vue=S('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),$ue=S('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),que=S('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),Uue=S('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),Gue=S('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),Kue=S('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button>'),Zue=S('<div class="version-popup svelte-1n46o8q"><dl class="svelte-1n46o8q"><dt class="svelte-1n46o8q">Installed</dt><dd class="svelte-1n46o8q"></dd> <!></dl> <div class="version-actions svelte-1n46o8q"><!> <button class="check-btn svelte-1n46o8q" title="Check for updates now"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button></div></div>'),Yue=S('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),Xue=S('<dt class="svelte-1n46o8q">Matter nodes</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Matter endpoints</dt><dd class="svelte-1n46o8q"> </dd>',1),Que=S('<dt class="svelte-1n46o8q">DB docs</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">DB views</dt><dd class="svelte-1n46o8q"> </dd>',1),Jue=S('<dl class="svelte-1n46o8q"><!> <dt class="svelte-1n46o8q">Scripts</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT topics</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT msg/s</dt><dd class="svelte-1n46o8q"> </dd> <!> <!> <dt class="svelte-1n46o8q">Handlers</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Memory</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">CPU</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL util</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag mean</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag max</dt><dd class="svelte-1n46o8q"> </dd></dl>'),ehe=S('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),the=S('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M18.36 6.64a9 9 0 1 1-12.73 0" class="svelte-1n46o8q"></path><line x1="12" y1="2" x2="12" y2="12" class="svelte-1n46o8q"></line></svg> Restart daemon</button>'),ihe=S('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),nhe=S('<button class="nav-logout svelte-1n46o8q" title="Logout"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" class="svelte-1n46o8q"></path><polyline points="16 17 21 12 16 7" class="svelte-1n46o8q"></polyline><line x1="21" y1="12" x2="9" y2="12" class="svelte-1n46o8q"></line></svg></button>'),she=S("<div><!></div>"),ohe=S('<div class="shell svelte-1n46o8q"><!> <nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="5,3 1,8 5,13" class="svelte-1n46o8q"></polyline><polyline points="11,3 15,8 11,13" class="svelte-1n46o8q"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" class="svelte-1n46o8q"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1" class="svelte-1n46o8q"></rect><path d="M2,11 V5 H5 V11" class="svelte-1n46o8q"></path><path d="M6,12 V5 H9 V8 H6" class="svelte-1n46o8q"></path><path d="M10,11 V5 H15 V11" class="svelte-1n46o8q"></path><line x1="12.5" y1="5" x2="12.5" y2="11" class="svelte-1n46o8q"></line></svg> Packages <!></button> <button><svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle" class="svelte-1n46o8q"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z" class="svelte-1n46o8q"></path></svg> MQTT <!></button> <!> <!> <!> <!> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="3" y="7" width="10" height="7" rx="1.5" class="svelte-1n46o8q"></rect><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" class="svelte-1n46o8q"></path><circle cx="8" cy="9.9" r="1.15" stroke-width="1.1" class="svelte-1n46o8q"></circle><path d="M8 11v1.2" stroke-width="1.1" class="svelte-1n46o8q"></path></svg> Secrets</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" class="svelte-1n46o8q"><line x1="2" y1="5" x2="14" y2="5" class="svelte-1n46o8q"></line><line x1="2" y1="8" x2="14" y2="8" class="svelte-1n46o8q"></line><line x1="2" y1="11" x2="9" y2="11" class="svelte-1n46o8q"></line></svg> Logs <!></button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" class="svelte-1n46o8q"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><line x1="18" y1="20" x2="18" y2="10" class="svelte-1n46o8q"></line><line x1="12" y1="20" x2="12" y2="4" class="svelte-1n46o8q"></line><line x1="6" y1="20" x2="6" y2="14" class="svelte-1n46o8q"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" class="svelte-1n46o8q"></path><circle cx="12" cy="12" r="3" class="svelte-1n46o8q"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <!> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),rhe=S('<div class="login-error svelte-1n46o8q"> </div>'),ahe=S('<div class="login-overlay svelte-1n46o8q"><form class="login-box svelte-1n46o8q"><div class="login-brand svelte-1n46o8q">she</div> <h2 class="svelte-1n46o8q">Sign in</h2> <div class="login-field svelte-1n46o8q"><label for="she-password" class="svelte-1n46o8q">Password</label> <input id="she-password" type="password" placeholder="Enter password" autocomplete="current-password" class="svelte-1n46o8q"/></div> <!> <button type="submit" class="login-btn svelte-1n46o8q"> </button></form></div>'),lhe=S('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Restarting smart-home-engine…</div></div>'),che=S('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Updating smart-home-engine…</div></div>'),dhe=S("<!> <!> <!> <!>",1);function uhe(r,e){_s(e,!0);const t=["scripts","mqtt","matter","broker","adapters","secrets","db","logs","config","packages"],i={services:"adapters",security:"broker"};function n(){const Je=location.hash.replace(/^#\/?/,""),[Dt,..._t]=Je.split("/"),$t=i[Dt]??Dt;if(!t.includes($t))return{page:"scripts",sub:null};const Ie=_t.map(Se=>{try{return decodeURIComponent(Se)}catch{return Se}}).join("/");return{page:$t,sub:Ie||null}}let s=A(wi(n().page)),a=A(wi(n().sub)),l=A(null),d=A(!1),u=A(!1),g=A(!1),x=A(!1),m=A("none"),C=A(""),_=A(!1),E=A(""),k=A(""),I=A(!1),M=A(!1);sG(()=>{p(_,!0)});async function N(){p(k,""),p(I,!0);try{await aG(o(E)),p(E,""),p(_,!1)}catch(Je){p(k,Je.message??"Login failed",!0)}finally{p(I,!1)}}async function O(){if(o(m)==="proxy"&&o(C)){window.location.href=o(C);return}await lG(),p(_,!0)}let z=A(null),U=A(!1),q=A(!1),se=A(!1),Ee=A(!1),ge=A(wi([])),he=A(0),Ve=A(!1),nt=A(!1),ue=A("none"),$e=A(""),me=A(wi([]));const Xe=rt(()=>o(me).filter(Je=>Je.online).length),be=rt(()=>o(me).length===0?"none":o(Xe)===o(me).length?"all":o(Xe)>0?"some":"offline");let Pt=A(!1),Ne=A(!1);async function Fe(){if(!await o(z).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;p(U,!0);let Je;try{Je=(await Gc()).startedAt}catch{}try{await bB()}catch{}const Dt=Date.now()+6e4;for(;Date.now()<Dt;){await new Promise(_t=>setTimeout(_t,250));try{const _t=await Gc();if(Je===void 0||_t.startedAt!==Je){location.reload();return}}catch{}}location.reload()}async function Pe(){p(g,!0);try{const Je=await vG();o(l)&&p(l,{...o(l),latestVersion:Je.latestVersion??void 0},!0)}catch{}finally{p(g,!1)}}async function Lt(){var _t,$t;if(!await o(z).show(`Update to v${(_t=o(l))==null?void 0:_t.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;p(u,!1),p(x,!0);const Je=($t=o(l))==null?void 0:$t.startedAt;try{await gG()}catch{}const Dt=Date.now()+18e4;for(;Date.now()<Dt;){await new Promise(Ie=>setTimeout(Ie,1e3));try{const Ie=await Gc();if(Je===void 0||Ie.startedAt!==Je){location.reload();return}}catch{p(x,!1),p(U,!0)}}location.reload()}let xe=A(void 0),ke=A(0);function Te(){if(!o(xe))return;const Je=getComputedStyle(o(xe)),Dt=parseFloat(Je.columnGap)||0,_t=[...o(xe).children];let $t=parseFloat(Je.paddingLeft)+parseFloat(Je.paddingRight)+Dt*Math.max(0,_t.length-1);for(const Se of _t)Se.classList.contains("nav-spacer")||($t+=Se.getBoundingClientRect().width);const Ie=Math.ceil($t)+8;Ie>0&&Ie!==o(ke)&&p(ke,Ie)}let Qe=null;function Ue(){if(!(!o(xe)||!Qe)){Qe.disconnect(),Qe.observe(o(xe));for(const Je of o(xe).children)Qe.observe(Je);Te()}}Vs(()=>(Qe=new ResizeObserver(()=>Te()),Ue(),()=>{Qe==null||Qe.disconnect(),Qe=null})),cn(()=>{var Je,Dt,_t,$t;o(Ve),o(nt),(Je=o(l))==null||Je.matterEnabled,(Dt=o(l))==null||Dt.dbEnabled,(_t=o(l))==null||_t.latestVersion,($t=o(l))==null||$t.docker,va().then(()=>Io(Ue))});function vt(Je){p(s,Je,!0),p(a,null),location.hash=ii(Je,null)}function ii(Je,Dt){const _t=Dt?Dt.split("/").map(encodeURIComponent).join("/"):"";return`#/${Je}${_t?"/"+_t:""}`}function Vt(Je,Dt){const _t=Dt||null;o(s)!==Je||o(a)===_t||(p(a,_t,!0),history.replaceState(null,"",ii(Je,_t)))}Vs(async()=>{const Je=ii(o(s),o(a));location.hash!==Je&&history.replaceState(null,"",Je);const Dt=()=>{const _e=n();p(s,_e.page,!0),p(a,_e.sub,!0)};window.addEventListener("hashchange",Dt);const _t=()=>{document.visibilityState==="visible"&&(gZ(),Gc().then(_e=>{p(l,_e,!0)}).catch(()=>{}),requestAnimationFrame(()=>{document.body.style.display="none",document.body.offsetHeight,document.body.style.display="",window.dispatchEvent(new Event("she:visible"))}))};document.addEventListener("visibilitychange",_t);try{const _e=await rG();p(m,_e.mode,!0),p(C,_e.proxyLogoutUrl??"",!0),o(m)==="password"&&(await fetch("/she/scripts")).status===401&&p(_,!0)}catch{}p(M,!0);async function $t(){var _e,De,st,V;try{p(l,await Gc(),!0)}catch{}try{const[Ke,mt]=await Promise.all([wB(),Ec()]);p(ge,Array.isArray(mt.pinnedPackages)?mt.pinnedPackages:[],!0),p(he,Object.keys(Ke).filter(ht=>!o(ge).includes(ht)).length,!0);const ve=o(Ve);p(Ve,((_e=mt.broker)==null?void 0:_e.enabled)===!0),ve&&!o(Ve)&&o(s)==="broker"&&vt("scripts");const Ge=o(nt);p(nt,((De=mt.services)==null?void 0:De.enabled)===!0),Ge&&!o(nt)&&o(s)==="adapters"&&vt("scripts")}catch{}!((st=o(l))!=null&&st.matterEnabled)&&o(s)==="matter"&&vt("scripts"),!((V=o(l))!=null&&V.dbEnabled)&&o(s)==="db"&&vt("scripts")}$t();const Ie=setInterval($t,5e3),Se=tr("mqtt:status",_e=>{_e.connected===!1?(p(Ee,!0),p(q,!1),p(se,!1)):(p(Ee,!1),p(q,_e.ready===!1),p(se,_e.ready===!0))}),et=tr("matter:deviceList",_e=>{Array.isArray(_e.devices)&&p(me,_e.devices.map(De=>({nodeId:String(De.nodeId),online:!!De.online})),!0)}),w=tr("matter:deviceStatus",_e=>{if(_e.nodeId===void 0)return;const De=String(_e.nodeId),st=!!_e.online;p(me,o(me).map(V=>V.nodeId===De?{...V,online:st}:V),!0)}),j=IB();p(Pt,j.some(_e=>_e.level==="error"),!0),p(Ne,!o(Pt)&&j.some(_e=>_e.level==="warn"),!0);const te=u2(_e=>{_e.level==="error"?(p(Pt,!0),p(Ne,!1)):_e.level==="warn"&&!o(Pt)&&p(Ne,!0)});return()=>{window.removeEventListener("hashchange",Dt),document.removeEventListener("visibilitychange",_t),clearInterval(Ie),Se(),et(),w(),te()}});var Oe=dhe();Ls("click",r3,()=>{o(d)&&p(d,!1),o(u)&&p(u,!1)});var lt=Ct(Oe);{var zt=Je=>{var Dt=ohe(),_t=f(Dt);{var $t=Me=>{var dt=Lue(),ti=h(f(dt),2);H("click",ti,Fe),y(Me,dt)};P(_t,Me=>{var dt;(dt=o(l))!=null&&dt.safeMode&&Me($t)})}var Ie=h(_t,2),Se=h(f(Ie),2);let et;var w=h(Se,2);let j;var te=h(f(w),2);{var _e=Me=>{var dt=e6();T(()=>_i(dt,"title",`${o(he)??""} package update${o(he)===1?"":"s"} available`)),y(Me,dt)};P(te,Me=>{o(he)>0&&Me(_e)})}var De=h(w,2);let st;var V=h(f(De),2);{var Ke=Me=>{var dt=Iue();y(Me,dt)},mt=Me=>{var dt=Pue();y(Me,dt)},ve=Me=>{var dt=Tue();y(Me,dt)};P(V,Me=>{o(Ee)?Me(Ke):o(q)?Me(mt,1):o(se)&&Me(ve,2)})}var Ge=h(De,2);{var ht=Me=>{var dt=Mue();let ti;T(()=>ti=Ht(dt,1,"svelte-1n46o8q",null,ti,{active:o(s)==="broker"})),H("click",dt,()=>vt("broker")),y(Me,dt)};P(Ge,Me=>{o(Ve)&&Me(ht)})}var wt=h(Ge,2);{var Wt=Me=>{var dt=Nue();let ti;var $i=h(f(dt),2);{var Ni=Ut=>{var si=e6();T(()=>_i(si,"title",o($e))),y(Ut,si)},Wi=Ut=>{var si=Rue();y(Ut,si)};P($i,Ut=>{o(ue)==="warn"?Ut(Ni):Ut(Wi,-1)})}T(()=>ti=Ht(dt,1,"svelte-1n46o8q",null,ti,{active:o(s)==="adapters"})),H("click",dt,()=>vt("adapters")),y(Me,dt)};P(wt,Me=>{o(nt)&&Me(Wt)})}var Be=h(wt,2);{var ft=Me=>{var dt=Wue();let ti;var $i=h(f(dt),2);{var Ni=si=>{var ki=Oue();y(si,ki)},Wi=si=>{var ki=Hue();y(si,ki)},Ut=si=>{var ki=zue();y(si,ki)};P($i,si=>{o(be)==="all"?si(Ni):o(be)==="some"?si(Wi,1):o(be)==="offline"&&si(Ut,2)})}T(()=>ti=Ht(dt,1,"svelte-1n46o8q",null,ti,{active:o(s)==="matter"})),H("click",dt,()=>vt("matter")),y(Me,dt)};P(Be,Me=>{var dt;(dt=o(l))!=null&&dt.matterEnabled&&Me(ft)})}var $=h(Be,2);{var we=Me=>{var dt=jue();let ti;T(()=>ti=Ht(dt,1,"svelte-1n46o8q",null,ti,{active:o(s)==="db"})),H("click",dt,()=>vt("db")),y(Me,dt)};P($,Me=>{var dt;(dt=o(l))!=null&&dt.dbEnabled&&Me(we)})}var He=h($,2);let bt;var xt=h(He,2);let Rt;var ne=h(f(xt),2);{var Q=Me=>{var dt=Vue();y(Me,dt)},G=Me=>{var dt=$ue();y(Me,dt)};P(ne,Me=>{o(Pt)?Me(Q):o(Ne)&&Me(G,1)})}var de=h(xt,4),ot=h(f(de),2),Ze=f(ot),At=f(Ze);At.nodeValue="v1.53.1 ";var St=h(At);{var ze=Me=>{var dt=que();y(Me,dt)};P(St,Me=>{var dt,ti;(dt=o(l))!=null&&dt.latestVersion&&!((ti=o(l))!=null&&ti.docker)&&Me(ze)})}var Kt=h(Ze,2);{var Xt=Me=>{var dt=Zue(),ti=f(dt),$i=h(f(ti));$i.textContent="v1.53.1";var Ni=h($i,2);{var Wi=mn=>{var Zi=Uue(),qn=h(Ct(Zi)),os=f(qn);T(()=>B(os,`v${o(l).latestVersion??""}`)),y(mn,Zi)},Ut=mn=>{var Zi=Gue();y(mn,Zi)};P(Ni,mn=>{var Zi;(Zi=o(l))!=null&&Zi.latestVersion?mn(Wi):mn(Ut,-1)})}var si=h(ti,2),ki=f(si);{var Ki=mn=>{var Zi=Kue(),qn=h(f(Zi));T(()=>B(qn,` Update to v${o(l).latestVersion??""}`)),H("click",Zi,Lt),y(mn,Zi)};P(ki,mn=>{var Zi;(Zi=o(l))!=null&&Zi.latestVersion&&mn(Ki)})}var Mi=h(ki,2),_n=f(Mi);let ln;var Pn=h(_n);T(()=>{Mi.disabled=o(g),ln=Ht(_n,0,"svelte-1n46o8q",null,ln,{spinning:o(g)}),B(Pn,` ${o(g)?"Checking…":"Check for updates"}`)}),H("click",dt,mn=>mn.stopPropagation()),H("click",Mi,Pe),y(Me,dt)};P(Kt,Me=>{var dt;o(u)&&!((dt=o(l))!=null&&dt.docker)&&Me(Xt)})}var Ci=h(ot,2),Li=f(Ci),J=h(Li,2);{var We=Me=>{var dt=ihe(),ti=f(dt);{var $i=ki=>{var Ki=Jue(),Mi=f(Ki);{var _n=Gt=>{const fi=rt(()=>Math.floor((Date.now()-o(l).startedAt)/1e3)),bi=rt(()=>Math.floor(o(fi)/86400)),qi=rt(()=>Math.floor(o(fi)%86400/3600)),an=rt(()=>Math.floor(o(fi)%3600/60));var fn=Yue(),pn=h(Ct(fn)),Cn=f(pn);T(()=>B(Cn,`${o(bi)>0?o(bi)+"d ":""}${o(qi)>0||o(bi)>0?o(qi)+"h ":""}${o(an)??""}m`)),y(Gt,fn)};P(Mi,Gt=>{o(l).startedAt&&Gt(_n)})}var ln=h(Mi,3),Pn=f(ln),mn=h(ln,3),Zi=f(mn),qn=h(mn,3),os=f(qn),fs=h(qn,2);{var Xs=Gt=>{var fi=Xue(),bi=h(Ct(fi)),qi=f(bi),an=h(bi,3),fn=f(an);T(()=>{B(qi,o(l).matterNodes??0),B(fn,o(l).matterEndpoints??0)}),y(Gt,fi)};P(fs,Gt=>{o(l).matterEnabled&&Gt(Xs)})}var rs=h(fs,2);{var ro=Gt=>{var fi=Que(),bi=h(Ct(fi)),qi=f(bi),an=h(bi,3),fn=f(an);T(()=>{B(qi,o(l).dbDocs??"—"),B(fn,o(l).dbViews??"—")}),y(Gt,fi)};P(rs,Gt=>{o(l).dbEnabled&&Gt(ro)})}var Le=h(rs,3),ut=f(Le),at=h(Le,3),ni=f(at),li=h(at,3),Ii=f(li),zi=h(li,3),Tt=f(zi),Ei=h(zi,3),ui=f(Ei),Di=h(Ei,3),Bi=f(Di);T(()=>{B(Pn,o(l).scripts),B(Zi,o(l).topics),B(os,o(l).mqttMsgPerSec??"—"),B(ut,o(l).handlers??"—"),B(ni,o(l).memMb!=null?o(l).memMb+" MB":"—"),B(Ii,o(l).cpuPercent!=null?o(l).cpuPercent+" %":"—"),B(Tt,o(l).eluPercent!=null?o(l).eluPercent+" %":"—"),B(ui,o(l).elMeanMs!=null?o(l).elMeanMs+" ms":"—"),B(Bi,o(l).elMaxMs!=null?o(l).elMaxMs+" ms":"—")}),y(ki,Ki)},Ni=ki=>{var Ki=ehe();y(ki,Ki)};P(ti,ki=>{o(l)?ki($i):ki(Ni,-1)})}var Wi=h(ti,2),Ut=f(Wi);{var si=ki=>{var Ki=the();H("click",Ki,()=>{p(d,!1),Fe()}),y(ki,Ki)};P(Ut,ki=>{var Ki;(Ki=o(l))!=null&&Ki.docker||ki(si)})}H("click",dt,ki=>ki.stopPropagation()),y(Me,dt)};P(J,Me=>{o(d)&&Me(We)})}var kt=h(Ci,2);let Mt;var X=h(kt,2);{var le=Me=>{var dt=nhe();H("click",dt,O),y(Me,dt)};P(X,Me=>{o(m)==="password"&&Me(le)})}ds(Ie,Me=>p(xe,Me),()=>o(xe));var ee=h(Ie,2),fe=f(ee);ds(Fr(fe,{}),Me=>p(z,Me,!0),()=>o(z));var qe=h(fe,2);let Ae;var yt=f(qe);{let Me=rt(()=>o(s)==="scripts"),dt=rt(()=>o(s)==="scripts"?o(a):null);iJ(yt,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("scripts",ti)})}var re=h(qe,2);let ae;var W=f(re);Pne(W,{});var Y=h(re,2);let Ce;var je=f(Y);{let Me=rt(()=>o(s)==="mqtt"),dt=rt(()=>o(s)==="mqtt"?o(a):null);pne(je,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("mqtt",ti)})}var ye=h(Y,2);let it;var pt=f(ye);{let Me=rt(()=>o(s)==="matter"),dt=rt(()=>o(s)==="matter"?o(a):null);aie(pt,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("matter",ti)})}var It=h(ye,2);let Et;var Bt=f(It);{let Me=rt(()=>o(s)==="broker"),dt=rt(()=>o(s)==="broker"?o(a):null);ure(Bt,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("broker",ti)})}var Nt=h(It,2);{var Ot=Me=>{var dt=she();let ti;var $i=f(dt);{let Ni=rt(()=>o(s)==="adapters"),Wi=rt(()=>o(s)==="adapters"?o(a):null);lue($i,{onstatus:(Ut,si)=>{p(ue,Ut,!0),p($e,si,!0)},get active(){return o(Ni)},get sub(){return o(Wi)},onsub:Ut=>Vt("adapters",Ut)})}T(()=>ti=Ht(dt,1,"page-wrap svelte-1n46o8q",null,ti,{hidden:o(s)!=="adapters"})),y(Me,dt)};P(Nt,Me=>{o(nt)&&Me(Ot)})}var Qt=h(Nt,2);let Fi;var Ui=f(Qt);{let Me=rt(()=>o(s)==="secrets"),dt=rt(()=>o(s)==="secrets"?o(a):null);Fue(Ui,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("secrets",ti)})}var hi=h(Qt,2);let Ri;var Yi=f(hi);{let Me=rt(()=>o(s)==="db"),dt=rt(()=>o(s)==="db"?o(a):null);lte(Yi,{get active(){return o(Me)},get sub(){return o(dt)},onsub:ti=>Vt("db",ti)})}var Re=h(hi,2);let ai;var vi=f(Re);YJ(vi,{});var Vi=h(Re,2);let yi;var Jt=f(Vi);iee(Jt,{}),T(()=>{To(Dt,o(ke)?`min-width: ${o(ke)}px`:void 0),et=Ht(Se,1,"svelte-1n46o8q",null,et,{active:o(s)==="scripts"}),j=Ht(w,1,"svelte-1n46o8q",null,j,{active:o(s)==="packages"}),st=Ht(De,1,"svelte-1n46o8q",null,st,{active:o(s)==="mqtt"}),bt=Ht(He,1,"svelte-1n46o8q",null,bt,{active:o(s)==="secrets"}),Rt=Ht(xt,1,"svelte-1n46o8q",null,Rt,{active:o(s)==="logs"}),Mt=Ht(kt,1,"nav-settings svelte-1n46o8q",null,Mt,{active:o(s)==="config"}),Ae=Ht(qe,1,"page-wrap svelte-1n46o8q",null,Ae,{hidden:o(s)!=="scripts"}),ae=Ht(re,1,"page-wrap svelte-1n46o8q",null,ae,{hidden:o(s)!=="packages"}),Ce=Ht(Y,1,"page-wrap svelte-1n46o8q",null,Ce,{hidden:o(s)!=="mqtt"}),it=Ht(ye,1,"page-wrap svelte-1n46o8q",null,it,{hidden:o(s)!=="matter"}),Et=Ht(It,1,"page-wrap svelte-1n46o8q",null,Et,{hidden:o(s)!=="broker"}),Fi=Ht(Qt,1,"page-wrap svelte-1n46o8q",null,Fi,{hidden:o(s)!=="secrets"}),Ri=Ht(hi,1,"page-wrap svelte-1n46o8q",null,Ri,{hidden:o(s)!=="db"}),ai=Ht(Re,1,"page-wrap svelte-1n46o8q",null,ai,{hidden:o(s)!=="config"}),yi=Ht(Vi,1,"page-wrap svelte-1n46o8q",null,yi,{hidden:o(s)!=="logs"})}),H("click",Se,()=>vt("scripts")),H("click",w,()=>vt("packages")),H("click",De,()=>vt("mqtt")),H("click",He,()=>vt("secrets")),H("click",xt,()=>{vt("logs"),p(Pt,!1),p(Ne,!1)}),H("click",Ze,Me=>{Me.stopPropagation(),p(u,!o(u)),p(d,!1)}),H("click",Li,Me=>{Me.stopPropagation(),p(d,!o(d)),p(u,!1)}),H("click",kt,()=>vt("config")),y(Je,Dt)};P(lt,Je=>{o(M)&&!o(_)&&Je(zt)})}var Ft=h(lt,2);{var oi=Je=>{var Dt=ahe(),_t=f(Dt),$t=h(f(_t),4),Ie=h(f($t),2),Se=h($t,2);{var et=te=>{var _e=rhe(),De=f(_e);T(()=>B(De,o(k))),y(te,_e)};P(Se,te=>{o(k)&&te(et)})}var w=h(Se,2),j=f(w);T(()=>{Ie.disabled=o(I),w.disabled=o(I)||!o(E),B(j,o(I)?"Signing in…":"Sign in")}),Ls("submit",_t,te=>{te.preventDefault(),N()}),ci(Ie,()=>o(E),te=>p(E,te)),y(Je,Dt)};P(Ft,Je=>{o(_)&&Je(oi)})}var Z=h(Ft,2);{var oe=Je=>{var Dt=lhe();y(Je,Dt)};P(Z,Je=>{o(U)&&Je(oe)})}var ce=h(Z,2);{var ct=Je=>{var Dt=che();y(Je,Dt)};P(ce,Je=>{o(x)&&Je(ct)})}y(r,Oe),bs()}ks(["click"]);CM(uhe,{target:document.getElementById("app")});export{z3 as t};
|