smart-home-engine 1.20.8 → 1.20.9
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-tUihOf0o.js","assets/monaco-langs-Dt8a9eeo.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-tUihOf0o.js","assets/monaco-langs-Dt8a9eeo.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-HwpLJXZi.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var c3=Object.defineProperty;var LS=o=>{throw TypeError(o)};var d3=(o,e,t)=>e in o?c3(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var Un=(o,e,t)=>d3(o,typeof e!="symbol"?e+"":e,t),Kb=(o,e,t)=>e.has(o)||LS("Cannot "+t);var ke=(o,e,t)=>(Kb(o,e,"read from private field"),t?t.call(o):e.get(o)),Mn=(o,e,t)=>e.has(o)?LS("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Rn=(o,e,t,i)=>(Kb(o,e,"write to private field"),i?i.call(o,t):e.set(o,t),t),ys=(o,e,t)=>(Kb(o,e,"access private method"),t);import{_ as uA,m as hA,l as Ei,A as Ko,C as Ue,I as Ds,D as Mp,a as $s,g as fA,M as oi,b as tn,E as Sa,c as K,r as as,d as ta,e as S,f as u3,h as Cs,R as Nn,S as Xi,i as Fo,j as ia,k as Gn,n as Sn,o as Ne,p as Ct,K as Zs,q as mi,s as Ot,t as io,u as ee,v as Tn,O as tl,w as Qs,P as wi,x as Zb,y as Rp,z as gA,B as Ll,F as Da,G as YC,H as vo,U as ds,J as qf,L as Si,N as Nl,Q as h3,T as jo,V as QC,W as f3,X as pA,$ as xi,Y as Qn,Z as qn,a0 as Ls,a1 as gn,a2 as Er,a3 as Wg,a4 as Nt,a5 as Qx,a6 as g3,a7 as p3,a8 as to,a9 as x3,aa as Aa,ab as Zo,ac as Ii,ad as xA,ae as ws,af as v3,ag as m3,ah as Uo,ai as E0,aj as Xs,ak as j_,al as Ho,am as dd,an as Dw,ao as $_,ap as fo,aq as Gf,ar as go,as as U_,at as q_,au as _3,av as Np,aw as y0,ax as Kl,ay as b3,az as w0,aA as C3,aB as Aw,aC as E3,aD as y3,aE as IS,aF as js,aG as Il,aH as Wo,aI as _n,aJ as Al,aK as w3,aL as ol,aM as _r,aN as lo,aO as ka,aP as kw,aQ as so,aR as Ws,aS as Av,aT as mn,aU as vA,aV as S3,aW as Bw,aX as G_,aY as Fw,aZ as Lw,a_ as jd,a$ as D3,b0 as Iw,b1 as A3,b2 as Pw,b3 as Zl,b4 as Xl,b5 as Kf,b6 as zg,b7 as ar,b8 as Op,b9 as kv,ba as Xb,bb as ps,bc as Tw,bd as Hp,be as K_,bf as k3,bg as mA,bh as Vg,bi as Zf,bj as jg,bk as Wp,bl as Z_,bm as Yn,bn as ud,bo as zp,bp as B3,bq as F3,br as Mw,bs as L3,bt as Bv,bu as Mr,bv as Rw,bw as Xf,bx as Yl,by as S0,bz as Fn,bA as Yf,bB as _A,bC as Vp,bD as I3,bE as $d,bF as ai,bG as PS,bH as Jx,bI as bA,bJ as oa,bK as Ca,bL as ms,bM as Qf,bN as Zr,bO as Jf,bP as Fs,bQ as $g,bR as ah,bS as JC,bT as CA,bU as EA,bV as yA,bW as Nw,bX as er,bY as os,bZ as jp,b_ as wA,b$ as Pl,c0 as X_,c1 as P3,c2 as nf,c3 as TS,c4 as $p,c5 as SA,c6 as sf,c7 as T3,c8 as Vr,c9 as Y_,ca as M3,cb as Xo,cc as Ba,cd as Up,ce as Ug,cf as DA,cg as Ir,ch as qp,ci as Q_,cj as R3,ck as N3,cl as O3,cm as D0,cn as rl,co,cp as H3,cq as Ow,cr as W3,cs as z3,ct as MS,cu as V3,cv as Gp,cw as Ol,cx as e1,cy as zu,cz as Hl,cA as j3,cB as il,cC as Xr,cD as pr,cE as RS,cF as Po,cG as Kp,cH as td,cI as al,cJ as $3,cK as Fa,cL as qg,cM as J_,cN as AA,cO as U3,cP as q3,cQ as Hw,cR as G3,cS as Gg,cT as K3,cU as kc,cV as Kg,cW as NS,cX as Z3,cY as X3,cZ as dl,c_ as Y3,c$ as Ww,d0 as kA,d1 as BA,d2 as FA,d3 as LA,d4 as Q3,d5 as J3,d6 as IA,d7 as PA,d8 as e4,d9 as zw,da as t4,db as i4,dc as Is,dd as n4,de as Vw,df as s4,dg as of,dh as OS,di as o4,dj as r4,dk as a4,dl as l4,dm as c4,dn as d4,dp as e0,dq as eb,dr as t1,ds as u4,dt as h4,du as HS,dv as i1,dw as f4,dx as WS,dy as Yb,dz as g4,dA as TA,dB as p4,dC as MA,dD as n1,dE as x4,dF as v4,dG as m4,dH as RA,dI as NA,dJ as _4,dK as Fv,dL as OA,dM as tb,dN as b4,dO as C4,dP as id,dQ as jw,dR as E4,dS as zS,dT as VS,dU as y4,dV as rf,dW as HA,dX as w4,dY as S4,dZ as D4,d_ as A4,d$ as WA,e0 as zA,e1 as VA,e2 as jA,e3 as k4,e4 as nl,e5 as jS,e6 as B4,e7 as Zp,e8 as F4,e9 as tg,ea as $A,eb as $S,ec as Zg,ed as UA,ee as Lv,ef as L4,eg as qA,eh as I4,ei as GA,ej as P4,ek as T4,el as KA,em as ZA,en as Wl,eo as ib,ep as M4,eq as XA,er as br,es as Ud,et as YA,eu as R4,ev as N4,ew as QA,ex as JA,ey as O4,ez as ek,eA as tk,eB as Xg,eC as H4,eD as W4,eE as z4,eF as V4,eG as $0,eH as US,eI as j4,eJ as $4,eK as U4,eL as Iv,eM as yo,eN as q4,eO as s1,eP as lh,eQ as G4,eR as Sl,eS as K4,eT as Z4,eU as ik,eV as X4,eW as mg,eX as Y4,eY as Q4,eZ as J4,e_ as e7,e$ as qS,f0 as GS,f1 as KS,f2 as ch,f3 as $w,f4 as nk,f5 as o1,f6 as ev,f7 as sk,f8 as Pv,f9 as t7,fa as i7,fb as n7,fc as s7,fd as Uw,fe as ok,ff as o7,fg as Tv,fh as rk,fi as ak,fj as r7,fk as a7,fl as l7,fm as c7,fn as d7,fo as u7,fp as h7,fq as f7,fr as lk,fs as g7,ft as Mv,fu as ck,fv as p7,fw as dk,fx as x7,fy as uk,fz as hk,fA as v7,fB as ZS,fC as fk,fD as XS,fE as m7,fF as Qb,fG as YS,fH as _7,fI as b7,fJ as C7,fK as Ka,fL as nd,fM as E7,fN as QS,fO as tv,fP as y7,fQ as kl,fR as nb,fS as r1,fT as w7,fU as gk,fV as pk,fW as To,fX as JS,fY as mx,fZ as qw,f_ as S7,f$ as D7,g0 as A7,g1 as k7,g2 as B7,g3 as F7,g4 as L7,g5 as I7,g6 as e8,g7 as P7,g8 as T7,g9 as M7,ga as t0,gb as _g,gc as xk,gd as R7,ge as Gw,gf as iv,gg as _x,gh as Jb,gi as N7,gj as O7,gk as vk,gl as H7,gm as Kw,gn as W7,go as z7,gp as mk,gq as sb,gr as V7,gs as Rv,gt as Zw,gu as Xw,gv as Yw,gw as _k,gx as bk,gy as Ck,gz as Ek,gA as yk,gB as wk,gC as Sk,gD as t8,gE as Dk,gF as Ph,gG as j7,gH as $7,gI as U7,gJ as q7,gK as Ak,gL as G7,gM as K7,gN as i8,gO as a1,gP as Mc,gQ as Z7,gR as X7,gS as Y7,gT as Q7,gU as J7,gV as eL,gW as n8,gX as Qw,gY as l1,gZ as tL,g_ as c1,g$ as iL,h0 as nL,h1 as sL,h2 as oL,h3 as Jw,h4 as kk,h5 as s8,h6 as o8,h7 as rL,h8 as aL,h9 as lL,ha as r8,hb as eC,hc as cL,hd as dL,he as uL,hf as tC,hg as Bk,hh as Fk,hi as Lk,hj as Ik,hk as zl,hl as Pk,hm as e9,hn as a8,ho as hL,hp as Tk,hq as fL,hr as gL,hs as ob,ht as rb,hu as dh,hv as ab,hw as Xp,hx as pL,hy as lb,hz as xL,hA as vL,hB as mL,hC as Mk,hD as U0,hE as _L,hF as bL,hG as CL,hH as EL,hI as Yp,hJ as yL,hK as Rk,hL as Nk,hM as Ok,hN as d1,hO as wL,hP as SL,hQ as DL,hR as AL,hS as kL,hT as u1,hU as BL,hV as FL,hW as LL,hX as IL,hY as PL,hZ as TL,h_ as ML,h$ as RL,i0 as Hk,i1 as NL,i2 as OL,i3 as HL,i4 as l8,i5 as WL,i6 as zL,i7 as Bd,i8 as ur,i9 as h1,ia as Wk,ib as VL,ic as jL}from"./monaco-langs-Dt8a9eeo.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 r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).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 zk=!1;var t9=Array.isArray,$L=Array.prototype.indexOf,Nv=Array.prototype.includes,cb=Array.from,UL=Object.defineProperty,yf=Object.getOwnPropertyDescriptor,qL=Object.getOwnPropertyDescriptors,GL=Object.prototype,KL=Array.prototype,Vk=Object.getPrototypeOf,c8=Object.isExtensible;const db=()=>{};function ZL(o){for(var e=0;e<o.length;e++)o[e]()}function jk(){var o,e,t=new Promise((i,n)=>{o=i,e=n});return{promise:t,resolve:o,reject:e}}function XL(o,e,t=!1){return o===void 0?t?e():e:o}function d8(o,e){if(Array.isArray(o))return o;if(!(Symbol.iterator in o))return Array.from(o);const t=[];for(const i of o)if(t.push(i),t.length===e)break;return t}const No=2,i0=4,ub=8,$k=1<<24,Ea=16,wa=32,sd=64,f1=128,Jr=512,wo=1024,Ao=2048,ll=4096,nr=8192,ea=16384,A0=32768,g1=1<<25,n0=65536,Ov=1<<17,YL=1<<18,k0=1<<19,QL=1<<20,Qa=1<<25,Vu=65536,Hv=1<<21,wf=1<<22,Rc=1<<23,qd=Symbol("$state"),JL=Symbol("legacy props"),eI=Symbol(""),nv=Symbol("attributes"),p1=Symbol("class"),x1=Symbol("style"),ig=Symbol("text"),sv=Symbol("form reset"),hb=new class extends Error{constructor(){super(...arguments);Un(this,"name","StaleReactionError");Un(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var lA;const tI=!!((lA=globalThis.document)!=null&&lA.contentType)&&globalThis.document.contentType.includes("xml");function Uk(o){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function iI(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function nI(o,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function sI(o){throw new Error("https://svelte.dev/e/effect_in_teardown")}function oI(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function rI(o){throw new Error("https://svelte.dev/e/effect_orphan")}function aI(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function lI(o){throw new Error("https://svelte.dev/e/props_invalid_value")}function cI(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function dI(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function uI(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function hI(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const fI=1,gI=2,qk=4,pI=8,xI=16,vI=1,mI=4,_I=8,bI=16,CI=1,EI=2,Eo=Symbol("uninitialized"),Gk="http://www.w3.org/1999/xhtml",yI="http://www.w3.org/2000/svg",wI="http://www.w3.org/1998/Math/MathML";function SI(){console.warn("https://svelte.dev/e/derived_inert")}function DI(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function AI(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Kk(o){return o===this.v}function kI(o,e){return o!=o?e==e:o!==e||o!==null&&typeof o=="object"||typeof o=="function"}function Zk(o){return!kI(o,this.v)}let BI=!1,Ro=null;function s0(o){Ro=o}function Js(o,e=!1,t){Ro={p:Ro,i:!1,c:null,e:null,s:o,x:null,r:rs,l:null}}function eo(o){var e=Ro,t=e.e;if(t!==null){e.e=null;for(var i of t)v6(i)}return o!==void 0&&(e.x=o),e.i=!0,Ro=e.p,o??{}}function Xk(){return!0}let Td=[];function Yk(){var o=Td;Td=[],ZL(o)}function Nc(o){if(Td.length===0&&!Cg){var e=Td;queueMicrotask(()=>{e===Td&&Yk()})}Td.push(o)}function FI(){for(;Td.length>0;)Yk()}function Qk(o){var e=rs;if(e===null)return ss.f|=Rc,o;if((e.f&A0)===0&&(e.f&i0)===0)throw o;Bc(o,e)}function Bc(o,e){for(;e!==null;){if((e.f&f1)!==0){if((e.f&A0)===0)throw o;try{e.b.error(o);return}catch(t){o=t}}e=e.parent}throw o}const LI=-7169;function ro(o,e){o.f=o.f&LI|e}function i9(o){(o.f&Jr)!==0||o.deps===null?ro(o,wo):ro(o,ll)}function Jk(o){if(o!==null)for(const e of o)(e.f&No)===0||(e.f&Vu)===0||(e.f^=Vu,Jk(e.deps))}function e6(o,e,t){(o.f&Ao)!==0?e.add(o):(o.f&ll)!==0&&t.add(o),Jk(o.deps),ro(o,wo)}let bx=!1;function II(o){var e=bx;try{return bx=!1,[o(),bx]}finally{bx=e}}let iC=null,Th=null,xn=null,bg=null,Lo=null,v1=null,Cg=!1,nC=!1,af=null,ov=null;var u8=0;let PI=1;var kf,Sc,Od,Bf,Ff,Lf,Cl,If,hr,Bp,El,ha,$a,Pf,Hd,Ps,m1,ng,_1,t6,i6,Xh,TI,sg;const Xm=class Xm{constructor(){Mn(this,Ps);Un(this,"id",PI++);Mn(this,kf,!1);Un(this,"linked",!0);Mn(this,Sc,null);Mn(this,Od,null);Un(this,"async_deriveds",new Map);Un(this,"current",new Map);Un(this,"previous",new Map);Mn(this,Bf,new Set);Mn(this,Ff,new Set);Mn(this,Lf,0);Mn(this,Cl,new Map);Mn(this,If,null);Mn(this,hr,[]);Mn(this,Bp,[]);Mn(this,El,new Set);Mn(this,ha,new Set);Mn(this,$a,new Map);Mn(this,Pf,new Set);Un(this,"is_fork",!1);Mn(this,Hd,!1);Th===null?iC=Th=this:(Rn(Th,Od,this),Rn(this,Sc,Th)),Th=this}skip_effect(e){ke(this,$a).has(e)||ke(this,$a).set(e,{d:[],m:[]}),ke(this,Pf).delete(e)}unskip_effect(e,t=i=>this.schedule(i)){var i=ke(this,$a).get(e);if(i){ke(this,$a).delete(e);for(var n of i.d)ro(n,Ao),t(n);for(n of i.m)ro(n,ll),t(n)}ke(this,Pf).add(e)}capture(e,t,i=!1){e.v!==Eo&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Rc)===0&&(this.current.set(e,[t,i]),Lo==null||Lo.set(e,t)),this.is_fork||(e.v=t)}activate(){xn=this}deactivate(){xn=null,Lo=null}flush(){try{nC=!0,xn=this,ys(this,Ps,ng).call(this)}finally{u8=0,v1=null,af=null,ov=null,nC=!1,xn=null,Lo=null,Gd.clear()}}discard(){var e;for(const t of ke(this,Ff))t(this);ke(this,Ff).clear(),ys(this,Ps,sg).call(this),(e=ke(this,If))==null||e.resolve()}register_created_effect(e){ke(this,Bp).push(e)}increment(e,t){if(Rn(this,Lf,ke(this,Lf)+1),e){let i=ke(this,Cl).get(t)??0;ke(this,Cl).set(t,i+1)}}decrement(e,t){if(Rn(this,Lf,ke(this,Lf)-1),e){let i=ke(this,Cl).get(t)??0;i===1?ke(this,Cl).delete(t):ke(this,Cl).set(t,i-1)}ke(this,Hd)||(Rn(this,Hd,!0),Nc(()=>{Rn(this,Hd,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(const i of e)ke(this,El).add(i);for(const i of t)ke(this,ha).add(i);e.clear(),t.clear()}oncommit(e){ke(this,Bf).add(e)}ondiscard(e){ke(this,Ff).add(e)}settled(){return(ke(this,If)??Rn(this,If,jk())).promise}static ensure(){if(xn===null){const e=xn=new Xm;!nC&&!Cg&&Nc(()=>{ke(e,kf)||e.flush()})}return xn}apply(){{Lo=null;return}}schedule(e){var n;if(v1=e,(n=e.b)!=null&&n.is_pending&&(e.f&(i0|ub|$k))!==0&&(e.f&A0)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var i=t.f;if(af!==null&&t===rs&&(ss===null||(ss.f&No)===0))return;if((i&(sd|wa))!==0){if((i&wo)===0)return;t.f^=wo}}ke(this,hr).push(t)}};kf=new WeakMap,Sc=new WeakMap,Od=new WeakMap,Bf=new WeakMap,Ff=new WeakMap,Lf=new WeakMap,Cl=new WeakMap,If=new WeakMap,hr=new WeakMap,Bp=new WeakMap,El=new WeakMap,ha=new WeakMap,$a=new WeakMap,Pf=new WeakMap,Hd=new WeakMap,Ps=new WeakSet,m1=function(){if(this.is_fork)return!0;for(const i of ke(this,Cl).keys()){for(var e=i,t=!1;e.parent!==null;){if(ke(this,$a).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},ng=function(){var d,u,f,g;Rn(this,kf,!0),u8++>1e3&&(ys(this,Ps,sg).call(this),RI());for(const p of ke(this,El))ke(this,ha).delete(p),ro(p,Ao),this.schedule(p);for(const p of ke(this,ha))ro(p,ll),this.schedule(p);const e=ke(this,hr);Rn(this,hr,[]),this.apply();var t=af=[],i=[],n=ov=[];for(const p of e)try{ys(this,Ps,_1).call(this,p,t,i)}catch(C){throw o6(p),ys(this,Ps,m1).call(this)||this.discard(),C}if(xn=null,n.length>0){var s=Xm.ensure();for(const p of n)s.schedule(p)}if(af=null,ov=null,ys(this,Ps,m1).call(this)){ys(this,Ps,Xh).call(this,i),ys(this,Ps,Xh).call(this,t);for(const[p,C]of ke(this,$a))s6(p,C);n.length>0&&ys(d=xn,Ps,ng).call(d);return}const r=ys(this,Ps,t6).call(this);if(r){ys(this,Ps,Xh).call(this,i),ys(this,Ps,Xh).call(this,t),ys(u=r,Ps,i6).call(u,this);return}ke(this,El).clear(),ke(this,ha).clear();for(const p of ke(this,Bf))p(this);ke(this,Bf).clear(),bg=this,h8(i),h8(t),bg=null,(f=ke(this,If))==null||f.resolve();var a=xn;if(ke(this,Lf)===0&&(ke(this,hr).length===0||a!==null)&&ys(this,Ps,sg).call(this),ke(this,hr).length>0)if(a!==null){const p=a;ke(p,hr).push(...ke(this,hr).filter(C=>!ke(p,hr).includes(C)))}else a=this;a!==null&&ys(g=a,Ps,ng).call(g)},_1=function(e,t,i){e.f^=wo;for(var n=e.first;n!==null;){var s=n.f,r=(s&(wa|sd))!==0,a=r&&(s&wo)!==0,d=a||(s&nr)!==0||ke(this,$a).has(n);if(!d&&n.fn!==null){r?n.f^=wo:(s&i0)!==0?t.push(n):Jp(n)&&((s&Ea)!==0&&ke(this,ha).add(n),r0(n));var u=n.first;if(u!==null){n=u;continue}}for(;n!==null;){var f=n.next;if(f!==null){n=f;break}n=n.parent}}},t6=function(){for(var e=ke(this,Sc);e!==null;){if(!e.is_fork){for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e}e=ke(e,Sc)}return null},i6=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 r=this.async_deriveds.get(n);r&&s.promise.then(r.resolve).catch(r.reject)}this.transfer_effects(ke(e,El),ke(e,ha));const t=n=>{var s=n.reactions;if(s!==null)for(const d of s){var r=d.f;if((r&No)!==0)t(d);else{var a=d;r&(wf|Ea)&&!this.async_deriveds.has(a)&&(ke(this,ha).delete(a),ro(a,Ao),this.schedule(a))}}};for(const n of this.current.keys())t(n);this.oncommit(()=>e.discard()),ys(i=e,Ps,sg).call(i),xn=this,ys(this,Ps,ng).call(this)},Xh=function(e){for(var t=0;t<e.length;t+=1)e6(e[t],ke(this,El),ke(this,ha))},TI=function(){var f;for(let g=iC;g!==null;g=ke(g,Od)){var e=g.id<this.id,t=[];for(const[p,[C,b]]of this.current){if(g.current.has(p)){var i=g.current.get(p)[0];if(e&&C!==i)g.current.set(p,[C,b]);else continue}t.push(p)}if(e)for(const[p,C]of this.async_deriveds){const b=g.async_deriveds.get(p);b&&C.promise.then(b.resolve).catch(b.reject)}if(ke(g,kf)){var n=[...g.current.keys()].filter(p=>!g.current.get(p)[1]&&!this.current.has(p));if(n.length===0)e&&g.discard();else if(t.length>0){if(e)for(const p of ke(this,Pf))g.unskip_effect(p,C=>{var b;(C.f&(Ea|wf))!==0?g.schedule(C):ys(b=g,Ps,Xh).call(b,[C])});g.activate();var s=new Set,r=new Map;for(var a of t)n6(a,n,s,r);r=new Map;var d=[...g.current].filter(([p,C])=>{const b=this.current.get(p);return b?b[0]!==C[0]||b[1]!==C[1]:!0}).map(([p])=>p);if(d.length>0)for(const p of ke(this,Bp))(p.f&(ea|nr|Ov))===0&&n9(p,d,r)&&((p.f&(wf|Ea))!==0?(ro(p,Ao),g.schedule(p)):ke(g,El).add(p));if(ke(g,hr).length>0&&!ke(g,Hd)){g.apply();for(var u of ke(g,hr))ys(f=g,Ps,_1).call(f,u,[],[]);Rn(g,hr,[])}g.deactivate()}}}},sg=function(){if(this.linked){var e=ke(this,Sc),t=ke(this,Od);e===null?iC=t:Rn(e,Od,t),t===null?Th=e:Rn(t,Sc,e),this.linked=!1}};let ju=Xm;function MI(o){var e=Cg;Cg=!0;try{for(var t;;){if(FI(),xn===null)return t;xn.flush()}}finally{Cg=e}}function RI(){try{aI()}catch(o){Bc(o,v1)}}let ca=null;function h8(o){var e=o.length;if(e!==0){for(var t=0;t<e;){var i=o[t++];if((i.f&(ea|nr))===0&&Jp(i)&&(ca=new Set,r0(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&b6(i),(ca==null?void 0:ca.size)>0)){Gd.clear();for(const n of ca){if((n.f&(ea|nr))!==0)continue;const s=[n];let r=n.parent;for(;r!==null;)ca.has(r)&&(ca.delete(r),s.push(r)),r=r.parent;for(let a=s.length-1;a>=0;a--){const d=s[a];(d.f&(ea|nr))===0&&r0(d)}}ca.clear()}}ca=null}}function n6(o,e,t,i){if(!t.has(o)&&(t.add(o),o.reactions!==null))for(const n of o.reactions){const s=n.f;(s&No)!==0?n6(n,e,t,i):(s&(wf|Ea))!==0&&(s&Ao)===0&&n9(n,e,i)&&(ro(n,Ao),s9(n))}}function n9(o,e,t){const i=t.get(o);if(i!==void 0)return i;if(o.deps!==null)for(const n of o.deps){if(Nv.call(e,n))return!0;if((n.f&No)!==0&&n9(n,e,t))return t.set(n,!0),!0}return t.set(o,!1),!1}function s9(o){xn.schedule(o)}function s6(o,e){if(!((o.f&wa)!==0&&(o.f&wo)!==0)){(o.f&Ao)!==0?e.d.push(o):(o.f&ll)!==0&&e.m.push(o),ro(o,wo);for(var t=o.first;t!==null;)s6(t,e),t=t.next}}function o6(o){ro(o,wo);for(var e=o.first;e!==null;)o6(e),e=e.next}function NI(o){let e=0,t=$u(0),i;return()=>{l9()&&(l(t),gb(()=>(e===0&&(i=Jl(()=>o(()=>Eg(t)))),e+=1,()=>{Nc(()=>{e-=1,e===0&&(i==null||i(),i=void 0,Eg(t))})})))}}var OI=n0|k0;function HI(o,e,t,i){new WI(o,e,t,i)}var $r,Sw,Ur,Wd,fr,qr,Qo,kr,yl,zd,Dc,Tf,Fp,Lp,wl,Ym,ao,zI,VI,jI,b1,rv,av,C1,E1;class WI{constructor(e,t,i,n){Mn(this,ao);Un(this,"parent");Un(this,"is_pending",!1);Un(this,"transform_error");Mn(this,$r);Mn(this,Sw,null);Mn(this,Ur);Mn(this,Wd);Mn(this,fr);Mn(this,qr,null);Mn(this,Qo,null);Mn(this,kr,null);Mn(this,yl,null);Mn(this,zd,0);Mn(this,Dc,0);Mn(this,Tf,!1);Mn(this,Fp,new Set);Mn(this,Lp,new Set);Mn(this,wl,null);Mn(this,Ym,NI(()=>(Rn(this,wl,$u(ke(this,zd))),()=>{Rn(this,wl,null)})));var s;Rn(this,$r,e),Rn(this,Ur,t),Rn(this,Wd,r=>{var a=rs;a.b=this,a.f|=f1,i(r)}),this.parent=rs.b,this.transform_error=n??((s=this.parent)==null?void 0:s.transform_error)??(r=>r),Rn(this,fr,u9(()=>{ys(this,ao,b1).call(this)},OI))}defer_effect(e){e6(e,ke(this,Fp),ke(this,Lp))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!ke(this,Ur).pending}update_pending_count(e,t){ys(this,ao,C1).call(this,e,t),Rn(this,zd,ke(this,zd)+e),!(!ke(this,wl)||ke(this,Tf))&&(Rn(this,Tf,!0),Nc(()=>{Rn(this,Tf,!1),ke(this,wl)&&o0(ke(this,wl),ke(this,zd))}))}get_effect_pending(){return ke(this,Ym).call(this),l(ke(this,wl))}error(e){if(!ke(this,Ur).onerror&&!ke(this,Ur).failed)throw e;xn!=null&&xn.is_fork?(ke(this,qr)&&xn.skip_effect(ke(this,qr)),ke(this,Qo)&&xn.skip_effect(ke(this,Qo)),ke(this,kr)&&xn.skip_effect(ke(this,kr)),xn.oncommit(()=>{ys(this,ao,E1).call(this,e)})):ys(this,ao,E1).call(this,e)}}$r=new WeakMap,Sw=new WeakMap,Ur=new WeakMap,Wd=new WeakMap,fr=new WeakMap,qr=new WeakMap,Qo=new WeakMap,kr=new WeakMap,yl=new WeakMap,zd=new WeakMap,Dc=new WeakMap,Tf=new WeakMap,Fp=new WeakMap,Lp=new WeakMap,wl=new WeakMap,Ym=new WeakMap,ao=new WeakSet,zI=function(){try{Rn(this,qr,Gr(()=>ke(this,Wd).call(this,ke(this,$r))))}catch(e){this.error(e)}},VI=function(e){const t=ke(this,Ur).failed;t&&Rn(this,kr,Gr(()=>{t(ke(this,$r),()=>e,()=>()=>{})}))},jI=function(){const e=ke(this,Ur).pending;e&&(this.is_pending=!0,Rn(this,Qo,Gr(()=>e(ke(this,$r)))),Nc(()=>{var t=Rn(this,yl,document.createDocumentFragment()),i=Tl();t.append(i),Rn(this,qr,ys(this,ao,av).call(this,()=>Gr(()=>ke(this,Wd).call(this,i)))),ke(this,Dc)===0&&(ke(this,$r).before(t),Rn(this,yl,null),Zd(ke(this,Qo),()=>{Rn(this,Qo,null)}),ys(this,ao,rv).call(this,xn))}))},b1=function(){try{if(this.is_pending=this.has_pending_snippet(),Rn(this,Dc,0),Rn(this,zd,0),Rn(this,qr,Gr(()=>{ke(this,Wd).call(this,ke(this,$r))})),ke(this,Dc)>0){var e=Rn(this,yl,document.createDocumentFragment());f9(ke(this,qr),e);const t=ke(this,Ur).pending;Rn(this,Qo,Gr(()=>t(ke(this,$r))))}else ys(this,ao,rv).call(this,xn)}catch(t){this.error(t)}},rv=function(e){this.is_pending=!1,e.transfer_effects(ke(this,Fp),ke(this,Lp))},av=function(e){var t=rs,i=ss,n=Ro;cl(ke(this,fr)),na(ke(this,fr)),s0(ke(this,fr).ctx);try{return ju.ensure(),e()}catch(s){return Qk(s),null}finally{cl(t),na(i),s0(n)}},C1=function(e,t){var i;if(!this.has_pending_snippet()){this.parent&&ys(i=this.parent,ao,C1).call(i,e,t);return}Rn(this,Dc,ke(this,Dc)+e),ke(this,Dc)===0&&(ys(this,ao,rv).call(this,t),ke(this,Qo)&&Zd(ke(this,Qo),()=>{Rn(this,Qo,null)}),ke(this,yl)&&(ke(this,$r).before(ke(this,yl)),Rn(this,yl,null)))},E1=function(e){ke(this,qr)&&(Cr(ke(this,qr)),Rn(this,qr,null)),ke(this,Qo)&&(Cr(ke(this,Qo)),Rn(this,Qo,null)),ke(this,kr)&&(Cr(ke(this,kr)),Rn(this,kr,null));var t=ke(this,Ur).onerror;let i=ke(this,Ur).failed;var n=!1,s=!1;const r=()=>{if(n){AI();return}n=!0,s&&hI(),ke(this,kr)!==null&&Zd(ke(this,kr),()=>{Rn(this,kr,null)}),ys(this,ao,av).call(this,()=>{ys(this,ao,b1).call(this)})},a=d=>{try{s=!0,t==null||t(d,r),s=!1}catch(u){Bc(u,ke(this,fr)&&ke(this,fr).parent)}i&&Rn(this,kr,ys(this,ao,av).call(this,()=>{try{return Gr(()=>{var u=rs;u.b=this,u.f|=f1,i(ke(this,$r),()=>d,()=>r)})}catch(u){return Bc(u,ke(this,fr).parent),null}}))};Nc(()=>{var d;try{d=this.transform_error(e)}catch(u){Bc(u,ke(this,fr)&&ke(this,fr).parent);return}d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(a,u=>Bc(u,ke(this,fr)&&ke(this,fr).parent)):a(d)})};function $I(o,e,t,i){const n=Yg;var s=o.filter(p=>!p.settled);if(t.length===0&&s.length===0){i(e.map(n));return}var r=rs,a=UI(),d=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(p=>p.promise)):null;function u(p){if((r.f&ea)===0){a();try{i(p)}catch(C){Bc(C,r)}Wv()}}var f=r6();if(t.length===0){d.then(()=>u(e.map(n))).finally(f);return}function g(){Promise.all(t.map(p=>qI(p))).then(p=>u([...e.map(n),...p])).catch(p=>Bc(p,r)).finally(f)}d?d.then(()=>{a(),g(),Wv()}):g()}function UI(){var o=rs,e=ss,t=Ro,i=xn;return function(s=!0){cl(o),na(e),s0(t),s&&(o.f&ea)===0&&(i==null||i.activate(),i==null||i.apply())}}function Wv(o=!0){cl(null),na(null),s0(null),o&&(xn==null||xn.deactivate())}function r6(){var o=rs,e=o.b,t=xn,i=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,t),t.increment(i,o),()=>{e==null||e.update_pending_count(-1,t),t.decrement(i,o)}}function Yg(o){var e=No|Ao;return rs!==null&&(rs.f|=k0),{ctx:Ro,deps:null,effects:null,equals:Kk,f:e,fn:o,reactions:null,rv:0,v:Eo,wv:0,parent:rs,ac:null}}const Cx=Symbol("obsolete");function qI(o,e,t){let i=rs;i===null&&iI();var n=void 0,s=$u(Eo),r=!ss,a=new Set;return sP(()=>{var C,b;var d=rs,u=jk();n=u.promise;try{Promise.resolve(o()).then(u.resolve,E=>{E!==hb&&u.reject(E)}).finally(Wv)}catch(E){u.reject(E),Wv()}var f=xn;if(r){if((d.f&A0)!==0)var g=r6();if((C=i.b)!=null&&C.is_rendered())(b=f.async_deriveds.get(d))==null||b.reject(Cx);else for(const E of a.values())E.reject(Cx);a.add(u),f.async_deriveds.set(d,u)}const p=(E,w=void 0)=>{g==null||g(),a.delete(u),w!==Cx&&(f.activate(),w?(s.f|=Rc,o0(s,w)):((s.f&Rc)!==0&&(s.f^=Rc),o0(s,E)),f.deactivate())};u.promise.then(p,E=>p(null,E||"unknown"))}),c9(()=>{for(const d of a)d.reject(Cx)}),new Promise(d=>{function u(f){function g(){f===n?d(s):u(n)}f.then(g,g)}u(n)})}function Bt(o){const e=Yg(o);return y6(e),e}function o9(o){const e=Yg(o);return e.equals=Zk,e}function GI(o){var e=o.effects;if(e!==null){o.effects=null;for(var t=0;t<e.length;t+=1)Cr(e[t])}}function r9(o){var e,t=rs,i=o.parent;if(!Vl&&i!==null&&o.v!==Eo&&(i.f&(ea|nr))!==0)return SI(),o.v;cl(i);try{o.f&=~Vu,GI(o),e=A6(o)}finally{cl(t)}return e}function a6(o){var e=r9(o);if(!o.equals(e)&&(o.wv=S6(),(!(xn!=null&&xn.is_fork)||o.deps===null)&&(xn!==null?(xn.capture(o,e,!0),bg==null||bg.capture(o,e,!0)):o.v=e,o.deps===null))){ro(o,wo);return}Vl||(Lo!==null?(l9()||xn!=null&&xn.is_fork)&&Lo.set(o,e):i9(o))}function KI(o){var e,t;if(o.effects!==null)for(const i of o.effects)(i.teardown||i.ac)&&((e=i.teardown)==null||e.call(i),(t=i.ac)==null||t.abort(hb),i.fn!==null&&(i.teardown=db),i.ac=null,Qg(i,0),h9(i))}function l6(o){if(o.effects!==null)for(const e of o.effects)e.teardown&&e.fn!==null&&r0(e)}let zv=new Set;const Gd=new Map;let c6=!1;function $u(o,e){var t={f:0,v:o,reactions:null,equals:Kk,rv:0,wv:0};return t}function B(o,e){const t=$u(o);return y6(t),t}function ZI(o,e=!1,t=!0){const i=$u(o);return e||(i.equals=Zk),i}function x(o,e,t=!1){ss!==null&&(!ya||(ss.f&Ov)!==0)&&Xk()&&(ss.f&(No|Ea|wf|Ov))!==0&&(sl===null||!sl.has(o))&&uI();let i=t?vi(e):e;return o0(o,i,ov)}function o0(o,e,t=null){if(!o.equals(e)){Gd.set(o,Vl?e:o.v);var i=ju.ensure();if(i.capture(o,e),(o.f&No)!==0){const n=o;(o.f&Ao)!==0&&r9(n),Lo===null&&i9(n)}o.wv=S6(),d6(o,Ao,t),rs!==null&&(rs.f&wo)!==0&&(rs.f&(wa|sd))===0&&(jr===null?rP([o]):jr.push(o)),!i.is_fork&&zv.size>0&&!c6&&XI()}return e}function XI(){c6=!1;for(const o of zv){(o.f&wo)!==0&&ro(o,ll);let e;try{e=Jp(o)}catch{e=!0}e&&r0(o)}zv.clear()}function f8(o,e=1){var t=l(o),i=e===1?t++:t--;return x(o,t),i}function Eg(o){x(o,o.v+1)}function d6(o,e,t){var i=o.reactions;if(i!==null)for(var n=i.length,s=0;s<n;s++){var r=i[s],a=r.f,d=(a&Ao)===0;if(d&&ro(r,e),(a&Ov)!==0)zv.add(r);else if((a&No)!==0){var u=r;Lo==null||Lo.delete(u),(a&Vu)===0&&(a&Jr&&(rs===null||(rs.f&Hv)===0)&&(r.f|=Vu),d6(u,ll,t))}else if(d){var f=r;(a&Ea)!==0&&ca!==null&&ca.add(f),t!==null?t.push(f):s9(f)}}}function vi(o){if(typeof o!="object"||o===null||qd in o)return o;const e=Vk(o);if(e!==GL&&e!==KL)return o;var t=new Map,i=t9(o),n=B(0),s=Xd,r=a=>{if(Xd===s)return a();var d=ss,u=Xd;na(null),v8(s);var f=a();return na(d),v8(u),f};return i&&t.set("length",B(o.length)),new Proxy(o,{defineProperty(a,d,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&cI();var f=t.get(d);return f===void 0?r(()=>{var g=B(u.value);return t.set(d,g),g}):x(f,u.value,!0),!0},deleteProperty(a,d){var u=t.get(d);if(u===void 0){if(d in a){const f=r(()=>B(Eo));t.set(d,f),Eg(n)}}else x(u,Eo),Eg(n);return!0},get(a,d,u){var C;if(d===qd)return o;var f=t.get(d),g=d in a;if(f===void 0&&(!g||(C=yf(a,d))!=null&&C.writable)&&(f=r(()=>{var b=vi(g?a[d]:Eo),E=B(b);return E}),t.set(d,f)),f!==void 0){var p=l(f);return p===Eo?void 0:p}return Reflect.get(a,d,u)},getOwnPropertyDescriptor(a,d){var u=Reflect.getOwnPropertyDescriptor(a,d);if(u&&"value"in u){var f=t.get(d);f&&(u.value=l(f))}else if(u===void 0){var g=t.get(d),p=g==null?void 0:g.v;if(g!==void 0&&p!==Eo)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return u},has(a,d){var p;if(d===qd)return!0;var u=t.get(d),f=u!==void 0&&u.v!==Eo||Reflect.has(a,d);if(u!==void 0||rs!==null&&(!f||(p=yf(a,d))!=null&&p.writable)){u===void 0&&(u=r(()=>{var C=f?vi(a[d]):Eo,b=B(C);return b}),t.set(d,u));var g=l(u);if(g===Eo)return!1}return f},set(a,d,u,f){var T;var g=t.get(d),p=d in a;if(i&&d==="length")for(var C=u;C<g.v;C+=1){var b=t.get(C+"");b!==void 0?x(b,Eo):C in a&&(b=r(()=>B(Eo)),t.set(C+"",b))}if(g===void 0)(!p||(T=yf(a,d))!=null&&T.writable)&&(g=r(()=>B(void 0)),x(g,vi(u)),t.set(d,g));else{p=g.v!==Eo;var E=r(()=>vi(u));x(g,E)}var w=Reflect.getOwnPropertyDescriptor(a,d);if(w!=null&&w.set&&w.set.call(f,u),!p){if(i&&typeof d=="string"){var A=t.get("length"),I=Number(d);Number.isInteger(I)&&I>=A.v&&x(A,I+1)}Eg(n)}return!0},ownKeys(a){l(n);var d=Reflect.ownKeys(a).filter(g=>{var p=t.get(g);return p===void 0||p.v!==Eo});for(var[u,f]of t)f.v!==Eo&&!(u in a)&&d.push(u);return d},setPrototypeOf(){dI()}})}function g8(o){try{if(o!==null&&typeof o=="object"&&qd in o)return o[qd]}catch{}return o}function YI(o,e){return Object.is(g8(o),g8(e))}var Kd,u6,h6,f6,g6;function QI(){if(Kd===void 0){Kd=window,u6=document,h6=/Firefox/.test(navigator.userAgent);var o=Element.prototype,e=Node.prototype,t=Text.prototype;f6=yf(e,"firstChild").get,g6=yf(e,"nextSibling").get,c8(o)&&(o[p1]=void 0,o[nv]=null,o[x1]=void 0,o.__e=void 0),c8(t)&&(t[ig]=void 0)}}function Tl(o=""){return document.createTextNode(o)}function Ja(o){return f6.call(o)}function Qp(o){return g6.call(o)}function m(o,e){return Ja(o)}function ct(o,e=!1){{var t=Ja(o);return t instanceof Comment&&t.data===""?Qp(t):t}}function v(o,e=1,t=!1){let i=o;for(;e--;)i=Qp(i);return i}function JI(o){o.textContent=""}function p6(){return!1}function x6(o,e,t){return e==null||e===Gk?t?document.createElement(o,{is:t}):document.createElement(o):t?document.createElementNS(e,o,{is:t}):document.createElementNS(e,o)}let p8=!1;function eP(){p8||(p8=!0,document.addEventListener("reset",o=>{Promise.resolve().then(()=>{var e;if(!o.defaultPrevented)for(const t of o.target.elements)(e=t[sv])==null||e.call(t)})},{capture:!0}))}function fb(o){var e=ss,t=rs;na(null),cl(null);try{return o()}finally{na(e),cl(t)}}function a9(o,e,t,i=t){o.addEventListener(e,()=>fb(t));const n=o[sv];n?o[sv]=()=>{n(),i(!0)}:o[sv]=()=>i(!0),eP()}function tP(o){rs===null&&(ss===null&&rI(),oI()),Vl&&sI()}function iP(o,e){var t=e.last;t===null?e.last=e.first=o:(t.next=o,o.prev=t,e.last=o)}function Ql(o,e){var t=rs;t!==null&&(t.f&nr)!==0&&(o|=nr);var i={ctx:Ro,deps:null,nodes:null,f:o|Ao|Jr,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};xn==null||xn.register_created_effect(i);var n=i;if((o&i0)!==0)af!==null?af.push(i):ju.ensure().schedule(i);else if(e!==null){try{r0(i)}catch(r){throw Cr(i),r}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&k0)===0&&(n=n.first,(o&Ea)!==0&&(o&n0)!==0&&n!==null&&(n.f|=n0))}if(n!==null&&(n.parent=t,t!==null&&iP(n,t),ss!==null&&(ss.f&No)!==0&&(o&sd)===0)){var s=ss;(s.effects??(s.effects=[])).push(n)}return i}function l9(){return ss!==null&&!ya}function c9(o){const e=Ql(ub,null);return ro(e,wo),e.teardown=o,e}function vs(o){tP();var e=rs.f,t=!ss&&(e&wa)!==0&&Ro!==null&&!Ro.i;if(t){var i=Ro;(i.e??(i.e=[])).push(o)}else return v6(o)}function v6(o){return Ql(i0|QL,o)}function nP(o){ju.ensure();const e=Ql(sd|k0,o);return(t={})=>new Promise(i=>{t.outro?Zd(e,()=>{Cr(e),i(void 0)}):(Cr(e),i(void 0))})}function d9(o){return Ql(i0,o)}function sP(o){return Ql(wf|k0,o)}function gb(o,e=0){return Ql(ub|e,o)}function W(o,e=[],t=[],i=[]){$I(i,e,t,n=>{Ql(ub,()=>o(...n.map(l)))})}function u9(o,e=0){var t=Ql(Ea|e,o);return t}function Gr(o){return Ql(wa|k0,o)}function m6(o){var e=o.teardown;if(e!==null){const t=Vl,i=ss;x8(!0),na(null);try{e.call(null)}finally{x8(t),na(i)}}}function h9(o,e=!1){var t=o.first;for(o.first=o.last=null;t!==null;){const n=t.ac;n!==null&&fb(()=>{n.abort(hb)});var i=t.next;(t.f&sd)!==0?t.parent=null:Cr(t,e),t=i}}function oP(o){for(var e=o.first;e!==null;){var t=e.next;(e.f&wa)===0&&Cr(e),e=t}}function Cr(o,e=!0){var t=!1;(e||(o.f&YL)!==0)&&o.nodes!==null&&o.nodes.end!==null&&(_6(o.nodes.start,o.nodes.end),t=!0),ro(o,g1),h9(o,e&&!t),Qg(o,0);var i=o.nodes&&o.nodes.t;if(i!==null)for(const s of i)s.stop();m6(o),o.f^=g1,o.f|=ea;var n=o.parent;n!==null&&n.first!==null&&b6(o),o.next=o.prev=o.teardown=o.ctx=o.deps=o.fn=o.nodes=o.ac=o.b=null}function _6(o,e){for(;o!==null;){var t=o===e?null:Qp(o);o.remove(),o=t}}function b6(o){var e=o.parent,t=o.prev,i=o.next;t!==null&&(t.next=i),i!==null&&(i.prev=t),e!==null&&(e.first===o&&(e.first=i),e.last===o&&(e.last=t))}function Zd(o,e,t=!0){var i=[];C6(o,i,!0);var n=()=>{t&&Cr(o),e&&e()},s=i.length;if(s>0){var r=()=>--s||n();for(var a of i)a.out(r)}else n()}function C6(o,e,t){if((o.f&nr)===0){o.f^=nr;var i=o.nodes&&o.nodes.t;if(i!==null)for(const a of i)(a.is_global||t)&&e.push(a);for(var n=o.first;n!==null;){var s=n.next;if((n.f&sd)===0){var r=(n.f&n0)!==0||(n.f&wa)!==0&&(o.f&Ea)!==0;C6(n,e,r?t:!1)}n=s}}}function Vv(o){E6(o,!0)}function E6(o,e){if((o.f&nr)!==0){o.f^=nr,(o.f&wo)===0&&(ro(o,Ao),ju.ensure().schedule(o));for(var t=o.first;t!==null;){var i=t.next,n=(t.f&n0)!==0||(t.f&wa)!==0;E6(t,n?e:!1),t=i}var s=o.nodes&&o.nodes.t;if(s!==null)for(const r of s)(r.is_global||e)&&r.in()}}function f9(o,e){if(o.nodes)for(var t=o.nodes.start,i=o.nodes.end;t!==null;){var n=t===i?null:Qp(t);e.append(t),t=n}}let lv=!1,Vl=!1;function x8(o){Vl=o}let ss=null,ya=!1;function na(o){ss=o}let rs=null;function cl(o){rs=o}let sl=null;function y6(o){ss!==null&&(sl??(sl=new Set)).add(o)}let gr=null,Dr=0,jr=null;function rP(o){jr=o}let w6=1,Md=0,Xd=Md;function v8(o){Xd=o}function S6(){return++w6}function Jp(o){var e=o.f;if((e&Ao)!==0)return!0;if(e&No&&(o.f&=~Vu),(e&ll)!==0){for(var t=o.deps,i=t.length,n=0;n<i;n++){var s=t[n];if(Jp(s)&&a6(s),s.wv>o.wv)return!0}(e&Jr)!==0&&Lo===null&&ro(o,wo)}return!1}function D6(o,e,t=!0){var i=o.reactions;if(i!==null&&!(sl!==null&&sl.has(o)))for(var n=0;n<i.length;n++){var s=i[n];(s.f&No)!==0?D6(s,e,!1):e===s&&(t?ro(s,Ao):(s.f&wo)!==0&&ro(s,ll),s9(s))}}function A6(o){var E;var e=gr,t=Dr,i=jr,n=ss,s=sl,r=Ro,a=ya,d=Xd,u=o.f;gr=null,Dr=0,jr=null,ss=(u&(wa|sd))===0?o:null,sl=null,s0(o.ctx),ya=!1,Xd=++Md,o.ac!==null&&(fb(()=>{o.ac.abort(hb)}),o.ac=null);try{o.f|=Hv;var f=o.fn,g=f();o.f|=A0;var p=o.deps,C=xn==null?void 0:xn.is_fork;if(gr!==null){var b;if(C||Qg(o,Dr),p!==null&&Dr>0)for(p.length=Dr+gr.length,b=0;b<gr.length;b++)p[Dr+b]=gr[b];else o.deps=p=gr;if(l9()&&(o.f&Jr)!==0)for(b=Dr;b<p.length;b++)((E=p[b]).reactions??(E.reactions=[])).push(o)}else!C&&p!==null&&Dr<p.length&&(Qg(o,Dr),p.length=Dr);if(Xk()&&jr!==null&&!ya&&p!==null&&(o.f&(No|ll|Ao))===0)for(b=0;b<jr.length;b++)D6(jr[b],o);if(n!==null&&n!==o){if(Md++,n.deps!==null)for(let w=0;w<t;w+=1)n.deps[w].rv=Md;if(e!==null)for(const w of e)w.rv=Md;jr!==null&&(i===null?i=jr:i.push(...jr))}return(o.f&Rc)!==0&&(o.f^=Rc),g}catch(w){return Qk(w)}finally{o.f^=Hv,gr=e,Dr=t,jr=i,ss=n,sl=s,s0(r),ya=a,Xd=d}}function aP(o,e){let t=e.reactions;if(t!==null){var i=$L.call(t,o);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&No)!==0&&(gr===null||!Nv.call(gr,e))){var s=e;(s.f&Jr)!==0&&(s.f^=Jr,s.f&=~Vu),s.v!==Eo&&i9(s),KI(s),Qg(s,0)}}function Qg(o,e){var t=o.deps;if(t!==null)for(var i=e;i<t.length;i++)aP(o,t[i])}function r0(o){var e=o.f;if((e&ea)===0){ro(o,wo);var t=rs,i=lv;rs=o,lv=!0;try{(e&(Ea|$k))!==0?oP(o):h9(o),m6(o);var n=A6(o);o.teardown=typeof n=="function"?n:null,o.wv=w6;var s;zk&&BI&&(o.f&Ao)!==0&&o.deps}finally{lv=i,rs=t}}}async function Dl(){await Promise.resolve(),MI()}function l(o){var e=o.f,t=(e&No)!==0;if(ss!==null&&!ya){var i=rs!==null&&(rs.f&ea)!==0;if(!i&&(sl===null||!sl.has(o))){var n=ss.deps;if((ss.f&Hv)!==0)o.rv<Md&&(o.rv=Md,gr===null&&n!==null&&n[Dr]===o?Dr++:gr===null?gr=[o]:gr.push(o));else{ss.deps??(ss.deps=[]),Nv.call(ss.deps,o)||ss.deps.push(o);var s=o.reactions;s===null?o.reactions=[ss]:Nv.call(s,ss)||s.push(ss)}}}if(Vl&&Gd.has(o))return Gd.get(o);if(t){var r=o;if(Vl){var a=r.v;return((r.f&wo)===0&&r.reactions!==null||B6(r))&&(a=r9(r)),Gd.set(r,a),a}var d=(r.f&Jr)===0&&!ya&&ss!==null&&(lv||(ss.f&Jr)!==0),u=(r.f&A0)===0;Jp(r)&&(d&&(r.f|=Jr),a6(r)),d&&!u&&(l6(r),k6(r))}if(Lo!=null&&Lo.has(o))return Lo.get(o);if((o.f&Rc)!==0)throw o.v;return o.v}function k6(o){if(o.f|=Jr,o.deps!==null)for(const e of o.deps)(e.reactions??(e.reactions=[])).push(o),(e.f&No)!==0&&(e.f&Jr)===0&&(l6(e),k6(e))}function B6(o){if(o.v===Eo)return!0;if(o.deps===null)return!1;for(const e of o.deps)if(Gd.has(e)||(e.f&No)!==0&&B6(e))return!0;return!1}function Jl(o){var e=ya;try{return ya=!0,o()}finally{ya=e}}const lP=["touchstart","touchmove"];function cP(o){return lP.includes(o)}const Rd=Symbol("events"),F6=new Set,y1=new Set;function dP(o,e,t,i={}){function n(s){if(i.capture||w1.call(e,s),!s.cancelBubble)return fb(()=>t==null?void 0:t.call(this,s))}return o.startsWith("pointer")||o.startsWith("touch")||o==="wheel"?Nc(()=>{e.addEventListener(o,n,i)}):e.addEventListener(o,n,i),n}function Ns(o,e,t,i,n){var s={capture:i,passive:n},r=dP(o,e,t,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&c9(()=>{e.removeEventListener(o,r,s)})}function z(o,e,t){(e[Rd]??(e[Rd]={}))[o]=t}function uo(o){for(var e=0;e<o.length;e++)F6.add(o[e]);for(var t of y1)t(o)}let m8=null;function w1(o){var E,w;var e=this,t=e.ownerDocument,i=o.type,n=((E=o.composedPath)==null?void 0:E.call(o))||[],s=n[0]||o.target;m8=o;var r=0,a=m8===o&&o[Rd];if(a){var d=n.indexOf(a);if(d!==-1&&(e===document||e===window)){o[Rd]=e;return}var u=n.indexOf(e);if(u===-1)return;d<=u&&(r=d)}if(s=n[r]||o.target,s!==e){UL(o,"currentTarget",{configurable:!0,get(){return s||t}});var f=ss,g=rs;na(null),cl(null);try{for(var p,C=[];s!==null&&s!==e;){try{var b=(w=s[Rd])==null?void 0:w[i];b!=null&&(!s.disabled||o.target===s)&&b.call(s,o)}catch(A){p?C.push(A):p=A}if(o.cancelBubble)break;r++,s=r<n.length?n[r]:null}if(p){for(let A of C)queueMicrotask(()=>{throw A});throw p}}finally{o[Rd]=e,delete o.currentTarget,na(f),cl(g)}}}var cA;const sC=((cA=globalThis==null?void 0:globalThis.window)==null?void 0:cA.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:o=>o});function uP(o){return(sC==null?void 0:sC.createHTML(o))??o}function L6(o){var e=x6("template");return e.innerHTML=uP(o.replaceAll("<!>","<!---->")),e.content}function Uu(o,e){var t=rs;t.nodes===null&&(t.nodes={start:o,end:e,a:null,t:null})}function F(o,e){var t=(e&CI)!==0,i=(e&EI)!==0,n,s=!o.startsWith("<!>");return()=>{n===void 0&&(n=L6(s?o:"<!>"+o),t||(n=Ja(n)));var r=i||h6?document.importNode(n,!0):n.cloneNode(!0);if(t){var a=Ja(r),d=r.lastChild;Uu(a,d)}else Uu(r,r);return r}}function hP(o,e,t="svg"){var i=!o.startsWith("<!>"),n=`<${t}>${i?o:"<!>"+o}</${t}>`,s;return()=>{if(!s){var r=L6(n),a=Ja(r);s=Ja(a)}var d=s.cloneNode(!0);return Uu(d,d),d}}function pb(o,e){return hP(o,e,"svg")}function mo(o=""){{var e=Tl(o+"");return Uu(e,e),e}}function Hs(){var o=document.createDocumentFragment(),e=document.createComment(""),t=Tl();return o.append(e,t),Uu(e,t),o}function D(o,e){o!==null&&o.before(e)}function O(o,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(o[ig]??(o[ig]=o.nodeValue))&&(o[ig]=t,o.nodeValue=`${t}`)}function fP(o,e){return gP(o,e)}const Ex=new Map;function gP(o,{target:e,anchor:t,props:i={},events:n,context:s,intro:r=!0,transformError:a}){QI();var d=void 0,u=nP(()=>{var f=t??e.appendChild(Tl());HI(f,{pending:()=>{}},C=>{Js({});var b=Ro;s&&(b.c=s),n&&(i.$$events=n),d=o(C,i)||{},eo()},a);var g=new Set,p=C=>{for(var b=0;b<C.length;b++){var E=C[b];if(!g.has(E)){g.add(E);var w=cP(E);for(const T of[e,document]){var A=Ex.get(T);A===void 0&&(A=new Map,Ex.set(T,A));var I=A.get(E);I===void 0?(T.addEventListener(E,w1,{passive:w}),A.set(E,1)):A.set(E,I+1)}}}};return p(cb(F6)),y1.add(p),()=>{var w;for(var C of g)for(const A of[e,document]){var b=Ex.get(A),E=b.get(C);--E==0?(A.removeEventListener(C,w1),b.delete(C),b.size===0&&Ex.delete(A)):b.set(C,E)}y1.delete(p),f!==t&&((w=f.parentNode)==null||w.removeChild(f))}});return pP.set(d,u),d}let pP=new WeakMap;var fa,Ua,Br,Vd,Ip,Pp,Qm;class xP{constructor(e,t=!0){Un(this,"anchor");Mn(this,fa,new Map);Mn(this,Ua,new Map);Mn(this,Br,new Map);Mn(this,Vd,new Set);Mn(this,Ip,!0);Mn(this,Pp,e=>{if(ke(this,fa).has(e)){var t=ke(this,fa).get(e),i=ke(this,Ua).get(t);if(i)Vv(i),ke(this,Vd).delete(t);else{var n=ke(this,Br).get(t);n&&(Vv(n.effect),ke(this,Ua).set(t,n.effect),ke(this,Br).delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[s,r]of ke(this,fa)){if(ke(this,fa).delete(s),s===e)break;const a=ke(this,Br).get(r);a&&(Cr(a.effect),ke(this,Br).delete(r))}for(const[s,r]of ke(this,Ua)){if(s===t||ke(this,Vd).has(s))continue;const a=()=>{if(Array.from(ke(this,fa).values()).includes(s)){var u=document.createDocumentFragment();f9(r,u),u.append(Tl()),ke(this,Br).set(s,{effect:r,fragment:u})}else Cr(r);ke(this,Vd).delete(s),ke(this,Ua).delete(s)};ke(this,Ip)||!i?(ke(this,Vd).add(s),Zd(r,a,!1)):a()}}});Mn(this,Qm,e=>{ke(this,fa).delete(e);const t=Array.from(ke(this,fa).values());for(const[i,n]of ke(this,Br))t.includes(i)||(Cr(n.effect),ke(this,Br).delete(i))});this.anchor=e,Rn(this,Ip,t)}ensure(e,t){var i=xn,n=p6();if(t&&!ke(this,Ua).has(e)&&!ke(this,Br).has(e))if(n){var s=document.createDocumentFragment(),r=Tl();s.append(r),ke(this,Br).set(e,{effect:Gr(()=>t(r)),fragment:s})}else ke(this,Ua).set(e,Gr(()=>t(this.anchor)));if(ke(this,fa).set(i,e),n){for(const[a,d]of ke(this,Ua))a===e?i.unskip_effect(d):i.skip_effect(d);for(const[a,d]of ke(this,Br))a===e?i.unskip_effect(d.effect):i.skip_effect(d.effect);i.oncommit(ke(this,Pp)),i.ondiscard(ke(this,Qm))}else ke(this,Pp).call(this,i)}}fa=new WeakMap,Ua=new WeakMap,Br=new WeakMap,Vd=new WeakMap,Ip=new WeakMap,Pp=new WeakMap,Qm=new WeakMap;function N(o,e,t=!1){var i=new xP(o),n=t?n0:0;function s(r,a){i.ensure(r,a)}u9(()=>{var r=!1;e((a,d=0)=>{r=!0,s(d,a)}),r||s(-1,null)},n)}function Ri(o,e){return e}function vP(o,e,t){for(var i=[],n=e.length,s,r=e.length,a=0;a<n;a++){let g=e[a];Zd(g,()=>{if(s){if(s.pending.delete(g),s.done.add(g),s.pending.size===0){var p=o.outrogroups;S1(o,cb(s.done)),p.delete(s),p.size===0&&(o.outrogroups=null)}}else r-=1},!1)}if(r===0){var d=i.length===0&&t!==null;if(d){var u=t,f=u.parentNode;JI(f),f.append(u),o.items.clear()}S1(o,e,!d)}else s={pending:new Set(e),done:new Set},(o.outrogroups??(o.outrogroups=new Set)).add(s)}function S1(o,e,t=!0){var i;if(o.pending.size>0){i=new Set;for(const r of o.pending.values())for(const a of r)i.add(o.items.get(a).e)}for(var n=0;n<e.length;n++){var s=e[n];if(i!=null&&i.has(s)){s.f|=Qa;const r=document.createDocumentFragment();f9(s,r)}else Cr(e[n],t)}}var _8;function ti(o,e,t,i,n,s=null){var r=o,a=new Map,d=(e&qk)!==0;if(d){var u=o;r=u.appendChild(Tl())}var f=null,g=o9(()=>{var T=t();return t9(T)?T:T==null?[]:cb(T)}),p,C=new Map,b=!0;function E(T){(I.effect.f&ea)===0&&(I.pending.delete(T),I.fallback=f,mP(I,p,r,e,i),f!==null&&(p.length===0?(f.f&Qa)===0?Vv(f):(f.f^=Qa,og(f,null,r)):Zd(f,()=>{f=null})))}function w(T){I.pending.delete(T)}var A=u9(()=>{p=l(g);for(var T=p.length,M=new Set,P=xn,j=p6(),U=0;U<T;U+=1){var Q=p[U],oe=i(Q,U),le=b?null:a.get(oe);le?(le.v&&o0(le.v,Q),le.i&&o0(le.i,U),j&&P.unskip_effect(le.e)):(le=_P(a,b?r:_8??(_8=Tl()),Q,oe,U,n,e,t),b||(le.e.f|=Qa),a.set(oe,le)),M.add(oe)}if(T===0&&s&&!f&&(b?f=Gr(()=>s(r)):(f=Gr(()=>s(_8??(_8=Tl()))),f.f|=Qa)),T>M.size&&nI(),!b)if(C.set(P,M),j){for(const[re,ce]of a)M.has(re)||P.skip_effect(ce.e);P.oncommit(E),P.ondiscard(w)}else E(P);l(g)}),I={effect:A,items:a,pending:C,outrogroups:null,fallback:f};b=!1}function q0(o){for(;o!==null&&(o.f&wa)===0;)o=o.next;return o}function mP(o,e,t,i,n){var le,re,ce,Se,ie,ge,me,Be,he;var s=(i&pI)!==0,r=e.length,a=o.items,d=q0(o.effect.first),u,f=null,g,p=[],C=[],b,E,w,A;if(s)for(A=0;A<r;A+=1)b=e[A],E=n(b,A),w=a.get(E).e,(w.f&Qa)===0&&((re=(le=w.nodes)==null?void 0:le.a)==null||re.measure(),(g??(g=new Set)).add(w));for(A=0;A<r;A+=1){if(b=e[A],E=n(b,A),w=a.get(E).e,o.outrogroups!==null)for(const De of o.outrogroups)De.pending.delete(w),De.done.delete(w);if((w.f&nr)!==0&&(Vv(w),s&&((Se=(ce=w.nodes)==null?void 0:ce.a)==null||Se.unfix(),(g??(g=new Set)).delete(w))),(w.f&Qa)!==0)if(w.f^=Qa,w===d)og(w,null,t);else{var I=f?f.next:d;w===o.effect.last&&(o.effect.last=w.prev),w.prev&&(w.prev.next=w.next),w.next&&(w.next.prev=w.prev),hc(o,f,w),hc(o,w,I),og(w,I,t),f=w,p=[],C=[],d=q0(f.next);continue}if(w!==d){if(u!==void 0&&u.has(w)){if(p.length<C.length){var T=C[0],M;f=T.prev;var P=p[0],j=p[p.length-1];for(M=0;M<p.length;M+=1)og(p[M],T,t);for(M=0;M<C.length;M+=1)u.delete(C[M]);hc(o,P.prev,j.next),hc(o,f,P),hc(o,j,T),d=T,f=j,A-=1,p=[],C=[]}else u.delete(w),og(w,d,t),hc(o,w.prev,w.next),hc(o,w,f===null?o.effect.first:f.next),hc(o,f,w),f=w;continue}for(p=[],C=[];d!==null&&d!==w;)(u??(u=new Set)).add(d),C.push(d),d=q0(d.next);if(d===null)continue}(w.f&Qa)===0&&p.push(w),f=w,d=q0(w.next)}if(o.outrogroups!==null){for(const De of o.outrogroups)De.pending.size===0&&(S1(o,cb(De.done)),(ie=o.outrogroups)==null||ie.delete(De));o.outrogroups.size===0&&(o.outrogroups=null)}if(d!==null||u!==void 0){var U=[];if(u!==void 0)for(w of u)(w.f&nr)===0&&U.push(w);for(;d!==null;)(d.f&nr)===0&&d!==o.fallback&&U.push(d),d=q0(d.next);var Q=U.length;if(Q>0){var oe=(i&qk)!==0&&r===0?t:null;if(s){for(A=0;A<Q;A+=1)(me=(ge=U[A].nodes)==null?void 0:ge.a)==null||me.measure();for(A=0;A<Q;A+=1)(he=(Be=U[A].nodes)==null?void 0:Be.a)==null||he.fix()}vP(o,U,oe)}}s&&Nc(()=>{var De,Re;if(g!==void 0)for(w of g)(Re=(De=w.nodes)==null?void 0:De.a)==null||Re.apply()})}function _P(o,e,t,i,n,s,r,a){var d=(r&fI)!==0?(r&xI)===0?ZI(t,!1,!1):$u(t):null,u=(r&gI)!==0?$u(n):null;return{v:d,i:u,e:Gr(()=>(s(e,d??t,u??n,a),()=>{o.delete(i)}))}}function og(o,e,t){if(o.nodes)for(var i=o.nodes.start,n=o.nodes.end,s=e&&(e.f&Qa)===0?e.nodes.start:t;i!==null;){var r=Qp(i);if(s.before(i),i===n)return;i=r}}function hc(o,e,t){e===null?o.effect.first=t:e.next=t,t===null?o.effect.last=e:t.prev=e}function Fc(o,e,t=!1,i=!1,n=!1,s=!1){var r=o,a="";if(t)var d=o;W(()=>{var u=rs;if(a!==(a=e()??"")){if(t){u.nodes=null,d.innerHTML=a,a!==""&&Uu(Ja(d),d.lastChild);return}if(u.nodes!==null&&(_6(u.nodes.start,u.nodes.end),u.nodes=null),a!==""){var f=i?yI:n?wI:void 0,g=x6(i?"svg":n?"math":"template",f);g.innerHTML=a;var p=i||n?g:g.content;if(Uu(Ja(p),p.lastChild),i||n)for(;Ja(p);)r.before(Ja(p));else r.before(p)}}})}function I6(o){var e,t,i="";if(typeof o=="string"||typeof o=="number")i+=o;else if(typeof o=="object")if(Array.isArray(o)){var n=o.length;for(e=0;e<n;e++)o[e]&&(t=I6(o[e]))&&(i&&(i+=" "),i+=t)}else for(t in o)o[t]&&(i&&(i+=" "),i+=t);return i}function bP(){for(var o,e,t=0,i="",n=arguments.length;t<n;t++)(o=arguments[t])&&(e=I6(o))&&(i&&(i+=" "),i+=e);return i}function yg(o){return typeof o=="object"?bP(o):o??""}const b8=[...`
|
|
3
3
|
\r\f \v\uFEFF`];function CP(o,e,t){var i=o==null?"":""+o;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,r=0;(r=i.indexOf(n,r))>=0;){var a=r+s;(r===0||b8.includes(i[r-1]))&&(a===i.length||b8.includes(i[a]))?i=(r===0?"":i.substring(0,r))+i.substring(a+1):r=a}}return i===""?null:i}function C8(o,e=!1){var t=e?" !important;":";",i="";for(var n of Object.keys(o)){var s=o[n];s!=null&&s!==""&&(i+=" "+n+": "+s+t)}return i}function oC(o){return o[0]!=="-"||o[1]!=="-"?o.toLowerCase():o}function EP(o,e){if(e){var t="",i,n;if(Array.isArray(e)?(i=e[0],n=e[1]):i=e,o){o=String(o).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,r=0,a=!1,d=[];i&&d.push(...Object.keys(i).map(oC)),n&&d.push(...Object.keys(n).map(oC));var u=0,f=-1;const E=o.length;for(var g=0;g<E;g++){var p=o[g];if(a?p==="/"&&o[g-1]==="*"&&(a=!1):s?s===p&&(s=!1):p==="/"&&o[g+1]==="*"?a=!0:p==='"'||p==="'"?s=p:p==="("?r++:p===")"&&r--,!a&&s===!1&&r===0){if(p===":"&&f===-1)f=g;else if(p===";"||g===E-1){if(f!==-1){var C=oC(o.substring(u,f).trim());if(!d.includes(C)){p!==";"&&g++;var b=o.substring(u,g).trim();t+=" "+b+";"}}u=g+1,f=-1}}}}return i&&(t+=C8(i)),n&&(t+=C8(n,!0)),t=t.trim(),t===""?null:t}return o==null?null:String(o)}function kt(o,e,t,i,n,s){var r=o[p1];if(r!==t||r===void 0){var a=CP(t,i,s);a==null?o.removeAttribute("class"):e?o.className=a:o.setAttribute("class",a),o[p1]=t}else if(s&&n!==s)for(var d in s){var u=!!s[d];(n==null||u!==!!n[d])&&o.classList.toggle(d,u)}return s}function rC(o,e={},t,i){for(var n in t){var s=t[n];e[n]!==s&&(t[n]==null?o.style.removeProperty(n):o.style.setProperty(n,s,i))}}function Io(o,e,t,i){var n=o[x1];if(n!==e){var s=EP(e,i);s==null?o.removeAttribute("style"):o.style.cssText=s,o[x1]=e}else i&&(Array.isArray(i)?(rC(o,t==null?void 0:t[0],i[0]),rC(o,t==null?void 0:t[1],i[1],"important")):rC(o,t,i));return i}function jv(o,e,t=!1){if(o.multiple){if(e==null)return;if(!t9(e))return DI();for(var i of o.options)i.selected=e.includes(wg(i));return}for(i of o.options){var n=wg(i);if(YI(n,e)){i.selected=!0;return}}(!t||e!==void 0)&&(o.selectedIndex=-1)}function D1(o){var e=new MutationObserver(()=>{jv(o,o.__value)});e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),c9(()=>{e.disconnect()})}function Ks(o,e,t=e){var i=new WeakSet,n=!0;a9(o,"change",s=>{var r=s?"[selected]":":checked",a;if(o.multiple)a=[].map.call(o.querySelectorAll(r),wg);else{var d=o.querySelector(r)??o.querySelector("option:not([disabled])");a=d&&wg(d)}t(a),o.__value=a,xn!==null&&i.add(xn)}),d9(()=>{var s=e();if(o===document.activeElement){var r=xn;if(i.has(r))return}if(jv(o,s,n),n&&s===void 0){var a=o.querySelector(":checked");a!==null&&(s=wg(a),t(s))}o.__value=s,n=!1}),D1(o)}function wg(o){return"__value"in o?o.__value:o.value}const yP=Symbol("is custom element"),wP=Symbol("is html"),SP=tI?"progress":"PROGRESS";function A1(o,e){var t=g9(o);t.value===(t.value=e??void 0)||o.value===e&&(e!==0||o.nodeName!==SP)||(o.value=e??"")}function mr(o,e){var t=g9(o);t.checked!==(t.checked=e??void 0)&&(o.checked=e)}function fn(o,e,t,i){var n=g9(o);n[e]!==(n[e]=t)&&(e==="loading"&&(o[eI]=t),t==null?o.removeAttribute(e):typeof t!="string"&&DP(o).includes(e)?o[e]=t:o.setAttribute(e,t))}function g9(o){return o[nv]??(o[nv]={[yP]:o.nodeName.includes("-"),[wP]:o.namespaceURI===Gk})}var E8=new Map;function DP(o){var e=o.getAttribute("is")||o.nodeName,t=E8.get(e);if(t)return t;E8.set(e,t=[]);for(var i,n=o,s=Element.prototype;s!==n;){i=qL(n);for(var r in i)i[r].set&&r!=="innerHTML"&&r!=="textContent"&&r!=="innerText"&&t.push(r);n=Vk(n)}return t}function At(o,e,t=e){var i=new WeakSet;a9(o,"input",async n=>{var s=n?o.defaultValue:o.value;if(s=aC(o)?lC(s):s,t(s),xn!==null&&i.add(xn),await Dl(),s!==(s=e())){var r=o.selectionStart,a=o.selectionEnd,d=o.value.length;if(o.value=s??"",a!==null){var u=o.value.length;r===a&&a===d&&u>d?(o.selectionStart=u,o.selectionEnd=u):(o.selectionStart=r,o.selectionEnd=Math.min(a,u))}}}),Jl(e)==null&&o.value&&(t(aC(o)?lC(o.value):o.value),xn!==null&&i.add(xn)),gb(()=>{var n=e();if(o===document.activeElement){var s=xn;if(i.has(s))return}aC(o)&&n===lC(o.value)||o.type==="date"&&!n&&!o.value||n!==o.value&&(o.value=n??"")})}function Os(o,e,t=e){a9(o,"change",i=>{var n=i?o.defaultChecked:o.checked;t(n)}),Jl(e)==null&&t(o.checked),gb(()=>{var i=e();o.checked=!!i})}function aC(o){var e=o.type;return e==="number"||e==="range"}function lC(o){return o===""?null:+o}var Ac,Mf,Tp,Jm,P6;const e_=class e_{constructor(e){Mn(this,Jm);Mn(this,Ac,new WeakMap);Mn(this,Mf);Mn(this,Tp);Rn(this,Tp,e)}observe(e,t){var i=ke(this,Ac).get(e)||new Set;return i.add(t),ke(this,Ac).set(e,i),ys(this,Jm,P6).call(this).observe(e,ke(this,Tp)),()=>{var n=ke(this,Ac).get(e);n.delete(t),n.size===0&&(ke(this,Ac).delete(e),ke(this,Mf).unobserve(e))}}};Ac=new WeakMap,Mf=new WeakMap,Tp=new WeakMap,Jm=new WeakSet,P6=function(){return ke(this,Mf)??Rn(this,Mf,new ResizeObserver(e=>{for(var t of e){e_.entries.set(t.target,t);for(var i of ke(this,Ac).get(t.target)||[])i(t)}}))},Un(e_,"entries",new WeakMap);let k1=e_;var AP=new k1({box:"border-box"});function kP(o,e,t){var i=AP.observe(o,()=>t(o[e]));d9(()=>(Jl(()=>t(o[e])),i))}function cC(o,e){return o===e||(o==null?void 0:o[qd])===e}function Bs(o={},e,t,i){var n=Ro.r,s=rs;return d9(()=>{var r,a;return gb(()=>{r=a,a=[],Jl(()=>{cC(t(...a),o)||(e(o,...a),r&&cC(t(...r),o)&&e(null,...r))})}),()=>{let d=s;for(;d!==n&&d.parent!==null&&d.parent.f&g1;)d=d.parent;const u=()=>{a&&cC(t(...a),o)&&e(null,...a)},f=d.teardown;d.teardown=()=>{u(),f==null||f()}}}),o}function qu(o,e,t,i){var M;var n=!0,s=(t&_I)!==0,r=(t&bI)!==0,a=i,d=!0,u=void 0,f=()=>r&&n?(u??(u=Yg(i)),l(u)):(d&&(d=!1,a=r?Jl(i):i),a);let g;if(s){var p=qd in o||JL in o;g=((M=yf(o,e))==null?void 0:M.set)??(p&&e in o?P=>o[e]=P:void 0)}var C,b=!1;s?[C,b]=II(()=>o[e]):C=o[e],C===void 0&&i!==void 0&&(C=f(),g&&(lI(),g(C)));var E;if(E=()=>{var P=o[e];return P===void 0?f():(d=!0,P)},(t&mI)===0)return E;if(g){var w=o.$$legacy;return(function(P,j){return arguments.length>0?((!j||w||b)&&g(j?E():P),P):E()})}var A=!1,I=((t&vI)!==0?Yg:o9)(()=>(A=!1,E()));s&&l(I);var T=rs;return(function(P,j){if(arguments.length>0){const U=j?l(I):s?vi(P):P;return x(I,U),A=!0,a!==void 0&&(a=U),P}return Vl&&A||(T.f&ea)!==0?I.v:l(I)})}function no(o){Ro===null&&Uk(),vs(()=>{const e=Jl(o);if(typeof e=="function")return e})}function B0(o){Ro===null&&Uk(),no(()=>()=>Jl(o))}const BP="5";var dA;typeof window<"u"&&((dA=window.__svelte??(window.__svelte={})).v??(dA.v=new Set)).add(BP);/*!-----------------------------------------------------------------------------
|
|
4
4
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10,7 +10,7 @@ var c3=Object.defineProperty;var LS=o=>{throw TypeError(o)};var d3=(o,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 WP=Object.defineProperty,zP=Object.getOwnPropertyDescriptor,VP=Object.getOwnPropertyNames,jP=Object.prototype.hasOwnProperty,$P=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of VP(e))!jP.call(o,n)&&n!==t&&WP(o,n,{get:()=>e[n],enumerable:!(i=zP(e,n))||i.enumerable});return o},UP=(o,e,t)=>($P(o,e,"default"),t),qP="5.4.5",a0={};UP(a0,hA);var R6=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(R6||{}),N6=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(N6||{}),O6=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(O6||{}),H6=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(H6||{}),W6=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(W6||{}),z6=class{constructor(o,e,t,i,n){this._onDidChange=new a0.Emitter,this._onDidExtraLibsChange=new a0.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),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(o,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===o)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:o,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(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){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(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},GP=qP,V6={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},j6=new z6({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},V6),$6=new z6({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},V6),KP=()=>xb().then(o=>o.getTypeScriptWorker()),ZP=()=>xb().then(o=>o.getJavaScriptWorker());a0.languages.typescript={ModuleKind:R6,JsxEmit:N6,NewLineKind:O6,ScriptTarget:H6,ModuleResolutionKind:W6,typescriptVersion:GP,typescriptDefaults:j6,javascriptDefaults:$6,getTypeScriptWorker:KP,getJavaScriptWorker:ZP};function xb(){return uA(()=>import("./tsMode-4yeSlBtg.js"),__vite__mapDeps([3,1,2]))}a0.languages.onLanguage("typescript",()=>xb().then(o=>o.setupTypeScript(j6)));a0.languages.onLanguage("javascript",()=>xb().then(o=>o.setupJavaScript($6)));class XP extends Ko{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Ei("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:tn.map,toggled:Ue.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Ue.has("isInDiffEditor"),menu:{when:Ue.has("isInDiffEditor"),id:oi.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Ds),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class U6 extends Ko{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Ei("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(Ds),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class q6 extends Ko{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Ei("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(Ds),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const tx=Ei("diffEditor","Diff Editor");class YP extends Sa{constructor(){super({id:"diffEditor.switchSide",title:Ei("switchSide","Switch Side"),icon:tn.arrowSwap,precondition:Ue.has("isInDiffEditor"),f1:!0,category:tx})}runEditorCommand(e,t,i){const n=F0(e);if(n instanceof Mp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class QP extends Sa{constructor(){super({id:"diffEditor.exitCompareMove",title:Ei("exitCompareMove","Exit Compare Move"),icon:tn.close,precondition:K.comparingMovedCode,f1:!1,category:tx,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Mp&&n.exitCompareMove()}}class JP extends Sa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Ei("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:tn.fold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:tx})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Mp&&n.collapseAllUnchangedRegions()}}class eT extends Sa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Ei("showAllUnchangedRegions","Show All Unchanged Regions"),icon:tn.unfold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:tx})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Mp&&n.showAllUnchangedRegions()}}class B1 extends Ko{constructor(){super({id:"diffEditor.revert",title:Ei("revert","Revert"),f1:!1,category:tx})}run(e,t){const i=tT(e,t.originalUri,t.modifiedUri);i instanceof Mp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const G6=Ei("accessibleDiffViewer","Accessible Diff Viewer"),t_=class t_ extends Ko{constructor(){super({id:t_.id,title:Ei("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:G6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=F0(e);t==null||t.accessibleDiffViewerNext()}};t_.id="editor.action.accessibleDiffViewer.next";let Jg=t_;const i_=class i_ extends Ko{constructor(){super({id:i_.id,title:Ei("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:G6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=F0(e);t==null||t.accessibleDiffViewerPrev()}};i_.id="editor.action.accessibleDiffViewer.prev";let $v=i_;function tT(o,e,t){return o.get($s).listDiffEditors().find(s=>{var d,u;const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&((d=r.getModel())==null?void 0:d.uri.toString())===t.toString()&&a&&((u=a.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function F0(o){const t=o.get($s).listDiffEditors(),i=fA();if(i)for(const n of t){const s=n.getContainerDomNode();if(iT(s,i))return n}return null}function iT(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}as(XP);as(U6);as(q6);ta.appendMenuItem(oi.EditorTitle,{command:{id:new q6().desc.id,title:S("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Ue.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Ue.has("isInDiffEditor")},order:11,group:"1_diff",when:Ue.and(K.diffEditorRenderSideBySideInlineBreakpointReached,Ue.has("isInDiffEditor"))});ta.appendMenuItem(oi.EditorTitle,{command:{id:new U6().desc.id,title:S("showMoves","Show Moved Code Blocks"),icon:tn.move,toggled:u3.create("config.diffEditor.experimental.showMoves",!0),precondition:Ue.has("isInDiffEditor")},order:10,group:"1_diff",when:Ue.has("isInDiffEditor")});as(B1);for(const o of[{icon:tn.arrowRight,key:K.diffEditorInlineMode.toNegated()},{icon:tn.discard,key:K.diffEditorInlineMode}])ta.appendMenuItem(oi.DiffEditorHunkToolbar,{command:{id:new B1().desc.id,title:S("revertHunk","Revert Block"),icon:o.icon},when:Ue.and(K.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),ta.appendMenuItem(oi.DiffEditorSelectionToolbar,{command:{id:new B1().desc.id,title:S("revertSelection","Revert Selection"),icon:o.icon},when:Ue.and(K.diffEditorModifiedWritable,o.key),order:5,group:"primary"});as(YP);as(QP);as(JP);as(eT);ta.appendMenuItem(oi.EditorTitle,{command:{id:Jg.id,title:S("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Ue.has("isInDiffEditor")},order:10,group:"2_diff",when:Ue.and(K.accessibleDiffViewerVisible.negate(),Ue.has("isInDiffEditor"))});Cs.registerCommandAlias("editor.action.diffReview.next",Jg.id);as(Jg);Cs.registerCommandAlias("editor.action.diffReview.prev",$v.id);as($v);var nT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sT=function(o,e){return function(t,i){e(t,i,o)}},F1;const vb=new Nn("selectionAnchorSet",!1);var eu;let od=(eu=class{static get(e){return e.getContribution(F1.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=vb.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(Xi.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Fo().appendText(S("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ia(S("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(Xi.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()}},F1=eu,eu.ID="editor.contrib.selectionAnchorController",eu);od=F1=nT([sT(1,Gn)],od);class oT extends Ct{constructor(){super({id:"editor.action.setSelectionAnchor",label:S("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:Zs(2089,2080),weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.setSelectionAnchor()}}class rT extends Ct{constructor(){super({id:"editor.action.goToSelectionAnchor",label:S("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:vb})}async run(e,t){var i;(i=od.get(t))==null||i.goToSelectionAnchor()}}class aT extends Ct{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:S("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:vb,kbOpts:{kbExpr:K.editorTextFocus,primary:Zs(2089,2089),weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.selectFromAnchorToCursor()}}class lT extends Ct{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:S("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:vb,kbOpts:{kbExpr:K.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.cancelSelectionAnchor()}}Sn(od.ID,od,4);Ne(oT);Ne(rT);Ne(aT);Ne(lT);const cT=mi("editorOverviewRuler.bracketMatchForeground","#A0A0A0",S("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class dT extends Ct{constructor(){super({id:"editor.action.jumpToBracket",label:S("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Gu.get(t))==null||i.jumpToBracket()}}class uT extends Ct{constructor(){super({id:"editor.action.selectToBracket",label:S("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Ei("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=Gu.get(t))==null||s.selectToBracket(n)}}class hT extends Ct{constructor(){super({id:"editor.action.removeBrackets",label:S("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Gu.get(t))==null||i.removeBrackets(this.id)}}class fT{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const bc=class bc extends Ot{static get(e){return e.getContribution(bc.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new io(()=>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 r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(r=d.range.getStartPosition())}}return r?new Xi(r.lineNumber,r.column,r.lineNumber,r.column):new Xi(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 r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(r=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let a=null,d=null;if(r){r.sort(ee.compareRangesUsingStarts);const[u,f]=r;if(a=e?u.getStartPosition():u.getEndPosition(),d=e?f.getEndPosition():f.getStartPosition(),f.containsPosition(s)){const g=a;a=d,d=g}}a&&d&&i.push(new Xi(a.lineNumber,a.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 r=0;for(let g=0,p=e.length;g<p;g++){const C=e[g];C.isEmpty()&&(s[r++]=C.getStartPosition())}s.length>1&&s.sort(wi.compare);const a=[];let d=0,u=0;const f=n.length;for(let g=0,p=s.length;g<p;g++){const C=s[g];for(;u<f&&n[u].position.isBefore(C);)u++;if(u<f&&n[u].position.equals(C))a[d++]=n[u];else{let b=t.bracketPairs.matchBracket(C,20),E=bc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!b&&this._matchBrackets==="always"&&(b=t.bracketPairs.findEnclosingBrackets(C,20),E=bc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[d++]=new fT(C,b,E)}}this._lastBracketsData=a,this._lastVersionId=i}};bc.ID="editor.contrib.bracketMatchingController",bc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Tn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Qs(cT),position:tl.Center}}),bc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Tn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Gu=bc;Sn(Gu.ID,Gu,1);Ne(uT);Ne(dT);Ne(hT);ta.appendMenuItem(oi.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:S({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class gT{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 r=new ee(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new ee(i,s,i,s),a)}else{const r=new ee(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new ee(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new Xi(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Xi(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class K6 extends Ct{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 gT(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class pT extends K6{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:S("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:K.writable})}}class xT extends K6{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:S("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:K.writable})}}Ne(pT);Ne(xT);class vT extends Ct{constructor(){super({id:"editor.action.transposeLetters",label:S("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:K.writable,kbOpts:{kbExpr:K.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 r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,d=r.startColumn,u=i.getLineMaxColumn(a);if(a===1&&(d===1||d===2&&u===2))continue;const f=d===u?r.getPosition():Zb.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),g=Zb.leftPosition(i,f),p=Zb.leftPosition(i,g),C=i.getValueInRange(ee.fromPositions(p,g)),b=i.getValueInRange(ee.fromPositions(g,f)),E=ee.fromPositions(p,f);n.push(new Rp(E,b+C))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Ne(vT);const mb=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=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(){o(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 p9(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function mT(o,e,t){const i={id:mb(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class Z6{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 Ll.some(this,([i,n])=>n.asFile())&&t.push("files"),Y6(Uv(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 Uv(e)}}function Uv(o){return o.toLowerCase()}function X6(o,e){return Y6(Uv(o),e.map(Uv))}function Y6(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const _b=Object.freeze({create:o=>gA(o.map(e=>e.toString())).join(`\r
|
|
13
|
+
*-----------------------------------------------------------------------------*/var WP=Object.defineProperty,zP=Object.getOwnPropertyDescriptor,VP=Object.getOwnPropertyNames,jP=Object.prototype.hasOwnProperty,$P=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of VP(e))!jP.call(o,n)&&n!==t&&WP(o,n,{get:()=>e[n],enumerable:!(i=zP(e,n))||i.enumerable});return o},UP=(o,e,t)=>($P(o,e,"default"),t),qP="5.4.5",a0={};UP(a0,hA);var R6=(o=>(o[o.None=0]="None",o[o.CommonJS=1]="CommonJS",o[o.AMD=2]="AMD",o[o.UMD=3]="UMD",o[o.System=4]="System",o[o.ES2015=5]="ES2015",o[o.ESNext=99]="ESNext",o))(R6||{}),N6=(o=>(o[o.None=0]="None",o[o.Preserve=1]="Preserve",o[o.React=2]="React",o[o.ReactNative=3]="ReactNative",o[o.ReactJSX=4]="ReactJSX",o[o.ReactJSXDev=5]="ReactJSXDev",o))(N6||{}),O6=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(O6||{}),H6=(o=>(o[o.ES3=0]="ES3",o[o.ES5=1]="ES5",o[o.ES2015=2]="ES2015",o[o.ES2016=3]="ES2016",o[o.ES2017=4]="ES2017",o[o.ES2018=5]="ES2018",o[o.ES2019=6]="ES2019",o[o.ES2020=7]="ES2020",o[o.ESNext=99]="ESNext",o[o.JSON=100]="JSON",o[o.Latest=99]="Latest",o))(H6||{}),W6=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(W6||{}),z6=class{constructor(o,e,t,i,n){this._onDidChange=new a0.Emitter,this._onDidExtraLibsChange=new a0.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(o),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(o,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===o)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:o,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(o){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),o&&o.length>0)for(const e of o){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(o){this._compilerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(o){this._diagnosticsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(o){this._workerOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(o){this._inlayHintsOptions=o||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(o){}setEagerModelSync(o){this._eagerModelSync=o}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(o){this._modeConfiguration=o||Object.create(null),this._onDidChange.fire(void 0)}},GP=qP,V6={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},j6=new z6({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},V6),$6=new z6({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},V6),KP=()=>xb().then(o=>o.getTypeScriptWorker()),ZP=()=>xb().then(o=>o.getJavaScriptWorker());a0.languages.typescript={ModuleKind:R6,JsxEmit:N6,NewLineKind:O6,ScriptTarget:H6,ModuleResolutionKind:W6,typescriptVersion:GP,typescriptDefaults:j6,javascriptDefaults:$6,getTypeScriptWorker:KP,getJavaScriptWorker:ZP};function xb(){return uA(()=>import("./tsMode-HwpLJXZi.js"),__vite__mapDeps([3,1,2]))}a0.languages.onLanguage("typescript",()=>xb().then(o=>o.setupTypeScript(j6)));a0.languages.onLanguage("javascript",()=>xb().then(o=>o.setupJavaScript($6)));class XP extends Ko{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Ei("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:tn.map,toggled:Ue.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Ue.has("isInDiffEditor"),menu:{when:Ue.has("isInDiffEditor"),id:oi.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Ds),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class U6 extends Ko{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Ei("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(Ds),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class q6 extends Ko{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Ei("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:Ue.has("isInDiffEditor")})}run(e,...t){const i=e.get(Ds),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const tx=Ei("diffEditor","Diff Editor");class YP extends Sa{constructor(){super({id:"diffEditor.switchSide",title:Ei("switchSide","Switch Side"),icon:tn.arrowSwap,precondition:Ue.has("isInDiffEditor"),f1:!0,category:tx})}runEditorCommand(e,t,i){const n=F0(e);if(n instanceof Mp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class QP extends Sa{constructor(){super({id:"diffEditor.exitCompareMove",title:Ei("exitCompareMove","Exit Compare Move"),icon:tn.close,precondition:K.comparingMovedCode,f1:!1,category:tx,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Mp&&n.exitCompareMove()}}class JP extends Sa{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Ei("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:tn.fold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:tx})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Mp&&n.collapseAllUnchangedRegions()}}class eT extends Sa{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Ei("showAllUnchangedRegions","Show All Unchanged Regions"),icon:tn.unfold,precondition:Ue.has("isInDiffEditor"),f1:!0,category:tx})}runEditorCommand(e,t,...i){const n=F0(e);n instanceof Mp&&n.showAllUnchangedRegions()}}class B1 extends Ko{constructor(){super({id:"diffEditor.revert",title:Ei("revert","Revert"),f1:!1,category:tx})}run(e,t){const i=tT(e,t.originalUri,t.modifiedUri);i instanceof Mp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const G6=Ei("accessibleDiffViewer","Accessible Diff Viewer"),t_=class t_ extends Ko{constructor(){super({id:t_.id,title:Ei("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:G6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=F0(e);t==null||t.accessibleDiffViewerNext()}};t_.id="editor.action.accessibleDiffViewer.next";let Jg=t_;const i_=class i_ extends Ko{constructor(){super({id:i_.id,title:Ei("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:G6,precondition:Ue.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=F0(e);t==null||t.accessibleDiffViewerPrev()}};i_.id="editor.action.accessibleDiffViewer.prev";let $v=i_;function tT(o,e,t){return o.get($s).listDiffEditors().find(s=>{var d,u;const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&((d=r.getModel())==null?void 0:d.uri.toString())===t.toString()&&a&&((u=a.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function F0(o){const t=o.get($s).listDiffEditors(),i=fA();if(i)for(const n of t){const s=n.getContainerDomNode();if(iT(s,i))return n}return null}function iT(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}as(XP);as(U6);as(q6);ta.appendMenuItem(oi.EditorTitle,{command:{id:new q6().desc.id,title:S("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Ue.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Ue.has("isInDiffEditor")},order:11,group:"1_diff",when:Ue.and(K.diffEditorRenderSideBySideInlineBreakpointReached,Ue.has("isInDiffEditor"))});ta.appendMenuItem(oi.EditorTitle,{command:{id:new U6().desc.id,title:S("showMoves","Show Moved Code Blocks"),icon:tn.move,toggled:u3.create("config.diffEditor.experimental.showMoves",!0),precondition:Ue.has("isInDiffEditor")},order:10,group:"1_diff",when:Ue.has("isInDiffEditor")});as(B1);for(const o of[{icon:tn.arrowRight,key:K.diffEditorInlineMode.toNegated()},{icon:tn.discard,key:K.diffEditorInlineMode}])ta.appendMenuItem(oi.DiffEditorHunkToolbar,{command:{id:new B1().desc.id,title:S("revertHunk","Revert Block"),icon:o.icon},when:Ue.and(K.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),ta.appendMenuItem(oi.DiffEditorSelectionToolbar,{command:{id:new B1().desc.id,title:S("revertSelection","Revert Selection"),icon:o.icon},when:Ue.and(K.diffEditorModifiedWritable,o.key),order:5,group:"primary"});as(YP);as(QP);as(JP);as(eT);ta.appendMenuItem(oi.EditorTitle,{command:{id:Jg.id,title:S("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Ue.has("isInDiffEditor")},order:10,group:"2_diff",when:Ue.and(K.accessibleDiffViewerVisible.negate(),Ue.has("isInDiffEditor"))});Cs.registerCommandAlias("editor.action.diffReview.next",Jg.id);as(Jg);Cs.registerCommandAlias("editor.action.diffReview.prev",$v.id);as($v);var nT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},sT=function(o,e){return function(t,i){e(t,i,o)}},F1;const vb=new Nn("selectionAnchorSet",!1);var eu;let od=(eu=class{static get(e){return e.getContribution(F1.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=vb.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(Xi.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Fo().appendText(S("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ia(S("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(Xi.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()}},F1=eu,eu.ID="editor.contrib.selectionAnchorController",eu);od=F1=nT([sT(1,Gn)],od);class oT extends Ct{constructor(){super({id:"editor.action.setSelectionAnchor",label:S("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:Zs(2089,2080),weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.setSelectionAnchor()}}class rT extends Ct{constructor(){super({id:"editor.action.goToSelectionAnchor",label:S("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:vb})}async run(e,t){var i;(i=od.get(t))==null||i.goToSelectionAnchor()}}class aT extends Ct{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:S("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:vb,kbOpts:{kbExpr:K.editorTextFocus,primary:Zs(2089,2089),weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.selectFromAnchorToCursor()}}class lT extends Ct{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:S("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:vb,kbOpts:{kbExpr:K.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=od.get(t))==null||i.cancelSelectionAnchor()}}Sn(od.ID,od,4);Ne(oT);Ne(rT);Ne(aT);Ne(lT);const cT=mi("editorOverviewRuler.bracketMatchForeground","#A0A0A0",S("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class dT extends Ct{constructor(){super({id:"editor.action.jumpToBracket",label:S("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Gu.get(t))==null||i.jumpToBracket()}}class uT extends Ct{constructor(){super({id:"editor.action.selectToBracket",label:S("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Ei("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=Gu.get(t))==null||s.selectToBracket(n)}}class hT extends Ct{constructor(){super({id:"editor.action.removeBrackets",label:S("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:K.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Gu.get(t))==null||i.removeBrackets(this.id)}}class fT{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const bc=class bc extends Ot{static get(e){return e.getContribution(bc.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new io(()=>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 r=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?r=s[1].getStartPosition():s[1].containsPosition(n)&&(r=s[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(n);if(a)r=a[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(r=d.range.getStartPosition())}}return r?new Xi(r.lineNumber,r.column,r.lineNumber,r.column):new Xi(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 r=t.bracketPairs.matchBracket(s);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(s),!r)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(r=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let a=null,d=null;if(r){r.sort(ee.compareRangesUsingStarts);const[u,f]=r;if(a=e?u.getStartPosition():u.getEndPosition(),d=e?f.getEndPosition():f.getStartPosition(),f.containsPosition(s)){const g=a;a=d,d=g}}a&&d&&i.push(new Xi(a.lineNumber,a.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 r=0;for(let g=0,p=e.length;g<p;g++){const C=e[g];C.isEmpty()&&(s[r++]=C.getStartPosition())}s.length>1&&s.sort(wi.compare);const a=[];let d=0,u=0;const f=n.length;for(let g=0,p=s.length;g<p;g++){const C=s[g];for(;u<f&&n[u].position.isBefore(C);)u++;if(u<f&&n[u].position.equals(C))a[d++]=n[u];else{let b=t.bracketPairs.matchBracket(C,20),E=bc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!b&&this._matchBrackets==="always"&&(b=t.bracketPairs.findEnclosingBrackets(C,20),E=bc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[d++]=new fT(C,b,E)}}this._lastBracketsData=a,this._lastVersionId=i}};bc.ID="editor.contrib.bracketMatchingController",bc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Tn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:Qs(cT),position:tl.Center}}),bc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Tn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Gu=bc;Sn(Gu.ID,Gu,1);Ne(uT);Ne(dT);Ne(hT);ta.appendMenuItem(oi.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:S({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class gT{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 r=new ee(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new ee(i,s,i,s),a)}else{const r=new ee(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new ee(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new Xi(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Xi(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class K6 extends Ct{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 gT(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class pT extends K6{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:S("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:K.writable})}}class xT extends K6{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:S("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:K.writable})}}Ne(pT);Ne(xT);class vT extends Ct{constructor(){super({id:"editor.action.transposeLetters",label:S("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:K.writable,kbOpts:{kbExpr:K.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 r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,d=r.startColumn,u=i.getLineMaxColumn(a);if(a===1&&(d===1||d===2&&u===2))continue;const f=d===u?r.getPosition():Zb.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),g=Zb.leftPosition(i,f),p=Zb.leftPosition(i,g),C=i.getValueInRange(ee.fromPositions(p,g)),b=i.getValueInRange(ee.fromPositions(g,f)),E=ee.fromPositions(p,f);n.push(new Rp(E,b+C))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Ne(vT);const mb=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let o;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?o=crypto.getRandomValues.bind(crypto):o=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(){o(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 p9(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function mT(o,e,t){const i={id:mb(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class Z6{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 Ll.some(this,([i,n])=>n.asFile())&&t.push("files"),Y6(Uv(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 Uv(e)}}function Uv(o){return o.toLowerCase()}function X6(o,e){return Y6(Uv(o),e.map(Uv))}function Y6(o,e){if(o==="*/*")return e.length>0;if(e.includes(o))return!0;const t=o.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(r=>r.startsWith(n+"/")):!1}const _b=Object.freeze({create:o=>gA(o.map(e=>e.toString())).join(`\r
|
|
14
14
|
`),split:o=>o.split(`\r
|
|
15
15
|
`),parse:o=>_b.split(o).filter(e=>!e.startsWith("#"))}),Wa=class Wa{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+Wa.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Wa((this.value?[this.value,...e]:e).join(Wa.sep))}};Wa.sep=".",Wa.None=new Wa("@@none@@"),Wa.Empty=new Wa("");let Ss=Wa;const y8={EDITORS:"CodeEditors",FILES:"CodeFiles"};class _T{}const bT={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Da.add(bT.DragAndDropContribution,new _T);const Rg=class Rg{constructor(){}static getInstance(){return Rg.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};Rg.INSTANCE=new Rg;let L1=Rg;function Q6(o){const e=new Z6;for(const t of o.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,p9(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,CT(n))}}return e}function CT(o){const e=o.path?ds.parse(o.path):void 0;return mT(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const ET=Object.freeze([y8.EDITORS,y8.FILES,YC.RESOURCES,YC.INTERNAL_URI_LIST]);function J6(o,e=!1){const t=Q6(o),i=t.get(YC.INTERNAL_URI_LIST);if(i)t.replace(vo.uriList,i);else if(e||!t.has(vo.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(ds.file(a).toString()):n.push(ds.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(vo.uriList,p9(_b.create(n)))}for(const n of ET)t.delete(n);return t}var x9=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ep=function(o,e){return function(t,i){e(t,i,o)}};class v9{async provideDocumentPasteEdits(e,t,i,n,s){const r=await this.getEdit(i,s);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.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 Ng=class Ng extends v9{constructor(){super(...arguments),this.kind=Ng.kind,this.dropMimeTypes=[vo.text],this.pasteMimeTypes=[vo.text]}async getEdit(e,t){const i=e.get(vo.text);if(!i||e.has(vo.uriList))return;const n=await i.asString();return{handledMimeType:vo.text,title:S("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};Ng.id="text",Ng.kind=new Ss("text.plain");let Ku=Ng;class e5 extends v9{constructor(){super(...arguments),this.kind=new Ss("uri.absolute"),this.dropMimeTypes=[vo.uriList],this.pasteMimeTypes=[vo.uriList]}async getEdit(e,t){const i=await t5(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:d})=>a.scheme===jo.file?a.fsPath:(n++,d)).join(" ");let r;return n>0?r=i.length>1?S("defaultDropProvider.uriList.uris","Insert Uris"):S("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?S("defaultDropProvider.uriList.paths","Insert Paths"):S("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:vo.uriList,insertText:s,title:r,kind:this.kind}}}let qv=class extends v9{constructor(e){super(),this._workspaceContextService=e,this.kind=new Ss("uri.relative"),this.dropMimeTypes=[vo.uriList],this.pasteMimeTypes=[vo.uriList]}async getEdit(e,t){const i=await t5(e);if(!i.length||t.isCancellationRequested)return;const n=Nl(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?h3(r.uri,s):void 0}));if(n.length)return{handledMimeType:vo.uriList,insertText:n.join(" "),title:i.length>1?S("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):S("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};qv=x9([ep(0,qf)],qv);class yT{constructor(){this.kind=new Ss("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:vo.text}]}async provideDocumentPasteEdits(e,t,i,n,s){var d;if(n.triggerKind!==QC.PasteAs&&!((d=n.only)!=null&&d.contains(this.kind)))return;const r=i.get("text/html"),a=await(r==null?void 0:r.asString());if(!(!a||s.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:S("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function t5(o){const e=o.get(vo.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of _b.parse(t))try{i.push({uri:ds.parse(n),originalText:n})}catch{}return i}let I1=class extends Ot{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new Ku)),this._register(e.documentDropEditProvider.register("*",new e5)),this._register(e.documentDropEditProvider.register("*",new qv(t)))}};I1=x9([ep(0,Si),ep(1,qf)],I1);let P1=class extends Ot{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Ku)),this._register(e.documentPasteEditProvider.register("*",new e5)),this._register(e.documentPasteEditProvider.register("*",new qv(t))),this._register(e.documentPasteEditProvider.register("*",new yT))}};P1=x9([ep(0,Si),ep(1,qf)],P1);const Hr=class Hr{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=Hr._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(Hr.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(Hr.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(Hr.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(Hr.isVariableCharacter(i)||Hr.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 Hr._table[i]>"u"&&!Hr.isDigitCharacter(i)&&!Hr.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};Hr._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let T1=Hr;class L0{constructor(){this._children=[]}appendChild(e){return e instanceof tr&&this._children[this._children.length-1]instanceof tr?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 r(a,d){for(const u of a)u.parent=d,r(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 ix)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}let tr=class i5 extends L0{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new i5(this.value)}};class n5 extends L0{}class Pr extends n5{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 I0?this._children[0]:void 0}clone(){const e=new Pr(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class I0 extends L0{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof tr&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new I0;return this.options.forEach(e.appendChild,e),e}}class m9 extends L0{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 ga&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof ga){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new m9;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 ga extends L0{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 ga(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class tp extends n5{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 tr(t)],!0):!1}clone(){const e=new tp(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function w8(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class ix extends L0{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Pr&&(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 w8([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Pr&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof tp&&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 ix;return this._children=this.children.map(t=>t.clone()),e}walk(e){w8(this.children,e)}}class Zu{constructor(){this._scanner=new T1,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 ix;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 Pr&&(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 r=(d,u)=>{const f=n.get(d.index);if(!f)return;const g=new Pr(d.index);g.transform=d.transform;for(const p of f){const C=p.clone();g.appendChild(C),C instanceof Pr&&n.has(C.index)&&!u.has(C.index)&&(u.add(C.index),r(C,u),u.delete(C.index))}t.replace(d,[g])},a=new Set;for(const d of s)r(d,a);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 Pr(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 tr(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 Pr(Number(t)):new tp(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 Pr(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new tr("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new I0;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(r),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 tr(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 tp(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new tr("${"+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 m9;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 tr(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 ga(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new ga(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 ga(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new ga(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new ga(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const r=this._until(4);if(r)return e.appendChild(new ga(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new ga(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new tr(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function s5(o,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 f3(o,{range:s,text:typeof t.insertText=="string"?Zu.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function o5(o){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of o)for(const a of r.yieldTo??[])for(const d of o)if(d!==r&&e(a,d)){let u=t.get(r);u||(u=[],t.set(r,u)),u.push(d)}if(!t.size)return Array.from(o);const i=new Set,n=[];function s(r){if(!r.length)return[];const a=r[0];if(n.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return s(r.slice(1));let d=[];const u=t.get(a);return u&&(n.push(a),d=s(u),n.pop()),i.add(a),[...d,a,...s(r.slice(1))]}return s(Array.from(o))}var wT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},ST=function(o,e){return function(t,i){e(t,i,o)}};const DT=Tn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:pA,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),n_=class n_ extends Ot{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=xi(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=xi("span.icon");this.domNode.append(t),t.classList.add(...Qn.asClassNameArray(tn.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(qn(this.domNode,Ls.CLICK,n=>{this.delegate.cancel()}))}getId(){return n_.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)}};n_.baseId="editor.widget.inlineProgressWidget";let M1=n_,Gv=class extends Ot{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Er),this._currentWidget=this._register(new Er),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=Wg(()=>{const a=ee.fromPositions(e);this._currentDecorations.set([{range:a,options:DT}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(M1,this.id,this._editor,a,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};Gv=wT([ST(2,gn)],Gv);var AT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},S8=function(o,e){return function(t,i){e(t,i,o)}},cv,Hc;let sr=(Hc=class{static get(e){return e.getContribution(cv.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Er,this._messageListeners=new Nt,this._mouseOverMessage=!1,this._editor=e,this._visible=cv.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){ia(Qx(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Qx(e)?g3(e,{actionHandler:{callback:n=>{this.closeMessage(),p3(this._openerService,n,Qx(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new D8(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(to.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&x3(fA(),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(qn(this._messageWidget.value.getDomNode(),Ls.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(qn(this._messageWidget.value.getDomNode(),Ls.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 ee(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(D8.fadeOut(this._messageWidget.value))}},cv=Hc,Hc.ID="editor.contrib.messageController",Hc.MESSAGE_VISIBLE=new Nn("messageVisible",!1,S("messageVisible","Whether the editor is currently showing an inline message")),Hc);sr=cv=AT([S8(1,Gn),S8(2,Aa)],sr);const kT=Zo.bindToContribution(sr.get);Ii(new kT({id:"leaveEditorMessage",precondition:sr.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let D8=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 r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Sn(sr.ID,sr,4);function dC(o,e){return e&&(o.stack||o.stacktrace)?S("stackTrace.format","{0}: {1}",k8(o),A8(o.stack)||A8(o.stacktrace)):k8(o)}function A8(o){return Array.isArray(o)?o.join(`
|
|
16
16
|
`):o}function k8(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?S("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||S("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function Kv(o=null,e=!1){if(!o)return S("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=Nl(o),i=Kv(t[0],e);return t.length>1?S("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(xA(o))return o;if(o.detail){const t=o.detail;if(t.error)return dC(t.error,e);if(t.exception)return dC(t.exception,e)}return o.stack?dC(o,e):o.message?o.message:S("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var r5=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Sf=function(o,e){return function(t,i){e(t,i,o)}},R1,tu;let N1=(tu=class extends Ot{constructor(e,t,i,n,s,r,a,d,u,f){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=d,this._keybindingService=f,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(g=>{s.containsPosition(g.position)||this.dispose()})),this._register(to.runAndSubscribe(f.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=xi(".post-edit-widget"),this.button=this._register(new v3(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(qn(this.domNode,Ls.CLICK,()=>this.showSelector()))}getId(){return R1.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Uo(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>m3({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},R1=tu,tu.baseId="editor.widget.postEditWidget",tu);N1=R1=r5([Sf(7,E0),Sf(8,Gn),Sf(9,Xs)],N1);let Zv=class extends Ot{constructor(e,t,i,n,s,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Er),this._register(to.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits.at(t.activeEditIndex);if(!a)return;const d=async w=>{const A=this._editor.getModel();A&&(await A.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:w,allEdits:t.allEdits},i,n,s))},u=(w,A)=>{dd(w)||(this._notificationService.error(A),i&&this.show(e[0],t,d))};let f;try{f=await n(a,s)}catch(w){return u(w,S("resolveError",`Error resolving edit '{0}':
|
|
@@ -231,4 +231,4 @@ declare const she: {
|
|
|
231
231
|
`):Te:"",!0),x(b,ge("max_connections"),!0),x(E,ge("max_inflight_messages"),!0),x(w,ge("max_queued_messages"),!0),x(A,ge("max_packet_size"),!0),x(I,ge("message_size_limit"),!0),x(T,ge("max_keepalive"),!0),x(M,ge("persistent_client_expiration"),!0),x(P,ge("retain_available"),!0),x(j,ge("set_tcp_nodelay"),!0),x(U,ge("connection_messages"),!0),x(ce,me("log_dest"),!0),x(Se,me("log_type"),!0),x(i,"")}catch(Te){x(i,Te.message??"Failed to load config",!0)}}async function he(){if(l(t)){x(n,!0),x(s,""),x(r,!1);try{let ye=function(ci,$t){$t!==""?Te[ci]=$t:delete Te[ci]};const Te={...l(t).managed};ye("persistence",l(f)),ye("persistence_location",l(g)),ye("sys_interval",l(p));const Pt=l(C).split(`
|
|
232
232
|
`).map(ci=>ci.trim()).filter(Boolean);Pt.length>0?Te.include_dir=Pt.length===1?Pt[0]:Pt:delete Te.include_dir,ye("max_connections",l(b)),ye("max_inflight_messages",l(E)),ye("max_queued_messages",l(w)),ye("max_packet_size",l(A)),ye("message_size_limit",l(I)),ye("max_keepalive",l(T)),ye("persistent_client_expiration",l(M)),ye("retain_available",l(P)),ye("set_tcp_nodelay",l(j)),ye("connection_messages",l(U)),l(ce).size>0?Te.log_dest=l(ce).size===1?[...l(ce)][0]:[...l(ce)]:delete Te.log_dest,l(Se).size>0?Te.log_type=l(Se).size===1?[...l(Se)][0]:[...l(Se)]:delete Te.log_type,await IF({listeners:l(t).listeners,managed:Te,passthrough:l(t).passthrough,checksum:l(u)}),x(r,!0),setTimeout(()=>x(r,!1),3e3),await Be()}catch(Te){x(s,Te.message??"Save failed",!0)}finally{x(n,!1)}}}async function De(){x(a,!0),x(d,"");try{const Te=await Hb();x(d,Te.stderr||Te.stdout||"Reloaded",!0)}catch(Te){x(d,"Error: "+(Te.message??"reload failed"))}finally{x(a,!1)}}var Re=Tee(),Ee=m(Re),ot=v(m(Ee),2),It=m(ot),Qe=m(It),mt=v(It,2),_e=m(mt),Pe=v(Ee,2);{var rt=Te=>{var ye=iA(),Pt=m(ye);W(()=>O(Pt,l(i))),D(Te,ye)};N(Pe,Te=>{l(i)&&Te(rt)})}var vt=v(Pe,2);{var it=Te=>{var ye=iA(),Pt=m(ye);W(()=>O(Pt,l(s))),D(Te,ye)};N(vt,Te=>{l(s)&&Te(it)})}var ft=v(vt,2);{var ii=Te=>{var ye=Fee();D(Te,ye)};N(ft,Te=>{l(r)&&Te(ii)})}var di=v(ft,2);{var ri=Te=>{var ye=Lee(),Pt=m(ye);W(()=>O(Pt,l(d))),D(Te,ye)};N(di,Te=>{l(d)&&Te(ri)})}var _t=v(di,2);{var li=Te=>{var ye=Pee(),Pt=ct(ye),ci=v(m(Pt),2),$t=m(ci),Pi=m($t),Ni=v(m(Pi),2),ki=m(Ni);ki.value=ki.__value="";var nn=v(ki);nn.value=nn.__value="true";var sn=v(nn);sn.value=sn.__value="false";var pn=v($t,2),wn=m(pn),ht=v(m(wn),2),Qt=v(pn,2),Ti=m(Qt),Bi=v(m(Ti),2),bi=v(ci,2),bn=m(bi),Cn=v(m(bn),2);fn(Cn,"rows",3);var kn=v(Pt,2),$e=v(m(kn),2),Yt=v(m($e),2);ti(Yt,21,()=>Q,Ri,(Ie,Me)=>{var gt=KC(),pt=m(gt),Xe=v(pt,3);W(qt=>{mr(pt,qt),O(Xe,` ${l(Me)??""}`)},[()=>l(ce).has(l(Me))]),z("change",pt,()=>{x(ce,ie(l(ce),l(Me)),!0)}),D(Ie,gt)});var Fi=v($e,2),gi=v(m(Fi),2),ji=m(gi),pi=v(m(ji),2);ti(pi,17,()=>oe,Ri,(Ie,Me)=>{var gt=KC(),pt=m(gt),Xe=v(pt,3);W(qt=>{mr(pt,qt),O(Xe,` ${l(Me)??""}`)},[()=>l(Se).has(l(Me))]),z("change",pt,()=>{x(Se,ie(l(Se),l(Me)),!0)}),D(Ie,gt)});var Gi=v(ji,2),Z=v(m(Gi),2);ti(Z,17,()=>le,Ri,(Ie,Me)=>{var gt=KC(),pt=m(gt),Xe=v(pt,3);W(qt=>{mr(pt,qt),O(Xe,` ${l(Me)??""}`)},[()=>l(Se).has(l(Me))]),z("change",pt,()=>{x(Se,ie(l(Se),l(Me)),!0)}),D(Ie,gt)});var we=v(Gi,2),st=m(we);ti(st,17,()=>re,Ri,(Ie,Me)=>{var gt=Iee(),pt=m(gt),Xe=v(pt,4),qt=m(Xe);W(at=>{mr(pt,at),O(qt,l(Me))},[()=>l(Se).has(l(Me))]),z("change",pt,()=>{x(Se,ie(l(Se),l(Me)),!0)}),D(Ie,gt)});var Ye=v(kn,2),Wt=v(m(Ye),2),Jt=m(Wt),ut=m(Jt),Je=v(m(ut),2),dt=v(Jt,2),ui=m(dt),Ae=v(m(ui),2),We=v(dt,2),Oi=m(We),on=v(m(Oi),2),Ki=v(We,2),de=m(Ki),Ke=v(m(de),2),Ft=v(Ye,2),zt=v(m(Ft),2),Le=m(zt),Ve=m(Le),Vt=v(m(Ve),2),Ut=v(Le,2),Zt=m(Ut),Rt=v(m(Zt),2),V=v(Ft,2),ae=v(m(V),2),pe=m(ae),ve=m(pe),tt=v(m(ve),2),Ze=v(pe,2),wt=m(Ze),$=v(m(wt),2),q=m($);q.value=q.__value="";var R=v(q);R.value=R.__value="true";var G=v(R);G.value=G.__value="false";var Y=v(V,2),te=v(m(Y),2),se=m(te),fe=m(se),be=v(m(fe),2),Ce=m(be);Ce.value=Ce.__value="";var He=v(Ce);He.value=He.__value="true";var Oe=v(He);Oe.value=Oe.__value="false";var et=v(se,2),ei=m(et),J=v(m(ei),2),ue=m(J);ue.value=ue.__value="";var je=v(ue);je.value=je.__value="true";var St=v(je);St.value=St.__value="false",Ks(Ni,()=>l(f),Ie=>x(f,Ie)),At(ht,()=>l(g),Ie=>x(g,Ie)),At(Bi,()=>l(p),Ie=>x(p,Ie)),At(Cn,()=>l(C),Ie=>x(C,Ie)),At(Je,()=>l(b),Ie=>x(b,Ie)),At(Ae,()=>l(T),Ie=>x(T,Ie)),At(on,()=>l(E),Ie=>x(E,Ie)),At(Ke,()=>l(w),Ie=>x(w,Ie)),At(Vt,()=>l(A),Ie=>x(A,Ie)),At(Rt,()=>l(I),Ie=>x(I,Ie)),At(tt,()=>l(M),Ie=>x(M,Ie)),Ks($,()=>l(P),Ie=>x(P,Ie)),Ks(be,()=>l(j),Ie=>x(j,Ie)),Ks(J,()=>l(U),Ie=>x(U,Ie)),D(Te,ye)};N(_t,Te=>{l(t)&&Te(li)})}W(()=>{It.disabled=l(n),O(Qe,l(n)?"Saving…":"Save"),mt.disabled=l(a),O(_e,l(a)?"Reloading…":"Apply & Reload")}),z("click",It,he),z("click",mt,De),D(o,Re),eo()}uo(["click","change"]);var vl=F('<div class="err svelte-9auejo"> </div>'),Ree=F('<div class="info-card svelte-9auejo"><dl class="svelte-9auejo"><dt class="svelte-9auejo">CN</dt><dd class="svelte-9auejo"> </dd> <dt class="svelte-9auejo">Fingerprint (SHA-256)</dt><dd class="mono small svelte-9auejo"> </dd> <dt class="svelte-9auejo">Expires</dt><dd> </dd></dl></div>'),Nee=F('<div class="empty svelte-9auejo">No managed server certificate. Use one of the options above, or configure <code>certfile</code>/<code>keyfile</code> manually in the Listeners tab.</div>'),Oee=F('<div class="empty svelte-9auejo">No trusted CA certs. Add one to enable client certificate authentication.</div>'),Hee=F('<tr><td class="mono svelte-9auejo"> </td><td class="mono small svelte-9auejo"> </td><td> </td><td class="actions svelte-9auejo"><button class="danger svelte-9auejo">✕</button></td></tr>'),Wee=F('<table class="svelte-9auejo"><thead><tr><th class="svelte-9auejo">CN</th><th class="svelte-9auejo">Fingerprint</th><th class="svelte-9auejo">Expires</th><th class="svelte-9auejo"></th></tr></thead><tbody></tbody></table>'),zee=F('<div class="result-box svelte-9auejo"><p class="svelte-9auejo">✓ Certificate installed.</p> <dl class="svelte-9auejo"><dt class="svelte-9auejo">Fingerprint</dt><dd class="mono small svelte-9auejo"> </dd><dt class="svelte-9auejo">Expires</dt><dd class="svelte-9auejo"> </dd></dl></div>'),nA=F('<button class="btn-primary svelte-9auejo"> </button>'),Vee=F('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal svelte-9auejo"><h3 class="svelte-9auejo">Generate self-signed server certificate</h3> <label class="svelte-9auejo">Common Name (hostname / IP)<input placeholder="e.g. mqtt.home.arpa" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Subject Alternative Names (comma-separated, optional)<input placeholder="192.168.1.10, mqtt.local" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Validity (days)<input type="number" min="1" max="3650" class="svelte-9auejo"/></label> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Close</button> <!></div></div></div>'),jee=F('<label class="svelte-9auejo">Common Name (hostname / IP)<input placeholder="e.g. mqtt.home.arpa" class="svelte-9auejo"/></label> <label class="svelte-9auejo">Subject Alternative Names (comma-separated, optional)<input placeholder="192.168.1.10, mqtt.local" class="svelte-9auejo"/></label> <p class="hint svelte-9auejo">A private key and CSR are generated on the server. Copy the CSR, have it signed by your CA, then paste the signed cert below.</p> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),$ee=F('<div class="ok svelte-9auejo">✓ Certificate installed.</div>'),Uee=F('<p class="hint svelte-9auejo">Key stored on server. Copy the CSR, get it signed, then paste the signed certificate to complete installation.</p> <label class="svelte-9auejo">Certificate Signing Request<textarea readonly="" rows="8" class="svelte-9auejo"></textarea></label> <div class="csr-actions svelte-9auejo"><button class="svelte-9auejo">Copy CSR</button> <a class="btn-download svelte-9auejo" download="server.csr">Download .csr</a></div> <hr class="svelte-9auejo"/> <label class="svelte-9auejo">Upload signed certificate (PEM)<textarea rows="6" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Close</button> <!></div>',1),qee=F('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Generate key + CSR for server certificate</h3> <!></div></div>'),Gee=F('<label class="svelte-9auejo">Certificate (PEM)<textarea rows="5" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <label class="svelte-9auejo">Private key (PEM — leave blank if key is already on disk from a prior CSR)<textarea rows="4" placeholder="-----BEGIN PRIVATE KEY----- … -----END PRIVATE KEY-----" class="svelte-9auejo"></textarea></label>',1),Kee=F('<span class="file-name mono small svelte-9auejo"> </span>'),Zee=F('<label class="svelte-9auejo">PKCS#12 file <div class="file-row svelte-9auejo"><input type="file" accept=".p12,.pfx" class="svelte-9auejo"/> <!></div></label> <label class="svelte-9auejo">Passphrase <div class="pw-row svelte-9auejo"><input autocomplete="off" class="svelte-9auejo"/> <button class="toggle-pw svelte-9auejo"> </button></div></label>',1),Xee=F('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Import server certificate</h3> <div class="import-mode-tabs svelte-9auejo"><button>PEM files</button> <button>PKCS#12 (.p12 / .pfx)</button></div> <!> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div></div></div>'),ZC=F("<option></option>"),Yee=F('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Use existing certificate files</h3> <p class="hint svelte-9auejo">Enter absolute paths on the broker host. Tab-completion is available for paths starting with /.</p> <label class="svelte-9auejo">Certificate file path <input list="set-cert-path-list" placeholder="/etc/letsencrypt/live/mqtt.example.com/fullchain.pem" class="svelte-9auejo"/> <datalist id="set-cert-path-list"></datalist></label> <label class="svelte-9auejo">Private key file path <input list="set-key-path-list" placeholder="/etc/letsencrypt/live/mqtt.example.com/privkey.pem" class="svelte-9auejo"/> <datalist id="set-key-path-list"></datalist></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div></div></div>'),Qee=F('<label class="svelte-9auejo">CA certificate (PEM)<textarea rows="8" placeholder="-----BEGIN CERTIFICATE----- … -----END CERTIFICATE-----" class="svelte-9auejo"></textarea></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),Jee=F('<p class="hint svelte-9auejo">Enter the absolute path to the CA certificate file on the broker host.</p> <label class="svelte-9auejo">CA certificate path <input list="trusted-path-list" placeholder="/etc/ssl/certs/my-ca.pem" class="svelte-9auejo"/> <datalist id="trusted-path-list"></datalist></label> <!> <div class="modal-actions svelte-9auejo"><button class="svelte-9auejo">Cancel</button> <button class="btn-primary svelte-9auejo"> </button></div>',1),ete=F('<div class="modal-backdrop svelte-9auejo" role="dialog" aria-modal="true"><div class="modal modal--wide svelte-9auejo"><h3 class="svelte-9auejo">Add trusted CA certificate</h3> <div class="import-mode-tabs svelte-9auejo"><button>Paste PEM</button> <button>From path</button></div> <!></div></div>'),tte=F('<div class="certs-page svelte-9auejo"><div class="page-toolbar svelte-9auejo"><button class="reload-btn svelte-9auejo" title="Refresh">↺</button></div> <!> <!> <div class="section svelte-9auejo"><div class="section-header svelte-9auejo"><h3 class="svelte-9auejo">Server Certificate</h3> <button class="svelte-9auejo">Self-signed</button> <button class="svelte-9auejo">Generate CSR</button> <button class="svelte-9auejo">Import cert</button> <button class="svelte-9auejo">Use path</button></div> <!></div> <div class="section svelte-9auejo"><div class="section-header svelte-9auejo"><h3 class="svelte-9auejo">Trusted CA Certificates</h3> <button class="svelte-9auejo">+ Add CA cert</button></div> <!></div></div> <!> <!> <!> <!> <!>',1);function ite(o,e){Js(e,!0);let t=B(null),i=B(vi([])),n=B(""),s=B(""),r=B(!1),a=B(""),d=B(""),u=B(365),f=B(!1),g=B(""),p=B(null),C=B(!1),b=B(""),E=B(""),w=B(!1),A=B(""),I=B(""),T=B(""),M=B(!1),P=B(""),j=B(!1),U=B(!1),Q=B("pem"),oe=B(""),le=B(""),re=B(""),ce=B(""),Se=B(""),ie=B(!1),ge=B(!1),me=B(""),Be=B(!1),he=B(""),De=B(""),Re=B(!1),Ee=B(""),ot=B(vi([])),It=B(vi([])),Qe=B(!1),mt=B("pem"),_e=B(""),Pe=B(!1),rt=B(""),vt=B(""),it=B(vi([])),ft=B(!1),ii=B("");async function di(){try{const[Le,Ve]=await Promise.allSettled([oq(),lq()]);Le.status==="fulfilled"&&x(t,Le.value.server,!0),Ve.status==="fulfilled"&&x(i,Ve.value.certs,!0),x(n,"")}catch(Le){x(n,Le.message,!0)}}no(()=>{di()});async function ri(){x(g,""),x(f,!0),x(p,null);try{const Le=l(d).split(",").map(Vt=>Vt.trim()).filter(Boolean),Ve=await rq({cn:l(a),san:Le,days:l(u)});x(p,{fingerprint:Ve.fingerprint,expires:Ve.expires},!0),await di()}catch(Le){x(g,Le.message,!0)}finally{x(f,!1)}}async function _t(){x(A,""),x(w,!0),x(I,"");try{const Le=l(E).split(",").map(Vt=>Vt.trim()).filter(Boolean),Ve=await aq({cn:l(b),san:Le});x(I,Ve.csrPem,!0)}catch(Le){x(A,Le.message,!0)}finally{x(w,!1)}}async function li(){x(P,""),x(M,!0),x(j,!1);try{if(!l(T).trim())throw new Error("Paste the signed certificate PEM");await jC({cert:l(T)}),x(j,!0),await di()}catch(Le){x(P,Le.message,!0)}finally{x(M,!1)}}function Te(){navigator.clipboard.writeText(l(I)).catch(()=>{})}function ye(Le){var Ut;const Ve=(Ut=Le.target.files)==null?void 0:Ut[0];if(!Ve)return;x(ce,Ve.name,!0);const Vt=new FileReader;Vt.onload=()=>{const Zt=Vt.result;x(re,btoa(String.fromCharCode(...new Uint8Array(Zt))),!0)},Vt.readAsArrayBuffer(Ve)}async function Pt(){x(me,""),x(ge,!0);try{if(l(Q)==="p12"){if(!l(re))throw new Error("Select a .p12 / .pfx file");await jC({p12base64:l(re),passphrase:l(Se)})}else{if(!l(oe).trim())throw new Error("Certificate PEM is required");await jC({cert:l(oe),key:l(le)||void 0})}x(U,!1),await di()}catch(Le){x(me,Le.message,!0)}finally{x(ge,!1)}}function ci(Le){let Ve;return Vt=>{const Ut=Vt.target.value;clearTimeout(Ve),Ve=setTimeout(async()=>{if(!Ut.startsWith("/")||Ut.length<2){Le([]);return}try{Le((await uq(Ut)).suggestions)}catch{Le([])}},280)}}const $t=ci(Le=>{x(ot,Le,!0)}),Pi=ci(Le=>{x(It,Le,!0)}),Ni=ci(Le=>{x(it,Le,!0)});async function ki(){x(Ee,""),x(Re,!0);try{await hq({certPath:l(he),keyPath:l(De)}),x(Be,!1),await di()}catch(Le){x(Ee,Le.message,!0)}finally{x(Re,!1)}}async function nn(){x(rt,""),x(Pe,!0);try{await cq(l(_e)),x(_e,""),x(Qe,!1),await di()}catch(Le){x(rt,Le.message,!0)}finally{x(Pe,!1)}}async function sn(){x(ii,""),x(ft,!0);try{await fq(l(vt)),x(vt,""),x(Qe,!1),await di()}catch(Le){x(ii,Le.message,!0)}finally{x(ft,!1)}}async function pn(Le){if(confirm("Remove this trusted CA cert?"))try{await dq(Le),await di()}catch(Ve){x(s,Ve.message,!0)}}function wn(Le){const Ve=new Date(Le).getTime()-Date.now();return Ve<0?"expired":Ve<30*864e5?"expiring":""}function ht(Le){return new Date(Le).toLocaleDateString()}var Qt=tte(),Ti=ct(Qt),Bi=m(Ti),bi=m(Bi),bn=v(Bi,2);{var Cn=Le=>{var Ve=vl(),Vt=m(Ve);W(()=>O(Vt,l(n))),D(Le,Ve)};N(bn,Le=>{l(n)&&Le(Cn)})}var kn=v(bn,2);{var $e=Le=>{var Ve=vl(),Vt=m(Ve);W(()=>O(Vt,l(s))),D(Le,Ve)};N(kn,Le=>{l(s)&&Le($e)})}var Yt=v(kn,2),Fi=m(Yt),gi=v(m(Fi),2),ji=v(gi,2),pi=v(ji,2),Gi=v(pi,2),Z=v(Fi,2);{var we=Le=>{var Ve=Ree(),Vt=m(Ve),Ut=v(m(Vt)),Zt=m(Ut),Rt=v(Ut,3),V=m(Rt),ae=v(Rt,3),pe=m(ae);W((ve,tt)=>{O(Zt,l(t).cn),O(V,l(t).fingerprint),kt(ae,1,ve,"svelte-9auejo"),O(pe,tt)},[()=>yg(wn(l(t).expires)),()=>ht(l(t).expires)]),D(Le,Ve)},st=Le=>{var Ve=Nee();D(Le,Ve)};N(Z,Le=>{l(t)?Le(we):Le(st,-1)})}var Ye=v(Yt,2),Wt=m(Ye),Jt=v(m(Wt),2),ut=v(Wt,2);{var Je=Le=>{var Ve=Oee();D(Le,Ve)},dt=Le=>{var Ve=Wee(),Vt=v(m(Ve));ti(Vt,21,()=>l(i),Ri,(Ut,Zt)=>{var Rt=Hee(),V=m(Rt),ae=m(V),pe=v(V),ve=m(pe),tt=v(pe),Ze=m(tt),wt=v(tt),$=m(wt);W((q,R,G)=>{O(ae,l(Zt).cn),O(ve,`${q??""}…`),kt(tt,1,R,"svelte-9auejo"),O(Ze,G)},[()=>l(Zt).fingerprint.slice(0,29),()=>yg(wn(l(Zt).expires)),()=>ht(l(Zt).expires)]),z("click",$,()=>pn(l(Zt).fingerprint)),D(Ut,Rt)}),D(Le,Ve)};N(ut,Le=>{l(i).length===0?Le(Je):Le(dt,-1)})}var ui=v(Ti,2);{var Ae=Le=>{var Ve=Vee(),Vt=m(Ve),Ut=v(m(Vt),2),Zt=v(m(Ut)),Rt=v(Ut,2),V=v(m(Rt)),ae=v(Rt,2),pe=v(m(ae)),ve=v(ae,2);{var tt=Y=>{var te=vl(),se=m(te);W(()=>O(se,l(g))),D(Y,te)};N(ve,Y=>{l(g)&&Y(tt)})}var Ze=v(ve,2);{var wt=Y=>{var te=zee(),se=v(m(te),2),fe=v(m(se)),be=m(fe),Ce=v(fe,2),He=m(Ce);W(Oe=>{O(be,l(p).fingerprint),O(He,Oe)},[()=>ht(l(p).expires)]),D(Y,te)};N(Ze,Y=>{l(p)&&Y(wt)})}var $=v(Ze,2),q=m($),R=v(q,2);{var G=Y=>{var te=nA(),se=m(te);W(()=>{te.disabled=l(f),O(se,l(f)?"Generating…":"Generate")}),z("click",te,ri),D(Y,te)};N(R,Y=>{l(p)||Y(G)})}At(Zt,()=>l(a),Y=>x(a,Y)),At(V,()=>l(d),Y=>x(d,Y)),At(pe,()=>l(u),Y=>x(u,Y)),z("click",q,()=>x(r,!1)),D(Le,Ve)};N(ui,Le=>{l(r)&&Le(Ae)})}var We=v(ui,2);{var Oi=Le=>{var Ve=qee(),Vt=m(Ve),Ut=v(m(Vt),2);{var Zt=V=>{var ae=jee(),pe=ct(ae),ve=v(m(pe)),tt=v(pe,2),Ze=v(m(tt)),wt=v(tt,4);{var $=te=>{var se=vl(),fe=m(se);W(()=>O(fe,l(A))),D(te,se)};N(wt,te=>{l(A)&&te($)})}var q=v(wt,2),R=m(q),G=v(R,2),Y=m(G);W(()=>{G.disabled=l(w),O(Y,l(w)?"Generating…":"Generate key + CSR")}),At(ve,()=>l(b),te=>x(b,te)),At(Ze,()=>l(E),te=>x(E,te)),z("click",R,()=>x(C,!1)),z("click",G,_t),D(V,ae)},Rt=V=>{var ae=Uee(),pe=v(ct(ae),2),ve=v(m(pe)),tt=v(pe,2),Ze=m(tt),wt=v(Ze,2),$=v(tt,4),q=v(m($)),R=v($,2);{var G=He=>{var Oe=vl(),et=m(Oe);W(()=>O(et,l(P))),D(He,Oe)};N(R,He=>{l(P)&&He(G)})}var Y=v(R,2);{var te=He=>{var Oe=$ee();D(He,Oe)};N(Y,He=>{l(j)&&He(te)})}var se=v(Y,2),fe=m(se),be=v(fe,2);{var Ce=He=>{var Oe=nA(),et=m(Oe);W(ei=>{Oe.disabled=ei,O(et,l(M)?"Uploading…":"Upload signed cert")},[()=>l(M)||!l(T).trim()]),z("click",Oe,li),D(He,Oe)};N(be,He=>{l(j)||He(Ce)})}W(He=>{A1(ve,l(I)),fn(wt,"href",`data:application/pkcs10;charset=utf-8,${He??""}`)},[()=>encodeURIComponent(l(I))]),z("click",Ze,Te),At(q,()=>l(T),He=>x(T,He)),z("click",fe,()=>x(C,!1)),D(V,ae)};N(Ut,V=>{l(I)?V(Rt,-1):V(Zt)})}D(Le,Ve)};N(We,Le=>{l(C)&&Le(Oi)})}var on=v(We,2);{var Ki=Le=>{var Ve=Xee(),Vt=m(Ve),Ut=v(m(Vt),2),Zt=m(Ut);let Rt;var V=v(Zt,2);let ae;var pe=v(Ut,2);{var ve=Y=>{var te=Gee(),se=ct(te),fe=v(m(se)),be=v(se,2),Ce=v(m(be));At(fe,()=>l(oe),He=>x(oe,He)),At(Ce,()=>l(le),He=>x(le,He)),D(Y,te)},tt=Y=>{var te=Zee(),se=ct(te),fe=v(m(se)),be=m(fe),Ce=v(be,2);{var He=je=>{var St=Kee(),Ie=m(St);W(()=>O(Ie,l(ce))),D(je,St)};N(Ce,je=>{l(ce)&&je(He)})}var Oe=v(se,2),et=v(m(Oe)),ei=m(et),J=v(ei,2),ue=m(J);W(()=>{fn(ei,"type",l(ie)?"text":"password"),O(ue,l(ie)?"Hide":"Show")}),z("change",be,ye),At(ei,()=>l(Se),je=>x(Se,je)),z("click",J,()=>x(ie,!l(ie))),D(Y,te)};N(pe,Y=>{l(Q)==="pem"?Y(ve):Y(tt,-1)})}var Ze=v(pe,2);{var wt=Y=>{var te=vl(),se=m(te);W(()=>O(se,l(me))),D(Y,te)};N(Ze,Y=>{l(me)&&Y(wt)})}var $=v(Ze,2),q=m($),R=v(q,2),G=m(R);W(()=>{Rt=kt(Zt,1,"svelte-9auejo",null,Rt,{active:l(Q)==="pem"}),ae=kt(V,1,"svelte-9auejo",null,ae,{active:l(Q)==="p12"}),R.disabled=l(ge),O(G,l(ge)?"Importing…":"Import")}),z("click",Zt,()=>x(Q,"pem")),z("click",V,()=>x(Q,"p12")),z("click",q,()=>x(U,!1)),z("click",R,Pt),D(Le,Ve)};N(on,Le=>{l(U)&&Le(Ki)})}var de=v(on,2);{var Ke=Le=>{var Ve=Yee(),Vt=m(Ve),Ut=v(m(Vt),4),Zt=v(m(Ut)),Rt=v(Zt,2);ti(Rt,21,()=>l(ot),Ri,(R,G)=>{var Y=ZC(),te={};W(()=>{te!==(te=l(G))&&(Y.value=(Y.__value=l(G))??"")}),D(R,Y)});var V=v(Ut,2),ae=v(m(V)),pe=v(ae,2);ti(pe,21,()=>l(It),Ri,(R,G)=>{var Y=ZC(),te={};W(()=>{te!==(te=l(G))&&(Y.value=(Y.__value=l(G))??"")}),D(R,Y)});var ve=v(V,2);{var tt=R=>{var G=vl(),Y=m(G);W(()=>O(Y,l(Ee))),D(R,G)};N(ve,R=>{l(Ee)&&R(tt)})}var Ze=v(ve,2),wt=m(Ze),$=v(wt,2),q=m($);W(R=>{$.disabled=R,O(q,l(Re)?"Installing…":"Install")},[()=>l(Re)||!l(he).trim()||!l(De).trim()]),z("input",Zt,$t),At(Zt,()=>l(he),R=>x(he,R)),z("input",ae,Pi),At(ae,()=>l(De),R=>x(De,R)),z("click",wt,()=>x(Be,!1)),z("click",$,ki),D(Le,Ve)};N(de,Le=>{l(Be)&&Le(Ke)})}var Ft=v(de,2);{var zt=Le=>{var Ve=ete(),Vt=m(Ve),Ut=v(m(Vt),2),Zt=m(Ut);let Rt;var V=v(Zt,2);let ae;var pe=v(Ut,2);{var ve=Ze=>{var wt=Qee(),$=ct(wt),q=v(m($)),R=v($,2);{var G=be=>{var Ce=vl(),He=m(Ce);W(()=>O(He,l(rt))),D(be,Ce)};N(R,be=>{l(rt)&&be(G)})}var Y=v(R,2),te=m(Y),se=v(te,2),fe=m(se);W(be=>{se.disabled=be,O(fe,l(Pe)?"Adding…":"Add CA cert")},[()=>l(Pe)||!l(_e).trim()]),At(q,()=>l(_e),be=>x(_e,be)),z("click",te,()=>x(Qe,!1)),z("click",se,nn),D(Ze,wt)},tt=Ze=>{var wt=Jee(),$=v(ct(wt),2),q=v(m($)),R=v(q,2);ti(R,21,()=>l(it),Ri,(Ce,He)=>{var Oe=ZC(),et={};W(()=>{et!==(et=l(He))&&(Oe.value=(Oe.__value=l(He))??"")}),D(Ce,Oe)});var G=v($,2);{var Y=Ce=>{var He=vl(),Oe=m(He);W(()=>O(Oe,l(ii))),D(Ce,He)};N(G,Ce=>{l(ii)&&Ce(Y)})}var te=v(G,2),se=m(te),fe=v(se,2),be=m(fe);W(Ce=>{fe.disabled=Ce,O(be,l(ft)?"Adding…":"Add CA cert")},[()=>l(ft)||!l(vt).trim()]),z("input",q,Ni),At(q,()=>l(vt),Ce=>x(vt,Ce)),z("click",se,()=>x(Qe,!1)),z("click",fe,sn),D(Ze,wt)};N(pe,Ze=>{l(mt)==="pem"?Ze(ve):Ze(tt,-1)})}W(()=>{Rt=kt(Zt,1,"svelte-9auejo",null,Rt,{active:l(mt)==="pem"}),ae=kt(V,1,"svelte-9auejo",null,ae,{active:l(mt)==="path"})}),z("click",Zt,()=>x(mt,"pem")),z("click",V,()=>x(mt,"path")),D(Le,Ve)};N(Ft,Le=>{l(Qe)&&Le(zt)})}z("click",bi,di),z("click",gi,()=>{x(r,!0),x(g,""),x(p,null)}),z("click",ji,()=>{x(C,!0),x(A,""),x(I,""),x(T,""),x(j,!1),x(P,"")}),z("click",pi,()=>{x(U,!0),x(me,""),x(Q,"pem"),x(oe,""),x(le,""),x(re,""),x(ce,""),x(Se,""),x(ie,!1)}),z("click",Gi,()=>{x(Be,!0),x(Ee,""),x(he,""),x(De,""),x(ot,[],!0),x(It,[],!0)}),z("click",Jt,()=>{x(Qe,!0),x(rt,""),x(_e,""),x(mt,"pem"),x(ii,""),x(vt,""),x(it,[],!0)}),D(o,Qt),eo()}uo(["click","change","input"]);var Xx=F('<div class="err svelte-17yczfe"> </div>'),nte=F('<div class="check-list svelte-17yczfe"><div class="check-row svelte-17yczfe"><span> </span> <code class="svelte-17yczfe">mosquitto_ctrl</code> <span> </span></div> <div class="check-row svelte-17yczfe"><span> </span> <code class="svelte-17yczfe">mosquitto</code> <span> </span></div></div>'),ste=F('<div class="checking svelte-17yczfe">Checking…</div>'),ote=F('<div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">Tool availability</h3> <p class="hint svelte-17yczfe">These tools must be installed and in the PATH of the she process. They are used by the Setup Wizard and cert installation.</p> <!> <!> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div></div>'),rte=F('<label class="svelte-17yczfe">Install command (run locally) <div class="pubkey-row svelte-17yczfe"><input readonly="" class="svelte-17yczfe"/> <button class="copy-btn svelte-17yczfe">Copy</button></div></label>'),ate=F('<label class="svelte-17yczfe">Public key <div class="pubkey-row svelte-17yczfe"><textarea readonly="" rows="3" class="svelte-17yczfe"></textarea> <button class="copy-btn svelte-17yczfe">Copy</button></div></label> <!> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div>',1),lte=F('<div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button></div>'),cte=F("<span> </span>"),dte=F('<div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">SSH connection</h3> <p class="hint svelte-17yczfe">Used for file operations: reading/writing mosquitto.conf and installing certificates on the broker host. User/ACL management always uses the MQTT port directly.</p> <div class="fields svelte-17yczfe"><label class="svelte-17yczfe">Host<input placeholder="192.168.1.10 or broker.local" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">Port<input type="number" min="1" max="65535" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">SSH user<input placeholder="root" class="svelte-17yczfe"/></label> <label class="svelte-17yczfe">Identity file (private key)<input class="svelte-17yczfe"/></label></div></div> <div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">SSH keypair</h3> <p class="hint svelte-17yczfe">Dedicated Ed25519 keypair for she to authenticate to the broker host. Private key stored at <code class="svelte-17yczfe"> </code>.</p> <!> <!></div> <div class="section svelte-17yczfe"><h3 class="svelte-17yczfe">Test connection</h3> <div class="row svelte-17yczfe"><button class="svelte-17yczfe"> </button> <!></div></div>',1),ute=F('<div class="ok svelte-17yczfe">Saved.</div>'),hte=F('<div class="mosquitto-page svelte-17yczfe"><!> <div class="mode-bar svelte-17yczfe"><span class="mode-label svelte-17yczfe">Connection mode</span> <div class="mode-toggle svelte-17yczfe"><button>Local</button> <button>SSH / Remote</button></div> <span class="mode-desc svelte-17yczfe"> </span></div> <!> <!> <!> <!> <div class="row svelte-17yczfe"><button class="btn-primary svelte-17yczfe"> </button></div></div>');function fte(o,e){Js(e,!0);let t=B(vi({})),i=B(""),n=B(!1),s=B(!1),r=B(""),a=B("~/.she/ssh/broker_id_ed25519"),d=B("local"),u=B(null),f=B(!1),g=B(""),p=B(""),C=B(!1),b=B(""),E=B(!1),w=B(""),A=B(vi({}));no(async()=>{try{const[it,ft,ii]=await Promise.all([Gl(),Ob(),fetch("/she/broker/ssh/pubkey").then(ri=>ri.json()).catch(()=>({publicKey:null}))]);x(A,it,!0),ft.sshKeyDefault&&x(a,ft.sshKeyDefault,!0);const di=l(A).broker??{};x(t,di.ssh??{},!0),l(t).port||(l(t).port=22),l(t).identityFile||(l(t).identityFile=l(a)),ii.publicKey&&x(p,ii.publicKey,!0),x(d,l(t).host?"ssh":"local",!0),l(d)==="local"&&I()}catch(it){x(i,it.message,!0)}});async function I(){x(f,!0),x(g,"");try{x(u,await SU(),!0)}catch(it){x(g,it.message??"Check failed",!0)}finally{x(f,!1)}}async function T(){x(n,!0),x(r,""),x(s,!1);try{const it=l(A).broker??{},ft=l(d)==="local"?{...l(t),host:""}:l(t),ii={...l(A),broker:{...it,ssh:ft}};await Ap(ii),x(s,!0),setTimeout(()=>x(s,!1),3e3)}catch(it){x(r,it.message,!0)}finally{x(n,!1)}}async function M(){x(C,!0),x(b,"");try{const it=await fetch("/she/broker/ssh/keygen",{method:"POST",headers:{"Content-Type":"application/json"}}),ft=await it.json();if(!it.ok)throw new Error(ft.error??it.statusText);x(p,ft.publicKey,!0)}catch(it){x(b,it.message,!0)}finally{x(C,!1)}}async function P(){x(E,!0),x(w,"");try{const it=await fetch("/she/broker/ssh/test",{method:"POST",headers:{"Content-Type":"application/json"}}),ft=await it.json();if(!it.ok)throw new Error(ft.error??it.statusText);x(w,ft.ok?"✓ Connection successful":"✗ "+(ft.error??"Failed"),!0)}catch(it){x(w,"✗ "+it.message)}finally{x(E,!1)}}function j(it){navigator.clipboard.writeText(it).catch(()=>{})}const U=Bt(()=>l(t).identityFile&&l(t).user&&l(t).host?`ssh-copy-id -i ${l(t).identityFile}.pub ${l(t).user}@${l(t).host}`:"");var Q=hte(),oe=m(Q);{var le=it=>{var ft=Xx(),ii=m(ft);W(()=>O(ii,l(i))),D(it,ft)};N(oe,it=>{l(i)&&it(le)})}var re=v(oe,2),ce=v(m(re),2),Se=m(ce);let ie;var ge=v(Se,2);let me;var Be=v(ce,2),he=m(Be),De=v(re,2);{var Re=it=>{var ft=ote(),ii=v(m(ft),4);{var di=ci=>{var $t=Xx(),Pi=m($t);W(()=>O(Pi,l(g))),D(ci,$t)};N(ii,ci=>{l(g)&&ci(di)})}var ri=v(ii,2);{var _t=ci=>{var $t=nte(),Pi=m($t),Ni=m(Pi);let ki;var nn=m(Ni),sn=v(Ni,4);let pn;var wn=m(sn),ht=v(Pi,2),Qt=m(ht);let Ti;var Bi=m(Qt),bi=v(Qt,4);let bn;var Cn=m(bi);W(()=>{ki=kt(Ni,1,"check-icon svelte-17yczfe",null,ki,{ok:l(u).mosquittoCtrl,fail:!l(u).mosquittoCtrl}),O(nn,l(u).mosquittoCtrl?"✓":"✗"),pn=kt(sn,1,"check-note svelte-17yczfe",null,pn,{ok:l(u).mosquittoCtrl,fail:!l(u).mosquittoCtrl}),O(wn,l(u).mosquittoCtrl?"found in PATH":"not found — install the mosquitto or mosquitto-clients package"),Ti=kt(Qt,1,"check-icon svelte-17yczfe",null,Ti,{ok:l(u).mosquitto,fail:!l(u).mosquitto}),O(Bi,l(u).mosquitto?"✓":"✗"),bn=kt(bi,1,"check-note svelte-17yczfe",null,bn,{ok:l(u).mosquitto,fail:!l(u).mosquitto}),O(Cn,l(u).mosquitto?"found in PATH":"not found — install the mosquitto package")}),D(ci,$t)},li=ci=>{var $t=ste();D(ci,$t)};N(ri,ci=>{l(u)?ci(_t):l(f)&&ci(li,1)})}var Te=v(ri,2),ye=m(Te),Pt=m(ye);W(()=>{ye.disabled=l(f),O(Pt,l(f)?"Checking…":l(u)?"Re-check":"Check tools")}),z("click",ye,I),D(it,ft)};N(De,it=>{l(d)==="local"&&it(Re)})}var Ee=v(De,2);{var ot=it=>{var ft=dte(),ii=ct(ft),di=v(m(ii),4),ri=m(di),_t=v(m(ri)),li=v(ri,2),Te=v(m(li)),ye=v(li,2),Pt=v(m(ye)),ci=v(ye,2),$t=v(m(ci)),Pi=v(ii,2),Ni=v(m(Pi),2),ki=v(m(Ni)),nn=m(ki),sn=v(Ni,2);{var pn=$e=>{var Yt=ate(),Fi=ct(Yt),gi=v(m(Fi)),ji=m(gi),pi=v(ji,2),Gi=v(Fi,2);{var Z=Wt=>{var Jt=rte(),ut=v(m(Jt)),Je=m(ut),dt=v(Je,2);W(()=>A1(Je,l(U))),z("click",dt,()=>j(l(U))),D(Wt,Jt)};N(Gi,Wt=>{l(U)&&Wt(Z)})}var we=v(Gi,2),st=m(we),Ye=m(st);W(()=>{A1(ji,l(p)),st.disabled=l(C),O(Ye,l(C)?"Generating…":"Regenerate keypair")}),z("click",pi,()=>j(l(p))),z("click",st,M),D($e,Yt)},wn=$e=>{var Yt=lte(),Fi=m(Yt),gi=m(Fi);W(()=>{Fi.disabled=l(C),O(gi,l(C)?"Generating…":"Generate keypair")}),z("click",Fi,M),D($e,Yt)};N(sn,$e=>{l(p)?$e(pn):$e(wn,-1)})}var ht=v(sn,2);{var Qt=$e=>{var Yt=Xx(),Fi=m(Yt);W(()=>O(Fi,l(b))),D($e,Yt)};N(ht,$e=>{l(b)&&$e(Qt)})}var Ti=v(Pi,2),Bi=v(m(Ti),2),bi=m(Bi),bn=m(bi),Cn=v(bi,2);{var kn=$e=>{var Yt=cte();let Fi;var gi=m(Yt);W(ji=>{Fi=kt(Yt,1,"test-result svelte-17yczfe",null,Fi,ji),O(gi,l(w))},[()=>({ok:l(w).startsWith("✓"),fail:l(w).startsWith("✗")})]),D($e,Yt)};N(Cn,$e=>{l(w)&&$e(kn)})}W(()=>{fn($t,"placeholder",l(a)),O(nn,l(t).identityFile||l(a)),bi.disabled=l(E)||!l(t).host,O(bn,l(E)?"Testing…":"Test SSH connection")}),At(_t,()=>l(t).host,$e=>l(t).host=$e),At(Te,()=>l(t).port,$e=>l(t).port=$e),At(Pt,()=>l(t).user,$e=>l(t).user=$e),At($t,()=>l(t).identityFile,$e=>l(t).identityFile=$e),z("click",bi,P),D(it,ft)};N(Ee,it=>{l(d)==="ssh"&&it(ot)})}var It=v(Ee,2);{var Qe=it=>{var ft=Xx(),ii=m(ft);W(()=>O(ii,l(r))),D(it,ft)};N(It,it=>{l(r)&&it(Qe)})}var mt=v(It,2);{var _e=it=>{var ft=ute();D(it,ft)};N(mt,it=>{l(s)&&it(_e)})}var Pe=v(mt,2),rt=m(Pe),vt=m(rt);W(()=>{ie=kt(Se,1,"svelte-17yczfe",null,ie,{active:l(d)==="local"}),me=kt(ge,1,"svelte-17yczfe",null,me,{active:l(d)==="ssh"}),O(he,l(d)==="local"?"she and mosquitto run on the same machine — local filesystem access":"mosquitto runs on a remote host — file operations go through SSH"),rt.disabled=l(n),O(vt,l(n)?"Saving…":"Save")}),z("click",Se,()=>{x(d,"local"),l(u)||I()}),z("click",ge,()=>x(d,"ssh")),z("click",rt,T),D(o,Q),eo()}uo(["click"]);var gte=F("<button> </button>"),pte=F('<code>log_dest topic</code> is not enabled in mosquitto.conf.<br/> <span class="hint svelte-1yc29ow">Enable it in the <strong>Config</strong> tab, then click <em>Apply & Reload</em>.</span>',1),xte=F('<code>log_dest topic</code> is configured — waiting for messages…<br/> <span class="hint svelte-1yc29ow">If nothing appears, mosquitto may need a full restart for the change to take effect.</span>',1),vte=F('Waiting for log messages…<br/> <span class="hint svelte-1yc29ow">Make sure <code class="svelte-1yc29ow">log_dest topic</code> is set in mosquitto.conf.</span>',1),mte=F('<div class="empty svelte-1yc29ow"><!></div>'),_te=F('<div class="entry svelte-1yc29ow"><span class="ts svelte-1yc29ow"> </span> <span> </span> <span class="msg svelte-1yc29ow"> </span></div>'),bte=F('<div class="logs-page svelte-1yc29ow"><div class="toolbar svelte-1yc29ow"><div class="level-filters svelte-1yc29ow"></div> <div class="spacer svelte-1yc29ow"></div> <label class="autoscroll-label svelte-1yc29ow"><input type="checkbox" class="svelte-1yc29ow"/> <span class="checkmark svelte-1yc29ow"></span> Auto-scroll</label> <button class="btn-clear svelte-1yc29ow">Clear</button></div> <div class="log-container svelte-1yc29ow"><!></div></div>');function Cte(o,e){Js(e,!0);const t={D:"DBG",I:"INF",N:"NTC",W:"WRN",E:"ERR"},i={D:"lvl-d",I:"lvl-i",N:"lvl-n",W:"lvl-w",E:"lvl-e"},n=new Set(["D","I","N","W","E"]);let s=B(vi([])),r=B(!0),a=B(vi(new Set(["D","I","N","W","E"]))),d=B(void 0),u=B(!1),f=B(null),g=null;no(async()=>{const le=await AU().catch(()=>[]),re=xq(),ce=new Set,Se=[...le,...re].filter(ie=>n.has(ie.level)).map(ie=>({ts:ie.ts,level:ie.level,msg:ie.msg}));Se.sort((ie,ge)=>ie.ts-ge.ts),x(s,Se.filter(ie=>{const ge=`${ie.ts}\0${ie.msg}`;return ce.has(ge)?!1:(ce.add(ge),!0)}).slice(-500),!0),l(s).length>0&&(x(u,!0),Dl().then(p)),g=ir("brokerLog",ie=>{n.has(ie.level)&&(x(u,!0),x(s,[...l(s).slice(-499),{ts:ie.ts,level:ie.level,msg:ie.msg}],!0),l(r)&&Dl().then(p))}),ux().then(ie=>{const ge=ie.managed.log_dest,me=Array.isArray(ge)?ge:ge?[ge]:[];x(f,me.includes("topic"),!0)}).catch(()=>{x(f,null)})}),B0(()=>{g==null||g()});function p(){l(d)&&(l(d).scrollTop=l(d).scrollHeight)}function C(le){const re=new Set(l(a));re.has(le)?re.delete(le):re.add(le),x(a,re,!0)}function b(){x(s,[],!0),x(u,!1)}let E=Bt(()=>l(s).filter(le=>l(a).has(le.level)));var w=bte(),A=m(w),I=m(A);ti(I,20,()=>["D","I","N","W","E"],Ri,(le,re)=>{var ce=gte();let Se;var ie=m(ce);W(ge=>{Se=kt(ce,1,`lvl-btn ${i[re]??""}`,"svelte-1yc29ow",Se,ge),fn(ce,"title",`Toggle ${re??""} messages`),O(ie,t[re])},[()=>({active:l(a).has(re)})]),z("click",ce,()=>C(re)),D(le,ce)});var T=v(I,4),M=m(T),P=v(T,2),j=v(A,2),U=m(j);{var Q=le=>{var re=mte(),ce=m(re);{var Se=ge=>{var me=Hs(),Be=ct(me);{var he=Ee=>{var ot=pte();D(Ee,ot)},De=Ee=>{var ot=xte();D(Ee,ot)},Re=Ee=>{var ot=vte();D(Ee,ot)};N(Be,Ee=>{l(f)===!1?Ee(he):l(f)===!0?Ee(De,1):Ee(Re,-1)})}D(ge,me)},ie=ge=>{var me=mo("No messages match the current filter.");D(ge,me)};N(ce,ge=>{l(u)?ge(ie,-1):ge(Se)})}D(le,re)},oe=le=>{var re=Hs(),ce=ct(re);ti(ce,17,()=>l(E),Ri,(Se,ie)=>{var ge=_te(),me=m(ge),Be=m(me),he=v(me,2),De=m(he),Re=v(he,2),Ee=m(Re);W(ot=>{O(Be,ot),kt(he,1,`badge ${i[l(ie).level]??""}`,"svelte-1yc29ow"),O(De,t[l(ie).level]),O(Ee,l(ie).msg)},[()=>uS(l(ie).ts)]),D(Se,ge)}),D(le,re)};N(U,le=>{l(E).length===0?le(Q):le(oe,-1)})}Bs(j,le=>x(d,le),()=>l(d)),Os(M,()=>l(r),le=>x(r,le)),z("click",P,b),D(o,w),eo()}uo(["click"]);var Ete=F('<div class="err svelte-d31be1"> </div>'),yte=F('<div class="step svelte-d31be1"><p class="svelte-d31be1">This wizard will configure the <strong>Mosquitto Dynamic Security plugin</strong> for use with she. It will:</p> <ul class="svelte-d31be1"><li>Create a <code class="svelte-d31be1">she-admin</code> service account with a random strong password.</li> <li>Write <code class="svelte-d31be1">dynamic-security.json</code> to your mosquitto config directory.</li> <li>Add the <code class="svelte-d31be1">plugin</code> line to <code class="svelte-d31be1">mosquitto.conf</code>.</li> <li>Ask you to restart mosquitto to activate the plugin.</li></ul> <p class="hint svelte-d31be1">In <strong>remote mode</strong> (SSH host configured), <code class="svelte-d31be1">mosquitto_ctrl</code> is invoked on the broker host via SSH. In local mode, it must be installed on this machine. <code class="svelte-d31be1">mosquitto_ctrl</code> is part of the <code class="svelte-d31be1">mosquitto</code> package.</p> <div class="actions svelte-d31be1"><button class="svelte-d31be1">Start</button></div></div>'),wte=F('<div class="step svelte-d31be1"><p class="svelte-d31be1"> </p></div>'),Ste=F('<div class="step svelte-d31be1"><p class="svelte-d31be1">dynsec is not yet active. Configure bootstrap settings:</p> <label class="svelte-d31be1">Admin username<input class="svelte-d31be1"/></label> <label class="svelte-d31be1">Admin password<input type="password" placeholder="(leave blank to auto-generate)" class="svelte-d31be1"/></label> <label class="svelte-d31be1">Mosquitto config directory<input class="svelte-d31be1"/></label> <div class="actions svelte-d31be1"><button class="svelte-d31be1"> </button></div></div>'),Dte=F('<p class="hint svelte-d31be1">Restarting mosquitto… this may take a few seconds.</p>'),Ate=F(`<div class="step svelte-d31be1"><div class="ok-banner svelte-d31be1">✓ dynsec files written and credentials saved.</div> <p class="svelte-d31be1">The <code class="svelte-d31be1">plugin</code> line has been added to <code class="svelte-d31be1"> </code>.</p> <p class="svelte-d31be1">Enabling a new plugin requires a <strong>full mosquitto restart</strong> (not just SIGHUP):</p> <div class="actions svelte-d31be1"><button class="btn-warn svelte-d31be1"> </button> <button class="skip-step svelte-d31be1">Skip (I'll restart manually)</button></div> <!></div>`),kte=F('<div class="step svelte-d31be1"><div class="ok-banner svelte-d31be1">✓ dynsec is configured and connected.</div> <p class="svelte-d31be1">she is now managing broker users and ACLs via the Dynamic Security plugin. You can use the <strong>Users & Roles</strong> tab to add users, create roles, and define ACL rules.</p> <div class="actions svelte-d31be1"><button class="btn-primary svelte-d31be1">Done</button></div></div>'),Bte=F('<div class="step svelte-d31be1"><p class="svelte-d31be1">Enter the credentials of an existing dynsec admin account:</p> <label class="svelte-d31be1">Admin username<input class="svelte-d31be1"/></label> <label class="svelte-d31be1">Admin password<input type="password" class="svelte-d31be1"/></label> <div class="actions svelte-d31be1"><button class="svelte-d31be1">Back</button> <button class="btn-primary svelte-d31be1"> </button></div></div>'),Fte=F('<div class="wizard svelte-d31be1"><div class="wizard-header svelte-d31be1"><h3 class="svelte-d31be1">dynsec Setup Wizard</h3> <button class="skip-btn svelte-d31be1">Manual setup instead</button></div> <!> <!></div>');function Lte(o,e){Js(e,!0);let t=B("intro"),i=B(""),n=B(!1),s=B("she-admin"),r=B(""),a=B("/etc/mosquitto"),d=B(null),u=B(!1),f=B(!1),g=B("she-admin"),p=B(""),C=B(!1);async function b(){x(n,!0),x(i,"");try{(await(await fetch("/she/broker/wizard/probe",{method:"POST",headers:{"Content-Type":"application/json"}})).json()).active?x(t,"done"):x(t,"config")}catch(ie){x(i,ie.message,!0)}finally{x(n,!1)}}async function E(){x(n,!0),x(i,"");try{const ie=await fetch("/she/broker/wizard/bootstrap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adminUsername:l(s),adminPassword:l(r)||void 0,configDir:l(a)})}),ge=await ie.json();if(!ie.ok||!ge.ok)throw new Error(ge.error??"Bootstrap failed");x(d,ge,!0);const me=await Gl(),Be=me.broker??{};await Ap({...me,broker:{...Be,dynsec:{adminUsername:ge.adminUsername,adminPassword:ge.adminPassword}}}),await PU().catch(()=>{}),x(t,"restart")}catch(ie){x(i,ie.message,!0)}finally{x(n,!1)}}async function w(){x(f,!0),x(i,"");try{await LU(),await new Promise(ie=>setTimeout(ie,2e3)),x(u,!0),x(t,"done")}catch(ie){x(i,ie.message,!0)}finally{x(f,!1)}}async function A(){x(C,!0),x(i,"");try{const ie=await Gl(),ge=ie.broker??{};await Ap({...ie,broker:{...ge,dynsec:{adminUsername:l(g),adminPassword:l(p)}}}),x(t,"done")}catch(ie){x(i,ie.message,!0)}finally{x(C,!1)}}var I=Fte(),T=m(I),M=v(m(T),2),P=v(T,2);{var j=ie=>{var ge=Ete(),me=m(ge);W(()=>O(me,l(i))),D(ie,ge)};N(P,ie=>{l(i)&&ie(j)})}var U=v(P,2);{var Q=ie=>{var ge=yte(),me=v(m(ge),6),Be=m(me);W(()=>Be.disabled=l(n)),z("click",Be,()=>{x(t,"probe"),b()}),D(ie,ge)},oe=ie=>{var ge=wte(),me=m(ge),Be=m(me);W(()=>O(Be,l(n)?"Probing dynsec…":"Checking dynsec status…")),D(ie,ge)},le=ie=>{var ge=Ste(),me=v(m(ge),2),Be=v(m(me)),he=v(me,2),De=v(m(he)),Re=v(he,2),Ee=v(m(Re)),ot=v(Re,2),It=m(ot),Qe=m(It);W(()=>{It.disabled=l(n)||!l(s),O(Qe,l(n)?"Bootstrapping…":"Bootstrap dynsec")}),At(Be,()=>l(s),mt=>x(s,mt)),At(De,()=>l(r),mt=>x(r,mt)),At(Ee,()=>l(a),mt=>x(a,mt)),z("click",It,E),D(ie,ge)},re=ie=>{var ge=Ate(),me=v(m(ge),2),Be=v(m(me),3),he=m(Be),De=v(me,4),Re=m(De),Ee=m(Re),ot=v(Re,2),It=v(De,2);{var Qe=mt=>{var _e=Dte();D(mt,_e)};N(It,mt=>{l(f)&&mt(Qe)})}W(()=>{O(he,l(d).confFilePath),Re.disabled=l(f),O(Ee,l(f)?"Restarting…":"Restart mosquitto now")}),z("click",Re,w),z("click",ot,()=>{x(t,"done")}),D(ie,ge)},ce=ie=>{var ge=kte(),me=v(m(ge),4),Be=m(me);z("click",Be,function(...he){var De;(De=e.onDone)==null||De.apply(this,he)}),D(ie,ge)},Se=ie=>{var ge=Bte(),me=v(m(ge),2),Be=v(m(me)),he=v(me,2),De=v(m(he)),Re=v(he,2),Ee=m(Re),ot=v(Ee,2),It=m(ot);W(()=>{ot.disabled=l(C)||!l(g)||!l(p),O(It,l(C)?"Saving…":"Save credentials")}),At(Be,()=>l(g),Qe=>x(g,Qe)),At(De,()=>l(p),Qe=>x(p,Qe)),z("click",Ee,()=>x(t,"intro")),z("click",ot,A),D(ie,ge)};N(U,ie=>{l(t)==="intro"?ie(Q):l(t)==="probe"?ie(oe,1):l(t)==="config"?ie(le,2):l(t)==="restart"&&l(d)?ie(re,3):l(t)==="done"?ie(ce,4):l(t)==="manual"&&ie(Se,5)})}z("click",M,()=>x(t,"manual")),D(o,I),eo()}uo(["click"]);var sA=F('<div class="err svelte-bwar3a"> </div>'),Ite=F('<div class="ok svelte-bwar3a">Saved.</div>'),Pte=F('<div class="reload-msg svelte-bwar3a"> </div>'),Tte=F('<div class="loading svelte-bwar3a">Loading…</div>'),Mte=F('<li class="svelte-bwar3a"><span class="backup-name svelte-bwar3a"> </span> <button class="btn-restore svelte-bwar3a"> </button></li>'),Rte=F('<div class="backups-section svelte-bwar3a"><div class="backups-header svelte-bwar3a"><span class="backups-title svelte-bwar3a">Backups</span> <button class="btn-refresh svelte-bwar3a" title="Refresh backup list">↻</button></div> <ul class="backup-list svelte-bwar3a"></ul></div>'),Nte=F('<div class="advanced-page svelte-bwar3a"><div class="page-header svelte-bwar3a"><h3 class="svelte-bwar3a">Advanced — mosquitto.conf</h3> <div class="header-actions svelte-bwar3a"><button class="btn-save svelte-bwar3a"> </button> <button class="svelte-bwar3a"> </button></div></div> <!> <!> <!> <!> <div class="editor-wrap svelte-bwar3a"><!></div> <!></div> <!>',1);function Ote(o,e){Js(e,!0);let t=B(""),i=B(null),n=B(vi([])),s=B(!0),r=B(""),a=B(!1),d=B(""),u=B(!1),f=B(!1),g=B(""),p=B(""),C;no(()=>{b()});async function b(){x(s,!0),x(r,"");try{const Pe=await ux();x(t,Pe.raw??"",!0),x(i,Pe.checksum,!0),x(n,Pe.backups??[],!0)}catch(Pe){x(r,Pe.message??"Failed to load config",!0)}finally{x(s,!1)}}async function E(){var Pe;x(a,!0),x(d,""),x(u,!1);try{await kU(l(t),l(i)),x(u,!0),await b(),x(u,!0)}catch(rt){(Pe=rt.message)!=null&&Pe.includes("external_modify")||rt.status===409?x(d,"mosquitto.conf was modified externally since last read. Reload first."):x(d,rt.message??"Save failed",!0)}finally{x(a,!1)}}async function w(){x(f,!0),x(g,"");try{const Pe=await Hb();x(g,Pe.stderr||Pe.stdout||"Reloaded",!0)}catch(Pe){x(g,"Error: "+(Pe.message??"reload failed"))}finally{x(f,!1)}}async function A(Pe){if(await C.show(`Restore backup "${Pe}"? Current mosquitto.conf will be overwritten.`,{confirm:"Restore",danger:!0})){x(p,Pe,!0),x(d,"");try{await FU(Pe),await b()}catch(rt){x(d,rt.message??"Restore failed",!0)}finally{x(p,"")}}}async function I(){try{const Pe=await BU();x(n,Pe.backups,!0)}catch{}}function T(Pe){const rt=Pe.match(/\.bak-(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})/);return rt?`${rt[1]}-${rt[2]}-${rt[3]} ${rt[4]}:${rt[5]}:${rt[6]}`:Pe}var M=Nte(),P=ct(M),j=m(P),U=v(m(j),2),Q=m(U),oe=m(Q),le=v(Q,2),re=m(le),ce=v(j,2);{var Se=Pe=>{var rt=sA(),vt=m(rt);W(()=>O(vt,l(r))),D(Pe,rt)};N(ce,Pe=>{l(r)&&Pe(Se)})}var ie=v(ce,2);{var ge=Pe=>{var rt=sA(),vt=m(rt);W(()=>O(vt,l(d))),D(Pe,rt)};N(ie,Pe=>{l(d)&&Pe(ge)})}var me=v(ie,2);{var Be=Pe=>{var rt=Ite();D(Pe,rt)};N(me,Pe=>{l(u)&&Pe(Be)})}var he=v(me,2);{var De=Pe=>{var rt=Pte(),vt=m(rt);W(()=>O(vt,l(g))),D(Pe,rt)};N(he,Pe=>{l(g)&&Pe(De)})}var Re=v(he,2),Ee=m(Re);{var ot=Pe=>{var rt=Tte();D(Pe,rt)},It=Pe=>{Mg(Pe,{language:"ini",onSave:E,get value(){return l(t)},set value(rt){x(t,rt,!0)}})};N(Ee,Pe=>{l(s)?Pe(ot):Pe(It,-1)})}var Qe=v(Re,2);{var mt=Pe=>{var rt=Rte(),vt=m(rt),it=v(m(vt),2),ft=v(vt,2);ti(ft,21,()=>l(n),Ri,(ii,di)=>{var ri=Mte(),_t=m(ri),li=m(_t),Te=v(_t,2),ye=m(Te);W(Pt=>{O(li,Pt),Te.disabled=l(p)===l(di),O(ye,l(p)===l(di)?"Restoring…":"Restore")},[()=>T(l(di))]),z("click",Te,()=>A(l(di))),D(ii,ri)}),z("click",it,I),D(Pe,rt)};N(Qe,Pe=>{l(n).length>0&&Pe(mt)})}var _e=v(P,2);Bs(hl(_e,{}),Pe=>C=Pe,()=>C),W(()=>{Q.disabled=l(a)||l(s),O(oe,l(a)?"Saving…":"Save"),le.disabled=l(f),O(re,l(f)?"Reloading…":"Apply & Reload")}),z("click",Q,E),z("click",le,w),D(o,M),eo()}uo(["click"]);var Hte=F('<div class="reload-msg svelte-1q1ovna"> </div>'),XC=F('<div class="err svelte-1q1ovna"> </div>'),oA=F('<div class="ok svelte-1q1ovna"> </div>'),rA=F('<div class="loading svelte-1q1ovna">Loading…</div>'),Wte=F('<span class="inline-err svelte-1q1ovna"> </span>'),zte=F('<div class="change-form svelte-1q1ovna"><input type="password" placeholder="New password" autocomplete="new-password" class="svelte-1q1ovna"/> <input type="password" placeholder="Confirm password" autocomplete="new-password" class="svelte-1q1ovna"/> <!> <button class="svelte-1q1ovna"> </button> <button class="svelte-1q1ovna">Cancel</button></div>'),Vte=F('<button class="svelte-1q1ovna">Change password</button> <button class="btn-danger svelte-1q1ovna"> </button>',1),jte=F('<tr><td class="user-name svelte-1q1ovna"> </td><td class="user-actions svelte-1q1ovna"><!></td></tr>'),$te=F('<table class="user-table svelte-1q1ovna"><thead><tr><th class="svelte-1q1ovna">Username</th><th class="svelte-1q1ovna"></th></tr></thead><tbody></tbody></table>'),Ute=F('<p class="empty svelte-1q1ovna">No users found — file may not exist yet.</p>'),qte=F('<!> <div class="add-form svelte-1q1ovna"><span class="add-title svelte-1q1ovna">Add user</span> <div class="add-fields svelte-1q1ovna"><input placeholder="Username" autocomplete="off" class="svelte-1q1ovna"/> <input type="password" placeholder="Password" autocomplete="new-password" class="svelte-1q1ovna"/> <input type="password" placeholder="Confirm password" autocomplete="new-password" class="svelte-1q1ovna"/> <button class="btn-add svelte-1q1ovna"> </button></div> <!></div>',1),Gte=F(`<div class="passwd-page svelte-1q1ovna"><section class="card svelte-1q1ovna"><div class="card-header svelte-1q1ovna"><h4 class="svelte-1q1ovna">Password File</h4> <div class="header-actions svelte-1q1ovna"><button class="svelte-1q1ovna"> </button></div></div> <div class="file-row svelte-1q1ovna"><label class="file-label svelte-1q1ovna"><span class="svelte-1q1ovna">File path</span> <input placeholder="/etc/mosquitto/passwd" class="svelte-1q1ovna"/></label> <button class="svelte-1q1ovna">↻</button></div> <!> <!> <!> <!></section> <section class="card acl-card svelte-1q1ovna"><div class="card-header svelte-1q1ovna"><h4 class="svelte-1q1ovna">ACL File</h4> <div class="header-actions svelte-1q1ovna"><button class="btn-save svelte-1q1ovna"> </button></div></div> <div class="file-row svelte-1q1ovna"><label class="file-label svelte-1q1ovna"><span class="svelte-1q1ovna">File path</span> <input placeholder="/etc/mosquitto/acl" class="svelte-1q1ovna"/></label> <button class="svelte-1q1ovna">↻</button></div> <!> <!> <div class="acl-editor-wrap svelte-1q1ovna"><!></div> <p class="hint svelte-1q1ovna">Static ACL file format: <code class="svelte-1q1ovna">user <username></code> followed by <code class="svelte-1q1ovna">topic [read|write|readwrite] <pattern></code>.
|
|
233
233
|
Requires <code class="svelte-1q1ovna">acl_file</code> set in mosquitto.conf and no dynsec plugin.
|
|
234
|
-
After saving, click <strong>Apply & Reload</strong> above to activate changes.</p></section></div> <!>`,1);function Kte(o,e){Js(e,!0);let t=B("/etc/mosquitto/passwd"),i=B(vi([])),n=B(!1),s=B(""),r=B(""),a=B(""),d=B(""),u=B(""),f=B(!1),g=B(""),p=B(null),C=B(""),b=B(""),E=B(!1),w=B(""),A=B(null),I=B("/etc/mosquitto/acl"),T=B(""),M=B(!1),P=B(""),j=B(""),U=B(!1),Q=B(!1),oe=B(""),le;no(async()=>{try{const $e=await ux(),Yt=$e.listeners.find(gi=>gi.password_file);Yt!=null&&Yt.password_file&&x(t,Yt.password_file,!0);const Fi=$e.listeners.find(gi=>gi.acl_file);Fi!=null&&Fi.acl_file&&x(I,Fi.acl_file,!0),!(Yt!=null&&Yt.password_file)&&$e.managed.password_file&&x(t,String($e.managed.password_file),!0),!(Fi!=null&&Fi.acl_file)&&$e.managed.acl_file&&x(I,String($e.managed.acl_file),!0)}catch{}await re(),await me()});async function re(){if(l(t)){x(n,!0),x(s,""),x(r,"");try{const $e=await MU(l(t));x(i,$e.users,!0)}catch($e){x(s,$e.message??"Failed to load password file",!0)}finally{x(n,!1)}}}async function ce(){if(!l(a).trim()){x(g,"Username required");return}if(!l(d)){x(g,"Password required");return}if(l(d)!==l(u)){x(g,"Passwords do not match");return}x(f,!0),x(g,""),x(r,"");try{await x2(l(t),l(a).trim(),l(d)),x(a,""),x(d,""),x(u,""),x(r,"User added."),await re()}catch($e){x(g,$e.message??"Failed to add user",!0)}finally{x(f,!1)}}async function Se($e){x(p,$e,!0),x(C,""),x(b,""),x(w,"")}async function ie(){if(!l(C)){x(w,"Password required");return}if(l(C)!==l(b)){x(w,"Passwords do not match");return}x(E,!0),x(w,""),x(r,"");try{await x2(l(t),l(p),l(C)),x(p,null),x(r,"Password updated.")}catch($e){x(w,$e.message??"Failed to change password",!0)}finally{x(E,!1)}}async function ge($e){if(await le.show(`Delete user "${$e}" from ${l(t)}?`,{confirm:"Delete",danger:!0})){x(A,$e,!0),x(s,""),x(r,"");try{await RU(l(t),$e),x(r,`User "${$e}" deleted.`),await re()}catch(Yt){x(s,Yt.message??"Delete failed",!0)}finally{x(A,null)}}}async function me(){if(l(I)){x(M,!0),x(P,""),x(j,"");try{const $e=await NU(l(I));x(T,$e.content,!0)}catch($e){x(P,$e.message??"Failed to load ACL file",!0)}finally{x(M,!1)}}}async function Be(){x(U,!0),x(P,""),x(j,"");try{await OU(l(I),l(T)),x(j,"ACL file saved.")}catch($e){x(P,$e.message??"Save failed",!0)}finally{x(U,!1)}}async function he(){x(Q,!0),x(oe,"");try{const $e=await Hb();x(oe,$e.stderr||$e.stdout||"Reloaded",!0)}catch($e){x(oe,"Error: "+($e.message??"reload failed"))}finally{x(Q,!1)}}var De=Gte(),Re=ct(De),Ee=m(Re),ot=m(Ee),It=v(m(ot),2),Qe=m(It),mt=m(Qe),_e=v(ot,2),Pe=m(_e),rt=v(m(Pe),2),vt=v(Pe,2),it=v(_e,2);{var ft=$e=>{var Yt=Hte(),Fi=m(Yt);W(()=>O(Fi,l(oe))),D($e,Yt)};N(it,$e=>{l(oe)&&$e(ft)})}var ii=v(it,2);{var di=$e=>{var Yt=XC(),Fi=m(Yt);W(()=>O(Fi,l(s))),D($e,Yt)};N(ii,$e=>{l(s)&&$e(di)})}var ri=v(ii,2);{var _t=$e=>{var Yt=oA(),Fi=m(Yt);W(()=>O(Fi,l(r))),D($e,Yt)};N(ri,$e=>{l(r)&&$e(_t)})}var li=v(ri,2);{var Te=$e=>{var Yt=rA();D($e,Yt)},ye=$e=>{var Yt=qte(),Fi=ct(Yt);{var gi=Je=>{var dt=$te(),ui=v(m(dt));ti(ui,21,()=>l(i),Ri,(Ae,We)=>{var Oi=jte(),on=m(Oi),Ki=m(on),de=v(on),Ke=m(de);{var Ft=Le=>{var Ve=zte(),Vt=m(Ve),Ut=v(Vt,2),Zt=v(Ut,2);{var Rt=ve=>{var tt=Wte(),Ze=m(tt);W(()=>O(Ze,l(w))),D(ve,tt)};N(Zt,ve=>{l(w)&&ve(Rt)})}var V=v(Zt,2),ae=m(V),pe=v(V,2);W(()=>{V.disabled=l(E),O(ae,l(E)?"…":"Save")}),At(Vt,()=>l(C),ve=>x(C,ve)),At(Ut,()=>l(b),ve=>x(b,ve)),z("click",V,ie),z("click",pe,()=>x(p,null)),D(Le,Ve)},zt=Le=>{var Ve=Vte(),Vt=ct(Ve),Ut=v(Vt,2),Zt=m(Ut);W(()=>{Ut.disabled=l(A)===l(We),O(Zt,l(A)===l(We)?"…":"Delete")}),z("click",Vt,()=>Se(l(We))),z("click",Ut,()=>ge(l(We))),D(Le,Ve)};N(Ke,Le=>{l(p)===l(We)?Le(Ft):Le(zt,-1)})}W(()=>O(Ki,l(We))),D(Ae,Oi)}),D(Je,dt)},ji=Je=>{var dt=Ute();D(Je,dt)};N(Fi,Je=>{l(i).length>0?Je(gi):l(s)||Je(ji,1)})}var pi=v(Fi,2),Gi=v(m(pi),2),Z=m(Gi),we=v(Z,2),st=v(we,2),Ye=v(st,2),Wt=m(Ye),Jt=v(Gi,2);{var ut=Je=>{var dt=XC(),ui=m(dt);W(()=>O(ui,l(g))),D(Je,dt)};N(Jt,Je=>{l(g)&&Je(ut)})}W(()=>{Ye.disabled=l(f),O(Wt,l(f)?"Adding…":"Add")}),At(Z,()=>l(a),Je=>x(a,Je)),At(we,()=>l(d),Je=>x(d,Je)),At(st,()=>l(u),Je=>x(u,Je)),z("click",Ye,ce),D($e,Yt)};N(li,$e=>{l(n)?$e(Te):$e(ye,-1)})}var Pt=v(Ee,2),ci=m(Pt),$t=v(m(ci),2),Pi=m($t),Ni=m(Pi),ki=v(ci,2),nn=m(ki),sn=v(m(nn),2),pn=v(nn,2),wn=v(ki,2);{var ht=$e=>{var Yt=XC(),Fi=m(Yt);W(()=>O(Fi,l(P))),D($e,Yt)};N(wn,$e=>{l(P)&&$e(ht)})}var Qt=v(wn,2);{var Ti=$e=>{var Yt=oA(),Fi=m(Yt);W(()=>O(Fi,l(j))),D($e,Yt)};N(Qt,$e=>{l(j)&&$e(Ti)})}var Bi=v(Qt,2),bi=m(Bi);{var bn=$e=>{var Yt=rA();D($e,Yt)},Cn=$e=>{Mg($e,{language:"plaintext",onSave:Be,get value(){return l(T)},set value(Yt){x(T,Yt,!0)}})};N(bi,$e=>{l(M)?$e(bn):$e(Cn,-1)})}var kn=v(Re,2);Bs(hl(kn,{}),$e=>le=$e,()=>le),W(()=>{Qe.disabled=l(Q),O(mt,l(Q)?"Reloading…":"Apply & Reload"),vt.disabled=l(n),Pi.disabled=l(U),O(Ni,l(U)?"Saving…":"Save"),pn.disabled=l(M)}),z("click",Qe,he),z("change",rt,re),At(rt,()=>l(t),$e=>x(t,$e)),z("click",vt,re),z("click",Pi,Be),z("change",sn,me),At(sn,()=>l(I),$e=>x(I,$e)),z("click",pn,me),D(o,De),eo()}uo(["click","change"]);var Zte=F('<div class="loading svelte-zuhcpo">Loading…</div>'),Xte=F('<div class="error-banner svelte-zuhcpo"> </div>'),Yte=F('<div class="conn-row svelte-zuhcpo"><span></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span><!></span> <button class="btn-deactivate svelte-zuhcpo"> </button></div>'),Qte=F('<button class="btn-wizard-inline svelte-zuhcpo">Setup Wizard ↗</button>'),Jte=F('<div class="conn-row svelte-zuhcpo"><span class="dot dot-off svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span class="conn-detail muted svelte-zuhcpo">not configured</span> <!></div>'),eie=F('<div class="error-inline svelte-zuhcpo"> </div>'),tie=F('<button class="diag-btn svelte-zuhcpo"> </button>'),aA=F('<p class="diag-issue svelte-zuhcpo"> </p>'),iie=F('<p class="diag-ok-msg svelte-zuhcpo">✓ dynamic-security.json looks correct. Verify mosquitto restarted with the plugin loaded.</p>'),nie=F('<p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">File</span><code class="svelte-zuhcpo"> </code></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Admin user exists</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Has admin role</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">$CONTROL publish ACL</span><span> </span></p> <!> <!>',1),sie=F('<div><!></div> <button class="diag-btn svelte-zuhcpo" style="margin-top:6px"> </button>',1),oie=F('<button class="wizard-btn svelte-zuhcpo">Run Setup Wizard</button>'),rie=F('<div class="diag-area svelte-zuhcpo"><!> <!></div>'),aie=F('<div class="stats-block svelte-zuhcpo"><dl class="svelte-zuhcpo"><dt class="svelte-zuhcpo">Version</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Uptime</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Clients</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Messages</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Topics</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Traffic</dt><dd class="svelte-zuhcpo"> </dd></dl></div>'),lie=F('<div style="margin-top: 20px;"><!></div>'),cie=F('<div class="status-layout svelte-zuhcpo"><div class="conn-block svelte-zuhcpo"><div class="conn-row svelte-zuhcpo"><span class="dot ok svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">mosquitto</span> <span class="conn-detail svelte-zuhcpo"> </span></div> <!> <!></div> <!> <!></div> <!>',1),die=F('<div class="tab-content svelte-zuhcpo"><!></div>'),uie=F('<div class="broker-page svelte-zuhcpo"><div class="sub-nav svelte-zuhcpo"><button>Status</button> <button>Directory</button> <button>Config</button> <button>Advanced</button> <button>Auth Files</button> <button>Listeners</button> <button>Certificates</button> <button>Connection</button> <button>Logs</button></div> <!></div> <!>',1);function hie(o,e){Js(e,!0);let t=B(!1),i,n=B(!1),s=B(""),r=B(!1),a=B(null);const d="she-broker-tab";let u=B(vi(localStorage.getItem(d)??"status"));vs(()=>{localStorage.setItem(d,l(u))});let f=B(null),g=B(""),p=B(!0);async function C(){try{x(f,await Ob(),!0),x(g,"")}catch(_t){x(g,_t.message??"Failed to load broker status",!0)}finally{x(p,!1)}}no(()=>{C();const _t=setInterval(C,1e4);return()=>clearInterval(_t)});async function b(){x(r,!0),x(a,null);try{x(a,await TU(),!0)}catch(_t){x(a,{ok:!1,dynSecPath:"",issues:[_t.message??"Diagnose request failed"]},!0)}finally{x(r,!1)}}async function E(){if(await i.show("Remove dynsec plugin lines from mosquitto.conf and clear credentials? You will need to restart mosquitto afterwards.",{confirm:"Deactivate",danger:!0})){x(n,!0),x(s,"");try{await IU(),await C()}catch(_t){x(s,_t.message??"Deactivate failed",!0)}finally{x(n,!1)}}}function w(_t){var Te;if(!((Te=l(f))!=null&&Te.sys))return"—";const li=l(f).sys[_t];return li?String(li.val??"—"):"—"}function A(_t){if(_t==="—")return _t;const li=_t.match(/^(\d+)/),Te=li?parseInt(li[1]):NaN;if(isNaN(Te))return _t;const ye=Math.floor(Te/86400),Pt=Math.floor(Te%86400/3600),ci=Math.floor(Te%3600/60),$t=Te%60,Pi=Ni=>String(Ni).padStart(2,"0");return ye>0?`${ye}d ${Pi(Pt)}:${Pi(ci)}:${Pi($t)}`:`${Pi(Pt)}:${Pi(ci)}:${Pi($t)}`}function I(_t){if(_t==="—")return _t;const li=parseInt(_t);return isNaN(li)?_t:li<1024?`${li} B`:li<1048576?`${(li/1024).toFixed(1)} KB`:li<1073741824?`${(li/1048576).toFixed(1)} MB`:`${(li/1073741824).toFixed(1)} GB`}var T=uie(),M=ct(T),P=m(M),j=m(P);let U;var Q=v(j,2);let oe;var le=v(Q,2);let re;var ce=v(le,2);let Se;var ie=v(ce,2);let ge;var me=v(ie,2);let Be;var he=v(me,2);let De;var Re=v(he,2);let Ee;var ot=v(Re,2);let It;var Qe=v(P,2);{var mt=_t=>{var li=die(),Te=m(li);{var ye=$t=>{var Pi=Zte();D($t,Pi)},Pt=$t=>{var Pi=Xte(),Ni=m(Pi);W(()=>O(Ni,l(g))),D($t,Pi)},ci=$t=>{var Pi=cie(),Ni=ct(Pi),ki=m(Ni),nn=m(ki),sn=v(m(nn),4),pn=m(sn),wn=v(nn,2);{var ht=gi=>{var ji=Yte(),pi=m(ji);let Gi;var Z=v(pi,4);let we;var st=m(Z);{var Ye=dt=>{var ui=mo("plugin active");D(dt,ui)},Wt=dt=>{var ui=mo("connected — plugin not responding");D(dt,ui)},Jt=dt=>{var ui=mo("disconnected");D(dt,ui)};N(st,dt=>{l(f).dynsec.dynsecReady?dt(Ye):l(f).dynsec.connected?dt(Wt,1):dt(Jt,-1)})}var ut=v(Z,2),Je=m(ut);W(()=>{Gi=kt(pi,1,"dot svelte-zuhcpo",null,Gi,{ok:l(f).dynsec.dynsecReady,warn:l(f).dynsec.connected&&!l(f).dynsec.dynsecReady,"dot-err":!l(f).dynsec.connected}),we=kt(Z,1,"conn-detail svelte-zuhcpo",null,we,{ok:l(f).dynsec.dynsecReady,warn:l(f).dynsec.connected&&!l(f).dynsec.dynsecReady,err:!l(f).dynsec.connected}),ut.disabled=l(n),O(Je,l(n)?"…":"deactivate")}),z("click",ut,E),D(gi,ji)},Qt=gi=>{var ji=Jte(),pi=v(m(ji),6);{var Gi=Z=>{var we=Qte();z("click",we,()=>x(t,!0)),D(Z,we)};N(pi,Z=>{l(t)||Z(Gi)})}D(gi,ji)};N(wn,gi=>{l(f).dynsec.configured?gi(ht):gi(Qt,-1)})}var Ti=v(wn,2);{var Bi=gi=>{var ji=eie(),pi=m(ji);W(()=>O(pi,l(s))),D(gi,ji)};N(Ti,gi=>{l(s)&&gi(Bi)})}var bi=v(ki,2);{var bn=gi=>{var ji=rie(),pi=m(ji);{var Gi=Ye=>{var Wt=tie(),Jt=m(Wt);W(()=>{Wt.disabled=l(r),O(Jt,l(r)?"Running diagnostics…":"Run diagnostics")}),z("click",Wt,b),D(Ye,Wt)},Z=Ye=>{var Wt=sie(),Jt=ct(Wt);let ut;var Je=m(Jt);{var dt=Oi=>{var on=aA(),Ki=m(on);W(()=>O(Ki,`⚠ ${l(a).error??""}`)),D(Oi,on)},ui=Oi=>{var on=nie(),Ki=ct(on),de=v(m(Ki)),Ke=m(de),Ft=v(Ki,2),zt=v(m(Ft)),Le=m(zt),Ve=v(Ft,2),Vt=v(m(Ve)),Ut=m(Vt),Zt=v(Ve,2),Rt=v(m(Zt)),V=m(Rt),ae=v(Zt,2);ti(ae,17,()=>l(a).issues,Ri,(tt,Ze)=>{var wt=aA(),$=m(wt);W(()=>O($,`⚠ ${l(Ze)??""}`)),D(tt,wt)});var pe=v(ae,2);{var ve=tt=>{var Ze=iie();D(tt,Ze)};N(pe,tt=>{l(a).ok&&tt(ve)})}W(()=>{O(Ke,l(a).dynSecPath),kt(zt,1,yg(l(a).adminClientExists?"ok":"fail"),"svelte-zuhcpo"),O(Le,l(a).adminClientExists?"✓ yes":"✗ no"),kt(Vt,1,yg(l(a).hasAdminRole?"ok":"fail"),"svelte-zuhcpo"),O(Ut,l(a).hasAdminRole?"✓ yes":"✗ no"),kt(Rt,1,yg(l(a).hasControlSendAcl?"ok":"fail"),"svelte-zuhcpo"),O(V,l(a).hasControlSendAcl?"✓ present":"✗ missing")}),D(Oi,on)};N(Je,Oi=>{l(a).error?Oi(dt):Oi(ui,-1)})}var Ae=v(Jt,2),We=m(Ae);W(()=>{ut=kt(Jt,1,"diag-card svelte-zuhcpo",null,ut,{"diag-ok":l(a).ok,"diag-fail":!l(a).ok}),Ae.disabled=l(r),O(We,l(r)?"Running…":"Re-run")}),z("click",Ae,b),D(Ye,Wt)};N(pi,Ye=>{l(a)?Ye(Z,-1):Ye(Gi)})}var we=v(pi,2);{var st=Ye=>{var Wt=oie();z("click",Wt,()=>x(t,!0)),D(Ye,Wt)};N(we,Ye=>{l(t)||Ye(st)})}D(gi,ji)};N(bi,gi=>{l(f).dynsec.configured&&l(f).dynsec.connected&&!l(f).dynsec.dynsecReady&&gi(bn)})}var Cn=v(bi,2);{var kn=gi=>{var ji=aie(),pi=m(ji),Gi=v(m(pi)),Z=m(Gi),we=v(Gi,3),st=m(we),Ye=v(we,3),Wt=m(Ye),Jt=v(Ye,3),ut=m(Jt),Je=v(Jt,3),dt=m(Je),ui=v(Je,3),Ae=m(ui);W((We,Oi,on,Ki,de,Ke,Ft,zt,Le,Ve,Vt,Ut)=>{O(Z,We),O(st,Oi),O(Wt,`${on??""} connected · ${Ki??""} max · ${de??""} total`),O(ut,`${Ke??""} rcv · ${Ft??""} sent · ${zt??""} stored`),O(dt,`${Le??""} retained · ${Ve??""} subscriptions`),O(Ae,`${Vt??""} in · ${Ut??""} out`)},[()=>w("$SYS/broker/version"),()=>A(w("$SYS/broker/uptime")),()=>w("$SYS/broker/clients/connected"),()=>w("$SYS/broker/clients/maximum"),()=>w("$SYS/broker/clients/total"),()=>w("$SYS/broker/messages/received"),()=>w("$SYS/broker/messages/sent"),()=>w("$SYS/broker/messages/stored"),()=>w("$SYS/broker/retained messages/count"),()=>w("$SYS/broker/subscriptions/count"),()=>I(w("$SYS/broker/bytes/received")),()=>I(w("$SYS/broker/bytes/sent"))]),D(gi,ji)},$e=Bt(()=>Object.keys(l(f).sys).length>0);N(Cn,gi=>{l($e)&&gi(kn)})}var Yt=v(Ni,2);{var Fi=gi=>{var ji=lie(),pi=m(ji);Lte(pi,{onDone:()=>{x(t,!1),C()}}),D(gi,ji)};N(Yt,gi=>{l(t)&&(!l(f).dynsec.configured||!l(f).dynsec.dynsecReady)&&gi(Fi)})}W(()=>O(pn,l(f).sshConfigured?`ssh — ${l(f).sshHost}`:"local")),D($t,Pi)};N(Te,$t=>{l(p)?$t(ye):l(g)?$t(Pt,1):l(f)&&$t(ci,2)})}D(_t,li)},_e=_t=>{{let li=Bt(()=>{var Te;return((Te=l(f))==null?void 0:Te.dynsec.dynsecReady)??!1});pee(_t,{get dynsecReady(){return l(li)}})}},Pe=_t=>{Mee(_t,{})},rt=_t=>{Ote(_t,{})},vt=_t=>{Kte(_t,{})},it=_t=>{Bee(_t,{})},ft=_t=>{ite(_t,{})},ii=_t=>{fte(_t,{})},di=_t=>{Cte(_t,{})};N(Qe,_t=>{l(u)==="status"?_t(mt):l(u)==="users"?_t(_e,1):l(u)==="brokerconfig"?_t(Pe,2):l(u)==="advanced"?_t(rt,3):l(u)==="passwd"?_t(vt,4):l(u)==="listeners"?_t(it,5):l(u)==="certs"?_t(ft,6):l(u)==="ssh"?_t(ii,7):l(u)==="logs"&&_t(di,8)})}var ri=v(M,2);Bs(hl(ri,{}),_t=>i=_t,()=>i),W(()=>{U=kt(j,1,"svelte-zuhcpo",null,U,{active:l(u)==="status"}),oe=kt(Q,1,"svelte-zuhcpo",null,oe,{active:l(u)==="users"}),re=kt(le,1,"svelte-zuhcpo",null,re,{active:l(u)==="brokerconfig"}),Se=kt(ce,1,"svelte-zuhcpo",null,Se,{active:l(u)==="advanced"}),ge=kt(ie,1,"svelte-zuhcpo",null,ge,{active:l(u)==="passwd"}),Be=kt(me,1,"svelte-zuhcpo",null,Be,{active:l(u)==="listeners"}),De=kt(he,1,"svelte-zuhcpo",null,De,{active:l(u)==="certs"}),Ee=kt(Re,1,"svelte-zuhcpo",null,Ee,{active:l(u)==="ssh"}),It=kt(ot,1,"svelte-zuhcpo",null,It,{active:l(u)==="logs"})}),z("click",j,()=>x(u,"status")),z("click",Q,()=>x(u,"users")),z("click",le,()=>x(u,"brokerconfig")),z("click",ce,()=>x(u,"advanced")),z("click",ie,()=>x(u,"passwd")),z("click",me,()=>x(u,"listeners")),z("click",he,()=>x(u,"certs")),z("click",Re,()=>x(u,"ssh")),z("click",ot,()=>x(u,"logs")),D(o,T),eo()}uo(["click"]);var fie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),gie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),pie=F('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),xie=F('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),vie=F('<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"><circle cx="8" cy="10" r="2" class="svelte-1n46o8q"></circle><path d="M5,7 A4,4 0,0,1 11,7" class="svelte-1n46o8q"></path><path d="M3,5 A6.5,6.5 0,0,1 13,5" class="svelte-1n46o8q"></path><line x1="8" y1="12" x2="8" y2="15" class="svelte-1n46o8q"></line></svg> Broker</button>'),mie=F('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),_ie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),bie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),Cie=F('<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>'),Eie=F('<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>'),yie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),wie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),Sie=F('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),Die=F('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),Aie=F('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),kie=F('<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>'),Bie=F('<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>'),Fie=F('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),Lie=F('<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),Iie=F('<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),Pie=F('<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>'),Tie=F('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),Mie=F('<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>'),Rie=F('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),Nie=F('<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>'),Oie=F('<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="14" height="14" 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" 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></main></div>'),Hie=F('<div class="login-error svelte-1n46o8q"> </div>'),Wie=F('<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>'),zie=F('<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>'),Vie=F('<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>'),jie=F("<!> <!> <!> <!>",1);function $ie(o,e){Js(e,!0);const t=["scripts","mqtt","matter","security","db","logs","config","packages"];function i(){const vt=location.hash.slice(1);return t.includes(vt)?vt:"scripts"}let n=B(vi(i())),s=B(null),r=B(!1),a=B(!1),d=B(!1),u=B(!1),f=B("none"),g=B(""),p=B(!1),C=B(""),b=B(""),E=B(!1),w=B(!1);Z$(()=>{x(p,!0)});async function A(){x(b,""),x(E,!0);try{await Q$(l(C)),x(C,""),x(p,!1)}catch(vt){x(b,vt.message??"Login failed",!0)}finally{x(E,!1)}}async function I(){if(l(f)==="proxy"&&l(g)){window.location.href=l(g);return}await J$(),x(p,!0)}let T=B(null),M=B(!1),P=B(!1),j=B(!1),U=B(!1),Q=B(vi([])),oe=B(0),le=B(!1),re=B(vi([]));const ce=Bt(()=>l(re).filter(vt=>vt.online).length),Se=Bt(()=>l(re).length===0?"none":l(ce)===l(re).length?"all":l(ce)>0?"some":"offline");let ie=B(!1),ge=B(!1);async function me(){if(!await l(T).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;x(M,!0);let vt;try{vt=(await xf()).startedAt}catch{}try{await yF()}catch{}const it=Date.now()+6e4;for(;Date.now()<it;){await new Promise(ft=>setTimeout(ft,250));try{const ft=await xf();if(vt===void 0||ft.startedAt!==vt){location.reload();return}}catch{}}location.reload()}async function Be(){x(d,!0);try{const vt=await sU();l(s)&&x(s,{...l(s),latestVersion:vt.latestVersion??void 0},!0)}catch{}finally{x(d,!1)}}async function he(){var ft,ii;if(!await l(T).show(`Update to v${(ft=l(s))==null?void 0:ft.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;x(a,!1),x(u,!0);const vt=(ii=l(s))==null?void 0:ii.startedAt;try{await nU()}catch{}const it=Date.now()+18e4;for(;Date.now()<it;){await new Promise(di=>setTimeout(di,1e3));try{const di=await xf();if(vt===void 0||di.startedAt!==vt){location.reload();return}}catch{x(u,!1),x(M,!0)}}location.reload()}function De(vt){x(n,vt,!0),location.hash=vt}no(async()=>{location.hash||(location.hash=l(n));const vt=()=>{x(n,i(),!0)};window.addEventListener("hashchange",vt);try{const Te=await Y$();x(f,Te.mode,!0),x(g,Te.proxyLogoutUrl??"",!0),l(f)==="password"&&(await fetch("/she/scripts")).status===401&&x(p,!0)}catch{}x(w,!0);async function it(){var Te,ye,Pt;try{x(s,await xf(),!0)}catch{}try{const[ci,$t]=await Promise.all([DF(),Gl()]);x(Q,Array.isArray($t.pinnedPackages)?$t.pinnedPackages:[],!0),x(oe,Object.keys(ci).filter(Ni=>!l(Q).includes(Ni)).length,!0);const Pi=l(le);x(le,((Te=$t.broker)==null?void 0:Te.enabled)===!0),Pi&&!l(le)&&l(n)==="security"&&De("scripts")}catch{}!((ye=l(s))!=null&&ye.matterEnabled)&&l(n)==="matter"&&De("scripts"),!((Pt=l(s))!=null&&Pt.dbEnabled)&&l(n)==="db"&&De("scripts")}it();const ft=setInterval(it,5e3),ii=ir("mqtt:status",Te=>{Te.connected===!1?(x(U,!0),x(P,!1),x(j,!1)):(x(U,!1),x(P,Te.ready===!1),x(j,Te.ready===!0))}),di=ir("matter:deviceList",Te=>{Array.isArray(Te.devices)&&x(re,Te.devices.map(ye=>({nodeId:String(ye.nodeId),online:!!ye.online})),!0)}),ri=ir("matter:deviceStatus",Te=>{if(Te.nodeId===void 0)return;const ye=String(Te.nodeId),Pt=!!Te.online;x(re,l(re).map(ci=>ci.nodeId===ye?{...ci,online:Pt}:ci),!0)}),_t=TF();x(ie,_t.some(Te=>Te.level==="error"),!0),x(ge,!l(ie)&&_t.some(Te=>Te.level==="warn"),!0);const li=dS(Te=>{Te.level==="error"?(x(ie,!0),x(ge,!1)):Te.level==="warn"&&!l(ie)&&x(ge,!0)});return()=>{window.removeEventListener("hashchange",vt),clearInterval(ft),ii(),di(),ri(),li()}});var Re=jie();Ns("click",u6,()=>{l(r)&&x(r,!1),l(a)&&x(a,!1)});var Ee=ct(Re);{var ot=vt=>{var it=Oie(),ft=m(it),ii=v(m(ft),2);let di;var ri=v(ii,2);let _t;var li=v(m(ri),2);{var Te=q=>{var R=fie();W(()=>fn(R,"title",`${l(oe)??""} package update${l(oe)===1?"":"s"} available`)),D(q,R)};N(li,q=>{l(oe)>0&&q(Te)})}var ye=v(ri,2);let Pt;var ci=v(m(ye),2);{var $t=q=>{var R=gie();D(q,R)},Pi=q=>{var R=pie();D(q,R)},Ni=q=>{var R=xie();D(q,R)};N(ci,q=>{l(U)?q($t):l(P)?q(Pi,1):l(j)&&q(Ni,2)})}var ki=v(ye,2);{var nn=q=>{var R=vie();let G;W(()=>G=kt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="security"})),z("click",R,()=>De("security")),D(q,R)};N(ki,q=>{l(le)&&q(nn)})}var sn=v(ki,2);{var pn=q=>{var R=Cie();let G;var Y=v(m(R),2);{var te=be=>{var Ce=mie();D(be,Ce)},se=be=>{var Ce=_ie();D(be,Ce)},fe=be=>{var Ce=bie();D(be,Ce)};N(Y,be=>{l(Se)==="all"?be(te):l(Se)==="some"?be(se,1):l(Se)==="offline"&&be(fe,2)})}W(()=>G=kt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="matter"})),z("click",R,()=>De("matter")),D(q,R)};N(sn,q=>{var R;(R=l(s))!=null&&R.matterEnabled&&q(pn)})}var wn=v(sn,2);{var ht=q=>{var R=Eie();let G;W(()=>G=kt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="db"})),z("click",R,()=>De("db")),D(q,R)};N(wn,q=>{var R;(R=l(s))!=null&&R.dbEnabled&&q(ht)})}var Qt=v(wn,2);let Ti;var Bi=v(m(Qt),2);{var bi=q=>{var R=yie();D(q,R)},bn=q=>{var R=wie();D(q,R)};N(Bi,q=>{l(ie)?q(bi):l(ge)&&q(bn,1)})}var Cn=v(Qt,4),kn=v(m(Cn),2),$e=m(kn),Yt=m($e);Yt.nodeValue="v1.20.8 ";var Fi=v(Yt);{var gi=q=>{var R=Sie();D(q,R)};N(Fi,q=>{var R,G;(R=l(s))!=null&&R.latestVersion&&!((G=l(s))!=null&&G.docker)&&q(gi)})}var ji=v($e,2);{var pi=q=>{var R=Bie(),G=m(R),Y=v(m(G));Y.textContent="v1.20.8";var te=v(Y,2);{var se=ue=>{var je=Die(),St=v(ct(je)),Ie=m(St);W(()=>O(Ie,`v${l(s).latestVersion??""}`)),D(ue,je)},fe=ue=>{var je=Aie();D(ue,je)};N(te,ue=>{var je;(je=l(s))!=null&&je.latestVersion?ue(se):ue(fe,-1)})}var be=v(G,2),Ce=m(be);{var He=ue=>{var je=kie(),St=v(m(je));W(()=>O(St,` Update to v${l(s).latestVersion??""}`)),z("click",je,he),D(ue,je)};N(Ce,ue=>{var je;(je=l(s))!=null&&je.latestVersion&&ue(He)})}var Oe=v(Ce,2),et=m(Oe);let ei;var J=v(et);W(()=>{Oe.disabled=l(d),ei=kt(et,0,"svelte-1n46o8q",null,ei,{spinning:l(d)}),O(J,` ${l(d)?"Checking…":"Check for updates"}`)}),z("click",R,ue=>ue.stopPropagation()),z("click",Oe,Be),D(q,R)};N(ji,q=>{var R;l(a)&&!((R=l(s))!=null&&R.docker)&&q(pi)})}var Gi=v(kn,2),Z=m(Gi),we=v(Z,2);{var st=q=>{var R=Rie(),G=m(R);{var Y=Ce=>{var He=Pie(),Oe=m(He);{var et=Xt=>{const Di=Bt(()=>Math.floor((Date.now()-l(s).startedAt)/1e3)),Zi=Bt(()=>Math.floor(l(Di)/86400)),qi=Bt(()=>Math.floor(l(Di)%86400/3600)),Ji=Bt(()=>Math.floor(l(Di)%3600/60));var qe=Fie(),Et=v(ct(qe)),Lt=m(Et);W(()=>O(Lt,`${l(Zi)>0?l(Zi)+"d ":""}${l(qi)>0||l(Zi)>0?l(qi)+"h ":""}${l(Ji)??""}m`)),D(Xt,qe)};N(Oe,Xt=>{l(s).startedAt&&Xt(et)})}var ei=v(Oe,3),J=m(ei),ue=v(ei,3),je=m(ue),St=v(ue,3),Ie=m(St),Me=v(St,2);{var gt=Xt=>{var Di=Lie(),Zi=v(ct(Di)),qi=m(Zi),Ji=v(Zi,3),qe=m(Ji);W(()=>{O(qi,l(s).matterNodes??0),O(qe,l(s).matterEndpoints??0)}),D(Xt,Di)};N(Me,Xt=>{l(s).matterEnabled&&Xt(gt)})}var pt=v(Me,2);{var Xe=Xt=>{var Di=Iie(),Zi=v(ct(Di)),qi=m(Zi),Ji=v(Zi,3),qe=m(Ji);W(()=>{O(qi,l(s).dbDocs??"—"),O(qe,l(s).dbViews??"—")}),D(Xt,Di)};N(pt,Xt=>{l(s).dbEnabled&&Xt(Xe)})}var qt=v(pt,3),at=m(qt),nt=v(qt,3),yt=m(nt),jt=v(nt,3),Tt=m(jt),si=v(jt,3),ze=m(si),Dt=v(si,3),ni=m(Dt),Vi=v(Dt,3),Gt=m(Vi);W(()=>{O(J,l(s).scripts),O(je,l(s).topics),O(Ie,l(s).mqttMsgPerSec??"—"),O(at,l(s).handlers??"—"),O(yt,l(s).memMb!=null?l(s).memMb+" MB":"—"),O(Tt,l(s).cpuPercent!=null?l(s).cpuPercent+" %":"—"),O(ze,l(s).eluPercent!=null?l(s).eluPercent+" %":"—"),O(ni,l(s).elMeanMs!=null?l(s).elMeanMs+" ms":"—"),O(Gt,l(s).elMaxMs!=null?l(s).elMaxMs+" ms":"—")}),D(Ce,He)},te=Ce=>{var He=Tie();D(Ce,He)};N(G,Ce=>{l(s)?Ce(Y):Ce(te,-1)})}var se=v(G,2),fe=m(se);{var be=Ce=>{var He=Mie();z("click",He,()=>{x(r,!1),me()}),D(Ce,He)};N(fe,Ce=>{var He;(He=l(s))!=null&&He.docker||Ce(be)})}z("click",R,Ce=>Ce.stopPropagation()),D(q,R)};N(we,q=>{l(r)&&q(st)})}var Ye=v(Gi,2);let Wt;var Jt=v(Ye,2);{var ut=q=>{var R=Nie();z("click",R,I),D(q,R)};N(Jt,q=>{l(f)==="password"&&q(ut)})}var Je=v(ft,2),dt=m(Je);Bs(hl(dt,{}),q=>x(T,q,!0),()=>l(T));var ui=v(dt,2);let Ae;var We=m(ui);{let q=Bt(()=>l(n)==="scripts");LZ(We,{get active(){return l(q)}})}var Oi=v(ui,2);let on;var Ki=m(Oi);TJ(Ki,{});var de=v(Oi,2);let Ke;var Ft=m(de);pJ(Ft,{});var zt=v(de,2);let Le;var Ve=m(zt);PQ(Ve,{});var Vt=v(zt,2);let Ut;var Zt=m(Vt);hie(Zt,{});var Rt=v(Vt,2);let V;var ae=m(Rt);TY(ae,{});var pe=v(Rt,2);let ve;var tt=m(pe);EX(tt,{});var Ze=v(pe,2);let wt;var $=m(Ze);kX($,{}),W(()=>{di=kt(ii,1,"svelte-1n46o8q",null,di,{active:l(n)==="scripts"}),_t=kt(ri,1,"svelte-1n46o8q",null,_t,{active:l(n)==="packages"}),Pt=kt(ye,1,"svelte-1n46o8q",null,Pt,{active:l(n)==="mqtt"}),Ti=kt(Qt,1,"svelte-1n46o8q",null,Ti,{active:l(n)==="logs"}),Wt=kt(Ye,1,"nav-settings svelte-1n46o8q",null,Wt,{active:l(n)==="config"}),Ae=kt(ui,1,"page-wrap svelte-1n46o8q",null,Ae,{hidden:l(n)!=="scripts"}),on=kt(Oi,1,"page-wrap svelte-1n46o8q",null,on,{hidden:l(n)!=="packages"}),Ke=kt(de,1,"page-wrap svelte-1n46o8q",null,Ke,{hidden:l(n)!=="mqtt"}),Le=kt(zt,1,"page-wrap svelte-1n46o8q",null,Le,{hidden:l(n)!=="matter"}),Ut=kt(Vt,1,"page-wrap svelte-1n46o8q",null,Ut,{hidden:l(n)!=="security"}),V=kt(Rt,1,"page-wrap svelte-1n46o8q",null,V,{hidden:l(n)!=="db"}),ve=kt(pe,1,"page-wrap svelte-1n46o8q",null,ve,{hidden:l(n)!=="config"}),wt=kt(Ze,1,"page-wrap svelte-1n46o8q",null,wt,{hidden:l(n)!=="logs"})}),z("click",ii,()=>De("scripts")),z("click",ri,()=>De("packages")),z("click",ye,()=>De("mqtt")),z("click",Qt,()=>{De("logs"),x(ie,!1),x(ge,!1)}),z("click",$e,q=>{q.stopPropagation(),x(a,!l(a)),x(r,!1)}),z("click",Z,q=>{q.stopPropagation(),x(r,!l(r)),x(a,!1)}),z("click",Ye,()=>De("config")),D(vt,it)};N(Ee,vt=>{l(w)&&!l(p)&&vt(ot)})}var It=v(Ee,2);{var Qe=vt=>{var it=Wie(),ft=m(it),ii=v(m(ft),4),di=v(m(ii),2),ri=v(ii,2);{var _t=ye=>{var Pt=Hie(),ci=m(Pt);W(()=>O(ci,l(b))),D(ye,Pt)};N(ri,ye=>{l(b)&&ye(_t)})}var li=v(ri,2),Te=m(li);W(()=>{di.disabled=l(E),li.disabled=l(E)||!l(C),O(Te,l(E)?"Signing in…":"Sign in")}),Ns("submit",ft,ye=>{ye.preventDefault(),A()}),At(di,()=>l(C),ye=>x(C,ye)),D(vt,it)};N(It,vt=>{l(p)&&vt(Qe)})}var mt=v(It,2);{var _e=vt=>{var it=zie();D(vt,it)};N(mt,vt=>{l(M)&&vt(_e)})}var Pe=v(mt,2);{var rt=vt=>{var it=Vie();D(vt,it)};N(Pe,vt=>{l(u)&&vt(rt)})}D(o,Re),eo()}uo(["click"]);fP($ie,{target:document.getElementById("app")});export{j6 as t};
|
|
234
|
+
After saving, click <strong>Apply & Reload</strong> above to activate changes.</p></section></div> <!>`,1);function Kte(o,e){Js(e,!0);let t=B("/etc/mosquitto/passwd"),i=B(vi([])),n=B(!1),s=B(""),r=B(""),a=B(""),d=B(""),u=B(""),f=B(!1),g=B(""),p=B(null),C=B(""),b=B(""),E=B(!1),w=B(""),A=B(null),I=B("/etc/mosquitto/acl"),T=B(""),M=B(!1),P=B(""),j=B(""),U=B(!1),Q=B(!1),oe=B(""),le;no(async()=>{try{const $e=await ux(),Yt=$e.listeners.find(gi=>gi.password_file);Yt!=null&&Yt.password_file&&x(t,Yt.password_file,!0);const Fi=$e.listeners.find(gi=>gi.acl_file);Fi!=null&&Fi.acl_file&&x(I,Fi.acl_file,!0),!(Yt!=null&&Yt.password_file)&&$e.managed.password_file&&x(t,String($e.managed.password_file),!0),!(Fi!=null&&Fi.acl_file)&&$e.managed.acl_file&&x(I,String($e.managed.acl_file),!0)}catch{}await re(),await me()});async function re(){if(l(t)){x(n,!0),x(s,""),x(r,"");try{const $e=await MU(l(t));x(i,$e.users,!0)}catch($e){x(s,$e.message??"Failed to load password file",!0)}finally{x(n,!1)}}}async function ce(){if(!l(a).trim()){x(g,"Username required");return}if(!l(d)){x(g,"Password required");return}if(l(d)!==l(u)){x(g,"Passwords do not match");return}x(f,!0),x(g,""),x(r,"");try{await x2(l(t),l(a).trim(),l(d)),x(a,""),x(d,""),x(u,""),x(r,"User added."),await re()}catch($e){x(g,$e.message??"Failed to add user",!0)}finally{x(f,!1)}}async function Se($e){x(p,$e,!0),x(C,""),x(b,""),x(w,"")}async function ie(){if(!l(C)){x(w,"Password required");return}if(l(C)!==l(b)){x(w,"Passwords do not match");return}x(E,!0),x(w,""),x(r,"");try{await x2(l(t),l(p),l(C)),x(p,null),x(r,"Password updated.")}catch($e){x(w,$e.message??"Failed to change password",!0)}finally{x(E,!1)}}async function ge($e){if(await le.show(`Delete user "${$e}" from ${l(t)}?`,{confirm:"Delete",danger:!0})){x(A,$e,!0),x(s,""),x(r,"");try{await RU(l(t),$e),x(r,`User "${$e}" deleted.`),await re()}catch(Yt){x(s,Yt.message??"Delete failed",!0)}finally{x(A,null)}}}async function me(){if(l(I)){x(M,!0),x(P,""),x(j,"");try{const $e=await NU(l(I));x(T,$e.content,!0)}catch($e){x(P,$e.message??"Failed to load ACL file",!0)}finally{x(M,!1)}}}async function Be(){x(U,!0),x(P,""),x(j,"");try{await OU(l(I),l(T)),x(j,"ACL file saved.")}catch($e){x(P,$e.message??"Save failed",!0)}finally{x(U,!1)}}async function he(){x(Q,!0),x(oe,"");try{const $e=await Hb();x(oe,$e.stderr||$e.stdout||"Reloaded",!0)}catch($e){x(oe,"Error: "+($e.message??"reload failed"))}finally{x(Q,!1)}}var De=Gte(),Re=ct(De),Ee=m(Re),ot=m(Ee),It=v(m(ot),2),Qe=m(It),mt=m(Qe),_e=v(ot,2),Pe=m(_e),rt=v(m(Pe),2),vt=v(Pe,2),it=v(_e,2);{var ft=$e=>{var Yt=Hte(),Fi=m(Yt);W(()=>O(Fi,l(oe))),D($e,Yt)};N(it,$e=>{l(oe)&&$e(ft)})}var ii=v(it,2);{var di=$e=>{var Yt=XC(),Fi=m(Yt);W(()=>O(Fi,l(s))),D($e,Yt)};N(ii,$e=>{l(s)&&$e(di)})}var ri=v(ii,2);{var _t=$e=>{var Yt=oA(),Fi=m(Yt);W(()=>O(Fi,l(r))),D($e,Yt)};N(ri,$e=>{l(r)&&$e(_t)})}var li=v(ri,2);{var Te=$e=>{var Yt=rA();D($e,Yt)},ye=$e=>{var Yt=qte(),Fi=ct(Yt);{var gi=Je=>{var dt=$te(),ui=v(m(dt));ti(ui,21,()=>l(i),Ri,(Ae,We)=>{var Oi=jte(),on=m(Oi),Ki=m(on),de=v(on),Ke=m(de);{var Ft=Le=>{var Ve=zte(),Vt=m(Ve),Ut=v(Vt,2),Zt=v(Ut,2);{var Rt=ve=>{var tt=Wte(),Ze=m(tt);W(()=>O(Ze,l(w))),D(ve,tt)};N(Zt,ve=>{l(w)&&ve(Rt)})}var V=v(Zt,2),ae=m(V),pe=v(V,2);W(()=>{V.disabled=l(E),O(ae,l(E)?"…":"Save")}),At(Vt,()=>l(C),ve=>x(C,ve)),At(Ut,()=>l(b),ve=>x(b,ve)),z("click",V,ie),z("click",pe,()=>x(p,null)),D(Le,Ve)},zt=Le=>{var Ve=Vte(),Vt=ct(Ve),Ut=v(Vt,2),Zt=m(Ut);W(()=>{Ut.disabled=l(A)===l(We),O(Zt,l(A)===l(We)?"…":"Delete")}),z("click",Vt,()=>Se(l(We))),z("click",Ut,()=>ge(l(We))),D(Le,Ve)};N(Ke,Le=>{l(p)===l(We)?Le(Ft):Le(zt,-1)})}W(()=>O(Ki,l(We))),D(Ae,Oi)}),D(Je,dt)},ji=Je=>{var dt=Ute();D(Je,dt)};N(Fi,Je=>{l(i).length>0?Je(gi):l(s)||Je(ji,1)})}var pi=v(Fi,2),Gi=v(m(pi),2),Z=m(Gi),we=v(Z,2),st=v(we,2),Ye=v(st,2),Wt=m(Ye),Jt=v(Gi,2);{var ut=Je=>{var dt=XC(),ui=m(dt);W(()=>O(ui,l(g))),D(Je,dt)};N(Jt,Je=>{l(g)&&Je(ut)})}W(()=>{Ye.disabled=l(f),O(Wt,l(f)?"Adding…":"Add")}),At(Z,()=>l(a),Je=>x(a,Je)),At(we,()=>l(d),Je=>x(d,Je)),At(st,()=>l(u),Je=>x(u,Je)),z("click",Ye,ce),D($e,Yt)};N(li,$e=>{l(n)?$e(Te):$e(ye,-1)})}var Pt=v(Ee,2),ci=m(Pt),$t=v(m(ci),2),Pi=m($t),Ni=m(Pi),ki=v(ci,2),nn=m(ki),sn=v(m(nn),2),pn=v(nn,2),wn=v(ki,2);{var ht=$e=>{var Yt=XC(),Fi=m(Yt);W(()=>O(Fi,l(P))),D($e,Yt)};N(wn,$e=>{l(P)&&$e(ht)})}var Qt=v(wn,2);{var Ti=$e=>{var Yt=oA(),Fi=m(Yt);W(()=>O(Fi,l(j))),D($e,Yt)};N(Qt,$e=>{l(j)&&$e(Ti)})}var Bi=v(Qt,2),bi=m(Bi);{var bn=$e=>{var Yt=rA();D($e,Yt)},Cn=$e=>{Mg($e,{language:"plaintext",onSave:Be,get value(){return l(T)},set value(Yt){x(T,Yt,!0)}})};N(bi,$e=>{l(M)?$e(bn):$e(Cn,-1)})}var kn=v(Re,2);Bs(hl(kn,{}),$e=>le=$e,()=>le),W(()=>{Qe.disabled=l(Q),O(mt,l(Q)?"Reloading…":"Apply & Reload"),vt.disabled=l(n),Pi.disabled=l(U),O(Ni,l(U)?"Saving…":"Save"),pn.disabled=l(M)}),z("click",Qe,he),z("change",rt,re),At(rt,()=>l(t),$e=>x(t,$e)),z("click",vt,re),z("click",Pi,Be),z("change",sn,me),At(sn,()=>l(I),$e=>x(I,$e)),z("click",pn,me),D(o,De),eo()}uo(["click","change"]);var Zte=F('<div class="loading svelte-zuhcpo">Loading…</div>'),Xte=F('<div class="error-banner svelte-zuhcpo"> </div>'),Yte=F('<div class="conn-row svelte-zuhcpo"><span></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span><!></span> <button class="btn-deactivate svelte-zuhcpo"> </button></div>'),Qte=F('<button class="btn-wizard-inline svelte-zuhcpo">Setup Wizard ↗</button>'),Jte=F('<div class="conn-row svelte-zuhcpo"><span class="dot dot-off svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">dynamic security</span> <span class="conn-detail muted svelte-zuhcpo">not configured</span> <!></div>'),eie=F('<div class="error-inline svelte-zuhcpo"> </div>'),tie=F('<button class="diag-btn svelte-zuhcpo"> </button>'),aA=F('<p class="diag-issue svelte-zuhcpo"> </p>'),iie=F('<p class="diag-ok-msg svelte-zuhcpo">✓ dynamic-security.json looks correct. Verify mosquitto restarted with the plugin loaded.</p>'),nie=F('<p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">File</span><code class="svelte-zuhcpo"> </code></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Admin user exists</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">Has admin role</span><span> </span></p> <p class="diag-row svelte-zuhcpo"><span class="svelte-zuhcpo">$CONTROL publish ACL</span><span> </span></p> <!> <!>',1),sie=F('<div><!></div> <button class="diag-btn svelte-zuhcpo" style="margin-top:6px"> </button>',1),oie=F('<button class="wizard-btn svelte-zuhcpo">Run Setup Wizard</button>'),rie=F('<div class="diag-area svelte-zuhcpo"><!> <!></div>'),aie=F('<div class="stats-block svelte-zuhcpo"><dl class="svelte-zuhcpo"><dt class="svelte-zuhcpo">Version</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Uptime</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Clients</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Messages</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Topics</dt><dd class="svelte-zuhcpo"> </dd> <dt class="svelte-zuhcpo">Traffic</dt><dd class="svelte-zuhcpo"> </dd></dl></div>'),lie=F('<div style="margin-top: 20px;"><!></div>'),cie=F('<div class="status-layout svelte-zuhcpo"><div class="conn-block svelte-zuhcpo"><div class="conn-row svelte-zuhcpo"><span class="dot ok svelte-zuhcpo"></span> <span class="conn-name svelte-zuhcpo">mosquitto</span> <span class="conn-detail svelte-zuhcpo"> </span></div> <!> <!></div> <!> <!></div> <!>',1),die=F('<div class="tab-content svelte-zuhcpo"><!></div>'),uie=F('<div class="broker-page svelte-zuhcpo"><div class="sub-nav svelte-zuhcpo"><button>Status</button> <button>Directory</button> <button>Config</button> <button>Advanced</button> <button>Auth Files</button> <button>Listeners</button> <button>Certificates</button> <button>Connection</button> <button>Logs</button></div> <!></div> <!>',1);function hie(o,e){Js(e,!0);let t=B(!1),i,n=B(!1),s=B(""),r=B(!1),a=B(null);const d="she-broker-tab";let u=B(vi(localStorage.getItem(d)??"status"));vs(()=>{localStorage.setItem(d,l(u))});let f=B(null),g=B(""),p=B(!0);async function C(){try{x(f,await Ob(),!0),x(g,"")}catch(_t){x(g,_t.message??"Failed to load broker status",!0)}finally{x(p,!1)}}no(()=>{C();const _t=setInterval(C,1e4);return()=>clearInterval(_t)});async function b(){x(r,!0),x(a,null);try{x(a,await TU(),!0)}catch(_t){x(a,{ok:!1,dynSecPath:"",issues:[_t.message??"Diagnose request failed"]},!0)}finally{x(r,!1)}}async function E(){if(await i.show("Remove dynsec plugin lines from mosquitto.conf and clear credentials? You will need to restart mosquitto afterwards.",{confirm:"Deactivate",danger:!0})){x(n,!0),x(s,"");try{await IU(),await C()}catch(_t){x(s,_t.message??"Deactivate failed",!0)}finally{x(n,!1)}}}function w(_t){var Te;if(!((Te=l(f))!=null&&Te.sys))return"—";const li=l(f).sys[_t];return li?String(li.val??"—"):"—"}function A(_t){if(_t==="—")return _t;const li=_t.match(/^(\d+)/),Te=li?parseInt(li[1]):NaN;if(isNaN(Te))return _t;const ye=Math.floor(Te/86400),Pt=Math.floor(Te%86400/3600),ci=Math.floor(Te%3600/60),$t=Te%60,Pi=Ni=>String(Ni).padStart(2,"0");return ye>0?`${ye}d ${Pi(Pt)}:${Pi(ci)}:${Pi($t)}`:`${Pi(Pt)}:${Pi(ci)}:${Pi($t)}`}function I(_t){if(_t==="—")return _t;const li=parseInt(_t);return isNaN(li)?_t:li<1024?`${li} B`:li<1048576?`${(li/1024).toFixed(1)} KB`:li<1073741824?`${(li/1048576).toFixed(1)} MB`:`${(li/1073741824).toFixed(1)} GB`}var T=uie(),M=ct(T),P=m(M),j=m(P);let U;var Q=v(j,2);let oe;var le=v(Q,2);let re;var ce=v(le,2);let Se;var ie=v(ce,2);let ge;var me=v(ie,2);let Be;var he=v(me,2);let De;var Re=v(he,2);let Ee;var ot=v(Re,2);let It;var Qe=v(P,2);{var mt=_t=>{var li=die(),Te=m(li);{var ye=$t=>{var Pi=Zte();D($t,Pi)},Pt=$t=>{var Pi=Xte(),Ni=m(Pi);W(()=>O(Ni,l(g))),D($t,Pi)},ci=$t=>{var Pi=cie(),Ni=ct(Pi),ki=m(Ni),nn=m(ki),sn=v(m(nn),4),pn=m(sn),wn=v(nn,2);{var ht=gi=>{var ji=Yte(),pi=m(ji);let Gi;var Z=v(pi,4);let we;var st=m(Z);{var Ye=dt=>{var ui=mo("plugin active");D(dt,ui)},Wt=dt=>{var ui=mo("connected — plugin not responding");D(dt,ui)},Jt=dt=>{var ui=mo("disconnected");D(dt,ui)};N(st,dt=>{l(f).dynsec.dynsecReady?dt(Ye):l(f).dynsec.connected?dt(Wt,1):dt(Jt,-1)})}var ut=v(Z,2),Je=m(ut);W(()=>{Gi=kt(pi,1,"dot svelte-zuhcpo",null,Gi,{ok:l(f).dynsec.dynsecReady,warn:l(f).dynsec.connected&&!l(f).dynsec.dynsecReady,"dot-err":!l(f).dynsec.connected}),we=kt(Z,1,"conn-detail svelte-zuhcpo",null,we,{ok:l(f).dynsec.dynsecReady,warn:l(f).dynsec.connected&&!l(f).dynsec.dynsecReady,err:!l(f).dynsec.connected}),ut.disabled=l(n),O(Je,l(n)?"…":"deactivate")}),z("click",ut,E),D(gi,ji)},Qt=gi=>{var ji=Jte(),pi=v(m(ji),6);{var Gi=Z=>{var we=Qte();z("click",we,()=>x(t,!0)),D(Z,we)};N(pi,Z=>{l(t)||Z(Gi)})}D(gi,ji)};N(wn,gi=>{l(f).dynsec.configured?gi(ht):gi(Qt,-1)})}var Ti=v(wn,2);{var Bi=gi=>{var ji=eie(),pi=m(ji);W(()=>O(pi,l(s))),D(gi,ji)};N(Ti,gi=>{l(s)&&gi(Bi)})}var bi=v(ki,2);{var bn=gi=>{var ji=rie(),pi=m(ji);{var Gi=Ye=>{var Wt=tie(),Jt=m(Wt);W(()=>{Wt.disabled=l(r),O(Jt,l(r)?"Running diagnostics…":"Run diagnostics")}),z("click",Wt,b),D(Ye,Wt)},Z=Ye=>{var Wt=sie(),Jt=ct(Wt);let ut;var Je=m(Jt);{var dt=Oi=>{var on=aA(),Ki=m(on);W(()=>O(Ki,`⚠ ${l(a).error??""}`)),D(Oi,on)},ui=Oi=>{var on=nie(),Ki=ct(on),de=v(m(Ki)),Ke=m(de),Ft=v(Ki,2),zt=v(m(Ft)),Le=m(zt),Ve=v(Ft,2),Vt=v(m(Ve)),Ut=m(Vt),Zt=v(Ve,2),Rt=v(m(Zt)),V=m(Rt),ae=v(Zt,2);ti(ae,17,()=>l(a).issues,Ri,(tt,Ze)=>{var wt=aA(),$=m(wt);W(()=>O($,`⚠ ${l(Ze)??""}`)),D(tt,wt)});var pe=v(ae,2);{var ve=tt=>{var Ze=iie();D(tt,Ze)};N(pe,tt=>{l(a).ok&&tt(ve)})}W(()=>{O(Ke,l(a).dynSecPath),kt(zt,1,yg(l(a).adminClientExists?"ok":"fail"),"svelte-zuhcpo"),O(Le,l(a).adminClientExists?"✓ yes":"✗ no"),kt(Vt,1,yg(l(a).hasAdminRole?"ok":"fail"),"svelte-zuhcpo"),O(Ut,l(a).hasAdminRole?"✓ yes":"✗ no"),kt(Rt,1,yg(l(a).hasControlSendAcl?"ok":"fail"),"svelte-zuhcpo"),O(V,l(a).hasControlSendAcl?"✓ present":"✗ missing")}),D(Oi,on)};N(Je,Oi=>{l(a).error?Oi(dt):Oi(ui,-1)})}var Ae=v(Jt,2),We=m(Ae);W(()=>{ut=kt(Jt,1,"diag-card svelte-zuhcpo",null,ut,{"diag-ok":l(a).ok,"diag-fail":!l(a).ok}),Ae.disabled=l(r),O(We,l(r)?"Running…":"Re-run")}),z("click",Ae,b),D(Ye,Wt)};N(pi,Ye=>{l(a)?Ye(Z,-1):Ye(Gi)})}var we=v(pi,2);{var st=Ye=>{var Wt=oie();z("click",Wt,()=>x(t,!0)),D(Ye,Wt)};N(we,Ye=>{l(t)||Ye(st)})}D(gi,ji)};N(bi,gi=>{l(f).dynsec.configured&&l(f).dynsec.connected&&!l(f).dynsec.dynsecReady&&gi(bn)})}var Cn=v(bi,2);{var kn=gi=>{var ji=aie(),pi=m(ji),Gi=v(m(pi)),Z=m(Gi),we=v(Gi,3),st=m(we),Ye=v(we,3),Wt=m(Ye),Jt=v(Ye,3),ut=m(Jt),Je=v(Jt,3),dt=m(Je),ui=v(Je,3),Ae=m(ui);W((We,Oi,on,Ki,de,Ke,Ft,zt,Le,Ve,Vt,Ut)=>{O(Z,We),O(st,Oi),O(Wt,`${on??""} connected · ${Ki??""} max · ${de??""} total`),O(ut,`${Ke??""} rcv · ${Ft??""} sent · ${zt??""} stored`),O(dt,`${Le??""} retained · ${Ve??""} subscriptions`),O(Ae,`${Vt??""} in · ${Ut??""} out`)},[()=>w("$SYS/broker/version"),()=>A(w("$SYS/broker/uptime")),()=>w("$SYS/broker/clients/connected"),()=>w("$SYS/broker/clients/maximum"),()=>w("$SYS/broker/clients/total"),()=>w("$SYS/broker/messages/received"),()=>w("$SYS/broker/messages/sent"),()=>w("$SYS/broker/messages/stored"),()=>w("$SYS/broker/retained messages/count"),()=>w("$SYS/broker/subscriptions/count"),()=>I(w("$SYS/broker/bytes/received")),()=>I(w("$SYS/broker/bytes/sent"))]),D(gi,ji)},$e=Bt(()=>Object.keys(l(f).sys).length>0);N(Cn,gi=>{l($e)&&gi(kn)})}var Yt=v(Ni,2);{var Fi=gi=>{var ji=lie(),pi=m(ji);Lte(pi,{onDone:()=>{x(t,!1),C()}}),D(gi,ji)};N(Yt,gi=>{l(t)&&(!l(f).dynsec.configured||!l(f).dynsec.dynsecReady)&&gi(Fi)})}W(()=>O(pn,l(f).sshConfigured?`ssh — ${l(f).sshHost}`:"local")),D($t,Pi)};N(Te,$t=>{l(p)?$t(ye):l(g)?$t(Pt,1):l(f)&&$t(ci,2)})}D(_t,li)},_e=_t=>{{let li=Bt(()=>{var Te;return((Te=l(f))==null?void 0:Te.dynsec.dynsecReady)??!1});pee(_t,{get dynsecReady(){return l(li)}})}},Pe=_t=>{Mee(_t,{})},rt=_t=>{Ote(_t,{})},vt=_t=>{Kte(_t,{})},it=_t=>{Bee(_t,{})},ft=_t=>{ite(_t,{})},ii=_t=>{fte(_t,{})},di=_t=>{Cte(_t,{})};N(Qe,_t=>{l(u)==="status"?_t(mt):l(u)==="users"?_t(_e,1):l(u)==="brokerconfig"?_t(Pe,2):l(u)==="advanced"?_t(rt,3):l(u)==="passwd"?_t(vt,4):l(u)==="listeners"?_t(it,5):l(u)==="certs"?_t(ft,6):l(u)==="ssh"?_t(ii,7):l(u)==="logs"&&_t(di,8)})}var ri=v(M,2);Bs(hl(ri,{}),_t=>i=_t,()=>i),W(()=>{U=kt(j,1,"svelte-zuhcpo",null,U,{active:l(u)==="status"}),oe=kt(Q,1,"svelte-zuhcpo",null,oe,{active:l(u)==="users"}),re=kt(le,1,"svelte-zuhcpo",null,re,{active:l(u)==="brokerconfig"}),Se=kt(ce,1,"svelte-zuhcpo",null,Se,{active:l(u)==="advanced"}),ge=kt(ie,1,"svelte-zuhcpo",null,ge,{active:l(u)==="passwd"}),Be=kt(me,1,"svelte-zuhcpo",null,Be,{active:l(u)==="listeners"}),De=kt(he,1,"svelte-zuhcpo",null,De,{active:l(u)==="certs"}),Ee=kt(Re,1,"svelte-zuhcpo",null,Ee,{active:l(u)==="ssh"}),It=kt(ot,1,"svelte-zuhcpo",null,It,{active:l(u)==="logs"})}),z("click",j,()=>x(u,"status")),z("click",Q,()=>x(u,"users")),z("click",le,()=>x(u,"brokerconfig")),z("click",ce,()=>x(u,"advanced")),z("click",ie,()=>x(u,"passwd")),z("click",me,()=>x(u,"listeners")),z("click",he,()=>x(u,"certs")),z("click",Re,()=>x(u,"ssh")),z("click",ot,()=>x(u,"logs")),D(o,T),eo()}uo(["click"]);var fie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),gie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),pie=F('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),xie=F('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),vie=F('<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"><circle cx="8" cy="10" r="2" class="svelte-1n46o8q"></circle><path d="M5,7 A4,4 0,0,1 11,7" class="svelte-1n46o8q"></path><path d="M3,5 A6.5,6.5 0,0,1 13,5" class="svelte-1n46o8q"></path><line x1="8" y1="12" x2="8" y2="15" class="svelte-1n46o8q"></line></svg> Broker</button>'),mie=F('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),_ie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),bie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),Cie=F('<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>'),Eie=F('<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>'),yie=F('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),wie=F('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),Sie=F('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),Die=F('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),Aie=F('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),kie=F('<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>'),Bie=F('<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>'),Fie=F('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),Lie=F('<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),Iie=F('<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),Pie=F('<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>'),Tie=F('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),Mie=F('<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>'),Rie=F('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),Nie=F('<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>'),Oie=F('<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="14" height="14" 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" 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></main></div>'),Hie=F('<div class="login-error svelte-1n46o8q"> </div>'),Wie=F('<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>'),zie=F('<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>'),Vie=F('<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>'),jie=F("<!> <!> <!> <!>",1);function $ie(o,e){Js(e,!0);const t=["scripts","mqtt","matter","security","db","logs","config","packages"];function i(){const vt=location.hash.slice(1);return t.includes(vt)?vt:"scripts"}let n=B(vi(i())),s=B(null),r=B(!1),a=B(!1),d=B(!1),u=B(!1),f=B("none"),g=B(""),p=B(!1),C=B(""),b=B(""),E=B(!1),w=B(!1);Z$(()=>{x(p,!0)});async function A(){x(b,""),x(E,!0);try{await Q$(l(C)),x(C,""),x(p,!1)}catch(vt){x(b,vt.message??"Login failed",!0)}finally{x(E,!1)}}async function I(){if(l(f)==="proxy"&&l(g)){window.location.href=l(g);return}await J$(),x(p,!0)}let T=B(null),M=B(!1),P=B(!1),j=B(!1),U=B(!1),Q=B(vi([])),oe=B(0),le=B(!1),re=B(vi([]));const ce=Bt(()=>l(re).filter(vt=>vt.online).length),Se=Bt(()=>l(re).length===0?"none":l(ce)===l(re).length?"all":l(ce)>0?"some":"offline");let ie=B(!1),ge=B(!1);async function me(){if(!await l(T).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;x(M,!0);let vt;try{vt=(await xf()).startedAt}catch{}try{await yF()}catch{}const it=Date.now()+6e4;for(;Date.now()<it;){await new Promise(ft=>setTimeout(ft,250));try{const ft=await xf();if(vt===void 0||ft.startedAt!==vt){location.reload();return}}catch{}}location.reload()}async function Be(){x(d,!0);try{const vt=await sU();l(s)&&x(s,{...l(s),latestVersion:vt.latestVersion??void 0},!0)}catch{}finally{x(d,!1)}}async function he(){var ft,ii;if(!await l(T).show(`Update to v${(ft=l(s))==null?void 0:ft.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;x(a,!1),x(u,!0);const vt=(ii=l(s))==null?void 0:ii.startedAt;try{await nU()}catch{}const it=Date.now()+18e4;for(;Date.now()<it;){await new Promise(di=>setTimeout(di,1e3));try{const di=await xf();if(vt===void 0||di.startedAt!==vt){location.reload();return}}catch{x(u,!1),x(M,!0)}}location.reload()}function De(vt){x(n,vt,!0),location.hash=vt}no(async()=>{location.hash||(location.hash=l(n));const vt=()=>{x(n,i(),!0)};window.addEventListener("hashchange",vt);try{const Te=await Y$();x(f,Te.mode,!0),x(g,Te.proxyLogoutUrl??"",!0),l(f)==="password"&&(await fetch("/she/scripts")).status===401&&x(p,!0)}catch{}x(w,!0);async function it(){var Te,ye,Pt;try{x(s,await xf(),!0)}catch{}try{const[ci,$t]=await Promise.all([DF(),Gl()]);x(Q,Array.isArray($t.pinnedPackages)?$t.pinnedPackages:[],!0),x(oe,Object.keys(ci).filter(Ni=>!l(Q).includes(Ni)).length,!0);const Pi=l(le);x(le,((Te=$t.broker)==null?void 0:Te.enabled)===!0),Pi&&!l(le)&&l(n)==="security"&&De("scripts")}catch{}!((ye=l(s))!=null&&ye.matterEnabled)&&l(n)==="matter"&&De("scripts"),!((Pt=l(s))!=null&&Pt.dbEnabled)&&l(n)==="db"&&De("scripts")}it();const ft=setInterval(it,5e3),ii=ir("mqtt:status",Te=>{Te.connected===!1?(x(U,!0),x(P,!1),x(j,!1)):(x(U,!1),x(P,Te.ready===!1),x(j,Te.ready===!0))}),di=ir("matter:deviceList",Te=>{Array.isArray(Te.devices)&&x(re,Te.devices.map(ye=>({nodeId:String(ye.nodeId),online:!!ye.online})),!0)}),ri=ir("matter:deviceStatus",Te=>{if(Te.nodeId===void 0)return;const ye=String(Te.nodeId),Pt=!!Te.online;x(re,l(re).map(ci=>ci.nodeId===ye?{...ci,online:Pt}:ci),!0)}),_t=TF();x(ie,_t.some(Te=>Te.level==="error"),!0),x(ge,!l(ie)&&_t.some(Te=>Te.level==="warn"),!0);const li=dS(Te=>{Te.level==="error"?(x(ie,!0),x(ge,!1)):Te.level==="warn"&&!l(ie)&&x(ge,!0)});return()=>{window.removeEventListener("hashchange",vt),clearInterval(ft),ii(),di(),ri(),li()}});var Re=jie();Ns("click",u6,()=>{l(r)&&x(r,!1),l(a)&&x(a,!1)});var Ee=ct(Re);{var ot=vt=>{var it=Oie(),ft=m(it),ii=v(m(ft),2);let di;var ri=v(ii,2);let _t;var li=v(m(ri),2);{var Te=q=>{var R=fie();W(()=>fn(R,"title",`${l(oe)??""} package update${l(oe)===1?"":"s"} available`)),D(q,R)};N(li,q=>{l(oe)>0&&q(Te)})}var ye=v(ri,2);let Pt;var ci=v(m(ye),2);{var $t=q=>{var R=gie();D(q,R)},Pi=q=>{var R=pie();D(q,R)},Ni=q=>{var R=xie();D(q,R)};N(ci,q=>{l(U)?q($t):l(P)?q(Pi,1):l(j)&&q(Ni,2)})}var ki=v(ye,2);{var nn=q=>{var R=vie();let G;W(()=>G=kt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="security"})),z("click",R,()=>De("security")),D(q,R)};N(ki,q=>{l(le)&&q(nn)})}var sn=v(ki,2);{var pn=q=>{var R=Cie();let G;var Y=v(m(R),2);{var te=be=>{var Ce=mie();D(be,Ce)},se=be=>{var Ce=_ie();D(be,Ce)},fe=be=>{var Ce=bie();D(be,Ce)};N(Y,be=>{l(Se)==="all"?be(te):l(Se)==="some"?be(se,1):l(Se)==="offline"&&be(fe,2)})}W(()=>G=kt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="matter"})),z("click",R,()=>De("matter")),D(q,R)};N(sn,q=>{var R;(R=l(s))!=null&&R.matterEnabled&&q(pn)})}var wn=v(sn,2);{var ht=q=>{var R=Eie();let G;W(()=>G=kt(R,1,"svelte-1n46o8q",null,G,{active:l(n)==="db"})),z("click",R,()=>De("db")),D(q,R)};N(wn,q=>{var R;(R=l(s))!=null&&R.dbEnabled&&q(ht)})}var Qt=v(wn,2);let Ti;var Bi=v(m(Qt),2);{var bi=q=>{var R=yie();D(q,R)},bn=q=>{var R=wie();D(q,R)};N(Bi,q=>{l(ie)?q(bi):l(ge)&&q(bn,1)})}var Cn=v(Qt,4),kn=v(m(Cn),2),$e=m(kn),Yt=m($e);Yt.nodeValue="v1.20.9 ";var Fi=v(Yt);{var gi=q=>{var R=Sie();D(q,R)};N(Fi,q=>{var R,G;(R=l(s))!=null&&R.latestVersion&&!((G=l(s))!=null&&G.docker)&&q(gi)})}var ji=v($e,2);{var pi=q=>{var R=Bie(),G=m(R),Y=v(m(G));Y.textContent="v1.20.9";var te=v(Y,2);{var se=ue=>{var je=Die(),St=v(ct(je)),Ie=m(St);W(()=>O(Ie,`v${l(s).latestVersion??""}`)),D(ue,je)},fe=ue=>{var je=Aie();D(ue,je)};N(te,ue=>{var je;(je=l(s))!=null&&je.latestVersion?ue(se):ue(fe,-1)})}var be=v(G,2),Ce=m(be);{var He=ue=>{var je=kie(),St=v(m(je));W(()=>O(St,` Update to v${l(s).latestVersion??""}`)),z("click",je,he),D(ue,je)};N(Ce,ue=>{var je;(je=l(s))!=null&&je.latestVersion&&ue(He)})}var Oe=v(Ce,2),et=m(Oe);let ei;var J=v(et);W(()=>{Oe.disabled=l(d),ei=kt(et,0,"svelte-1n46o8q",null,ei,{spinning:l(d)}),O(J,` ${l(d)?"Checking…":"Check for updates"}`)}),z("click",R,ue=>ue.stopPropagation()),z("click",Oe,Be),D(q,R)};N(ji,q=>{var R;l(a)&&!((R=l(s))!=null&&R.docker)&&q(pi)})}var Gi=v(kn,2),Z=m(Gi),we=v(Z,2);{var st=q=>{var R=Rie(),G=m(R);{var Y=Ce=>{var He=Pie(),Oe=m(He);{var et=Xt=>{const Di=Bt(()=>Math.floor((Date.now()-l(s).startedAt)/1e3)),Zi=Bt(()=>Math.floor(l(Di)/86400)),qi=Bt(()=>Math.floor(l(Di)%86400/3600)),Ji=Bt(()=>Math.floor(l(Di)%3600/60));var qe=Fie(),Et=v(ct(qe)),Lt=m(Et);W(()=>O(Lt,`${l(Zi)>0?l(Zi)+"d ":""}${l(qi)>0||l(Zi)>0?l(qi)+"h ":""}${l(Ji)??""}m`)),D(Xt,qe)};N(Oe,Xt=>{l(s).startedAt&&Xt(et)})}var ei=v(Oe,3),J=m(ei),ue=v(ei,3),je=m(ue),St=v(ue,3),Ie=m(St),Me=v(St,2);{var gt=Xt=>{var Di=Lie(),Zi=v(ct(Di)),qi=m(Zi),Ji=v(Zi,3),qe=m(Ji);W(()=>{O(qi,l(s).matterNodes??0),O(qe,l(s).matterEndpoints??0)}),D(Xt,Di)};N(Me,Xt=>{l(s).matterEnabled&&Xt(gt)})}var pt=v(Me,2);{var Xe=Xt=>{var Di=Iie(),Zi=v(ct(Di)),qi=m(Zi),Ji=v(Zi,3),qe=m(Ji);W(()=>{O(qi,l(s).dbDocs??"—"),O(qe,l(s).dbViews??"—")}),D(Xt,Di)};N(pt,Xt=>{l(s).dbEnabled&&Xt(Xe)})}var qt=v(pt,3),at=m(qt),nt=v(qt,3),yt=m(nt),jt=v(nt,3),Tt=m(jt),si=v(jt,3),ze=m(si),Dt=v(si,3),ni=m(Dt),Vi=v(Dt,3),Gt=m(Vi);W(()=>{O(J,l(s).scripts),O(je,l(s).topics),O(Ie,l(s).mqttMsgPerSec??"—"),O(at,l(s).handlers??"—"),O(yt,l(s).memMb!=null?l(s).memMb+" MB":"—"),O(Tt,l(s).cpuPercent!=null?l(s).cpuPercent+" %":"—"),O(ze,l(s).eluPercent!=null?l(s).eluPercent+" %":"—"),O(ni,l(s).elMeanMs!=null?l(s).elMeanMs+" ms":"—"),O(Gt,l(s).elMaxMs!=null?l(s).elMaxMs+" ms":"—")}),D(Ce,He)},te=Ce=>{var He=Tie();D(Ce,He)};N(G,Ce=>{l(s)?Ce(Y):Ce(te,-1)})}var se=v(G,2),fe=m(se);{var be=Ce=>{var He=Mie();z("click",He,()=>{x(r,!1),me()}),D(Ce,He)};N(fe,Ce=>{var He;(He=l(s))!=null&&He.docker||Ce(be)})}z("click",R,Ce=>Ce.stopPropagation()),D(q,R)};N(we,q=>{l(r)&&q(st)})}var Ye=v(Gi,2);let Wt;var Jt=v(Ye,2);{var ut=q=>{var R=Nie();z("click",R,I),D(q,R)};N(Jt,q=>{l(f)==="password"&&q(ut)})}var Je=v(ft,2),dt=m(Je);Bs(hl(dt,{}),q=>x(T,q,!0),()=>l(T));var ui=v(dt,2);let Ae;var We=m(ui);{let q=Bt(()=>l(n)==="scripts");LZ(We,{get active(){return l(q)}})}var Oi=v(ui,2);let on;var Ki=m(Oi);TJ(Ki,{});var de=v(Oi,2);let Ke;var Ft=m(de);pJ(Ft,{});var zt=v(de,2);let Le;var Ve=m(zt);PQ(Ve,{});var Vt=v(zt,2);let Ut;var Zt=m(Vt);hie(Zt,{});var Rt=v(Vt,2);let V;var ae=m(Rt);TY(ae,{});var pe=v(Rt,2);let ve;var tt=m(pe);EX(tt,{});var Ze=v(pe,2);let wt;var $=m(Ze);kX($,{}),W(()=>{di=kt(ii,1,"svelte-1n46o8q",null,di,{active:l(n)==="scripts"}),_t=kt(ri,1,"svelte-1n46o8q",null,_t,{active:l(n)==="packages"}),Pt=kt(ye,1,"svelte-1n46o8q",null,Pt,{active:l(n)==="mqtt"}),Ti=kt(Qt,1,"svelte-1n46o8q",null,Ti,{active:l(n)==="logs"}),Wt=kt(Ye,1,"nav-settings svelte-1n46o8q",null,Wt,{active:l(n)==="config"}),Ae=kt(ui,1,"page-wrap svelte-1n46o8q",null,Ae,{hidden:l(n)!=="scripts"}),on=kt(Oi,1,"page-wrap svelte-1n46o8q",null,on,{hidden:l(n)!=="packages"}),Ke=kt(de,1,"page-wrap svelte-1n46o8q",null,Ke,{hidden:l(n)!=="mqtt"}),Le=kt(zt,1,"page-wrap svelte-1n46o8q",null,Le,{hidden:l(n)!=="matter"}),Ut=kt(Vt,1,"page-wrap svelte-1n46o8q",null,Ut,{hidden:l(n)!=="security"}),V=kt(Rt,1,"page-wrap svelte-1n46o8q",null,V,{hidden:l(n)!=="db"}),ve=kt(pe,1,"page-wrap svelte-1n46o8q",null,ve,{hidden:l(n)!=="config"}),wt=kt(Ze,1,"page-wrap svelte-1n46o8q",null,wt,{hidden:l(n)!=="logs"})}),z("click",ii,()=>De("scripts")),z("click",ri,()=>De("packages")),z("click",ye,()=>De("mqtt")),z("click",Qt,()=>{De("logs"),x(ie,!1),x(ge,!1)}),z("click",$e,q=>{q.stopPropagation(),x(a,!l(a)),x(r,!1)}),z("click",Z,q=>{q.stopPropagation(),x(r,!l(r)),x(a,!1)}),z("click",Ye,()=>De("config")),D(vt,it)};N(Ee,vt=>{l(w)&&!l(p)&&vt(ot)})}var It=v(Ee,2);{var Qe=vt=>{var it=Wie(),ft=m(it),ii=v(m(ft),4),di=v(m(ii),2),ri=v(ii,2);{var _t=ye=>{var Pt=Hie(),ci=m(Pt);W(()=>O(ci,l(b))),D(ye,Pt)};N(ri,ye=>{l(b)&&ye(_t)})}var li=v(ri,2),Te=m(li);W(()=>{di.disabled=l(E),li.disabled=l(E)||!l(C),O(Te,l(E)?"Signing in…":"Sign in")}),Ns("submit",ft,ye=>{ye.preventDefault(),A()}),At(di,()=>l(C),ye=>x(C,ye)),D(vt,it)};N(It,vt=>{l(p)&&vt(Qe)})}var mt=v(It,2);{var _e=vt=>{var it=zie();D(vt,it)};N(mt,vt=>{l(M)&&vt(_e)})}var Pe=v(mt,2);{var rt=vt=>{var it=Vie();D(vt,it)};N(Pe,vt=>{l(u)&&vt(rt)})}D(o,Re),eo()}uo(["click"]);fP($ie,{target:document.getElementById("app")});export{j6 as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as O}from"./monaco-langs-Dt8a9eeo.js";import{t as I}from"./index-
|
|
1
|
+
import{m as O}from"./monaco-langs-Dt8a9eeo.js";import{t as I}from"./index-C6zGQcmq.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
package/dist/web/index.html
CHANGED
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
}
|
|
173
173
|
})();
|
|
174
174
|
</script>
|
|
175
|
-
<script type="module" crossorigin src="/assets/index-
|
|
175
|
+
<script type="module" crossorigin src="/assets/index-C6zGQcmq.js"></script>
|
|
176
176
|
<link rel="modulepreload" crossorigin href="/assets/monaco-langs-Dt8a9eeo.js">
|
|
177
177
|
<link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
|
|
178
178
|
<link rel="stylesheet" crossorigin href="/assets/index-C3njyEHY.css">
|
package/package.json
CHANGED
package/src/matter/controller.js
CHANGED
|
@@ -722,13 +722,18 @@ function subscribeAttribute(scriptFile, nodeId, endpointId, clusterName, attrNam
|
|
|
722
722
|
if (!changeEvent) throw new Error(`Attribute "${attrName}" on cluster "${clusterName}" has no change event`);
|
|
723
723
|
|
|
724
724
|
const listenerId = _nextListenerId++;
|
|
725
|
-
const
|
|
725
|
+
const observer = (value, oldValue) => {
|
|
726
726
|
try {
|
|
727
727
|
callback(value, oldValue);
|
|
728
728
|
} catch (err) {
|
|
729
729
|
_log?.error(`matter subscriber error in ${scriptFile}:`, err.message);
|
|
730
730
|
}
|
|
731
|
-
}
|
|
731
|
+
};
|
|
732
|
+
// Observable.on() returns void — detaching needs off() with the same
|
|
733
|
+
// observer reference. (A cancel based on on()'s return value silently did
|
|
734
|
+
// nothing, leaking one listener per hot-reload.)
|
|
735
|
+
changeEvent.on(observer);
|
|
736
|
+
const cancel = () => changeEvent.off(observer);
|
|
732
737
|
|
|
733
738
|
if (!_listeners.has(scriptFile)) _listeners.set(scriptFile, new Map());
|
|
734
739
|
_listeners.get(scriptFile).set(listenerId, { cancel });
|
|
@@ -756,13 +761,18 @@ function unsubscribe(scriptFile, listenerId) {
|
|
|
756
761
|
function cleanup(scriptFile) {
|
|
757
762
|
const scriptListeners = _listeners.get(scriptFile);
|
|
758
763
|
if (!scriptListeners) return;
|
|
764
|
+
let cancelled = 0;
|
|
759
765
|
for (const { cancel } of scriptListeners.values()) {
|
|
760
766
|
try {
|
|
761
767
|
cancel();
|
|
762
|
-
|
|
763
|
-
|
|
768
|
+
cancelled++;
|
|
769
|
+
} catch (err) {
|
|
770
|
+
// Don't swallow silently — a broken cancel means a leaked listener
|
|
771
|
+
// (this hid the on()-returns-void bug above for a long time).
|
|
772
|
+
_log?.warn(`matter: failed to cancel a subscription of ${scriptFile}: ${err.message}`);
|
|
764
773
|
}
|
|
765
774
|
}
|
|
775
|
+
if (cancelled > 0) _log?.debug(`matter: cancelled ${cancelled} subscription(s) of ${scriptFile}`);
|
|
766
776
|
_listeners.delete(scriptFile);
|
|
767
777
|
}
|
|
768
778
|
|