smart-home-engine 0.24.1 → 0.24.2

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-CXWNuhmR.js","assets/monaco-langs-BW2J83t5.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-BgnpB8sV.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-CXWNuhmR.js","assets/monaco-langs-BW2J83t5.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-BfGVy5xb.js"])))=>i.map(i=>d[i]);
2
2
  var sA=Object.defineProperty;var kL=o=>{throw TypeError(o)};var oA=(o,e,t)=>e in o?sA(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var Fi=(o,e,t)=>oA(o,typeof e!="symbol"?e+"":e,t),Hy=(o,e,t)=>e.has(o)||kL("Cannot "+t);var Q=(o,e,t)=>(Hy(o,e,"read from private field"),t?t.call(o):e.get(o)),Ii=(o,e,t)=>e.has(o)?kL("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Di=(o,e,t,i)=>(Hy(o,e,"write to private field"),i?i.call(o,t):e.set(o,t),t),yn=(o,e,t)=>(Hy(o,e,"access private method"),t);import{_ as zD,m as VD,l as vt,A as Ys,C as re,I as Cn,D as Lp,a as Yn,g as jD,M as Qe,b as ei,E as Or,c as M,r as en,d as hr,e as y,f as rA,h as mn,R as Pi,S as jt,i as Ns,j as ur,k as Wi,n as vi,o as se,p as ye,K as ts,q as ut,s as ze,t as rs,u as W,v as xi,O as va,w as ss,P as St,x as Wy,y as kp,z as UD,B as Xa,F as Fr,G as Fw,H as ms,U as nn,J as Wu,L as Ct,N as il,Q as aA,T as $s,V as Hw,W as lA,X as $D,$ as ht,Y as $i,Z as Hi,a0 as Tn,a1 as ci,a2 as Lo,a3 as Tf,a4 as We,a5 as qm,a6 as cA,a7 as dA,a8 as os,a9 as hA,aa as Hr,ab as Js,ac as Lt,ad as qD,ae as wn,af as uA,ag as gA,ah as Gs,ai as mg,aj as is,ak as Nb,al as zs,am as yc,an as d0,ao as Rb,ap as gs,aq as Bu,ar as fs,as as Ab,at as Ob,au as fA,av as Ip,aw as _g,ax as ul,ay as pA,az as vg,aA as mA,aB as h0,aC as _A,aD as vA,aE as IL,aF as Xn,aG as Ya,aH as Vs,aI as fi,aJ as qa,aK as bA,aL as Sa,aM as So,aN as hs,aO as Wr,aP as u0,aQ as as,aR as Gn,aS as v_,aT as gi,aU as KD,aV as yA,aW as g0,aX as Fb,aY as f0,aZ as p0,a_ as Gc,a$ as wA,b0 as m0,b1 as SA,b2 as _0,b3 as gl,b4 as fl,b5 as zu,b6 as Mf,b7 as co,b8 as Dp,b9 as b_,ba as By,bb as ln,bc as v0,bd as Ep,be as Hb,bf as CA,bg as GD,bh as Nf,bi as Vu,bj as Rf,bk as Pp,bl as Wb,bm as zi,bn as wc,bo as Tp,bp as xA,bq as LA,br as b0,bs as kA,bt as y_,bu as jo,bv as y0,bw as ju,bx as pl,by as bg,bz as Si,bA as Uu,bB as ZD,bC as Mp,bD as IA,bE as Zc,bF as nt,bG as DL,bH as Km,bI as XD,bJ as pr,bK as Tr,bL as gn,bM as $u,bN as or,bO as qu,bP as Pn,bQ as Af,bR as hh,bS as Ww,bT as YD,bU as JD,bV as QD,bW as w0,bX as no,bY as Ji,bZ as Np,b_ as eE,b$ as Ja,c0 as Bb,c1 as DA,c2 as Jh,c3 as EL,c4 as Rp,c5 as tE,c6 as Qh,c7 as EA,c8 as Jo,c9 as zb,ca as PA,cb as Qs,cc as Br,cd as Ap,ce as Of,cf as iE,cg as Wo,ch as Op,ci as Vb,cj as TA,ck as MA,cl as NA,cm as yg,cn as Ca,co as us,cp as RA,cq as S0,cr as AA,cs as OA,ct as PL,cu as FA,cv as Fp,cw as nl,cx as Bw,cy as qd,cz as sl,cA as HA,cB as ba,cC as rr,cD as bo,cE as TL,cF as As,cG as Hp,cH as hc,cI as xa,cJ as WA,cK as zr,cL as Ff,cM as jb,cN as nE,cO as BA,cP as zA,cQ as C0,cR as VA,cS as Hf,cT as jA,cU as Fl,cV as Wf,cW as ML,cX as UA,cY as $A,cZ as Ia,c_ as qA,c$ as x0,d0 as sE,d1 as oE,d2 as rE,d3 as aE,d4 as KA,d5 as GA,d6 as lE,d7 as cE,d8 as ZA,d9 as L0,da as XA,db as YA,dc as zn,dd as JA,de as k0,df as QA,dg as eu,dh as NL,di as eO,dj as tO,dk as iO,dl as nO,dm as sO,dn as oO,dp as Ku,dq as Ub,dr as zw,ds as rO,dt as aO,du as RL,dv as Vw,dw as lO,dx as AL,dy as zy,dz as cO,dA as dE,dB as dO,dC as hE,dD as jw,dE as hO,dF as uO,dG as gO,dH as uE,dI as gE,dJ as fO,dK as w_,dL as fE,dM as $b,dN as pO,dO as mO,dP as uc,dQ as I0,dR as _O,dS as OL,dT as FL,dU as vO,dV as tu,dW as pE,dX as bO,dY as yO,dZ as wO,d_ as SO,d$ as mE,e0 as _E,e1 as vE,e2 as bE,e3 as CO,e4 as ya,e5 as HL,e6 as xO,e7 as Wp,e8 as LO,e9 as Kg,ea as yE,eb as WL,ec as Bf,ed as wE,ee as S_,ef as kO,eg as SE,eh as IO,ei as CE,ej as DO,ek as EO,el as xE,em as LE,en as ol,eo as qb,ep as PO,eq as kE,er as Co,es as Xc,et as IE,eu as TO,ev as MO,ew as DE,ex as EE,ey as NO,ez as PE,eA as TE,eB as zf,eC as RO,eD as AO,eE as OO,eF as FO,eG as Og,eH as BL,eI as HO,eJ as WO,eK as BO,eL as C_,eM as ys,eN as zO,eO as Uw,eP as uh,eQ as VO,eR as $a,eS as jO,eT as UO,eU as ME,eV as $O,eW as hf,eX as qO,eY as KO,eZ as GO,e_ as ZO,e$ as zL,f0 as VL,f1 as jL,f2 as gh,f3 as D0,f4 as NE,f5 as $w,f6 as Gm,f7 as RE,f8 as x_,f9 as XO,fa as YO,fb as JO,fc as QO,fd as E0,fe as AE,ff as e2,fg as L_,fh as OE,fi as FE,fj as t2,fk as i2,fl as n2,fm as s2,fn as o2,fo as r2,fp as a2,fq as l2,fr as HE,fs as c2,ft as k_,fu as WE,fv as d2,fw as BE,fx as h2,fy as zE,fz as VE,fA as u2,fB as UL,fC as jE,fD as $L,fE as g2,fF as Vy,fG as qL,fH as f2,fI as p2,fJ as m2,fK as da,fL as gc,fM as _2,fN as KL,fO as Zm,fP as v2,fQ as Ka,fR as Kb,fS as qw,fT as b2,fU as UE,fV as $E,fW as Os,fX as GL,fY as mm,fZ as P0,f_ as y2,f$ as w2,g0 as S2,g1 as C2,g2 as x2,g3 as L2,g4 as k2,g5 as I2,g6 as ZL,g7 as D2,g8 as E2,g9 as P2,ga as Gu,gb as uf,gc as qE,gd as T2,ge as T0,gf as Xm,gg as _m,gh as jy,gi as M2,gj as N2,gk as KE,gl as R2,gm as M0,gn as A2,go as O2,gp as GE,gq as Gb,gr as F2,gs as I_,gt as N0,gu as R0,gv as A0,gw as ZE,gx as XE,gy as YE,gz as JE,gA as QE,gB as eP,gC as tP,gD as XL,gE as iP,gF as Ph,gG as H2,gH as W2,gI as B2,gJ as z2,gK as nP,gL as V2,gM as j2,gN as YL,gO as Kw,gP as $l,gQ as U2,gR as $2,gS as q2,gT as K2,gU as G2,gV as Z2,gW as JL,gX as O0,gY as Gw,gZ as X2,g_ as Zw,g$ as Y2,h0 as J2,h1 as Q2,h2 as eF,h3 as F0,h4 as sP,h5 as QL,h6 as ek,h7 as tF,h8 as iF,h9 as nF,ha as tk,hb as Uy,hc as sF,hd as oF,he as rF,hf as $y,hg as oP,hh as rP,hi as aP,hj as lP,hk as rl,hl as cP,hm as H0,hn as ik,ho as aF,hp as dP,hq as lF,hr as cF,hs as Zb,ht as Xb,hu as fh,hv as Yb,hw as Bp,hx as dF,hy as Jb,hz as hF,hA as uF,hB as gF,hC as hP,hD as Fg,hE as fF,hF as pF,hG as mF,hH as _F,hI as zp,hJ as vF,hK as uP,hL as gP,hM as fP,hN as Xw,hO as bF,hP as yF,hQ as wF,hR as SF,hS as CF,hT as Yw,hU as xF,hV as LF,hW as kF,hX as IF,hY as DF,hZ as EF,h_ as PF,h$ as TF,i0 as pP,i1 as MF,i2 as NF,i3 as RF,i4 as nk,i5 as AF,i6 as OF,i7 as Rc,i8 as Fa,i9 as FF,ia as HF}from"./monaco-langs-BW2J83t5.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 mP=!1;var W0=Array.isArray,WF=Array.prototype.indexOf,D_=Array.prototype.includes,Qb=Array.from,BF=Object.defineProperty,mu=Object.getOwnPropertyDescriptor,zF=Object.getOwnPropertyDescriptors,VF=Object.prototype,jF=Array.prototype,_P=Object.getPrototypeOf,sk=Object.isExtensible;const ey=()=>{};function UF(o){for(var e=0;e<o.length;e++)o[e]()}function vP(){var o,e,t=new Promise((i,n)=>{o=i,e=n});return{promise:t,resolve:o,reject:e}}function ok(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 Ws=2,Zu=4,ty=8,bP=1<<24,Mr=16,Ar=32,fc=64,Jw=128,cr=512,ws=1024,Is=2048,La=4096,oo=8192,dr=16384,wg=32768,Qw=1<<25,Xu=65536,E_=1<<17,$F=1<<18,Sg=1<<19,qF=1<<20,pa=1<<25,Kd=65536,P_=1<<21,_u=1<<22,ql=1<<23,Yc=Symbol("$state"),KF=Symbol("legacy props"),GF=Symbol(""),Ym=Symbol("attributes"),eS=Symbol("class"),tS=Symbol("style"),Gg=Symbol("text"),Jm=Symbol("form reset"),iy=new class extends Error{constructor(){super(...arguments);Fi(this,"name","StaleReactionError");Fi(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function yP(o){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function ZF(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function XF(o,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function YF(o){throw new Error("https://svelte.dev/e/effect_in_teardown")}function JF(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function QF(o){throw new Error("https://svelte.dev/e/effect_orphan")}function eH(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function tH(o){throw new Error("https://svelte.dev/e/props_invalid_value")}function iH(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function nH(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function sH(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function oH(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const rH=1,aH=2,wP=4,lH=8,cH=16,dH=1,hH=4,uH=8,gH=16,fH=1,pH=2,bs=Symbol("uninitialized"),SP="http://www.w3.org/1999/xhtml",mH="http://www.w3.org/2000/svg",_H="http://www.w3.org/1998/Math/MathML";function vH(){console.warn("https://svelte.dev/e/derived_inert")}function bH(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function yH(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function CP(o){return o===this.v}function wH(o,e){return o!=o?e==e:o!==e||o!==null&&typeof o=="object"||typeof o=="function"}function xP(o){return!wH(o,this.v)}let SH=!1,Hs=null;function Yu(o){Hs=o}function Io(o,e=!1,t){Hs={p:Hs,i:!1,c:null,e:null,s:o,x:null,r:Qi,l:null}}function Do(o){var e=Hs,t=e.e;if(t!==null){e.e=null;for(var i of t)KP(i)}return o!==void 0&&(e.x=o),e.i=!0,Hs=e.p,o??{}}function LP(){return!0}let Wc=[];function kP(){var o=Wc;Wc=[],UF(o)}function Kl(o){if(Wc.length===0&&!ff){var e=Wc;queueMicrotask(()=>{e===Wc&&kP()})}Wc.push(o)}function CH(){for(;Wc.length>0;)kP()}function IP(o){var e=Qi;if(e===null)return Yi.f|=ql,o;if((e.f&wg)===0&&(e.f&Zu)===0)throw o;Hl(o,e)}function Hl(o,e){for(;e!==null;){if((e.f&Jw)!==0){if((e.f&wg)===0)throw o;try{e.b.error(o);return}catch(t){o=t}}e=e.parent}throw o}const xH=-7169;function cs(o,e){o.f=o.f&xH|e}function B0(o){(o.f&cr)!==0||o.deps===null?cs(o,ws):cs(o,La)}function DP(o){if(o!==null)for(const e of o)(e.f&Ws)===0||(e.f&Kd)===0||(e.f^=Kd,DP(e.deps))}function EP(o,e,t){(o.f&Is)!==0?e.add(o):(o.f&La)!==0&&t.add(o),DP(o.deps),cs(o,ws)}let vm=!1;function LH(o){var e=vm;try{return vm=!1,[o(),vm]}finally{vm=e}}let qy=null,Th=null,di=null,gf=null,Rs=null,iS=null,ff=!1,Ky=!1,iu=null,Qm=null;var rk=0;let kH=1;var wu,Rl,jc,Su,Cu,xu,za,Lu,mo,bp,Va,Sr,ra,ku,Uc,Vn,nS,Zg,sS,PP,TP,qh,IH,Xg;const Bv=class Bv{constructor(){Ii(this,Vn);Fi(this,"id",kH++);Ii(this,wu,!1);Fi(this,"linked",!0);Ii(this,Rl,null);Ii(this,jc,null);Fi(this,"async_deriveds",new Map);Fi(this,"current",new Map);Fi(this,"previous",new Map);Ii(this,Su,new Set);Ii(this,Cu,new Set);Ii(this,xu,0);Ii(this,za,new Map);Ii(this,Lu,null);Ii(this,mo,[]);Ii(this,bp,[]);Ii(this,Va,new Set);Ii(this,Sr,new Set);Ii(this,ra,new Map);Ii(this,ku,new Set);Fi(this,"is_fork",!1);Ii(this,Uc,!1);Th===null?qy=Th=this:(Di(Th,jc,this),Di(this,Rl,Th)),Th=this}skip_effect(e){Q(this,ra).has(e)||Q(this,ra).set(e,{d:[],m:[]}),Q(this,ku).delete(e)}unskip_effect(e,t=i=>this.schedule(i)){var i=Q(this,ra).get(e);if(i){Q(this,ra).delete(e);for(var n of i.d)cs(n,Is),t(n);for(n of i.m)cs(n,La),t(n)}Q(this,ku).add(e)}capture(e,t,i=!1){e.v!==bs&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&ql)===0&&(this.current.set(e,[t,i]),Rs==null||Rs.set(e,t)),this.is_fork||(e.v=t)}activate(){di=this}deactivate(){di=null,Rs=null}flush(){try{Ky=!0,di=this,yn(this,Vn,Zg).call(this)}finally{rk=0,iS=null,iu=null,Qm=null,Ky=!1,di=null,Rs=null,Jc.clear()}}discard(){var e;for(const t of Q(this,Cu))t(this);Q(this,Cu).clear(),yn(this,Vn,Xg).call(this),(e=Q(this,Lu))==null||e.resolve()}register_created_effect(e){Q(this,bp).push(e)}increment(e,t){if(Di(this,xu,Q(this,xu)+1),e){let i=Q(this,za).get(t)??0;Q(this,za).set(t,i+1)}}decrement(e,t){if(Di(this,xu,Q(this,xu)-1),e){let i=Q(this,za).get(t)??0;i===1?Q(this,za).delete(t):Q(this,za).set(t,i-1)}Q(this,Uc)||(Di(this,Uc,!0),Kl(()=>{Di(this,Uc,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(const i of e)Q(this,Va).add(i);for(const i of t)Q(this,Sr).add(i);e.clear(),t.clear()}oncommit(e){Q(this,Su).add(e)}ondiscard(e){Q(this,Cu).add(e)}settled(){return(Q(this,Lu)??Di(this,Lu,vP())).promise}static ensure(){if(di===null){const e=di=new Bv;!Ky&&!ff&&Kl(()=>{Q(e,wu)||e.flush()})}return di}apply(){{Rs=null;return}}schedule(e){var n;if(iS=e,(n=e.b)!=null&&n.is_pending&&(e.f&(Zu|ty|bP))!==0&&(e.f&wg)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var i=t.f;if(iu!==null&&t===Qi&&(Yi===null||(Yi.f&Ws)===0))return;if((i&(fc|Ar))!==0){if((i&ws)===0)return;t.f^=ws}}Q(this,mo).push(t)}};wu=new WeakMap,Rl=new WeakMap,jc=new WeakMap,Su=new WeakMap,Cu=new WeakMap,xu=new WeakMap,za=new WeakMap,Lu=new WeakMap,mo=new WeakMap,bp=new WeakMap,Va=new WeakMap,Sr=new WeakMap,ra=new WeakMap,ku=new WeakMap,Uc=new WeakMap,Vn=new WeakSet,nS=function(){if(this.is_fork)return!0;for(const i of Q(this,za).keys()){for(var e=i,t=!1;e.parent!==null;){if(Q(this,ra).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},Zg=function(){var c,h,g,f;Di(this,wu,!0),rk++>1e3&&(yn(this,Vn,Xg).call(this),EH());for(const p of Q(this,Va))Q(this,Sr).delete(p),cs(p,Is),this.schedule(p);for(const p of Q(this,Sr))cs(p,La),this.schedule(p);const e=Q(this,mo);Di(this,mo,[]),this.apply();var t=iu=[],i=[],n=Qm=[];for(const p of e)try{yn(this,Vn,sS).call(this,p,t,i)}catch(v){throw RP(p),yn(this,Vn,nS).call(this)||this.discard(),v}if(di=null,n.length>0){var s=Bv.ensure();for(const p of n)s.schedule(p)}if(iu=null,Qm=null,yn(this,Vn,nS).call(this)){yn(this,Vn,qh).call(this,i),yn(this,Vn,qh).call(this,t);for(const[p,v]of Q(this,ra))NP(p,v);n.length>0&&yn(c=di,Vn,Zg).call(c);return}const r=yn(this,Vn,PP).call(this);if(r){yn(this,Vn,qh).call(this,i),yn(this,Vn,qh).call(this,t),yn(h=r,Vn,TP).call(h,this);return}Q(this,Va).clear(),Q(this,Sr).clear();for(const p of Q(this,Su))p(this);Q(this,Su).clear(),gf=this,ak(i),ak(t),gf=null,(g=Q(this,Lu))==null||g.resolve();var a=di;if(Q(this,xu)===0&&(Q(this,mo).length===0||a!==null)&&yn(this,Vn,Xg).call(this),Q(this,mo).length>0)if(a!==null){const p=a;Q(p,mo).push(...Q(this,mo).filter(v=>!Q(p,mo).includes(v)))}else a=this;a!==null&&yn(f=a,Vn,Zg).call(f)},sS=function(e,t,i){e.f^=ws;for(var n=e.first;n!==null;){var s=n.f,r=(s&(Ar|fc))!==0,a=r&&(s&ws)!==0,c=a||(s&oo)!==0||Q(this,ra).has(n);if(!c&&n.fn!==null){r?n.f^=ws:(s&Zu)!==0?t.push(n):jp(n)&&((s&Mr)!==0&&Q(this,Sr).add(n),Qu(n));var h=n.first;if(h!==null){n=h;continue}}for(;n!==null;){var g=n.next;if(g!==null){n=g;break}n=n.parent}}},PP=function(){for(var e=Q(this,Rl);e!==null;){if(!e.is_fork){for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e}e=Q(e,Rl)}return null},TP=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(Q(e,Va),Q(e,Sr));const t=n=>{var s=n.reactions;if(s!==null)for(const c of s){var r=c.f;if((r&Ws)!==0)t(c);else{var a=c;r&(_u|Mr)&&!this.async_deriveds.has(a)&&(Q(this,Sr).delete(a),cs(a,Is),this.schedule(a))}}};for(const n of this.current.keys())t(n);this.oncommit(()=>e.discard()),yn(i=e,Vn,Xg).call(i),di=this,yn(this,Vn,Zg).call(this)},qh=function(e){for(var t=0;t<e.length;t+=1)EP(e[t],Q(this,Va),Q(this,Sr))},IH=function(){var g;for(let f=qy;f!==null;f=Q(f,jc)){var e=f.id<this.id,t=[];for(const[p,[v,_]]of this.current){if(f.current.has(p)){var i=f.current.get(p)[0];if(e&&v!==i)f.current.set(p,[v,_]);else continue}t.push(p)}if(e)for(const[p,v]of this.async_deriveds){const _=f.async_deriveds.get(p);_&&v.promise.then(_.resolve).catch(_.reject)}if(Q(f,wu)){var n=[...f.current.keys()].filter(p=>!f.current.get(p)[1]&&!this.current.has(p));if(n.length===0)e&&f.discard();else if(t.length>0){if(e)for(const p of Q(this,ku))f.unskip_effect(p,v=>{var _;(v.f&(Mr|_u))!==0?f.schedule(v):yn(_=f,Vn,qh).call(_,[v])});f.activate();var s=new Set,r=new Map;for(var a of t)MP(a,n,s,r);r=new Map;var c=[...f.current].filter(([p,v])=>{const _=this.current.get(p);return _?_[0]!==v[0]||_[1]!==v[1]:!0}).map(([p])=>p);if(c.length>0)for(const p of Q(this,bp))(p.f&(dr|oo|E_))===0&&z0(p,c,r)&&((p.f&(_u|Mr))!==0?(cs(p,Is),f.schedule(p)):Q(f,Va).add(p));if(Q(f,mo).length>0&&!Q(f,Uc)){f.apply();for(var h of Q(f,mo))yn(g=f,Vn,sS).call(g,h,[],[]);Di(f,mo,[])}f.deactivate()}}}},Xg=function(){if(this.linked){var e=Q(this,Rl),t=Q(this,jc);e===null?qy=t:Di(e,jc,t),t===null?Th=e:Di(t,Rl,e),this.linked=!1}};let Gd=Bv;function DH(o){var e=ff;ff=!0;try{for(var t;;){if(CH(),di===null)return t;di.flush()}}finally{ff=e}}function EH(){try{eH()}catch(o){Hl(o,iS)}}let br=null;function ak(o){var e=o.length;if(e!==0){for(var t=0;t<e;){var i=o[t++];if((i.f&(dr|oo))===0&&jp(i)&&(br=new Set,Qu(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&XP(i),(br==null?void 0:br.size)>0)){Jc.clear();for(const n of br){if((n.f&(dr|oo))!==0)continue;const s=[n];let r=n.parent;for(;r!==null;)br.has(r)&&(br.delete(r),s.push(r)),r=r.parent;for(let a=s.length-1;a>=0;a--){const c=s[a];(c.f&(dr|oo))===0&&Qu(c)}}br.clear()}}br=null}}function MP(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&Ws)!==0?MP(n,e,t,i):(s&(_u|Mr))!==0&&(s&Is)===0&&z0(n,e,i)&&(cs(n,Is),V0(n))}}function z0(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(D_.call(e,n))return!0;if((n.f&Ws)!==0&&z0(n,e,t))return t.set(n,!0),!0}return t.set(o,!1),!1}function V0(o){di.schedule(o)}function NP(o,e){if(!((o.f&Ar)!==0&&(o.f&ws)!==0)){(o.f&Is)!==0?e.d.push(o):(o.f&La)!==0&&e.m.push(o),cs(o,ws);for(var t=o.first;t!==null;)NP(t,e),t=t.next}}function RP(o){cs(o,ws);for(var e=o.first;e!==null;)RP(e),e=e.next}function PH(o){let e=0,t=Zd(0),i;return()=>{$0()&&(u(t),sy(()=>(e===0&&(i=_l(()=>o(()=>pf(t)))),e+=1,()=>{Kl(()=>{e-=1,e===0&&(i==null||i(),i=void 0,pf(t))})})))}}var TH=Xu|Sg;function MH(o,e,t,i){new NH(o,e,t,i)}var er,c0,tr,$c,_o,ir,to,Ao,ja,qc,Al,Iu,yp,wp,Ua,zv,ds,RH,AH,OH,oS,e_,t_,rS,aS;class NH{constructor(e,t,i,n){Ii(this,ds);Fi(this,"parent");Fi(this,"is_pending",!1);Fi(this,"transform_error");Ii(this,er);Ii(this,c0,null);Ii(this,tr);Ii(this,$c);Ii(this,_o);Ii(this,ir,null);Ii(this,to,null);Ii(this,Ao,null);Ii(this,ja,null);Ii(this,qc,0);Ii(this,Al,0);Ii(this,Iu,!1);Ii(this,yp,new Set);Ii(this,wp,new Set);Ii(this,Ua,null);Ii(this,zv,PH(()=>(Di(this,Ua,Zd(Q(this,qc))),()=>{Di(this,Ua,null)})));var s;Di(this,er,e),Di(this,tr,t),Di(this,$c,r=>{var a=Qi;a.b=this,a.f|=Jw,i(r)}),this.parent=Qi.b,this.transform_error=n??((s=this.parent)==null?void 0:s.transform_error)??(r=>r),Di(this,_o,G0(()=>{yn(this,ds,oS).call(this)},TH))}defer_effect(e){EP(e,Q(this,yp),Q(this,wp))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!Q(this,tr).pending}update_pending_count(e,t){yn(this,ds,rS).call(this,e,t),Di(this,qc,Q(this,qc)+e),!(!Q(this,Ua)||Q(this,Iu))&&(Di(this,Iu,!0),Kl(()=>{Di(this,Iu,!1),Q(this,Ua)&&Ju(Q(this,Ua),Q(this,qc))}))}get_effect_pending(){return Q(this,zv).call(this),u(Q(this,Ua))}error(e){if(!Q(this,tr).onerror&&!Q(this,tr).failed)throw e;di!=null&&di.is_fork?(Q(this,ir)&&di.skip_effect(Q(this,ir)),Q(this,to)&&di.skip_effect(Q(this,to)),Q(this,Ao)&&di.skip_effect(Q(this,Ao)),di.oncommit(()=>{yn(this,ds,aS).call(this,e)})):yn(this,ds,aS).call(this,e)}}er=new WeakMap,c0=new WeakMap,tr=new WeakMap,$c=new WeakMap,_o=new WeakMap,ir=new WeakMap,to=new WeakMap,Ao=new WeakMap,ja=new WeakMap,qc=new WeakMap,Al=new WeakMap,Iu=new WeakMap,yp=new WeakMap,wp=new WeakMap,Ua=new WeakMap,zv=new WeakMap,ds=new WeakSet,RH=function(){try{Di(this,ir,nr(()=>Q(this,$c).call(this,Q(this,er))))}catch(e){this.error(e)}},AH=function(e){const t=Q(this,tr).failed;t&&Di(this,Ao,nr(()=>{t(Q(this,er),()=>e,()=>()=>{})}))},OH=function(){const e=Q(this,tr).pending;e&&(this.is_pending=!0,Di(this,to,nr(()=>e(Q(this,er)))),Kl(()=>{var t=Di(this,ja,document.createDocumentFragment()),i=Qa();t.append(i),Di(this,ir,yn(this,ds,t_).call(this,()=>nr(()=>Q(this,$c).call(this,i)))),Q(this,Al)===0&&(Q(this,er).before(t),Di(this,ja,null),ed(Q(this,to),()=>{Di(this,to,null)}),yn(this,ds,e_).call(this,di))}))},oS=function(){try{if(this.is_pending=this.has_pending_snippet(),Di(this,Al,0),Di(this,qc,0),Di(this,ir,nr(()=>{Q(this,$c).call(this,Q(this,er))})),Q(this,Al)>0){var e=Di(this,ja,document.createDocumentFragment());X0(Q(this,ir),e);const t=Q(this,tr).pending;Di(this,to,nr(()=>t(Q(this,er))))}else yn(this,ds,e_).call(this,di)}catch(t){this.error(t)}},e_=function(e){this.is_pending=!1,e.transfer_effects(Q(this,yp),Q(this,wp))},t_=function(e){var t=Qi,i=Yi,n=Hs;ka(Q(this,_o)),gr(Q(this,_o)),Yu(Q(this,_o).ctx);try{return Gd.ensure(),e()}catch(s){return IP(s),null}finally{ka(t),gr(i),Yu(n)}},rS=function(e,t){var i;if(!this.has_pending_snippet()){this.parent&&yn(i=this.parent,ds,rS).call(i,e,t);return}Di(this,Al,Q(this,Al)+e),Q(this,Al)===0&&(yn(this,ds,e_).call(this,t),Q(this,to)&&ed(Q(this,to),()=>{Di(this,to,null)}),Q(this,ja)&&(Q(this,er).before(Q(this,ja)),Di(this,ja,null)))},aS=function(e){Q(this,ir)&&(xo(Q(this,ir)),Di(this,ir,null)),Q(this,to)&&(xo(Q(this,to)),Di(this,to,null)),Q(this,Ao)&&(xo(Q(this,Ao)),Di(this,Ao,null));var t=Q(this,tr).onerror;let i=Q(this,tr).failed;var n=!1,s=!1;const r=()=>{if(n){yH();return}n=!0,s&&oH(),Q(this,Ao)!==null&&ed(Q(this,Ao),()=>{Di(this,Ao,null)}),yn(this,ds,t_).call(this,()=>{yn(this,ds,oS).call(this)})},a=c=>{try{s=!0,t==null||t(c,r),s=!1}catch(h){Hl(h,Q(this,_o)&&Q(this,_o).parent)}i&&Di(this,Ao,yn(this,ds,t_).call(this,()=>{try{return nr(()=>{var h=Qi;h.b=this,h.f|=Jw,i(Q(this,er),()=>c,()=>r)})}catch(h){return Hl(h,Q(this,_o).parent),null}}))};Kl(()=>{var c;try{c=this.transform_error(e)}catch(h){Hl(h,Q(this,_o)&&Q(this,_o).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(a,h=>Hl(h,Q(this,_o)&&Q(this,_o).parent)):a(c)})};function FH(o,e,t,i){const n=Vf;var s=o.filter(p=>!p.settled);if(t.length===0&&s.length===0){i(e.map(n));return}var r=Qi,a=HH(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(p=>p.promise)):null;function h(p){if((r.f&dr)===0){a();try{i(p)}catch(v){Hl(v,r)}T_()}}var g=AP();if(t.length===0){c.then(()=>h(e.map(n))).finally(g);return}function f(){Promise.all(t.map(p=>WH(p))).then(p=>h([...e.map(n),...p])).catch(p=>Hl(p,r)).finally(g)}c?c.then(()=>{a(),f(),T_()}):f()}function HH(){var o=Qi,e=Yi,t=Hs,i=di;return function(s=!0){ka(o),gr(e),Yu(t),s&&(o.f&dr)===0&&(i==null||i.activate(),i==null||i.apply())}}function T_(o=!0){ka(null),gr(null),Yu(null),o&&(di==null||di.deactivate())}function AP(){var o=Qi,e=o.b,t=di,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 Vf(o){var e=Ws|Is;return Qi!==null&&(Qi.f|=Sg),{ctx:Hs,deps:null,effects:null,equals:CP,f:e,fn:o,reactions:null,rv:0,v:bs,wv:0,parent:Qi,ac:null}}const bm=Symbol("obsolete");function WH(o,e,t){let i=Qi;i===null&&ZF();var n=void 0,s=Zd(bs),r=!Yi,a=new Set;return YH(()=>{var v,_;var c=Qi,h=vP();n=h.promise;try{Promise.resolve(o()).then(h.resolve,w=>{w!==iy&&h.reject(w)}).finally(T_)}catch(w){h.reject(w),T_()}var g=di;if(r){if((c.f&wg)!==0)var f=AP();if((v=i.b)!=null&&v.is_rendered())(_=g.async_deriveds.get(c))==null||_.reject(bm);else for(const w of a.values())w.reject(bm);a.add(h),g.async_deriveds.set(c,h)}const p=(w,S=void 0)=>{f==null||f(),a.delete(h),S!==bm&&(g.activate(),S?(s.f|=ql,Ju(s,S)):((s.f&ql)!==0&&(s.f^=ql),Ju(s,w)),g.deactivate())};h.promise.then(p,w=>p(null,w||"unknown"))}),q0(()=>{for(const c of a)c.reject(bm)}),new Promise(c=>{function h(g){function f(){g===n?c(s):h(n)}g.then(f,f)}h(n)})}function st(o){const e=Vf(o);return QP(e),e}function OP(o){const e=Vf(o);return e.equals=xP,e}function BH(o){var e=o.effects;if(e!==null){o.effects=null;for(var t=0;t<e.length;t+=1)xo(e[t])}}function j0(o){var e,t=Qi,i=o.parent;if(!al&&i!==null&&o.v!==bs&&(i.f&(dr|oo))!==0)return vH(),o.v;ka(i);try{o.f&=~Kd,BH(o),e=nT(o)}finally{ka(t)}return e}function FP(o){var e=j0(o);if(!o.equals(e)&&(o.wv=tT(),(!(di!=null&&di.is_fork)||o.deps===null)&&(di!==null?(di.capture(o,e,!0),gf==null||gf.capture(o,e,!0)):o.v=e,o.deps===null))){cs(o,ws);return}al||(Rs!==null?($0()||di!=null&&di.is_fork)&&Rs.set(o,e):B0(o))}function zH(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(iy),i.fn!==null&&(i.teardown=ey),i.ac=null,jf(i,0),Z0(i))}function HP(o){if(o.effects!==null)for(const e of o.effects)e.teardown&&e.fn!==null&&Qu(e)}let M_=new Set;const Jc=new Map;let WP=!1;function Zd(o,e){var t={f:0,v:o,reactions:null,equals:CP,rv:0,wv:0};return t}function V(o,e){const t=Zd(o);return QP(t),t}function VH(o,e=!1,t=!0){const i=Zd(o);return e||(i.equals=xP),i}function I(o,e,t=!1){Yi!==null&&(!Nr||(Yi.f&E_)!==0)&&LP()&&(Yi.f&(Ws|Mr|_u|E_))!==0&&(wa===null||!wa.has(o))&&sH();let i=t?wi(e):e;return Ju(o,i,Qm)}function Ju(o,e,t=null){if(!o.equals(e)){Jc.set(o,al?e:o.v);var i=Gd.ensure();if(i.capture(o,e),(o.f&Ws)!==0){const n=o;(o.f&Is)!==0&&j0(n),Rs===null&&B0(n)}o.wv=tT(),BP(o,Is,t),Qi!==null&&(Qi.f&ws)!==0&&(Qi.f&(Ar|fc))===0&&(Qo===null?QH([o]):Qo.push(o)),!i.is_fork&&M_.size>0&&!WP&&jH()}return e}function jH(){WP=!1;for(const o of M_){(o.f&ws)!==0&&cs(o,La);let e;try{e=jp(o)}catch{e=!0}e&&Qu(o)}M_.clear()}function lk(o,e=1){var t=u(o),i=e===1?t++:t--;return I(o,t),i}function pf(o){I(o,o.v+1)}function BP(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,c=(a&Is)===0;if(c&&cs(r,e),(a&E_)!==0)M_.add(r);else if((a&Ws)!==0){var h=r;Rs==null||Rs.delete(h),(a&Kd)===0&&(a&cr&&(Qi===null||(Qi.f&P_)===0)&&(r.f|=Kd),BP(h,La,t))}else if(c){var g=r;(a&Mr)!==0&&br!==null&&br.add(g),t!==null?t.push(g):V0(g)}}}function wi(o){if(typeof o!="object"||o===null||Yc in o)return o;const e=_P(o);if(e!==VF&&e!==jF)return o;var t=new Map,i=W0(o),n=V(0),s=td,r=a=>{if(td===s)return a();var c=Yi,h=td;gr(null),uk(s);var g=a();return gr(c),uk(h),g};return i&&t.set("length",V(o.length)),new Proxy(o,{defineProperty(a,c,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&iH();var g=t.get(c);return g===void 0?r(()=>{var f=V(h.value);return t.set(c,f),f}):I(g,h.value,!0),!0},deleteProperty(a,c){var h=t.get(c);if(h===void 0){if(c in a){const g=r(()=>V(bs));t.set(c,g),pf(n)}}else I(h,bs),pf(n);return!0},get(a,c,h){var v;if(c===Yc)return o;var g=t.get(c),f=c in a;if(g===void 0&&(!f||(v=mu(a,c))!=null&&v.writable)&&(g=r(()=>{var _=wi(f?a[c]:bs),w=V(_);return w}),t.set(c,g)),g!==void 0){var p=u(g);return p===bs?void 0:p}return Reflect.get(a,c,h)},getOwnPropertyDescriptor(a,c){var h=Reflect.getOwnPropertyDescriptor(a,c);if(h&&"value"in h){var g=t.get(c);g&&(h.value=u(g))}else if(h===void 0){var f=t.get(c),p=f==null?void 0:f.v;if(f!==void 0&&p!==bs)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return h},has(a,c){var p;if(c===Yc)return!0;var h=t.get(c),g=h!==void 0&&h.v!==bs||Reflect.has(a,c);if(h!==void 0||Qi!==null&&(!g||(p=mu(a,c))!=null&&p.writable)){h===void 0&&(h=r(()=>{var v=g?wi(a[c]):bs,_=V(v);return _}),t.set(c,h));var f=u(h);if(f===bs)return!1}return g},set(a,c,h,g){var N;var f=t.get(c),p=c in a;if(i&&c==="length")for(var v=h;v<f.v;v+=1){var _=t.get(v+"");_!==void 0?I(_,bs):v in a&&(_=r(()=>V(bs)),t.set(v+"",_))}if(f===void 0)(!p||(N=mu(a,c))!=null&&N.writable)&&(f=r(()=>V(void 0)),I(f,wi(h)),t.set(c,f));else{p=f.v!==bs;var w=r(()=>wi(h));I(f,w)}var S=Reflect.getOwnPropertyDescriptor(a,c);if(S!=null&&S.set&&S.set.call(g,h),!p){if(i&&typeof c=="string"){var D=t.get("length"),P=Number(c);Number.isInteger(P)&&P>=D.v&&I(D,P+1)}pf(n)}return!0},ownKeys(a){u(n);var c=Reflect.ownKeys(a).filter(f=>{var p=t.get(f);return p===void 0||p.v!==bs});for(var[h,g]of t)g.v!==bs&&!(h in a)&&c.push(h);return c},setPrototypeOf(){nH()}})}function ck(o){try{if(o!==null&&typeof o=="object"&&Yc in o)return o[Yc]}catch{}return o}function UH(o,e){return Object.is(ck(o),ck(e))}var Qc,zP,VP,jP,UP;function $H(){if(Qc===void 0){Qc=window,zP=document,VP=/Firefox/.test(navigator.userAgent);var o=Element.prototype,e=Node.prototype,t=Text.prototype;jP=mu(e,"firstChild").get,UP=mu(e,"nextSibling").get,sk(o)&&(o[eS]=void 0,o[Ym]=null,o[tS]=void 0,o.__e=void 0),sk(t)&&(t[Gg]=void 0)}}function Qa(o=""){return document.createTextNode(o)}function ma(o){return jP.call(o)}function Vp(o){return UP.call(o)}function C(o,e){return ma(o)}function wt(o,e=!1){{var t=ma(o);return t instanceof Comment&&t.data===""?Vp(t):t}}function x(o,e=1,t=!1){let i=o;for(;e--;)i=Vp(i);return i}function qH(o){o.textContent=""}function $P(){return!1}function qP(o,e,t){return e==null||e===SP?t?document.createElement(o,{is:t}):document.createElement(o):t?document.createElementNS(e,o,{is:t}):document.createElementNS(e,o)}let dk=!1;function KH(){dk||(dk=!0,document.addEventListener("reset",o=>{Promise.resolve().then(()=>{var e;if(!o.defaultPrevented)for(const t of o.target.elements)(e=t[Jm])==null||e.call(t)})},{capture:!0}))}function ny(o){var e=Yi,t=Qi;gr(null),ka(null);try{return o()}finally{gr(e),ka(t)}}function U0(o,e,t,i=t){o.addEventListener(e,()=>ny(t));const n=o[Jm];n?o[Jm]=()=>{n(),i(!0)}:o[Jm]=()=>i(!0),KH()}function GH(o){Qi===null&&(Yi===null&&QF(),JF()),al&&YF()}function ZH(o,e){var t=e.last;t===null?e.last=e.first=o:(t.next=o,o.prev=t,e.last=o)}function ml(o,e){var t=Qi;t!==null&&(t.f&oo)!==0&&(o|=oo);var i={ctx:Hs,deps:null,nodes:null,f:o|Is|cr,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};di==null||di.register_created_effect(i);var n=i;if((o&Zu)!==0)iu!==null?iu.push(i):Gd.ensure().schedule(i);else if(e!==null){try{Qu(i)}catch(r){throw xo(i),r}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&Sg)===0&&(n=n.first,(o&Mr)!==0&&(o&Xu)!==0&&n!==null&&(n.f|=Xu))}if(n!==null&&(n.parent=t,t!==null&&ZH(n,t),Yi!==null&&(Yi.f&Ws)!==0&&(o&fc)===0)){var s=Yi;(s.effects??(s.effects=[])).push(n)}return i}function $0(){return Yi!==null&&!Nr}function q0(o){const e=ml(ty,null);return cs(e,ws),e.teardown=o,e}function Dn(o){GH();var e=Qi.f,t=!Yi&&(e&Ar)!==0&&Hs!==null&&!Hs.i;if(t){var i=Hs;(i.e??(i.e=[])).push(o)}else return KP(o)}function KP(o){return ml(Zu|qF,o)}function XH(o){Gd.ensure();const e=ml(fc|Sg,o);return(t={})=>new Promise(i=>{t.outro?ed(e,()=>{xo(e),i(void 0)}):(xo(e),i(void 0))})}function K0(o){return ml(Zu,o)}function YH(o){return ml(_u|Sg,o)}function sy(o,e=0){return ml(ty|e,o)}function X(o,e=[],t=[],i=[]){FH(i,e,t,n=>{ml(ty,()=>o(...n.map(u)))})}function G0(o,e=0){var t=ml(Mr|e,o);return t}function nr(o){return ml(Ar|Sg,o)}function GP(o){var e=o.teardown;if(e!==null){const t=al,i=Yi;hk(!0),gr(null);try{e.call(null)}finally{hk(t),gr(i)}}}function Z0(o,e=!1){var t=o.first;for(o.first=o.last=null;t!==null;){const n=t.ac;n!==null&&ny(()=>{n.abort(iy)});var i=t.next;(t.f&fc)!==0?t.parent=null:xo(t,e),t=i}}function JH(o){for(var e=o.first;e!==null;){var t=e.next;(e.f&Ar)===0&&xo(e),e=t}}function xo(o,e=!0){var t=!1;(e||(o.f&$F)!==0)&&o.nodes!==null&&o.nodes.end!==null&&(ZP(o.nodes.start,o.nodes.end),t=!0),cs(o,Qw),Z0(o,e&&!t),jf(o,0);var i=o.nodes&&o.nodes.t;if(i!==null)for(const s of i)s.stop();GP(o),o.f^=Qw,o.f|=dr;var n=o.parent;n!==null&&n.first!==null&&XP(o),o.next=o.prev=o.teardown=o.ctx=o.deps=o.fn=o.nodes=o.ac=o.b=null}function ZP(o,e){for(;o!==null;){var t=o===e?null:Vp(o);o.remove(),o=t}}function XP(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 ed(o,e,t=!0){var i=[];YP(o,i,!0);var n=()=>{t&&xo(o),e&&e()},s=i.length;if(s>0){var r=()=>--s||n();for(var a of i)a.out(r)}else n()}function YP(o,e,t){if((o.f&oo)===0){o.f^=oo;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&fc)===0){var r=(n.f&Xu)!==0||(n.f&Ar)!==0&&(o.f&Mr)!==0;YP(n,e,r?t:!1)}n=s}}}function N_(o){JP(o,!0)}function JP(o,e){if((o.f&oo)!==0){o.f^=oo,(o.f&ws)===0&&(cs(o,Is),Gd.ensure().schedule(o));for(var t=o.first;t!==null;){var i=t.next,n=(t.f&Xu)!==0||(t.f&Ar)!==0;JP(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 X0(o,e){if(o.nodes)for(var t=o.nodes.start,i=o.nodes.end;t!==null;){var n=t===i?null:Vp(t);e.append(t),t=n}}let i_=!1,al=!1;function hk(o){al=o}let Yi=null,Nr=!1;function gr(o){Yi=o}let Qi=null;function ka(o){Qi=o}let wa=null;function QP(o){Yi!==null&&(wa??(wa=new Set)).add(o)}let vo=null,No=0,Qo=null;function QH(o){Qo=o}let eT=1,Bc=0,td=Bc;function uk(o){td=o}function tT(){return++eT}function jp(o){var e=o.f;if((e&Is)!==0)return!0;if(e&Ws&&(o.f&=~Kd),(e&La)!==0){for(var t=o.deps,i=t.length,n=0;n<i;n++){var s=t[n];if(jp(s)&&FP(s),s.wv>o.wv)return!0}(e&cr)!==0&&Rs===null&&cs(o,ws)}return!1}function iT(o,e,t=!0){var i=o.reactions;if(i!==null&&!(wa!==null&&wa.has(o)))for(var n=0;n<i.length;n++){var s=i[n];(s.f&Ws)!==0?iT(s,e,!1):e===s&&(t?cs(s,Is):(s.f&ws)!==0&&cs(s,La),V0(s))}}function nT(o){var w;var e=vo,t=No,i=Qo,n=Yi,s=wa,r=Hs,a=Nr,c=td,h=o.f;vo=null,No=0,Qo=null,Yi=(h&(Ar|fc))===0?o:null,wa=null,Yu(o.ctx),Nr=!1,td=++Bc,o.ac!==null&&(ny(()=>{o.ac.abort(iy)}),o.ac=null);try{o.f|=P_;var g=o.fn,f=g();o.f|=wg;var p=o.deps,v=di==null?void 0:di.is_fork;if(vo!==null){var _;if(v||jf(o,No),p!==null&&No>0)for(p.length=No+vo.length,_=0;_<vo.length;_++)p[No+_]=vo[_];else o.deps=p=vo;if($0()&&(o.f&cr)!==0)for(_=No;_<p.length;_++)((w=p[_]).reactions??(w.reactions=[])).push(o)}else!v&&p!==null&&No<p.length&&(jf(o,No),p.length=No);if(LP()&&Qo!==null&&!Nr&&p!==null&&(o.f&(Ws|La|Is))===0)for(_=0;_<Qo.length;_++)iT(Qo[_],o);if(n!==null&&n!==o){if(Bc++,n.deps!==null)for(let S=0;S<t;S+=1)n.deps[S].rv=Bc;if(e!==null)for(const S of e)S.rv=Bc;Qo!==null&&(i===null?i=Qo:i.push(...Qo))}return(o.f&ql)!==0&&(o.f^=ql),f}catch(S){return IP(S)}finally{o.f^=P_,vo=e,No=t,Qo=i,Yi=n,wa=s,Yu(r),Nr=a,td=c}}function eW(o,e){let t=e.reactions;if(t!==null){var i=WF.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&Ws)!==0&&(vo===null||!D_.call(vo,e))){var s=e;(s.f&cr)!==0&&(s.f^=cr,s.f&=~Kd),s.v!==bs&&B0(s),zH(s),jf(s,0)}}function jf(o,e){var t=o.deps;if(t!==null)for(var i=e;i<t.length;i++)eW(o,t[i])}function Qu(o){var e=o.f;if((e&dr)===0){cs(o,ws);var t=Qi,i=i_;Qi=o,i_=!0;try{(e&(Mr|bP))!==0?JH(o):Z0(o),GP(o);var n=nT(o);o.teardown=typeof n=="function"?n:null,o.wv=eT;var s;mP&&SH&&(o.f&Is)!==0&&o.deps}finally{i_=i,Qi=t}}}async function lS(){await Promise.resolve(),DH()}function u(o){var e=o.f,t=(e&Ws)!==0;if(Yi!==null&&!Nr){var i=Qi!==null&&(Qi.f&dr)!==0;if(!i&&(wa===null||!wa.has(o))){var n=Yi.deps;if((Yi.f&P_)!==0)o.rv<Bc&&(o.rv=Bc,vo===null&&n!==null&&n[No]===o?No++:vo===null?vo=[o]:vo.push(o));else{Yi.deps??(Yi.deps=[]),D_.call(Yi.deps,o)||Yi.deps.push(o);var s=o.reactions;s===null?o.reactions=[Yi]:D_.call(s,Yi)||s.push(Yi)}}}if(al&&Jc.has(o))return Jc.get(o);if(t){var r=o;if(al){var a=r.v;return((r.f&ws)===0&&r.reactions!==null||oT(r))&&(a=j0(r)),Jc.set(r,a),a}var c=(r.f&cr)===0&&!Nr&&Yi!==null&&(i_||(Yi.f&cr)!==0),h=(r.f&wg)===0;jp(r)&&(c&&(r.f|=cr),FP(r)),c&&!h&&(HP(r),sT(r))}if(Rs!=null&&Rs.has(o))return Rs.get(o);if((o.f&ql)!==0)throw o.v;return o.v}function sT(o){if(o.f|=cr,o.deps!==null)for(const e of o.deps)(e.reactions??(e.reactions=[])).push(o),(e.f&Ws)!==0&&(e.f&cr)===0&&(HP(e),sT(e))}function oT(o){if(o.v===bs)return!0;if(o.deps===null)return!1;for(const e of o.deps)if(Jc.has(e)||(e.f&Ws)!==0&&oT(e))return!0;return!1}function _l(o){var e=Nr;try{return Nr=!0,o()}finally{Nr=e}}const tW=["touchstart","touchmove"];function iW(o){return tW.includes(o)}const zc=Symbol("events"),rT=new Set,cS=new Set;function nW(o,e,t,i={}){function n(s){if(i.capture||dS.call(e,s),!s.cancelBubble)return ny(()=>t==null?void 0:t.call(this,s))}return o.startsWith("pointer")||o.startsWith("touch")||o==="wheel"?Kl(()=>{e.addEventListener(o,n,i)}):e.addEventListener(o,n,i),n}function es(o,e,t,i,n){var s={capture:i,passive:n},r=nW(o,e,t,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&q0(()=>{e.removeEventListener(o,r,s)})}function oe(o,e,t){(e[zc]??(e[zc]={}))[o]=t}function mr(o){for(var e=0;e<o.length;e++)rT.add(o[e]);for(var t of cS)t(o)}let gk=null;function dS(o){var w,S;var e=this,t=e.ownerDocument,i=o.type,n=((w=o.composedPath)==null?void 0:w.call(o))||[],s=n[0]||o.target;gk=o;var r=0,a=gk===o&&o[zc];if(a){var c=n.indexOf(a);if(c!==-1&&(e===document||e===window)){o[zc]=e;return}var h=n.indexOf(e);if(h===-1)return;c<=h&&(r=c)}if(s=n[r]||o.target,s!==e){BF(o,"currentTarget",{configurable:!0,get(){return s||t}});var g=Yi,f=Qi;gr(null),ka(null);try{for(var p,v=[];s!==null&&s!==e;){try{var _=(S=s[zc])==null?void 0:S[i];_!=null&&(!s.disabled||o.target===s)&&_.call(s,o)}catch(D){p?v.push(D):p=D}if(o.cancelBubble)break;r++,s=r<n.length?n[r]:null}if(p){for(let D of v)queueMicrotask(()=>{throw D});throw p}}finally{o[zc]=e,delete o.currentTarget,gr(g),ka(f)}}}var WD;const Gy=((WD=globalThis==null?void 0:globalThis.window)==null?void 0:WD.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:o=>o});function sW(o){return(Gy==null?void 0:Gy.createHTML(o))??o}function aT(o){var e=qP("template");return e.innerHTML=sW(o.replaceAll("<!>","<!---->")),e.content}function Xd(o,e){var t=Qi;t.nodes===null&&(t.nodes={start:o,end:e,a:null,t:null})}function R(o,e){var t=(e&fH)!==0,i=(e&pH)!==0,n,s=!o.startsWith("<!>");return()=>{n===void 0&&(n=aT(s?o:"<!>"+o),t||(n=ma(n)));var r=i||VP?document.importNode(n,!0):n.cloneNode(!0);if(t){var a=ma(r),c=r.lastChild;Xd(a,c)}else Xd(r,r);return r}}function oW(o,e,t="svg"){var i=!o.startsWith("<!>"),n=`<${t}>${i?o:"<!>"+o}</${t}>`,s;return()=>{if(!s){var r=aT(n),a=ma(r);s=ma(a)}var c=s.cloneNode(!0);return Xd(c,c),c}}function lT(o,e){return oW(o,e,"svg")}function Rr(o=""){{var e=Qa(o+"");return Xd(e,e),e}}function Ds(){var o=document.createDocumentFragment(),e=document.createComment(""),t=Qa();return o.append(e,t),Xd(e,t),o}function T(o,e){o!==null&&o.before(e)}function G(o,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(o[Gg]??(o[Gg]=o.nodeValue))&&(o[Gg]=t,o.nodeValue=`${t}`)}function rW(o,e){return aW(o,e)}const ym=new Map;function aW(o,{target:e,anchor:t,props:i={},events:n,context:s,intro:r=!0,transformError:a}){$H();var c=void 0,h=XH(()=>{var g=t??e.appendChild(Qa());MH(g,{pending:()=>{}},v=>{Io({});var _=Hs;s&&(_.c=s),n&&(i.$$events=n),c=o(v,i)||{},Do()},a);var f=new Set,p=v=>{for(var _=0;_<v.length;_++){var w=v[_];if(!f.has(w)){f.add(w);var S=iW(w);for(const N of[e,document]){var D=ym.get(N);D===void 0&&(D=new Map,ym.set(N,D));var P=D.get(w);P===void 0?(N.addEventListener(w,dS,{passive:S}),D.set(w,1)):D.set(w,P+1)}}}};return p(Qb(rT)),cS.add(p),()=>{var S;for(var v of f)for(const D of[e,document]){var _=ym.get(D),w=_.get(v);--w==0?(D.removeEventListener(v,dS),_.delete(v),_.size===0&&ym.delete(D)):_.set(v,w)}cS.delete(p),g!==t&&((S=g.parentNode)==null||S.removeChild(g))}});return lW.set(c,h),c}let lW=new WeakMap;var Cr,aa,Oo,Kc,Sp,Cp,Vv;class cW{constructor(e,t=!0){Fi(this,"anchor");Ii(this,Cr,new Map);Ii(this,aa,new Map);Ii(this,Oo,new Map);Ii(this,Kc,new Set);Ii(this,Sp,!0);Ii(this,Cp,e=>{if(Q(this,Cr).has(e)){var t=Q(this,Cr).get(e),i=Q(this,aa).get(t);if(i)N_(i),Q(this,Kc).delete(t);else{var n=Q(this,Oo).get(t);n&&(N_(n.effect),Q(this,aa).set(t,n.effect),Q(this,Oo).delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[s,r]of Q(this,Cr)){if(Q(this,Cr).delete(s),s===e)break;const a=Q(this,Oo).get(r);a&&(xo(a.effect),Q(this,Oo).delete(r))}for(const[s,r]of Q(this,aa)){if(s===t||Q(this,Kc).has(s))continue;const a=()=>{if(Array.from(Q(this,Cr).values()).includes(s)){var h=document.createDocumentFragment();X0(r,h),h.append(Qa()),Q(this,Oo).set(s,{effect:r,fragment:h})}else xo(r);Q(this,Kc).delete(s),Q(this,aa).delete(s)};Q(this,Sp)||!i?(Q(this,Kc).add(s),ed(r,a,!1)):a()}}});Ii(this,Vv,e=>{Q(this,Cr).delete(e);const t=Array.from(Q(this,Cr).values());for(const[i,n]of Q(this,Oo))t.includes(i)||(xo(n.effect),Q(this,Oo).delete(i))});this.anchor=e,Di(this,Sp,t)}ensure(e,t){var i=di,n=$P();if(t&&!Q(this,aa).has(e)&&!Q(this,Oo).has(e))if(n){var s=document.createDocumentFragment(),r=Qa();s.append(r),Q(this,Oo).set(e,{effect:nr(()=>t(r)),fragment:s})}else Q(this,aa).set(e,nr(()=>t(this.anchor)));if(Q(this,Cr).set(i,e),n){for(const[a,c]of Q(this,aa))a===e?i.unskip_effect(c):i.skip_effect(c);for(const[a,c]of Q(this,Oo))a===e?i.unskip_effect(c.effect):i.skip_effect(c.effect);i.oncommit(Q(this,Cp)),i.ondiscard(Q(this,Vv))}else Q(this,Cp).call(this,i)}}Cr=new WeakMap,aa=new WeakMap,Oo=new WeakMap,Kc=new WeakMap,Sp=new WeakMap,Cp=new WeakMap,Vv=new WeakMap;function q(o,e,t=!1){var i=new cW(o),n=t?Xu:0;function s(r,a){i.ensure(r,a)}G0(()=>{var r=!1;e((a,c=0)=>{r=!0,s(c,a)}),r||s(-1,null)},n)}function En(o,e){return e}function dW(o,e,t){for(var i=[],n=e.length,s,r=e.length,a=0;a<n;a++){let f=e[a];ed(f,()=>{if(s){if(s.pending.delete(f),s.done.add(f),s.pending.size===0){var p=o.outrogroups;hS(o,Qb(s.done)),p.delete(s),p.size===0&&(o.outrogroups=null)}}else r-=1},!1)}if(r===0){var c=i.length===0&&t!==null;if(c){var h=t,g=h.parentNode;qH(g),g.append(h),o.items.clear()}hS(o,e,!c)}else s={pending:new Set(e),done:new Set},(o.outrogroups??(o.outrogroups=new Set)).add(s)}function hS(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|=pa;const r=document.createDocumentFragment();X0(s,r)}else xo(e[n],t)}}var fk;function _i(o,e,t,i,n,s=null){var r=o,a=new Map,c=(e&wP)!==0;if(c){var h=o;r=h.appendChild(Qa())}var g=null,f=OP(()=>{var N=t();return W0(N)?N:N==null?[]:Qb(N)}),p,v=new Map,_=!0;function w(N){(P.effect.f&dr)===0&&(P.pending.delete(N),P.fallback=g,hW(P,p,r,e,i),g!==null&&(p.length===0?(g.f&pa)===0?N_(g):(g.f^=pa,Yg(g,null,r)):ed(g,()=>{g=null})))}function S(N){P.pending.delete(N)}var D=G0(()=>{p=u(f);for(var N=p.length,z=new Set,F=di,ie=$P(),Y=0;Y<N;Y+=1){var ge=p[Y],_e=i(ge,Y),Ae=_?null:a.get(_e);Ae?(Ae.v&&Ju(Ae.v,ge),Ae.i&&Ju(Ae.i,Y),ie&&F.unskip_effect(Ae.e)):(Ae=uW(a,_?r:fk??(fk=Qa()),ge,_e,Y,n,e,t),_||(Ae.e.f|=pa),a.set(_e,Ae)),z.add(_e)}if(N===0&&s&&!g&&(_?g=nr(()=>s(r)):(g=nr(()=>s(fk??(fk=Qa()))),g.f|=pa)),N>z.size&&XF(),!_)if(v.set(F,z),ie){for(const[Le,gt]of a)z.has(Le)||F.skip_effect(gt.e);F.oncommit(w),F.ondiscard(S)}else w(F);u(f)}),P={effect:D,items:a,pending:v,outrogroups:null,fallback:g};_=!1}function Hg(o){for(;o!==null&&(o.f&Ar)===0;)o=o.next;return o}function hW(o,e,t,i,n){var Ae,Le,gt,Tt,ft,mt,ct,Ot,Me;var s=(i&lH)!==0,r=e.length,a=o.items,c=Hg(o.effect.first),h,g=null,f,p=[],v=[],_,w,S,D;if(s)for(D=0;D<r;D+=1)_=e[D],w=n(_,D),S=a.get(w).e,(S.f&pa)===0&&((Le=(Ae=S.nodes)==null?void 0:Ae.a)==null||Le.measure(),(f??(f=new Set)).add(S));for(D=0;D<r;D+=1){if(_=e[D],w=n(_,D),S=a.get(w).e,o.outrogroups!==null)for(const Mt of o.outrogroups)Mt.pending.delete(S),Mt.done.delete(S);if((S.f&oo)!==0&&(N_(S),s&&((Tt=(gt=S.nodes)==null?void 0:gt.a)==null||Tt.unfix(),(f??(f=new Set)).delete(S))),(S.f&pa)!==0)if(S.f^=pa,S===c)Yg(S,null,t);else{var P=g?g.next:c;S===o.effect.last&&(o.effect.last=S.prev),S.prev&&(S.prev.next=S.next),S.next&&(S.next.prev=S.prev),Sl(o,g,S),Sl(o,S,P),Yg(S,P,t),g=S,p=[],v=[],c=Hg(g.next);continue}if(S!==c){if(h!==void 0&&h.has(S)){if(p.length<v.length){var N=v[0],z;g=N.prev;var F=p[0],ie=p[p.length-1];for(z=0;z<p.length;z+=1)Yg(p[z],N,t);for(z=0;z<v.length;z+=1)h.delete(v[z]);Sl(o,F.prev,ie.next),Sl(o,g,F),Sl(o,ie,N),c=N,g=ie,D-=1,p=[],v=[]}else h.delete(S),Yg(S,c,t),Sl(o,S.prev,S.next),Sl(o,S,g===null?o.effect.first:g.next),Sl(o,g,S),g=S;continue}for(p=[],v=[];c!==null&&c!==S;)(h??(h=new Set)).add(c),v.push(c),c=Hg(c.next);if(c===null)continue}(S.f&pa)===0&&p.push(S),g=S,c=Hg(S.next)}if(o.outrogroups!==null){for(const Mt of o.outrogroups)Mt.pending.size===0&&(hS(o,Qb(Mt.done)),(ft=o.outrogroups)==null||ft.delete(Mt));o.outrogroups.size===0&&(o.outrogroups=null)}if(c!==null||h!==void 0){var Y=[];if(h!==void 0)for(S of h)(S.f&oo)===0&&Y.push(S);for(;c!==null;)(c.f&oo)===0&&c!==o.fallback&&Y.push(c),c=Hg(c.next);var ge=Y.length;if(ge>0){var _e=(i&wP)!==0&&r===0?t:null;if(s){for(D=0;D<ge;D+=1)(ct=(mt=Y[D].nodes)==null?void 0:mt.a)==null||ct.measure();for(D=0;D<ge;D+=1)(Me=(Ot=Y[D].nodes)==null?void 0:Ot.a)==null||Me.fix()}dW(o,Y,_e)}}s&&Kl(()=>{var Mt,je;if(f!==void 0)for(S of f)(je=(Mt=S.nodes)==null?void 0:Mt.a)==null||je.apply()})}function uW(o,e,t,i,n,s,r,a){var c=(r&rH)!==0?(r&cH)===0?VH(t,!1,!1):Zd(t):null,h=(r&aH)!==0?Zd(n):null;return{v:c,i:h,e:nr(()=>(s(e,c??t,h??n,a),()=>{o.delete(i)}))}}function Yg(o,e,t){if(o.nodes)for(var i=o.nodes.start,n=o.nodes.end,s=e&&(e.f&pa)===0?e.nodes.start:t;i!==null;){var r=Vp(i);if(s.before(i),i===n)return;i=r}}function Sl(o,e,t){e===null?o.effect.first=t:e.next=t,t===null?o.effect.last=e:t.prev=e}function Wl(o,e,t=!1,i=!1,n=!1,s=!1){var r=o,a="";if(t)var c=o;X(()=>{var h=Qi;if(a!==(a=e()??"")){if(t){h.nodes=null,c.innerHTML=a,a!==""&&Xd(ma(c),c.lastChild);return}if(h.nodes!==null&&(ZP(h.nodes.start,h.nodes.end),h.nodes=null),a!==""){var g=i?mH:n?_H:void 0,f=qP(i?"svg":n?"math":"template",g);f.innerHTML=a;var p=i||n?f:f.content;if(Xd(ma(p),p.lastChild),i||n)for(;ma(p);)r.before(ma(p));else r.before(p)}}})}const pk=[...`
3
3
  \r\f \v\uFEFF`];function gW(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||pk.includes(i[r-1]))&&(a===i.length||pk.includes(i[a]))?i=(r===0?"":i.substring(0,r))+i.substring(a+1):r=a}}return i===""?null:i}function mk(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 Zy(o){return o[0]!=="-"||o[1]!=="-"?o.toLowerCase():o}function fW(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,c=[];i&&c.push(...Object.keys(i).map(Zy)),n&&c.push(...Object.keys(n).map(Zy));var h=0,g=-1;const w=o.length;for(var f=0;f<w;f++){var p=o[f];if(a?p==="/"&&o[f-1]==="*"&&(a=!1):s?s===p&&(s=!1):p==="/"&&o[f+1]==="*"?a=!0:p==='"'||p==="'"?s=p:p==="("?r++:p===")"&&r--,!a&&s===!1&&r===0){if(p===":"&&g===-1)g=f;else if(p===";"||f===w-1){if(g!==-1){var v=Zy(o.substring(h,g).trim());if(!c.includes(v)){p!==";"&&f++;var _=o.substring(h,f).trim();t+=" "+_+";"}}h=f+1,g=-1}}}}return i&&(t+=mk(i)),n&&(t+=mk(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[eS];if(r!==t||r===void 0){var a=gW(t,i,s);a==null?o.removeAttribute("class"):e?o.className=a:o.setAttribute("class",a),o[eS]=t}else if(s&&n!==s)for(var c in s){var h=!!s[c];(n==null||h!==!!n[c])&&o.classList.toggle(c,h)}return s}function Xy(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 zo(o,e,t,i){var n=o[tS];if(n!==e){var s=fW(e,i);s==null?o.removeAttribute("style"):o.style.cssText=s,o[tS]=e}else i&&(Array.isArray(i)?(Xy(o,t==null?void 0:t[0],i[0]),Xy(o,t==null?void 0:t[1],i[1],"important")):Xy(o,t,i));return i}function cT(o,e,t=!1){if(o.multiple){if(e==null)return;if(!W0(e))return bH();for(var i of o.options)i.selected=e.includes(mf(i));return}for(i of o.options){var n=mf(i);if(UH(n,e)){i.selected=!0;return}}(!t||e!==void 0)&&(o.selectedIndex=-1)}function pW(o){var e=new MutationObserver(()=>{cT(o,o.__value)});e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),q0(()=>{e.disconnect()})}function ha(o,e,t=e){var i=new WeakSet,n=!0;U0(o,"change",s=>{var r=s?"[selected]":":checked",a;if(o.multiple)a=[].map.call(o.querySelectorAll(r),mf);else{var c=o.querySelector(r)??o.querySelector("option:not([disabled])");a=c&&mf(c)}t(a),o.__value=a,di!==null&&i.add(di)}),K0(()=>{var s=e();if(o===document.activeElement){var r=di;if(i.has(r))return}if(cT(o,s,n),n&&s===void 0){var a=o.querySelector(":checked");a!==null&&(s=mf(a),t(s))}o.__value=s,n=!1}),pW(o)}function mf(o){return"__value"in o?o.__value:o.value}const mW=Symbol("is custom element"),_W=Symbol("is html");function Yy(o,e){var t=dT(o);t.checked!==(t.checked=e??void 0)&&(o.checked=e)}function Hn(o,e,t,i){var n=dT(o);n[e]!==(n[e]=t)&&(e==="loading"&&(o[GF]=t),t==null?o.removeAttribute(e):typeof t!="string"&&vW(o).includes(e)?o[e]=t:o.setAttribute(e,t))}function dT(o){return o[Ym]??(o[Ym]={[mW]:o.nodeName.includes("-"),[_W]:o.namespaceURI===SP})}var _k=new Map;function vW(o){var e=o.getAttribute("is")||o.nodeName,t=_k.get(e);if(t)return t;_k.set(e,t=[]);for(var i,n=o,s=Element.prototype;s!==n;){i=zF(n);for(var r in i)i[r].set&&r!=="innerHTML"&&r!=="textContent"&&r!=="innerText"&&t.push(r);n=_P(n)}return t}function Ei(o,e,t=e){var i=new WeakSet;U0(o,"input",async n=>{var s=n?o.defaultValue:o.value;if(s=Jy(o)?Qy(s):s,t(s),di!==null&&i.add(di),await lS(),s!==(s=e())){var r=o.selectionStart,a=o.selectionEnd,c=o.value.length;if(o.value=s??"",a!==null){var h=o.value.length;r===a&&a===c&&h>c?(o.selectionStart=h,o.selectionEnd=h):(o.selectionStart=r,o.selectionEnd=Math.min(a,h))}}}),_l(e)==null&&o.value&&(t(Jy(o)?Qy(o.value):o.value),di!==null&&i.add(di)),sy(()=>{var n=e();if(o===document.activeElement){var s=di;if(i.has(s))return}Jy(o)&&n===Qy(o.value)||o.type==="date"&&!n&&!o.value||n!==o.value&&(o.value=n??"")})}function qs(o,e,t=e){U0(o,"change",i=>{var n=i?o.defaultChecked:o.checked;t(n)}),_l(e)==null&&t(o.checked),sy(()=>{var i=e();o.checked=!!i})}function Jy(o){var e=o.type;return e==="number"||e==="range"}function Qy(o){return o===""?null:+o}var Ol,Du,xp,jv,hT;const Uv=class Uv{constructor(e){Ii(this,jv);Ii(this,Ol,new WeakMap);Ii(this,Du);Ii(this,xp);Di(this,xp,e)}observe(e,t){var i=Q(this,Ol).get(e)||new Set;return i.add(t),Q(this,Ol).set(e,i),yn(this,jv,hT).call(this).observe(e,Q(this,xp)),()=>{var n=Q(this,Ol).get(e);n.delete(t),n.size===0&&(Q(this,Ol).delete(e),Q(this,Du).unobserve(e))}}};Ol=new WeakMap,Du=new WeakMap,xp=new WeakMap,jv=new WeakSet,hT=function(){return Q(this,Du)??Di(this,Du,new ResizeObserver(e=>{for(var t of e){Uv.entries.set(t.target,t);for(var i of Q(this,Ol).get(t.target)||[])i(t)}}))},Fi(Uv,"entries",new WeakMap);let uS=Uv;var bW=new uS({box:"border-box"});function yW(o,e,t){var i=bW.observe(o,()=>t(o[e]));K0(()=>(_l(()=>t(o[e])),i))}function ew(o,e){return o===e||(o==null?void 0:o[Yc])===e}function Ss(o={},e,t,i){var n=Hs.r,s=Qi;return K0(()=>{var r,a;return sy(()=>{r=a,a=[],_l(()=>{ew(t(...a),o)||(e(o,...a),r&&ew(t(...r),o)&&e(null,...r))})}),()=>{let c=s;for(;c!==n&&c.parent!==null&&c.parent.f&Qw;)c=c.parent;const h=()=>{a&&ew(t(...a),o)&&e(null,...a)},g=c.teardown;c.teardown=()=>{h(),g==null||g()}}}),o}function eg(o,e,t,i){var z;var n=!0,s=(t&uH)!==0,r=(t&gH)!==0,a=i,c=!0,h=void 0,g=()=>r&&n?(h??(h=Vf(i)),u(h)):(c&&(c=!1,a=r?_l(i):i),a);let f;if(s){var p=Yc in o||KF in o;f=((z=mu(o,e))==null?void 0:z.set)??(p&&e in o?F=>o[e]=F:void 0)}var v,_=!1;s?[v,_]=LH(()=>o[e]):v=o[e],v===void 0&&i!==void 0&&(v=g(),f&&(tH(),f(v)));var w;if(w=()=>{var F=o[e];return F===void 0?g():(c=!0,F)},(t&hH)===0)return w;if(f){var S=o.$$legacy;return(function(F,ie){return arguments.length>0?((!ie||S||_)&&f(ie?w():F),F):w()})}var D=!1,P=((t&dH)!==0?Vf:OP)(()=>(D=!1,w()));s&&u(P);var N=Qi;return(function(F,ie){if(arguments.length>0){const Y=ie?u(P):s?wi(F):F;return I(P,Y),D=!0,a!==void 0&&(a=Y),F}return al&&D||(N.f&dr)!==0?P.v:u(P)})}function Vr(o){Hs===null&&yP(),Dn(()=>{const e=_l(o);if(typeof e=="function")return e})}function oy(o){Hs===null&&yP(),Vr(()=>()=>_l(o))}const wW="5";var BD;typeof window<"u"&&((BD=window.__svelte??(window.__svelte={})).v??(BD.v=new Set)).add(wW);/*!-----------------------------------------------------------------------------
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10,7 +10,7 @@ var sA=Object.defineProperty;var kL=o=>{throw TypeError(o)};var oA=(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 MW=Object.defineProperty,NW=Object.getOwnPropertyDescriptor,RW=Object.getOwnPropertyNames,AW=Object.prototype.hasOwnProperty,OW=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of RW(e))!AW.call(o,n)&&n!==t&&MW(o,n,{get:()=>e[n],enumerable:!(i=NW(e,n))||i.enumerable});return o},FW=(o,e,t)=>(OW(o,e,"default"),t),HW="5.4.5",tg={};FW(tg,VD);var fT=(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))(fT||{}),pT=(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))(pT||{}),mT=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(mT||{}),_T=(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))(_T||{}),vT=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(vT||{}),bT=class{constructor(o,e,t,i,n){this._onDidChange=new tg.Emitter,this._onDidExtraLibsChange=new tg.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)}},WW=HW,yT={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},wT=new bT({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},yT),ST=new bT({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},yT),BW=()=>ry().then(o=>o.getTypeScriptWorker()),zW=()=>ry().then(o=>o.getJavaScriptWorker());tg.languages.typescript={ModuleKind:fT,JsxEmit:pT,NewLineKind:mT,ScriptTarget:_T,ModuleResolutionKind:vT,typescriptVersion:WW,typescriptDefaults:wT,javascriptDefaults:ST,getTypeScriptWorker:BW,getJavaScriptWorker:zW};function ry(){return zD(()=>import("./tsMode-BgnpB8sV.js"),__vite__mapDeps([3,1,2]))}tg.languages.onLanguage("typescript",()=>ry().then(o=>o.setupTypeScript(wT)));tg.languages.onLanguage("javascript",()=>ry().then(o=>o.setupJavaScript(ST)));class VW extends Ys{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:vt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:ei.map,toggled:re.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:re.has("isInDiffEditor"),menu:{when:re.has("isInDiffEditor"),id:Qe.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Cn),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class CT extends Ys{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:vt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:re.has("isInDiffEditor")})}run(e,...t){const i=e.get(Cn),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class xT extends Ys{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:vt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:re.has("isInDiffEditor")})}run(e,...t){const i=e.get(Cn),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const $p=vt("diffEditor","Diff Editor");class jW extends Or{constructor(){super({id:"diffEditor.switchSide",title:vt("switchSide","Switch Side"),icon:ei.arrowSwap,precondition:re.has("isInDiffEditor"),f1:!0,category:$p})}runEditorCommand(e,t,i){const n=Cg(e);if(n instanceof Lp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class UW extends Or{constructor(){super({id:"diffEditor.exitCompareMove",title:vt("exitCompareMove","Exit Compare Move"),icon:ei.close,precondition:M.comparingMovedCode,f1:!1,category:$p,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Cg(e);n instanceof Lp&&n.exitCompareMove()}}class $W extends Or{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:vt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:ei.fold,precondition:re.has("isInDiffEditor"),f1:!0,category:$p})}runEditorCommand(e,t,...i){const n=Cg(e);n instanceof Lp&&n.collapseAllUnchangedRegions()}}class qW extends Or{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:vt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:ei.unfold,precondition:re.has("isInDiffEditor"),f1:!0,category:$p})}runEditorCommand(e,t,...i){const n=Cg(e);n instanceof Lp&&n.showAllUnchangedRegions()}}class gS extends Ys{constructor(){super({id:"diffEditor.revert",title:vt("revert","Revert"),f1:!1,category:$p})}run(e,t){const i=KW(e,t.originalUri,t.modifiedUri);i instanceof Lp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const LT=vt("accessibleDiffViewer","Accessible Diff Viewer"),$v=class $v extends Ys{constructor(){super({id:$v.id,title:vt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:LT,precondition:re.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Cg(e);t==null||t.accessibleDiffViewerNext()}};$v.id="editor.action.accessibleDiffViewer.next";let Uf=$v;const qv=class qv extends Ys{constructor(){super({id:qv.id,title:vt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:LT,precondition:re.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Cg(e);t==null||t.accessibleDiffViewerPrev()}};qv.id="editor.action.accessibleDiffViewer.prev";let R_=qv;function KW(o,e,t){return o.get(Yn).listDiffEditors().find(s=>{var c,h;const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&((c=r.getModel())==null?void 0:c.uri.toString())===t.toString()&&a&&((h=a.getModel())==null?void 0:h.uri.toString())===e.toString()})||null}function Cg(o){const t=o.get(Yn).listDiffEditors(),i=jD();if(i)for(const n of t){const s=n.getContainerDomNode();if(GW(s,i))return n}return null}function GW(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}en(VW);en(CT);en(xT);hr.appendMenuItem(Qe.EditorTitle,{command:{id:new xT().desc.id,title:y("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:re.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:re.has("isInDiffEditor")},order:11,group:"1_diff",when:re.and(M.diffEditorRenderSideBySideInlineBreakpointReached,re.has("isInDiffEditor"))});hr.appendMenuItem(Qe.EditorTitle,{command:{id:new CT().desc.id,title:y("showMoves","Show Moved Code Blocks"),icon:ei.move,toggled:rA.create("config.diffEditor.experimental.showMoves",!0),precondition:re.has("isInDiffEditor")},order:10,group:"1_diff",when:re.has("isInDiffEditor")});en(gS);for(const o of[{icon:ei.arrowRight,key:M.diffEditorInlineMode.toNegated()},{icon:ei.discard,key:M.diffEditorInlineMode}])hr.appendMenuItem(Qe.DiffEditorHunkToolbar,{command:{id:new gS().desc.id,title:y("revertHunk","Revert Block"),icon:o.icon},when:re.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),hr.appendMenuItem(Qe.DiffEditorSelectionToolbar,{command:{id:new gS().desc.id,title:y("revertSelection","Revert Selection"),icon:o.icon},when:re.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"});en(jW);en(UW);en($W);en(qW);hr.appendMenuItem(Qe.EditorTitle,{command:{id:Uf.id,title:y("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:re.has("isInDiffEditor")},order:10,group:"2_diff",when:re.and(M.accessibleDiffViewerVisible.negate(),re.has("isInDiffEditor"))});mn.registerCommandAlias("editor.action.diffReview.next",Uf.id);en(Uf);mn.registerCommandAlias("editor.action.diffReview.prev",R_.id);en(R_);var ZW=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},XW=function(o,e){return function(t,i){e(t,i,o)}},fS;const ay=new Pi("selectionAnchorSet",!1);var od;let pc=(od=class{static get(e){return e.getContribution(fS.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=ay.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(jt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Ns().appendText(y("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ur(y("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(jt.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()}},fS=od,od.ID="editor.contrib.selectionAnchorController",od);pc=fS=ZW([XW(1,Wi)],pc);class YW extends ye{constructor(){super({id:"editor.action.setSelectionAnchor",label:y("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:ts(2089,2080),weight:100}})}async run(e,t){var i;(i=pc.get(t))==null||i.setSelectionAnchor()}}class JW extends ye{constructor(){super({id:"editor.action.goToSelectionAnchor",label:y("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:ay})}async run(e,t){var i;(i=pc.get(t))==null||i.goToSelectionAnchor()}}class QW extends ye{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:y("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:ay,kbOpts:{kbExpr:M.editorTextFocus,primary:ts(2089,2089),weight:100}})}async run(e,t){var i;(i=pc.get(t))==null||i.selectFromAnchorToCursor()}}class e3 extends ye{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:y("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:ay,kbOpts:{kbExpr:M.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=pc.get(t))==null||i.cancelSelectionAnchor()}}vi(pc.ID,pc,4);se(YW);se(JW);se(QW);se(e3);const t3=ut("editorOverviewRuler.bracketMatchForeground","#A0A0A0",y("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class i3 extends ye{constructor(){super({id:"editor.action.jumpToBracket",label:y("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Yd.get(t))==null||i.jumpToBracket()}}class n3 extends ye{constructor(){super({id:"editor.action.selectToBracket",label:y("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:vt("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=Yd.get(t))==null||s.selectToBracket(n)}}class s3 extends ye{constructor(){super({id:"editor.action.removeBrackets",label:y("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Yd.get(t))==null||i.removeBrackets(this.id)}}class o3{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const El=class El extends ze{static get(e){return e.getContribution(El.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new rs(()=>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 c=e.bracketPairs.findNextBracket(n);c&&c.range&&(r=c.range.getStartPosition())}}return r?new jt(r.lineNumber,r.column,r.lineNumber,r.column):new jt(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 h=t.bracketPairs.findNextBracket(s);h&&h.range&&(r=t.bracketPairs.matchBracket(h.range.getStartPosition()))}let a=null,c=null;if(r){r.sort(W.compareRangesUsingStarts);const[h,g]=r;if(a=e?h.getStartPosition():h.getEndPosition(),c=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(s)){const f=a;a=c,c=f}}a&&c&&i.push(new jt(a.lineNumber,a.column,c.lineNumber,c.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 f=0,p=e.length;f<p;f++){const v=e[f];v.isEmpty()&&(s[r++]=v.getStartPosition())}s.length>1&&s.sort(St.compare);const a=[];let c=0,h=0;const g=n.length;for(let f=0,p=s.length;f<p;f++){const v=s[f];for(;h<g&&n[h].position.isBefore(v);)h++;if(h<g&&n[h].position.equals(v))a[c++]=n[h];else{let _=t.bracketPairs.matchBracket(v,20),w=El._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(v,20),w=El._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[c++]=new o3(v,_,w)}}this._lastBracketsData=a,this._lastVersionId=i}};El.ID="editor.contrib.bracketMatchingController",El._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=xi.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ss(t3),position:va.Center}}),El._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=xi.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Yd=El;vi(Yd.ID,Yd,1);se(n3);se(i3);se(s3);hr.appendMenuItem(Qe.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:y({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class r3{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 W(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new W(i,s,i,s),a)}else{const r=new W(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new W(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new jt(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new jt(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class kT extends ye{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 r3(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class a3 extends kT{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:y("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:M.writable})}}class l3 extends kT{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:y("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:M.writable})}}se(a3);se(l3);class c3 extends ye{constructor(){super({id:"editor.action.transposeLetters",label:y("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:M.writable,kbOpts:{kbExpr:M.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,c=r.startColumn,h=i.getLineMaxColumn(a);if(a===1&&(c===1||c===2&&h===2))continue;const g=c===h?r.getPosition():Wy.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),f=Wy.leftPosition(i,g),p=Wy.leftPosition(i,f),v=i.getValueInRange(W.fromPositions(p,f)),_=i.getValueInRange(W.fromPositions(f,g)),w=W.fromPositions(p,g);n.push(new kp(w,_+v))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}se(c3);const ly=(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 Y0(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function d3(o,e,t){const i={id:ly(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class IT{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 Xa.some(this,([i,n])=>n.asFile())&&t.push("files"),ET(A_(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 A_(e)}}function A_(o){return o.toLowerCase()}function DT(o,e){return ET(A_(o),e.map(A_))}function ET(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 cy=Object.freeze({create:o=>UD(o.map(e=>e.toString())).join(`\r
13
+ *-----------------------------------------------------------------------------*/var MW=Object.defineProperty,NW=Object.getOwnPropertyDescriptor,RW=Object.getOwnPropertyNames,AW=Object.prototype.hasOwnProperty,OW=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of RW(e))!AW.call(o,n)&&n!==t&&MW(o,n,{get:()=>e[n],enumerable:!(i=NW(e,n))||i.enumerable});return o},FW=(o,e,t)=>(OW(o,e,"default"),t),HW="5.4.5",tg={};FW(tg,VD);var fT=(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))(fT||{}),pT=(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))(pT||{}),mT=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(mT||{}),_T=(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))(_T||{}),vT=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(vT||{}),bT=class{constructor(o,e,t,i,n){this._onDidChange=new tg.Emitter,this._onDidExtraLibsChange=new tg.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)}},WW=HW,yT={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},wT=new bT({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},yT),ST=new bT({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},yT),BW=()=>ry().then(o=>o.getTypeScriptWorker()),zW=()=>ry().then(o=>o.getJavaScriptWorker());tg.languages.typescript={ModuleKind:fT,JsxEmit:pT,NewLineKind:mT,ScriptTarget:_T,ModuleResolutionKind:vT,typescriptVersion:WW,typescriptDefaults:wT,javascriptDefaults:ST,getTypeScriptWorker:BW,getJavaScriptWorker:zW};function ry(){return zD(()=>import("./tsMode-BfGVy5xb.js"),__vite__mapDeps([3,1,2]))}tg.languages.onLanguage("typescript",()=>ry().then(o=>o.setupTypeScript(wT)));tg.languages.onLanguage("javascript",()=>ry().then(o=>o.setupJavaScript(ST)));class VW extends Ys{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:vt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:ei.map,toggled:re.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:re.has("isInDiffEditor"),menu:{when:re.has("isInDiffEditor"),id:Qe.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Cn),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class CT extends Ys{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:vt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:re.has("isInDiffEditor")})}run(e,...t){const i=e.get(Cn),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class xT extends Ys{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:vt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:re.has("isInDiffEditor")})}run(e,...t){const i=e.get(Cn),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const $p=vt("diffEditor","Diff Editor");class jW extends Or{constructor(){super({id:"diffEditor.switchSide",title:vt("switchSide","Switch Side"),icon:ei.arrowSwap,precondition:re.has("isInDiffEditor"),f1:!0,category:$p})}runEditorCommand(e,t,i){const n=Cg(e);if(n instanceof Lp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class UW extends Or{constructor(){super({id:"diffEditor.exitCompareMove",title:vt("exitCompareMove","Exit Compare Move"),icon:ei.close,precondition:M.comparingMovedCode,f1:!1,category:$p,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Cg(e);n instanceof Lp&&n.exitCompareMove()}}class $W extends Or{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:vt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:ei.fold,precondition:re.has("isInDiffEditor"),f1:!0,category:$p})}runEditorCommand(e,t,...i){const n=Cg(e);n instanceof Lp&&n.collapseAllUnchangedRegions()}}class qW extends Or{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:vt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:ei.unfold,precondition:re.has("isInDiffEditor"),f1:!0,category:$p})}runEditorCommand(e,t,...i){const n=Cg(e);n instanceof Lp&&n.showAllUnchangedRegions()}}class gS extends Ys{constructor(){super({id:"diffEditor.revert",title:vt("revert","Revert"),f1:!1,category:$p})}run(e,t){const i=KW(e,t.originalUri,t.modifiedUri);i instanceof Lp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const LT=vt("accessibleDiffViewer","Accessible Diff Viewer"),$v=class $v extends Ys{constructor(){super({id:$v.id,title:vt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:LT,precondition:re.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Cg(e);t==null||t.accessibleDiffViewerNext()}};$v.id="editor.action.accessibleDiffViewer.next";let Uf=$v;const qv=class qv extends Ys{constructor(){super({id:qv.id,title:vt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:LT,precondition:re.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Cg(e);t==null||t.accessibleDiffViewerPrev()}};qv.id="editor.action.accessibleDiffViewer.prev";let R_=qv;function KW(o,e,t){return o.get(Yn).listDiffEditors().find(s=>{var c,h;const r=s.getModifiedEditor(),a=s.getOriginalEditor();return r&&((c=r.getModel())==null?void 0:c.uri.toString())===t.toString()&&a&&((h=a.getModel())==null?void 0:h.uri.toString())===e.toString()})||null}function Cg(o){const t=o.get(Yn).listDiffEditors(),i=jD();if(i)for(const n of t){const s=n.getContainerDomNode();if(GW(s,i))return n}return null}function GW(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}en(VW);en(CT);en(xT);hr.appendMenuItem(Qe.EditorTitle,{command:{id:new xT().desc.id,title:y("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:re.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:re.has("isInDiffEditor")},order:11,group:"1_diff",when:re.and(M.diffEditorRenderSideBySideInlineBreakpointReached,re.has("isInDiffEditor"))});hr.appendMenuItem(Qe.EditorTitle,{command:{id:new CT().desc.id,title:y("showMoves","Show Moved Code Blocks"),icon:ei.move,toggled:rA.create("config.diffEditor.experimental.showMoves",!0),precondition:re.has("isInDiffEditor")},order:10,group:"1_diff",when:re.has("isInDiffEditor")});en(gS);for(const o of[{icon:ei.arrowRight,key:M.diffEditorInlineMode.toNegated()},{icon:ei.discard,key:M.diffEditorInlineMode}])hr.appendMenuItem(Qe.DiffEditorHunkToolbar,{command:{id:new gS().desc.id,title:y("revertHunk","Revert Block"),icon:o.icon},when:re.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),hr.appendMenuItem(Qe.DiffEditorSelectionToolbar,{command:{id:new gS().desc.id,title:y("revertSelection","Revert Selection"),icon:o.icon},when:re.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"});en(jW);en(UW);en($W);en(qW);hr.appendMenuItem(Qe.EditorTitle,{command:{id:Uf.id,title:y("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:re.has("isInDiffEditor")},order:10,group:"2_diff",when:re.and(M.accessibleDiffViewerVisible.negate(),re.has("isInDiffEditor"))});mn.registerCommandAlias("editor.action.diffReview.next",Uf.id);en(Uf);mn.registerCommandAlias("editor.action.diffReview.prev",R_.id);en(R_);var ZW=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},XW=function(o,e){return function(t,i){e(t,i,o)}},fS;const ay=new Pi("selectionAnchorSet",!1);var od;let pc=(od=class{static get(e){return e.getContribution(fS.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=ay.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(jt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Ns().appendText(y("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ur(y("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(jt.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()}},fS=od,od.ID="editor.contrib.selectionAnchorController",od);pc=fS=ZW([XW(1,Wi)],pc);class YW extends ye{constructor(){super({id:"editor.action.setSelectionAnchor",label:y("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:ts(2089,2080),weight:100}})}async run(e,t){var i;(i=pc.get(t))==null||i.setSelectionAnchor()}}class JW extends ye{constructor(){super({id:"editor.action.goToSelectionAnchor",label:y("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:ay})}async run(e,t){var i;(i=pc.get(t))==null||i.goToSelectionAnchor()}}class QW extends ye{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:y("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:ay,kbOpts:{kbExpr:M.editorTextFocus,primary:ts(2089,2089),weight:100}})}async run(e,t){var i;(i=pc.get(t))==null||i.selectFromAnchorToCursor()}}class e3 extends ye{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:y("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:ay,kbOpts:{kbExpr:M.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=pc.get(t))==null||i.cancelSelectionAnchor()}}vi(pc.ID,pc,4);se(YW);se(JW);se(QW);se(e3);const t3=ut("editorOverviewRuler.bracketMatchForeground","#A0A0A0",y("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class i3 extends ye{constructor(){super({id:"editor.action.jumpToBracket",label:y("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Yd.get(t))==null||i.jumpToBracket()}}class n3 extends ye{constructor(){super({id:"editor.action.selectToBracket",label:y("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:vt("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=Yd.get(t))==null||s.selectToBracket(n)}}class s3 extends ye{constructor(){super({id:"editor.action.removeBrackets",label:y("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Yd.get(t))==null||i.removeBrackets(this.id)}}class o3{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const El=class El extends ze{static get(e){return e.getContribution(El.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new rs(()=>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 c=e.bracketPairs.findNextBracket(n);c&&c.range&&(r=c.range.getStartPosition())}}return r?new jt(r.lineNumber,r.column,r.lineNumber,r.column):new jt(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 h=t.bracketPairs.findNextBracket(s);h&&h.range&&(r=t.bracketPairs.matchBracket(h.range.getStartPosition()))}let a=null,c=null;if(r){r.sort(W.compareRangesUsingStarts);const[h,g]=r;if(a=e?h.getStartPosition():h.getEndPosition(),c=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(s)){const f=a;a=c,c=f}}a&&c&&i.push(new jt(a.lineNumber,a.column,c.lineNumber,c.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 f=0,p=e.length;f<p;f++){const v=e[f];v.isEmpty()&&(s[r++]=v.getStartPosition())}s.length>1&&s.sort(St.compare);const a=[];let c=0,h=0;const g=n.length;for(let f=0,p=s.length;f<p;f++){const v=s[f];for(;h<g&&n[h].position.isBefore(v);)h++;if(h<g&&n[h].position.equals(v))a[c++]=n[h];else{let _=t.bracketPairs.matchBracket(v,20),w=El._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(v,20),w=El._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[c++]=new o3(v,_,w)}}this._lastBracketsData=a,this._lastVersionId=i}};El.ID="editor.contrib.bracketMatchingController",El._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=xi.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ss(t3),position:va.Center}}),El._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=xi.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Yd=El;vi(Yd.ID,Yd,1);se(n3);se(i3);se(s3);hr.appendMenuItem(Qe.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:y({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class r3{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 W(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new W(i,s,i,s),a)}else{const r=new W(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new W(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new jt(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new jt(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class kT extends ye{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 r3(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class a3 extends kT{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:y("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:M.writable})}}class l3 extends kT{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:y("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:M.writable})}}se(a3);se(l3);class c3 extends ye{constructor(){super({id:"editor.action.transposeLetters",label:y("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:M.writable,kbOpts:{kbExpr:M.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,c=r.startColumn,h=i.getLineMaxColumn(a);if(a===1&&(c===1||c===2&&h===2))continue;const g=c===h?r.getPosition():Wy.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),f=Wy.leftPosition(i,g),p=Wy.leftPosition(i,f),v=i.getValueInRange(W.fromPositions(p,f)),_=i.getValueInRange(W.fromPositions(f,g)),w=W.fromPositions(p,g);n.push(new kp(w,_+v))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}se(c3);const ly=(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 Y0(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function d3(o,e,t){const i={id:ly(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class IT{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 Xa.some(this,([i,n])=>n.asFile())&&t.push("files"),ET(A_(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 A_(e)}}function A_(o){return o.toLowerCase()}function DT(o,e){return ET(A_(o),e.map(A_))}function ET(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 cy=Object.freeze({create:o=>UD(o.map(e=>e.toString())).join(`\r
14
14
  `),split:o=>o.split(`\r
15
15
  `),parse:o=>cy.split(o).filter(e=>!e.startsWith("#"))}),ia=class ia{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+ia.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new ia((this.value?[this.value,...e]:e).join(ia.sep))}};ia.sep=".",ia.None=new ia("@@none@@"),ia.Empty=new ia("");let Sn=ia;const vk={EDITORS:"CodeEditors",FILES:"CodeFiles"};class h3{}const u3={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Fr.add(u3.DragAndDropContribution,new h3);const If=class If{constructor(){}static getInstance(){return If.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};If.INSTANCE=new If;let pS=If;function PT(o){const e=new IT;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,Y0(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,g3(n))}}return e}function g3(o){const e=o.path?nn.parse(o.path):void 0;return d3(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const f3=Object.freeze([vk.EDITORS,vk.FILES,Fw.RESOURCES,Fw.INTERNAL_URI_LIST]);function TT(o,e=!1){const t=PT(o),i=t.get(Fw.INTERNAL_URI_LIST);if(i)t.replace(ms.uriList,i);else if(e||!t.has(ms.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(nn.file(a).toString()):n.push(nn.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(ms.uriList,Y0(cy.create(n)))}for(const n of f3)t.delete(n);return t}var J0=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},$f=function(o,e){return function(t,i){e(t,i,o)}};class Q0{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 Df=class Df extends Q0{constructor(){super(...arguments),this.kind=Df.kind,this.dropMimeTypes=[ms.text],this.pasteMimeTypes=[ms.text]}async getEdit(e,t){const i=e.get(ms.text);if(!i||e.has(ms.uriList))return;const n=await i.asString();return{handledMimeType:ms.text,title:y("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};Df.id="text",Df.kind=new Sn("text.plain");let Jd=Df;class MT extends Q0{constructor(){super(...arguments),this.kind=new Sn("uri.absolute"),this.dropMimeTypes=[ms.uriList],this.pasteMimeTypes=[ms.uriList]}async getEdit(e,t){const i=await NT(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:c})=>a.scheme===$s.file?a.fsPath:(n++,c)).join(" ");let r;return n>0?r=i.length>1?y("defaultDropProvider.uriList.uris","Insert Uris"):y("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?y("defaultDropProvider.uriList.paths","Insert Paths"):y("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:ms.uriList,insertText:s,title:r,kind:this.kind}}}let O_=class extends Q0{constructor(e){super(),this._workspaceContextService=e,this.kind=new Sn("uri.relative"),this.dropMimeTypes=[ms.uriList],this.pasteMimeTypes=[ms.uriList]}async getEdit(e,t){const i=await NT(e);if(!i.length||t.isCancellationRequested)return;const n=il(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?aA(r.uri,s):void 0}));if(n.length)return{handledMimeType:ms.uriList,insertText:n.join(" "),title:i.length>1?y("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):y("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};O_=J0([$f(0,Wu)],O_);class p3{constructor(){this.kind=new Sn("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:ms.text}]}async provideDocumentPasteEdits(e,t,i,n,s){var c;if(n.triggerKind!==Hw.PasteAs&&!((c=n.only)!=null&&c.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:y("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function NT(o){const e=o.get(ms.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of cy.parse(t))try{i.push({uri:nn.parse(n),originalText:n})}catch{}return i}let mS=class extends ze{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new Jd)),this._register(e.documentDropEditProvider.register("*",new MT)),this._register(e.documentDropEditProvider.register("*",new O_(t)))}};mS=J0([$f(0,Ct),$f(1,Wu)],mS);let _S=class extends ze{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Jd)),this._register(e.documentPasteEditProvider.register("*",new MT)),this._register(e.documentPasteEditProvider.register("*",new O_(t))),this._register(e.documentPasteEditProvider.register("*",new p3))}};_S=J0([$f(0,Ct),$f(1,Wu)],_S);const Zo=class Zo{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=Zo._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(Zo.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(Zo.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(Zo.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(Zo.isVariableCharacter(i)||Zo.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 Zo._table[i]>"u"&&!Zo.isDigitCharacter(i)&&!Zo.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};Zo._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let vS=Zo;class xg{constructor(){this._children=[]}appendChild(e){return e instanceof so&&this._children[this._children.length-1]instanceof so?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,c){for(const h of a)h.parent=c,r(h.children,h)})(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 qp)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}let so=class RT extends xg{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new RT(this.value)}};class AT extends xg{}class Bo extends AT{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 Lg?this._children[0]:void 0}clone(){const e=new Bo(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Lg extends xg{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof so&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Lg;return this.options.forEach(e.appendChild,e),e}}class e1 extends xg{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 xr&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof xr){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new e1;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 xr extends xg{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 xr(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class qf extends AT{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 so(t)],!0):!1}clone(){const e=new qf(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function bk(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class qp extends xg{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Bo&&(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 bk([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Bo&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof qf&&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 qp;return this._children=this.children.map(t=>t.clone()),e}walk(e){bk(this.children,e)}}class Qd{constructor(){this._scanner=new vS,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 qp;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(c=>(c instanceof Bo&&(c.isFinalTabstop?n.set(0,void 0):!n.has(c.index)&&c.children.length>0?n.set(c.index,c.children):s.push(c)),!0));const r=(c,h)=>{const g=n.get(c.index);if(!g)return;const f=new Bo(c.index);f.transform=c.transform;for(const p of g){const v=p.clone();f.appendChild(v),v instanceof Bo&&n.has(v.index)&&!h.has(v.index)&&(h.add(v.index),r(v,h),h.delete(v.index))}t.replace(c,[f])},a=new Set;for(const c of s)r(c,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 Bo(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 so(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 Bo(Number(t)):new qf(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 Bo(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new so("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new Lg;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 so(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 qf(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new so("${"+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 e1;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 so(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 xr(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new xr(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 xr(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new xr(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new xr(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 xr(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new xr(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new so(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function OT(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 lA(o,{range:s,text:typeof t.insertText=="string"?Qd.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function FT(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 c of o)if(c!==r&&e(a,c)){let h=t.get(r);h||(h=[],t.set(r,h)),h.push(c)}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 c=[];const h=t.get(a);return h&&(n.push(a),c=s(h),n.pop()),i.add(a),[...c,a,...s(r.slice(1))]}return s(Array.from(o))}var m3=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},_3=function(o,e){return function(t,i){e(t,i,o)}};const v3=xi.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:$D,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),Kv=class Kv extends ze{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=ht(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ht("span.icon");this.domNode.append(t),t.classList.add(...$i.asClassNameArray(ei.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(Hi(this.domNode,Tn.CLICK,n=>{this.delegate.cancel()}))}getId(){return Kv.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)}};Kv.baseId="editor.widget.inlineProgressWidget";let bS=Kv,F_=class extends ze{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Lo),this._currentWidget=this._register(new Lo),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=Tf(()=>{const a=W.fromPositions(e);this._currentDecorations.set([{range:a,options:v3}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(bS,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()}};F_=m3([_3(2,ci)],F_);var b3=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},yk=function(o,e){return function(t,i){e(t,i,o)}},n_,Zl;let ro=(Zl=class{static get(e){return e.getContribution(n_.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Lo,this._messageListeners=new We,this._mouseOverMessage=!1,this._editor=e,this._visible=n_.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){ur(qm(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=qm(e)?cA(e,{actionHandler:{callback:n=>{this.closeMessage(),dA(this._openerService,n,qm(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new wk(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(os.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&hA(jD(),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(Hi(this._messageWidget.value.getDomNode(),Tn.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(Hi(this._messageWidget.value.getDomNode(),Tn.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 W(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(wk.fadeOut(this._messageWidget.value))}},n_=Zl,Zl.ID="editor.contrib.messageController",Zl.MESSAGE_VISIBLE=new Pi("messageVisible",!1,y("messageVisible","Whether the editor is currently showing an inline message")),Zl);ro=n_=b3([yk(1,Wi),yk(2,Hr)],ro);const y3=Js.bindToContribution(ro.get);Lt(new y3({id:"leaveEditorMessage",precondition:ro.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let wk=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)}};vi(ro.ID,ro,4);function tw(o,e){return e&&(o.stack||o.stacktrace)?y("stackTrace.format","{0}: {1}",Ck(o),Sk(o.stack)||Sk(o.stacktrace)):Ck(o)}function Sk(o){return Array.isArray(o)?o.join(`
16
16
  `):o}function Ck(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"?y("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||y("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function H_(o=null,e=!1){if(!o)return y("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=il(o),i=H_(t[0],e);return t.length>1?y("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(qD(o))return o;if(o.detail){const t=o.detail;if(t.error)return tw(t.error,e);if(t.exception)return tw(t.exception,e)}return o.stack?tw(o,e):o.message?o.message:y("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var HT=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},vu=function(o,e){return function(t,i){e(t,i,o)}},yS,rd;let wS=(rd=class extends ze{constructor(e,t,i,n,s,r,a,c,h,g){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=c,this._keybindingService=g,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(h),this.visibleContext.set(!0),this._register(wn(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(wn((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(f=>{s.containsPosition(f.position)||this.dispose()})),this._register(os.runAndSubscribe(g.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=ht(".post-edit-widget"),this.button=this._register(new uA(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(Hi(this.domNode,Tn.CLICK,()=>this.showSelector()))}getId(){return yS.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Gs(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>gA({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},yS=rd,rd.baseId="editor.widget.postEditWidget",rd);wS=yS=HT([vu(7,mg),vu(8,Wi),vu(9,is)],wS);let W_=class extends ze{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 Lo),this._register(os.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 c=async S=>{const D=this._editor.getModel();D&&(await D.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:S,allEdits:t.allEdits},i,n,s))},h=(S,D)=>{yc(S)||(this._notificationService.error(D),i&&this.show(e[0],t,c))};let g;try{g=await n(a,s)}catch(S){return h(S,y("resolveError",`Error resolving edit '{0}':
@@ -222,4 +222,4 @@ declare const she: {
222
222
  `).trim())}}return j}function _t($){return $.filter!==void 0||$.map!==void 0||$.reduce!==void 0}function pi($){const j=[];return $.filter!==void 0&&j.push("filter"),$.map!==void 0&&j.push("map"),$.reduce!==void 0&&j.push("reduce"),`Apply ${j.join(" + ")}`}const Rt=15;function Dt($){return $.split(`
223
223
  `).length>Rt}function kt($){const j=new Set(u(p));j.has($)?j.delete($):j.add($),I(p,j,!0)}function qi($,j){if(Mn(j))try{return Av.highlight($,{language:"javascript"}).value}catch{}return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ki($){return Ln.parse($)}function Mn($){return!$||$==="js"||$==="javascript"}function cn($){navigator.clipboard.writeText($).catch(()=>{})}async function Vi(){if(I(v,!0),!(u(_)||u(w))){I(w,!0),I(S,"");try{I(_,await rR(u(f)||u(h).model),!0)}catch($){I(S,$.message,!0)}I(w,!1)}}function dn($){return $>=1e9?`${($/1e9).toFixed(1)} GB`:$>=1e6?`${($/1e6).toFixed(0)} MB`:`${$} B`}function hn($){const j=$.match(/\.([^.]+)$/);return j?j[1].toUpperCase():"?"}function Nn($){switch($){case"SH":case"BASH":return"$";case"MD":case"MARKDOWN":return"↓";case"JSON":case"JSONC":return"{}";default:return $}}function jn($){I(Y,u(Y).filter((j,K)=>K!==$),!0)}function xn(){Ae.click()}async function Rn($){if(!(!$||$.length===0))for(const j of Array.from($)){const K=await j.text();I(Y,[...u(Y),{name:j.name,content:K}],!0)}}function _n($){const j=$.target;Rn(j.files),j.value=""}function Un($){var j;$.preventDefault(),I(_e,!1),Rn(((j=$.dataTransfer)==null?void 0:j.files)??null)}function Ye($){var j;(j=$.dataTransfer)!=null&&j.types.includes("Files")&&($.preventDefault(),I(_e,!0))}function Ht(){I(_e,!1)}async function oi(){const $=u(r).trim();if(!(!$||u(a))){I(r,""),I(c,""),I(a,!0),I(n,[...u(n),{role:"user",content:$}],!0),D=new AbortController,I(Le,[],!0);try{await lR({messages:u(n),currentView:u(Me),context:u(mt),modelOverride:u(f)||void 0,extraFiles:u(Y).length>0?u(Y):void 0},j=>{I(s,(u(s)??"")+j)},D.signal,j=>{I(Le,[...u(Le),j],!0)}),I(n,[...u(n),{role:"assistant",content:u(s)??"",toolEvents:u(Le).length>0?[...u(Le)]:void 0}],!0),I(Le,[],!0)}catch(j){if(j.name==="AbortError"){const K=u(s);K!=null&&K.trim()&&I(n,[...u(n),{role:"assistant",content:K+`
224
224
 
225
- *[stopped]*`,toolEvents:u(Le).length>0?[...u(Le)]:void 0}],!0)}else I(c,j.message,!0)}finally{D=null,I(s,null),I(Le,[],!0),I(a,!1)}}}function Ut(){D==null||D.abort()}function mi($){$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),oi())}function An(){I(n,[],!0),I(c,"")}const un=["Write a view to list all document IDs","Write a view to sum a numeric property across all documents","Write a view that filters to a specific prefix and emits a field","Write a reduce that returns the maximum value","Explain how the current view works"];function ji($){I(r,$,!0),Tt==null||Tt.focus()}var sn=EZ(),Wn=wt(sn),Ni=C(Wn),on=x(C(Ni),2);{var Bn=$=>{var j=KG(),K=C(j);{var ue=De=>{var pe=Rr();X(()=>G(pe,`${u(h).provider??""} · ${(u(f)||u(h).model)??""}`)),T(De,pe)},le=De=>{var pe=Rr("Not configured");T(De,pe)};q(K,De=>{u(ct)?De(ue):De(le,-1)})}X(()=>Hn(j,"title",`Provider: ${u(h).provider??""}`)),T($,j)};q(on,$=>{u(h)&&$(Bn)})}var Jn=x(on,2);{var kn=$=>{var j=GG();oe("click",j,An),T($,j)};q(Jn,$=>{u(n).length>0&&$(kn)})}var Xi=x(Ni,2),On=C(Xi);{var rn=$=>{var j=ZG();T($,j)},Se=$=>{var j=JG(),K=C(j),ue=C(K);{var le=Fe=>{var lt=XG(),Ve=x(wt(lt)),Ke=C(Ve);X(()=>G(Ke,t().id)),T(Fe,lt)},De=Fe=>{var lt=Rr("No view selected. Ask a general sheDB view question.");T(Fe,lt)};q(ue,Fe=>{t()?Fe(le):Fe(De,-1)})}var pe=x(K,2);_i(pe,17,()=>un,En,(Fe,lt)=>{var Ve=YG(),Ke=C(Ve);X(()=>G(Ke,u(lt))),oe("click",Ve,()=>ji(u(lt))),T(Fe,Ve)}),T($,j)};q(On,$=>{u(ct)?u(n).length===0&&u(s)===null&&$(Se,1):$(rn)})}var Z=x(On,2);_i(Z,17,()=>u(n),En,($,j,K)=>{var ue=sZ(),le=C(ue);{var De=Fe=>{var lt=QG(),Ve=C(lt);X(()=>G(Ve,u(j).content)),T(Fe,lt)},pe=Fe=>{const lt=st(()=>Mt(u(j).content)),Ve=st(()=>ot(u(lt)));var Ke=nZ(),si=wt(Ke);{var A=Te=>{var me=MD();_i(me,21,()=>u(j).toolEvents,En,(xe,Ze)=>{var Ee=Ds(),ve=wt(Ee);{var At=we=>{var xt=PD(),$e=x(C(xt)),Vt=C($e);X(ai=>G(Vt,ai),[()=>u(Ze).name.replace(/_/g," ")]),T(we,xt)},Ne=we=>{var xt=TD(),$e=x(C(xt)),Vt=C($e);X(ai=>G(Vt,ai),[()=>u(Ze).name.replace(/_/g," ")]),T(we,xt)};q(ve,we=>{u(Ze).type==="tool_call"?we(At):we(Ne,-1)})}T(xe,Ee)}),T(Te,me)};q(si,Te=>{var me;(me=u(j).toolEvents)!=null&&me.length&&Te(A)})}var J=x(si,2),He=C(J);_i(He,17,()=>u(lt),En,(Te,me,xe)=>{var Ze=Ds(),Ee=wt(Ze);{var ve=Ne=>{var we=ND();Wl(we,()=>Ki(u(me).text),!0),T(Ne,we)},At=Ne=>{const we=st(()=>`${K}:${xe}`),xt=st(()=>Dt(u(me).text)),$e=st(()=>u(p).has(u(we))),Vt=st(()=>u(me).lang==="filter");var ai=tZ(),be=C(ai),qe=C(be),rt=C(qe),Wt=x(qe,2),tt=C(Wt),ui=x(be,2);let ri;var Ti=C(ui),Jt=C(Ti);Wl(Jt,()=>qi(u(me).text,u(me).lang??""),!0);var Bt=x(Ti,2);{var Ui=tn=>{var bn=eZ(),$n=C(bn);X(()=>G($n,u($e)?"▲ collapse":"▼ expand")),oe("click",bn,()=>kt(u(we))),T(tn,bn)};q(Bt,tn=>{u(xt)&&tn(Ui)})}X(()=>{G(rt,u(Vt)?"filter":u(me).lang),ri=Kt(ui,1,"code-body svelte-1twuiul",null,ri,{collapsed:u(xt)&&!u($e)})}),oe("click",tt,()=>cn(u(me).text)),T(Ne,ai)};q(Ee,Ne=>{u(me).type==="text"?Ne(ve):Ne(At,-1)})}T(Te,Ze)});var dt=x(He,2);{var it=Te=>{var me=iZ(),xe=C(me),Ze=C(xe);X(Ee=>G(Ze,Ee),[()=>pi(u(Ve))]),oe("click",xe,()=>e.onApplyView(u(Ve))),T(Te,me)},zt=st(()=>_t(u(Ve))&&e.onApplyView);q(dt,Te=>{u(zt)&&Te(it)})}T(Fe,Ke)};q(le,Fe=>{u(j).role==="user"?Fe(De):Fe(pe,-1)})}X(()=>Kt(ue,1,`message ${u(j).role??""}`,"svelte-1twuiul")),T($,ue)});var Pe=x(Z,2);{var at=$=>{var j=MD();_i(j,21,()=>u(Le),En,(K,ue)=>{var le=Ds(),De=wt(le);{var pe=lt=>{var Ve=PD(),Ke=x(C(Ve)),si=C(Ke);X(A=>G(si,A),[()=>u(ue).name.replace(/_/g," ")]),T(lt,Ve)},Fe=lt=>{var Ve=TD(),Ke=x(C(Ve)),si=C(Ke);X(A=>G(si,A),[()=>u(ue).name.replace(/_/g," ")]),T(lt,Ve)};q(De,lt=>{u(ue).type==="tool_call"?lt(pe):lt(Fe,-1)})}T(K,le)}),T($,j)};q(Pe,$=>{u(Le).length>0&&$(at)})}var It=x(Pe,2);{var $t=$=>{var j=oZ(),K=C(j),ue=C(K),le=C(ue);X(()=>G(le,N[u(P)])),T($,j)};q(It,$=>{u(a)&&u(s)===null&&u(Le).length===0&&$($t)})}var H=x(It,2);{var O=$=>{var j=aZ(),K=C(j);_i(K,21,()=>je(u(s)),En,(ue,le)=>{var De=Ds(),pe=wt(De);{var Fe=Ve=>{var Ke=ND();Wl(Ke,()=>Ki(u(le).text),!0),T(Ve,Ke)},lt=Ve=>{var Ke=rZ(),si=C(Ke),A=C(si),J=C(A),He=x(si,2),dt=C(He);Wl(dt,()=>qi(u(le).text,u(le).lang??""),!0),X(()=>G(J,u(le).lang)),T(Ve,Ke)};q(pe,Ve=>{u(le).type==="text"?Ve(Fe):Ve(lt,-1)})}T(ue,De)}),T($,j)};q(H,$=>{u(s)!==null&&$(O)})}Ss(Xi,$=>ft=$,()=>ft);var ee=x(Xi,2);{var ke=$=>{var j=lZ(),K=C(j);X(()=>G(K,u(c))),T($,j)};q(ee,$=>{u(c)&&$(ke)})}var Je=x(ee,2),Ge=C(Je),fe=C(Ge),Ie=x(Ge,2),et=C(Ie),Zt=x(Ie,2),bt=C(Zt),Oe=x(Zt,2),yt=C(Oe),Xt=x(Je,2),Yt=C(Xt);{var ti=$=>{var j=cZ();let K;var ue=x(C(j),2),le=C(ue),De=x(ue,2),pe=C(De);X(()=>{K=Kt(j,1,"file-chip svelte-1twuiul",null,K,{inactive:!u(ge)}),G(le,t().id),Hn(De,"title",u(ge)?"Remove from context":"Re-add to context"),G(pe,u(ge)?"×":"+")}),oe("click",De,()=>I(ge,!u(ge))),T($,j)};q(Yt,$=>{t()&&$(ti)})}var ii=x(Yt,2);_i(ii,17,()=>u(Y),En,($,j,K)=>{const ue=st(()=>hn(u(j).name));var le=dZ(),De=C(le),pe=C(De),Fe=x(De,2),lt=C(Fe),Ve=x(Fe,2);X((Ke,si)=>{Kt(De,1,`badge badge-${Ke??""}`,"svelte-1twuiul"),G(pe,si),G(lt,u(j).name)},[()=>u(ue).toLowerCase(),()=>Nn(u(ue))]),oe("click",Ve,()=>jn(K)),T($,le)});var te=x(ii,2),he=x(te,2);Ss(he,$=>Ae=$,()=>Ae);var Ce=x(Xt,2);let Ue;var pt=C(Ce);let Xe;var Et=C(pt);Ss(Et,$=>Tt=$,()=>Tt);var li=x(pt,2);{var hi=$=>{var j=hZ();oe("click",j,Ut),T($,j)},ni=$=>{var j=uZ();X(K=>j.disabled=K,[()=>!u(r).trim()||!u(ct)]),oe("click",j,oi),T($,j)};q(li,$=>{u(a)?$(hi):$(ni,-1)})}var Gi=x(Ce,2);{var vn=$=>{var j=_Z(),K=C(j),ue=C(K),le=x(K,2);{var De=Ve=>{var Ke=fZ();_i(Ke,21,()=>u(g),En,(si,A)=>{var J=gZ(),He=C(J),dt={};X(()=>{G(He,u(A)),dt!==(dt=u(A))&&(J.value=(J.__value=u(A))??"")}),T(si,J)}),X(()=>Ke.disabled=u(a)),ha(Ke,()=>u(f),si=>I(f,si)),T(Ve,Ke)},pe=Ve=>{var Ke=pZ(),si=C(Ke);X(()=>G(si,u(f)||u(h).model)),T(Ve,Ke)};q(le,Ve=>{u(g).length>0?Ve(De):Ve(pe,-1)})}var Fe=x(le,2);{var lt=Ve=>{var Ke=mZ();oe("click",Ke,Vi),T(Ve,Ke)};q(Fe,Ve=>{u(h).provider==="ollama"&&Ve(lt)})}X(()=>G(ue,u(h).provider)),T($,j)};q(Gi,$=>{u(ct)&&u(h)&&$(vn)})}var Ri=x(Wn,2);{var qt=$=>{var j=DZ(),K=C(j),ue=C(K),le=C(ue),De=C(le),pe=x(le,2),Fe=x(ue,2),lt=C(Fe);{var Ve=A=>{var J=vZ();T(A,J)},Ke=A=>{var J=bZ(),He=C(J);X(()=>G(He,u(S))),T(A,J)},si=A=>{var J=IZ(),He=C(J);{var dt=Ne=>{var we=yZ(),xt=x(wt(we)),$e=C(xt);X(()=>G($e,u(_).version)),T(Ne,we)};q(He,Ne=>{u(_).version&&Ne(dt)})}var it=x(He,2);{var zt=Ne=>{var we=wZ(),xt=x(wt(we)),$e=C(xt);X(()=>G($e,u(_).details.family)),T(Ne,we)};q(it,Ne=>{var we;(we=u(_).details)!=null&&we.family&&Ne(zt)})}var Te=x(it,2);{var me=Ne=>{var we=SZ(),xt=x(wt(we)),$e=C(xt);X(()=>G($e,u(_).details.parameter_size)),T(Ne,we)};q(Te,Ne=>{var we;(we=u(_).details)!=null&&we.parameter_size&&Ne(me)})}var xe=x(Te,2);{var Ze=Ne=>{var we=CZ(),xt=x(wt(we)),$e=C(xt);X(()=>G($e,u(_).details.quantization_level)),T(Ne,we)};q(xe,Ne=>{var we;(we=u(_).details)!=null&&we.quantization_level&&Ne(Ze)})}var Ee=x(xe,2);{var ve=Ne=>{var we=LZ(),xt=x(wt(we),2);_i(xt,21,()=>u(_).running,En,($e,Vt)=>{var ai=xZ(),be=C(ai);X(qe=>G(be,`${u(Vt).name??""} · ${qe??""} VRAM`),[()=>dn(u(Vt).size_vram)]),T($e,ai)}),T(Ne,we)},At=Ne=>{var we=kZ();T(Ne,we)};q(Ee,Ne=>{u(_).running&&u(_).running.length>0?Ne(ve):u(_).running!==null&&Ne(At,1)})}T(A,J)};q(lt,A=>{u(w)?A(Ve):u(S)?A(Ke,1):u(_)&&A(si,2)})}X(()=>{var A;return G(De,`Ollama · ${(u(f)||((A=u(h))==null?void 0:A.model))??""}`)}),oe("click",j,()=>I(v,!1)),oe("click",K,A=>A.stopPropagation()),oe("click",pe,()=>I(v,!1)),T($,j)};q(Ri,$=>{u(v)&&$(qt)})}X($=>{G(yt,$),Ue=Kt(Ce,1,"input-row svelte-1twuiul",null,Ue,{"drag-over":u(_e)}),Xe=Kt(pt,1,"textarea-wrap svelte-1twuiul",null,Xe,{loading:u(a)}),Hn(Et,"placeholder",u(ct)?"Ask anything… (Enter to send, Shift+Enter for newline, drag & drop files to add context)":"AI not configured"),Et.disabled=u(a)||!u(ct)},[()=>dn(u(Ot))]),qs(fe,()=>u(z),$=>I(z,$)),qs(et,()=>u(F),$=>I(F,$)),qs(bt,()=>u(ie),$=>I(ie,$)),oe("click",te,xn),oe("change",he,_n),es("dragover",Ce,Ye),es("dragleave",Ce,Ht),es("drop",Ce,Un),oe("keydown",Et,mi),Ei(Et,()=>u(r),$=>I(r,$)),T(o,sn),Do()}mr(["click","change","keydown"]);var TZ=R('<div class="me svelte-1pxdb1"></div>');function Aw(o,e){Io(e,!0);let t=eg(e,"value",15,""),i=eg(e,"language",3,"javascript"),n,s,r=!1;Vr(()=>{const c=i()==="json"?{formatOnPaste:!0,autoIndent:"full"}:{};s=Fa.create(n,{value:t(),language:i(),theme:"vs-dark",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,fontFamily:"'Cascadia Code', 'Fira Code', monospace",automaticLayout:!0,wordWrap:"on",lineNumbers:"on",renderLineHighlight:"none",overviewRulerLanes:0,scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6},...c}),s.onDidChangeModelContent(()=>{r||t(s.getValue())})}),oy(()=>s==null?void 0:s.dispose()),Dn(()=>{!s||s.getValue()===t()||(r=!0,s.setValue(t()),r=!1)});var a=TZ();Ss(a,c=>n=c,()=>n),T(o,a),Do()}var MZ=R('<!> <div class="welcome svelte-rrt0o"><div class="welcome-inner svelte-rrt0o"><div class="welcome-logo svelte-rrt0o">db</div> <p class="welcome-sub svelte-rrt0o">sheDB — embedded JSON document store with MapReduce views</p> <div class="welcome-hint svelte-rrt0o"><strong>In scripts:</strong> use <code class="svelte-rrt0o">she.db.get(id)</code>, <code class="svelte-rrt0o">she.db.set(id, doc)</code>, <code class="svelte-rrt0o">she.db.extend(id, partial)</code>, <code class="svelte-rrt0o">she.db.sub(pattern, cb)</code>.<br/> <strong>Views:</strong> <code class="svelte-rrt0o">this</code> = current document &mdash; call <code class="svelte-rrt0o">emit(value)</code> to add to result.</div> <div class="welcome-links svelte-rrt0o"><a href="https://github.com/hobbyquaker/she/blob/main/doc/db/README.md" target="_blank" rel="noopener" class="svelte-rrt0o">sheDB docs</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she/blob/main/doc/db/view-examples.md" target="_blank" rel="noopener" class="svelte-rrt0o">View examples</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" class="svelte-rrt0o">GitHub</a></div></div></div>',1),NZ=R('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><line x1="5.5" y1="5" x2="4" y2="2.5"></line><line x1="10.5" y1="5" x2="12" y2="2.5"></line><path d="M3 11 V7 A5 3.5 0 0 0 13 7 V11 Z" stroke-linejoin="round"></path><circle cx="6" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle><circle cx="10" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle></svg> AI</button>'),RD=R('<div class="form-error svelte-rrt0o"> </div>'),RZ=R('<div class="new-item-form svelte-rrt0o"><input placeholder="device/lamp1" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),AD=R("<li> </li>"),OD=R('<div class="error-bar svelte-rrt0o"> </div>'),FD=R('<div class="loading svelte-rrt0o">Loading…</div>'),AZ=R('<div class="monaco-doc-wrap svelte-rrt0o"><!></div>'),OZ=R('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),FZ=R('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ Doc</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main></div>'),HZ=R('<div class="new-item-form svelte-rrt0o"><input placeholder="myView" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),WZ=R('<label class="opt-check svelte-rrt0o"><input type="checkbox" class="svelte-rrt0o"/> <span class="checkmark svelte-rrt0o"></span> Retain <span class="section-hint svelte-rrt0o">— send as retained MQTT message</span></label>'),BZ=R('<span class="badge-error svelte-rrt0o">error</span>'),zZ=R('<span class="badge-ok svelte-rrt0o"> </span>'),VZ=R('<pre class="result-error svelte-rrt0o"> </pre>'),jZ=R('<pre class="result-json svelte-rrt0o"> </pre>'),UZ=R('<div class="view-result svelte-rrt0o"><div class="result-header svelte-rrt0o">Result <!></div> <!></div>'),$Z=R('<div class="view-sections svelte-rrt0o"><div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Description <span class="section-hint svelte-rrt0o">— optional, shown in sidebar</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="(optional description)"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Filter <span class="section-hint svelte-rrt0o">— MQTT wildcard, optional</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="#"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Map <span class="section-hint svelte-rrt0o">— <code>this</code> = document &nbsp;·&nbsp; call <code>emit(this)</code> to include in result</span></div> <div class="monaco-view-wrap monaco-view-wrap--map svelte-rrt0o"><!></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Reduce <span class="section-hint svelte-rrt0o">— receives <code>result</code> array, must <code>return</code> new value (optional)</span></div> <div class="monaco-view-wrap monaco-view-wrap--reduce svelte-rrt0o"><!></div></div> <div class="view-section view-section--options svelte-rrt0o"><label class="opt-check svelte-rrt0o"><input type="checkbox" class="svelte-rrt0o"/> <span class="checkmark svelte-rrt0o"></span> Publish to MQTT <span class="section-hint svelte-rrt0o">— publish view to MQTT topic <code> </code></span></label> <!></div> <!></div>'),qZ=R('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button title="Re-run view" class="svelte-rrt0o">Refresh</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),KZ=R('<div class="chat-resize-handle svelte-rrt0o" role="separator"></div> <div class="chat-pane svelte-rrt0o"><!></div>',1),GZ=R('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ View</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main> <!></div>'),ZZ=R('<div class="db-root svelte-rrt0o" role="presentation"><div class="panel-tabs svelte-rrt0o"><button>Documents</button> <button>Views</button> <!></div> <!></div>');function XZ(o,e){Io(e,!0);const t=Se=>{var Z=MZ(),Pe=wt(Z);Ss(tm(Pe,{}),at=>jn=at,()=>jn),T(Se,Z)};let i=V(wi([])),n=V(null),s=V("{}"),r=V(!1),a=V(null);const c="she-db-selected-view";let h=V(wi([])),g=V(wi(localStorage.getItem(c))),f=V("#"),p=V("// emit(this.someProperty)"),v=V(""),_=V(""),w=V(!1),S=V(!1),D=V(null),P=V(!1),N=V(null),z=V("she/db/view/");const F="she-db-panel";let ie=V(wi(localStorage.getItem(F)??"docs")),Y=V(""),ge=V(!1),_e=V(null),Ae=V(""),Le=V(!1),gt=V(null);const Tt="she-db-sidebar-width";let ft=V(wi(parseInt(localStorage.getItem(Tt)??"220",10))),mt=!1,ct=0,Ot=0;const Me="she-db-chat-width",Mt="she-db-chat-open";let je=V(localStorage.getItem(Mt)==="true"),ot=V(wi(parseInt(localStorage.getItem(Me)??"320",10))),_t=!1,pi=0,Rt=0;const Dt=st(()=>u(g)?{id:u(g),filter:u(f),map:u(p),reduce:u(v)}:null);function kt(Se){Se.filter!==void 0&&I(f,Se.filter,!0),Se.map!==void 0&&I(p,Se.map,!0),Se.reduce!==void 0&&I(v,Se.reduce,!0)}Dn(()=>{localStorage.setItem(Mt,String(u(je)))}),Dn(()=>{localStorage.setItem(F,u(ie))}),Dn(()=>{u(g)?localStorage.setItem(c,u(g)):localStorage.removeItem(c)});function qi(Se){mt=!0,ct=Se.clientX,Ot=u(ft),Se.preventDefault()}function Ki(Se){mt&&I(ft,Math.max(140,Math.min(500,Ot+Se.clientX-ct)),!0),_t&&I(ot,Math.max(240,Math.min(600,Rt-(Se.clientX-pi))),!0)}function Mn(){mt&&(mt=!1,localStorage.setItem(Tt,String(u(ft)))),_t&&(_t=!1,localStorage.setItem(Me,String(u(ot))))}function cn(Se){_t=!0,pi=Se.clientX,Rt=u(ot),Se.preventDefault()}async function Vi(){try{I(i,await eR(),!0)}catch{}}async function dn(){try{I(h,await tR(),!0)}catch{}}async function hn(Se){I(n,Se,!0),I(a,null),I(r,!0);try{const Z=await e8(Se);I(s,JSON.stringify(Z,null,2),!0)}catch(Z){I(a,Z instanceof Error?Z.message:String(Z),!0)}finally{I(r,!1)}}async function Nn(){if(u(n)){I(a,null);try{const Se=JSON.parse(u(s));await oD(u(n),Se)}catch(Se){I(a,Se instanceof Error?Se.message:String(Se),!0)}}}let jn;async function xn(){if(u(n)&&await jn.show(`Delete document "${u(n)}"?`,{confirm:"Delete",danger:!0}))try{await t8(u(n)),I(n,null),I(s,"{}")}catch(Se){I(a,Se instanceof Error?Se.message:String(Se),!0)}}async function Rn(){const Se=u(Y).trim();if(Se){I(_e,null);try{await oD(Se,{}),I(ge,!1),I(Y,""),await hn(Se)}catch(Z){I(_e,Z instanceof Error?Z.message:String(Z),!0)}}}async function _n(Se){I(g,Se,!0),I(N,null),I(P,!0),I(D,null);try{const Z=await i8(Se);I(f,Z.filter??"",!0),I(p,Z.map,!0),I(v,Z.reduce??"",!0),I(_,Z.description??"",!0),I(w,Z.mqttpub??!1,!0),I(S,Z.retain??!1,!0),I(D,await Nw(Se).catch(()=>null),!0)}catch(Z){I(N,Z instanceof Error?Z.message:String(Z),!0)}finally{I(P,!1)}}async function Un(){if(u(g)){I(N,null);try{const Se={map:u(p)};u(f).trim()&&(Se.filter=u(f).trim()),u(v).trim()&&(Se.reduce=u(v).trim()),u(_).trim()&&(Se.description=u(_).trim()),u(w)&&(Se.mqttpub=!0),u(S)&&(Se.retain=!0),await rD(u(g),Se)}catch(Se){I(N,Se instanceof Error?Se.message:String(Se),!0)}}}async function Ye(){if(u(g))try{I(D,await Nw(u(g)),!0)}catch(Se){I(N,Se instanceof Error?Se.message:String(Se),!0)}}async function Ht(){if(u(g)&&await jn.show(`Delete view "${u(g)}"?`,{confirm:"Delete",danger:!0}))try{await n8(u(g)),I(g,null),I(f,""),I(p,"// emit(this.someProperty)"),I(v,""),I(_,""),I(w,!1),I(S,!1),I(D,null)}catch(Se){I(N,Se instanceof Error?Se.message:String(Se),!0)}}async function oi(){if(!u(Ae).trim())return;const Se=u(Ae).trim();I(gt,null);try{await rD(Se,{map:"// emit(this.someProperty)"}),I(Le,!1),I(Ae,""),await dn(),await _n(Se)}catch(Z){I(gt,Z instanceof Error?Z.message:String(Z),!0)}}let Ut=V(""),mi=V(""),An=st(()=>[...u(i)].filter(Se=>!u(Ut)||Se.toLowerCase().includes(u(Ut).toLowerCase())).sort()),un=st(()=>[...u(h)].filter(Se=>!u(mi)||Se.toLowerCase().includes(u(mi).toLowerCase())).sort());Vr(()=>{Vi(),dn(),u(g)&&_n(u(g)),QN().then(It=>{const $t=It.dbPrefix||"she/db/",H=$t.endsWith("/")?$t:$t+"/";I(z,H+"view/")}).catch(()=>{});const Se=Ul("db:ids",It=>{I(i,It.ids??[],!0)}),Z=Ul("db:viewIds",It=>{I(h,It.ids??[],!0)}),Pe=Ul("db:change",async It=>{const $t=It.id;u(n)===$t&&(It.doc===null?(I(n,null),I(s,"{}")):I(s,JSON.stringify(It.doc,null,2),!0))}),at=Ul("db:viewUpdate",async It=>{const $t=It.id;u(g)===$t&&I(D,await Nw($t).catch(()=>null),!0)});return()=>{Se(),Z(),Pe(),at()}});var ji=ZZ(),sn=C(ji),Wn=C(sn);let Ni;var on=x(Wn,2);let Bn;var Jn=x(on,2);{var kn=Se=>{var Z=NZ();let Pe;X(()=>{Pe=Kt(Z,1,"ai-toggle svelte-rrt0o",null,Pe,{"ai-open":u(je)}),Hn(Z,"title",u(je)?"Close AI assistant":"Open AI assistant")}),oe("click",Z,()=>I(je,!u(je))),T(Se,Z)};q(Jn,Se=>{u(ie)==="views"&&Se(kn)})}var Xi=x(sn,2);{var On=Se=>{var Z=FZ(),Pe=C(Z);let at;var It=C(Pe),$t=C(It),H=x(It,2);{var O=bt=>{var Oe=RZ(),yt=wt(Oe),Xt=C(yt),Yt=x(Xt,2),ti=x(yt,2);{var ii=te=>{var he=RD(),Ce=C(he);X(()=>G(Ce,u(_e))),T(te,he)};q(ti,te=>{u(_e)&&te(ii)})}oe("keydown",Xt,te=>te.key==="Enter"&&Rn()),Ei(Xt,()=>u(Y),te=>I(Y,te)),oe("click",Yt,Rn),T(bt,Oe)};q(H,bt=>{u(ge)&&bt(O)})}var ee=x(H,2),ke=C(ee),Je=x(ee,2);_i(Je,20,()=>u(An),bt=>bt,(bt,Oe)=>{var yt=AD();let Xt;var Yt=C(yt);X(()=>{Xt=Kt(yt,1,"flat-item svelte-rrt0o",null,Xt,{"active-item":u(n)===Oe}),G(Yt,Oe)}),oe("click",yt,()=>hn(Oe)),T(bt,yt)});var Ge=x(Pe,2),fe=x(Ge,2),Ie=C(fe);{var et=bt=>{var Oe=OZ(),yt=wt(Oe),Xt=C(yt),Yt=C(Xt),ti=x(Xt,2),ii=x(ti,2),te=x(yt,2);{var he=Xe=>{var Et=OD(),li=C(Et);X(()=>G(li,u(a))),T(Xe,Et)};q(te,Xe=>{u(a)&&Xe(he)})}var Ce=x(te,2);{var Ue=Xe=>{var Et=FD();T(Xe,Et)},pt=Xe=>{var Et=AZ(),li=C(Et);Aw(li,{language:"json",get value(){return u(s)},set value(hi){I(s,hi,!0)}}),T(Xe,Et)};q(Ce,Xe=>{u(r)?Xe(Ue):Xe(pt,-1)})}X(()=>G(Yt,u(n))),oe("click",ti,Nn),oe("click",ii,xn),T(bt,Oe)},Zt=bt=>{t(bt)};q(Ie,bt=>{u(n)?bt(et):bt(Zt,-1)})}X(()=>at=zo(Pe,"",at,{width:`${u(ft)??""}px`})),oe("click",$t,()=>{I(ge,!u(ge)),I(_e,null)}),Ei(ke,()=>u(Ut),bt=>I(Ut,bt)),oe("mousedown",Ge,qi),T(Se,Z)},rn=Se=>{var Z=GZ(),Pe=C(Z);let at;var It=C(Pe),$t=C(It),H=x(It,2);{var O=yt=>{var Xt=HZ(),Yt=wt(Xt),ti=C(Yt),ii=x(ti,2),te=x(Yt,2);{var he=Ce=>{var Ue=RD(),pt=C(Ue);X(()=>G(pt,u(gt))),T(Ce,Ue)};q(te,Ce=>{u(gt)&&Ce(he)})}oe("keydown",ti,Ce=>Ce.key==="Enter"&&oi()),Ei(ti,()=>u(Ae),Ce=>I(Ae,Ce)),oe("click",ii,oi),T(yt,Xt)};q(H,yt=>{u(Le)&&yt(O)})}var ee=x(H,2),ke=C(ee),Je=x(ee,2);_i(Je,20,()=>u(un),yt=>yt,(yt,Xt)=>{var Yt=AD();let ti;var ii=C(Yt);X(()=>{ti=Kt(Yt,1,"flat-item svelte-rrt0o",null,ti,{"active-item":u(g)===Xt}),G(ii,Xt)}),oe("click",Yt,()=>_n(Xt)),T(yt,Yt)});var Ge=x(Pe,2),fe=x(Ge,2),Ie=C(fe);{var et=yt=>{var Xt=qZ(),Yt=wt(Xt),ti=C(Yt),ii=C(ti),te=x(ti,2),he=x(te,2),Ce=x(he,2),Ue=x(Yt,2);{var pt=hi=>{var ni=OD(),Gi=C(ni);X(()=>G(Gi,u(N))),T(hi,ni)};q(Ue,hi=>{u(N)&&hi(pt)})}var Xe=x(Ue,2);{var Et=hi=>{var ni=FD();T(hi,ni)},li=hi=>{var ni=$Z(),Gi=C(ni),vn=x(C(Gi),2),Ri=C(vn),qt=x(Gi,2),$=x(C(qt),2),j=C($),K=x(qt,2),ue=x(C(K),2),le=C(ue);Aw(le,{language:"javascript",get value(){return u(p)},set value(Te){I(p,Te,!0)}});var De=x(K,2),pe=x(C(De),2),Fe=C(pe);Aw(Fe,{language:"javascript",get value(){return u(v)},set value(Te){I(v,Te,!0)}});var lt=x(De,2),Ve=C(lt),Ke=C(Ve),si=x(Ke,4),A=x(C(si)),J=C(A),He=x(Ve,2);{var dt=Te=>{var me=WZ(),xe=C(me);qs(xe,()=>u(S),Ze=>I(S,Ze)),T(Te,me)};q(He,Te=>{u(w)&&Te(dt)})}var it=x(lt,2);{var zt=Te=>{var me=UZ(),xe=C(me),Ze=x(C(xe));{var Ee=xt=>{var $e=BZ();T(xt,$e)},ve=xt=>{var $e=zZ(),Vt=C($e);X(()=>G(Vt,`${u(D).length??0??""} items · rev ${u(D)._rev??""}`)),T(xt,$e)};q(Ze,xt=>{u(D).error?xt(Ee):xt(ve,-1)})}var At=x(xe,2);{var Ne=xt=>{var $e=VZ(),Vt=C($e);X(()=>G(Vt,u(D).error)),T(xt,$e)},we=xt=>{var $e=jZ(),Vt=C($e);X(ai=>G(Vt,ai),[()=>JSON.stringify(u(D).result,null,2)]),T(xt,$e)};q(At,xt=>{u(D).error?xt(Ne):xt(we,-1)})}T(Te,me)};q(it,Te=>{u(D)&&Te(zt)})}X(()=>G(J,`${u(z)??""}${u(g)??""} on every update`)),Ei(Ri,()=>u(_),Te=>I(_,Te)),Ei(j,()=>u(f),Te=>I(f,Te)),qs(Ke,()=>u(w),Te=>I(w,Te)),T(hi,ni)};q(Xe,hi=>{u(P)?hi(Et):hi(li,-1)})}X(()=>G(ii,u(g))),oe("click",te,Un),oe("click",he,Ye),oe("click",Ce,Ht),T(yt,Xt)},Zt=yt=>{t(yt)};q(Ie,yt=>{u(g)?yt(et):yt(Zt,-1)})}var bt=x(fe,2);{var Oe=yt=>{var Xt=KZ(),Yt=wt(Xt),ti=x(Yt,2);let ii;var te=C(ti);PZ(te,{get currentView(){return u(Dt)},onApplyView:kt}),X(()=>ii=zo(ti,"",ii,{width:`${u(ot)??""}px`})),oe("mousedown",Yt,cn),T(yt,Xt)};q(bt,yt=>{u(je)&&yt(Oe)})}X(()=>at=zo(Pe,"",at,{width:`${u(ft)??""}px`})),oe("click",$t,()=>{I(Le,!u(Le)),I(gt,null)}),Ei(ke,()=>u(mi),yt=>I(mi,yt)),oe("mousedown",Ge,qi),T(Se,Z)};q(Xi,Se=>{u(ie)==="docs"?Se(On):Se(rn,-1)})}X(()=>{Ni=Kt(Wn,1,"svelte-rrt0o",null,Ni,{active:u(ie)==="docs"}),Bn=Kt(on,1,"svelte-rrt0o",null,Bn,{active:u(ie)==="views"})}),oe("mousemove",ji,Ki),oe("mouseup",ji,Mn),es("mouseleave",ji,Mn),oe("click",Wn,()=>I(ie,"docs")),oe("click",on,()=>I(ie,"views")),T(o,ji),Do()}mr(["mousemove","mouseup","click","keydown","mousedown"]);var YZ=R('<label class="svelte-1ua3isv">Passcode <input type="number" placeholder="20202021" class="svelte-1ua3isv"/></label> <label class="svelte-1ua3isv">Discriminator (optional) <input type="number" placeholder="3840" class="svelte-1ua3isv"/></label>',1),JZ=R('<label class="svelte-1ua3isv">Pairing Code / QR <input type="text" placeholder="MT:..." class="svelte-1ua3isv"/></label>'),HD=R('<p class="err svelte-1ua3isv"> </p>'),QZ=R('<div class="wizard svelte-1ua3isv"><div class="wizard-tabs svelte-1ua3isv"><button>Passcode</button> <button>QR / Code</button></div> <!> <label class="svelte-1ua3isv">IP Address (optional, bypasses mDNS) <input type="text" placeholder="192.168.1.100 or 192.168.1.100:5540" class="svelte-1ua3isv"/></label> <!> <button class="commission-btn svelte-1ua3isv"> </button></div>'),e9=R('<span class="device-name svelte-1ua3isv"> </span> <span class="device-nodeid svelte-1ua3isv"> </span>',1),t9=R('<span class="device-name svelte-1ua3isv"> </span>'),i9=R('<li><button class="device-select-btn svelte-1ua3isv"><span></span> <span class="device-label svelte-1ua3isv"><!></span></button> <button class="unpair-btn svelte-1ua3isv" title="Unpair">✕</button></li>'),n9=R('<li class="empty svelte-1ua3isv">No paired devices</li>'),s9=R('<p class="info svelte-1ua3isv">Loading…</p>'),o9=R('<p class="device-subtitle svelte-1ua3isv"> </p>'),r9=R('<span class="ep-chip svelte-1ua3isv"> </span>'),a9=R('<span class="attr-id svelte-1ua3isv"> </span>'),l9=R('<button class="attr-action-btn svelte-1ua3isv"> </button>'),c9=R('<div class="attr-actions svelte-1ua3isv"></div>'),d9=R('<span class="cmd-sep svelte-1ua3isv">,</span>'),h9=R('<span class="cmd-name svelte-1ua3isv"> </span><span class="cmd-id svelte-1ua3isv"> </span>',1),u9=R('<span class="cmd-id svelte-1ua3isv"> </span>'),g9=R("<!> <!>",1),f9=R('<span class="cmd-list svelte-1ua3isv"></span>'),p9=R(' <span class="cmd-id svelte-1ua3isv"> </span>',1),m9=R('<tr class="svelte-1ua3isv"><td class="svelte-1ua3isv"><!></td><td class="svelte-1ua3isv"> </td></tr>'),_9=R('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"><th class="svelte-1ua3isv">deviceType</th><th class="svelte-1ua3isv">revision</th></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),v9=R('<th class="svelte-1ua3isv"> </th>'),b9=R('<td class="svelte-1ua3isv"> </td>'),y9=R('<tr class="svelte-1ua3isv"></tr>'),w9=R('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),S9=R('<tr class="svelte-1ua3isv"><td class="attr-obj-key svelte-1ua3isv"> </td><td class="attr-obj-val svelte-1ua3isv"> </td></tr>'),C9=R('<table class="attr-obj-table svelte-1ua3isv"><tbody class="svelte-1ua3isv"></tbody></table>'),x9=R('<a class="attr-link svelte-1ua3isv" target="_blank" rel="noopener noreferrer"> </a>'),L9=R('<span class="attr-val svelte-1ua3isv"> </span>'),k9=R('<tr class="svelte-1ua3isv"><td class="attr-name-cell svelte-1ua3isv"><span class="attr-key svelte-1ua3isv"> </span><!></td><td class="attr-actions-cell svelte-1ua3isv"><!></td><td class="attr-val-cell svelte-1ua3isv"><!></td></tr>'),I9=R('<tr class="cluster-hdr-row svelte-1ua3isv"><td colspan="3" class="cluster-hdr-cell svelte-1ua3isv"> </td></tr> <!>',1),D9=R('<table class="cluster-table svelte-1ua3isv"><colgroup><col class="col-attr-name svelte-1ua3isv"/><col class="col-attr-actions svelte-1ua3isv"/><col class="col-attr-val"/></colgroup><tbody class="svelte-1ua3isv"></tbody></table>'),E9=R('<p class="no-clusters svelte-1ua3isv">No clusters</p>'),P9=R('<details class="svelte-1ua3isv"><summary class="svelte-1ua3isv"> <span class="ep-id svelte-1ua3isv"> </span> <span class="ep-chips svelte-1ua3isv"></span></summary> <!></details>'),T9=R('<div class="detail-hdr svelte-1ua3isv"><h2 class="svelte-1ua3isv"> </h2> <!> <p class="detail-nodeid svelte-1ua3isv"> </p></div> <!>',1),M9=R('<p class="info svelte-1ua3isv">Select a device to view its endpoints.</p>'),N9=R('<span class="stream-badge svelte-1ua3isv"> </span>'),R9=R('<span class="stream-empty svelte-1ua3isv">Waiting for events…</span>'),Ow=R('&nbsp;<span class="e-sub svelte-1ua3isv"> </span>',1),A9=R('<span class="e-badge e-badge-status svelte-1ua3isv">status</span> <span class="e-node svelte-1ua3isv"> <!></span> <span> </span>',1),O9=R('<span class="e-badge e-badge-attr svelte-1ua3isv">attr</span> <span class="e-node svelte-1ua3isv"> <!></span> <span class="e-ep svelte-1ua3isv"> <!></span> <span class="e-cluster svelte-1ua3isv"> </span> <span class="e-attr svelte-1ua3isv"> </span> <span class="e-val svelte-1ua3isv"> </span>',1),F9=R('<div class="er svelte-1ua3isv"><span class="e-ts svelte-1ua3isv"> </span> <!></div>'),H9=R('<div class="stream-body svelte-1ua3isv"><!></div>'),W9=R('<!> <div class="matter-page svelte-1ua3isv"><div class="matter-main svelte-1ua3isv"><div class="sidebar svelte-1ua3isv"><div class="sidebar-header svelte-1ua3isv"><span class="sidebar-title svelte-1ua3isv">Matter Devices</span> <button class="add-btn svelte-1ua3isv" title="Commission new device">+</button></div> <!> <ul class="device-list svelte-1ua3isv"><!> <!></ul></div> <div class="detail svelte-1ua3isv"><!></div></div> <div class="stream-panel svelte-1ua3isv"><div class="stream-resize svelte-1ua3isv"></div> <div class="stream-hdr-row svelte-1ua3isv"><span class="stream-title svelte-1ua3isv">Matter Events</span> <!> <button class="stream-toggle svelte-1ua3isv" title="Toggle event feed"> </button></div> <!></div></div>',1);function B9(o,e){Io(e,!0);const t={onOff:{onOff:[{label:"On",command:"on"},{label:"Off",command:"off"},{label:"Toggle",command:"toggle"}]},levelControl:{currentLevel:[{label:"Step ▲",command:"stepWithOnOff",args:{stepMode:0,stepSize:25,transitionTime:5}},{label:"Step ▼",command:"stepWithOnOff",args:{stepMode:1,stepSize:25,transitionTime:5}}]},windowCovering:{currentPositionLiftPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}],currentPositionTiltPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}]}};async function i(Z,Pe,at,It,$t){try{await m8(Z,Pe,at,It,$t)}catch(H){console.error("matter command failed",H)}}const n={identify:{0:"identify",1:"triggerEffect"},groups:{0:"addGroup",1:"viewGroup",2:"getGroupMembership",3:"removeGroup",4:"removeAllGroups",5:"addGroupIfIdentifying"},scenes:{0:"addScene",1:"viewScene",2:"removeScene",3:"removeAllScenes",4:"storeScene",5:"recallScene",6:"getSceneMembership",64:"enhancedAddScene",65:"enhancedViewScene",66:"copyScene"},onOff:{0:"off",1:"on",2:"toggle",64:"offWithEffect",65:"onWithRecallGlobalScene",66:"onWithTimedOff"},levelControl:{0:"moveToLevel",1:"move",2:"step",3:"stop",4:"moveToLevelWithOnOff",5:"moveWithOnOff",6:"stepWithOnOff",7:"stopWithOnOff",8:"moveToClosestFrequency"},colorControl:{0:"moveToHue",1:"moveHue",2:"stepHue",3:"moveToSaturation",4:"moveSaturation",5:"stepSaturation",6:"moveToHueAndSaturation",7:"moveToColor",8:"moveColor",9:"stepColor",10:"moveToColorTemperature",64:"enhancedMoveToHue",65:"enhancedMoveHue",66:"enhancedStepHue",67:"enhancedMoveToHueAndSaturation",68:"colorLoopSet",71:"stopMoveStep",75:"moveColorTemperature",76:"stepColorTemperature"},thermostat:{0:"setpointRaiseLower",1:"setWeeklySchedule",2:"getWeeklySchedule",3:"clearWeeklySchedule"},doorLock:{0:"lockDoor",1:"unlockDoor",3:"unlockWithTimeout",11:"setWeekDaySchedule",12:"getWeekDaySchedule",13:"clearWeekDaySchedule",14:"setYearDaySchedule",15:"getYearDaySchedule",16:"clearYearDaySchedule",17:"setHolidaySchedule",18:"getHolidaySchedule",19:"clearHolidaySchedule",26:"setUser",27:"getUser",28:"clearUser",34:"setCredential",36:"getCredential",38:"clearCredential"},windowCovering:{0:"upOrOpen",1:"downOrClose",2:"stopMotion",4:"goToLiftValue",5:"goToLiftPercentage",7:"goToTiltValue",8:"goToTiltPercentage"},fanControl:{0:"step"}};function s(Z,Pe){const at=n[Z];return Pe.map(It=>{const $t=typeof It=="number"?It:Number(It);return{id:$t,name:(at==null?void 0:at[$t])??null}})}const r={10:"Door Lock",11:"Door Lock Controller",14:"Aggregator",15:"Generic Switch",17:"On/Off Plug-In Unit",18:"Dimmable Plug-In Unit",19:"Pump",20:"On/Off Light Switch",21:"Dimmer Switch",22:"Color Dimmer Switch",23:"Control Bridge",24:"Pump Controller",256:"On/Off Light",257:"Dimmable Light",268:"Extended Color Light",269:"Color Temperature Light",262:"Light Sensor",263:"Occupancy Sensor",514:"Window Covering",515:"Window Covering Controller",768:"Heating/Cooling Unit",769:"Thermostat",770:"Temperature Sensor",771:"Pressure Sensor",772:"Flow Sensor",773:"Humidity Sensor",774:"On/Off Sensor",2112:"Air Quality Sensor"},a={generatedCommandList:65528,acceptedCommandList:65529,eventList:65530,attributeList:65531,featureMap:65532,clusterRevision:65533},c={descriptor:{deviceTypeList:0,serverList:1,clientList:2,partsList:3,tagList:4},basicInformation:{dataModelRevision:0,vendorName:1,vendorID:2,vendorId:2,productName:3,productID:4,productId:4,nodeLabel:5,location:6,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,localConfigDisabled:16,reachable:17,uniqueID:18,uniqueId:18,capabilityMinima:19,productAppearance:20,specificationVersion:21,maxPathsPerInvoke:22},bridgedDeviceBasicInformation:{vendorName:1,vendorID:2,vendorId:2,productName:3,productId:4,nodeLabel:5,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,reachable:17,uniqueID:18,uniqueId:18,productAppearance:20},identify:{identifyTime:0,identifyType:1},groups:{nameSupport:0},onOff:{onOff:0,globalSceneControl:16384,onTime:16385,offWaitTime:16386,startUpOnOff:16387},levelControl:{currentLevel:0,remainingTime:1,minLevel:2,maxLevel:3,currentFrequency:4,minFrequency:5,maxFrequency:6,options:15,onOffTransitionTime:16,onLevel:17,onTransitionTime:18,offTransitionTime:19,defaultMoveRate:20,startUpCurrentLevel:16384},colorControl:{currentHue:0,currentSaturation:1,remainingTime:2,currentX:3,currentY:4,colorTemperatureMireds:7,colorMode:8,options:15,enhancedCurrentHue:16384,enhancedColorMode:16385,colorLoopActive:16386,colorLoopDirection:16387,colorLoopTime:16388,colorCapabilities:16394,colorTempPhysicalMinMireds:16395,colorTempPhysicalMaxMireds:16396,coupleColorTempToLevelMinMireds:16397,startUpColorTemperatureMireds:16400},thermostat:{localTemperature:0,outdoorTemperature:1,occupancy:2,absMinHeatSetpointLimit:3,absMaxHeatSetpointLimit:4,absMinCoolSetpointLimit:5,absMaxCoolSetpointLimit:6,piCoolingDemand:7,piHeatingDemand:8,localTemperatureCalibration:16,occupiedCoolingSetpoint:17,occupiedHeatingSetpoint:18,unoccupiedCoolingSetpoint:19,unoccupiedHeatingSetpoint:20,minHeatSetpointLimit:21,maxHeatSetpointLimit:22,minCoolSetpointLimit:23,maxCoolSetpointLimit:24,minSetpointDeadBand:25,remoteSensing:26,controlSequenceOfOperation:27,systemMode:28,thermostatRunningMode:30,startOfWeek:32,numberOfWeeklyTransitions:33,numberOfDailyTransitions:34,temperatureSetpointHold:35,temperatureSetpointHoldDuration:36,thermostatProgrammingOperationMode:37,thermostatRunningState:41,setpointChangeSource:48,setpointChangeAmount:49,setpointChangeSourceTimestamp:50,occupiedSetback:52,unoccupiedSetback:55,emergencyHeatDelta:58},windowCovering:{type:0,physicalClosedLimitLift:1,physicalClosedLimitTilt:2,currentPositionLift:3,currentPositionTilt:4,numberOfActuationsLift:5,numberOfActuationsTilt:6,configStatus:7,currentPositionLiftPercentage:8,currentPositionTiltPercentage:9,operationalStatus:10,targetPositionLiftPercent100ths:11,targetPositionTiltPercent100ths:12,endProductType:13,currentPositionLiftPercent100ths:14,currentPositionTiltPercent100ths:15,installedOpenLimitLift:16,installedClosedLimitLift:17,installedOpenLimitTilt:18,installedClosedLimitTilt:19,mode:23,safetyStatus:26},doorLock:{lockState:0,lockType:1,actuatorEnabled:2,doorState:3,numberOfTotalUsersSupported:17,numberOfPINUsersSupported:18,maxPINCodeLength:23,minPINCodeLength:24,language:33,autoRelockTime:35,soundVolume:36,operatingMode:37,supportedOperatingModes:38,wrongCodeEntryLimit:48},fanControl:{fanMode:0,fanModeSequence:1,percentSetting:2,percentCurrent:3,speedMax:4,speedSetting:5,speedCurrent:6,rockSupport:7,rockSetting:8,windSupport:9,windSetting:10,airflowDirectionSupport:11,airflowDirection:12},occupancySensing:{occupancy:0,occupancySensorType:1,occupancySensorTypeBitmap:2,holdTime:3,pirOccupiedToUnoccupiedDelay:16,pirUnoccupiedToOccupiedDelay:17},illuminanceMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,lightSensorType:4},temperatureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},pressureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,scaledValue:16,minScaledValue:17,maxScaledValue:18,scale:20},flowMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},relativeHumidityMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},powerSource:{status:0,order:1,description:2,batVoltage:11,batPercentRemaining:12,batTimeRemaining:13,batChargeLevel:14,batReplacementNeeded:15,batReplaceability:16,batPresent:17,activeBatFaults:18,batChargeState:26}};function h(Z){return"0x"+Z.toString(16).toUpperCase().padStart(4,"0")}let g=V(wi([])),f=wi(new Map);function p(Z){if(Z==null)return"—";if(typeof Z=="boolean"||typeof Z=="number")return String(Z);if(typeof Z=="string")return Z.length>50?Z.slice(0,47)+"…":Z;const Pe=JSON.stringify(Z);return Pe.length>60?Pe.slice(0,57)+"…":Pe}function v(Z){return Z==null?"—":typeof Z=="boolean"||typeof Z=="number"?String(Z):typeof Z=="string"?Z:JSON.stringify(Z)}function _(Z){return Z!==null&&typeof Z=="object"&&!Array.isArray(Z)}function w(Z){return Array.isArray(Z)&&Z.length>0&&Z.every(_)}function S(Z,Pe){return!!(Pe==="attributeList"||Array.isArray(Z)&&Z.length===0||_(Z)&&Object.keys(Z).length===0)}function D(Z){return new Date(Z).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}const P=500,N=20,z=32;let F=0,ie=V(wi([])),Y=V(!0),ge=V(180),_e=st(()=>{const Z=Math.max(1,Math.floor((u(ge)-z)/N)+1);return u(ie).slice(0,Z)});function Ae(Z){Z.preventDefault();const Pe=Z.clientY,at=u(ge);function It(H){I(ge,Math.max(60,Math.min(600,at+Pe-H.clientY)),!0)}function $t(){document.removeEventListener("mousemove",It),document.removeEventListener("mouseup",$t)}document.addEventListener("mousemove",It),document.addEventListener("mouseup",$t)}let Le=V(null),gt=V(!1),Tt=V(null),ft=V(!1),mt=V("passcode"),ct=V(""),Ot=V(""),Me=V(""),Mt=V(!1),je=V(null),ot=V("");const _t="she:matter:selectedNodeId";async function pi(){try{I(g,await iR(),!0);for(const Z of u(g))m_(Z.nodeId).then(Pe=>{f.set(Z.nodeId,Pe)}).catch(()=>{});if(u(g).length>0&&!u(Le)){const Z=localStorage.getItem(_t),Pe=Z&&u(g).find(at=>at.nodeId===Z)?Z:u(g)[0].nodeId;Rt(Pe)}}catch{I(g,[],!0)}}async function Rt(Z){I(gt,!0),I(Tt,null);try{I(Le,await m_(Z),!0),f.set(Z,u(Le)),localStorage.setItem(_t,Z)}catch(Pe){I(Tt,Pe instanceof Error?Pe.message:String(Pe),!0)}finally{I(gt,!1)}}let Dt;async function kt(Z){var Pe;if(await Dt.show(`Unpair device ${Z}?`,{confirm:"Unpair",danger:!0}))try{await p8(Z),((Pe=u(Le))==null?void 0:Pe.nodeId)===Z&&I(Le,null),await pi()}catch(at){I(Tt,at instanceof Error?at.message:String(at),!0)}}async function qi(){I(Mt,!0),I(je,null);try{let Z;u(mt)==="passcode"?(Z={passcode:Number(u(ct))},u(Ot)&&(Z={...Z,discriminator:Number(u(Ot))})):Z={pairingCode:u(Me).trim()},u(ot).trim()&&(Z={...Z,discoveryAddress:u(ot).trim()}),await f8(Z),I(ft,!1),I(ct,""),I(Ot,""),I(Me,""),I(ot,""),await pi()}catch(Z){I(je,Z instanceof Error?Z.message:String(Z),!0)}finally{I(Mt,!1)}}Vr(()=>{pi()});const Ki=Ul("matter:deviceList",Z=>{if(!Array.isArray(Z.devices))return;const Pe=Z.devices;for(const at of Pe)f.has(at.nodeId)||m_(at.nodeId).then(It=>{f.set(at.nodeId,It)}).catch(()=>{});I(g,Pe,!0)}),Mn=Ul("matter:deviceStatus",Z=>{if(Z.nodeId===void 0)return;const Pe=String(Z.nodeId),at=!!Z.online;I(g,u(g).map(It=>It.nodeId===Pe?{...It,online:at}:It),!0),I(ie,[{id:F++,kind:"status",nodeId:Pe,online:at,ts:Date.now()},...u(ie).slice(0,P-1)],!0)}),cn=Ul("matter:attr",Z=>{const Pe=String(Z.nodeId),at=Z.endpointId,It=String(Z.clusterName),$t=String(Z.attrName),H=Z.value;if(u(Le)&&u(Le).nodeId===Pe){const ee=u(Le).endpoints.find(Je=>Je.endpointId===at),ke=ee==null?void 0:ee.clusters.find(Je=>Je.name===It);ke&&(ke.attrs[$t]=H)}const O=f.get(Pe);if(O){const ee=O.endpoints.find(Je=>Je.endpointId===at),ke=ee==null?void 0:ee.clusters.find(Je=>Je.name===It);ke&&(ke.attrs[$t]=H)}I(ie,[{id:F++,kind:"attr",nodeId:Pe,endpointId:at,clusterName:It,attrName:$t,value:H,ts:Z.ts??Date.now()},...u(ie).slice(0,P-1)],!0)});oy(()=>{Ki(),Mn(),cn()});var Vi=W9(),dn=wt(Vi);Ss(tm(dn,{}),Z=>Dt=Z,()=>Dt);var hn=x(dn,2),Nn=C(hn),jn=C(Nn),xn=C(jn),Rn=x(C(xn),2),_n=x(xn,2);{var Un=Z=>{var Pe=QZ(),at=C(Pe),It=C(at);let $t;var H=x(It,2);let O;var ee=x(at,2);{var ke=Oe=>{var yt=YZ(),Xt=wt(yt),Yt=x(C(Xt)),ti=x(Xt,2),ii=x(C(ti));Ei(Yt,()=>u(ct),te=>I(ct,te)),Ei(ii,()=>u(Ot),te=>I(Ot,te)),T(Oe,yt)},Je=Oe=>{var yt=JZ(),Xt=x(C(yt));Ei(Xt,()=>u(Me),Yt=>I(Me,Yt)),T(Oe,yt)};q(ee,Oe=>{u(mt)==="passcode"?Oe(ke):Oe(Je,-1)})}var Ge=x(ee,2),fe=x(C(Ge)),Ie=x(Ge,2);{var et=Oe=>{var yt=HD(),Xt=C(yt);X(()=>G(Xt,u(je))),T(Oe,yt)};q(Ie,Oe=>{u(je)&&Oe(et)})}var Zt=x(Ie,2),bt=C(Zt);X(()=>{$t=Kt(It,1,"svelte-1ua3isv",null,$t,{active:u(mt)==="passcode"}),O=Kt(H,1,"svelte-1ua3isv",null,O,{active:u(mt)==="pairingCode"}),Zt.disabled=u(Mt),G(bt,u(Mt)?"Commissioning…":"Commission")}),oe("click",It,()=>I(mt,"passcode")),oe("click",H,()=>I(mt,"pairingCode")),Ei(fe,()=>u(ot),Oe=>I(ot,Oe)),oe("click",Zt,qi),T(Z,Pe)};q(_n,Z=>{u(ft)&&Z(Un)})}var Ye=x(_n,2),Ht=C(Ye);_i(Ht,17,()=>u(g),Z=>Z.nodeId,(Z,Pe)=>{var at=i9();let It;var $t=C(at),H=C($t);let O;var ee=x(H,2),ke=C(ee);{var Je=Ie=>{var et=e9(),Zt=wt(et),bt=C(Zt),Oe=x(Zt,2),yt=C(Oe);X(()=>{G(bt,u(Pe).name),G(yt,`#${u(Pe).nodeId??""}`)}),T(Ie,et)},Ge=Ie=>{var et=t9(),Zt=C(et);X(()=>G(Zt,`Node ${u(Pe).nodeId??""}`)),T(Ie,et)};q(ke,Ie=>{u(Pe).name?Ie(Je):Ie(Ge,-1)})}var fe=x($t,2);X(()=>{var Ie;It=Kt(at,1,"svelte-1ua3isv",null,It,{selected:((Ie=u(Le))==null?void 0:Ie.nodeId)===u(Pe).nodeId}),O=Kt(H,1,"status-dot svelte-1ua3isv",null,O,{online:u(Pe).online})}),oe("click",$t,()=>Rt(u(Pe).nodeId)),oe("click",fe,()=>kt(u(Pe).nodeId)),T(Z,at)});var oi=x(Ht,2);{var Ut=Z=>{var Pe=n9();T(Z,Pe)};q(oi,Z=>{u(g).length===0&&Z(Ut)})}var mi=x(jn,2),An=C(mi);{var un=Z=>{var Pe=s9();T(Z,Pe)},ji=Z=>{var Pe=HD(),at=C(Pe);X(()=>G(at,u(Tt))),T(Z,Pe)},sn=Z=>{var Pe=T9(),at=wt(Pe),It=C(at),$t=C(It),H=x(It,2);{var O=Ge=>{var fe=o9(),Ie=C(fe);X(()=>G(Ie,u(Le).subtitle)),T(Ge,fe)};q(H,Ge=>{u(Le).subtitle&&Ge(O)})}var ee=x(H,2),ke=C(ee),Je=x(at,2);_i(Je,17,()=>u(Le).endpoints,Ge=>Ge.endpointId,(Ge,fe)=>{var Ie=P9(),et=C(Ie),Zt=C(et),bt=x(Zt),Oe=C(bt),yt=x(bt,2);_i(yt,21,()=>u(fe).clusters,En,(ii,te)=>{var he=r9(),Ce=C(he);X(()=>G(Ce,u(te).name)),T(ii,he)});var Xt=x(et,2);{var Yt=ii=>{var te=D9(),he=x(C(te));_i(he,21,()=>u(fe).clusters,En,(Ce,Ue)=>{var pt=I9(),Xe=wt(pt),Et=C(Xe),li=C(Et),hi=x(Xe,2);_i(hi,17,()=>Object.entries(u(Ue).attrs),En,(ni,Gi)=>{var vn=st(()=>ok(u(Gi),2));let Ri=()=>u(vn)[0],qt=()=>u(vn)[1];var $=Ds(),j=wt($);{var K=le=>{const De=st(()=>{var $e;return($e=t[u(Ue).name])==null?void 0:$e[Ri()]}),pe=st(()=>(Ri()==="acceptedCommandList"||Ri()==="generatedCommandList")&&Array.isArray(qt())),Fe=st(()=>{var $e;return(($e=c[u(Ue).name])==null?void 0:$e[Ri()])??a[Ri()]});var lt=k9(),Ve=C(lt),Ke=C(Ve),si=C(Ke),A=x(Ke);{var J=$e=>{var Vt=a9(),ai=C(Vt);X(be=>G(ai,`(${be??""})`),[()=>h(u(Fe))]),T($e,Vt)};q(A,$e=>{u(Fe)!==void 0&&$e(J)})}var He=x(Ve),dt=C(He);{var it=$e=>{var Vt=c9();_i(Vt,21,()=>u(De),En,(ai,be)=>{var qe=l9(),rt=C(qe);X(()=>G(rt,u(be).label)),oe("click",qe,()=>i(u(Le).nodeId,u(fe).endpointId,u(Ue).name,u(be).command,u(be).args)),T(ai,qe)}),T($e,Vt)};q(dt,$e=>{u(De)&&$e(it)})}var zt=x(He),Te=C(zt);{var me=$e=>{var Vt=f9();_i(Vt,21,()=>s(u(Ue).name,qt()),En,(ai,be,qe)=>{var rt=g9(),Wt=wt(rt);{var tt=Jt=>{var Bt=d9();T(Jt,Bt)};q(Wt,Jt=>{qe>0&&Jt(tt)})}var ui=x(Wt,2);{var ri=Jt=>{var Bt=h9(),Ui=wt(Bt),tn=C(Ui),bn=x(Ui),$n=C(bn);X(()=>{G(tn,u(be).name),G($n,`(${u(be).id??""})`)}),T(Jt,Bt)},Ti=Jt=>{var Bt=u9(),Ui=C(Bt);X(()=>G(Ui,u(be).id)),T(Jt,Bt)};q(ui,Jt=>{u(be).name?Jt(ri):Jt(Ti,-1)})}T(ai,rt)}),T($e,Vt)},xe=$e=>{var Vt=_9(),ai=x(C(Vt));_i(ai,21,qt,En,(be,qe)=>{const rt=st(()=>u(qe)),Wt=st(()=>u(rt).deviceType),tt=st(()=>r[u(Wt)]);var ui=m9(),ri=C(ui),Ti=C(ri);{var Jt=bn=>{var $n=p9(),In=wt($n),Ps=x(In),Ur=C(Ps);X(Eo=>{G(In,`${u(tt)??""} `),G(Ur,`(${Eo??""})`)},[()=>h(u(Wt))]),T(bn,$n)},Bt=bn=>{var $n=Rr();X(In=>G($n,In),[()=>h(u(Wt))]),T(bn,$n)};q(Ti,bn=>{u(tt)?bn(Jt):bn(Bt,-1)})}var Ui=x(ri),tn=C(Ui);X(bn=>G(tn,bn),[()=>v(u(rt).revision)]),T(be,ui)}),T($e,Vt)},Ze=st(()=>Ri()==="deviceTypeList"&&Array.isArray(qt())),Ee=$e=>{const Vt=st(()=>[...new Set(qt().flatMap(Wt=>Object.keys(Wt)))]);var ai=w9(),be=C(ai),qe=C(be);_i(qe,21,()=>u(Vt),En,(Wt,tt)=>{var ui=v9(),ri=C(ui);X(()=>G(ri,u(tt))),T(Wt,ui)});var rt=x(be);_i(rt,21,qt,En,(Wt,tt)=>{var ui=y9();_i(ui,21,()=>u(Vt),En,(ri,Ti)=>{var Jt=b9(),Bt=C(Jt);X(Ui=>G(Bt,Ui),[()=>v(u(tt)[u(Ti)])]),T(ri,Jt)}),T(Wt,ui)}),T($e,ai)},ve=st(()=>w(qt())),At=$e=>{var Vt=C9(),ai=C(Vt);_i(ai,21,()=>Object.entries(qt()),En,(be,qe)=>{var rt=st(()=>ok(u(qe),2));let Wt=()=>u(rt)[0],tt=()=>u(rt)[1];var ui=S9(),ri=C(ui),Ti=C(ri),Jt=x(ri),Bt=C(Jt);X(Ui=>{G(Ti,Wt()),G(Bt,Ui)},[()=>v(tt())]),T(be,ui)}),T($e,Vt)},Ne=st(()=>_(qt())),we=$e=>{var Vt=x9(),ai=C(Vt);X(()=>{Hn(Vt,"href",qt()),G(ai,qt())}),T($e,Vt)},xt=$e=>{var Vt=L9(),ai=C(Vt);X(be=>G(ai,be),[()=>v(qt())]),T($e,Vt)};q(Te,$e=>{u(pe)?$e(me):u(Ze)?$e(xe,1):u(ve)?$e(Ee,2):u(Ne)?$e(At,3):(Ri()==="productUrl"||Ri()==="productURL")&&typeof qt()=="string"?$e(we,4):$e(xt,-1)})}X(()=>{Hn(Ve,"title",Ri()),G(si,Ri())}),T(le,lt)},ue=st(()=>!S(qt(),Ri()));q(j,le=>{u(ue)&&le(K)})}T(ni,$)}),X(()=>G(li,u(Ue).name)),T(Ce,pt)}),T(ii,te)},ti=ii=>{var te=E9();T(ii,te)};q(Xt,ii=>{u(fe).clusters.length>0?ii(Yt):ii(ti,-1)})}X(()=>{G(Zt,`${u(fe).name??`Endpoint ${u(fe).endpointId}`??""} `),G(Oe,`ep${u(fe).endpointId??""}`)}),T(Ge,Ie)}),X(()=>{G($t,u(Le).name??`Node ${u(Le).nodeId}`),G(ke,`Node ID: ${u(Le).nodeId??""}`)}),T(Z,Pe)},Wn=Z=>{var Pe=M9();T(Z,Pe)};q(An,Z=>{u(gt)?Z(un):u(Tt)?Z(ji,1):u(Le)?Z(sn,2):Z(Wn,-1)})}var Ni=x(Nn,2),on=C(Ni),Bn=x(on,2),Jn=x(C(Bn),2);{var kn=Z=>{var Pe=N9(),at=C(Pe);X(()=>G(at,u(ie).length)),T(Z,Pe)};q(Jn,Z=>{!u(Y)&&u(ie).length>0&&Z(kn)})}var Xi=x(Jn,2),On=C(Xi),rn=x(Bn,2);{var Se=Z=>{var Pe=H9(),at=C(Pe);{var It=H=>{var O=R9();T(H,O)},$t=H=>{var O=Ds(),ee=wt(O);_i(ee,17,()=>u(_e),ke=>ke.id,(ke,Je)=>{const Ge=st(()=>{var Yt,ti;return((Yt=f.get(u(Je).nodeId))==null?void 0:Yt.name)??((ti=u(g).find(ii=>ii.nodeId===u(Je).nodeId))==null?void 0:ti.name)??null}),fe=st(()=>{var Yt,ti;return u(Je).endpointId!==void 0?((ti=(Yt=f.get(u(Je).nodeId))==null?void 0:Yt.endpoints.find(ii=>ii.endpointId===u(Je).endpointId))==null?void 0:ti.name)??null:null}),Ie=st(()=>u(Je).attrName??u(Je).clusterName);var et=F9(),Zt=C(et),bt=C(Zt),Oe=x(Zt,2);{var yt=Yt=>{var ti=A9(),ii=x(wt(ti),2),te=C(ii),he=x(te);{var Ce=Et=>{var li=Ow(),hi=x(wt(li)),ni=C(hi);X(()=>G(ni,`(#${u(Je).nodeId??""})`)),T(Et,li)};q(he,Et=>{u(Ge)&&Et(Ce)})}var Ue=x(ii,2);let pt;var Xe=C(Ue);X(()=>{G(te,u(Ge)??`#${u(Je).nodeId}`),pt=Kt(Ue,1,"e-val svelte-1ua3isv",null,pt,{"e-online":u(Je).online,"e-offline":!u(Je).online}),G(Xe,u(Je).online?"online":"offline")}),T(Yt,ti)},Xt=Yt=>{var ti=O9(),ii=x(wt(ti),2),te=C(ii),he=x(te);{var Ce=qt=>{var $=Ow(),j=x(wt($)),K=C(j);X(()=>G(K,`(#${u(Je).nodeId??""})`)),T(qt,$)};q(he,qt=>{u(Ge)&&qt(Ce)})}var Ue=x(ii,2),pt=C(Ue),Xe=x(pt);{var Et=qt=>{var $=Ow(),j=x(wt($)),K=C(j);X(()=>G(K,`(ep ${u(Je).endpointId??""})`)),T(qt,$)};q(Xe,qt=>{u(fe)&&qt(Et)})}var li=x(Ue,2),hi=C(li),ni=x(li,2),Gi=C(ni),vn=x(ni,2),Ri=C(vn);X(qt=>{G(te,u(Ge)??`#${u(Je).nodeId}`),G(pt,u(fe)??`ep${u(Je).endpointId}`),G(hi,u(Je).clusterName),G(Gi,u(Ie)),G(Ri,qt)},[()=>p(u(Je).value)]),T(Yt,ti)};q(Oe,Yt=>{u(Je).kind==="status"?Yt(yt):Yt(Xt,-1)})}X(Yt=>G(bt,Yt),[()=>D(u(Je).ts)]),T(ke,et)}),T(H,O)};q(at,H=>{u(_e).length===0?H(It):H($t,-1)})}T(Z,Pe)};q(rn,Z=>{u(Y)&&Z(Se)})}X(()=>{zo(Ni,u(Y)?`height: ${u(ge)}px;`:""),G(On,u(Y)?"▾":"▸")}),oe("click",Rn,()=>I(ft,!u(ft))),oe("mousedown",on,Ae),oe("click",Xi,()=>{I(Y,!u(Y))}),T(o,Vi),Do()}mr(["click","mousedown"]);var z9=R("<button>›</button>"),V9=R('<span class="chev-ph svelte-1vejtrc"></span>'),j9=R('<span class="tv svelte-1vejtrc"> </span> <span class="tt svelte-1vejtrc"> </span>',1),U9=R('<div class="tc svelte-1vejtrc"></div>'),$9=R('<div class="tn svelte-1vejtrc"><div><!> <span class="seg svelte-1vejtrc"> </span> <!></div> <!></div>'),q9=R("<option></option>"),K9=R('<span class="pub-ok svelte-1vejtrc">✓</span>'),G9=R('<span class="pub-err svelte-1vejtrc"> </span>'),Z9=R('<div class="info svelte-1vejtrc">Loading…</div>'),X9=R('<div class="info err svelte-1vejtrc"> </div>'),Y9=R('<div class="info svelte-1vejtrc">No topics match.</div>'),J9=R('<div class="vr svelte-1vejtrc"><span class="v-topic svelte-1vejtrc"> </span> <span class="v-val svelte-1vejtrc"> </span> <span class="v-ts svelte-1vejtrc"> </span></div>'),Q9=R('<div class="vs svelte-1vejtrc"><div><div class="vrows-abs svelte-1vejtrc"></div></div></div>'),eX=R('<div class="info svelte-1vejtrc">No topics yet.</div>'),tX=R('<div class="tree-wrap svelte-1vejtrc"><!></div>'),iX=R('<span class="stream-badge"> </span>'),nX=R('<span class="stream-empty svelte-1vejtrc">Waiting for messages…</span>'),sX=R('<span class="s-ret svelte-1vejtrc" title="retained snapshot">&#x229B;</span>'),oX=R('<div><span class="s-ts svelte-1vejtrc"> </span> <!> <span class="s-topic svelte-1vejtrc"> </span> <span class="s-val svelte-1vejtrc"> </span></div>'),rX=R('<div class="stream-body svelte-1vejtrc"><!></div>'),aX=R('<div class="ctx-bd svelte-1vejtrc"></div> <div class="ctx-menu svelte-1vejtrc"><button class="svelte-1vejtrc">Copy topic</button> <button class="svelte-1vejtrc">Clear retained</button></div>',1),lX=R('<label class="modal-check svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> Recursive — also clear all child topics</label>'),cX=R('<div class="modal-bd svelte-1vejtrc"></div> <div class="modal svelte-1vejtrc"><div class="modal-title svelte-1vejtrc">Clear retained</div> <div class="modal-body svelte-1vejtrc"><p class="svelte-1vejtrc">Clear retained value for <code class="svelte-1vejtrc"> </code>?</p> <!></div> <div class="modal-footer svelte-1vejtrc"><button class="btn-cancel svelte-1vejtrc">Cancel</button> <button class="btn-confirm svelte-1vejtrc">Clear</button></div></div>',1),dX=R('<div class="page svelte-1vejtrc"><div class="toolbar svelte-1vejtrc"><h2 class="svelte-1vejtrc">MQTT</h2></div> <div class="main-group svelte-1vejtrc"><div class="pub-bar svelte-1vejtrc"><input class="pt svelte-1vejtrc" type="text" placeholder="topic" list="pub-topic-list" autocomplete="off"/> <datalist id="pub-topic-list"></datalist> <input class="pp svelte-1vejtrc" type="text" placeholder="payload"/> <label class="rl svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> retain</label> <select class="svelte-1vejtrc"><option>QoS 0</option><option>QoS 1</option><option>QoS 2</option></select> <button class="svelte-1vejtrc">Publish</button> <!> <!></div> <div class="tree-filter-bar svelte-1vejtrc"><input class="filter-in svelte-1vejtrc" type="search" placeholder="Filter topics…"/> <span class="count svelte-1vejtrc"><!> </span></div> <!></div> <div class="stream-panel svelte-1vejtrc"><div class="stream-resize svelte-1vejtrc"></div> <div class="stream-hdr-row svelte-1vejtrc"><input class="filter-in stream-filter-in svelte-1vejtrc" type="search" placeholder="Live stream filter (MQTT wildcard, default: #)"/> <!> <button class="stream-toggle svelte-1vejtrc" title="Toggle live stream"> </button></div> <!></div> <!> <!></div>');function hX(o,e){Io(e,!0);const t=(te,he=ey)=>{const Ce=st(()=>u(f).has(he().path)),Ue=st(()=>u(a)>=0&&he().children.size>0),pt=st(()=>u(a)>=0&&he().isLeaf&&!n.has(he().path));var Xe=$9(),Et=C(Xe);let li;var hi=C(Et);{var ni=le=>{var De=z9();let pe;X(()=>{pe=Kt(De,1,"chev svelte-1vejtrc",null,pe,{open:u(Ce)}),Hn(De,"aria-label",u(Ce)?"Collapse":"Expand")}),oe("click",De,()=>p(he().path)),T(le,De)},Gi=le=>{var De=V9();T(le,De)};q(hi,le=>{u(Ue)?le(ni):le(Gi,-1)})}var vn=x(hi,2),Ri=C(vn),qt=x(vn,2);{var $=le=>{var De=j9(),pe=wt(De),Fe=C(pe),lt=x(pe,2),Ve=C(lt);X((Ke,si,A)=>{Hn(pe,"title",Ke),G(Fe,si),G(Ve,A)},[()=>{var Ke;return hn((Ke=xn(he().path))==null?void 0:Ke.val)},()=>{var Ke;return hn((Ke=xn(he().path))==null?void 0:Ke.val)},()=>{var Ke;return((Ke=xn(he().path))==null?void 0:Ke.ts)!=null?Nn(xn(he().path).ts):""}]),T(le,De)},j=st(()=>he().isLeaf&&i.has(he().path));q(qt,le=>{u(j)&&le($)})}var K=x(Et,2);{var ue=le=>{var De=U9();_i(De,21,()=>[...he().children.values()].sort((pe,Fe)=>pe.seg.localeCompare(Fe.seg)),pe=>pe.path,(pe,Fe)=>{t(pe,()=>u(Fe))}),T(le,De)};q(K,le=>{u(Ue)&&u(Ce)&&le(ue)})}X(()=>{li=Kt(Et,1,"tr svelte-1vejtrc",null,li,{stale:u(pt)}),G(Ri,he().seg)}),oe("click",Et,()=>{I(gt,he().path+"/#")}),oe("contextmenu",Et,le=>{le.preventDefault(),I(ot,{x:le.clientX,y:le.clientY,topic:he().path},!0)}),T(te,Xe)},i=new Map,n=new Set,s=new Set;let r=null,a=V(0);function c(){r===null&&(r=requestAnimationFrame(()=>{r=null;for(const te of s)g(te);s.clear(),lk(a)}))}const h=new Map;function g(te){const he=te.split("/");let Ce=h,Ue="";for(let pt=0;pt<he.length;pt++){const Xe=he[pt];Ue=pt===0?Xe:`${Ue}/${Xe}`,Ce.has(Xe)||Ce.set(Xe,{seg:Xe,path:Ue,children:new Map,isLeaf:!1});const Et=Ce.get(Xe);pt===he.length-1&&(Et.isLeaf=!0),Ce=Et.children}}let f=V(wi(new Set));function p(te){const he=new Set(u(f));he.has(te)?he.delete(te):he.add(te),I(f,he,!0)}let v=V("");const _=24,w=5;let S=V(0),D=V(300),P=st(()=>{if(u(a),!u(v))return[];const te=u(v).toLowerCase().split(/\s+/).filter(Boolean),he=[];for(const[Ce,Ue]of i){const pt=Ce.toLowerCase();te.every(Xe=>pt.includes(Xe))&&he.push({topic:Ce,...Ue})}return he.sort((Ce,Ue)=>Ce.topic.localeCompare(Ue.topic))}),N=st(()=>{const te=u(P).length,he=Math.max(0,Math.floor(u(S)/_)-w),Ce=Math.min(te,Math.ceil((u(S)+u(D))/_)+w);return{start:he,end:Ce,totalH:te*_,top:he*_}});const z=1e3,F=200,ie=20,Y=36;let ge=0,_e=V(wi([])),Ae=V(wi([])),Le=V(!0),gt=V("#"),Tt=V(200);Dn(()=>{const te=u(gt).trim(),he=_l(()=>u(_e)),Ce=!te||te==="#"?he.slice(0,F):he.filter(Ue=>ft(te,Ue.topic)).slice(0,F);if(te&&te!=="#"){const Ue=new Set(Ce.map(Xe=>Xe.topic)),pt=[];for(const[Xe,Et]of i)Ue.has(Xe)||ft(te,Xe)&&pt.push({id:-(pt.length+1),topic:Xe,val:Et.val,ts:Et.ts,retained:!0});pt.sort((Xe,Et)=>Xe.topic.localeCompare(Et.topic)),I(Ae,[...Ce,...pt],!0)}else I(Ae,Ce,!0)});function ft(te,he){if(te==="#")return!0;const Ce=te.split("/"),Ue=he.split("/");for(let pt=0;pt<Ce.length;pt++){if(Ce[pt]==="#")return!0;if(pt>=Ue.length||Ce[pt]!=="+"&&Ce[pt]!==Ue[pt])return!1}return Ce.length===Ue.length}function mt(te){te.preventDefault();const he=te.clientY,Ce=u(Tt);function Ue(Xe){I(Tt,Math.max(60,Math.min(800,Ce+he-Xe.clientY)),!0)}function pt(){document.removeEventListener("mousemove",Ue),document.removeEventListener("mouseup",pt)}document.addEventListener("mousemove",Ue),document.addEventListener("mouseup",pt)}let ct=st(()=>{const te=Math.max(1,Math.floor((u(Tt)-Y)/ie)+1);return u(Ae).slice(0,te)}),Ot=V(!0),Me=V(null);async function Mt(){I(Ot,!0),I(Me,null);try{const te=await nR();for(const he of te)i.set(he.topic,{val:he.val,ts:he.ts}),g(he.topic)}catch(te){I(Me,te instanceof Error?te.message:String(te),!0)}finally{I(Ot,!1),lk(a)}}const je=Ul("mqtt",te=>{const{topic:he,val:Ce,ts:Ue}=te;i.set(he,{val:Ce,ts:Ue}),n.add(he),s.add(he),c();const pt={id:ge++,topic:he,val:Ce,ts:Ue};I(_e,[pt,...u(_e).slice(0,z-1)],!0);const Xe=u(gt).trim();(!Xe||Xe==="#"||ft(Xe,he))&&I(Ae,[pt,...u(Ae).filter(Et=>!(Et.retained&&Et.topic===he)).slice(0,F-1)],!0)});let ot=V(null),_t=V(null);async function pi(te,he){const Ce=[te];if(he){const Ue=te+"/";for(const pt of i.keys())pt.startsWith(Ue)&&Ce.push(pt)}for(const Ue of Ce)await lD(Ue,"",!0,0)}let Rt=st(()=>(u(a),[...i.keys()].sort())),Dt=V(""),kt=V(""),qi=V(!1),Ki=V(0),Mn=V(!1),cn=V(null),Vi=V(!1);async function dn(){if(u(Dt)){I(Mn,!0),I(cn,null),I(Vi,!1);try{await lD(u(Dt),u(kt),u(qi),u(Ki)),I(Vi,!0),setTimeout(()=>{I(Vi,!1)},2e3)}catch(te){I(cn,te instanceof Error?te.message:String(te),!0)}finally{I(Mn,!1)}}}function hn(te){return te==null?"":typeof te=="object"?JSON.stringify(te):String(te)}function Nn(te){return new Date(te).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function jn(te){return new Date(te).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function xn(te){return u(a),i.get(te)}let Rn=st(()=>(u(a),[...h.values()].sort((te,he)=>te.seg.localeCompare(he.seg)))),_n=st(()=>(u(a),i.size));Vr(Mt),oy(()=>{je(),r!==null&&cancelAnimationFrame(r)});var Un=dX(),Ye=x(C(Un),2),Ht=C(Ye),oi=C(Ht),Ut=x(oi,2);_i(Ut,20,()=>u(Rt),te=>te,(te,he)=>{var Ce=q9(),Ue={};X(()=>{Ue!==(Ue=he)&&(Ce.value=(Ce.__value=he)??"")}),T(te,Ce)});var mi=x(Ut,2),An=x(mi,2),un=C(An),ji=x(An,2),sn=C(ji);sn.value=sn.__value=0;var Wn=x(sn);Wn.value=Wn.__value=1;var Ni=x(Wn);Ni.value=Ni.__value=2;var on=x(ji,2),Bn=x(on,2);{var Jn=te=>{var he=K9();T(te,he)};q(Bn,te=>{u(Vi)&&te(Jn)})}var kn=x(Bn,2);{var Xi=te=>{var he=G9(),Ce=C(he);X(()=>G(Ce,u(cn))),T(te,he)};q(kn,te=>{u(cn)&&te(Xi)})}var On=x(Ht,2),rn=C(On),Se=x(rn,2),Z=C(Se);{var Pe=te=>{var he=Rr();X(()=>G(he,`${u(P).length??""} /`)),T(te,he)};q(Z,te=>{u(v)&&te(Pe)})}var at=x(Z),It=x(On,2);{var $t=te=>{var he=Z9();T(te,he)},H=te=>{var he=X9(),Ce=C(he);X(()=>G(Ce,u(Me))),T(te,he)},O=te=>{var he=Ds(),Ce=wt(he);{var Ue=Xe=>{var Et=Y9();T(Xe,Et)},pt=Xe=>{var Et=Q9(),li=C(Et),hi=C(li);_i(hi,21,()=>u(P).slice(u(N).start,u(N).end),ni=>ni.topic,(ni,Gi)=>{var vn=J9(),Ri=C(vn),qt=C(Ri),$=x(Ri,2),j=C($),K=x($,2),ue=C(K);X((le,De,pe)=>{G(qt,u(Gi).topic),Hn($,"title",le),G(j,De),G(ue,pe)},[()=>hn(u(Gi).val),()=>hn(u(Gi).val),()=>Nn(u(Gi).ts)]),T(ni,vn)}),X(()=>{zo(li,`height: ${u(N).totalH??""}px; position: relative;`),zo(hi,`top: ${u(N).top??""}px;`)}),es("scroll",Et,ni=>{I(S,ni.currentTarget.scrollTop,!0)}),yW(Et,"clientHeight",ni=>I(D,ni)),T(Xe,Et)};q(Ce,Xe=>{u(P).length===0?Xe(Ue):Xe(pt,-1)})}T(te,he)},ee=te=>{var he=tX(),Ce=C(he);{var Ue=Xe=>{var Et=eX();T(Xe,Et)},pt=Xe=>{var Et=Ds(),li=wt(Et);_i(li,17,()=>u(Rn),hi=>hi.path,(hi,ni)=>{t(hi,()=>u(ni))}),T(Xe,Et)};q(Ce,Xe=>{u(Rn).length===0?Xe(Ue):Xe(pt,-1)})}T(te,he)};q(It,te=>{u(Ot)?te($t):u(Me)?te(H,1):u(v)?te(O,2):te(ee,-1)})}var ke=x(Ye,2),Je=C(ke),Ge=x(Je,2),fe=C(Ge),Ie=x(fe,2);{var et=te=>{var he=iX(),Ce=C(he);X(()=>G(Ce,u(Ae).length)),T(te,he)};q(Ie,te=>{!u(Le)&&u(Ae).length>0&&te(et)})}var Zt=x(Ie,2),bt=C(Zt),Oe=x(Ge,2);{var yt=te=>{var he=rX(),Ce=C(he);{var Ue=Xe=>{var Et=nX();T(Xe,Et)},pt=Xe=>{var Et=Ds(),li=wt(Et);_i(li,17,()=>u(ct),hi=>hi.id,(hi,ni)=>{var Gi=oX();let vn;var Ri=C(Gi),qt=C(Ri),$=x(Ri,2);{var j=pe=>{var Fe=sX();T(pe,Fe)};q($,pe=>{u(ni).retained&&pe(j)})}var K=x($,2),ue=C(K),le=x(K,2),De=C(le);X((pe,Fe,lt)=>{vn=Kt(Gi,1,"sr svelte-1vejtrc",null,vn,{retained:u(ni).retained}),G(qt,pe),G(ue,u(ni).topic),Hn(le,"title",Fe),G(De,lt)},[()=>jn(u(ni).ts),()=>hn(u(ni).val),()=>hn(u(ni).val)]),T(hi,Gi)}),T(Xe,Et)};q(Ce,Xe=>{u(ct).length===0?Xe(Ue):Xe(pt,-1)})}T(te,he)};q(Oe,te=>{u(Le)&&te(yt)})}var Xt=x(ke,2);{var Yt=te=>{var he=aX(),Ce=wt(he),Ue=x(Ce,2);let pt;var Xe=C(Ue),Et=x(Xe,2);X(()=>pt=zo(Ue,"",pt,{left:`${u(ot).x??""}px`,top:`${u(ot).y??""}px`})),oe("click",Ce,()=>I(ot,null)),oe("contextmenu",Ce,li=>{li.preventDefault(),I(ot,null)}),oe("click",Xe,()=>{navigator.clipboard.writeText(u(ot).topic),I(ot,null)}),oe("click",Et,()=>{const li=u(ot).topic,hi=li+"/",ni=[...i.keys()].some(Gi=>Gi.startsWith(hi));I(_t,{topic:li,hasChildren:ni,recursive:!1},!0),I(ot,null)}),T(te,he)};q(Xt,te=>{u(ot)&&te(Yt)})}var ti=x(Xt,2);{var ii=te=>{var he=cX(),Ce=wt(he),Ue=x(Ce,2),pt=x(C(Ue),2),Xe=C(pt),Et=x(C(Xe)),li=C(Et),hi=x(Xe,2);{var ni=qt=>{var $=lX(),j=C($);qs(j,()=>u(_t).recursive,K=>u(_t).recursive=K),T(qt,$)};q(hi,qt=>{u(_t).hasChildren&&qt(ni)})}var Gi=x(pt,2),vn=C(Gi),Ri=x(vn,2);X(()=>G(li,u(_t).topic)),oe("click",Ce,()=>I(_t,null)),oe("click",vn,()=>I(_t,null)),oe("click",Ri,()=>{const{topic:qt,recursive:$}=u(_t);I(_t,null),pi(qt,$)}),T(te,he)};q(ti,te=>{u(_t)&&te(ii)})}X(()=>{on.disabled=u(Mn)||!u(Dt),G(at,` ${u(_n)??""}`),zo(ke,u(Le)?`height: ${u(Tt)}px;`:""),G(bt,u(Le)?"▾":"▸")}),Ei(oi,()=>u(Dt),te=>I(Dt,te)),Ei(mi,()=>u(kt),te=>I(kt,te)),qs(un,()=>u(qi),te=>I(qi,te)),ha(ji,()=>u(Ki),te=>I(Ki,te)),oe("click",on,dn),Ei(rn,()=>u(v),te=>I(v,te)),oe("mousedown",Je,mt),Ei(fe,()=>u(gt),te=>I(gt,te)),oe("click",Zt,()=>{I(Le,!u(Le))}),T(o,Un),Do()}mr(["click","contextmenu","mousedown"]);var uX=R('<div class="restart-banner svelte-twakcj">⚠ Package changes require a daemon restart to take effect. Use the ↺ button in the topbar.</div>'),gX=R('<div class="err svelte-twakcj"> </div>'),fX=R('<span class="pane-count pane-count--warn svelte-twakcj"> </span>'),pX=R('<p class="empty svelte-twakcj">No packages installed.</p>'),mX=R('<p class="empty svelte-twakcj">No match.</p>'),_X=R('<span class="dep-latest svelte-twakcj"> </span>'),vX=lT('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="8" cy="8" r="6" stroke-dasharray="18" stroke-dashoffset="4"></circle></svg>'),bX=lT('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13 8A5 5 0 1 1 10.5 3.67"></path><polyline points="10.5,1.5 10.5,4 13,4"></polyline></svg>'),yX=R('<div><div class="dep-info svelte-twakcj"><a class="dep-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="dep-ver svelte-twakcj"> </span> <!></div> <div class="dep-btns svelte-twakcj"><button><!></button> <button class="icon-btn icon-btn--danger svelte-twakcj" title="Uninstall"><svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><line x1="2" y1="2" x2="14" y2="14"></line><line x1="14" y1="2" x2="2" y2="14"></line></svg></button></div></div>'),wX=R('<span class="result-author svelte-twakcj"> </span>'),SX=R('<span class="result-date svelte-twakcj"> </span>'),CX=R('<span class="result-desc svelte-twakcj"> </span>'),xX=R('<div class="result-row svelte-twakcj"><div class="result-info svelte-twakcj"><a class="result-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="result-ver svelte-twakcj"> </span> <!> <!> <!></div> <button class="install-btn svelte-twakcj"> </button></div>'),LX=R('<div class="results-list svelte-twakcj"></div>'),kX=R('<pre class="npm-output svelte-twakcj"> </pre>'),IX=R(`<p class="hint svelte-twakcj">Install npm packages into <code class="svelte-twakcj">~/.she/</code>. Scripts can then <code class="svelte-twakcj">require('package-name')</code> directly.</p>`),DX=R('<div class="pkg-shell svelte-twakcj"><!> <!> <div class="pkg-body svelte-twakcj"><div class="pkg-left svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Installed</span> <span class="pane-count svelte-twakcj"> </span> <!> <button class="icon-btn check-outdated-btn svelte-twakcj" title="Check for package updates"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13 8A5 5 0 1 1 10.5 3.67"></path><polyline points="10.5,1.5 10.5,4 13,4"></polyline></svg></button></div> <div class="filter-row svelte-twakcj"><input class="filter-in svelte-twakcj" type="search" placeholder="Filter…"/></div> <div class="installed-list svelte-twakcj"><!></div></div> <div class="pkg-right svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Search npm</span></div> <div class="search-row svelte-twakcj"><input class="search-in svelte-twakcj" type="text" placeholder="Package name, e.g. axios, lodash…"/> <button class="search-btn svelte-twakcj"> </button></div> <!> <!> <!></div></div></div>');function EX(o,e){Io(e,!0);let t=V(wi([])),i=V(""),n=V(wi({})),s=V(!1),r=V(""),a=V(wi([])),c=V(!1),h=V(!1),g=V(""),f=V(""),p=wi({});const v=st(()=>u(i).trim()?u(t).filter(Ye=>Ye.name.toLowerCase().includes(u(i).toLowerCase())):u(t)),_=st(()=>Object.keys(u(n)).length);Vr(async()=>{await Promise.all([w(),S()])});async function w(){try{I(t,await s8(),!0),I(g,"")}catch(Ye){I(g,Ye.message,!0)}}async function S(){try{I(n,await c8(),!0)}catch{}}async function D(){I(s,!0);try{I(n,await d8(),!0)}catch{}finally{I(s,!1)}}async function P(){const Ye=u(r).trim();if(!Ye){I(a,[],!0);return}I(h,!0),I(g,"");try{I(a,await o8(Ye),!0)}catch(Ht){I(g,Ht.message,!0)}finally{I(h,!1)}}function N(Ye){if(!Ye)return"";try{return new Date(Ye).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}async function z(Ye,Ht){p[Ye]=!0,I(g,""),I(f,"");try{const oi=await r8(Ye,Ht);I(f,oi.stdout||oi.stderr||"Done.",!0),I(c,!0),await w()}catch(oi){I(g,oi.message,!0)}finally{p[Ye]=!1}}async function F(Ye){p[Ye]=!0,I(g,""),I(f,"");try{const Ht=await a8(Ye);I(f,Ht.stdout||Ht.stderr||"Done.",!0),I(c,!0);const oi={...u(n)};delete oi[Ye],I(n,oi,!0),await w()}catch(Ht){I(g,Ht.message,!0)}finally{p[Ye]=!1}}async function ie(Ye){p[Ye]=!0,I(g,""),I(f,"");try{const Ht=await l8(Ye);I(f,Ht.stdout||Ht.stderr||"Done.",!0),I(c,!0);const oi={...u(n)};delete oi[Ye],I(n,oi,!0),await w()}catch(Ht){I(g,Ht.message,!0)}finally{p[Ye]=!1}}var Y=DX(),ge=C(Y);{var _e=Ye=>{var Ht=uX();T(Ye,Ht)};q(ge,Ye=>{u(c)&&Ye(_e)})}var Ae=x(ge,2);{var Le=Ye=>{var Ht=gX(),oi=C(Ht);X(()=>G(oi,u(g))),T(Ye,Ht)};q(Ae,Ye=>{u(g)&&Ye(Le)})}var gt=x(Ae,2),Tt=C(gt),ft=C(Tt),mt=x(C(ft),2),ct=C(mt),Ot=x(mt,2);{var Me=Ye=>{var Ht=fX(),oi=C(Ht);X(()=>G(oi,`${u(_)??""} outdated`)),T(Ye,Ht)};q(Ot,Ye=>{u(_)>0&&Ye(Me)})}var Mt=x(Ot,2),je=C(Mt);let ot;var _t=x(ft,2),pi=C(_t),Rt=x(_t,2),Dt=C(Rt);{var kt=Ye=>{var Ht=pX();T(Ye,Ht)},qi=Ye=>{var Ht=mX();T(Ye,Ht)},Ki=Ye=>{var Ht=Ds(),oi=wt(Ht);_i(oi,17,()=>u(v),Ut=>Ut.name,(Ut,mi)=>{var An=yX();let un;var ji=C(An),sn=C(ji),Wn=C(sn),Ni=x(sn,2),on=C(Ni),Bn=x(Ni,2);{var Jn=at=>{var It=_X(),$t=C(It);X(()=>G($t,`→ v${u(n)[u(mi).name].latest??""}`)),T(at,It)};q(Bn,at=>{u(n)[u(mi).name]&&at(Jn)})}var kn=x(ji,2),Xi=C(kn);let On;var rn=C(Xi);{var Se=at=>{var It=vX();T(at,It)},Z=at=>{var It=bX();T(at,It)};q(rn,at=>{p[u(mi).name]?at(Se):at(Z,-1)})}var Pe=x(Xi,2);X(()=>{un=Kt(An,1,"dep-row svelte-twakcj",null,un,{"dep-busy":!!p[u(mi).name]}),Hn(sn,"href",u(mi).url??`https://www.npmjs.com/package/${u(mi).name}`),G(Wn,u(mi).name),G(on,u(mi).installedVersion??u(mi).version),On=Kt(Xi,1,"icon-btn svelte-twakcj",null,On,{"icon-btn--update":!!u(n)[u(mi).name]}),Xi.disabled=!!p[u(mi).name],Hn(Xi,"title",u(n)[u(mi).name]?`Update to v${u(n)[u(mi).name].latest}`:"Update to latest"),Pe.disabled=!!p[u(mi).name]}),oe("click",Xi,()=>ie(u(mi).name)),oe("click",Pe,()=>F(u(mi).name)),T(Ut,An)}),T(Ye,Ht)};q(Dt,Ye=>{u(t).length===0?Ye(kt):u(v).length===0?Ye(qi,1):Ye(Ki,-1)})}var Mn=x(Tt,2),cn=x(C(Mn),2),Vi=C(cn),dn=x(Vi,2),hn=C(dn),Nn=x(cn,2);{var jn=Ye=>{var Ht=LX();_i(Ht,21,()=>u(a),oi=>oi.name,(oi,Ut)=>{var mi=xX(),An=C(mi),un=C(An),ji=C(un),sn=x(un,2),Wn=C(sn),Ni=x(sn,2);{var on=Se=>{var Z=wX(),Pe=C(Z);X(()=>G(Pe,u(Ut).author)),T(Se,Z)};q(Ni,Se=>{u(Ut).author&&Se(on)})}var Bn=x(Ni,2);{var Jn=Se=>{var Z=SX(),Pe=C(Z);X(at=>{Hn(Z,"title",u(Ut).date),G(Pe,at)},[()=>N(u(Ut).date)]),T(Se,Z)};q(Bn,Se=>{u(Ut).date&&Se(Jn)})}var kn=x(Bn,2);{var Xi=Se=>{var Z=CX(),Pe=C(Z);X(()=>G(Pe,u(Ut).description)),T(Se,Z)};q(kn,Se=>{u(Ut).description&&Se(Xi)})}var On=x(An,2),rn=C(On);X(()=>{Hn(un,"href",u(Ut).url??`https://www.npmjs.com/package/${u(Ut).name}`),G(ji,u(Ut).name),G(Wn,u(Ut).version),On.disabled=!!p[u(Ut).name],G(rn,p[u(Ut).name]?"Installing…":"Install")}),oe("click",On,()=>z(u(Ut).name)),T(oi,mi)}),T(Ye,Ht)};q(Nn,Ye=>{u(a).length>0&&Ye(jn)})}var xn=x(Nn,2);{var Rn=Ye=>{var Ht=kX(),oi=C(Ht);X(()=>G(oi,u(f))),T(Ye,Ht)};q(xn,Ye=>{u(f)&&Ye(Rn)})}var _n=x(xn,2);{var Un=Ye=>{var Ht=IX();T(Ye,Ht)};q(_n,Ye=>{!u(a).length&&!u(f)&&Ye(Un)})}X(()=>{G(ct,u(t).length),Mt.disabled=u(s),ot=Kt(je,0,"svelte-twakcj",null,ot,{spinning:u(s)}),dn.disabled=u(h),G(hn,u(h)?"Searching…":"Search")}),oe("click",Mt,D),Ei(pi,()=>u(i),Ye=>I(i,Ye)),oe("keydown",Vi,Ye=>Ye.key==="Enter"&&P()),Ei(Vi,()=>u(r),Ye=>I(r,Ye)),oe("click",dn,P),T(o,Y),Do()}mr(["click","keydown"]);var PX=R('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),TX=R('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),MX=R('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),NX=R('<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"><polyline points="4 4 4 10 10 10"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> </button>'),RX=R('<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"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> </button></div></div>'),AX=R('<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),OX=R('<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),FX=R('<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></dl>'),HX=R('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),WX=R('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><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"><path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path><line x1="12" y1="2" x2="12" y2="12"></line></svg> Restart daemon</button></div></div>'),BX=R('<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"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg></button>'),zX=R('<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"><polyline points="5,3 1,8 5,13"></polyline><polyline points="11,3 15,8 11,13"></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"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1"></rect><path d="M2,11 V5 H5 V11"></path><path d="M6,12 V5 H9 V8 H6"></path><path d="M10,11 V5 H15 V11"></path><line x1="12.5" y1="5" x2="12.5" y2="11"></line></svg> Packages</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle"><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"></path></svg> MQTT</button> <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"><path d="M8,2 L8,7"></path><path d="M6,5 L8,7.5 L10,5"></path><path d="M2.5,14 L6,10"></path><path d="M6.2,12.8 L6,10 L3.2,10.2"></path><path d="M13.5,14 L10,10"></path><path d="M9.8,12.8 L10,10 L12.8,10.2"></path></svg> Matter</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="8" cy="4.5" rx="5" ry="1.8"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7"></path><path d="M3,8 a5,1.8 0,0,0 10,0"></path></svg> DB</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="2" y1="5" x2="14" y2="5"></line><line x1="2" y1="8" x2="14" y2="8"></line><line x1="2" y1="11" x2="9" y2="11"></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"><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"></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"><line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></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"><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"></path><circle cx="12" cy="12" r="3"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),VX=R('<div class="login-error svelte-1n46o8q"> </div>'),jX=R('<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>'),UX=R('<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"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> Updating smart-home-engine…</div></div>'),$X=R("<!> <!> <!>",1);function qX(o,e){Io(e,!0);const t=["scripts","mqtt","matter","db","logs","config","packages"];function i(){const mt=location.hash.slice(1);return t.includes(mt)?mt:"scripts"}let n=V(wi(i())),s=V(null),r=V(!1),a=V(!1),c=V(!1),h=V(!1),g=V("none"),f=V(""),p=V(!1),v=V(""),_=V(""),w=V(!1),S=V(!1);W7(()=>{I(p,!0)});async function D(){I(_,""),I(w,!0);try{await V7(u(v)),I(v,""),I(p,!1)}catch(mt){I(_,mt.message??"Login failed",!0)}finally{I(w,!1)}}async function P(){if(u(g)==="proxy"&&u(f)){window.location.href=u(f);return}await j7(),I(p,!0)}let N=V(null);async function z(){if(await u(N).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))try{await G7(),setTimeout(()=>location.reload(),2500)}catch{}}async function F(){I(c,!0);try{const mt=await X7();u(s)&&I(s,{...u(s),latestVersion:mt.latestVersion??void 0},!0)}catch{}finally{I(c,!1)}}async function ie(){var Ot;if(!await u(N).show(`Update to v${(Ot=u(s))==null?void 0:Ot.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;I(a,!1),I(h,!0);try{await Z7()}catch{}let mt=!1;const ct=Date.now()+18e4;for(;Date.now()<ct;){await new Promise(Me=>setTimeout(Me,2e3));try{if(await Qx(),mt){location.reload();return}}catch{mt=!0}}location.reload()}function Y(mt){I(n,mt,!0),location.hash=mt}Vr(async()=>{location.hash||(location.hash=u(n));const mt=()=>{I(n,i(),!0)};window.addEventListener("hashchange",mt);try{const Me=await z7();I(g,Me.mode,!0),I(f,Me.proxyLogoutUrl??"",!0),u(g)==="password"&&(await fetch("/she/scripts")).status===401&&I(p,!0)}catch{}I(S,!0);async function ct(){try{I(s,await Qx(),!0)}catch{}}ct();const Ot=setInterval(ct,5e3);return()=>{window.removeEventListener("hashchange",mt),clearInterval(Ot)}});var ge=$X();es("click",zP,()=>{u(r)&&I(r,!1),u(a)&&I(a,!1)});var _e=wt(ge);{var Ae=mt=>{var ct=zX(),Ot=C(ct),Me=x(C(Ot),2);let Mt;var je=x(Me,2);let ot;var _t=x(je,2);let pi;var Rt=x(_t,2);let Dt;var kt=x(Rt,2);let qi;var Ki=x(kt,2);let Mn;var cn=x(Ki,4),Vi=x(C(cn),2),dn=C(Vi),hn=C(dn);hn.nodeValue="v0.24.1 ";var Nn=x(hn);{var jn=Ge=>{var fe=PX();T(Ge,fe)};q(Nn,Ge=>{var fe;(fe=u(s))!=null&&fe.latestVersion&&Ge(jn)})}var xn=x(dn,2);{var Rn=Ge=>{var fe=RX(),Ie=C(fe),et=x(C(Ie));et.textContent="v0.24.1";var Zt=x(et,2);{var bt=Ce=>{var Ue=TX(),pt=x(wt(Ue)),Xe=C(pt);X(()=>G(Xe,`v${u(s).latestVersion??""}`)),T(Ce,Ue)},Oe=Ce=>{var Ue=MX();T(Ce,Ue)};q(Zt,Ce=>{var Ue;(Ue=u(s))!=null&&Ue.latestVersion?Ce(bt):Ce(Oe,-1)})}var yt=x(Ie,2),Xt=C(yt);{var Yt=Ce=>{var Ue=NX(),pt=x(C(Ue));X(()=>G(pt,` Update to v${u(s).latestVersion??""}`)),oe("click",Ue,ie),T(Ce,Ue)};q(Xt,Ce=>{var Ue;(Ue=u(s))!=null&&Ue.latestVersion&&Ce(Yt)})}var ti=x(Xt,2),ii=C(ti);let te;var he=x(ii);X(()=>{ti.disabled=u(c),te=Kt(ii,0,"svelte-1n46o8q",null,te,{spinning:u(c)}),G(he,` ${u(c)?"Checking…":"Check for updates"}`)}),oe("click",fe,Ce=>Ce.stopPropagation()),oe("click",ti,F),T(Ge,fe)};q(xn,Ge=>{u(a)&&Ge(Rn)})}var _n=x(Vi,2),Un=C(_n),Ye=x(Un,2);{var Ht=Ge=>{var fe=WX(),Ie=C(fe);{var et=yt=>{var Xt=FX(),Yt=x(C(Xt)),ti=C(Yt),ii=x(Yt,3),te=C(ii),he=x(ii,3),Ce=C(he),Ue=x(he,2);{var pt=qt=>{var $=AX(),j=x(wt($)),K=C(j),ue=x(j,3),le=C(ue);X(()=>{G(K,u(s).matterNodes??0),G(le,u(s).matterEndpoints??0)}),T(qt,$)};q(Ue,qt=>{u(s).matterEnabled&&qt(pt)})}var Xe=x(Ue,2);{var Et=qt=>{var $=OX(),j=x(wt($)),K=C(j),ue=x(j,3),le=C(ue);X(()=>{G(K,u(s).dbDocs??"—"),G(le,u(s).dbViews??"—")}),T(qt,$)};q(Xe,qt=>{u(s).dbEnabled&&qt(Et)})}var li=x(Xe,3),hi=C(li),ni=x(li,3),Gi=C(ni),vn=x(ni,3),Ri=C(vn);X(()=>{G(ti,u(s).scripts),G(te,u(s).topics),G(Ce,u(s).mqttMsgPerSec??"—"),G(hi,u(s).handlers??"—"),G(Gi,u(s).memMb!=null?u(s).memMb+" MB":"—"),G(Ri,u(s).cpuPercent!=null?u(s).cpuPercent+" %":"—")}),T(yt,Xt)},Zt=yt=>{var Xt=HX();T(yt,Xt)};q(Ie,yt=>{u(s)?yt(et):yt(Zt,-1)})}var bt=x(Ie,2),Oe=C(bt);oe("click",fe,yt=>yt.stopPropagation()),oe("click",Oe,()=>{I(r,!1),z()}),T(Ge,fe)};q(Ye,Ge=>{u(r)&&Ge(Ht)})}var oi=x(_n,2);let Ut;var mi=x(oi,2);{var An=Ge=>{var fe=BX();oe("click",fe,P),T(Ge,fe)};q(mi,Ge=>{u(g)==="password"&&Ge(An)})}var un=x(Ot,2),ji=C(un);Ss(tm(ji,{}),Ge=>I(N,Ge,!0),()=>u(N));var sn=x(ji,2);let Wn;var Ni=C(sn);{let Ge=st(()=>u(n)==="scripts");nG(Ni,{get active(){return u(Ge)}})}var on=x(sn,2);let Bn;var Jn=C(on);EX(Jn,{});var kn=x(on,2);let Xi;var On=C(kn);hX(On,{});var rn=x(kn,2);let Se;var Z=C(rn);B9(Z,{});var Pe=x(rn,2);let at;var It=C(Pe);XZ(It,{});var $t=x(Pe,2);let H;var O=C($t);VG(O,{});var ee=x($t,2);let ke;var Je=C(ee);qG(Je,{}),X(()=>{Mt=Kt(Me,1,"svelte-1n46o8q",null,Mt,{active:u(n)==="scripts"}),ot=Kt(je,1,"svelte-1n46o8q",null,ot,{active:u(n)==="packages"}),pi=Kt(_t,1,"svelte-1n46o8q",null,pi,{active:u(n)==="mqtt"}),Dt=Kt(Rt,1,"svelte-1n46o8q",null,Dt,{active:u(n)==="matter"}),qi=Kt(kt,1,"svelte-1n46o8q",null,qi,{active:u(n)==="db"}),Mn=Kt(Ki,1,"svelte-1n46o8q",null,Mn,{active:u(n)==="logs"}),Ut=Kt(oi,1,"nav-settings svelte-1n46o8q",null,Ut,{active:u(n)==="config"}),Wn=Kt(sn,1,"page-wrap svelte-1n46o8q",null,Wn,{hidden:u(n)!=="scripts"}),Bn=Kt(on,1,"page-wrap svelte-1n46o8q",null,Bn,{hidden:u(n)!=="packages"}),Xi=Kt(kn,1,"page-wrap svelte-1n46o8q",null,Xi,{hidden:u(n)!=="mqtt"}),Se=Kt(rn,1,"page-wrap svelte-1n46o8q",null,Se,{hidden:u(n)!=="matter"}),at=Kt(Pe,1,"page-wrap svelte-1n46o8q",null,at,{hidden:u(n)!=="db"}),H=Kt($t,1,"page-wrap svelte-1n46o8q",null,H,{hidden:u(n)!=="config"}),ke=Kt(ee,1,"page-wrap svelte-1n46o8q",null,ke,{hidden:u(n)!=="logs"})}),oe("click",Me,()=>Y("scripts")),oe("click",je,()=>Y("packages")),oe("click",_t,()=>Y("mqtt")),oe("click",Rt,()=>Y("matter")),oe("click",kt,()=>Y("db")),oe("click",Ki,()=>Y("logs")),oe("click",dn,Ge=>{Ge.stopPropagation(),I(a,!u(a)),I(r,!1)}),oe("click",Un,Ge=>{Ge.stopPropagation(),I(r,!u(r)),I(a,!1)}),oe("click",oi,()=>Y("config")),T(mt,ct)};q(_e,mt=>{u(S)&&!u(p)&&mt(Ae)})}var Le=x(_e,2);{var gt=mt=>{var ct=jX(),Ot=C(ct),Me=x(C(Ot),4),Mt=x(C(Me),2),je=x(Me,2);{var ot=Rt=>{var Dt=VX(),kt=C(Dt);X(()=>G(kt,u(_))),T(Rt,Dt)};q(je,Rt=>{u(_)&&Rt(ot)})}var _t=x(je,2),pi=C(_t);X(()=>{Mt.disabled=u(w),_t.disabled=u(w)||!u(v),G(pi,u(w)?"Signing in…":"Sign in")}),es("submit",Ot,Rt=>{Rt.preventDefault(),D()}),Ei(Mt,()=>u(v),Rt=>I(v,Rt)),T(mt,ct)};q(Le,mt=>{u(p)&&mt(gt)})}var Tt=x(Le,2);{var ft=mt=>{var ct=UX();T(mt,ct)};q(Tt,mt=>{u(h)&&mt(ft)})}T(o,ge),Do()}mr(["click"]);rW(qX,{target:document.getElementById("app")});export{wT as t};
225
+ *[stopped]*`,toolEvents:u(Le).length>0?[...u(Le)]:void 0}],!0)}else I(c,j.message,!0)}finally{D=null,I(s,null),I(Le,[],!0),I(a,!1)}}}function Ut(){D==null||D.abort()}function mi($){$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),oi())}function An(){I(n,[],!0),I(c,"")}const un=["Write a view to list all document IDs","Write a view to sum a numeric property across all documents","Write a view that filters to a specific prefix and emits a field","Write a reduce that returns the maximum value","Explain how the current view works"];function ji($){I(r,$,!0),Tt==null||Tt.focus()}var sn=EZ(),Wn=wt(sn),Ni=C(Wn),on=x(C(Ni),2);{var Bn=$=>{var j=KG(),K=C(j);{var ue=De=>{var pe=Rr();X(()=>G(pe,`${u(h).provider??""} · ${(u(f)||u(h).model)??""}`)),T(De,pe)},le=De=>{var pe=Rr("Not configured");T(De,pe)};q(K,De=>{u(ct)?De(ue):De(le,-1)})}X(()=>Hn(j,"title",`Provider: ${u(h).provider??""}`)),T($,j)};q(on,$=>{u(h)&&$(Bn)})}var Jn=x(on,2);{var kn=$=>{var j=GG();oe("click",j,An),T($,j)};q(Jn,$=>{u(n).length>0&&$(kn)})}var Xi=x(Ni,2),On=C(Xi);{var rn=$=>{var j=ZG();T($,j)},Se=$=>{var j=JG(),K=C(j),ue=C(K);{var le=Fe=>{var lt=XG(),Ve=x(wt(lt)),Ke=C(Ve);X(()=>G(Ke,t().id)),T(Fe,lt)},De=Fe=>{var lt=Rr("No view selected. Ask a general sheDB view question.");T(Fe,lt)};q(ue,Fe=>{t()?Fe(le):Fe(De,-1)})}var pe=x(K,2);_i(pe,17,()=>un,En,(Fe,lt)=>{var Ve=YG(),Ke=C(Ve);X(()=>G(Ke,u(lt))),oe("click",Ve,()=>ji(u(lt))),T(Fe,Ve)}),T($,j)};q(On,$=>{u(ct)?u(n).length===0&&u(s)===null&&$(Se,1):$(rn)})}var Z=x(On,2);_i(Z,17,()=>u(n),En,($,j,K)=>{var ue=sZ(),le=C(ue);{var De=Fe=>{var lt=QG(),Ve=C(lt);X(()=>G(Ve,u(j).content)),T(Fe,lt)},pe=Fe=>{const lt=st(()=>Mt(u(j).content)),Ve=st(()=>ot(u(lt)));var Ke=nZ(),si=wt(Ke);{var A=Te=>{var me=MD();_i(me,21,()=>u(j).toolEvents,En,(xe,Ze)=>{var Ee=Ds(),ve=wt(Ee);{var At=we=>{var xt=PD(),$e=x(C(xt)),Vt=C($e);X(ai=>G(Vt,ai),[()=>u(Ze).name.replace(/_/g," ")]),T(we,xt)},Ne=we=>{var xt=TD(),$e=x(C(xt)),Vt=C($e);X(ai=>G(Vt,ai),[()=>u(Ze).name.replace(/_/g," ")]),T(we,xt)};q(ve,we=>{u(Ze).type==="tool_call"?we(At):we(Ne,-1)})}T(xe,Ee)}),T(Te,me)};q(si,Te=>{var me;(me=u(j).toolEvents)!=null&&me.length&&Te(A)})}var J=x(si,2),He=C(J);_i(He,17,()=>u(lt),En,(Te,me,xe)=>{var Ze=Ds(),Ee=wt(Ze);{var ve=Ne=>{var we=ND();Wl(we,()=>Ki(u(me).text),!0),T(Ne,we)},At=Ne=>{const we=st(()=>`${K}:${xe}`),xt=st(()=>Dt(u(me).text)),$e=st(()=>u(p).has(u(we))),Vt=st(()=>u(me).lang==="filter");var ai=tZ(),be=C(ai),qe=C(be),rt=C(qe),Wt=x(qe,2),tt=C(Wt),ui=x(be,2);let ri;var Ti=C(ui),Jt=C(Ti);Wl(Jt,()=>qi(u(me).text,u(me).lang??""),!0);var Bt=x(Ti,2);{var Ui=tn=>{var bn=eZ(),$n=C(bn);X(()=>G($n,u($e)?"▲ collapse":"▼ expand")),oe("click",bn,()=>kt(u(we))),T(tn,bn)};q(Bt,tn=>{u(xt)&&tn(Ui)})}X(()=>{G(rt,u(Vt)?"filter":u(me).lang),ri=Kt(ui,1,"code-body svelte-1twuiul",null,ri,{collapsed:u(xt)&&!u($e)})}),oe("click",tt,()=>cn(u(me).text)),T(Ne,ai)};q(Ee,Ne=>{u(me).type==="text"?Ne(ve):Ne(At,-1)})}T(Te,Ze)});var dt=x(He,2);{var it=Te=>{var me=iZ(),xe=C(me),Ze=C(xe);X(Ee=>G(Ze,Ee),[()=>pi(u(Ve))]),oe("click",xe,()=>e.onApplyView(u(Ve))),T(Te,me)},zt=st(()=>_t(u(Ve))&&e.onApplyView);q(dt,Te=>{u(zt)&&Te(it)})}T(Fe,Ke)};q(le,Fe=>{u(j).role==="user"?Fe(De):Fe(pe,-1)})}X(()=>Kt(ue,1,`message ${u(j).role??""}`,"svelte-1twuiul")),T($,ue)});var Pe=x(Z,2);{var at=$=>{var j=MD();_i(j,21,()=>u(Le),En,(K,ue)=>{var le=Ds(),De=wt(le);{var pe=lt=>{var Ve=PD(),Ke=x(C(Ve)),si=C(Ke);X(A=>G(si,A),[()=>u(ue).name.replace(/_/g," ")]),T(lt,Ve)},Fe=lt=>{var Ve=TD(),Ke=x(C(Ve)),si=C(Ke);X(A=>G(si,A),[()=>u(ue).name.replace(/_/g," ")]),T(lt,Ve)};q(De,lt=>{u(ue).type==="tool_call"?lt(pe):lt(Fe,-1)})}T(K,le)}),T($,j)};q(Pe,$=>{u(Le).length>0&&$(at)})}var It=x(Pe,2);{var $t=$=>{var j=oZ(),K=C(j),ue=C(K),le=C(ue);X(()=>G(le,N[u(P)])),T($,j)};q(It,$=>{u(a)&&u(s)===null&&u(Le).length===0&&$($t)})}var H=x(It,2);{var O=$=>{var j=aZ(),K=C(j);_i(K,21,()=>je(u(s)),En,(ue,le)=>{var De=Ds(),pe=wt(De);{var Fe=Ve=>{var Ke=ND();Wl(Ke,()=>Ki(u(le).text),!0),T(Ve,Ke)},lt=Ve=>{var Ke=rZ(),si=C(Ke),A=C(si),J=C(A),He=x(si,2),dt=C(He);Wl(dt,()=>qi(u(le).text,u(le).lang??""),!0),X(()=>G(J,u(le).lang)),T(Ve,Ke)};q(pe,Ve=>{u(le).type==="text"?Ve(Fe):Ve(lt,-1)})}T(ue,De)}),T($,j)};q(H,$=>{u(s)!==null&&$(O)})}Ss(Xi,$=>ft=$,()=>ft);var ee=x(Xi,2);{var ke=$=>{var j=lZ(),K=C(j);X(()=>G(K,u(c))),T($,j)};q(ee,$=>{u(c)&&$(ke)})}var Je=x(ee,2),Ge=C(Je),fe=C(Ge),Ie=x(Ge,2),et=C(Ie),Zt=x(Ie,2),bt=C(Zt),Oe=x(Zt,2),yt=C(Oe),Xt=x(Je,2),Yt=C(Xt);{var ti=$=>{var j=cZ();let K;var ue=x(C(j),2),le=C(ue),De=x(ue,2),pe=C(De);X(()=>{K=Kt(j,1,"file-chip svelte-1twuiul",null,K,{inactive:!u(ge)}),G(le,t().id),Hn(De,"title",u(ge)?"Remove from context":"Re-add to context"),G(pe,u(ge)?"×":"+")}),oe("click",De,()=>I(ge,!u(ge))),T($,j)};q(Yt,$=>{t()&&$(ti)})}var ii=x(Yt,2);_i(ii,17,()=>u(Y),En,($,j,K)=>{const ue=st(()=>hn(u(j).name));var le=dZ(),De=C(le),pe=C(De),Fe=x(De,2),lt=C(Fe),Ve=x(Fe,2);X((Ke,si)=>{Kt(De,1,`badge badge-${Ke??""}`,"svelte-1twuiul"),G(pe,si),G(lt,u(j).name)},[()=>u(ue).toLowerCase(),()=>Nn(u(ue))]),oe("click",Ve,()=>jn(K)),T($,le)});var te=x(ii,2),he=x(te,2);Ss(he,$=>Ae=$,()=>Ae);var Ce=x(Xt,2);let Ue;var pt=C(Ce);let Xe;var Et=C(pt);Ss(Et,$=>Tt=$,()=>Tt);var li=x(pt,2);{var hi=$=>{var j=hZ();oe("click",j,Ut),T($,j)},ni=$=>{var j=uZ();X(K=>j.disabled=K,[()=>!u(r).trim()||!u(ct)]),oe("click",j,oi),T($,j)};q(li,$=>{u(a)?$(hi):$(ni,-1)})}var Gi=x(Ce,2);{var vn=$=>{var j=_Z(),K=C(j),ue=C(K),le=x(K,2);{var De=Ve=>{var Ke=fZ();_i(Ke,21,()=>u(g),En,(si,A)=>{var J=gZ(),He=C(J),dt={};X(()=>{G(He,u(A)),dt!==(dt=u(A))&&(J.value=(J.__value=u(A))??"")}),T(si,J)}),X(()=>Ke.disabled=u(a)),ha(Ke,()=>u(f),si=>I(f,si)),T(Ve,Ke)},pe=Ve=>{var Ke=pZ(),si=C(Ke);X(()=>G(si,u(f)||u(h).model)),T(Ve,Ke)};q(le,Ve=>{u(g).length>0?Ve(De):Ve(pe,-1)})}var Fe=x(le,2);{var lt=Ve=>{var Ke=mZ();oe("click",Ke,Vi),T(Ve,Ke)};q(Fe,Ve=>{u(h).provider==="ollama"&&Ve(lt)})}X(()=>G(ue,u(h).provider)),T($,j)};q(Gi,$=>{u(ct)&&u(h)&&$(vn)})}var Ri=x(Wn,2);{var qt=$=>{var j=DZ(),K=C(j),ue=C(K),le=C(ue),De=C(le),pe=x(le,2),Fe=x(ue,2),lt=C(Fe);{var Ve=A=>{var J=vZ();T(A,J)},Ke=A=>{var J=bZ(),He=C(J);X(()=>G(He,u(S))),T(A,J)},si=A=>{var J=IZ(),He=C(J);{var dt=Ne=>{var we=yZ(),xt=x(wt(we)),$e=C(xt);X(()=>G($e,u(_).version)),T(Ne,we)};q(He,Ne=>{u(_).version&&Ne(dt)})}var it=x(He,2);{var zt=Ne=>{var we=wZ(),xt=x(wt(we)),$e=C(xt);X(()=>G($e,u(_).details.family)),T(Ne,we)};q(it,Ne=>{var we;(we=u(_).details)!=null&&we.family&&Ne(zt)})}var Te=x(it,2);{var me=Ne=>{var we=SZ(),xt=x(wt(we)),$e=C(xt);X(()=>G($e,u(_).details.parameter_size)),T(Ne,we)};q(Te,Ne=>{var we;(we=u(_).details)!=null&&we.parameter_size&&Ne(me)})}var xe=x(Te,2);{var Ze=Ne=>{var we=CZ(),xt=x(wt(we)),$e=C(xt);X(()=>G($e,u(_).details.quantization_level)),T(Ne,we)};q(xe,Ne=>{var we;(we=u(_).details)!=null&&we.quantization_level&&Ne(Ze)})}var Ee=x(xe,2);{var ve=Ne=>{var we=LZ(),xt=x(wt(we),2);_i(xt,21,()=>u(_).running,En,($e,Vt)=>{var ai=xZ(),be=C(ai);X(qe=>G(be,`${u(Vt).name??""} · ${qe??""} VRAM`),[()=>dn(u(Vt).size_vram)]),T($e,ai)}),T(Ne,we)},At=Ne=>{var we=kZ();T(Ne,we)};q(Ee,Ne=>{u(_).running&&u(_).running.length>0?Ne(ve):u(_).running!==null&&Ne(At,1)})}T(A,J)};q(lt,A=>{u(w)?A(Ve):u(S)?A(Ke,1):u(_)&&A(si,2)})}X(()=>{var A;return G(De,`Ollama · ${(u(f)||((A=u(h))==null?void 0:A.model))??""}`)}),oe("click",j,()=>I(v,!1)),oe("click",K,A=>A.stopPropagation()),oe("click",pe,()=>I(v,!1)),T($,j)};q(Ri,$=>{u(v)&&$(qt)})}X($=>{G(yt,$),Ue=Kt(Ce,1,"input-row svelte-1twuiul",null,Ue,{"drag-over":u(_e)}),Xe=Kt(pt,1,"textarea-wrap svelte-1twuiul",null,Xe,{loading:u(a)}),Hn(Et,"placeholder",u(ct)?"Ask anything… (Enter to send, Shift+Enter for newline, drag & drop files to add context)":"AI not configured"),Et.disabled=u(a)||!u(ct)},[()=>dn(u(Ot))]),qs(fe,()=>u(z),$=>I(z,$)),qs(et,()=>u(F),$=>I(F,$)),qs(bt,()=>u(ie),$=>I(ie,$)),oe("click",te,xn),oe("change",he,_n),es("dragover",Ce,Ye),es("dragleave",Ce,Ht),es("drop",Ce,Un),oe("keydown",Et,mi),Ei(Et,()=>u(r),$=>I(r,$)),T(o,sn),Do()}mr(["click","change","keydown"]);var TZ=R('<div class="me svelte-1pxdb1"></div>');function Aw(o,e){Io(e,!0);let t=eg(e,"value",15,""),i=eg(e,"language",3,"javascript"),n,s,r=!1;Vr(()=>{const c=i()==="json"?{formatOnPaste:!0,autoIndent:"full"}:{};s=Fa.create(n,{value:t(),language:i(),theme:"vs-dark",minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,fontFamily:"'Cascadia Code', 'Fira Code', monospace",automaticLayout:!0,wordWrap:"on",lineNumbers:"on",renderLineHighlight:"none",overviewRulerLanes:0,scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6},...c}),s.onDidChangeModelContent(()=>{r||t(s.getValue())})}),oy(()=>s==null?void 0:s.dispose()),Dn(()=>{!s||s.getValue()===t()||(r=!0,s.setValue(t()),r=!1)});var a=TZ();Ss(a,c=>n=c,()=>n),T(o,a),Do()}var MZ=R('<!> <div class="welcome svelte-rrt0o"><div class="welcome-inner svelte-rrt0o"><div class="welcome-logo svelte-rrt0o">db</div> <p class="welcome-sub svelte-rrt0o">sheDB — embedded JSON document store with MapReduce views</p> <div class="welcome-hint svelte-rrt0o"><strong>In scripts:</strong> use <code class="svelte-rrt0o">she.db.get(id)</code>, <code class="svelte-rrt0o">she.db.set(id, doc)</code>, <code class="svelte-rrt0o">she.db.extend(id, partial)</code>, <code class="svelte-rrt0o">she.db.sub(pattern, cb)</code>.<br/> <strong>Views:</strong> <code class="svelte-rrt0o">this</code> = current document &mdash; call <code class="svelte-rrt0o">emit(value)</code> to add to result.</div> <div class="welcome-links svelte-rrt0o"><a href="https://github.com/hobbyquaker/she/blob/main/doc/db/README.md" target="_blank" rel="noopener" class="svelte-rrt0o">sheDB docs</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she/blob/main/doc/db/view-examples.md" target="_blank" rel="noopener" class="svelte-rrt0o">View examples</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" class="svelte-rrt0o">GitHub</a></div></div></div>',1),NZ=R('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><line x1="5.5" y1="5" x2="4" y2="2.5"></line><line x1="10.5" y1="5" x2="12" y2="2.5"></line><path d="M3 11 V7 A5 3.5 0 0 0 13 7 V11 Z" stroke-linejoin="round"></path><circle cx="6" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle><circle cx="10" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle></svg> AI</button>'),RD=R('<div class="form-error svelte-rrt0o"> </div>'),RZ=R('<div class="new-item-form svelte-rrt0o"><input placeholder="device/lamp1" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),AD=R("<li> </li>"),OD=R('<div class="error-bar svelte-rrt0o"> </div>'),FD=R('<div class="loading svelte-rrt0o">Loading…</div>'),AZ=R('<div class="monaco-doc-wrap svelte-rrt0o"><!></div>'),OZ=R('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),FZ=R('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ Doc</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main></div>'),HZ=R('<div class="new-item-form svelte-rrt0o"><input placeholder="myView" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),WZ=R('<label class="opt-check svelte-rrt0o"><input type="checkbox" class="svelte-rrt0o"/> <span class="checkmark svelte-rrt0o"></span> Retain <span class="section-hint svelte-rrt0o">— send as retained MQTT message</span></label>'),BZ=R('<span class="badge-error svelte-rrt0o">error</span>'),zZ=R('<span class="badge-ok svelte-rrt0o"> </span>'),VZ=R('<pre class="result-error svelte-rrt0o"> </pre>'),jZ=R('<pre class="result-json svelte-rrt0o"> </pre>'),UZ=R('<div class="view-result svelte-rrt0o"><div class="result-header svelte-rrt0o">Result <!></div> <!></div>'),$Z=R('<div class="view-sections svelte-rrt0o"><div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Description <span class="section-hint svelte-rrt0o">— optional, shown in sidebar</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="(optional description)"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Filter <span class="section-hint svelte-rrt0o">— MQTT wildcard, optional</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="#"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Map <span class="section-hint svelte-rrt0o">— <code>this</code> = document &nbsp;·&nbsp; call <code>emit(this)</code> to include in result</span></div> <div class="monaco-view-wrap monaco-view-wrap--map svelte-rrt0o"><!></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Reduce <span class="section-hint svelte-rrt0o">— receives <code>result</code> array, must <code>return</code> new value (optional)</span></div> <div class="monaco-view-wrap monaco-view-wrap--reduce svelte-rrt0o"><!></div></div> <div class="view-section view-section--options svelte-rrt0o"><label class="opt-check svelte-rrt0o"><input type="checkbox" class="svelte-rrt0o"/> <span class="checkmark svelte-rrt0o"></span> Publish to MQTT <span class="section-hint svelte-rrt0o">— publish view to MQTT topic <code> </code></span></label> <!></div> <!></div>'),qZ=R('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button title="Re-run view" class="svelte-rrt0o">Refresh</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),KZ=R('<div class="chat-resize-handle svelte-rrt0o" role="separator"></div> <div class="chat-pane svelte-rrt0o"><!></div>',1),GZ=R('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ View</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main> <!></div>'),ZZ=R('<div class="db-root svelte-rrt0o" role="presentation"><div class="panel-tabs svelte-rrt0o"><button>Documents</button> <button>Views</button> <!></div> <!></div>');function XZ(o,e){Io(e,!0);const t=Se=>{var Z=MZ(),Pe=wt(Z);Ss(tm(Pe,{}),at=>jn=at,()=>jn),T(Se,Z)};let i=V(wi([])),n=V(null),s=V("{}"),r=V(!1),a=V(null);const c="she-db-selected-view";let h=V(wi([])),g=V(wi(localStorage.getItem(c))),f=V("#"),p=V("// emit(this.someProperty)"),v=V(""),_=V(""),w=V(!1),S=V(!1),D=V(null),P=V(!1),N=V(null),z=V("she/db/view/");const F="she-db-panel";let ie=V(wi(localStorage.getItem(F)??"docs")),Y=V(""),ge=V(!1),_e=V(null),Ae=V(""),Le=V(!1),gt=V(null);const Tt="she-db-sidebar-width";let ft=V(wi(parseInt(localStorage.getItem(Tt)??"220",10))),mt=!1,ct=0,Ot=0;const Me="she-db-chat-width",Mt="she-db-chat-open";let je=V(localStorage.getItem(Mt)==="true"),ot=V(wi(parseInt(localStorage.getItem(Me)??"320",10))),_t=!1,pi=0,Rt=0;const Dt=st(()=>u(g)?{id:u(g),filter:u(f),map:u(p),reduce:u(v)}:null);function kt(Se){Se.filter!==void 0&&I(f,Se.filter,!0),Se.map!==void 0&&I(p,Se.map,!0),Se.reduce!==void 0&&I(v,Se.reduce,!0)}Dn(()=>{localStorage.setItem(Mt,String(u(je)))}),Dn(()=>{localStorage.setItem(F,u(ie))}),Dn(()=>{u(g)?localStorage.setItem(c,u(g)):localStorage.removeItem(c)});function qi(Se){mt=!0,ct=Se.clientX,Ot=u(ft),Se.preventDefault()}function Ki(Se){mt&&I(ft,Math.max(140,Math.min(500,Ot+Se.clientX-ct)),!0),_t&&I(ot,Math.max(240,Math.min(600,Rt-(Se.clientX-pi))),!0)}function Mn(){mt&&(mt=!1,localStorage.setItem(Tt,String(u(ft)))),_t&&(_t=!1,localStorage.setItem(Me,String(u(ot))))}function cn(Se){_t=!0,pi=Se.clientX,Rt=u(ot),Se.preventDefault()}async function Vi(){try{I(i,await eR(),!0)}catch{}}async function dn(){try{I(h,await tR(),!0)}catch{}}async function hn(Se){I(n,Se,!0),I(a,null),I(r,!0);try{const Z=await e8(Se);I(s,JSON.stringify(Z,null,2),!0)}catch(Z){I(a,Z instanceof Error?Z.message:String(Z),!0)}finally{I(r,!1)}}async function Nn(){if(u(n)){I(a,null);try{const Se=JSON.parse(u(s));await oD(u(n),Se)}catch(Se){I(a,Se instanceof Error?Se.message:String(Se),!0)}}}let jn;async function xn(){if(u(n)&&await jn.show(`Delete document "${u(n)}"?`,{confirm:"Delete",danger:!0}))try{await t8(u(n)),I(n,null),I(s,"{}")}catch(Se){I(a,Se instanceof Error?Se.message:String(Se),!0)}}async function Rn(){const Se=u(Y).trim();if(Se){I(_e,null);try{await oD(Se,{}),I(ge,!1),I(Y,""),await hn(Se)}catch(Z){I(_e,Z instanceof Error?Z.message:String(Z),!0)}}}async function _n(Se){I(g,Se,!0),I(N,null),I(P,!0),I(D,null);try{const Z=await i8(Se);I(f,Z.filter??"",!0),I(p,Z.map,!0),I(v,Z.reduce??"",!0),I(_,Z.description??"",!0),I(w,Z.mqttpub??!1,!0),I(S,Z.retain??!1,!0),I(D,await Nw(Se).catch(()=>null),!0)}catch(Z){I(N,Z instanceof Error?Z.message:String(Z),!0)}finally{I(P,!1)}}async function Un(){if(u(g)){I(N,null);try{const Se={map:u(p)};u(f).trim()&&(Se.filter=u(f).trim()),u(v).trim()&&(Se.reduce=u(v).trim()),u(_).trim()&&(Se.description=u(_).trim()),u(w)&&(Se.mqttpub=!0),u(S)&&(Se.retain=!0),await rD(u(g),Se)}catch(Se){I(N,Se instanceof Error?Se.message:String(Se),!0)}}}async function Ye(){if(u(g))try{I(D,await Nw(u(g)),!0)}catch(Se){I(N,Se instanceof Error?Se.message:String(Se),!0)}}async function Ht(){if(u(g)&&await jn.show(`Delete view "${u(g)}"?`,{confirm:"Delete",danger:!0}))try{await n8(u(g)),I(g,null),I(f,""),I(p,"// emit(this.someProperty)"),I(v,""),I(_,""),I(w,!1),I(S,!1),I(D,null)}catch(Se){I(N,Se instanceof Error?Se.message:String(Se),!0)}}async function oi(){if(!u(Ae).trim())return;const Se=u(Ae).trim();I(gt,null);try{await rD(Se,{map:"// emit(this.someProperty)"}),I(Le,!1),I(Ae,""),await dn(),await _n(Se)}catch(Z){I(gt,Z instanceof Error?Z.message:String(Z),!0)}}let Ut=V(""),mi=V(""),An=st(()=>[...u(i)].filter(Se=>!u(Ut)||Se.toLowerCase().includes(u(Ut).toLowerCase())).sort()),un=st(()=>[...u(h)].filter(Se=>!u(mi)||Se.toLowerCase().includes(u(mi).toLowerCase())).sort());Vr(()=>{Vi(),dn().then(()=>{u(g)&&u(h).includes(u(g))?_n(u(g)):I(g,null)}),QN().then(It=>{const $t=It.dbPrefix||"she/db/",H=$t.endsWith("/")?$t:$t+"/";I(z,H+"view/")}).catch(()=>{});const Se=Ul("db:ids",It=>{I(i,It.ids??[],!0)}),Z=Ul("db:viewIds",It=>{I(h,It.ids??[],!0)}),Pe=Ul("db:change",async It=>{const $t=It.id;u(n)===$t&&(It.doc===null?(I(n,null),I(s,"{}")):I(s,JSON.stringify(It.doc,null,2),!0))}),at=Ul("db:viewUpdate",async It=>{const $t=It.id;u(g)===$t&&I(D,await Nw($t).catch(()=>null),!0)});return()=>{Se(),Z(),Pe(),at()}});var ji=ZZ(),sn=C(ji),Wn=C(sn);let Ni;var on=x(Wn,2);let Bn;var Jn=x(on,2);{var kn=Se=>{var Z=NZ();let Pe;X(()=>{Pe=Kt(Z,1,"ai-toggle svelte-rrt0o",null,Pe,{"ai-open":u(je)}),Hn(Z,"title",u(je)?"Close AI assistant":"Open AI assistant")}),oe("click",Z,()=>I(je,!u(je))),T(Se,Z)};q(Jn,Se=>{u(ie)==="views"&&Se(kn)})}var Xi=x(sn,2);{var On=Se=>{var Z=FZ(),Pe=C(Z);let at;var It=C(Pe),$t=C(It),H=x(It,2);{var O=bt=>{var Oe=RZ(),yt=wt(Oe),Xt=C(yt),Yt=x(Xt,2),ti=x(yt,2);{var ii=te=>{var he=RD(),Ce=C(he);X(()=>G(Ce,u(_e))),T(te,he)};q(ti,te=>{u(_e)&&te(ii)})}oe("keydown",Xt,te=>te.key==="Enter"&&Rn()),Ei(Xt,()=>u(Y),te=>I(Y,te)),oe("click",Yt,Rn),T(bt,Oe)};q(H,bt=>{u(ge)&&bt(O)})}var ee=x(H,2),ke=C(ee),Je=x(ee,2);_i(Je,20,()=>u(An),bt=>bt,(bt,Oe)=>{var yt=AD();let Xt;var Yt=C(yt);X(()=>{Xt=Kt(yt,1,"flat-item svelte-rrt0o",null,Xt,{"active-item":u(n)===Oe}),G(Yt,Oe)}),oe("click",yt,()=>hn(Oe)),T(bt,yt)});var Ge=x(Pe,2),fe=x(Ge,2),Ie=C(fe);{var et=bt=>{var Oe=OZ(),yt=wt(Oe),Xt=C(yt),Yt=C(Xt),ti=x(Xt,2),ii=x(ti,2),te=x(yt,2);{var he=Xe=>{var Et=OD(),li=C(Et);X(()=>G(li,u(a))),T(Xe,Et)};q(te,Xe=>{u(a)&&Xe(he)})}var Ce=x(te,2);{var Ue=Xe=>{var Et=FD();T(Xe,Et)},pt=Xe=>{var Et=AZ(),li=C(Et);Aw(li,{language:"json",get value(){return u(s)},set value(hi){I(s,hi,!0)}}),T(Xe,Et)};q(Ce,Xe=>{u(r)?Xe(Ue):Xe(pt,-1)})}X(()=>G(Yt,u(n))),oe("click",ti,Nn),oe("click",ii,xn),T(bt,Oe)},Zt=bt=>{t(bt)};q(Ie,bt=>{u(n)?bt(et):bt(Zt,-1)})}X(()=>at=zo(Pe,"",at,{width:`${u(ft)??""}px`})),oe("click",$t,()=>{I(ge,!u(ge)),I(_e,null)}),Ei(ke,()=>u(Ut),bt=>I(Ut,bt)),oe("mousedown",Ge,qi),T(Se,Z)},rn=Se=>{var Z=GZ(),Pe=C(Z);let at;var It=C(Pe),$t=C(It),H=x(It,2);{var O=yt=>{var Xt=HZ(),Yt=wt(Xt),ti=C(Yt),ii=x(ti,2),te=x(Yt,2);{var he=Ce=>{var Ue=RD(),pt=C(Ue);X(()=>G(pt,u(gt))),T(Ce,Ue)};q(te,Ce=>{u(gt)&&Ce(he)})}oe("keydown",ti,Ce=>Ce.key==="Enter"&&oi()),Ei(ti,()=>u(Ae),Ce=>I(Ae,Ce)),oe("click",ii,oi),T(yt,Xt)};q(H,yt=>{u(Le)&&yt(O)})}var ee=x(H,2),ke=C(ee),Je=x(ee,2);_i(Je,20,()=>u(un),yt=>yt,(yt,Xt)=>{var Yt=AD();let ti;var ii=C(Yt);X(()=>{ti=Kt(Yt,1,"flat-item svelte-rrt0o",null,ti,{"active-item":u(g)===Xt}),G(ii,Xt)}),oe("click",Yt,()=>_n(Xt)),T(yt,Yt)});var Ge=x(Pe,2),fe=x(Ge,2),Ie=C(fe);{var et=yt=>{var Xt=qZ(),Yt=wt(Xt),ti=C(Yt),ii=C(ti),te=x(ti,2),he=x(te,2),Ce=x(he,2),Ue=x(Yt,2);{var pt=hi=>{var ni=OD(),Gi=C(ni);X(()=>G(Gi,u(N))),T(hi,ni)};q(Ue,hi=>{u(N)&&hi(pt)})}var Xe=x(Ue,2);{var Et=hi=>{var ni=FD();T(hi,ni)},li=hi=>{var ni=$Z(),Gi=C(ni),vn=x(C(Gi),2),Ri=C(vn),qt=x(Gi,2),$=x(C(qt),2),j=C($),K=x(qt,2),ue=x(C(K),2),le=C(ue);Aw(le,{language:"javascript",get value(){return u(p)},set value(Te){I(p,Te,!0)}});var De=x(K,2),pe=x(C(De),2),Fe=C(pe);Aw(Fe,{language:"javascript",get value(){return u(v)},set value(Te){I(v,Te,!0)}});var lt=x(De,2),Ve=C(lt),Ke=C(Ve),si=x(Ke,4),A=x(C(si)),J=C(A),He=x(Ve,2);{var dt=Te=>{var me=WZ(),xe=C(me);qs(xe,()=>u(S),Ze=>I(S,Ze)),T(Te,me)};q(He,Te=>{u(w)&&Te(dt)})}var it=x(lt,2);{var zt=Te=>{var me=UZ(),xe=C(me),Ze=x(C(xe));{var Ee=xt=>{var $e=BZ();T(xt,$e)},ve=xt=>{var $e=zZ(),Vt=C($e);X(()=>G(Vt,`${u(D).length??0??""} items · rev ${u(D)._rev??""}`)),T(xt,$e)};q(Ze,xt=>{u(D).error?xt(Ee):xt(ve,-1)})}var At=x(xe,2);{var Ne=xt=>{var $e=VZ(),Vt=C($e);X(()=>G(Vt,u(D).error)),T(xt,$e)},we=xt=>{var $e=jZ(),Vt=C($e);X(ai=>G(Vt,ai),[()=>JSON.stringify(u(D).result,null,2)]),T(xt,$e)};q(At,xt=>{u(D).error?xt(Ne):xt(we,-1)})}T(Te,me)};q(it,Te=>{u(D)&&Te(zt)})}X(()=>G(J,`${u(z)??""}${u(g)??""} on every update`)),Ei(Ri,()=>u(_),Te=>I(_,Te)),Ei(j,()=>u(f),Te=>I(f,Te)),qs(Ke,()=>u(w),Te=>I(w,Te)),T(hi,ni)};q(Xe,hi=>{u(P)?hi(Et):hi(li,-1)})}X(()=>G(ii,u(g))),oe("click",te,Un),oe("click",he,Ye),oe("click",Ce,Ht),T(yt,Xt)},Zt=yt=>{t(yt)};q(Ie,yt=>{u(g)?yt(et):yt(Zt,-1)})}var bt=x(fe,2);{var Oe=yt=>{var Xt=KZ(),Yt=wt(Xt),ti=x(Yt,2);let ii;var te=C(ti);PZ(te,{get currentView(){return u(Dt)},onApplyView:kt}),X(()=>ii=zo(ti,"",ii,{width:`${u(ot)??""}px`})),oe("mousedown",Yt,cn),T(yt,Xt)};q(bt,yt=>{u(je)&&yt(Oe)})}X(()=>at=zo(Pe,"",at,{width:`${u(ft)??""}px`})),oe("click",$t,()=>{I(Le,!u(Le)),I(gt,null)}),Ei(ke,()=>u(mi),yt=>I(mi,yt)),oe("mousedown",Ge,qi),T(Se,Z)};q(Xi,Se=>{u(ie)==="docs"?Se(On):Se(rn,-1)})}X(()=>{Ni=Kt(Wn,1,"svelte-rrt0o",null,Ni,{active:u(ie)==="docs"}),Bn=Kt(on,1,"svelte-rrt0o",null,Bn,{active:u(ie)==="views"})}),oe("mousemove",ji,Ki),oe("mouseup",ji,Mn),es("mouseleave",ji,Mn),oe("click",Wn,()=>I(ie,"docs")),oe("click",on,()=>I(ie,"views")),T(o,ji),Do()}mr(["mousemove","mouseup","click","keydown","mousedown"]);var YZ=R('<label class="svelte-1ua3isv">Passcode <input type="number" placeholder="20202021" class="svelte-1ua3isv"/></label> <label class="svelte-1ua3isv">Discriminator (optional) <input type="number" placeholder="3840" class="svelte-1ua3isv"/></label>',1),JZ=R('<label class="svelte-1ua3isv">Pairing Code / QR <input type="text" placeholder="MT:..." class="svelte-1ua3isv"/></label>'),HD=R('<p class="err svelte-1ua3isv"> </p>'),QZ=R('<div class="wizard svelte-1ua3isv"><div class="wizard-tabs svelte-1ua3isv"><button>Passcode</button> <button>QR / Code</button></div> <!> <label class="svelte-1ua3isv">IP Address (optional, bypasses mDNS) <input type="text" placeholder="192.168.1.100 or 192.168.1.100:5540" class="svelte-1ua3isv"/></label> <!> <button class="commission-btn svelte-1ua3isv"> </button></div>'),e9=R('<span class="device-name svelte-1ua3isv"> </span> <span class="device-nodeid svelte-1ua3isv"> </span>',1),t9=R('<span class="device-name svelte-1ua3isv"> </span>'),i9=R('<li><button class="device-select-btn svelte-1ua3isv"><span></span> <span class="device-label svelte-1ua3isv"><!></span></button> <button class="unpair-btn svelte-1ua3isv" title="Unpair">✕</button></li>'),n9=R('<li class="empty svelte-1ua3isv">No paired devices</li>'),s9=R('<p class="info svelte-1ua3isv">Loading…</p>'),o9=R('<p class="device-subtitle svelte-1ua3isv"> </p>'),r9=R('<span class="ep-chip svelte-1ua3isv"> </span>'),a9=R('<span class="attr-id svelte-1ua3isv"> </span>'),l9=R('<button class="attr-action-btn svelte-1ua3isv"> </button>'),c9=R('<div class="attr-actions svelte-1ua3isv"></div>'),d9=R('<span class="cmd-sep svelte-1ua3isv">,</span>'),h9=R('<span class="cmd-name svelte-1ua3isv"> </span><span class="cmd-id svelte-1ua3isv"> </span>',1),u9=R('<span class="cmd-id svelte-1ua3isv"> </span>'),g9=R("<!> <!>",1),f9=R('<span class="cmd-list svelte-1ua3isv"></span>'),p9=R(' <span class="cmd-id svelte-1ua3isv"> </span>',1),m9=R('<tr class="svelte-1ua3isv"><td class="svelte-1ua3isv"><!></td><td class="svelte-1ua3isv"> </td></tr>'),_9=R('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"><th class="svelte-1ua3isv">deviceType</th><th class="svelte-1ua3isv">revision</th></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),v9=R('<th class="svelte-1ua3isv"> </th>'),b9=R('<td class="svelte-1ua3isv"> </td>'),y9=R('<tr class="svelte-1ua3isv"></tr>'),w9=R('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),S9=R('<tr class="svelte-1ua3isv"><td class="attr-obj-key svelte-1ua3isv"> </td><td class="attr-obj-val svelte-1ua3isv"> </td></tr>'),C9=R('<table class="attr-obj-table svelte-1ua3isv"><tbody class="svelte-1ua3isv"></tbody></table>'),x9=R('<a class="attr-link svelte-1ua3isv" target="_blank" rel="noopener noreferrer"> </a>'),L9=R('<span class="attr-val svelte-1ua3isv"> </span>'),k9=R('<tr class="svelte-1ua3isv"><td class="attr-name-cell svelte-1ua3isv"><span class="attr-key svelte-1ua3isv"> </span><!></td><td class="attr-actions-cell svelte-1ua3isv"><!></td><td class="attr-val-cell svelte-1ua3isv"><!></td></tr>'),I9=R('<tr class="cluster-hdr-row svelte-1ua3isv"><td colspan="3" class="cluster-hdr-cell svelte-1ua3isv"> </td></tr> <!>',1),D9=R('<table class="cluster-table svelte-1ua3isv"><colgroup><col class="col-attr-name svelte-1ua3isv"/><col class="col-attr-actions svelte-1ua3isv"/><col class="col-attr-val"/></colgroup><tbody class="svelte-1ua3isv"></tbody></table>'),E9=R('<p class="no-clusters svelte-1ua3isv">No clusters</p>'),P9=R('<details class="svelte-1ua3isv"><summary class="svelte-1ua3isv"> <span class="ep-id svelte-1ua3isv"> </span> <span class="ep-chips svelte-1ua3isv"></span></summary> <!></details>'),T9=R('<div class="detail-hdr svelte-1ua3isv"><h2 class="svelte-1ua3isv"> </h2> <!> <p class="detail-nodeid svelte-1ua3isv"> </p></div> <!>',1),M9=R('<p class="info svelte-1ua3isv">Select a device to view its endpoints.</p>'),N9=R('<span class="stream-badge svelte-1ua3isv"> </span>'),R9=R('<span class="stream-empty svelte-1ua3isv">Waiting for events…</span>'),Ow=R('&nbsp;<span class="e-sub svelte-1ua3isv"> </span>',1),A9=R('<span class="e-badge e-badge-status svelte-1ua3isv">status</span> <span class="e-node svelte-1ua3isv"> <!></span> <span> </span>',1),O9=R('<span class="e-badge e-badge-attr svelte-1ua3isv">attr</span> <span class="e-node svelte-1ua3isv"> <!></span> <span class="e-ep svelte-1ua3isv"> <!></span> <span class="e-cluster svelte-1ua3isv"> </span> <span class="e-attr svelte-1ua3isv"> </span> <span class="e-val svelte-1ua3isv"> </span>',1),F9=R('<div class="er svelte-1ua3isv"><span class="e-ts svelte-1ua3isv"> </span> <!></div>'),H9=R('<div class="stream-body svelte-1ua3isv"><!></div>'),W9=R('<!> <div class="matter-page svelte-1ua3isv"><div class="matter-main svelte-1ua3isv"><div class="sidebar svelte-1ua3isv"><div class="sidebar-header svelte-1ua3isv"><span class="sidebar-title svelte-1ua3isv">Matter Devices</span> <button class="add-btn svelte-1ua3isv" title="Commission new device">+</button></div> <!> <ul class="device-list svelte-1ua3isv"><!> <!></ul></div> <div class="detail svelte-1ua3isv"><!></div></div> <div class="stream-panel svelte-1ua3isv"><div class="stream-resize svelte-1ua3isv"></div> <div class="stream-hdr-row svelte-1ua3isv"><span class="stream-title svelte-1ua3isv">Matter Events</span> <!> <button class="stream-toggle svelte-1ua3isv" title="Toggle event feed"> </button></div> <!></div></div>',1);function B9(o,e){Io(e,!0);const t={onOff:{onOff:[{label:"On",command:"on"},{label:"Off",command:"off"},{label:"Toggle",command:"toggle"}]},levelControl:{currentLevel:[{label:"Step ▲",command:"stepWithOnOff",args:{stepMode:0,stepSize:25,transitionTime:5}},{label:"Step ▼",command:"stepWithOnOff",args:{stepMode:1,stepSize:25,transitionTime:5}}]},windowCovering:{currentPositionLiftPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}],currentPositionTiltPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}]}};async function i(Z,Pe,at,It,$t){try{await m8(Z,Pe,at,It,$t)}catch(H){console.error("matter command failed",H)}}const n={identify:{0:"identify",1:"triggerEffect"},groups:{0:"addGroup",1:"viewGroup",2:"getGroupMembership",3:"removeGroup",4:"removeAllGroups",5:"addGroupIfIdentifying"},scenes:{0:"addScene",1:"viewScene",2:"removeScene",3:"removeAllScenes",4:"storeScene",5:"recallScene",6:"getSceneMembership",64:"enhancedAddScene",65:"enhancedViewScene",66:"copyScene"},onOff:{0:"off",1:"on",2:"toggle",64:"offWithEffect",65:"onWithRecallGlobalScene",66:"onWithTimedOff"},levelControl:{0:"moveToLevel",1:"move",2:"step",3:"stop",4:"moveToLevelWithOnOff",5:"moveWithOnOff",6:"stepWithOnOff",7:"stopWithOnOff",8:"moveToClosestFrequency"},colorControl:{0:"moveToHue",1:"moveHue",2:"stepHue",3:"moveToSaturation",4:"moveSaturation",5:"stepSaturation",6:"moveToHueAndSaturation",7:"moveToColor",8:"moveColor",9:"stepColor",10:"moveToColorTemperature",64:"enhancedMoveToHue",65:"enhancedMoveHue",66:"enhancedStepHue",67:"enhancedMoveToHueAndSaturation",68:"colorLoopSet",71:"stopMoveStep",75:"moveColorTemperature",76:"stepColorTemperature"},thermostat:{0:"setpointRaiseLower",1:"setWeeklySchedule",2:"getWeeklySchedule",3:"clearWeeklySchedule"},doorLock:{0:"lockDoor",1:"unlockDoor",3:"unlockWithTimeout",11:"setWeekDaySchedule",12:"getWeekDaySchedule",13:"clearWeekDaySchedule",14:"setYearDaySchedule",15:"getYearDaySchedule",16:"clearYearDaySchedule",17:"setHolidaySchedule",18:"getHolidaySchedule",19:"clearHolidaySchedule",26:"setUser",27:"getUser",28:"clearUser",34:"setCredential",36:"getCredential",38:"clearCredential"},windowCovering:{0:"upOrOpen",1:"downOrClose",2:"stopMotion",4:"goToLiftValue",5:"goToLiftPercentage",7:"goToTiltValue",8:"goToTiltPercentage"},fanControl:{0:"step"}};function s(Z,Pe){const at=n[Z];return Pe.map(It=>{const $t=typeof It=="number"?It:Number(It);return{id:$t,name:(at==null?void 0:at[$t])??null}})}const r={10:"Door Lock",11:"Door Lock Controller",14:"Aggregator",15:"Generic Switch",17:"On/Off Plug-In Unit",18:"Dimmable Plug-In Unit",19:"Pump",20:"On/Off Light Switch",21:"Dimmer Switch",22:"Color Dimmer Switch",23:"Control Bridge",24:"Pump Controller",256:"On/Off Light",257:"Dimmable Light",268:"Extended Color Light",269:"Color Temperature Light",262:"Light Sensor",263:"Occupancy Sensor",514:"Window Covering",515:"Window Covering Controller",768:"Heating/Cooling Unit",769:"Thermostat",770:"Temperature Sensor",771:"Pressure Sensor",772:"Flow Sensor",773:"Humidity Sensor",774:"On/Off Sensor",2112:"Air Quality Sensor"},a={generatedCommandList:65528,acceptedCommandList:65529,eventList:65530,attributeList:65531,featureMap:65532,clusterRevision:65533},c={descriptor:{deviceTypeList:0,serverList:1,clientList:2,partsList:3,tagList:4},basicInformation:{dataModelRevision:0,vendorName:1,vendorID:2,vendorId:2,productName:3,productID:4,productId:4,nodeLabel:5,location:6,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,localConfigDisabled:16,reachable:17,uniqueID:18,uniqueId:18,capabilityMinima:19,productAppearance:20,specificationVersion:21,maxPathsPerInvoke:22},bridgedDeviceBasicInformation:{vendorName:1,vendorID:2,vendorId:2,productName:3,productId:4,nodeLabel:5,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,reachable:17,uniqueID:18,uniqueId:18,productAppearance:20},identify:{identifyTime:0,identifyType:1},groups:{nameSupport:0},onOff:{onOff:0,globalSceneControl:16384,onTime:16385,offWaitTime:16386,startUpOnOff:16387},levelControl:{currentLevel:0,remainingTime:1,minLevel:2,maxLevel:3,currentFrequency:4,minFrequency:5,maxFrequency:6,options:15,onOffTransitionTime:16,onLevel:17,onTransitionTime:18,offTransitionTime:19,defaultMoveRate:20,startUpCurrentLevel:16384},colorControl:{currentHue:0,currentSaturation:1,remainingTime:2,currentX:3,currentY:4,colorTemperatureMireds:7,colorMode:8,options:15,enhancedCurrentHue:16384,enhancedColorMode:16385,colorLoopActive:16386,colorLoopDirection:16387,colorLoopTime:16388,colorCapabilities:16394,colorTempPhysicalMinMireds:16395,colorTempPhysicalMaxMireds:16396,coupleColorTempToLevelMinMireds:16397,startUpColorTemperatureMireds:16400},thermostat:{localTemperature:0,outdoorTemperature:1,occupancy:2,absMinHeatSetpointLimit:3,absMaxHeatSetpointLimit:4,absMinCoolSetpointLimit:5,absMaxCoolSetpointLimit:6,piCoolingDemand:7,piHeatingDemand:8,localTemperatureCalibration:16,occupiedCoolingSetpoint:17,occupiedHeatingSetpoint:18,unoccupiedCoolingSetpoint:19,unoccupiedHeatingSetpoint:20,minHeatSetpointLimit:21,maxHeatSetpointLimit:22,minCoolSetpointLimit:23,maxCoolSetpointLimit:24,minSetpointDeadBand:25,remoteSensing:26,controlSequenceOfOperation:27,systemMode:28,thermostatRunningMode:30,startOfWeek:32,numberOfWeeklyTransitions:33,numberOfDailyTransitions:34,temperatureSetpointHold:35,temperatureSetpointHoldDuration:36,thermostatProgrammingOperationMode:37,thermostatRunningState:41,setpointChangeSource:48,setpointChangeAmount:49,setpointChangeSourceTimestamp:50,occupiedSetback:52,unoccupiedSetback:55,emergencyHeatDelta:58},windowCovering:{type:0,physicalClosedLimitLift:1,physicalClosedLimitTilt:2,currentPositionLift:3,currentPositionTilt:4,numberOfActuationsLift:5,numberOfActuationsTilt:6,configStatus:7,currentPositionLiftPercentage:8,currentPositionTiltPercentage:9,operationalStatus:10,targetPositionLiftPercent100ths:11,targetPositionTiltPercent100ths:12,endProductType:13,currentPositionLiftPercent100ths:14,currentPositionTiltPercent100ths:15,installedOpenLimitLift:16,installedClosedLimitLift:17,installedOpenLimitTilt:18,installedClosedLimitTilt:19,mode:23,safetyStatus:26},doorLock:{lockState:0,lockType:1,actuatorEnabled:2,doorState:3,numberOfTotalUsersSupported:17,numberOfPINUsersSupported:18,maxPINCodeLength:23,minPINCodeLength:24,language:33,autoRelockTime:35,soundVolume:36,operatingMode:37,supportedOperatingModes:38,wrongCodeEntryLimit:48},fanControl:{fanMode:0,fanModeSequence:1,percentSetting:2,percentCurrent:3,speedMax:4,speedSetting:5,speedCurrent:6,rockSupport:7,rockSetting:8,windSupport:9,windSetting:10,airflowDirectionSupport:11,airflowDirection:12},occupancySensing:{occupancy:0,occupancySensorType:1,occupancySensorTypeBitmap:2,holdTime:3,pirOccupiedToUnoccupiedDelay:16,pirUnoccupiedToOccupiedDelay:17},illuminanceMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,lightSensorType:4},temperatureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},pressureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,scaledValue:16,minScaledValue:17,maxScaledValue:18,scale:20},flowMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},relativeHumidityMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},powerSource:{status:0,order:1,description:2,batVoltage:11,batPercentRemaining:12,batTimeRemaining:13,batChargeLevel:14,batReplacementNeeded:15,batReplaceability:16,batPresent:17,activeBatFaults:18,batChargeState:26}};function h(Z){return"0x"+Z.toString(16).toUpperCase().padStart(4,"0")}let g=V(wi([])),f=wi(new Map);function p(Z){if(Z==null)return"—";if(typeof Z=="boolean"||typeof Z=="number")return String(Z);if(typeof Z=="string")return Z.length>50?Z.slice(0,47)+"…":Z;const Pe=JSON.stringify(Z);return Pe.length>60?Pe.slice(0,57)+"…":Pe}function v(Z){return Z==null?"—":typeof Z=="boolean"||typeof Z=="number"?String(Z):typeof Z=="string"?Z:JSON.stringify(Z)}function _(Z){return Z!==null&&typeof Z=="object"&&!Array.isArray(Z)}function w(Z){return Array.isArray(Z)&&Z.length>0&&Z.every(_)}function S(Z,Pe){return!!(Pe==="attributeList"||Array.isArray(Z)&&Z.length===0||_(Z)&&Object.keys(Z).length===0)}function D(Z){return new Date(Z).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}const P=500,N=20,z=32;let F=0,ie=V(wi([])),Y=V(!0),ge=V(180),_e=st(()=>{const Z=Math.max(1,Math.floor((u(ge)-z)/N)+1);return u(ie).slice(0,Z)});function Ae(Z){Z.preventDefault();const Pe=Z.clientY,at=u(ge);function It(H){I(ge,Math.max(60,Math.min(600,at+Pe-H.clientY)),!0)}function $t(){document.removeEventListener("mousemove",It),document.removeEventListener("mouseup",$t)}document.addEventListener("mousemove",It),document.addEventListener("mouseup",$t)}let Le=V(null),gt=V(!1),Tt=V(null),ft=V(!1),mt=V("passcode"),ct=V(""),Ot=V(""),Me=V(""),Mt=V(!1),je=V(null),ot=V("");const _t="she:matter:selectedNodeId";async function pi(){try{I(g,await iR(),!0);for(const Z of u(g))m_(Z.nodeId).then(Pe=>{f.set(Z.nodeId,Pe)}).catch(()=>{});if(u(g).length>0&&!u(Le)){const Z=localStorage.getItem(_t),Pe=Z&&u(g).find(at=>at.nodeId===Z)?Z:u(g)[0].nodeId;Rt(Pe)}}catch{I(g,[],!0)}}async function Rt(Z){I(gt,!0),I(Tt,null);try{I(Le,await m_(Z),!0),f.set(Z,u(Le)),localStorage.setItem(_t,Z)}catch(Pe){I(Tt,Pe instanceof Error?Pe.message:String(Pe),!0)}finally{I(gt,!1)}}let Dt;async function kt(Z){var Pe;if(await Dt.show(`Unpair device ${Z}?`,{confirm:"Unpair",danger:!0}))try{await p8(Z),((Pe=u(Le))==null?void 0:Pe.nodeId)===Z&&I(Le,null),await pi()}catch(at){I(Tt,at instanceof Error?at.message:String(at),!0)}}async function qi(){I(Mt,!0),I(je,null);try{let Z;u(mt)==="passcode"?(Z={passcode:Number(u(ct))},u(Ot)&&(Z={...Z,discriminator:Number(u(Ot))})):Z={pairingCode:u(Me).trim()},u(ot).trim()&&(Z={...Z,discoveryAddress:u(ot).trim()}),await f8(Z),I(ft,!1),I(ct,""),I(Ot,""),I(Me,""),I(ot,""),await pi()}catch(Z){I(je,Z instanceof Error?Z.message:String(Z),!0)}finally{I(Mt,!1)}}Vr(()=>{pi()});const Ki=Ul("matter:deviceList",Z=>{if(!Array.isArray(Z.devices))return;const Pe=Z.devices;for(const at of Pe)f.has(at.nodeId)||m_(at.nodeId).then(It=>{f.set(at.nodeId,It)}).catch(()=>{});I(g,Pe,!0)}),Mn=Ul("matter:deviceStatus",Z=>{if(Z.nodeId===void 0)return;const Pe=String(Z.nodeId),at=!!Z.online;I(g,u(g).map(It=>It.nodeId===Pe?{...It,online:at}:It),!0),I(ie,[{id:F++,kind:"status",nodeId:Pe,online:at,ts:Date.now()},...u(ie).slice(0,P-1)],!0)}),cn=Ul("matter:attr",Z=>{const Pe=String(Z.nodeId),at=Z.endpointId,It=String(Z.clusterName),$t=String(Z.attrName),H=Z.value;if(u(Le)&&u(Le).nodeId===Pe){const ee=u(Le).endpoints.find(Je=>Je.endpointId===at),ke=ee==null?void 0:ee.clusters.find(Je=>Je.name===It);ke&&(ke.attrs[$t]=H)}const O=f.get(Pe);if(O){const ee=O.endpoints.find(Je=>Je.endpointId===at),ke=ee==null?void 0:ee.clusters.find(Je=>Je.name===It);ke&&(ke.attrs[$t]=H)}I(ie,[{id:F++,kind:"attr",nodeId:Pe,endpointId:at,clusterName:It,attrName:$t,value:H,ts:Z.ts??Date.now()},...u(ie).slice(0,P-1)],!0)});oy(()=>{Ki(),Mn(),cn()});var Vi=W9(),dn=wt(Vi);Ss(tm(dn,{}),Z=>Dt=Z,()=>Dt);var hn=x(dn,2),Nn=C(hn),jn=C(Nn),xn=C(jn),Rn=x(C(xn),2),_n=x(xn,2);{var Un=Z=>{var Pe=QZ(),at=C(Pe),It=C(at);let $t;var H=x(It,2);let O;var ee=x(at,2);{var ke=Oe=>{var yt=YZ(),Xt=wt(yt),Yt=x(C(Xt)),ti=x(Xt,2),ii=x(C(ti));Ei(Yt,()=>u(ct),te=>I(ct,te)),Ei(ii,()=>u(Ot),te=>I(Ot,te)),T(Oe,yt)},Je=Oe=>{var yt=JZ(),Xt=x(C(yt));Ei(Xt,()=>u(Me),Yt=>I(Me,Yt)),T(Oe,yt)};q(ee,Oe=>{u(mt)==="passcode"?Oe(ke):Oe(Je,-1)})}var Ge=x(ee,2),fe=x(C(Ge)),Ie=x(Ge,2);{var et=Oe=>{var yt=HD(),Xt=C(yt);X(()=>G(Xt,u(je))),T(Oe,yt)};q(Ie,Oe=>{u(je)&&Oe(et)})}var Zt=x(Ie,2),bt=C(Zt);X(()=>{$t=Kt(It,1,"svelte-1ua3isv",null,$t,{active:u(mt)==="passcode"}),O=Kt(H,1,"svelte-1ua3isv",null,O,{active:u(mt)==="pairingCode"}),Zt.disabled=u(Mt),G(bt,u(Mt)?"Commissioning…":"Commission")}),oe("click",It,()=>I(mt,"passcode")),oe("click",H,()=>I(mt,"pairingCode")),Ei(fe,()=>u(ot),Oe=>I(ot,Oe)),oe("click",Zt,qi),T(Z,Pe)};q(_n,Z=>{u(ft)&&Z(Un)})}var Ye=x(_n,2),Ht=C(Ye);_i(Ht,17,()=>u(g),Z=>Z.nodeId,(Z,Pe)=>{var at=i9();let It;var $t=C(at),H=C($t);let O;var ee=x(H,2),ke=C(ee);{var Je=Ie=>{var et=e9(),Zt=wt(et),bt=C(Zt),Oe=x(Zt,2),yt=C(Oe);X(()=>{G(bt,u(Pe).name),G(yt,`#${u(Pe).nodeId??""}`)}),T(Ie,et)},Ge=Ie=>{var et=t9(),Zt=C(et);X(()=>G(Zt,`Node ${u(Pe).nodeId??""}`)),T(Ie,et)};q(ke,Ie=>{u(Pe).name?Ie(Je):Ie(Ge,-1)})}var fe=x($t,2);X(()=>{var Ie;It=Kt(at,1,"svelte-1ua3isv",null,It,{selected:((Ie=u(Le))==null?void 0:Ie.nodeId)===u(Pe).nodeId}),O=Kt(H,1,"status-dot svelte-1ua3isv",null,O,{online:u(Pe).online})}),oe("click",$t,()=>Rt(u(Pe).nodeId)),oe("click",fe,()=>kt(u(Pe).nodeId)),T(Z,at)});var oi=x(Ht,2);{var Ut=Z=>{var Pe=n9();T(Z,Pe)};q(oi,Z=>{u(g).length===0&&Z(Ut)})}var mi=x(jn,2),An=C(mi);{var un=Z=>{var Pe=s9();T(Z,Pe)},ji=Z=>{var Pe=HD(),at=C(Pe);X(()=>G(at,u(Tt))),T(Z,Pe)},sn=Z=>{var Pe=T9(),at=wt(Pe),It=C(at),$t=C(It),H=x(It,2);{var O=Ge=>{var fe=o9(),Ie=C(fe);X(()=>G(Ie,u(Le).subtitle)),T(Ge,fe)};q(H,Ge=>{u(Le).subtitle&&Ge(O)})}var ee=x(H,2),ke=C(ee),Je=x(at,2);_i(Je,17,()=>u(Le).endpoints,Ge=>Ge.endpointId,(Ge,fe)=>{var Ie=P9(),et=C(Ie),Zt=C(et),bt=x(Zt),Oe=C(bt),yt=x(bt,2);_i(yt,21,()=>u(fe).clusters,En,(ii,te)=>{var he=r9(),Ce=C(he);X(()=>G(Ce,u(te).name)),T(ii,he)});var Xt=x(et,2);{var Yt=ii=>{var te=D9(),he=x(C(te));_i(he,21,()=>u(fe).clusters,En,(Ce,Ue)=>{var pt=I9(),Xe=wt(pt),Et=C(Xe),li=C(Et),hi=x(Xe,2);_i(hi,17,()=>Object.entries(u(Ue).attrs),En,(ni,Gi)=>{var vn=st(()=>ok(u(Gi),2));let Ri=()=>u(vn)[0],qt=()=>u(vn)[1];var $=Ds(),j=wt($);{var K=le=>{const De=st(()=>{var $e;return($e=t[u(Ue).name])==null?void 0:$e[Ri()]}),pe=st(()=>(Ri()==="acceptedCommandList"||Ri()==="generatedCommandList")&&Array.isArray(qt())),Fe=st(()=>{var $e;return(($e=c[u(Ue).name])==null?void 0:$e[Ri()])??a[Ri()]});var lt=k9(),Ve=C(lt),Ke=C(Ve),si=C(Ke),A=x(Ke);{var J=$e=>{var Vt=a9(),ai=C(Vt);X(be=>G(ai,`(${be??""})`),[()=>h(u(Fe))]),T($e,Vt)};q(A,$e=>{u(Fe)!==void 0&&$e(J)})}var He=x(Ve),dt=C(He);{var it=$e=>{var Vt=c9();_i(Vt,21,()=>u(De),En,(ai,be)=>{var qe=l9(),rt=C(qe);X(()=>G(rt,u(be).label)),oe("click",qe,()=>i(u(Le).nodeId,u(fe).endpointId,u(Ue).name,u(be).command,u(be).args)),T(ai,qe)}),T($e,Vt)};q(dt,$e=>{u(De)&&$e(it)})}var zt=x(He),Te=C(zt);{var me=$e=>{var Vt=f9();_i(Vt,21,()=>s(u(Ue).name,qt()),En,(ai,be,qe)=>{var rt=g9(),Wt=wt(rt);{var tt=Jt=>{var Bt=d9();T(Jt,Bt)};q(Wt,Jt=>{qe>0&&Jt(tt)})}var ui=x(Wt,2);{var ri=Jt=>{var Bt=h9(),Ui=wt(Bt),tn=C(Ui),bn=x(Ui),$n=C(bn);X(()=>{G(tn,u(be).name),G($n,`(${u(be).id??""})`)}),T(Jt,Bt)},Ti=Jt=>{var Bt=u9(),Ui=C(Bt);X(()=>G(Ui,u(be).id)),T(Jt,Bt)};q(ui,Jt=>{u(be).name?Jt(ri):Jt(Ti,-1)})}T(ai,rt)}),T($e,Vt)},xe=$e=>{var Vt=_9(),ai=x(C(Vt));_i(ai,21,qt,En,(be,qe)=>{const rt=st(()=>u(qe)),Wt=st(()=>u(rt).deviceType),tt=st(()=>r[u(Wt)]);var ui=m9(),ri=C(ui),Ti=C(ri);{var Jt=bn=>{var $n=p9(),In=wt($n),Ps=x(In),Ur=C(Ps);X(Eo=>{G(In,`${u(tt)??""} `),G(Ur,`(${Eo??""})`)},[()=>h(u(Wt))]),T(bn,$n)},Bt=bn=>{var $n=Rr();X(In=>G($n,In),[()=>h(u(Wt))]),T(bn,$n)};q(Ti,bn=>{u(tt)?bn(Jt):bn(Bt,-1)})}var Ui=x(ri),tn=C(Ui);X(bn=>G(tn,bn),[()=>v(u(rt).revision)]),T(be,ui)}),T($e,Vt)},Ze=st(()=>Ri()==="deviceTypeList"&&Array.isArray(qt())),Ee=$e=>{const Vt=st(()=>[...new Set(qt().flatMap(Wt=>Object.keys(Wt)))]);var ai=w9(),be=C(ai),qe=C(be);_i(qe,21,()=>u(Vt),En,(Wt,tt)=>{var ui=v9(),ri=C(ui);X(()=>G(ri,u(tt))),T(Wt,ui)});var rt=x(be);_i(rt,21,qt,En,(Wt,tt)=>{var ui=y9();_i(ui,21,()=>u(Vt),En,(ri,Ti)=>{var Jt=b9(),Bt=C(Jt);X(Ui=>G(Bt,Ui),[()=>v(u(tt)[u(Ti)])]),T(ri,Jt)}),T(Wt,ui)}),T($e,ai)},ve=st(()=>w(qt())),At=$e=>{var Vt=C9(),ai=C(Vt);_i(ai,21,()=>Object.entries(qt()),En,(be,qe)=>{var rt=st(()=>ok(u(qe),2));let Wt=()=>u(rt)[0],tt=()=>u(rt)[1];var ui=S9(),ri=C(ui),Ti=C(ri),Jt=x(ri),Bt=C(Jt);X(Ui=>{G(Ti,Wt()),G(Bt,Ui)},[()=>v(tt())]),T(be,ui)}),T($e,Vt)},Ne=st(()=>_(qt())),we=$e=>{var Vt=x9(),ai=C(Vt);X(()=>{Hn(Vt,"href",qt()),G(ai,qt())}),T($e,Vt)},xt=$e=>{var Vt=L9(),ai=C(Vt);X(be=>G(ai,be),[()=>v(qt())]),T($e,Vt)};q(Te,$e=>{u(pe)?$e(me):u(Ze)?$e(xe,1):u(ve)?$e(Ee,2):u(Ne)?$e(At,3):(Ri()==="productUrl"||Ri()==="productURL")&&typeof qt()=="string"?$e(we,4):$e(xt,-1)})}X(()=>{Hn(Ve,"title",Ri()),G(si,Ri())}),T(le,lt)},ue=st(()=>!S(qt(),Ri()));q(j,le=>{u(ue)&&le(K)})}T(ni,$)}),X(()=>G(li,u(Ue).name)),T(Ce,pt)}),T(ii,te)},ti=ii=>{var te=E9();T(ii,te)};q(Xt,ii=>{u(fe).clusters.length>0?ii(Yt):ii(ti,-1)})}X(()=>{G(Zt,`${u(fe).name??`Endpoint ${u(fe).endpointId}`??""} `),G(Oe,`ep${u(fe).endpointId??""}`)}),T(Ge,Ie)}),X(()=>{G($t,u(Le).name??`Node ${u(Le).nodeId}`),G(ke,`Node ID: ${u(Le).nodeId??""}`)}),T(Z,Pe)},Wn=Z=>{var Pe=M9();T(Z,Pe)};q(An,Z=>{u(gt)?Z(un):u(Tt)?Z(ji,1):u(Le)?Z(sn,2):Z(Wn,-1)})}var Ni=x(Nn,2),on=C(Ni),Bn=x(on,2),Jn=x(C(Bn),2);{var kn=Z=>{var Pe=N9(),at=C(Pe);X(()=>G(at,u(ie).length)),T(Z,Pe)};q(Jn,Z=>{!u(Y)&&u(ie).length>0&&Z(kn)})}var Xi=x(Jn,2),On=C(Xi),rn=x(Bn,2);{var Se=Z=>{var Pe=H9(),at=C(Pe);{var It=H=>{var O=R9();T(H,O)},$t=H=>{var O=Ds(),ee=wt(O);_i(ee,17,()=>u(_e),ke=>ke.id,(ke,Je)=>{const Ge=st(()=>{var Yt,ti;return((Yt=f.get(u(Je).nodeId))==null?void 0:Yt.name)??((ti=u(g).find(ii=>ii.nodeId===u(Je).nodeId))==null?void 0:ti.name)??null}),fe=st(()=>{var Yt,ti;return u(Je).endpointId!==void 0?((ti=(Yt=f.get(u(Je).nodeId))==null?void 0:Yt.endpoints.find(ii=>ii.endpointId===u(Je).endpointId))==null?void 0:ti.name)??null:null}),Ie=st(()=>u(Je).attrName??u(Je).clusterName);var et=F9(),Zt=C(et),bt=C(Zt),Oe=x(Zt,2);{var yt=Yt=>{var ti=A9(),ii=x(wt(ti),2),te=C(ii),he=x(te);{var Ce=Et=>{var li=Ow(),hi=x(wt(li)),ni=C(hi);X(()=>G(ni,`(#${u(Je).nodeId??""})`)),T(Et,li)};q(he,Et=>{u(Ge)&&Et(Ce)})}var Ue=x(ii,2);let pt;var Xe=C(Ue);X(()=>{G(te,u(Ge)??`#${u(Je).nodeId}`),pt=Kt(Ue,1,"e-val svelte-1ua3isv",null,pt,{"e-online":u(Je).online,"e-offline":!u(Je).online}),G(Xe,u(Je).online?"online":"offline")}),T(Yt,ti)},Xt=Yt=>{var ti=O9(),ii=x(wt(ti),2),te=C(ii),he=x(te);{var Ce=qt=>{var $=Ow(),j=x(wt($)),K=C(j);X(()=>G(K,`(#${u(Je).nodeId??""})`)),T(qt,$)};q(he,qt=>{u(Ge)&&qt(Ce)})}var Ue=x(ii,2),pt=C(Ue),Xe=x(pt);{var Et=qt=>{var $=Ow(),j=x(wt($)),K=C(j);X(()=>G(K,`(ep ${u(Je).endpointId??""})`)),T(qt,$)};q(Xe,qt=>{u(fe)&&qt(Et)})}var li=x(Ue,2),hi=C(li),ni=x(li,2),Gi=C(ni),vn=x(ni,2),Ri=C(vn);X(qt=>{G(te,u(Ge)??`#${u(Je).nodeId}`),G(pt,u(fe)??`ep${u(Je).endpointId}`),G(hi,u(Je).clusterName),G(Gi,u(Ie)),G(Ri,qt)},[()=>p(u(Je).value)]),T(Yt,ti)};q(Oe,Yt=>{u(Je).kind==="status"?Yt(yt):Yt(Xt,-1)})}X(Yt=>G(bt,Yt),[()=>D(u(Je).ts)]),T(ke,et)}),T(H,O)};q(at,H=>{u(_e).length===0?H(It):H($t,-1)})}T(Z,Pe)};q(rn,Z=>{u(Y)&&Z(Se)})}X(()=>{zo(Ni,u(Y)?`height: ${u(ge)}px;`:""),G(On,u(Y)?"▾":"▸")}),oe("click",Rn,()=>I(ft,!u(ft))),oe("mousedown",on,Ae),oe("click",Xi,()=>{I(Y,!u(Y))}),T(o,Vi),Do()}mr(["click","mousedown"]);var z9=R("<button>›</button>"),V9=R('<span class="chev-ph svelte-1vejtrc"></span>'),j9=R('<span class="tv svelte-1vejtrc"> </span> <span class="tt svelte-1vejtrc"> </span>',1),U9=R('<div class="tc svelte-1vejtrc"></div>'),$9=R('<div class="tn svelte-1vejtrc"><div><!> <span class="seg svelte-1vejtrc"> </span> <!></div> <!></div>'),q9=R("<option></option>"),K9=R('<span class="pub-ok svelte-1vejtrc">✓</span>'),G9=R('<span class="pub-err svelte-1vejtrc"> </span>'),Z9=R('<div class="info svelte-1vejtrc">Loading…</div>'),X9=R('<div class="info err svelte-1vejtrc"> </div>'),Y9=R('<div class="info svelte-1vejtrc">No topics match.</div>'),J9=R('<div class="vr svelte-1vejtrc"><span class="v-topic svelte-1vejtrc"> </span> <span class="v-val svelte-1vejtrc"> </span> <span class="v-ts svelte-1vejtrc"> </span></div>'),Q9=R('<div class="vs svelte-1vejtrc"><div><div class="vrows-abs svelte-1vejtrc"></div></div></div>'),eX=R('<div class="info svelte-1vejtrc">No topics yet.</div>'),tX=R('<div class="tree-wrap svelte-1vejtrc"><!></div>'),iX=R('<span class="stream-badge"> </span>'),nX=R('<span class="stream-empty svelte-1vejtrc">Waiting for messages…</span>'),sX=R('<span class="s-ret svelte-1vejtrc" title="retained snapshot">&#x229B;</span>'),oX=R('<div><span class="s-ts svelte-1vejtrc"> </span> <!> <span class="s-topic svelte-1vejtrc"> </span> <span class="s-val svelte-1vejtrc"> </span></div>'),rX=R('<div class="stream-body svelte-1vejtrc"><!></div>'),aX=R('<div class="ctx-bd svelte-1vejtrc"></div> <div class="ctx-menu svelte-1vejtrc"><button class="svelte-1vejtrc">Copy topic</button> <button class="svelte-1vejtrc">Clear retained</button></div>',1),lX=R('<label class="modal-check svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> Recursive — also clear all child topics</label>'),cX=R('<div class="modal-bd svelte-1vejtrc"></div> <div class="modal svelte-1vejtrc"><div class="modal-title svelte-1vejtrc">Clear retained</div> <div class="modal-body svelte-1vejtrc"><p class="svelte-1vejtrc">Clear retained value for <code class="svelte-1vejtrc"> </code>?</p> <!></div> <div class="modal-footer svelte-1vejtrc"><button class="btn-cancel svelte-1vejtrc">Cancel</button> <button class="btn-confirm svelte-1vejtrc">Clear</button></div></div>',1),dX=R('<div class="page svelte-1vejtrc"><div class="toolbar svelte-1vejtrc"><h2 class="svelte-1vejtrc">MQTT</h2></div> <div class="main-group svelte-1vejtrc"><div class="pub-bar svelte-1vejtrc"><input class="pt svelte-1vejtrc" type="text" placeholder="topic" list="pub-topic-list" autocomplete="off"/> <datalist id="pub-topic-list"></datalist> <input class="pp svelte-1vejtrc" type="text" placeholder="payload"/> <label class="rl svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> retain</label> <select class="svelte-1vejtrc"><option>QoS 0</option><option>QoS 1</option><option>QoS 2</option></select> <button class="svelte-1vejtrc">Publish</button> <!> <!></div> <div class="tree-filter-bar svelte-1vejtrc"><input class="filter-in svelte-1vejtrc" type="search" placeholder="Filter topics…"/> <span class="count svelte-1vejtrc"><!> </span></div> <!></div> <div class="stream-panel svelte-1vejtrc"><div class="stream-resize svelte-1vejtrc"></div> <div class="stream-hdr-row svelte-1vejtrc"><input class="filter-in stream-filter-in svelte-1vejtrc" type="search" placeholder="Live stream filter (MQTT wildcard, default: #)"/> <!> <button class="stream-toggle svelte-1vejtrc" title="Toggle live stream"> </button></div> <!></div> <!> <!></div>');function hX(o,e){Io(e,!0);const t=(te,he=ey)=>{const Ce=st(()=>u(f).has(he().path)),Ue=st(()=>u(a)>=0&&he().children.size>0),pt=st(()=>u(a)>=0&&he().isLeaf&&!n.has(he().path));var Xe=$9(),Et=C(Xe);let li;var hi=C(Et);{var ni=le=>{var De=z9();let pe;X(()=>{pe=Kt(De,1,"chev svelte-1vejtrc",null,pe,{open:u(Ce)}),Hn(De,"aria-label",u(Ce)?"Collapse":"Expand")}),oe("click",De,()=>p(he().path)),T(le,De)},Gi=le=>{var De=V9();T(le,De)};q(hi,le=>{u(Ue)?le(ni):le(Gi,-1)})}var vn=x(hi,2),Ri=C(vn),qt=x(vn,2);{var $=le=>{var De=j9(),pe=wt(De),Fe=C(pe),lt=x(pe,2),Ve=C(lt);X((Ke,si,A)=>{Hn(pe,"title",Ke),G(Fe,si),G(Ve,A)},[()=>{var Ke;return hn((Ke=xn(he().path))==null?void 0:Ke.val)},()=>{var Ke;return hn((Ke=xn(he().path))==null?void 0:Ke.val)},()=>{var Ke;return((Ke=xn(he().path))==null?void 0:Ke.ts)!=null?Nn(xn(he().path).ts):""}]),T(le,De)},j=st(()=>he().isLeaf&&i.has(he().path));q(qt,le=>{u(j)&&le($)})}var K=x(Et,2);{var ue=le=>{var De=U9();_i(De,21,()=>[...he().children.values()].sort((pe,Fe)=>pe.seg.localeCompare(Fe.seg)),pe=>pe.path,(pe,Fe)=>{t(pe,()=>u(Fe))}),T(le,De)};q(K,le=>{u(Ue)&&u(Ce)&&le(ue)})}X(()=>{li=Kt(Et,1,"tr svelte-1vejtrc",null,li,{stale:u(pt)}),G(Ri,he().seg)}),oe("click",Et,()=>{I(gt,he().path+"/#")}),oe("contextmenu",Et,le=>{le.preventDefault(),I(ot,{x:le.clientX,y:le.clientY,topic:he().path},!0)}),T(te,Xe)},i=new Map,n=new Set,s=new Set;let r=null,a=V(0);function c(){r===null&&(r=requestAnimationFrame(()=>{r=null;for(const te of s)g(te);s.clear(),lk(a)}))}const h=new Map;function g(te){const he=te.split("/");let Ce=h,Ue="";for(let pt=0;pt<he.length;pt++){const Xe=he[pt];Ue=pt===0?Xe:`${Ue}/${Xe}`,Ce.has(Xe)||Ce.set(Xe,{seg:Xe,path:Ue,children:new Map,isLeaf:!1});const Et=Ce.get(Xe);pt===he.length-1&&(Et.isLeaf=!0),Ce=Et.children}}let f=V(wi(new Set));function p(te){const he=new Set(u(f));he.has(te)?he.delete(te):he.add(te),I(f,he,!0)}let v=V("");const _=24,w=5;let S=V(0),D=V(300),P=st(()=>{if(u(a),!u(v))return[];const te=u(v).toLowerCase().split(/\s+/).filter(Boolean),he=[];for(const[Ce,Ue]of i){const pt=Ce.toLowerCase();te.every(Xe=>pt.includes(Xe))&&he.push({topic:Ce,...Ue})}return he.sort((Ce,Ue)=>Ce.topic.localeCompare(Ue.topic))}),N=st(()=>{const te=u(P).length,he=Math.max(0,Math.floor(u(S)/_)-w),Ce=Math.min(te,Math.ceil((u(S)+u(D))/_)+w);return{start:he,end:Ce,totalH:te*_,top:he*_}});const z=1e3,F=200,ie=20,Y=36;let ge=0,_e=V(wi([])),Ae=V(wi([])),Le=V(!0),gt=V("#"),Tt=V(200);Dn(()=>{const te=u(gt).trim(),he=_l(()=>u(_e)),Ce=!te||te==="#"?he.slice(0,F):he.filter(Ue=>ft(te,Ue.topic)).slice(0,F);if(te&&te!=="#"){const Ue=new Set(Ce.map(Xe=>Xe.topic)),pt=[];for(const[Xe,Et]of i)Ue.has(Xe)||ft(te,Xe)&&pt.push({id:-(pt.length+1),topic:Xe,val:Et.val,ts:Et.ts,retained:!0});pt.sort((Xe,Et)=>Xe.topic.localeCompare(Et.topic)),I(Ae,[...Ce,...pt],!0)}else I(Ae,Ce,!0)});function ft(te,he){if(te==="#")return!0;const Ce=te.split("/"),Ue=he.split("/");for(let pt=0;pt<Ce.length;pt++){if(Ce[pt]==="#")return!0;if(pt>=Ue.length||Ce[pt]!=="+"&&Ce[pt]!==Ue[pt])return!1}return Ce.length===Ue.length}function mt(te){te.preventDefault();const he=te.clientY,Ce=u(Tt);function Ue(Xe){I(Tt,Math.max(60,Math.min(800,Ce+he-Xe.clientY)),!0)}function pt(){document.removeEventListener("mousemove",Ue),document.removeEventListener("mouseup",pt)}document.addEventListener("mousemove",Ue),document.addEventListener("mouseup",pt)}let ct=st(()=>{const te=Math.max(1,Math.floor((u(Tt)-Y)/ie)+1);return u(Ae).slice(0,te)}),Ot=V(!0),Me=V(null);async function Mt(){I(Ot,!0),I(Me,null);try{const te=await nR();for(const he of te)i.set(he.topic,{val:he.val,ts:he.ts}),g(he.topic)}catch(te){I(Me,te instanceof Error?te.message:String(te),!0)}finally{I(Ot,!1),lk(a)}}const je=Ul("mqtt",te=>{const{topic:he,val:Ce,ts:Ue}=te;i.set(he,{val:Ce,ts:Ue}),n.add(he),s.add(he),c();const pt={id:ge++,topic:he,val:Ce,ts:Ue};I(_e,[pt,...u(_e).slice(0,z-1)],!0);const Xe=u(gt).trim();(!Xe||Xe==="#"||ft(Xe,he))&&I(Ae,[pt,...u(Ae).filter(Et=>!(Et.retained&&Et.topic===he)).slice(0,F-1)],!0)});let ot=V(null),_t=V(null);async function pi(te,he){const Ce=[te];if(he){const Ue=te+"/";for(const pt of i.keys())pt.startsWith(Ue)&&Ce.push(pt)}for(const Ue of Ce)await lD(Ue,"",!0,0)}let Rt=st(()=>(u(a),[...i.keys()].sort())),Dt=V(""),kt=V(""),qi=V(!1),Ki=V(0),Mn=V(!1),cn=V(null),Vi=V(!1);async function dn(){if(u(Dt)){I(Mn,!0),I(cn,null),I(Vi,!1);try{await lD(u(Dt),u(kt),u(qi),u(Ki)),I(Vi,!0),setTimeout(()=>{I(Vi,!1)},2e3)}catch(te){I(cn,te instanceof Error?te.message:String(te),!0)}finally{I(Mn,!1)}}}function hn(te){return te==null?"":typeof te=="object"?JSON.stringify(te):String(te)}function Nn(te){return new Date(te).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function jn(te){return new Date(te).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function xn(te){return u(a),i.get(te)}let Rn=st(()=>(u(a),[...h.values()].sort((te,he)=>te.seg.localeCompare(he.seg)))),_n=st(()=>(u(a),i.size));Vr(Mt),oy(()=>{je(),r!==null&&cancelAnimationFrame(r)});var Un=dX(),Ye=x(C(Un),2),Ht=C(Ye),oi=C(Ht),Ut=x(oi,2);_i(Ut,20,()=>u(Rt),te=>te,(te,he)=>{var Ce=q9(),Ue={};X(()=>{Ue!==(Ue=he)&&(Ce.value=(Ce.__value=he)??"")}),T(te,Ce)});var mi=x(Ut,2),An=x(mi,2),un=C(An),ji=x(An,2),sn=C(ji);sn.value=sn.__value=0;var Wn=x(sn);Wn.value=Wn.__value=1;var Ni=x(Wn);Ni.value=Ni.__value=2;var on=x(ji,2),Bn=x(on,2);{var Jn=te=>{var he=K9();T(te,he)};q(Bn,te=>{u(Vi)&&te(Jn)})}var kn=x(Bn,2);{var Xi=te=>{var he=G9(),Ce=C(he);X(()=>G(Ce,u(cn))),T(te,he)};q(kn,te=>{u(cn)&&te(Xi)})}var On=x(Ht,2),rn=C(On),Se=x(rn,2),Z=C(Se);{var Pe=te=>{var he=Rr();X(()=>G(he,`${u(P).length??""} /`)),T(te,he)};q(Z,te=>{u(v)&&te(Pe)})}var at=x(Z),It=x(On,2);{var $t=te=>{var he=Z9();T(te,he)},H=te=>{var he=X9(),Ce=C(he);X(()=>G(Ce,u(Me))),T(te,he)},O=te=>{var he=Ds(),Ce=wt(he);{var Ue=Xe=>{var Et=Y9();T(Xe,Et)},pt=Xe=>{var Et=Q9(),li=C(Et),hi=C(li);_i(hi,21,()=>u(P).slice(u(N).start,u(N).end),ni=>ni.topic,(ni,Gi)=>{var vn=J9(),Ri=C(vn),qt=C(Ri),$=x(Ri,2),j=C($),K=x($,2),ue=C(K);X((le,De,pe)=>{G(qt,u(Gi).topic),Hn($,"title",le),G(j,De),G(ue,pe)},[()=>hn(u(Gi).val),()=>hn(u(Gi).val),()=>Nn(u(Gi).ts)]),T(ni,vn)}),X(()=>{zo(li,`height: ${u(N).totalH??""}px; position: relative;`),zo(hi,`top: ${u(N).top??""}px;`)}),es("scroll",Et,ni=>{I(S,ni.currentTarget.scrollTop,!0)}),yW(Et,"clientHeight",ni=>I(D,ni)),T(Xe,Et)};q(Ce,Xe=>{u(P).length===0?Xe(Ue):Xe(pt,-1)})}T(te,he)},ee=te=>{var he=tX(),Ce=C(he);{var Ue=Xe=>{var Et=eX();T(Xe,Et)},pt=Xe=>{var Et=Ds(),li=wt(Et);_i(li,17,()=>u(Rn),hi=>hi.path,(hi,ni)=>{t(hi,()=>u(ni))}),T(Xe,Et)};q(Ce,Xe=>{u(Rn).length===0?Xe(Ue):Xe(pt,-1)})}T(te,he)};q(It,te=>{u(Ot)?te($t):u(Me)?te(H,1):u(v)?te(O,2):te(ee,-1)})}var ke=x(Ye,2),Je=C(ke),Ge=x(Je,2),fe=C(Ge),Ie=x(fe,2);{var et=te=>{var he=iX(),Ce=C(he);X(()=>G(Ce,u(Ae).length)),T(te,he)};q(Ie,te=>{!u(Le)&&u(Ae).length>0&&te(et)})}var Zt=x(Ie,2),bt=C(Zt),Oe=x(Ge,2);{var yt=te=>{var he=rX(),Ce=C(he);{var Ue=Xe=>{var Et=nX();T(Xe,Et)},pt=Xe=>{var Et=Ds(),li=wt(Et);_i(li,17,()=>u(ct),hi=>hi.id,(hi,ni)=>{var Gi=oX();let vn;var Ri=C(Gi),qt=C(Ri),$=x(Ri,2);{var j=pe=>{var Fe=sX();T(pe,Fe)};q($,pe=>{u(ni).retained&&pe(j)})}var K=x($,2),ue=C(K),le=x(K,2),De=C(le);X((pe,Fe,lt)=>{vn=Kt(Gi,1,"sr svelte-1vejtrc",null,vn,{retained:u(ni).retained}),G(qt,pe),G(ue,u(ni).topic),Hn(le,"title",Fe),G(De,lt)},[()=>jn(u(ni).ts),()=>hn(u(ni).val),()=>hn(u(ni).val)]),T(hi,Gi)}),T(Xe,Et)};q(Ce,Xe=>{u(ct).length===0?Xe(Ue):Xe(pt,-1)})}T(te,he)};q(Oe,te=>{u(Le)&&te(yt)})}var Xt=x(ke,2);{var Yt=te=>{var he=aX(),Ce=wt(he),Ue=x(Ce,2);let pt;var Xe=C(Ue),Et=x(Xe,2);X(()=>pt=zo(Ue,"",pt,{left:`${u(ot).x??""}px`,top:`${u(ot).y??""}px`})),oe("click",Ce,()=>I(ot,null)),oe("contextmenu",Ce,li=>{li.preventDefault(),I(ot,null)}),oe("click",Xe,()=>{navigator.clipboard.writeText(u(ot).topic),I(ot,null)}),oe("click",Et,()=>{const li=u(ot).topic,hi=li+"/",ni=[...i.keys()].some(Gi=>Gi.startsWith(hi));I(_t,{topic:li,hasChildren:ni,recursive:!1},!0),I(ot,null)}),T(te,he)};q(Xt,te=>{u(ot)&&te(Yt)})}var ti=x(Xt,2);{var ii=te=>{var he=cX(),Ce=wt(he),Ue=x(Ce,2),pt=x(C(Ue),2),Xe=C(pt),Et=x(C(Xe)),li=C(Et),hi=x(Xe,2);{var ni=qt=>{var $=lX(),j=C($);qs(j,()=>u(_t).recursive,K=>u(_t).recursive=K),T(qt,$)};q(hi,qt=>{u(_t).hasChildren&&qt(ni)})}var Gi=x(pt,2),vn=C(Gi),Ri=x(vn,2);X(()=>G(li,u(_t).topic)),oe("click",Ce,()=>I(_t,null)),oe("click",vn,()=>I(_t,null)),oe("click",Ri,()=>{const{topic:qt,recursive:$}=u(_t);I(_t,null),pi(qt,$)}),T(te,he)};q(ti,te=>{u(_t)&&te(ii)})}X(()=>{on.disabled=u(Mn)||!u(Dt),G(at,` ${u(_n)??""}`),zo(ke,u(Le)?`height: ${u(Tt)}px;`:""),G(bt,u(Le)?"▾":"▸")}),Ei(oi,()=>u(Dt),te=>I(Dt,te)),Ei(mi,()=>u(kt),te=>I(kt,te)),qs(un,()=>u(qi),te=>I(qi,te)),ha(ji,()=>u(Ki),te=>I(Ki,te)),oe("click",on,dn),Ei(rn,()=>u(v),te=>I(v,te)),oe("mousedown",Je,mt),Ei(fe,()=>u(gt),te=>I(gt,te)),oe("click",Zt,()=>{I(Le,!u(Le))}),T(o,Un),Do()}mr(["click","contextmenu","mousedown"]);var uX=R('<div class="restart-banner svelte-twakcj">⚠ Package changes require a daemon restart to take effect. Use the ↺ button in the topbar.</div>'),gX=R('<div class="err svelte-twakcj"> </div>'),fX=R('<span class="pane-count pane-count--warn svelte-twakcj"> </span>'),pX=R('<p class="empty svelte-twakcj">No packages installed.</p>'),mX=R('<p class="empty svelte-twakcj">No match.</p>'),_X=R('<span class="dep-latest svelte-twakcj"> </span>'),vX=lT('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><circle cx="8" cy="8" r="6" stroke-dasharray="18" stroke-dashoffset="4"></circle></svg>'),bX=lT('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13 8A5 5 0 1 1 10.5 3.67"></path><polyline points="10.5,1.5 10.5,4 13,4"></polyline></svg>'),yX=R('<div><div class="dep-info svelte-twakcj"><a class="dep-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="dep-ver svelte-twakcj"> </span> <!></div> <div class="dep-btns svelte-twakcj"><button><!></button> <button class="icon-btn icon-btn--danger svelte-twakcj" title="Uninstall"><svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><line x1="2" y1="2" x2="14" y2="14"></line><line x1="14" y1="2" x2="2" y2="14"></line></svg></button></div></div>'),wX=R('<span class="result-author svelte-twakcj"> </span>'),SX=R('<span class="result-date svelte-twakcj"> </span>'),CX=R('<span class="result-desc svelte-twakcj"> </span>'),xX=R('<div class="result-row svelte-twakcj"><div class="result-info svelte-twakcj"><a class="result-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="result-ver svelte-twakcj"> </span> <!> <!> <!></div> <button class="install-btn svelte-twakcj"> </button></div>'),LX=R('<div class="results-list svelte-twakcj"></div>'),kX=R('<pre class="npm-output svelte-twakcj"> </pre>'),IX=R(`<p class="hint svelte-twakcj">Install npm packages into <code class="svelte-twakcj">~/.she/</code>. Scripts can then <code class="svelte-twakcj">require('package-name')</code> directly.</p>`),DX=R('<div class="pkg-shell svelte-twakcj"><!> <!> <div class="pkg-body svelte-twakcj"><div class="pkg-left svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Installed</span> <span class="pane-count svelte-twakcj"> </span> <!> <button class="icon-btn check-outdated-btn svelte-twakcj" title="Check for package updates"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13 8A5 5 0 1 1 10.5 3.67"></path><polyline points="10.5,1.5 10.5,4 13,4"></polyline></svg></button></div> <div class="filter-row svelte-twakcj"><input class="filter-in svelte-twakcj" type="search" placeholder="Filter…"/></div> <div class="installed-list svelte-twakcj"><!></div></div> <div class="pkg-right svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Search npm</span></div> <div class="search-row svelte-twakcj"><input class="search-in svelte-twakcj" type="text" placeholder="Package name, e.g. axios, lodash…"/> <button class="search-btn svelte-twakcj"> </button></div> <!> <!> <!></div></div></div>');function EX(o,e){Io(e,!0);let t=V(wi([])),i=V(""),n=V(wi({})),s=V(!1),r=V(""),a=V(wi([])),c=V(!1),h=V(!1),g=V(""),f=V(""),p=wi({});const v=st(()=>u(i).trim()?u(t).filter(Ye=>Ye.name.toLowerCase().includes(u(i).toLowerCase())):u(t)),_=st(()=>Object.keys(u(n)).length);Vr(async()=>{await Promise.all([w(),S()])});async function w(){try{I(t,await s8(),!0),I(g,"")}catch(Ye){I(g,Ye.message,!0)}}async function S(){try{I(n,await c8(),!0)}catch{}}async function D(){I(s,!0);try{I(n,await d8(),!0)}catch{}finally{I(s,!1)}}async function P(){const Ye=u(r).trim();if(!Ye){I(a,[],!0);return}I(h,!0),I(g,"");try{I(a,await o8(Ye),!0)}catch(Ht){I(g,Ht.message,!0)}finally{I(h,!1)}}function N(Ye){if(!Ye)return"";try{return new Date(Ye).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}async function z(Ye,Ht){p[Ye]=!0,I(g,""),I(f,"");try{const oi=await r8(Ye,Ht);I(f,oi.stdout||oi.stderr||"Done.",!0),I(c,!0),await w()}catch(oi){I(g,oi.message,!0)}finally{p[Ye]=!1}}async function F(Ye){p[Ye]=!0,I(g,""),I(f,"");try{const Ht=await a8(Ye);I(f,Ht.stdout||Ht.stderr||"Done.",!0),I(c,!0);const oi={...u(n)};delete oi[Ye],I(n,oi,!0),await w()}catch(Ht){I(g,Ht.message,!0)}finally{p[Ye]=!1}}async function ie(Ye){p[Ye]=!0,I(g,""),I(f,"");try{const Ht=await l8(Ye);I(f,Ht.stdout||Ht.stderr||"Done.",!0),I(c,!0);const oi={...u(n)};delete oi[Ye],I(n,oi,!0),await w()}catch(Ht){I(g,Ht.message,!0)}finally{p[Ye]=!1}}var Y=DX(),ge=C(Y);{var _e=Ye=>{var Ht=uX();T(Ye,Ht)};q(ge,Ye=>{u(c)&&Ye(_e)})}var Ae=x(ge,2);{var Le=Ye=>{var Ht=gX(),oi=C(Ht);X(()=>G(oi,u(g))),T(Ye,Ht)};q(Ae,Ye=>{u(g)&&Ye(Le)})}var gt=x(Ae,2),Tt=C(gt),ft=C(Tt),mt=x(C(ft),2),ct=C(mt),Ot=x(mt,2);{var Me=Ye=>{var Ht=fX(),oi=C(Ht);X(()=>G(oi,`${u(_)??""} outdated`)),T(Ye,Ht)};q(Ot,Ye=>{u(_)>0&&Ye(Me)})}var Mt=x(Ot,2),je=C(Mt);let ot;var _t=x(ft,2),pi=C(_t),Rt=x(_t,2),Dt=C(Rt);{var kt=Ye=>{var Ht=pX();T(Ye,Ht)},qi=Ye=>{var Ht=mX();T(Ye,Ht)},Ki=Ye=>{var Ht=Ds(),oi=wt(Ht);_i(oi,17,()=>u(v),Ut=>Ut.name,(Ut,mi)=>{var An=yX();let un;var ji=C(An),sn=C(ji),Wn=C(sn),Ni=x(sn,2),on=C(Ni),Bn=x(Ni,2);{var Jn=at=>{var It=_X(),$t=C(It);X(()=>G($t,`→ v${u(n)[u(mi).name].latest??""}`)),T(at,It)};q(Bn,at=>{u(n)[u(mi).name]&&at(Jn)})}var kn=x(ji,2),Xi=C(kn);let On;var rn=C(Xi);{var Se=at=>{var It=vX();T(at,It)},Z=at=>{var It=bX();T(at,It)};q(rn,at=>{p[u(mi).name]?at(Se):at(Z,-1)})}var Pe=x(Xi,2);X(()=>{un=Kt(An,1,"dep-row svelte-twakcj",null,un,{"dep-busy":!!p[u(mi).name]}),Hn(sn,"href",u(mi).url??`https://www.npmjs.com/package/${u(mi).name}`),G(Wn,u(mi).name),G(on,u(mi).installedVersion??u(mi).version),On=Kt(Xi,1,"icon-btn svelte-twakcj",null,On,{"icon-btn--update":!!u(n)[u(mi).name]}),Xi.disabled=!!p[u(mi).name],Hn(Xi,"title",u(n)[u(mi).name]?`Update to v${u(n)[u(mi).name].latest}`:"Update to latest"),Pe.disabled=!!p[u(mi).name]}),oe("click",Xi,()=>ie(u(mi).name)),oe("click",Pe,()=>F(u(mi).name)),T(Ut,An)}),T(Ye,Ht)};q(Dt,Ye=>{u(t).length===0?Ye(kt):u(v).length===0?Ye(qi,1):Ye(Ki,-1)})}var Mn=x(Tt,2),cn=x(C(Mn),2),Vi=C(cn),dn=x(Vi,2),hn=C(dn),Nn=x(cn,2);{var jn=Ye=>{var Ht=LX();_i(Ht,21,()=>u(a),oi=>oi.name,(oi,Ut)=>{var mi=xX(),An=C(mi),un=C(An),ji=C(un),sn=x(un,2),Wn=C(sn),Ni=x(sn,2);{var on=Se=>{var Z=wX(),Pe=C(Z);X(()=>G(Pe,u(Ut).author)),T(Se,Z)};q(Ni,Se=>{u(Ut).author&&Se(on)})}var Bn=x(Ni,2);{var Jn=Se=>{var Z=SX(),Pe=C(Z);X(at=>{Hn(Z,"title",u(Ut).date),G(Pe,at)},[()=>N(u(Ut).date)]),T(Se,Z)};q(Bn,Se=>{u(Ut).date&&Se(Jn)})}var kn=x(Bn,2);{var Xi=Se=>{var Z=CX(),Pe=C(Z);X(()=>G(Pe,u(Ut).description)),T(Se,Z)};q(kn,Se=>{u(Ut).description&&Se(Xi)})}var On=x(An,2),rn=C(On);X(()=>{Hn(un,"href",u(Ut).url??`https://www.npmjs.com/package/${u(Ut).name}`),G(ji,u(Ut).name),G(Wn,u(Ut).version),On.disabled=!!p[u(Ut).name],G(rn,p[u(Ut).name]?"Installing…":"Install")}),oe("click",On,()=>z(u(Ut).name)),T(oi,mi)}),T(Ye,Ht)};q(Nn,Ye=>{u(a).length>0&&Ye(jn)})}var xn=x(Nn,2);{var Rn=Ye=>{var Ht=kX(),oi=C(Ht);X(()=>G(oi,u(f))),T(Ye,Ht)};q(xn,Ye=>{u(f)&&Ye(Rn)})}var _n=x(xn,2);{var Un=Ye=>{var Ht=IX();T(Ye,Ht)};q(_n,Ye=>{!u(a).length&&!u(f)&&Ye(Un)})}X(()=>{G(ct,u(t).length),Mt.disabled=u(s),ot=Kt(je,0,"svelte-twakcj",null,ot,{spinning:u(s)}),dn.disabled=u(h),G(hn,u(h)?"Searching…":"Search")}),oe("click",Mt,D),Ei(pi,()=>u(i),Ye=>I(i,Ye)),oe("keydown",Vi,Ye=>Ye.key==="Enter"&&P()),Ei(Vi,()=>u(r),Ye=>I(r,Ye)),oe("click",dn,P),T(o,Y),Do()}mr(["click","keydown"]);var PX=R('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),TX=R('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),MX=R('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),NX=R('<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"><polyline points="4 4 4 10 10 10"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> </button>'),RX=R('<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"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> </button></div></div>'),AX=R('<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),OX=R('<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),FX=R('<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></dl>'),HX=R('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),WX=R('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><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"><path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path><line x1="12" y1="2" x2="12" y2="12"></line></svg> Restart daemon</button></div></div>'),BX=R('<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"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg></button>'),zX=R('<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"><polyline points="5,3 1,8 5,13"></polyline><polyline points="11,3 15,8 11,13"></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"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1"></rect><path d="M2,11 V5 H5 V11"></path><path d="M6,12 V5 H9 V8 H6"></path><path d="M10,11 V5 H15 V11"></path><line x1="12.5" y1="5" x2="12.5" y2="11"></line></svg> Packages</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle"><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"></path></svg> MQTT</button> <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"><path d="M8,2 L8,7"></path><path d="M6,5 L8,7.5 L10,5"></path><path d="M2.5,14 L6,10"></path><path d="M6.2,12.8 L6,10 L3.2,10.2"></path><path d="M13.5,14 L10,10"></path><path d="M9.8,12.8 L10,10 L12.8,10.2"></path></svg> Matter</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="8" cy="4.5" rx="5" ry="1.8"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7"></path><path d="M3,8 a5,1.8 0,0,0 10,0"></path></svg> DB</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="2" y1="5" x2="14" y2="5"></line><line x1="2" y1="8" x2="14" y2="8"></line><line x1="2" y1="11" x2="9" y2="11"></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"><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"></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"><line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></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"><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"></path><circle cx="12" cy="12" r="3"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),VX=R('<div class="login-error svelte-1n46o8q"> </div>'),jX=R('<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>'),UX=R('<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"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> Updating smart-home-engine…</div></div>'),$X=R("<!> <!> <!>",1);function qX(o,e){Io(e,!0);const t=["scripts","mqtt","matter","db","logs","config","packages"];function i(){const mt=location.hash.slice(1);return t.includes(mt)?mt:"scripts"}let n=V(wi(i())),s=V(null),r=V(!1),a=V(!1),c=V(!1),h=V(!1),g=V("none"),f=V(""),p=V(!1),v=V(""),_=V(""),w=V(!1),S=V(!1);W7(()=>{I(p,!0)});async function D(){I(_,""),I(w,!0);try{await V7(u(v)),I(v,""),I(p,!1)}catch(mt){I(_,mt.message??"Login failed",!0)}finally{I(w,!1)}}async function P(){if(u(g)==="proxy"&&u(f)){window.location.href=u(f);return}await j7(),I(p,!0)}let N=V(null);async function z(){if(await u(N).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))try{await G7(),setTimeout(()=>location.reload(),2500)}catch{}}async function F(){I(c,!0);try{const mt=await X7();u(s)&&I(s,{...u(s),latestVersion:mt.latestVersion??void 0},!0)}catch{}finally{I(c,!1)}}async function ie(){var Ot;if(!await u(N).show(`Update to v${(Ot=u(s))==null?void 0:Ot.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;I(a,!1),I(h,!0);try{await Z7()}catch{}let mt=!1;const ct=Date.now()+18e4;for(;Date.now()<ct;){await new Promise(Me=>setTimeout(Me,2e3));try{if(await Qx(),mt){location.reload();return}}catch{mt=!0}}location.reload()}function Y(mt){I(n,mt,!0),location.hash=mt}Vr(async()=>{location.hash||(location.hash=u(n));const mt=()=>{I(n,i(),!0)};window.addEventListener("hashchange",mt);try{const Me=await z7();I(g,Me.mode,!0),I(f,Me.proxyLogoutUrl??"",!0),u(g)==="password"&&(await fetch("/she/scripts")).status===401&&I(p,!0)}catch{}I(S,!0);async function ct(){try{I(s,await Qx(),!0)}catch{}}ct();const Ot=setInterval(ct,5e3);return()=>{window.removeEventListener("hashchange",mt),clearInterval(Ot)}});var ge=$X();es("click",zP,()=>{u(r)&&I(r,!1),u(a)&&I(a,!1)});var _e=wt(ge);{var Ae=mt=>{var ct=zX(),Ot=C(ct),Me=x(C(Ot),2);let Mt;var je=x(Me,2);let ot;var _t=x(je,2);let pi;var Rt=x(_t,2);let Dt;var kt=x(Rt,2);let qi;var Ki=x(kt,2);let Mn;var cn=x(Ki,4),Vi=x(C(cn),2),dn=C(Vi),hn=C(dn);hn.nodeValue="v0.24.2 ";var Nn=x(hn);{var jn=Ge=>{var fe=PX();T(Ge,fe)};q(Nn,Ge=>{var fe;(fe=u(s))!=null&&fe.latestVersion&&Ge(jn)})}var xn=x(dn,2);{var Rn=Ge=>{var fe=RX(),Ie=C(fe),et=x(C(Ie));et.textContent="v0.24.2";var Zt=x(et,2);{var bt=Ce=>{var Ue=TX(),pt=x(wt(Ue)),Xe=C(pt);X(()=>G(Xe,`v${u(s).latestVersion??""}`)),T(Ce,Ue)},Oe=Ce=>{var Ue=MX();T(Ce,Ue)};q(Zt,Ce=>{var Ue;(Ue=u(s))!=null&&Ue.latestVersion?Ce(bt):Ce(Oe,-1)})}var yt=x(Ie,2),Xt=C(yt);{var Yt=Ce=>{var Ue=NX(),pt=x(C(Ue));X(()=>G(pt,` Update to v${u(s).latestVersion??""}`)),oe("click",Ue,ie),T(Ce,Ue)};q(Xt,Ce=>{var Ue;(Ue=u(s))!=null&&Ue.latestVersion&&Ce(Yt)})}var ti=x(Xt,2),ii=C(ti);let te;var he=x(ii);X(()=>{ti.disabled=u(c),te=Kt(ii,0,"svelte-1n46o8q",null,te,{spinning:u(c)}),G(he,` ${u(c)?"Checking…":"Check for updates"}`)}),oe("click",fe,Ce=>Ce.stopPropagation()),oe("click",ti,F),T(Ge,fe)};q(xn,Ge=>{u(a)&&Ge(Rn)})}var _n=x(Vi,2),Un=C(_n),Ye=x(Un,2);{var Ht=Ge=>{var fe=WX(),Ie=C(fe);{var et=yt=>{var Xt=FX(),Yt=x(C(Xt)),ti=C(Yt),ii=x(Yt,3),te=C(ii),he=x(ii,3),Ce=C(he),Ue=x(he,2);{var pt=qt=>{var $=AX(),j=x(wt($)),K=C(j),ue=x(j,3),le=C(ue);X(()=>{G(K,u(s).matterNodes??0),G(le,u(s).matterEndpoints??0)}),T(qt,$)};q(Ue,qt=>{u(s).matterEnabled&&qt(pt)})}var Xe=x(Ue,2);{var Et=qt=>{var $=OX(),j=x(wt($)),K=C(j),ue=x(j,3),le=C(ue);X(()=>{G(K,u(s).dbDocs??"—"),G(le,u(s).dbViews??"—")}),T(qt,$)};q(Xe,qt=>{u(s).dbEnabled&&qt(Et)})}var li=x(Xe,3),hi=C(li),ni=x(li,3),Gi=C(ni),vn=x(ni,3),Ri=C(vn);X(()=>{G(ti,u(s).scripts),G(te,u(s).topics),G(Ce,u(s).mqttMsgPerSec??"—"),G(hi,u(s).handlers??"—"),G(Gi,u(s).memMb!=null?u(s).memMb+" MB":"—"),G(Ri,u(s).cpuPercent!=null?u(s).cpuPercent+" %":"—")}),T(yt,Xt)},Zt=yt=>{var Xt=HX();T(yt,Xt)};q(Ie,yt=>{u(s)?yt(et):yt(Zt,-1)})}var bt=x(Ie,2),Oe=C(bt);oe("click",fe,yt=>yt.stopPropagation()),oe("click",Oe,()=>{I(r,!1),z()}),T(Ge,fe)};q(Ye,Ge=>{u(r)&&Ge(Ht)})}var oi=x(_n,2);let Ut;var mi=x(oi,2);{var An=Ge=>{var fe=BX();oe("click",fe,P),T(Ge,fe)};q(mi,Ge=>{u(g)==="password"&&Ge(An)})}var un=x(Ot,2),ji=C(un);Ss(tm(ji,{}),Ge=>I(N,Ge,!0),()=>u(N));var sn=x(ji,2);let Wn;var Ni=C(sn);{let Ge=st(()=>u(n)==="scripts");nG(Ni,{get active(){return u(Ge)}})}var on=x(sn,2);let Bn;var Jn=C(on);EX(Jn,{});var kn=x(on,2);let Xi;var On=C(kn);hX(On,{});var rn=x(kn,2);let Se;var Z=C(rn);B9(Z,{});var Pe=x(rn,2);let at;var It=C(Pe);XZ(It,{});var $t=x(Pe,2);let H;var O=C($t);VG(O,{});var ee=x($t,2);let ke;var Je=C(ee);qG(Je,{}),X(()=>{Mt=Kt(Me,1,"svelte-1n46o8q",null,Mt,{active:u(n)==="scripts"}),ot=Kt(je,1,"svelte-1n46o8q",null,ot,{active:u(n)==="packages"}),pi=Kt(_t,1,"svelte-1n46o8q",null,pi,{active:u(n)==="mqtt"}),Dt=Kt(Rt,1,"svelte-1n46o8q",null,Dt,{active:u(n)==="matter"}),qi=Kt(kt,1,"svelte-1n46o8q",null,qi,{active:u(n)==="db"}),Mn=Kt(Ki,1,"svelte-1n46o8q",null,Mn,{active:u(n)==="logs"}),Ut=Kt(oi,1,"nav-settings svelte-1n46o8q",null,Ut,{active:u(n)==="config"}),Wn=Kt(sn,1,"page-wrap svelte-1n46o8q",null,Wn,{hidden:u(n)!=="scripts"}),Bn=Kt(on,1,"page-wrap svelte-1n46o8q",null,Bn,{hidden:u(n)!=="packages"}),Xi=Kt(kn,1,"page-wrap svelte-1n46o8q",null,Xi,{hidden:u(n)!=="mqtt"}),Se=Kt(rn,1,"page-wrap svelte-1n46o8q",null,Se,{hidden:u(n)!=="matter"}),at=Kt(Pe,1,"page-wrap svelte-1n46o8q",null,at,{hidden:u(n)!=="db"}),H=Kt($t,1,"page-wrap svelte-1n46o8q",null,H,{hidden:u(n)!=="config"}),ke=Kt(ee,1,"page-wrap svelte-1n46o8q",null,ke,{hidden:u(n)!=="logs"})}),oe("click",Me,()=>Y("scripts")),oe("click",je,()=>Y("packages")),oe("click",_t,()=>Y("mqtt")),oe("click",Rt,()=>Y("matter")),oe("click",kt,()=>Y("db")),oe("click",Ki,()=>Y("logs")),oe("click",dn,Ge=>{Ge.stopPropagation(),I(a,!u(a)),I(r,!1)}),oe("click",Un,Ge=>{Ge.stopPropagation(),I(r,!u(r)),I(a,!1)}),oe("click",oi,()=>Y("config")),T(mt,ct)};q(_e,mt=>{u(S)&&!u(p)&&mt(Ae)})}var Le=x(_e,2);{var gt=mt=>{var ct=jX(),Ot=C(ct),Me=x(C(Ot),4),Mt=x(C(Me),2),je=x(Me,2);{var ot=Rt=>{var Dt=VX(),kt=C(Dt);X(()=>G(kt,u(_))),T(Rt,Dt)};q(je,Rt=>{u(_)&&Rt(ot)})}var _t=x(je,2),pi=C(_t);X(()=>{Mt.disabled=u(w),_t.disabled=u(w)||!u(v),G(pi,u(w)?"Signing in…":"Sign in")}),es("submit",Ot,Rt=>{Rt.preventDefault(),D()}),Ei(Mt,()=>u(v),Rt=>I(v,Rt)),T(mt,ct)};q(Le,mt=>{u(p)&&mt(gt)})}var Tt=x(Le,2);{var ft=mt=>{var ct=UX();T(mt,ct)};q(Tt,mt=>{u(h)&&mt(ft)})}T(o,ge),Do()}mr(["click"]);rW(qX,{target:document.getElementById("app")});export{wT as t};
@@ -1,4 +1,4 @@
1
- import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-DB2s4UBZ.js";/*!-----------------------------------------------------------------------------
1
+ import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-7iwVdvJ3.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -155,7 +155,7 @@
155
155
  }
156
156
  })();
157
157
  </script>
158
- <script type="module" crossorigin src="/assets/index-DB2s4UBZ.js"></script>
158
+ <script type="module" crossorigin src="/assets/index-7iwVdvJ3.js"></script>
159
159
  <link rel="modulepreload" crossorigin href="/assets/monaco-langs-BW2J83t5.js">
160
160
  <link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
161
161
  <link rel="stylesheet" crossorigin href="/assets/index-OfBaeGiK.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-home-engine",
3
- "version": "0.24.1",
3
+ "version": "0.24.2",
4
4
  "description": "Node.js based script runner for use in MQTT based Smart Home environments",
5
5
  "main": "src/index.js",
6
6
  "scripts": {