smart-home-engine 0.23.1 → 0.23.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-
|
|
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-Bt_apCqT.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var nA=Object.defineProperty;var yL=o=>{throw TypeError(o)};var sA=(o,e,t)=>e in o?nA(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var Oi=(o,e,t)=>sA(o,typeof e!="symbol"?e+"":e,t),Mw=(o,e,t)=>e.has(o)||yL("Cannot "+t);var ee=(o,e,t)=>(Mw(o,e,"read from private field"),t?t.call(o):e.get(o)),Di=(o,e,t)=>e.has(o)?yL("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Ei=(o,e,t,i)=>(Mw(o,e,"write to private field"),i?i.call(o,t):e.set(o,t),t),bn=(o,e,t)=>(Mw(o,e,"access private method"),t);import{_ as OD,m as FD,l as pt,A as qs,C as re,I as Sn,D as Sp,a as Xn,g as HD,M as Qe,b as Zt,E as Nr,c as M,r as Qi,d as rr,e as w,f as oA,h as gn,R as Pi,S as Bt,i as Ps,j as ar,k as Hi,n as pi,o as se,p as we,K as es,q as gt,s as Ae,t as rs,u as W,v as Ci,O as ga,w as ss,P as _t,x as Nw,y as Cp,z as WD,B as qa,F as Rr,G as Ty,H as _s,U as nn,J as Fu,L as vt,N as Ja,Q as rA,T as zs,V as My,W as aA,X as BD,$ as ut,Y as Ui,Z as Fi,a0 as Mn,a1 as oi,a2 as Co,a3 as Df,a4 as Ne,a5 as Bm,a6 as lA,a7 as cA,a8 as os,a9 as dA,aa as Ar,ab as Ks,ac as St,ad as zD,ae as wn,af as hA,ag as uA,ah as Us,ai as fg,aj as ts,ak as kb,al as Hs,am as fc,an as s0,ao as Db,ap as fs,aq as Hu,ar as ps,as as Eb,at as Pb,au as gA,av as xp,aw as pg,ax as ll,ay as fA,az as mg,aA as pA,aB as o0,aC as mA,aD as _A,aE as SL,aF as Zn,aG as Ka,aH as Ws,aI as hi,aJ as Va,aK as vA,aL as _a,aM as wo,aN as ds,aO as Or,aP as r0,aQ as as,aR as qn,aS as u_,aT as di,aU as VD,aV as bA,aW as a0,aX as Tb,aY as l0,aZ as c0,a_ as qc,a$ as wA,b0 as d0,b1 as yA,b2 as h0,b3 as cl,b4 as dl,b5 as Wu,b6 as Ef,b7 as lo,b8 as Lp,b9 as g_,ba as Rw,bb as rn,bc as u0,bd as Ip,be as Mb,bf as SA,bg as UD,bh as Pf,bi as Bu,bj as Tf,bk as kp,bl as Nb,bm as Bi,bn as pc,bo as Dp,bp as CA,bq as xA,br as g0,bs as LA,bt as f_,bu as Bo,bv as f0,bw as zu,bx as hl,by as _g,bz as yi,bA as Vu,bB as jD,bC as Ep,bD as IA,bE as Kc,bF as nt,bG as CL,bH as zm,bI as $D,bJ as dr,bK as Dr,bL as dn,bM as Uu,bN as er,bO as ju,bP as Tn,bQ as Mf,bR as ch,bS as Ny,bT as qD,bU as KD,bV as GD,bW as p0,bX as eo,bY as Yi,bZ as Pp,b_ as ZD,b$ as Ga,c0 as Rb,c1 as kA,c2 as Xh,c3 as xL,c4 as Tp,c5 as XD,c6 as Yh,c7 as DA,c8 as Ko,c9 as Ab,ca as EA,cb as Gs,cc as Fr,cd as Mp,ce as Nf,cf as YD,cg as Oo,ch as Np,ci as Ob,cj as PA,ck as TA,cl as MA,cm as vg,cn as va,co as hs,cp as NA,cq as m0,cr as RA,cs as AA,ct as LL,cu as OA,cv as Rp,cw as Qa,cx as Ry,cy as jd,cz as el,cA as FA,cB as fa,cC as tr,cD as _o,cE as IL,cF as Ms,cG as Ap,cH as oc,cI as ba,cJ as HA,cK as Hr,cL as Rf,cM as Fb,cN as JD,cO as WA,cP as BA,cQ as _0,cR as zA,cS as Af,cT as VA,cU as Tl,cV as Of,cW as kL,cX as UA,cY as jA,cZ as Sa,c_ as $A,c$ as v0,d0 as QD,d1 as eE,d2 as tE,d3 as iE,d4 as qA,d5 as KA,d6 as nE,d7 as sE,d8 as GA,d9 as b0,da as ZA,db as XA,dc as Wn,dd as YA,de as w0,df as JA,dg as Jh,dh as DL,di as QA,dj as eO,dk as tO,dl as iO,dm as nO,dn as sO,dp as $u,dq as Hb,dr as Ay,ds as oO,dt as rO,du as EL,dv as Oy,dw as aO,dx as PL,dy as Aw,dz as lO,dA as oE,dB as cO,dC as rE,dD as Fy,dE as dO,dF as hO,dG as uO,dH as aE,dI as lE,dJ as gO,dK as p_,dL as cE,dM as Wb,dN as fO,dO as pO,dP as rc,dQ as y0,dR as mO,dS as TL,dT as ML,dU as _O,dV as Qh,dW as dE,dX as vO,dY as bO,dZ as wO,d_ as yO,d$ as hE,e0 as uE,e1 as gE,e2 as fE,e3 as SO,e4 as pa,e5 as NL,e6 as CO,e7 as Op,e8 as xO,e9 as jg,ea as pE,eb as RL,ec as Ff,ed as mE,ee as m_,ef as LO,eg as _E,eh as IO,ei as vE,ej as kO,ek as DO,el as bE,em as wE,en as tl,eo as Bb,ep as EO,eq as yE,er as yo,es as Gc,et as SE,eu as PO,ev as TO,ew as CE,ex as xE,ey as MO,ez as LE,eA as IE,eB as Hf,eC as NO,eD as RO,eE as AO,eF as OO,eG as Ng,eH as AL,eI as FO,eJ as HO,eK as WO,eL as __,eM as ws,eN as BO,eO as Hy,eP as dh,eQ as zO,eR as Ba,eS as VO,eT as UO,eU as kE,eV as jO,eW as lf,eX as $O,eY as qO,eZ as KO,e_ as GO,e$ as OL,f0 as FL,f1 as HL,f2 as hh,f3 as S0,f4 as DE,f5 as Wy,f6 as Vm,f7 as EE,f8 as v_,f9 as ZO,fa as XO,fb as YO,fc as JO,fd as C0,fe as PE,ff as QO,fg as b_,fh as TE,fi as ME,fj as e2,fk as t2,fl as i2,fm as n2,fn as s2,fo as o2,fp as r2,fq as a2,fr as NE,fs as l2,ft as w_,fu as RE,fv as c2,fw as AE,fx as d2,fy as OE,fz as FE,fA as h2,fB as WL,fC as HE,fD as BL,fE as u2,fF as Ow,fG as zL,fH as g2,fI as f2,fJ as p2,fK as ra,fL as ac,fM as m2,fN as VL,fO as Um,fP as _2,fQ as Ua,fR as zb,fS as By,fT as v2,fU as WE,fV as BE,fW as Ns,fX as UL,fY as dm,fZ as x0,f_ as b2,f$ as w2,g0 as y2,g1 as S2,g2 as C2,g3 as x2,g4 as L2,g5 as I2,g6 as jL,g7 as k2,g8 as D2,g9 as E2,ga as qu,gb as cf,gc as zE,gd as P2,ge as L0,gf as jm,gg as hm,gh as Fw,gi as T2,gj as M2,gk as VE,gl as N2,gm as I0,gn as R2,go as A2,gp as UE,gq as Vb,gr as O2,gs as y_,gt as k0,gu as D0,gv as E0,gw as jE,gx as $E,gy as qE,gz as KE,gA as GE,gB as ZE,gC as XE,gD as $L,gE as YE,gF as Dh,gG as F2,gH as H2,gI as W2,gJ as B2,gK as JE,gL as z2,gM as V2,gN as qL,gO as zy,gP as Wl,gQ as U2,gR as j2,gS as $2,gT as q2,gU as K2,gV as G2,gW as KL,gX as P0,gY as Vy,gZ as Z2,g_ as Uy,g$ as X2,h0 as Y2,h1 as J2,h2 as Q2,h3 as T0,h4 as QE,h5 as GL,h6 as ZL,h7 as eF,h8 as tF,h9 as iF,ha as XL,hb as Hw,hc as nF,hd as sF,he as oF,hf as Ww,hg as eP,hh as tP,hi as iP,hj as nP,hk as il,hl as sP,hm as M0,hn as YL,ho as rF,hp as oP,hq as aF,hr as lF,hs as Ub,ht as jb,hu as uh,hv as $b,hw as Fp,hx as cF,hy as qb,hz as dF,hA as hF,hB as uF,hC as rP,hD as Rg,hE as gF,hF as fF,hG as pF,hH as mF,hI as Hp,hJ as _F,hK as aP,hL as lP,hM as cP,hN as jy,hO as vF,hP as bF,hQ as wF,hR as yF,hS as SF,hT as $y,hU as CF,hV as xF,hW as LF,hX as IF,hY as kF,hZ as DF,h_ as EF,h$ as PF,i0 as dP,i1 as TF,i2 as MF,i3 as NF,i4 as JL,i5 as RF,i6 as AF,i7 as Mc,i8 as Ma,i9 as OF,ia as FF}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 hP=!1;var N0=Array.isArray,HF=Array.prototype.indexOf,S_=Array.prototype.includes,Kb=Array.from,WF=Object.defineProperty,fu=Object.getOwnPropertyDescriptor,BF=Object.getOwnPropertyDescriptors,zF=Object.prototype,VF=Array.prototype,uP=Object.getPrototypeOf,QL=Object.isExtensible;const Gb=()=>{};function UF(o){for(var e=0;e<o.length;e++)o[e]()}function gP(){var o,e,t=new Promise((i,n)=>{o=i,e=n});return{promise:t,resolve:o,reject:e}}function eI(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 Os=2,Ku=4,Zb=8,fP=1<<24,Er=16,Mr=32,lc=64,qy=128,sr=512,ys=1024,Is=2048,wa=4096,so=8192,or=16384,bg=32768,Ky=1<<25,Gu=65536,C_=1<<17,jF=1<<18,wg=1<<19,$F=1<<20,da=1<<25,$d=65536,x_=1<<21,pu=1<<22,Bl=1<<23,Zc=Symbol("$state"),qF=Symbol("legacy props"),KF=Symbol(""),$m=Symbol("attributes"),Gy=Symbol("class"),Zy=Symbol("style"),$g=Symbol("text"),qm=Symbol("form reset"),Xb=new class extends Error{constructor(){super(...arguments);Oi(this,"name","StaleReactionError");Oi(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function pP(o){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function GF(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function ZF(o,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function XF(o){throw new Error("https://svelte.dev/e/effect_in_teardown")}function YF(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function JF(o){throw new Error("https://svelte.dev/e/effect_orphan")}function QF(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function eH(o){throw new Error("https://svelte.dev/e/props_invalid_value")}function tH(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function iH(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function nH(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function sH(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const oH=1,rH=2,mP=4,aH=8,lH=16,cH=1,dH=4,hH=8,uH=16,gH=1,fH=2,bs=Symbol("uninitialized"),_P="http://www.w3.org/1999/xhtml",pH="http://www.w3.org/2000/svg",mH="http://www.w3.org/1998/Math/MathML";function _H(){console.warn("https://svelte.dev/e/derived_inert")}function vH(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function bH(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function vP(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 bP(o){return!wH(o,this.v)}let yH=!1,As=null;function Zu(o){As=o}function Lo(o,e=!1,t){As={p:As,i:!1,c:null,e:null,s:o,x:null,r:Ji,l:null}}function Io(o){var e=As,t=e.e;if(t!==null){e.e=null;for(var i of t)VP(i)}return o!==void 0&&(e.x=o),e.i=!0,As=e.p,o??{}}function wP(){return!0}let Fc=[];function yP(){var o=Fc;Fc=[],UF(o)}function zl(o){if(Fc.length===0&&!hf){var e=Fc;queueMicrotask(()=>{e===Fc&&yP()})}Fc.push(o)}function SH(){for(;Fc.length>0;)yP()}function SP(o){var e=Ji;if(e===null)return Xi.f|=Bl,o;if((e.f&bg)===0&&(e.f&Ku)===0)throw o;Ml(o,e)}function Ml(o,e){for(;e!==null;){if((e.f&qy)!==0){if((e.f&bg)===0)throw o;try{e.b.error(o);return}catch(t){o=t}}e=e.parent}throw o}const CH=-7169;function ls(o,e){o.f=o.f&CH|e}function R0(o){(o.f&sr)!==0||o.deps===null?ls(o,ys):ls(o,wa)}function CP(o){if(o!==null)for(const e of o)(e.f&Os)===0||(e.f&$d)===0||(e.f^=$d,CP(e.deps))}function xP(o,e,t){(o.f&Is)!==0?e.add(o):(o.f&wa)!==0&&t.add(o),CP(o.deps),ls(o,ys)}let um=!1;function xH(o){var e=um;try{return um=!1,[o(),um]}finally{um=e}}let Bw=null,Eh=null,ci=null,df=null,Ts=null,Xy=null,hf=!1,zw=!1,eu=null,Km=null;var tI=0;let LH=1;var bu,Dl,zc,wu,yu,Su,Oa,Cu,fo,mp,Fa,br,ia,xu,Vc,zn,Yy,qg,Jy,LP,IP,jh,IH,Kg;const Rv=class Rv{constructor(){Di(this,zn);Oi(this,"id",LH++);Di(this,bu,!1);Oi(this,"linked",!0);Di(this,Dl,null);Di(this,zc,null);Oi(this,"async_deriveds",new Map);Oi(this,"current",new Map);Oi(this,"previous",new Map);Di(this,wu,new Set);Di(this,yu,new Set);Di(this,Su,0);Di(this,Oa,new Map);Di(this,Cu,null);Di(this,fo,[]);Di(this,mp,[]);Di(this,Fa,new Set);Di(this,br,new Set);Di(this,ia,new Map);Di(this,xu,new Set);Oi(this,"is_fork",!1);Di(this,Vc,!1);Eh===null?Bw=Eh=this:(Ei(Eh,zc,this),Ei(this,Dl,Eh)),Eh=this}skip_effect(e){ee(this,ia).has(e)||ee(this,ia).set(e,{d:[],m:[]}),ee(this,xu).delete(e)}unskip_effect(e,t=i=>this.schedule(i)){var i=ee(this,ia).get(e);if(i){ee(this,ia).delete(e);for(var n of i.d)ls(n,Is),t(n);for(n of i.m)ls(n,wa),t(n)}ee(this,xu).add(e)}capture(e,t,i=!1){e.v!==bs&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Bl)===0&&(this.current.set(e,[t,i]),Ts==null||Ts.set(e,t)),this.is_fork||(e.v=t)}activate(){ci=this}deactivate(){ci=null,Ts=null}flush(){try{zw=!0,ci=this,bn(this,zn,qg).call(this)}finally{tI=0,Xy=null,eu=null,Km=null,zw=!1,ci=null,Ts=null,Xc.clear()}}discard(){var e;for(const t of ee(this,yu))t(this);ee(this,yu).clear(),bn(this,zn,Kg).call(this),(e=ee(this,Cu))==null||e.resolve()}register_created_effect(e){ee(this,mp).push(e)}increment(e,t){if(Ei(this,Su,ee(this,Su)+1),e){let i=ee(this,Oa).get(t)??0;ee(this,Oa).set(t,i+1)}}decrement(e,t){if(Ei(this,Su,ee(this,Su)-1),e){let i=ee(this,Oa).get(t)??0;i===1?ee(this,Oa).delete(t):ee(this,Oa).set(t,i-1)}ee(this,Vc)||(Ei(this,Vc,!0),zl(()=>{Ei(this,Vc,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(const i of e)ee(this,Fa).add(i);for(const i of t)ee(this,br).add(i);e.clear(),t.clear()}oncommit(e){ee(this,wu).add(e)}ondiscard(e){ee(this,yu).add(e)}settled(){return(ee(this,Cu)??Ei(this,Cu,gP())).promise}static ensure(){if(ci===null){const e=ci=new Rv;!zw&&!hf&&zl(()=>{ee(e,bu)||e.flush()})}return ci}apply(){{Ts=null;return}}schedule(e){var n;if(Xy=e,(n=e.b)!=null&&n.is_pending&&(e.f&(Ku|Zb|fP))!==0&&(e.f&bg)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var i=t.f;if(eu!==null&&t===Ji&&(Xi===null||(Xi.f&Os)===0))return;if((i&(lc|Mr))!==0){if((i&ys)===0)return;t.f^=ys}}ee(this,fo).push(t)}};bu=new WeakMap,Dl=new WeakMap,zc=new WeakMap,wu=new WeakMap,yu=new WeakMap,Su=new WeakMap,Oa=new WeakMap,Cu=new WeakMap,fo=new WeakMap,mp=new WeakMap,Fa=new WeakMap,br=new WeakMap,ia=new WeakMap,xu=new WeakMap,Vc=new WeakMap,zn=new WeakSet,Yy=function(){if(this.is_fork)return!0;for(const i of ee(this,Oa).keys()){for(var e=i,t=!1;e.parent!==null;){if(ee(this,ia).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},qg=function(){var c,h,u,f;Ei(this,bu,!0),tI++>1e3&&(bn(this,zn,Kg).call(this),DH());for(const p of ee(this,Fa))ee(this,br).delete(p),ls(p,Is),this.schedule(p);for(const p of ee(this,br))ls(p,wa),this.schedule(p);const e=ee(this,fo);Ei(this,fo,[]),this.apply();var t=eu=[],i=[],n=Km=[];for(const p of e)try{bn(this,zn,Jy).call(this,p,t,i)}catch(v){throw EP(p),bn(this,zn,Yy).call(this)||this.discard(),v}if(ci=null,n.length>0){var s=Rv.ensure();for(const p of n)s.schedule(p)}if(eu=null,Km=null,bn(this,zn,Yy).call(this)){bn(this,zn,jh).call(this,i),bn(this,zn,jh).call(this,t);for(const[p,v]of ee(this,ia))DP(p,v);n.length>0&&bn(c=ci,zn,qg).call(c);return}const r=bn(this,zn,LP).call(this);if(r){bn(this,zn,jh).call(this,i),bn(this,zn,jh).call(this,t),bn(h=r,zn,IP).call(h,this);return}ee(this,Fa).clear(),ee(this,br).clear();for(const p of ee(this,wu))p(this);ee(this,wu).clear(),df=this,iI(i),iI(t),df=null,(u=ee(this,Cu))==null||u.resolve();var a=ci;if(ee(this,Su)===0&&(ee(this,fo).length===0||a!==null)&&bn(this,zn,Kg).call(this),ee(this,fo).length>0)if(a!==null){const p=a;ee(p,fo).push(...ee(this,fo).filter(v=>!ee(p,fo).includes(v)))}else a=this;a!==null&&bn(f=a,zn,qg).call(f)},Jy=function(e,t,i){e.f^=ys;for(var n=e.first;n!==null;){var s=n.f,r=(s&(Mr|lc))!==0,a=r&&(s&ys)!==0,c=a||(s&so)!==0||ee(this,ia).has(n);if(!c&&n.fn!==null){r?n.f^=ys:(s&Ku)!==0?t.push(n):Bp(n)&&((s&Er)!==0&&ee(this,br).add(n),Yu(n));var h=n.first;if(h!==null){n=h;continue}}for(;n!==null;){var u=n.next;if(u!==null){n=u;break}n=n.parent}}},LP=function(){for(var e=ee(this,Dl);e!==null;){if(!e.is_fork){for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e}e=ee(e,Dl)}return null},IP=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(ee(e,Fa),ee(e,br));const t=n=>{var s=n.reactions;if(s!==null)for(const c of s){var r=c.f;if((r&Os)!==0)t(c);else{var a=c;r&(pu|Er)&&!this.async_deriveds.has(a)&&(ee(this,br).delete(a),ls(a,Is),this.schedule(a))}}};for(const n of this.current.keys())t(n);this.oncommit(()=>e.discard()),bn(i=e,zn,Kg).call(i),ci=this,bn(this,zn,qg).call(this)},jh=function(e){for(var t=0;t<e.length;t+=1)xP(e[t],ee(this,Fa),ee(this,br))},IH=function(){var u;for(let f=Bw;f!==null;f=ee(f,zc)){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(ee(f,bu)){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 ee(this,xu))f.unskip_effect(p,v=>{var _;(v.f&(Er|pu))!==0?f.schedule(v):bn(_=f,zn,jh).call(_,[v])});f.activate();var s=new Set,r=new Map;for(var a of t)kP(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 ee(this,mp))(p.f&(or|so|C_))===0&&A0(p,c,r)&&((p.f&(pu|Er))!==0?(ls(p,Is),f.schedule(p)):ee(f,Fa).add(p));if(ee(f,fo).length>0&&!ee(f,Vc)){f.apply();for(var h of ee(f,fo))bn(u=f,zn,Jy).call(u,h,[],[]);Ei(f,fo,[])}f.deactivate()}}}},Kg=function(){if(this.linked){var e=ee(this,Dl),t=ee(this,zc);e===null?Bw=t:Ei(e,zc,t),t===null?Eh=e:Ei(t,Dl,e),this.linked=!1}};let qd=Rv;function kH(o){var e=hf;hf=!0;try{for(var t;;){if(SH(),ci===null)return t;ci.flush()}}finally{hf=e}}function DH(){try{QF()}catch(o){Ml(o,Xy)}}let mr=null;function iI(o){var e=o.length;if(e!==0){for(var t=0;t<e;){var i=o[t++];if((i.f&(or|so))===0&&Bp(i)&&(mr=new Set,Yu(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&$P(i),(mr==null?void 0:mr.size)>0)){Xc.clear();for(const n of mr){if((n.f&(or|so))!==0)continue;const s=[n];let r=n.parent;for(;r!==null;)mr.has(r)&&(mr.delete(r),s.push(r)),r=r.parent;for(let a=s.length-1;a>=0;a--){const c=s[a];(c.f&(or|so))===0&&Yu(c)}}mr.clear()}}mr=null}}function kP(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&Os)!==0?kP(n,e,t,i):(s&(pu|Er))!==0&&(s&Is)===0&&A0(n,e,i)&&(ls(n,Is),O0(n))}}function A0(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(S_.call(e,n))return!0;if((n.f&Os)!==0&&A0(n,e,t))return t.set(n,!0),!0}return t.set(o,!1),!1}function O0(o){ci.schedule(o)}function DP(o,e){if(!((o.f&Mr)!==0&&(o.f&ys)!==0)){(o.f&Is)!==0?e.d.push(o):(o.f&wa)!==0&&e.m.push(o),ls(o,ys);for(var t=o.first;t!==null;)DP(t,e),t=t.next}}function EP(o){ls(o,ys);for(var e=o.first;e!==null;)EP(e),e=e.next}function EH(o){let e=0,t=Kd(0),i;return()=>{W0()&&(g(t),Jb(()=>(e===0&&(i=gl(()=>o(()=>uf(t)))),e+=1,()=>{zl(()=>{e-=1,e===0&&(i==null||i(),i=void 0,uf(t))})})))}}var PH=Gu|wg;function TH(o,e,t,i){new MH(o,e,t,i)}var Zo,n0,Xo,Uc,po,Yo,Js,Mo,Ha,jc,El,Lu,_p,vp,Wa,Av,cs,NH,RH,AH,Qy,Gm,Zm,eS,tS;class MH{constructor(e,t,i,n){Di(this,cs);Oi(this,"parent");Oi(this,"is_pending",!1);Oi(this,"transform_error");Di(this,Zo);Di(this,n0,null);Di(this,Xo);Di(this,Uc);Di(this,po);Di(this,Yo,null);Di(this,Js,null);Di(this,Mo,null);Di(this,Ha,null);Di(this,jc,0);Di(this,El,0);Di(this,Lu,!1);Di(this,_p,new Set);Di(this,vp,new Set);Di(this,Wa,null);Di(this,Av,EH(()=>(Ei(this,Wa,Kd(ee(this,jc))),()=>{Ei(this,Wa,null)})));var s;Ei(this,Zo,e),Ei(this,Xo,t),Ei(this,Uc,r=>{var a=Ji;a.b=this,a.f|=qy,i(r)}),this.parent=Ji.b,this.transform_error=n??((s=this.parent)==null?void 0:s.transform_error)??(r=>r),Ei(this,po,V0(()=>{bn(this,cs,Qy).call(this)},PH))}defer_effect(e){xP(e,ee(this,_p),ee(this,vp))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!ee(this,Xo).pending}update_pending_count(e,t){bn(this,cs,eS).call(this,e,t),Ei(this,jc,ee(this,jc)+e),!(!ee(this,Wa)||ee(this,Lu))&&(Ei(this,Lu,!0),zl(()=>{Ei(this,Lu,!1),ee(this,Wa)&&Xu(ee(this,Wa),ee(this,jc))}))}get_effect_pending(){return ee(this,Av).call(this),g(ee(this,Wa))}error(e){if(!ee(this,Xo).onerror&&!ee(this,Xo).failed)throw e;ci!=null&&ci.is_fork?(ee(this,Yo)&&ci.skip_effect(ee(this,Yo)),ee(this,Js)&&ci.skip_effect(ee(this,Js)),ee(this,Mo)&&ci.skip_effect(ee(this,Mo)),ci.oncommit(()=>{bn(this,cs,tS).call(this,e)})):bn(this,cs,tS).call(this,e)}}Zo=new WeakMap,n0=new WeakMap,Xo=new WeakMap,Uc=new WeakMap,po=new WeakMap,Yo=new WeakMap,Js=new WeakMap,Mo=new WeakMap,Ha=new WeakMap,jc=new WeakMap,El=new WeakMap,Lu=new WeakMap,_p=new WeakMap,vp=new WeakMap,Wa=new WeakMap,Av=new WeakMap,cs=new WeakSet,NH=function(){try{Ei(this,Yo,Jo(()=>ee(this,Uc).call(this,ee(this,Zo))))}catch(e){this.error(e)}},RH=function(e){const t=ee(this,Xo).failed;t&&Ei(this,Mo,Jo(()=>{t(ee(this,Zo),()=>e,()=>()=>{})}))},AH=function(){const e=ee(this,Xo).pending;e&&(this.is_pending=!0,Ei(this,Js,Jo(()=>e(ee(this,Zo)))),zl(()=>{var t=Ei(this,Ha,document.createDocumentFragment()),i=Za();t.append(i),Ei(this,Yo,bn(this,cs,Zm).call(this,()=>Jo(()=>ee(this,Uc).call(this,i)))),ee(this,El)===0&&(ee(this,Zo).before(t),Ei(this,Ha,null),Jc(ee(this,Js),()=>{Ei(this,Js,null)}),bn(this,cs,Gm).call(this,ci))}))},Qy=function(){try{if(this.is_pending=this.has_pending_snippet(),Ei(this,El,0),Ei(this,jc,0),Ei(this,Yo,Jo(()=>{ee(this,Uc).call(this,ee(this,Zo))})),ee(this,El)>0){var e=Ei(this,Ha,document.createDocumentFragment());j0(ee(this,Yo),e);const t=ee(this,Xo).pending;Ei(this,Js,Jo(()=>t(ee(this,Zo))))}else bn(this,cs,Gm).call(this,ci)}catch(t){this.error(t)}},Gm=function(e){this.is_pending=!1,e.transfer_effects(ee(this,_p),ee(this,vp))},Zm=function(e){var t=Ji,i=Xi,n=As;ya(ee(this,po)),lr(ee(this,po)),Zu(ee(this,po).ctx);try{return qd.ensure(),e()}catch(s){return SP(s),null}finally{ya(t),lr(i),Zu(n)}},eS=function(e,t){var i;if(!this.has_pending_snippet()){this.parent&&bn(i=this.parent,cs,eS).call(i,e,t);return}Ei(this,El,ee(this,El)+e),ee(this,El)===0&&(bn(this,cs,Gm).call(this,t),ee(this,Js)&&Jc(ee(this,Js),()=>{Ei(this,Js,null)}),ee(this,Ha)&&(ee(this,Zo).before(ee(this,Ha)),Ei(this,Ha,null)))},tS=function(e){ee(this,Yo)&&(So(ee(this,Yo)),Ei(this,Yo,null)),ee(this,Js)&&(So(ee(this,Js)),Ei(this,Js,null)),ee(this,Mo)&&(So(ee(this,Mo)),Ei(this,Mo,null));var t=ee(this,Xo).onerror;let i=ee(this,Xo).failed;var n=!1,s=!1;const r=()=>{if(n){bH();return}n=!0,s&&sH(),ee(this,Mo)!==null&&Jc(ee(this,Mo),()=>{Ei(this,Mo,null)}),bn(this,cs,Zm).call(this,()=>{bn(this,cs,Qy).call(this)})},a=c=>{try{s=!0,t==null||t(c,r),s=!1}catch(h){Ml(h,ee(this,po)&&ee(this,po).parent)}i&&Ei(this,Mo,bn(this,cs,Zm).call(this,()=>{try{return Jo(()=>{var h=Ji;h.b=this,h.f|=qy,i(ee(this,Zo),()=>c,()=>r)})}catch(h){return Ml(h,ee(this,po).parent),null}}))};zl(()=>{var c;try{c=this.transform_error(e)}catch(h){Ml(h,ee(this,po)&&ee(this,po).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(a,h=>Ml(h,ee(this,po)&&ee(this,po).parent)):a(c)})};function OH(o,e,t,i){const n=Wf;var s=o.filter(p=>!p.settled);if(t.length===0&&s.length===0){i(e.map(n));return}var r=Ji,a=FH(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(p=>p.promise)):null;function h(p){if((r.f&or)===0){a();try{i(p)}catch(v){Ml(v,r)}L_()}}var u=PP();if(t.length===0){c.then(()=>h(e.map(n))).finally(u);return}function f(){Promise.all(t.map(p=>HH(p))).then(p=>h([...e.map(n),...p])).catch(p=>Ml(p,r)).finally(u)}c?c.then(()=>{a(),f(),L_()}):f()}function FH(){var o=Ji,e=Xi,t=As,i=ci;return function(s=!0){ya(o),lr(e),Zu(t),s&&(o.f&or)===0&&(i==null||i.activate(),i==null||i.apply())}}function L_(o=!0){ya(null),lr(null),Zu(null),o&&(ci==null||ci.deactivate())}function PP(){var o=Ji,e=o.b,t=ci,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 Wf(o){var e=Os|Is;return Ji!==null&&(Ji.f|=wg),{ctx:As,deps:null,effects:null,equals:vP,f:e,fn:o,reactions:null,rv:0,v:bs,wv:0,parent:Ji,ac:null}}const gm=Symbol("obsolete");function HH(o,e,t){let i=Ji;i===null&&GF();var n=void 0,s=Kd(bs),r=!Xi,a=new Set;return XH(()=>{var v,_;var c=Ji,h=gP();n=h.promise;try{Promise.resolve(o()).then(h.resolve,y=>{y!==Xb&&h.reject(y)}).finally(L_)}catch(y){h.reject(y),L_()}var u=ci;if(r){if((c.f&bg)!==0)var f=PP();if((v=i.b)!=null&&v.is_rendered())(_=u.async_deriveds.get(c))==null||_.reject(gm);else for(const y of a.values())y.reject(gm);a.add(h),u.async_deriveds.set(c,h)}const p=(y,S=void 0)=>{f==null||f(),a.delete(h),S!==gm&&(u.activate(),S?(s.f|=Bl,Xu(s,S)):((s.f&Bl)!==0&&(s.f^=Bl),Xu(s,y)),u.deactivate())};h.promise.then(p,y=>p(null,y||"unknown"))}),B0(()=>{for(const c of a)c.reject(gm)}),new Promise(c=>{function h(u){function f(){u===n?c(s):h(n)}u.then(f,f)}h(n)})}function ht(o){const e=Wf(o);return GP(e),e}function TP(o){const e=Wf(o);return e.equals=bP,e}function WH(o){var e=o.effects;if(e!==null){o.effects=null;for(var t=0;t<e.length;t+=1)So(e[t])}}function F0(o){var e,t=Ji,i=o.parent;if(!nl&&i!==null&&o.v!==bs&&(i.f&(or|so))!==0)return _H(),o.v;ya(i);try{o.f&=~$d,WH(o),e=JP(o)}finally{ya(t)}return e}function MP(o){var e=F0(o);if(!o.equals(e)&&(o.wv=XP(),(!(ci!=null&&ci.is_fork)||o.deps===null)&&(ci!==null?(ci.capture(o,e,!0),df==null||df.capture(o,e,!0)):o.v=e,o.deps===null))){ls(o,ys);return}nl||(Ts!==null?(W0()||ci!=null&&ci.is_fork)&&Ts.set(o,e):R0(o))}function BH(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(Xb),i.fn!==null&&(i.teardown=Gb),i.ac=null,Bf(i,0),U0(i))}function NP(o){if(o.effects!==null)for(const e of o.effects)e.teardown&&e.fn!==null&&Yu(e)}let I_=new Set;const Xc=new Map;let RP=!1;function Kd(o,e){var t={f:0,v:o,reactions:null,equals:vP,rv:0,wv:0};return t}function V(o,e){const t=Kd(o);return GP(t),t}function zH(o,e=!1,t=!0){const i=Kd(o);return e||(i.equals=bP),i}function k(o,e,t=!1){Xi!==null&&(!Pr||(Xi.f&C_)!==0)&&wP()&&(Xi.f&(Os|Er|pu|C_))!==0&&(ma===null||!ma.has(o))&&nH();let i=t?bi(e):e;return Xu(o,i,Km)}function Xu(o,e,t=null){if(!o.equals(e)){Xc.set(o,nl?e:o.v);var i=qd.ensure();if(i.capture(o,e),(o.f&Os)!==0){const n=o;(o.f&Is)!==0&&F0(n),Ts===null&&R0(n)}o.wv=XP(),AP(o,Is,t),Ji!==null&&(Ji.f&ys)!==0&&(Ji.f&(Mr|lc))===0&&(Go===null?JH([o]):Go.push(o)),!i.is_fork&&I_.size>0&&!RP&&VH()}return e}function VH(){RP=!1;for(const o of I_){(o.f&ys)!==0&&ls(o,wa);let e;try{e=Bp(o)}catch{e=!0}e&&Yu(o)}I_.clear()}function nI(o,e=1){var t=g(o),i=e===1?t++:t--;return k(o,t),i}function uf(o){k(o,o.v+1)}function AP(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&&ls(r,e),(a&C_)!==0)I_.add(r);else if((a&Os)!==0){var h=r;Ts==null||Ts.delete(h),(a&$d)===0&&(a&sr&&(Ji===null||(Ji.f&x_)===0)&&(r.f|=$d),AP(h,wa,t))}else if(c){var u=r;(a&Er)!==0&&mr!==null&&mr.add(u),t!==null?t.push(u):O0(u)}}}function bi(o){if(typeof o!="object"||o===null||Zc in o)return o;const e=uP(o);if(e!==zF&&e!==VF)return o;var t=new Map,i=N0(o),n=V(0),s=Qc,r=a=>{if(Qc===s)return a();var c=Xi,h=Qc;lr(null),aI(s);var u=a();return lr(c),aI(h),u};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)&&tH();var u=t.get(c);return u===void 0?r(()=>{var f=V(h.value);return t.set(c,f),f}):k(u,h.value,!0),!0},deleteProperty(a,c){var h=t.get(c);if(h===void 0){if(c in a){const u=r(()=>V(bs));t.set(c,u),uf(n)}}else k(h,bs),uf(n);return!0},get(a,c,h){var v;if(c===Zc)return o;var u=t.get(c),f=c in a;if(u===void 0&&(!f||(v=fu(a,c))!=null&&v.writable)&&(u=r(()=>{var _=bi(f?a[c]:bs),y=V(_);return y}),t.set(c,u)),u!==void 0){var p=g(u);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 u=t.get(c);u&&(h.value=g(u))}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===Zc)return!0;var h=t.get(c),u=h!==void 0&&h.v!==bs||Reflect.has(a,c);if(h!==void 0||Ji!==null&&(!u||(p=fu(a,c))!=null&&p.writable)){h===void 0&&(h=r(()=>{var v=u?bi(a[c]):bs,_=V(v);return _}),t.set(c,h));var f=g(h);if(f===bs)return!1}return u},set(a,c,h,u){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?k(_,bs):v in a&&(_=r(()=>V(bs)),t.set(v+"",_))}if(f===void 0)(!p||(N=fu(a,c))!=null&&N.writable)&&(f=r(()=>V(void 0)),k(f,bi(h)),t.set(c,f));else{p=f.v!==bs;var y=r(()=>bi(h));k(f,y)}var S=Reflect.getOwnPropertyDescriptor(a,c);if(S!=null&&S.set&&S.set.call(u,h),!p){if(i&&typeof c=="string"){var D=t.get("length"),E=Number(c);Number.isInteger(E)&&E>=D.v&&k(D,E+1)}uf(n)}return!0},ownKeys(a){g(n);var c=Reflect.ownKeys(a).filter(f=>{var p=t.get(f);return p===void 0||p.v!==bs});for(var[h,u]of t)u.v!==bs&&!(h in a)&&c.push(h);return c},setPrototypeOf(){iH()}})}function sI(o){try{if(o!==null&&typeof o=="object"&&Zc in o)return o[Zc]}catch{}return o}function UH(o,e){return Object.is(sI(o),sI(e))}var Yc,OP,FP,HP,WP;function jH(){if(Yc===void 0){Yc=window,OP=document,FP=/Firefox/.test(navigator.userAgent);var o=Element.prototype,e=Node.prototype,t=Text.prototype;HP=fu(e,"firstChild").get,WP=fu(e,"nextSibling").get,QL(o)&&(o[Gy]=void 0,o[$m]=null,o[Zy]=void 0,o.__e=void 0),QL(t)&&(t[$g]=void 0)}}function Za(o=""){return document.createTextNode(o)}function ha(o){return HP.call(o)}function Wp(o){return WP.call(o)}function C(o,e){return ha(o)}function Lt(o,e=!1){{var t=ha(o);return t instanceof Comment&&t.data===""?Wp(t):t}}function I(o,e=1,t=!1){let i=o;for(;e--;)i=Wp(i);return i}function $H(o){o.textContent=""}function BP(){return!1}function zP(o,e,t){return e==null||e===_P?t?document.createElement(o,{is:t}):document.createElement(o):t?document.createElementNS(e,o,{is:t}):document.createElementNS(e,o)}let oI=!1;function qH(){oI||(oI=!0,document.addEventListener("reset",o=>{Promise.resolve().then(()=>{var e;if(!o.defaultPrevented)for(const t of o.target.elements)(e=t[qm])==null||e.call(t)})},{capture:!0}))}function Yb(o){var e=Xi,t=Ji;lr(null),ya(null);try{return o()}finally{lr(e),ya(t)}}function H0(o,e,t,i=t){o.addEventListener(e,()=>Yb(t));const n=o[qm];n?o[qm]=()=>{n(),i(!0)}:o[qm]=()=>i(!0),qH()}function KH(o){Ji===null&&(Xi===null&&JF(),YF()),nl&&XF()}function GH(o,e){var t=e.last;t===null?e.last=e.first=o:(t.next=o,o.prev=t,e.last=o)}function ul(o,e){var t=Ji;t!==null&&(t.f&so)!==0&&(o|=so);var i={ctx:As,deps:null,nodes:null,f:o|Is|sr,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};ci==null||ci.register_created_effect(i);var n=i;if((o&Ku)!==0)eu!==null?eu.push(i):qd.ensure().schedule(i);else if(e!==null){try{Yu(i)}catch(r){throw So(i),r}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&wg)===0&&(n=n.first,(o&Er)!==0&&(o&Gu)!==0&&n!==null&&(n.f|=Gu))}if(n!==null&&(n.parent=t,t!==null&&GH(n,t),Xi!==null&&(Xi.f&Os)!==0&&(o&lc)===0)){var s=Xi;(s.effects??(s.effects=[])).push(n)}return i}function W0(){return Xi!==null&&!Pr}function B0(o){const e=ul(Zb,null);return ls(e,ys),e.teardown=o,e}function Pn(o){KH();var e=Ji.f,t=!Xi&&(e&Mr)!==0&&As!==null&&!As.i;if(t){var i=As;(i.e??(i.e=[])).push(o)}else return VP(o)}function VP(o){return ul(Ku|$F,o)}function ZH(o){qd.ensure();const e=ul(lc|wg,o);return(t={})=>new Promise(i=>{t.outro?Jc(e,()=>{So(e),i(void 0)}):(So(e),i(void 0))})}function z0(o){return ul(Ku,o)}function XH(o){return ul(pu|wg,o)}function Jb(o,e=0){return ul(Zb|e,o)}function Z(o,e=[],t=[],i=[]){OH(i,e,t,n=>{ul(Zb,()=>o(...n.map(g)))})}function V0(o,e=0){var t=ul(Er|e,o);return t}function Jo(o){return ul(Mr|wg,o)}function UP(o){var e=o.teardown;if(e!==null){const t=nl,i=Xi;rI(!0),lr(null);try{e.call(null)}finally{rI(t),lr(i)}}}function U0(o,e=!1){var t=o.first;for(o.first=o.last=null;t!==null;){const n=t.ac;n!==null&&Yb(()=>{n.abort(Xb)});var i=t.next;(t.f&lc)!==0?t.parent=null:So(t,e),t=i}}function YH(o){for(var e=o.first;e!==null;){var t=e.next;(e.f&Mr)===0&&So(e),e=t}}function So(o,e=!0){var t=!1;(e||(o.f&jF)!==0)&&o.nodes!==null&&o.nodes.end!==null&&(jP(o.nodes.start,o.nodes.end),t=!0),ls(o,Ky),U0(o,e&&!t),Bf(o,0);var i=o.nodes&&o.nodes.t;if(i!==null)for(const s of i)s.stop();UP(o),o.f^=Ky,o.f|=or;var n=o.parent;n!==null&&n.first!==null&&$P(o),o.next=o.prev=o.teardown=o.ctx=o.deps=o.fn=o.nodes=o.ac=o.b=null}function jP(o,e){for(;o!==null;){var t=o===e?null:Wp(o);o.remove(),o=t}}function $P(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 Jc(o,e,t=!0){var i=[];qP(o,i,!0);var n=()=>{t&&So(o),e&&e()},s=i.length;if(s>0){var r=()=>--s||n();for(var a of i)a.out(r)}else n()}function qP(o,e,t){if((o.f&so)===0){o.f^=so;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&lc)===0){var r=(n.f&Gu)!==0||(n.f&Mr)!==0&&(o.f&Er)!==0;qP(n,e,r?t:!1)}n=s}}}function k_(o){KP(o,!0)}function KP(o,e){if((o.f&so)!==0){o.f^=so,(o.f&ys)===0&&(ls(o,Is),qd.ensure().schedule(o));for(var t=o.first;t!==null;){var i=t.next,n=(t.f&Gu)!==0||(t.f&Mr)!==0;KP(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 j0(o,e){if(o.nodes)for(var t=o.nodes.start,i=o.nodes.end;t!==null;){var n=t===i?null:Wp(t);e.append(t),t=n}}let Xm=!1,nl=!1;function rI(o){nl=o}let Xi=null,Pr=!1;function lr(o){Xi=o}let Ji=null;function ya(o){Ji=o}let ma=null;function GP(o){Xi!==null&&(ma??(ma=new Set)).add(o)}let mo=null,Po=0,Go=null;function JH(o){Go=o}let ZP=1,Hc=0,Qc=Hc;function aI(o){Qc=o}function XP(){return++ZP}function Bp(o){var e=o.f;if((e&Is)!==0)return!0;if(e&Os&&(o.f&=~$d),(e&wa)!==0){for(var t=o.deps,i=t.length,n=0;n<i;n++){var s=t[n];if(Bp(s)&&MP(s),s.wv>o.wv)return!0}(e&sr)!==0&&Ts===null&&ls(o,ys)}return!1}function YP(o,e,t=!0){var i=o.reactions;if(i!==null&&!(ma!==null&&ma.has(o)))for(var n=0;n<i.length;n++){var s=i[n];(s.f&Os)!==0?YP(s,e,!1):e===s&&(t?ls(s,Is):(s.f&ys)!==0&&ls(s,wa),O0(s))}}function JP(o){var y;var e=mo,t=Po,i=Go,n=Xi,s=ma,r=As,a=Pr,c=Qc,h=o.f;mo=null,Po=0,Go=null,Xi=(h&(Mr|lc))===0?o:null,ma=null,Zu(o.ctx),Pr=!1,Qc=++Hc,o.ac!==null&&(Yb(()=>{o.ac.abort(Xb)}),o.ac=null);try{o.f|=x_;var u=o.fn,f=u();o.f|=bg;var p=o.deps,v=ci==null?void 0:ci.is_fork;if(mo!==null){var _;if(v||Bf(o,Po),p!==null&&Po>0)for(p.length=Po+mo.length,_=0;_<mo.length;_++)p[Po+_]=mo[_];else o.deps=p=mo;if(W0()&&(o.f&sr)!==0)for(_=Po;_<p.length;_++)((y=p[_]).reactions??(y.reactions=[])).push(o)}else!v&&p!==null&&Po<p.length&&(Bf(o,Po),p.length=Po);if(wP()&&Go!==null&&!Pr&&p!==null&&(o.f&(Os|wa|Is))===0)for(_=0;_<Go.length;_++)YP(Go[_],o);if(n!==null&&n!==o){if(Hc++,n.deps!==null)for(let S=0;S<t;S+=1)n.deps[S].rv=Hc;if(e!==null)for(const S of e)S.rv=Hc;Go!==null&&(i===null?i=Go:i.push(...Go))}return(o.f&Bl)!==0&&(o.f^=Bl),f}catch(S){return SP(S)}finally{o.f^=x_,mo=e,Po=t,Go=i,Xi=n,ma=s,Zu(r),Pr=a,Qc=c}}function QH(o,e){let t=e.reactions;if(t!==null){var i=HF.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&Os)!==0&&(mo===null||!S_.call(mo,e))){var s=e;(s.f&sr)!==0&&(s.f^=sr,s.f&=~$d),s.v!==bs&&R0(s),BH(s),Bf(s,0)}}function Bf(o,e){var t=o.deps;if(t!==null)for(var i=e;i<t.length;i++)QH(o,t[i])}function Yu(o){var e=o.f;if((e&or)===0){ls(o,ys);var t=Ji,i=Xm;Ji=o,Xm=!0;try{(e&(Er|fP))!==0?YH(o):U0(o),UP(o);var n=JP(o);o.teardown=typeof n=="function"?n:null,o.wv=ZP;var s;hP&&yH&&(o.f&Is)!==0&&o.deps}finally{Xm=i,Ji=t}}}async function iS(){await Promise.resolve(),kH()}function g(o){var e=o.f,t=(e&Os)!==0;if(Xi!==null&&!Pr){var i=Ji!==null&&(Ji.f&or)!==0;if(!i&&(ma===null||!ma.has(o))){var n=Xi.deps;if((Xi.f&x_)!==0)o.rv<Hc&&(o.rv=Hc,mo===null&&n!==null&&n[Po]===o?Po++:mo===null?mo=[o]:mo.push(o));else{Xi.deps??(Xi.deps=[]),S_.call(Xi.deps,o)||Xi.deps.push(o);var s=o.reactions;s===null?o.reactions=[Xi]:S_.call(s,Xi)||s.push(Xi)}}}if(nl&&Xc.has(o))return Xc.get(o);if(t){var r=o;if(nl){var a=r.v;return((r.f&ys)===0&&r.reactions!==null||eT(r))&&(a=F0(r)),Xc.set(r,a),a}var c=(r.f&sr)===0&&!Pr&&Xi!==null&&(Xm||(Xi.f&sr)!==0),h=(r.f&bg)===0;Bp(r)&&(c&&(r.f|=sr),MP(r)),c&&!h&&(NP(r),QP(r))}if(Ts!=null&&Ts.has(o))return Ts.get(o);if((o.f&Bl)!==0)throw o.v;return o.v}function QP(o){if(o.f|=sr,o.deps!==null)for(const e of o.deps)(e.reactions??(e.reactions=[])).push(o),(e.f&Os)!==0&&(e.f&sr)===0&&(NP(e),QP(e))}function eT(o){if(o.v===bs)return!0;if(o.deps===null)return!1;for(const e of o.deps)if(Xc.has(e)||(e.f&Os)!==0&&eT(e))return!0;return!1}function gl(o){var e=Pr;try{return Pr=!0,o()}finally{Pr=e}}const eW=["touchstart","touchmove"];function tW(o){return eW.includes(o)}const Wc=Symbol("events"),tT=new Set,nS=new Set;function iW(o,e,t,i={}){function n(s){if(i.capture||sS.call(e,s),!s.cancelBubble)return Yb(()=>t==null?void 0:t.call(this,s))}return o.startsWith("pointer")||o.startsWith("touch")||o==="wheel"?zl(()=>{e.addEventListener(o,n,i)}):e.addEventListener(o,n,i),n}function Qn(o,e,t,i,n){var s={capture:i,passive:n},r=iW(o,e,t,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&B0(()=>{e.removeEventListener(o,r,s)})}function oe(o,e,t){(e[Wc]??(e[Wc]={}))[o]=t}function hr(o){for(var e=0;e<o.length;e++)tT.add(o[e]);for(var t of nS)t(o)}let lI=null;function sS(o){var y,S;var e=this,t=e.ownerDocument,i=o.type,n=((y=o.composedPath)==null?void 0:y.call(o))||[],s=n[0]||o.target;lI=o;var r=0,a=lI===o&&o[Wc];if(a){var c=n.indexOf(a);if(c!==-1&&(e===document||e===window)){o[Wc]=e;return}var h=n.indexOf(e);if(h===-1)return;c<=h&&(r=c)}if(s=n[r]||o.target,s!==e){WF(o,"currentTarget",{configurable:!0,get(){return s||t}});var u=Xi,f=Ji;lr(null),ya(null);try{for(var p,v=[];s!==null&&s!==e;){try{var _=(S=s[Wc])==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[Wc]=e,delete o.currentTarget,lr(u),ya(f)}}}var RD;const Vw=((RD=globalThis==null?void 0:globalThis.window)==null?void 0:RD.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:o=>o});function nW(o){return(Vw==null?void 0:Vw.createHTML(o))??o}function iT(o){var e=zP("template");return e.innerHTML=nW(o.replaceAll("<!>","<!---->")),e.content}function Gd(o,e){var t=Ji;t.nodes===null&&(t.nodes={start:o,end:e,a:null,t:null})}function A(o,e){var t=(e&gH)!==0,i=(e&fH)!==0,n,s=!o.startsWith("<!>");return()=>{n===void 0&&(n=iT(s?o:"<!>"+o),t||(n=ha(n)));var r=i||FP?document.importNode(n,!0):n.cloneNode(!0);if(t){var a=ha(r),c=r.lastChild;Gd(a,c)}else Gd(r,r);return r}}function sW(o,e,t="svg"){var i=!o.startsWith("<!>"),n=`<${t}>${i?o:"<!>"+o}</${t}>`,s;return()=>{if(!s){var r=iT(n),a=ha(r);s=ha(a)}var c=s.cloneNode(!0);return Gd(c,c),c}}function nT(o,e){return sW(o,e,"svg")}function Tr(o=""){{var e=Za(o+"");return Gd(e,e),e}}function ks(){var o=document.createDocumentFragment(),e=document.createComment(""),t=Za();return o.append(e,t),Gd(e,t),o}function T(o,e){o!==null&&o.before(e)}function q(o,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(o[$g]??(o[$g]=o.nodeValue))&&(o[$g]=t,o.nodeValue=`${t}`)}function oW(o,e){return rW(o,e)}const fm=new Map;function rW(o,{target:e,anchor:t,props:i={},events:n,context:s,intro:r=!0,transformError:a}){jH();var c=void 0,h=ZH(()=>{var u=t??e.appendChild(Za());TH(u,{pending:()=>{}},v=>{Lo({});var _=As;s&&(_.c=s),n&&(i.$$events=n),c=o(v,i)||{},Io()},a);var f=new Set,p=v=>{for(var _=0;_<v.length;_++){var y=v[_];if(!f.has(y)){f.add(y);var S=tW(y);for(const N of[e,document]){var D=fm.get(N);D===void 0&&(D=new Map,fm.set(N,D));var E=D.get(y);E===void 0?(N.addEventListener(y,sS,{passive:S}),D.set(y,1)):D.set(y,E+1)}}}};return p(Kb(tT)),nS.add(p),()=>{var S;for(var v of f)for(const D of[e,document]){var _=fm.get(D),y=_.get(v);--y==0?(D.removeEventListener(v,sS),_.delete(v),_.size===0&&fm.delete(D)):_.set(v,y)}nS.delete(p),u!==t&&((S=u.parentNode)==null||S.removeChild(u))}});return aW.set(c,h),c}let aW=new WeakMap;var wr,na,No,$c,bp,wp,Ov;class lW{constructor(e,t=!0){Oi(this,"anchor");Di(this,wr,new Map);Di(this,na,new Map);Di(this,No,new Map);Di(this,$c,new Set);Di(this,bp,!0);Di(this,wp,e=>{if(ee(this,wr).has(e)){var t=ee(this,wr).get(e),i=ee(this,na).get(t);if(i)k_(i),ee(this,$c).delete(t);else{var n=ee(this,No).get(t);n&&(k_(n.effect),ee(this,na).set(t,n.effect),ee(this,No).delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[s,r]of ee(this,wr)){if(ee(this,wr).delete(s),s===e)break;const a=ee(this,No).get(r);a&&(So(a.effect),ee(this,No).delete(r))}for(const[s,r]of ee(this,na)){if(s===t||ee(this,$c).has(s))continue;const a=()=>{if(Array.from(ee(this,wr).values()).includes(s)){var h=document.createDocumentFragment();j0(r,h),h.append(Za()),ee(this,No).set(s,{effect:r,fragment:h})}else So(r);ee(this,$c).delete(s),ee(this,na).delete(s)};ee(this,bp)||!i?(ee(this,$c).add(s),Jc(r,a,!1)):a()}}});Di(this,Ov,e=>{ee(this,wr).delete(e);const t=Array.from(ee(this,wr).values());for(const[i,n]of ee(this,No))t.includes(i)||(So(n.effect),ee(this,No).delete(i))});this.anchor=e,Ei(this,bp,t)}ensure(e,t){var i=ci,n=BP();if(t&&!ee(this,na).has(e)&&!ee(this,No).has(e))if(n){var s=document.createDocumentFragment(),r=Za();s.append(r),ee(this,No).set(e,{effect:Jo(()=>t(r)),fragment:s})}else ee(this,na).set(e,Jo(()=>t(this.anchor)));if(ee(this,wr).set(i,e),n){for(const[a,c]of ee(this,na))a===e?i.unskip_effect(c):i.skip_effect(c);for(const[a,c]of ee(this,No))a===e?i.unskip_effect(c.effect):i.skip_effect(c.effect);i.oncommit(ee(this,wp)),i.ondiscard(ee(this,Ov))}else ee(this,wp).call(this,i)}}wr=new WeakMap,na=new WeakMap,No=new WeakMap,$c=new WeakMap,bp=new WeakMap,wp=new WeakMap,Ov=new WeakMap;function K(o,e,t=!1){var i=new lW(o),n=t?Gu:0;function s(r,a){i.ensure(r,a)}V0(()=>{var r=!1;e((a,c=0)=>{r=!0,s(c,a)}),r||s(-1,null)},n)}function Fn(o,e){return e}function cW(o,e,t){for(var i=[],n=e.length,s,r=e.length,a=0;a<n;a++){let f=e[a];Jc(f,()=>{if(s){if(s.pending.delete(f),s.done.add(f),s.pending.size===0){var p=o.outrogroups;oS(o,Kb(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,u=h.parentNode;$H(u),u.append(h),o.items.clear()}oS(o,e,!c)}else s={pending:new Set(e),done:new Set},(o.outrogroups??(o.outrogroups=new Set)).add(s)}function oS(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|=da;const r=document.createDocumentFragment();j0(s,r)}else So(e[n],t)}}var cI;function vi(o,e,t,i,n,s=null){var r=o,a=new Map,c=(e&mP)!==0;if(c){var h=o;r=h.appendChild(Za())}var u=null,f=TP(()=>{var N=t();return N0(N)?N:N==null?[]:Kb(N)}),p,v=new Map,_=!0;function y(N){(E.effect.f&or)===0&&(E.pending.delete(N),E.fallback=u,dW(E,p,r,e,i),u!==null&&(p.length===0?(u.f&da)===0?k_(u):(u.f^=da,Gg(u,null,r)):Jc(u,()=>{u=null})))}function S(N){E.pending.delete(N)}var D=V0(()=>{p=g(f);for(var N=p.length,z=new Set,O=ci,Y=BP(),G=0;G<N;G+=1){var fe=p[G],Se=i(fe,G),Pe=_?null:a.get(Se);Pe?(Pe.v&&Xu(Pe.v,fe),Pe.i&&Xu(Pe.i,G),Y&&O.unskip_effect(Pe.e)):(Pe=hW(a,_?r:cI??(cI=Za()),fe,Se,G,n,e,t),_||(Pe.e.f|=da),a.set(Se,Pe)),z.add(Se)}if(N===0&&s&&!u&&(_?u=Jo(()=>s(r)):(u=Jo(()=>s(cI??(cI=Za()))),u.f|=da)),N>z.size&&ZF(),!_)if(v.set(O,z),Y){for(const[De,wt]of a)z.has(De)||O.skip_effect(wt.e);O.oncommit(y),O.ondiscard(S)}else y(O);g(f)}),E={effect:D,items:a,pending:v,outrogroups:null,fallback:u};_=!1}function Ag(o){for(;o!==null&&(o.f&Mr)===0;)o=o.next;return o}function dW(o,e,t,i,n){var Pe,De,wt,Dt,Te,$t,rt,Mt,ke;var s=(i&aH)!==0,r=e.length,a=o.items,c=Ag(o.effect.first),h,u=null,f,p=[],v=[],_,y,S,D;if(s)for(D=0;D<r;D+=1)_=e[D],y=n(_,D),S=a.get(y).e,(S.f&da)===0&&((De=(Pe=S.nodes)==null?void 0:Pe.a)==null||De.measure(),(f??(f=new Set)).add(S));for(D=0;D<r;D+=1){if(_=e[D],y=n(_,D),S=a.get(y).e,o.outrogroups!==null)for(const Ct of o.outrogroups)Ct.pending.delete(S),Ct.done.delete(S);if((S.f&so)!==0&&(k_(S),s&&((Dt=(wt=S.nodes)==null?void 0:wt.a)==null||Dt.unfix(),(f??(f=new Set)).delete(S))),(S.f&da)!==0)if(S.f^=da,S===c)Gg(S,null,t);else{var E=u?u.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),ml(o,u,S),ml(o,S,E),Gg(S,E,t),u=S,p=[],v=[],c=Ag(u.next);continue}if(S!==c){if(h!==void 0&&h.has(S)){if(p.length<v.length){var N=v[0],z;u=N.prev;var O=p[0],Y=p[p.length-1];for(z=0;z<p.length;z+=1)Gg(p[z],N,t);for(z=0;z<v.length;z+=1)h.delete(v[z]);ml(o,O.prev,Y.next),ml(o,u,O),ml(o,Y,N),c=N,u=Y,D-=1,p=[],v=[]}else h.delete(S),Gg(S,c,t),ml(o,S.prev,S.next),ml(o,S,u===null?o.effect.first:u.next),ml(o,u,S),u=S;continue}for(p=[],v=[];c!==null&&c!==S;)(h??(h=new Set)).add(c),v.push(c),c=Ag(c.next);if(c===null)continue}(S.f&da)===0&&p.push(S),u=S,c=Ag(S.next)}if(o.outrogroups!==null){for(const Ct of o.outrogroups)Ct.pending.size===0&&(oS(o,Kb(Ct.done)),(Te=o.outrogroups)==null||Te.delete(Ct));o.outrogroups.size===0&&(o.outrogroups=null)}if(c!==null||h!==void 0){var G=[];if(h!==void 0)for(S of h)(S.f&so)===0&&G.push(S);for(;c!==null;)(c.f&so)===0&&c!==o.fallback&&G.push(c),c=Ag(c.next);var fe=G.length;if(fe>0){var Se=(i&mP)!==0&&r===0?t:null;if(s){for(D=0;D<fe;D+=1)(rt=($t=G[D].nodes)==null?void 0:$t.a)==null||rt.measure();for(D=0;D<fe;D+=1)(ke=(Mt=G[D].nodes)==null?void 0:Mt.a)==null||ke.fix()}cW(o,G,Se)}}s&&zl(()=>{var Ct,Ue;if(f!==void 0)for(S of f)(Ue=(Ct=S.nodes)==null?void 0:Ct.a)==null||Ue.apply()})}function hW(o,e,t,i,n,s,r,a){var c=(r&oH)!==0?(r&lH)===0?zH(t,!1,!1):Kd(t):null,h=(r&rH)!==0?Kd(n):null;return{v:c,i:h,e:Jo(()=>(s(e,c??t,h??n,a),()=>{o.delete(i)}))}}function Gg(o,e,t){if(o.nodes)for(var i=o.nodes.start,n=o.nodes.end,s=e&&(e.f&da)===0?e.nodes.start:t;i!==null;){var r=Wp(i);if(s.before(i),i===n)return;i=r}}function ml(o,e,t){e===null?o.effect.first=t:e.next=t,t===null?o.effect.last=e:t.prev=e}function Nl(o,e,t=!1,i=!1,n=!1,s=!1){var r=o,a="";if(t)var c=o;Z(()=>{var h=Ji;if(a!==(a=e()??"")){if(t){h.nodes=null,c.innerHTML=a,a!==""&&Gd(ha(c),c.lastChild);return}if(h.nodes!==null&&(jP(h.nodes.start,h.nodes.end),h.nodes=null),a!==""){var u=i?pH:n?mH:void 0,f=zP(i?"svg":n?"math":"template",u);f.innerHTML=a;var p=i||n?f:f.content;if(Gd(ha(p),p.lastChild),i||n)for(;ha(p);)r.before(ha(p));else r.before(p)}}})}const dI=[...`
|
|
3
3
|
\r\f \v\uFEFF`];function uW(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||dI.includes(i[r-1]))&&(a===i.length||dI.includes(i[a]))?i=(r===0?"":i.substring(0,r))+i.substring(a+1):r=a}}return i===""?null:i}function hI(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 Uw(o){return o[0]!=="-"||o[1]!=="-"?o.toLowerCase():o}function gW(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(Uw)),n&&c.push(...Object.keys(n).map(Uw));var h=0,u=-1;const y=o.length;for(var f=0;f<y;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===":"&&u===-1)u=f;else if(p===";"||f===y-1){if(u!==-1){var v=Uw(o.substring(h,u).trim());if(!c.includes(v)){p!==";"&&f++;var _=o.substring(h,f).trim();t+=" "+_+";"}}h=f+1,u=-1}}}}return i&&(t+=hI(i)),n&&(t+=hI(n,!0)),t=t.trim(),t===""?null:t}return o==null?null:String(o)}function jt(o,e,t,i,n,s){var r=o[Gy];if(r!==t||r===void 0){var a=uW(t,i,s);a==null?o.removeAttribute("class"):e?o.className=a:o.setAttribute("class",a),o[Gy]=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 jw(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 Ho(o,e,t,i){var n=o[Zy];if(n!==e){var s=gW(e,i);s==null?o.removeAttribute("style"):o.style.cssText=s,o[Zy]=e}else i&&(Array.isArray(i)?(jw(o,t==null?void 0:t[0],i[0]),jw(o,t==null?void 0:t[1],i[1],"important")):jw(o,t,i));return i}function sT(o,e,t=!1){if(o.multiple){if(e==null)return;if(!N0(e))return vH();for(var i of o.options)i.selected=e.includes(gf(i));return}for(i of o.options){var n=gf(i);if(UH(n,e)){i.selected=!0;return}}(!t||e!==void 0)&&(o.selectedIndex=-1)}function fW(o){var e=new MutationObserver(()=>{sT(o,o.__value)});e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),B0(()=>{e.disconnect()})}function za(o,e,t=e){var i=new WeakSet,n=!0;H0(o,"change",s=>{var r=s?"[selected]":":checked",a;if(o.multiple)a=[].map.call(o.querySelectorAll(r),gf);else{var c=o.querySelector(r)??o.querySelector("option:not([disabled])");a=c&&gf(c)}t(a),o.__value=a,ci!==null&&i.add(ci)}),z0(()=>{var s=e();if(o===document.activeElement){var r=ci;if(i.has(r))return}if(sT(o,s,n),n&&s===void 0){var a=o.querySelector(":checked");a!==null&&(s=gf(a),t(s))}o.__value=s,n=!1}),fW(o)}function gf(o){return"__value"in o?o.__value:o.value}const pW=Symbol("is custom element"),mW=Symbol("is html");function $w(o,e){var t=oT(o);t.checked!==(t.checked=e??void 0)&&(o.checked=e)}function Bn(o,e,t,i){var n=oT(o);n[e]!==(n[e]=t)&&(e==="loading"&&(o[KF]=t),t==null?o.removeAttribute(e):typeof t!="string"&&_W(o).includes(e)?o[e]=t:o.setAttribute(e,t))}function oT(o){return o[$m]??(o[$m]={[pW]:o.nodeName.includes("-"),[mW]:o.namespaceURI===_P})}var uI=new Map;function _W(o){var e=o.getAttribute("is")||o.nodeName,t=uI.get(e);if(t)return t;uI.set(e,t=[]);for(var i,n=o,s=Element.prototype;s!==n;){i=BF(n);for(var r in i)i[r].set&&r!=="innerHTML"&&r!=="textContent"&&r!=="innerText"&&t.push(r);n=uP(n)}return t}function Mi(o,e,t=e){var i=new WeakSet;H0(o,"input",async n=>{var s=n?o.defaultValue:o.value;if(s=qw(o)?Kw(s):s,t(s),ci!==null&&i.add(ci),await iS(),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))}}}),gl(e)==null&&o.value&&(t(qw(o)?Kw(o.value):o.value),ci!==null&&i.add(ci)),Jb(()=>{var n=e();if(o===document.activeElement){var s=ci;if(i.has(s))return}qw(o)&&n===Kw(o.value)||o.type==="date"&&!n&&!o.value||n!==o.value&&(o.value=n??"")})}function no(o,e,t=e){H0(o,"change",i=>{var n=i?o.defaultChecked:o.checked;t(n)}),gl(e)==null&&t(o.checked),Jb(()=>{var i=e();o.checked=!!i})}function qw(o){var e=o.type;return e==="number"||e==="range"}function Kw(o){return o===""?null:+o}var Pl,Iu,yp,Fv,rT;const Hv=class Hv{constructor(e){Di(this,Fv);Di(this,Pl,new WeakMap);Di(this,Iu);Di(this,yp);Ei(this,yp,e)}observe(e,t){var i=ee(this,Pl).get(e)||new Set;return i.add(t),ee(this,Pl).set(e,i),bn(this,Fv,rT).call(this).observe(e,ee(this,yp)),()=>{var n=ee(this,Pl).get(e);n.delete(t),n.size===0&&(ee(this,Pl).delete(e),ee(this,Iu).unobserve(e))}}};Pl=new WeakMap,Iu=new WeakMap,yp=new WeakMap,Fv=new WeakSet,rT=function(){return ee(this,Iu)??Ei(this,Iu,new ResizeObserver(e=>{for(var t of e){Hv.entries.set(t.target,t);for(var i of ee(this,Pl).get(t.target)||[])i(t)}}))},Oi(Hv,"entries",new WeakMap);let rS=Hv;var vW=new rS({box:"border-box"});function bW(o,e,t){var i=vW.observe(o,()=>t(o[e]));z0(()=>(gl(()=>t(o[e])),i))}function Gw(o,e){return o===e||(o==null?void 0:o[Zc])===e}function io(o={},e,t,i){var n=As.r,s=Ji;return z0(()=>{var r,a;return Jb(()=>{r=a,a=[],gl(()=>{Gw(t(...a),o)||(e(o,...a),r&&Gw(t(...r),o)&&e(null,...r))})}),()=>{let c=s;for(;c!==n&&c.parent!==null&&c.parent.f&Ky;)c=c.parent;const h=()=>{a&&Gw(t(...a),o)&&e(null,...a)},u=c.teardown;c.teardown=()=>{h(),u==null||u()}}}),o}function Ju(o,e,t,i){var z;var n=!0,s=(t&hH)!==0,r=(t&uH)!==0,a=i,c=!0,h=void 0,u=()=>r&&n?(h??(h=Wf(i)),g(h)):(c&&(c=!1,a=r?gl(i):i),a);let f;if(s){var p=Zc in o||qF in o;f=((z=fu(o,e))==null?void 0:z.set)??(p&&e in o?O=>o[e]=O:void 0)}var v,_=!1;s?[v,_]=xH(()=>o[e]):v=o[e],v===void 0&&i!==void 0&&(v=u(),f&&(eH(),f(v)));var y;if(y=()=>{var O=o[e];return O===void 0?u():(c=!0,O)},(t&dH)===0)return y;if(f){var S=o.$$legacy;return(function(O,Y){return arguments.length>0?((!Y||S||_)&&f(Y?y():O),O):y()})}var D=!1,E=((t&cH)!==0?Wf:TP)(()=>(D=!1,y()));s&&g(E);var N=Ji;return(function(O,Y){if(arguments.length>0){const G=Y?g(E):s?bi(O):O;return k(E,G),D=!0,a!==void 0&&(a=G),O}return nl&&D||(N.f&or)!==0?E.v:g(E)})}function Wr(o){As===null&&pP(),Pn(()=>{const e=gl(o);if(typeof e=="function")return e})}function Qb(o){As===null&&pP(),Wr(()=>()=>gl(o))}const wW="5";var AD;typeof window<"u"&&((AD=window.__svelte??(window.__svelte={})).v??(AD.v=new Set)).add(wW);/*!-----------------------------------------------------------------------------
|
|
4
4
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10,7 +10,7 @@ var nA=Object.defineProperty;var yL=o=>{throw TypeError(o)};var sA=(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 TW=Object.defineProperty,MW=Object.getOwnPropertyDescriptor,NW=Object.getOwnPropertyNames,RW=Object.prototype.hasOwnProperty,AW=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of NW(e))!RW.call(o,n)&&n!==t&&TW(o,n,{get:()=>e[n],enumerable:!(i=MW(e,n))||i.enumerable});return o},OW=(o,e,t)=>(AW(o,e,"default"),t),FW="5.4.5",Qu={};OW(Qu,FD);var cT=(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))(cT||{}),dT=(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))(dT||{}),hT=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(hT||{}),uT=(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))(uT||{}),gT=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(gT||{}),fT=class{constructor(o,e,t,i,n){this._onDidChange=new Qu.Emitter,this._onDidExtraLibsChange=new Qu.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)}},HW=FW,pT={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},mT=new fT({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},pT),_T=new fT({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},pT),WW=()=>ew().then(o=>o.getTypeScriptWorker()),BW=()=>ew().then(o=>o.getJavaScriptWorker());Qu.languages.typescript={ModuleKind:cT,JsxEmit:dT,NewLineKind:hT,ScriptTarget:uT,ModuleResolutionKind:gT,typescriptVersion:HW,typescriptDefaults:mT,javascriptDefaults:_T,getTypeScriptWorker:WW,getJavaScriptWorker:BW};function ew(){return OD(()=>import("./tsMode-C4_T69lr.js"),__vite__mapDeps([3,1,2]))}Qu.languages.onLanguage("typescript",()=>ew().then(o=>o.setupTypeScript(mT)));Qu.languages.onLanguage("javascript",()=>ew().then(o=>o.setupJavaScript(_T)));class zW extends qs{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:pt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Zt.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(Sn),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class vT extends qs{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:pt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:re.has("isInDiffEditor")})}run(e,...t){const i=e.get(Sn),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class bT extends qs{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:pt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:re.has("isInDiffEditor")})}run(e,...t){const i=e.get(Sn),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const Vp=pt("diffEditor","Diff Editor");class VW extends Nr{constructor(){super({id:"diffEditor.switchSide",title:pt("switchSide","Switch Side"),icon:Zt.arrowSwap,precondition:re.has("isInDiffEditor"),f1:!0,category:Vp})}runEditorCommand(e,t,i){const n=yg(e);if(n instanceof Sp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class UW extends Nr{constructor(){super({id:"diffEditor.exitCompareMove",title:pt("exitCompareMove","Exit Compare Move"),icon:Zt.close,precondition:M.comparingMovedCode,f1:!1,category:Vp,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=yg(e);n instanceof Sp&&n.exitCompareMove()}}class jW extends Nr{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:pt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Zt.fold,precondition:re.has("isInDiffEditor"),f1:!0,category:Vp})}runEditorCommand(e,t,...i){const n=yg(e);n instanceof Sp&&n.collapseAllUnchangedRegions()}}class $W extends Nr{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:pt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Zt.unfold,precondition:re.has("isInDiffEditor"),f1:!0,category:Vp})}runEditorCommand(e,t,...i){const n=yg(e);n instanceof Sp&&n.showAllUnchangedRegions()}}class aS extends qs{constructor(){super({id:"diffEditor.revert",title:pt("revert","Revert"),f1:!1,category:Vp})}run(e,t){const i=qW(e,t.originalUri,t.modifiedUri);i instanceof Sp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const wT=pt("accessibleDiffViewer","Accessible Diff Viewer"),Wv=class Wv extends qs{constructor(){super({id:Wv.id,title:pt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:wT,precondition:re.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=yg(e);t==null||t.accessibleDiffViewerNext()}};Wv.id="editor.action.accessibleDiffViewer.next";let zf=Wv;const Bv=class Bv extends qs{constructor(){super({id:Bv.id,title:pt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:wT,precondition:re.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=yg(e);t==null||t.accessibleDiffViewerPrev()}};Bv.id="editor.action.accessibleDiffViewer.prev";let D_=Bv;function qW(o,e,t){return o.get(Xn).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 yg(o){const t=o.get(Xn).listDiffEditors(),i=HD();if(i)for(const n of t){const s=n.getContainerDomNode();if(KW(s,i))return n}return null}function KW(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}Qi(zW);Qi(vT);Qi(bT);rr.appendMenuItem(Qe.EditorTitle,{command:{id:new bT().desc.id,title:w("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"))});rr.appendMenuItem(Qe.EditorTitle,{command:{id:new vT().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:Zt.move,toggled:oA.create("config.diffEditor.experimental.showMoves",!0),precondition:re.has("isInDiffEditor")},order:10,group:"1_diff",when:re.has("isInDiffEditor")});Qi(aS);for(const o of[{icon:Zt.arrowRight,key:M.diffEditorInlineMode.toNegated()},{icon:Zt.discard,key:M.diffEditorInlineMode}])rr.appendMenuItem(Qe.DiffEditorHunkToolbar,{command:{id:new aS().desc.id,title:w("revertHunk","Revert Block"),icon:o.icon},when:re.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),rr.appendMenuItem(Qe.DiffEditorSelectionToolbar,{command:{id:new aS().desc.id,title:w("revertSelection","Revert Selection"),icon:o.icon},when:re.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"});Qi(VW);Qi(UW);Qi(jW);Qi($W);rr.appendMenuItem(Qe.EditorTitle,{command:{id:zf.id,title:w("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"))});gn.registerCommandAlias("editor.action.diffReview.next",zf.id);Qi(zf);gn.registerCommandAlias("editor.action.diffReview.prev",D_.id);Qi(D_);var GW=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},ZW=function(o,e){return function(t,i){e(t,i,o)}},lS;const tw=new Pi("selectionAnchorSet",!1);var nd;let cc=(nd=class{static get(e){return e.getContribution(lS.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=tw.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(Bt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Ps().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ar(w("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(Bt.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()}},lS=nd,nd.ID="editor.contrib.selectionAnchorController",nd);cc=lS=GW([ZW(1,Hi)],cc);class XW extends we{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:es(2089,2080),weight:100}})}async run(e,t){var i;(i=cc.get(t))==null||i.setSelectionAnchor()}}class YW extends we{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:tw})}async run(e,t){var i;(i=cc.get(t))==null||i.goToSelectionAnchor()}}class JW extends we{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:tw,kbOpts:{kbExpr:M.editorTextFocus,primary:es(2089,2089),weight:100}})}async run(e,t){var i;(i=cc.get(t))==null||i.selectFromAnchorToCursor()}}class QW extends we{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:tw,kbOpts:{kbExpr:M.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=cc.get(t))==null||i.cancelSelectionAnchor()}}pi(cc.ID,cc,4);se(XW);se(YW);se(JW);se(QW);const e3=gt("editorOverviewRuler.bracketMatchForeground","#A0A0A0",w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class t3 extends we{constructor(){super({id:"editor.action.jumpToBracket",label:w("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=Zd.get(t))==null||i.jumpToBracket()}}class i3 extends we{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:pt("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=Zd.get(t))==null||s.selectToBracket(n)}}class n3 extends we{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Zd.get(t))==null||i.removeBrackets(this.id)}}class s3{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Cl=class Cl extends Ae{static get(e){return e.getContribution(Cl.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 Bt(r.lineNumber,r.column,r.lineNumber,r.column):new Bt(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,u]=r;if(a=e?h.getStartPosition():h.getEndPosition(),c=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(s)){const f=a;a=c,c=f}}a&&c&&i.push(new Bt(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(_t.compare);const a=[];let c=0,h=0;const u=n.length;for(let f=0,p=s.length;f<p;f++){const v=s[f];for(;h<u&&n[h].position.isBefore(v);)h++;if(h<u&&n[h].position.equals(v))a[c++]=n[h];else{let _=t.bracketPairs.matchBracket(v,20),y=Cl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(v,20),y=Cl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[c++]=new s3(v,_,y)}}this._lastBracketsData=a,this._lastVersionId=i}};Cl.ID="editor.contrib.bracketMatchingController",Cl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ci.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ss(e3),position:ga.Center}}),Cl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ci.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Zd=Cl;pi(Zd.ID,Zd,1);se(i3);se(t3);se(n3);rr.appendMenuItem(Qe.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:w({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class o3{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 Bt(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Bt(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class yT extends we{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 o3(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class r3 extends yT{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:w("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:M.writable})}}class a3 extends yT{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:w("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:M.writable})}}se(r3);se(a3);class l3 extends we{constructor(){super({id:"editor.action.transposeLetters",label:w("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 u=c===h?r.getPosition():Nw.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),f=Nw.leftPosition(i,u),p=Nw.leftPosition(i,f),v=i.getValueInRange(W.fromPositions(p,f)),_=i.getValueInRange(W.fromPositions(f,u)),y=W.fromPositions(p,u);n.push(new Cp(y,_+v))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}se(l3);const iw=(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 $0(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function c3(o,e,t){const i={id:iw(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class ST{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 qa.some(this,([i,n])=>n.asFile())&&t.push("files"),xT(E_(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 E_(e)}}function E_(o){return o.toLowerCase()}function CT(o,e){return xT(E_(o),e.map(E_))}function xT(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 nw=Object.freeze({create:o=>WD(o.map(e=>e.toString())).join(`\r
|
|
13
|
+
*-----------------------------------------------------------------------------*/var TW=Object.defineProperty,MW=Object.getOwnPropertyDescriptor,NW=Object.getOwnPropertyNames,RW=Object.prototype.hasOwnProperty,AW=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of NW(e))!RW.call(o,n)&&n!==t&&TW(o,n,{get:()=>e[n],enumerable:!(i=MW(e,n))||i.enumerable});return o},OW=(o,e,t)=>(AW(o,e,"default"),t),FW="5.4.5",Qu={};OW(Qu,FD);var cT=(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))(cT||{}),dT=(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))(dT||{}),hT=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(hT||{}),uT=(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))(uT||{}),gT=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(gT||{}),fT=class{constructor(o,e,t,i,n){this._onDidChange=new Qu.Emitter,this._onDidExtraLibsChange=new Qu.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)}},HW=FW,pT={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},mT=new fT({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},pT),_T=new fT({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},pT),WW=()=>ew().then(o=>o.getTypeScriptWorker()),BW=()=>ew().then(o=>o.getJavaScriptWorker());Qu.languages.typescript={ModuleKind:cT,JsxEmit:dT,NewLineKind:hT,ScriptTarget:uT,ModuleResolutionKind:gT,typescriptVersion:HW,typescriptDefaults:mT,javascriptDefaults:_T,getTypeScriptWorker:WW,getJavaScriptWorker:BW};function ew(){return OD(()=>import("./tsMode-Bt_apCqT.js"),__vite__mapDeps([3,1,2]))}Qu.languages.onLanguage("typescript",()=>ew().then(o=>o.setupTypeScript(mT)));Qu.languages.onLanguage("javascript",()=>ew().then(o=>o.setupJavaScript(_T)));class zW extends qs{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:pt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Zt.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(Sn),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class vT extends qs{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:pt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:re.has("isInDiffEditor")})}run(e,...t){const i=e.get(Sn),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class bT extends qs{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:pt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:re.has("isInDiffEditor")})}run(e,...t){const i=e.get(Sn),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const Vp=pt("diffEditor","Diff Editor");class VW extends Nr{constructor(){super({id:"diffEditor.switchSide",title:pt("switchSide","Switch Side"),icon:Zt.arrowSwap,precondition:re.has("isInDiffEditor"),f1:!0,category:Vp})}runEditorCommand(e,t,i){const n=yg(e);if(n instanceof Sp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class UW extends Nr{constructor(){super({id:"diffEditor.exitCompareMove",title:pt("exitCompareMove","Exit Compare Move"),icon:Zt.close,precondition:M.comparingMovedCode,f1:!1,category:Vp,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=yg(e);n instanceof Sp&&n.exitCompareMove()}}class jW extends Nr{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:pt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Zt.fold,precondition:re.has("isInDiffEditor"),f1:!0,category:Vp})}runEditorCommand(e,t,...i){const n=yg(e);n instanceof Sp&&n.collapseAllUnchangedRegions()}}class $W extends Nr{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:pt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Zt.unfold,precondition:re.has("isInDiffEditor"),f1:!0,category:Vp})}runEditorCommand(e,t,...i){const n=yg(e);n instanceof Sp&&n.showAllUnchangedRegions()}}class aS extends qs{constructor(){super({id:"diffEditor.revert",title:pt("revert","Revert"),f1:!1,category:Vp})}run(e,t){const i=qW(e,t.originalUri,t.modifiedUri);i instanceof Sp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const wT=pt("accessibleDiffViewer","Accessible Diff Viewer"),Wv=class Wv extends qs{constructor(){super({id:Wv.id,title:pt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:wT,precondition:re.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=yg(e);t==null||t.accessibleDiffViewerNext()}};Wv.id="editor.action.accessibleDiffViewer.next";let zf=Wv;const Bv=class Bv extends qs{constructor(){super({id:Bv.id,title:pt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:wT,precondition:re.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=yg(e);t==null||t.accessibleDiffViewerPrev()}};Bv.id="editor.action.accessibleDiffViewer.prev";let D_=Bv;function qW(o,e,t){return o.get(Xn).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 yg(o){const t=o.get(Xn).listDiffEditors(),i=HD();if(i)for(const n of t){const s=n.getContainerDomNode();if(KW(s,i))return n}return null}function KW(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}Qi(zW);Qi(vT);Qi(bT);rr.appendMenuItem(Qe.EditorTitle,{command:{id:new bT().desc.id,title:w("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"))});rr.appendMenuItem(Qe.EditorTitle,{command:{id:new vT().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:Zt.move,toggled:oA.create("config.diffEditor.experimental.showMoves",!0),precondition:re.has("isInDiffEditor")},order:10,group:"1_diff",when:re.has("isInDiffEditor")});Qi(aS);for(const o of[{icon:Zt.arrowRight,key:M.diffEditorInlineMode.toNegated()},{icon:Zt.discard,key:M.diffEditorInlineMode}])rr.appendMenuItem(Qe.DiffEditorHunkToolbar,{command:{id:new aS().desc.id,title:w("revertHunk","Revert Block"),icon:o.icon},when:re.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),rr.appendMenuItem(Qe.DiffEditorSelectionToolbar,{command:{id:new aS().desc.id,title:w("revertSelection","Revert Selection"),icon:o.icon},when:re.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"});Qi(VW);Qi(UW);Qi(jW);Qi($W);rr.appendMenuItem(Qe.EditorTitle,{command:{id:zf.id,title:w("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"))});gn.registerCommandAlias("editor.action.diffReview.next",zf.id);Qi(zf);gn.registerCommandAlias("editor.action.diffReview.prev",D_.id);Qi(D_);var GW=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},ZW=function(o,e){return function(t,i){e(t,i,o)}},lS;const tw=new Pi("selectionAnchorSet",!1);var nd;let cc=(nd=class{static get(e){return e.getContribution(lS.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=tw.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(Bt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Ps().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),ar(w("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(Bt.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()}},lS=nd,nd.ID="editor.contrib.selectionAnchorController",nd);cc=lS=GW([ZW(1,Hi)],cc);class XW extends we{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:es(2089,2080),weight:100}})}async run(e,t){var i;(i=cc.get(t))==null||i.setSelectionAnchor()}}class YW extends we{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:tw})}async run(e,t){var i;(i=cc.get(t))==null||i.goToSelectionAnchor()}}class JW extends we{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:tw,kbOpts:{kbExpr:M.editorTextFocus,primary:es(2089,2089),weight:100}})}async run(e,t){var i;(i=cc.get(t))==null||i.selectFromAnchorToCursor()}}class QW extends we{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:tw,kbOpts:{kbExpr:M.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=cc.get(t))==null||i.cancelSelectionAnchor()}}pi(cc.ID,cc,4);se(XW);se(YW);se(JW);se(QW);const e3=gt("editorOverviewRuler.bracketMatchForeground","#A0A0A0",w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class t3 extends we{constructor(){super({id:"editor.action.jumpToBracket",label:w("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=Zd.get(t))==null||i.jumpToBracket()}}class i3 extends we{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:pt("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=Zd.get(t))==null||s.selectToBracket(n)}}class n3 extends we{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Zd.get(t))==null||i.removeBrackets(this.id)}}class s3{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Cl=class Cl extends Ae{static get(e){return e.getContribution(Cl.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 Bt(r.lineNumber,r.column,r.lineNumber,r.column):new Bt(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,u]=r;if(a=e?h.getStartPosition():h.getEndPosition(),c=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(s)){const f=a;a=c,c=f}}a&&c&&i.push(new Bt(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(_t.compare);const a=[];let c=0,h=0;const u=n.length;for(let f=0,p=s.length;f<p;f++){const v=s[f];for(;h<u&&n[h].position.isBefore(v);)h++;if(h<u&&n[h].position.equals(v))a[c++]=n[h];else{let _=t.bracketPairs.matchBracket(v,20),y=Cl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(v,20),y=Cl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[c++]=new s3(v,_,y)}}this._lastBracketsData=a,this._lastVersionId=i}};Cl.ID="editor.contrib.bracketMatchingController",Cl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Ci.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ss(e3),position:ga.Center}}),Cl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Ci.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let Zd=Cl;pi(Zd.ID,Zd,1);se(i3);se(t3);se(n3);rr.appendMenuItem(Qe.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:w({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class o3{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 Bt(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Bt(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class yT extends we{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 o3(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class r3 extends yT{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:w("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:M.writable})}}class a3 extends yT{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:w("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:M.writable})}}se(r3);se(a3);class l3 extends we{constructor(){super({id:"editor.action.transposeLetters",label:w("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 u=c===h?r.getPosition():Nw.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),f=Nw.leftPosition(i,u),p=Nw.leftPosition(i,f),v=i.getValueInRange(W.fromPositions(p,f)),_=i.getValueInRange(W.fromPositions(f,u)),y=W.fromPositions(p,u);n.push(new Cp(y,_+v))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}se(l3);const iw=(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 $0(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function c3(o,e,t){const i={id:iw(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class ST{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 qa.some(this,([i,n])=>n.asFile())&&t.push("files"),xT(E_(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 E_(e)}}function E_(o){return o.toLowerCase()}function CT(o,e){return xT(E_(o),e.map(E_))}function xT(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 nw=Object.freeze({create:o=>WD(o.map(e=>e.toString())).join(`\r
|
|
14
14
|
`),split:o=>o.split(`\r
|
|
15
15
|
`),parse:o=>nw.split(o).filter(e=>!e.startsWith("#"))}),Jr=class Jr{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+Jr.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Jr((this.value?[this.value,...e]:e).join(Jr.sep))}};Jr.sep=".",Jr.None=new Jr("@@none@@"),Jr.Empty=new Jr("");let yn=Jr;const gI={EDITORS:"CodeEditors",FILES:"CodeFiles"};class d3{}const h3={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Rr.add(h3.DragAndDropContribution,new d3);const xf=class xf{constructor(){}static getInstance(){return xf.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};xf.INSTANCE=new xf;let cS=xf;function LT(o){const e=new ST;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,$0(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,u3(n))}}return e}function u3(o){const e=o.path?nn.parse(o.path):void 0;return c3(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const g3=Object.freeze([gI.EDITORS,gI.FILES,Ty.RESOURCES,Ty.INTERNAL_URI_LIST]);function IT(o,e=!1){const t=LT(o),i=t.get(Ty.INTERNAL_URI_LIST);if(i)t.replace(_s.uriList,i);else if(e||!t.has(_s.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(_s.uriList,$0(nw.create(n)))}for(const n of g3)t.delete(n);return t}var q0=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},Vf=function(o,e){return function(t,i){e(t,i,o)}};class K0{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 Lf=class Lf extends K0{constructor(){super(...arguments),this.kind=Lf.kind,this.dropMimeTypes=[_s.text],this.pasteMimeTypes=[_s.text]}async getEdit(e,t){const i=e.get(_s.text);if(!i||e.has(_s.uriList))return;const n=await i.asString();return{handledMimeType:_s.text,title:w("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};Lf.id="text",Lf.kind=new yn("text.plain");let Xd=Lf;class kT extends K0{constructor(){super(...arguments),this.kind=new yn("uri.absolute"),this.dropMimeTypes=[_s.uriList],this.pasteMimeTypes=[_s.uriList]}async getEdit(e,t){const i=await DT(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:c})=>a.scheme===zs.file?a.fsPath:(n++,c)).join(" ");let r;return n>0?r=i.length>1?w("defaultDropProvider.uriList.uris","Insert Uris"):w("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?w("defaultDropProvider.uriList.paths","Insert Paths"):w("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:_s.uriList,insertText:s,title:r,kind:this.kind}}}let P_=class extends K0{constructor(e){super(),this._workspaceContextService=e,this.kind=new yn("uri.relative"),this.dropMimeTypes=[_s.uriList],this.pasteMimeTypes=[_s.uriList]}async getEdit(e,t){const i=await DT(e);if(!i.length||t.isCancellationRequested)return;const n=Ja(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?rA(r.uri,s):void 0}));if(n.length)return{handledMimeType:_s.uriList,insertText:n.join(" "),title:i.length>1?w("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):w("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};P_=q0([Vf(0,Fu)],P_);class f3{constructor(){this.kind=new yn("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:_s.text}]}async provideDocumentPasteEdits(e,t,i,n,s){var c;if(n.triggerKind!==My.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:w("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function DT(o){const e=o.get(_s.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of nw.parse(t))try{i.push({uri:nn.parse(n),originalText:n})}catch{}return i}let dS=class extends Ae{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new Xd)),this._register(e.documentDropEditProvider.register("*",new kT)),this._register(e.documentDropEditProvider.register("*",new P_(t)))}};dS=q0([Vf(0,vt),Vf(1,Fu)],dS);let hS=class extends Ae{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new Xd)),this._register(e.documentPasteEditProvider.register("*",new kT)),this._register(e.documentPasteEditProvider.register("*",new P_(t))),this._register(e.documentPasteEditProvider.register("*",new f3))}};hS=q0([Vf(0,vt),Vf(1,Fu)],hS);const jo=class jo{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=jo._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(jo.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(jo.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(jo.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(jo.isVariableCharacter(i)||jo.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 jo._table[i]>"u"&&!jo.isDigitCharacter(i)&&!jo.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};jo._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let uS=jo;class Sg{constructor(){this._children=[]}appendChild(e){return e instanceof to&&this._children[this._children.length-1]instanceof to?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 Up)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}let to=class ET extends Sg{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new ET(this.value)}};class PT extends Sg{}class Fo extends PT{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 Cg?this._children[0]:void 0}clone(){const e=new Fo(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Cg extends Sg{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof to&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Cg;return this.options.forEach(e.appendChild,e),e}}class G0 extends Sg{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 yr&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof yr){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new G0;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 yr extends Sg{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 yr(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class Uf extends PT{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 to(t)],!0):!1}clone(){const e=new Uf(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function fI(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class Up extends Sg{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Fo&&(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 fI([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Fo&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof Uf&&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 Up;return this._children=this.children.map(t=>t.clone()),e}walk(e){fI(this.children,e)}}class Yd{constructor(){this._scanner=new uS,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 Up;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 Fo&&(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 u=n.get(c.index);if(!u)return;const f=new Fo(c.index);f.transform=c.transform;for(const p of u){const v=p.clone();f.appendChild(v),v instanceof Fo&&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 Fo(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 to(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 Fo(Number(t)):new Uf(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 Fo(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new to("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new Cg;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 to(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 Uf(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new to("${"+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 G0;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 to(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 yr(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new yr(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 yr(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new yr(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new yr(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 yr(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new yr(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new to(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function TT(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 aA(o,{range:s,text:typeof t.insertText=="string"?Yd.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function MT(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 p3=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},m3=function(o,e){return function(t,i){e(t,i,o)}};const _3=Ci.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:BD,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),zv=class zv extends Ae{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=ut(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ut("span.icon");this.domNode.append(t),t.classList.add(...Ui.asClassNameArray(Zt.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(Fi(this.domNode,Mn.CLICK,n=>{this.delegate.cancel()}))}getId(){return zv.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)}};zv.baseId="editor.widget.inlineProgressWidget";let gS=zv,T_=class extends Ae{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Co),this._currentWidget=this._register(new Co),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=Df(()=>{const a=W.fromPositions(e);this._currentDecorations.set([{range:a,options:_3}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(gS,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()}};T_=p3([m3(2,oi)],T_);var v3=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},pI=function(o,e){return function(t,i){e(t,i,o)}},Ym,Ul;let oo=(Ul=class{static get(e){return e.getContribution(Ym.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Co,this._messageListeners=new Ne,this._mouseOverMessage=!1,this._editor=e,this._visible=Ym.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){ar(Bm(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Bm(e)?lA(e,{actionHandler:{callback:n=>{this.closeMessage(),cA(this._openerService,n,Bm(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new mI(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&&dA(HD(),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(Fi(this._messageWidget.value.getDomNode(),Mn.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(Fi(this._messageWidget.value.getDomNode(),Mn.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(mI.fadeOut(this._messageWidget.value))}},Ym=Ul,Ul.ID="editor.contrib.messageController",Ul.MESSAGE_VISIBLE=new Pi("messageVisible",!1,w("messageVisible","Whether the editor is currently showing an inline message")),Ul);oo=Ym=v3([pI(1,Hi),pI(2,Ar)],oo);const b3=Ks.bindToContribution(oo.get);St(new b3({id:"leaveEditorMessage",precondition:oo.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let mI=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)}};pi(oo.ID,oo,4);function Zw(o,e){return e&&(o.stack||o.stacktrace)?w("stackTrace.format","{0}: {1}",vI(o),_I(o.stack)||_I(o.stacktrace)):vI(o)}function _I(o){return Array.isArray(o)?o.join(`
|
|
16
16
|
`):o}function vI(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"?w("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function M_(o=null,e=!1){if(!o)return w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=Ja(o),i=M_(t[0],e);return t.length>1?w("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(zD(o))return o;if(o.detail){const t=o.detail;if(t.error)return Zw(t.error,e);if(t.exception)return Zw(t.exception,e)}return o.stack?Zw(o,e):o.message?o.message:w("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var NT=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},mu=function(o,e){return function(t,i){e(t,i,o)}},fS,sd;let pS=(sd=class extends Ae{constructor(e,t,i,n,s,r,a,c,h,u){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=c,this._keybindingService=u,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(u.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=ut(".post-edit-widget"),this.button=this._register(new hA(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(Fi(this.domNode,Mn.CLICK,()=>this.showSelector()))}getId(){return fS.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Us(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>uA({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},fS=sd,sd.baseId="editor.widget.postEditWidget",sd);pS=fS=NT([mu(7,fg),mu(8,Hi),mu(9,ts)],pS);let N_=class extends Ae{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 Co),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)=>{fc(S)||(this._notificationService.error(D),i&&this.show(e[0],t,c))};let u;try{u=await n(a,s)}catch(S){return h(S,w("resolveError",`Error resolving edit '{0}':
|
|
@@ -222,4 +222,4 @@ declare const she: {
|
|
|
222
222
|
`).trim())}}return H}function Et(j){return j.filter!==void 0||j.map!==void 0||j.reduce!==void 0}function Jt(j){const H=[];return j.filter!==void 0&&H.push("filter"),j.map!==void 0&&H.push("map"),j.reduce!==void 0&&H.push("reduce"),`Apply ${H.join(" + ")}`}const Qt=15;function Ft(j){return j.split(`
|
|
223
223
|
`).length>Qt}function At(j){const H=new Set(g(p));H.has(j)?H.delete(j):H.add(j),k(p,H,!0)}function ji(j,H){if(jn(H))try{return Ev.highlight(j,{language:"javascript"}).value}catch{}return j.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function en(j){return Ln.parse(j)}function jn(j){return!j||j==="js"||j==="javascript"}function Ki(j){navigator.clipboard.writeText(j).catch(()=>{})}async function Ri(){if(k(v,!0),!(g(_)||g(y))){k(y,!0),k(S,"");try{k(_,await tR(g(f)||g(h).model),!0)}catch(j){k(S,j.message,!0)}k(y,!1)}}function In(j){return j>=1e9?`${(j/1e9).toFixed(1)} GB`:j>=1e6?`${(j/1e6).toFixed(0)} MB`:`${j} B`}function kn(j){const H=j.match(/\.([^.]+)$/);return H?H[1].toUpperCase():"?"}function Hn(j){switch(j){case"SH":case"BASH":return"$";case"MD":case"MARKDOWN":return"↓";case"JSON":case"JSONC":return"{}";default:return j}}function fn(j){k(G,g(G).filter((H,te)=>te!==j),!0)}function zi(){Pe.click()}async function Nn(j){if(!(!j||j.length===0))for(const H of Array.from(j)){const te=await H.text();k(G,[...g(G),{name:H.name,content:te}],!0)}}function pn(j){const H=j.target;Nn(H.files),H.value=""}function tt(j){var H;j.preventDefault(),k(Se,!1),Nn(((H=j.dataTransfer)==null?void 0:H.files)??null)}function qt(j){var H;(H=j.dataTransfer)!=null&&H.types.includes("Files")&&(j.preventDefault(),k(Se,!0))}function ui(){k(Se,!1)}async function gi(){const j=g(r).trim();if(!(!j||g(a))){k(r,""),k(c,""),k(a,!0),k(n,[...g(n),{role:"user",content:j}],!0),D=new AbortController,k(De,[],!0);try{await nR({messages:g(n),currentView:g(ke),context:g($t),modelOverride:g(f)||void 0,extraFiles:g(G).length>0?g(G):void 0},H=>{k(s,(g(s)??"")+H)},D.signal,H=>{k(De,[...g(De),H],!0)}),k(n,[...g(n),{role:"assistant",content:g(s)??"",toolEvents:g(De).length>0?[...g(De)]:void 0}],!0),k(De,[],!0)}catch(H){if(H.name==="AbortError"){const te=g(s);te!=null&&te.trim()&&k(n,[...g(n),{role:"assistant",content:te+`
|
|
224
224
|
|
|
225
|
-
*[stopped]*`,toolEvents:g(De).length>0?[...g(De)]:void 0}],!0)}else k(c,H.message,!0)}finally{D=null,k(s,null),k(De,[],!0),k(a,!1)}}}function ri(){D==null||D.abort()}function mn(j){j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),gi())}function Cn(){k(n,[],!0),k(c,"")}const sn=["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 Ni(j){k(r,j,!0),Dt==null||Dt.focus()}var an=k9(),_n=Lt(an),ln=C(_n),cn=I(C(ln),2);{var vn=j=>{var H=$G(),te=C(H);{var ye=Ie=>{var pe=Tr();Z(()=>q(pe,`${g(h).provider??""} · ${(g(f)||g(h).model)??""}`)),T(Ie,pe)},he=Ie=>{var pe=Tr("Not configured");T(Ie,pe)};K(te,Ie=>{g(rt)?Ie(ye):Ie(he,-1)})}Z(()=>Bn(H,"title",`Provider: ${g(h).provider??""}`)),T(j,H)};K(cn,j=>{g(h)&&j(vn)})}var Dn=I(cn,2);{var xn=j=>{var H=qG();oe("click",H,Cn),T(j,H)};K(Dn,j=>{g(n).length>0&&j(xn)})}var Rn=I(ln,2),$=C(Rn);{var _e=j=>{var H=KG();T(j,H)},mt=j=>{var H=XG(),te=C(H),ye=C(te);{var he=Fe=>{var It=GG(),Ge=I(Lt(It)),dt=C(Ge);Z(()=>q(dt,t().id)),T(Fe,It)},Ie=Fe=>{var It=Tr("No view selected. Ask a general sheDB view question.");T(Fe,It)};K(ye,Fe=>{t()?Fe(he):Fe(Ie,-1)})}var pe=I(te,2);vi(pe,17,()=>sn,Fn,(Fe,It)=>{var Ge=ZG(),dt=C(Ge);Z(()=>q(dt,g(It))),oe("click",Ge,()=>Ni(g(It))),T(Fe,Ge)}),T(j,H)};K($,j=>{g(rt)?g(n).length===0&&g(s)===null&&j(mt,1):j(_e)})}var Rt=I($,2);vi(Rt,17,()=>g(n),Fn,(j,H,te)=>{var ye=i9(),he=C(ye);{var Ie=Fe=>{var It=YG(),Ge=C(It);Z(()=>q(Ge,g(H).content)),T(Fe,It)},pe=Fe=>{const It=ht(()=>Ct(g(H).content)),Ge=ht(()=>at(g(It)));var dt=t9(),ni=Lt(dt);{var F=it=>{var ge=ID();vi(ge,21,()=>g(H).toolEvents,Fn,(xe,Ye)=>{var Je=ks(),We=Lt(Je);{var Wt=le=>{var bt=xD(),xt=I(C(bt)),Si=C(xt);Z(Ii=>q(Si,Ii),[()=>g(Ye).name.replace(/_/g," ")]),T(le,bt)},ue=le=>{var bt=LD(),xt=I(C(bt)),Si=C(xt);Z(Ii=>q(Si,Ii),[()=>g(Ye).name.replace(/_/g," ")]),T(le,bt)};K(We,le=>{g(Ye).type==="tool_call"?le(Wt):le(ue,-1)})}T(xe,Je)}),T(it,ge)};K(ni,it=>{var ge;(ge=g(H).toolEvents)!=null&&ge.length&&it(F)})}var ie=I(ni,2),He=C(ie);vi(He,17,()=>g(It),Fn,(it,ge,xe)=>{var Ye=ks(),Je=Lt(Ye);{var We=ue=>{var le=kD();Nl(le,()=>en(g(ge).text),!0),T(ue,le)},Wt=ue=>{const le=ht(()=>`${te}:${xe}`),bt=ht(()=>Ft(g(ge).text)),xt=ht(()=>g(p).has(g(le))),Si=ht(()=>g(ge).lang==="filter");var Ii=QG(),Ee=C(Ii),Ze=C(Ee),ot=C(Ze),Ut=I(Ze,2),Ve=C(Ut),ti=I(Ee,2);let Xt;var An=C(ti),ki=C(An);Nl(ki,()=>ji(g(ge).text,g(ge).lang??""),!0);var Gt=I(An,2);{var Gi=$i=>{var is=JG(),us=C(is);Z(()=>q(us,g(xt)?"▲ collapse":"▼ expand")),oe("click",is,()=>At(g(le))),T($i,is)};K(Gt,$i=>{g(bt)&&$i(Gi)})}Z(()=>{q(ot,g(Si)?"filter":g(ge).lang),Xt=jt(ti,1,"code-body svelte-1twuiul",null,Xt,{collapsed:g(bt)&&!g(xt)})}),oe("click",Ve,()=>Ki(g(ge).text)),T(ue,Ii)};K(Je,ue=>{g(ge).type==="text"?ue(We):ue(Wt,-1)})}T(it,Ye)});var $e=I(He,2);{var be=it=>{var ge=e9(),xe=C(ge),Ye=C(xe);Z(Je=>q(Ye,Je),[()=>Jt(g(Ge))]),oe("click",xe,()=>e.onApplyView(g(Ge))),T(it,ge)},et=ht(()=>Et(g(Ge))&&e.onApplyView);K($e,it=>{g(et)&&it(be)})}T(Fe,dt)};K(he,Fe=>{g(H).role==="user"?Fe(Ie):Fe(pe,-1)})}Z(()=>jt(ye,1,`message ${g(H).role??""}`,"svelte-1twuiul")),T(j,ye)});var Pt=I(Rt,2);{var zt=j=>{var H=ID();vi(H,21,()=>g(De),Fn,(te,ye)=>{var he=ks(),Ie=Lt(he);{var pe=It=>{var Ge=xD(),dt=I(C(Ge)),ni=C(dt);Z(F=>q(ni,F),[()=>g(ye).name.replace(/_/g," ")]),T(It,Ge)},Fe=It=>{var Ge=LD(),dt=I(C(Ge)),ni=C(dt);Z(F=>q(ni,F),[()=>g(ye).name.replace(/_/g," ")]),T(It,Ge)};K(Ie,It=>{g(ye).type==="tool_call"?It(pe):It(Fe,-1)})}T(te,he)}),T(j,H)};K(Pt,j=>{g(De).length>0&&j(zt)})}var Q=I(Pt,2);{var Xe=j=>{var H=n9(),te=C(H),ye=C(te),he=C(ye);Z(()=>q(he,N[g(E)])),T(j,H)};K(Q,j=>{g(a)&&g(s)===null&&g(De).length===0&&j(Xe)})}var R=I(Q,2);{var X=j=>{var H=o9(),te=C(H);vi(te,21,()=>Ue(g(s)),Fn,(ye,he)=>{var Ie=ks(),pe=Lt(Ie);{var Fe=Ge=>{var dt=kD();Nl(dt,()=>en(g(he).text),!0),T(Ge,dt)},It=Ge=>{var dt=s9(),ni=C(dt),F=C(ni),ie=C(F),He=I(ni,2),$e=C(He);Nl($e,()=>ji(g(he).text,g(he).lang??""),!0),Z(()=>q(ie,g(he).lang)),T(Ge,dt)};K(pe,Ge=>{g(he).type==="text"?Ge(Fe):Ge(It,-1)})}T(ye,Ie)}),T(j,H)};K(R,j=>{g(s)!==null&&j(X)})}io(Rn,j=>Te=j,()=>Te);var Ce=I(Rn,2);{var Le=j=>{var H=r9(),te=C(H);Z(()=>q(te,g(c))),T(j,H)};K(Ce,j=>{g(c)&&j(Le)})}var lt=I(Ce,2),Nt=C(lt),Oe=C(Nt),je=I(Nt,2),Be=C(je),Ot=I(je,2),qe=C(Ot),ve=I(Ot,2),Vt=C(ve),Ht=I(lt,2),fi=C(Ht);{var mi=j=>{var H=a9();let te;var ye=I(C(H),2),he=C(ye),Ie=I(ye,2),pe=C(Ie);Z(()=>{te=jt(H,1,"file-chip svelte-1twuiul",null,te,{inactive:!g(fe)}),q(he,t().id),Bn(Ie,"title",g(fe)?"Remove from context":"Re-add to context"),q(pe,g(fe)?"×":"+")}),oe("click",Ie,()=>k(fe,!g(fe))),T(j,H)};K(fi,j=>{t()&&j(mi)})}var Wi=I(fi,2);vi(Wi,17,()=>g(G),Fn,(j,H,te)=>{const ye=ht(()=>kn(g(H).name));var he=l9(),Ie=C(he),pe=C(Ie),Fe=I(Ie,2),It=C(Fe),Ge=I(Fe,2);Z((dt,ni)=>{jt(Ie,1,`badge badge-${dt??""}`,"svelte-1twuiul"),q(pe,ni),q(It,g(H).name)},[()=>g(ye).toLowerCase(),()=>Hn(g(ye))]),oe("click",Ge,()=>fn(te)),T(j,he)});var J=I(Wi,2),de=I(J,2);io(de,j=>Pe=j,()=>Pe);var Ke=I(Ht,2);let st;var ft=C(Ke);let ct;var yt=C(ft);io(yt,j=>Dt=j,()=>Dt);var ai=I(ft,2);{var Ti=j=>{var H=c9();oe("click",H,ri),T(j,H)},Yt=j=>{var H=d9();Z(te=>H.disabled=te,[()=>!g(r).trim()||!g(rt)]),oe("click",H,gi),T(j,H)};K(ai,j=>{g(a)?j(Ti):j(Yt,-1)})}var ei=I(Ke,2);{var Li=j=>{var H=p9(),te=C(H),ye=C(te),he=I(te,2);{var Ie=Ge=>{var dt=u9();vi(dt,21,()=>g(u),Fn,(ni,F)=>{var ie=h9(),He=C(ie),$e={};Z(()=>{q(He,g(F)),$e!==($e=g(F))&&(ie.value=(ie.__value=g(F))??"")}),T(ni,ie)}),Z(()=>dt.disabled=g(a)),za(dt,()=>g(f),ni=>k(f,ni)),T(Ge,dt)},pe=Ge=>{var dt=g9(),ni=C(dt);Z(()=>q(ni,g(f)||g(h).model)),T(Ge,dt)};K(he,Ge=>{g(u).length>0?Ge(Ie):Ge(pe,-1)})}var Fe=I(he,2);{var It=Ge=>{var dt=f9();oe("click",dt,Ri),T(Ge,dt)};K(Fe,Ge=>{g(h).provider==="ollama"&&Ge(It)})}Z(()=>q(ye,g(h).provider)),T(j,H)};K(ei,j=>{g(rt)&&g(h)&&j(Li)})}var tn=I(_n,2);{var ze=j=>{var H=I9(),te=C(H),ye=C(te),he=C(ye),Ie=C(he),pe=I(he,2),Fe=I(ye,2),It=C(Fe);{var Ge=F=>{var ie=m9();T(F,ie)},dt=F=>{var ie=_9(),He=C(ie);Z(()=>q(He,g(S))),T(F,ie)},ni=F=>{var ie=L9(),He=C(ie);{var $e=ue=>{var le=v9(),bt=I(Lt(le)),xt=C(bt);Z(()=>q(xt,g(_).version)),T(ue,le)};K(He,ue=>{g(_).version&&ue($e)})}var be=I(He,2);{var et=ue=>{var le=b9(),bt=I(Lt(le)),xt=C(bt);Z(()=>q(xt,g(_).details.family)),T(ue,le)};K(be,ue=>{var le;(le=g(_).details)!=null&&le.family&&ue(et)})}var it=I(be,2);{var ge=ue=>{var le=w9(),bt=I(Lt(le)),xt=C(bt);Z(()=>q(xt,g(_).details.parameter_size)),T(ue,le)};K(it,ue=>{var le;(le=g(_).details)!=null&&le.parameter_size&&ue(ge)})}var xe=I(it,2);{var Ye=ue=>{var le=y9(),bt=I(Lt(le)),xt=C(bt);Z(()=>q(xt,g(_).details.quantization_level)),T(ue,le)};K(xe,ue=>{var le;(le=g(_).details)!=null&&le.quantization_level&&ue(Ye)})}var Je=I(xe,2);{var We=ue=>{var le=C9(),bt=I(Lt(le),2);vi(bt,21,()=>g(_).running,Fn,(xt,Si)=>{var Ii=S9(),Ee=C(Ii);Z(Ze=>q(Ee,`${g(Si).name??""} · ${Ze??""} VRAM`),[()=>In(g(Si).size_vram)]),T(xt,Ii)}),T(ue,le)},Wt=ue=>{var le=x9();T(ue,le)};K(Je,ue=>{g(_).running&&g(_).running.length>0?ue(We):g(_).running!==null&&ue(Wt,1)})}T(F,ie)};K(It,F=>{g(y)?F(Ge):g(S)?F(dt,1):g(_)&&F(ni,2)})}Z(()=>{var F;return q(Ie,`Ollama · ${(g(f)||((F=g(h))==null?void 0:F.model))??""}`)}),oe("click",H,()=>k(v,!1)),oe("click",te,F=>F.stopPropagation()),oe("click",pe,()=>k(v,!1)),T(j,H)};K(tn,j=>{g(v)&&j(ze)})}Z(j=>{q(Vt,j),st=jt(Ke,1,"input-row svelte-1twuiul",null,st,{"drag-over":g(Se)}),ct=jt(ft,1,"textarea-wrap svelte-1twuiul",null,ct,{loading:g(a)}),Bn(yt,"placeholder",g(rt)?"Ask anything… (Enter to send, Shift+Enter for newline, drag & drop files to add context)":"AI not configured"),yt.disabled=g(a)||!g(rt)},[()=>In(g(Mt))]),no(Oe,()=>g(z),j=>k(z,j)),no(Be,()=>g(O),j=>k(O,j)),no(qe,()=>g(Y),j=>k(Y,j)),oe("click",J,zi),oe("change",de,pn),Qn("dragover",Ke,qt),Qn("dragleave",Ke,ui),Qn("drop",Ke,tt),oe("keydown",yt,mn),Mi(yt,()=>g(r),j=>k(r,j)),T(o,an),Io()}hr(["click","change","keydown"]);var E9=A('<div class="me svelte-1pxdb1"></div>');function Ey(o,e){Lo(e,!0);let t=Ju(e,"value",15,""),i=Ju(e,"language",3,"javascript"),n,s,r=!1;Wr(()=>{const c=i()==="json"?{formatOnPaste:!0,autoIndent:"full"}:{};s=Ma.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())})}),Qb(()=>s==null?void 0:s.dispose()),Pn(()=>{!s||s.getValue()===t()||(r=!0,s.setValue(t()),r=!1)});var a=E9();io(a,c=>n=c,()=>n),T(o,a),Io()}const DD=o=>{var e=P9();T(o,e)};var P9=A('<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 — 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>'),T9=A('<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>'),ED=A('<div class="form-error svelte-rrt0o"> </div>'),M9=A('<div class="new-item-form svelte-rrt0o"><input placeholder="device/lamp1" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),PD=A("<li> </li>"),TD=A('<div class="error-bar svelte-rrt0o"> </div>'),MD=A('<div class="loading svelte-rrt0o">Loading…</div>'),N9=A('<div class="monaco-doc-wrap svelte-rrt0o"><!></div>'),R9=A('<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),A9=A('<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>'),O9=A('<div class="new-item-form svelte-rrt0o"><input placeholder="myView" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),F9=A('<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>'),H9=A('<span class="badge-error svelte-rrt0o">error</span>'),W9=A('<span class="badge-ok svelte-rrt0o"> </span>'),B9=A('<pre class="result-error svelte-rrt0o"> </pre>'),z9=A('<pre class="result-json svelte-rrt0o"> </pre>'),V9=A('<div class="view-result svelte-rrt0o"><div class="result-header svelte-rrt0o">Result <!></div> <!></div>'),U9=A('<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 · 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>'),j9=A('<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),$9=A('<div class="chat-resize-handle svelte-rrt0o" role="separator"></div> <div class="chat-pane svelte-rrt0o"><!></div>',1),q9=A('<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>'),K9=A('<div class="db-root svelte-rrt0o" role="presentation"><div class="panel-tabs svelte-rrt0o"><button>Documents</button> <button>Views</button> <!></div> <!></div>');function G9(o,e){Lo(e,!0);let t=V(bi([])),i=V(null),n=V("{}"),s=V(!1),r=V(null);const a="she-db-selected-view";let c=V(bi([])),h=V(bi(localStorage.getItem(a))),u=V("#"),f=V("// emit(this.someProperty)"),p=V(""),v=V(""),_=V(!1),y=V(!1),S=V(null),D=V(!1),E=V(null),N=V("she/db/view/");const z="she-db-panel";let O=V(bi(localStorage.getItem(z)??"docs")),Y=V(""),G=V(!1),fe=V(null),Se=V(""),Pe=V(!1),De=V(null);const wt="she-db-sidebar-width";let Dt=V(bi(parseInt(localStorage.getItem(wt)??"220",10))),Te=!1,$t=0,rt=0;const Mt="she-db-chat-width",ke="she-db-chat-open";let Ct=V(localStorage.getItem(ke)==="true"),Ue=V(bi(parseInt(localStorage.getItem(Mt)??"320",10))),at=!1,Et=0,Jt=0;const Qt=ht(()=>g(h)?{id:g(h),filter:g(u),map:g(f),reduce:g(p)}:null);function Ft($){$.filter!==void 0&&k(u,$.filter,!0),$.map!==void 0&&k(f,$.map,!0),$.reduce!==void 0&&k(p,$.reduce,!0)}Pn(()=>{localStorage.setItem(ke,String(g(Ct)))}),Pn(()=>{localStorage.setItem(z,g(O))}),Pn(()=>{g(h)?localStorage.setItem(a,g(h)):localStorage.removeItem(a)});function At($){Te=!0,$t=$.clientX,rt=g(Dt),$.preventDefault()}function ji($){Te&&k(Dt,Math.max(140,Math.min(500,rt+$.clientX-$t)),!0),at&&k(Ue,Math.max(240,Math.min(600,Jt-($.clientX-Et))),!0)}function en(){Te&&(Te=!1,localStorage.setItem(wt,String(g(Dt)))),at&&(at=!1,localStorage.setItem(Mt,String(g(Ue))))}function jn($){at=!0,Et=$.clientX,Jt=g(Ue),$.preventDefault()}async function Ki(){try{k(t,await ZN(),!0)}catch{}}async function Ri(){try{k(c,await XN(),!0)}catch{}}async function In($){k(i,$,!0),k(r,null),k(s,!0);try{const _e=await Q7($);k(n,JSON.stringify(_e,null,2),!0)}catch(_e){k(r,_e instanceof Error?_e.message:String(_e),!0)}finally{k(s,!1)}}async function kn(){if(g(i)){k(r,null);try{const $=JSON.parse(g(n));await eD(g(i),$)}catch($){k(r,$ instanceof Error?$.message:String($),!0)}}}async function Hn(){if(g(i)&&confirm(`Delete document "${g(i)}"?`))try{await e8(g(i)),k(i,null),k(n,"{}")}catch($){k(r,$ instanceof Error?$.message:String($),!0)}}async function fn(){const $=g(Y).trim();if($){k(fe,null);try{await eD($,{}),k(G,!1),k(Y,""),await In($)}catch(_e){k(fe,_e instanceof Error?_e.message:String(_e),!0)}}}async function zi($){k(h,$,!0),k(E,null),k(D,!0),k(S,null);try{const _e=await t8($);k(u,_e.filter??"",!0),k(f,_e.map,!0),k(p,_e.reduce??"",!0),k(v,_e.description??"",!0),k(_,_e.mqttpub??!1,!0),k(y,_e.retain??!1,!0),k(S,await ky($).catch(()=>null),!0)}catch(_e){k(E,_e instanceof Error?_e.message:String(_e),!0)}finally{k(D,!1)}}async function Nn(){if(g(h)){k(E,null);try{const $={map:g(f)};g(u).trim()&&($.filter=g(u).trim()),g(p).trim()&&($.reduce=g(p).trim()),g(v).trim()&&($.description=g(v).trim()),g(_)&&($.mqttpub=!0),g(y)&&($.retain=!0),await tD(g(h),$)}catch($){k(E,$ instanceof Error?$.message:String($),!0)}}}async function pn(){if(g(h))try{k(S,await ky(g(h)),!0)}catch($){k(E,$ instanceof Error?$.message:String($),!0)}}async function tt(){if(g(h)&&confirm(`Delete view "${g(h)}"?`))try{await i8(g(h)),k(h,null),k(u,""),k(f,"// emit(this.someProperty)"),k(p,""),k(v,""),k(_,!1),k(y,!1),k(S,null)}catch($){k(E,$ instanceof Error?$.message:String($),!0)}}async function qt(){if(!g(Se).trim())return;const $=g(Se).trim();k(De,null);try{await tD($,{map:"// emit(this.someProperty)"}),k(Pe,!1),k(Se,""),await Ri(),await zi($)}catch(_e){k(De,_e instanceof Error?_e.message:String(_e),!0)}}let ui=V(""),gi=V(""),ri=ht(()=>[...g(t)].filter($=>!g(ui)||$.toLowerCase().includes(g(ui).toLowerCase())).sort()),mn=ht(()=>[...g(c)].filter($=>!g(gi)||$.toLowerCase().includes(g(gi).toLowerCase())).sort());Wr(()=>{Ki(),Ri(),g(h)&&zi(g(h)),GN().then(Pt=>{const zt=Pt.dbPrefix||"she/db/",Q=zt.endsWith("/")?zt:zt+"/";k(N,Q+"view/")}).catch(()=>{});const $=Hl("db:ids",Pt=>{k(t,Pt.ids??[],!0)}),_e=Hl("db:viewIds",Pt=>{k(c,Pt.ids??[],!0)}),mt=Hl("db:change",async Pt=>{const zt=Pt.id;g(i)===zt&&(Pt.doc===null?(k(i,null),k(n,"{}")):k(n,JSON.stringify(Pt.doc,null,2),!0))}),Rt=Hl("db:viewUpdate",async Pt=>{const zt=Pt.id;g(h)===zt&&k(S,await ky(zt).catch(()=>null),!0)});return()=>{$(),_e(),mt(),Rt()}});var Cn=K9(),sn=C(Cn),Ni=C(sn);let an;var _n=I(Ni,2);let ln;var cn=I(_n,2);{var vn=$=>{var _e=T9();let mt;Z(()=>{mt=jt(_e,1,"ai-toggle svelte-rrt0o",null,mt,{"ai-open":g(Ct)}),Bn(_e,"title",g(Ct)?"Close AI assistant":"Open AI assistant")}),oe("click",_e,()=>k(Ct,!g(Ct))),T($,_e)};K(cn,$=>{g(O)==="views"&&$(vn)})}var Dn=I(sn,2);{var xn=$=>{var _e=A9(),mt=C(_e);let Rt;var Pt=C(mt),zt=C(Pt),Q=I(Pt,2);{var Xe=Be=>{var Ot=M9(),qe=Lt(Ot),ve=C(qe),Vt=I(ve,2),Ht=I(qe,2);{var fi=mi=>{var Wi=ED(),J=C(Wi);Z(()=>q(J,g(fe))),T(mi,Wi)};K(Ht,mi=>{g(fe)&&mi(fi)})}oe("keydown",ve,mi=>mi.key==="Enter"&&fn()),Mi(ve,()=>g(Y),mi=>k(Y,mi)),oe("click",Vt,fn),T(Be,Ot)};K(Q,Be=>{g(G)&&Be(Xe)})}var R=I(Q,2),X=C(R),Ce=I(R,2);vi(Ce,20,()=>g(ri),Be=>Be,(Be,Ot)=>{var qe=PD();let ve;var Vt=C(qe);Z(()=>{ve=jt(qe,1,"flat-item svelte-rrt0o",null,ve,{"active-item":g(i)===Ot}),q(Vt,Ot)}),oe("click",qe,()=>In(Ot)),T(Be,qe)});var Le=I(mt,2),lt=I(Le,2),Nt=C(lt);{var Oe=Be=>{var Ot=R9(),qe=Lt(Ot),ve=C(qe),Vt=C(ve),Ht=I(ve,2),fi=I(Ht,2),mi=I(qe,2);{var Wi=st=>{var ft=TD(),ct=C(ft);Z(()=>q(ct,g(r))),T(st,ft)};K(mi,st=>{g(r)&&st(Wi)})}var J=I(mi,2);{var de=st=>{var ft=MD();T(st,ft)},Ke=st=>{var ft=N9(),ct=C(ft);Ey(ct,{language:"json",get value(){return g(n)},set value(yt){k(n,yt,!0)}}),T(st,ft)};K(J,st=>{g(s)?st(de):st(Ke,-1)})}Z(()=>q(Vt,g(i))),oe("click",Ht,kn),oe("click",fi,Hn),T(Be,Ot)},je=Be=>{DD(Be)};K(Nt,Be=>{g(i)?Be(Oe):Be(je,-1)})}Z(()=>Rt=Ho(mt,"",Rt,{width:`${g(Dt)??""}px`})),oe("click",zt,()=>{k(G,!g(G)),k(fe,null)}),Mi(X,()=>g(ui),Be=>k(ui,Be)),oe("mousedown",Le,At),T($,_e)},Rn=$=>{var _e=q9(),mt=C(_e);let Rt;var Pt=C(mt),zt=C(Pt),Q=I(Pt,2);{var Xe=qe=>{var ve=O9(),Vt=Lt(ve),Ht=C(Vt),fi=I(Ht,2),mi=I(Vt,2);{var Wi=J=>{var de=ED(),Ke=C(de);Z(()=>q(Ke,g(De))),T(J,de)};K(mi,J=>{g(De)&&J(Wi)})}oe("keydown",Ht,J=>J.key==="Enter"&&qt()),Mi(Ht,()=>g(Se),J=>k(Se,J)),oe("click",fi,qt),T(qe,ve)};K(Q,qe=>{g(Pe)&&qe(Xe)})}var R=I(Q,2),X=C(R),Ce=I(R,2);vi(Ce,20,()=>g(mn),qe=>qe,(qe,ve)=>{var Vt=PD();let Ht;var fi=C(Vt);Z(()=>{Ht=jt(Vt,1,"flat-item svelte-rrt0o",null,Ht,{"active-item":g(h)===ve}),q(fi,ve)}),oe("click",Vt,()=>zi(ve)),T(qe,Vt)});var Le=I(mt,2),lt=I(Le,2),Nt=C(lt);{var Oe=qe=>{var ve=j9(),Vt=Lt(ve),Ht=C(Vt),fi=C(Ht),mi=I(Ht,2),Wi=I(mi,2),J=I(Wi,2),de=I(Vt,2);{var Ke=yt=>{var ai=TD(),Ti=C(ai);Z(()=>q(Ti,g(E))),T(yt,ai)};K(de,yt=>{g(E)&&yt(Ke)})}var st=I(de,2);{var ft=yt=>{var ai=MD();T(yt,ai)},ct=yt=>{var ai=U9(),Ti=C(ai),Yt=I(C(Ti),2),ei=C(Yt),Li=I(Ti,2),tn=I(C(Li),2),ze=C(tn),j=I(Li,2),H=I(C(j),2),te=C(H);Ey(te,{language:"javascript",get value(){return g(f)},set value(be){k(f,be,!0)}});var ye=I(j,2),he=I(C(ye),2),Ie=C(he);Ey(Ie,{language:"javascript",get value(){return g(p)},set value(be){k(p,be,!0)}});var pe=I(ye,2),Fe=C(pe),It=C(Fe),Ge=I(It,4),dt=I(C(Ge)),ni=C(dt),F=I(Fe,2);{var ie=be=>{var et=F9(),it=C(et);no(it,()=>g(y),ge=>k(y,ge)),T(be,et)};K(F,be=>{g(_)&&be(ie)})}var He=I(pe,2);{var $e=be=>{var et=V9(),it=C(et),ge=I(C(it));{var xe=ue=>{var le=H9();T(ue,le)},Ye=ue=>{var le=W9(),bt=C(le);Z(()=>q(bt,`${g(S).length??0??""} items · rev ${g(S)._rev??""}`)),T(ue,le)};K(ge,ue=>{g(S).error?ue(xe):ue(Ye,-1)})}var Je=I(it,2);{var We=ue=>{var le=B9(),bt=C(le);Z(()=>q(bt,g(S).error)),T(ue,le)},Wt=ue=>{var le=z9(),bt=C(le);Z(xt=>q(bt,xt),[()=>JSON.stringify(g(S).result,null,2)]),T(ue,le)};K(Je,ue=>{g(S).error?ue(We):ue(Wt,-1)})}T(be,et)};K(He,be=>{g(S)&&be($e)})}Z(()=>q(ni,`${g(N)??""}${g(h)??""} on every update`)),Mi(ei,()=>g(v),be=>k(v,be)),Mi(ze,()=>g(u),be=>k(u,be)),no(It,()=>g(_),be=>k(_,be)),T(yt,ai)};K(st,yt=>{g(D)?yt(ft):yt(ct,-1)})}Z(()=>q(fi,g(h))),oe("click",mi,Nn),oe("click",Wi,pn),oe("click",J,tt),T(qe,ve)},je=qe=>{DD(qe)};K(Nt,qe=>{g(h)?qe(Oe):qe(je,-1)})}var Be=I(lt,2);{var Ot=qe=>{var ve=$9(),Vt=Lt(ve),Ht=I(Vt,2);let fi;var mi=C(Ht);D9(mi,{get currentView(){return g(Qt)},onApplyView:Ft}),Z(()=>fi=Ho(Ht,"",fi,{width:`${g(Ue)??""}px`})),oe("mousedown",Vt,jn),T(qe,ve)};K(Be,qe=>{g(Ct)&&qe(Ot)})}Z(()=>Rt=Ho(mt,"",Rt,{width:`${g(Dt)??""}px`})),oe("click",zt,()=>{k(Pe,!g(Pe)),k(De,null)}),Mi(X,()=>g(gi),qe=>k(gi,qe)),oe("mousedown",Le,At),T($,_e)};K(Dn,$=>{g(O)==="docs"?$(xn):$(Rn,-1)})}Z(()=>{an=jt(Ni,1,"svelte-rrt0o",null,an,{active:g(O)==="docs"}),ln=jt(_n,1,"svelte-rrt0o",null,ln,{active:g(O)==="views"})}),oe("mousemove",Cn,ji),oe("mouseup",Cn,en),Qn("mouseleave",Cn,en),oe("click",Ni,()=>k(O,"docs")),oe("click",_n,()=>k(O,"views")),T(o,Cn),Io()}hr(["mousemove","mouseup","click","keydown","mousedown"]);var Z9=A('<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),X9=A('<label class="svelte-1ua3isv">Pairing Code / QR <input type="text" placeholder="MT:..." class="svelte-1ua3isv"/></label>'),ND=A('<p class="err svelte-1ua3isv"> </p>'),Y9=A('<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>'),J9=A('<span class="device-name svelte-1ua3isv"> </span> <span class="device-nodeid svelte-1ua3isv"> </span>',1),Q9=A('<span class="device-name svelte-1ua3isv"> </span>'),eZ=A('<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>'),tZ=A('<li class="empty svelte-1ua3isv">No paired devices</li>'),iZ=A('<p class="info svelte-1ua3isv">Loading…</p>'),nZ=A('<p class="device-subtitle svelte-1ua3isv"> </p>'),sZ=A('<span class="ep-chip svelte-1ua3isv"> </span>'),oZ=A('<span class="attr-id svelte-1ua3isv"> </span>'),rZ=A('<button class="attr-action-btn svelte-1ua3isv"> </button>'),aZ=A('<div class="attr-actions svelte-1ua3isv"></div>'),lZ=A('<span class="cmd-sep svelte-1ua3isv">,</span>'),cZ=A('<span class="cmd-name svelte-1ua3isv"> </span><span class="cmd-id svelte-1ua3isv"> </span>',1),dZ=A('<span class="cmd-id svelte-1ua3isv"> </span>'),hZ=A("<!> <!>",1),uZ=A('<span class="cmd-list svelte-1ua3isv"></span>'),gZ=A(' <span class="cmd-id svelte-1ua3isv"> </span>',1),fZ=A('<tr class="svelte-1ua3isv"><td class="svelte-1ua3isv"><!></td><td class="svelte-1ua3isv"> </td></tr>'),pZ=A('<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>'),mZ=A('<th class="svelte-1ua3isv"> </th>'),_Z=A('<td class="svelte-1ua3isv"> </td>'),vZ=A('<tr class="svelte-1ua3isv"></tr>'),bZ=A('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),wZ=A('<tr class="svelte-1ua3isv"><td class="attr-obj-key svelte-1ua3isv"> </td><td class="attr-obj-val svelte-1ua3isv"> </td></tr>'),yZ=A('<table class="attr-obj-table svelte-1ua3isv"><tbody class="svelte-1ua3isv"></tbody></table>'),SZ=A('<a class="attr-link svelte-1ua3isv" target="_blank" rel="noopener noreferrer"> </a>'),CZ=A('<span class="attr-val svelte-1ua3isv"> </span>'),xZ=A('<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>'),LZ=A('<tr class="cluster-hdr-row svelte-1ua3isv"><td colspan="3" class="cluster-hdr-cell svelte-1ua3isv"> </td></tr> <!>',1),IZ=A('<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>'),kZ=A('<p class="no-clusters svelte-1ua3isv">No clusters</p>'),DZ=A('<details class="svelte-1ua3isv"><summary class="svelte-1ua3isv"> <span class="ep-id svelte-1ua3isv"> </span> <span class="ep-chips svelte-1ua3isv"></span></summary> <!></details>'),EZ=A('<div class="detail-hdr svelte-1ua3isv"><h2 class="svelte-1ua3isv"> </h2> <!> <p class="detail-nodeid svelte-1ua3isv"> </p></div> <!>',1),PZ=A('<p class="info svelte-1ua3isv">Select a device to view its endpoints.</p>'),TZ=A('<span class="stream-badge svelte-1ua3isv"> </span>'),MZ=A('<span class="stream-empty svelte-1ua3isv">Waiting for events…</span>'),Py=A(' <span class="e-sub svelte-1ua3isv"> </span>',1),NZ=A('<span class="e-badge e-badge-status svelte-1ua3isv">status</span> <span class="e-node svelte-1ua3isv"> <!></span> <span> </span>',1),RZ=A('<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),AZ=A('<div class="er svelte-1ua3isv"><span class="e-ts svelte-1ua3isv"> </span> <!></div>'),OZ=A('<div class="stream-body svelte-1ua3isv"><!></div>'),FZ=A('<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>');function HZ(o,e){Lo(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($,_e,mt,Rt,Pt){try{await p8($,_e,mt,Rt,Pt)}catch(zt){console.error("matter command failed",zt)}}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($,_e){const mt=n[$];return _e.map(Rt=>{const Pt=typeof Rt=="number"?Rt:Number(Rt);return{id:Pt,name:(mt==null?void 0:mt[Pt])??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($){return"0x"+$.toString(16).toUpperCase().padStart(4,"0")}let u=V(bi([])),f=bi(new Map);function p($){if($==null)return"—";if(typeof $=="boolean"||typeof $=="number")return String($);if(typeof $=="string")return $.length>50?$.slice(0,47)+"…":$;const _e=JSON.stringify($);return _e.length>60?_e.slice(0,57)+"…":_e}function v($){return $==null?"—":typeof $=="boolean"||typeof $=="number"?String($):typeof $=="string"?$:JSON.stringify($)}function _($){return $!==null&&typeof $=="object"&&!Array.isArray($)}function y($){return Array.isArray($)&&$.length>0&&$.every(_)}function S($,_e){return!!(_e==="attributeList"||Array.isArray($)&&$.length===0||_($)&&Object.keys($).length===0)}function D($){return new Date($).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}const E=500,N=20,z=32;let O=0,Y=V(bi([])),G=V(!0),fe=V(180),Se=ht(()=>{const $=Math.max(1,Math.floor((g(fe)-z)/N)+1);return g(Y).slice(0,$)});function Pe($){$.preventDefault();const _e=$.clientY,mt=g(fe);function Rt(zt){k(fe,Math.max(60,Math.min(600,mt+_e-zt.clientY)),!0)}function Pt(){document.removeEventListener("mousemove",Rt),document.removeEventListener("mouseup",Pt)}document.addEventListener("mousemove",Rt),document.addEventListener("mouseup",Pt)}let De=V(null),wt=V(!1),Dt=V(null),Te=V(!1),$t=V("passcode"),rt=V(""),Mt=V(""),ke=V(""),Ct=V(!1),Ue=V(null),at=V("");const Et="she:matter:selectedNodeId";async function Jt(){try{k(u,await YN(),!0);for(const $ of g(u))d_($.nodeId).then(_e=>{f.set($.nodeId,_e)}).catch(()=>{});if(g(u).length>0&&!g(De)){const $=localStorage.getItem(Et),_e=$&&g(u).find(mt=>mt.nodeId===$)?$:g(u)[0].nodeId;Qt(_e)}}catch{k(u,[],!0)}}async function Qt($){k(wt,!0),k(Dt,null);try{k(De,await d_($),!0),f.set($,g(De)),localStorage.setItem(Et,$)}catch(_e){k(Dt,_e instanceof Error?_e.message:String(_e),!0)}finally{k(wt,!1)}}async function Ft($){var _e;if(confirm(`Unpair device ${$}?`))try{await f8($),((_e=g(De))==null?void 0:_e.nodeId)===$&&k(De,null),await Jt()}catch(mt){k(Dt,mt instanceof Error?mt.message:String(mt),!0)}}async function At(){k(Ct,!0),k(Ue,null);try{let $;g($t)==="passcode"?($={passcode:Number(g(rt))},g(Mt)&&($={...$,discriminator:Number(g(Mt))})):$={pairingCode:g(ke).trim()},g(at).trim()&&($={...$,discoveryAddress:g(at).trim()}),await g8($),k(Te,!1),k(rt,""),k(Mt,""),k(ke,""),k(at,""),await Jt()}catch($){k(Ue,$ instanceof Error?$.message:String($),!0)}finally{k(Ct,!1)}}Wr(()=>{Jt()});const ji=Hl("matter:deviceList",$=>{if(!Array.isArray($.devices))return;const _e=$.devices;for(const mt of _e)f.has(mt.nodeId)||d_(mt.nodeId).then(Rt=>{f.set(mt.nodeId,Rt)}).catch(()=>{});k(u,_e,!0)}),en=Hl("matter:deviceStatus",$=>{if($.nodeId===void 0)return;const _e=String($.nodeId),mt=!!$.online;k(u,g(u).map(Rt=>Rt.nodeId===_e?{...Rt,online:mt}:Rt),!0),k(Y,[{id:O++,kind:"status",nodeId:_e,online:mt,ts:Date.now()},...g(Y).slice(0,E-1)],!0)}),jn=Hl("matter:attr",$=>{const _e=String($.nodeId),mt=$.endpointId,Rt=String($.clusterName),Pt=String($.attrName),zt=$.value;if(g(De)&&g(De).nodeId===_e){const Xe=g(De).endpoints.find(X=>X.endpointId===mt),R=Xe==null?void 0:Xe.clusters.find(X=>X.name===Rt);R&&(R.attrs[Pt]=zt)}const Q=f.get(_e);if(Q){const Xe=Q.endpoints.find(X=>X.endpointId===mt),R=Xe==null?void 0:Xe.clusters.find(X=>X.name===Rt);R&&(R.attrs[Pt]=zt)}k(Y,[{id:O++,kind:"attr",nodeId:_e,endpointId:mt,clusterName:Rt,attrName:Pt,value:zt,ts:$.ts??Date.now()},...g(Y).slice(0,E-1)],!0)});Qb(()=>{ji(),en(),jn()});var Ki=FZ(),Ri=C(Ki),In=C(Ri),kn=C(In),Hn=I(C(kn),2),fn=I(kn,2);{var zi=$=>{var _e=Y9(),mt=C(_e),Rt=C(mt);let Pt;var zt=I(Rt,2);let Q;var Xe=I(mt,2);{var R=Be=>{var Ot=Z9(),qe=Lt(Ot),ve=I(C(qe)),Vt=I(qe,2),Ht=I(C(Vt));Mi(ve,()=>g(rt),fi=>k(rt,fi)),Mi(Ht,()=>g(Mt),fi=>k(Mt,fi)),T(Be,Ot)},X=Be=>{var Ot=X9(),qe=I(C(Ot));Mi(qe,()=>g(ke),ve=>k(ke,ve)),T(Be,Ot)};K(Xe,Be=>{g($t)==="passcode"?Be(R):Be(X,-1)})}var Ce=I(Xe,2),Le=I(C(Ce)),lt=I(Ce,2);{var Nt=Be=>{var Ot=ND(),qe=C(Ot);Z(()=>q(qe,g(Ue))),T(Be,Ot)};K(lt,Be=>{g(Ue)&&Be(Nt)})}var Oe=I(lt,2),je=C(Oe);Z(()=>{Pt=jt(Rt,1,"svelte-1ua3isv",null,Pt,{active:g($t)==="passcode"}),Q=jt(zt,1,"svelte-1ua3isv",null,Q,{active:g($t)==="pairingCode"}),Oe.disabled=g(Ct),q(je,g(Ct)?"Commissioning…":"Commission")}),oe("click",Rt,()=>k($t,"passcode")),oe("click",zt,()=>k($t,"pairingCode")),Mi(Le,()=>g(at),Be=>k(at,Be)),oe("click",Oe,At),T($,_e)};K(fn,$=>{g(Te)&&$(zi)})}var Nn=I(fn,2),pn=C(Nn);vi(pn,17,()=>g(u),$=>$.nodeId,($,_e)=>{var mt=eZ();let Rt;var Pt=C(mt),zt=C(Pt);let Q;var Xe=I(zt,2),R=C(Xe);{var X=lt=>{var Nt=J9(),Oe=Lt(Nt),je=C(Oe),Be=I(Oe,2),Ot=C(Be);Z(()=>{q(je,g(_e).name),q(Ot,`#${g(_e).nodeId??""}`)}),T(lt,Nt)},Ce=lt=>{var Nt=Q9(),Oe=C(Nt);Z(()=>q(Oe,`Node ${g(_e).nodeId??""}`)),T(lt,Nt)};K(R,lt=>{g(_e).name?lt(X):lt(Ce,-1)})}var Le=I(Pt,2);Z(()=>{var lt;Rt=jt(mt,1,"svelte-1ua3isv",null,Rt,{selected:((lt=g(De))==null?void 0:lt.nodeId)===g(_e).nodeId}),Q=jt(zt,1,"status-dot svelte-1ua3isv",null,Q,{online:g(_e).online})}),oe("click",Pt,()=>Qt(g(_e).nodeId)),oe("click",Le,()=>Ft(g(_e).nodeId)),T($,mt)});var tt=I(pn,2);{var qt=$=>{var _e=tZ();T($,_e)};K(tt,$=>{g(u).length===0&&$(qt)})}var ui=I(In,2),gi=C(ui);{var ri=$=>{var _e=iZ();T($,_e)},mn=$=>{var _e=ND(),mt=C(_e);Z(()=>q(mt,g(Dt))),T($,_e)},Cn=$=>{var _e=EZ(),mt=Lt(_e),Rt=C(mt),Pt=C(Rt),zt=I(Rt,2);{var Q=Ce=>{var Le=nZ(),lt=C(Le);Z(()=>q(lt,g(De).subtitle)),T(Ce,Le)};K(zt,Ce=>{g(De).subtitle&&Ce(Q)})}var Xe=I(zt,2),R=C(Xe),X=I(mt,2);vi(X,17,()=>g(De).endpoints,Ce=>Ce.endpointId,(Ce,Le)=>{var lt=DZ(),Nt=C(lt),Oe=C(Nt),je=I(Oe),Be=C(je),Ot=I(je,2);vi(Ot,21,()=>g(Le).clusters,Fn,(Ht,fi)=>{var mi=sZ(),Wi=C(mi);Z(()=>q(Wi,g(fi).name)),T(Ht,mi)});var qe=I(Nt,2);{var ve=Ht=>{var fi=IZ(),mi=I(C(fi));vi(mi,21,()=>g(Le).clusters,Fn,(Wi,J)=>{var de=LZ(),Ke=Lt(de),st=C(Ke),ft=C(st),ct=I(Ke,2);vi(ct,17,()=>Object.entries(g(J).attrs),Fn,(yt,ai)=>{var Ti=ht(()=>eI(g(ai),2));let Yt=()=>g(Ti)[0],ei=()=>g(Ti)[1];var Li=ks(),tn=Lt(Li);{var ze=H=>{const te=ht(()=>{var ue;return(ue=t[g(J).name])==null?void 0:ue[Yt()]}),ye=ht(()=>(Yt()==="acceptedCommandList"||Yt()==="generatedCommandList")&&Array.isArray(ei())),he=ht(()=>{var ue;return((ue=c[g(J).name])==null?void 0:ue[Yt()])??a[Yt()]});var Ie=xZ(),pe=C(Ie),Fe=C(pe),It=C(Fe),Ge=I(Fe);{var dt=ue=>{var le=oZ(),bt=C(le);Z(xt=>q(bt,`(${xt??""})`),[()=>h(g(he))]),T(ue,le)};K(Ge,ue=>{g(he)!==void 0&&ue(dt)})}var ni=I(pe),F=C(ni);{var ie=ue=>{var le=aZ();vi(le,21,()=>g(te),Fn,(bt,xt)=>{var Si=rZ(),Ii=C(Si);Z(()=>q(Ii,g(xt).label)),oe("click",Si,()=>i(g(De).nodeId,g(Le).endpointId,g(J).name,g(xt).command,g(xt).args)),T(bt,Si)}),T(ue,le)};K(F,ue=>{g(te)&&ue(ie)})}var He=I(ni),$e=C(He);{var be=ue=>{var le=uZ();vi(le,21,()=>s(g(J).name,ei()),Fn,(bt,xt,Si)=>{var Ii=hZ(),Ee=Lt(Ii);{var Ze=ti=>{var Xt=lZ();T(ti,Xt)};K(Ee,ti=>{Si>0&&ti(Ze)})}var ot=I(Ee,2);{var Ut=ti=>{var Xt=cZ(),An=Lt(Xt),ki=C(An),Gt=I(An),Gi=C(Gt);Z(()=>{q(ki,g(xt).name),q(Gi,`(${g(xt).id??""})`)}),T(ti,Xt)},Ve=ti=>{var Xt=dZ(),An=C(Xt);Z(()=>q(An,g(xt).id)),T(ti,Xt)};K(ot,ti=>{g(xt).name?ti(Ut):ti(Ve,-1)})}T(bt,Ii)}),T(ue,le)},et=ue=>{var le=pZ(),bt=I(C(le));vi(bt,21,ei,Fn,(xt,Si)=>{const Ii=ht(()=>g(Si)),Ee=ht(()=>g(Ii).deviceType),Ze=ht(()=>r[g(Ee)]);var ot=fZ(),Ut=C(ot),Ve=C(Ut);{var ti=Gt=>{var Gi=gZ(),$i=Lt(Gi),is=I($i),us=C(is);Z($n=>{q($i,`${g(Ze)??""} `),q(us,`(${$n??""})`)},[()=>h(g(Ee))]),T(Gt,Gi)},Xt=Gt=>{var Gi=Tr();Z($i=>q(Gi,$i),[()=>h(g(Ee))]),T(Gt,Gi)};K(Ve,Gt=>{g(Ze)?Gt(ti):Gt(Xt,-1)})}var An=I(Ut),ki=C(An);Z(Gt=>q(ki,Gt),[()=>v(g(Ii).revision)]),T(xt,ot)}),T(ue,le)},it=ht(()=>Yt()==="deviceTypeList"&&Array.isArray(ei())),ge=ue=>{const le=ht(()=>[...new Set(ei().flatMap(Ee=>Object.keys(Ee)))]);var bt=bZ(),xt=C(bt),Si=C(xt);vi(Si,21,()=>g(le),Fn,(Ee,Ze)=>{var ot=mZ(),Ut=C(ot);Z(()=>q(Ut,g(Ze))),T(Ee,ot)});var Ii=I(xt);vi(Ii,21,ei,Fn,(Ee,Ze)=>{var ot=vZ();vi(ot,21,()=>g(le),Fn,(Ut,Ve)=>{var ti=_Z(),Xt=C(ti);Z(An=>q(Xt,An),[()=>v(g(Ze)[g(Ve)])]),T(Ut,ti)}),T(Ee,ot)}),T(ue,bt)},xe=ht(()=>y(ei())),Ye=ue=>{var le=yZ(),bt=C(le);vi(bt,21,()=>Object.entries(ei()),Fn,(xt,Si)=>{var Ii=ht(()=>eI(g(Si),2));let Ee=()=>g(Ii)[0],Ze=()=>g(Ii)[1];var ot=wZ(),Ut=C(ot),Ve=C(Ut),ti=I(Ut),Xt=C(ti);Z(An=>{q(Ve,Ee()),q(Xt,An)},[()=>v(Ze())]),T(xt,ot)}),T(ue,le)},Je=ht(()=>_(ei())),We=ue=>{var le=SZ(),bt=C(le);Z(()=>{Bn(le,"href",ei()),q(bt,ei())}),T(ue,le)},Wt=ue=>{var le=CZ(),bt=C(le);Z(xt=>q(bt,xt),[()=>v(ei())]),T(ue,le)};K($e,ue=>{g(ye)?ue(be):g(it)?ue(et,1):g(xe)?ue(ge,2):g(Je)?ue(Ye,3):(Yt()==="productUrl"||Yt()==="productURL")&&typeof ei()=="string"?ue(We,4):ue(Wt,-1)})}Z(()=>{Bn(pe,"title",Yt()),q(It,Yt())}),T(H,Ie)},j=ht(()=>!S(ei(),Yt()));K(tn,H=>{g(j)&&H(ze)})}T(yt,Li)}),Z(()=>q(ft,g(J).name)),T(Wi,de)}),T(Ht,fi)},Vt=Ht=>{var fi=kZ();T(Ht,fi)};K(qe,Ht=>{g(Le).clusters.length>0?Ht(ve):Ht(Vt,-1)})}Z(()=>{q(Oe,`${g(Le).name??`Endpoint ${g(Le).endpointId}`??""} `),q(Be,`ep${g(Le).endpointId??""}`)}),T(Ce,lt)}),Z(()=>{q(Pt,g(De).name??`Node ${g(De).nodeId}`),q(R,`Node ID: ${g(De).nodeId??""}`)}),T($,_e)},sn=$=>{var _e=PZ();T($,_e)};K(gi,$=>{g(wt)?$(ri):g(Dt)?$(mn,1):g(De)?$(Cn,2):$(sn,-1)})}var Ni=I(Ri,2),an=C(Ni),_n=I(an,2),ln=I(C(_n),2);{var cn=$=>{var _e=TZ(),mt=C(_e);Z(()=>q(mt,g(Y).length)),T($,_e)};K(ln,$=>{!g(G)&&g(Y).length>0&&$(cn)})}var vn=I(ln,2),Dn=C(vn),xn=I(_n,2);{var Rn=$=>{var _e=OZ(),mt=C(_e);{var Rt=zt=>{var Q=MZ();T(zt,Q)},Pt=zt=>{var Q=ks(),Xe=Lt(Q);vi(Xe,17,()=>g(Se),R=>R.id,(R,X)=>{const Ce=ht(()=>{var ve,Vt;return((ve=f.get(g(X).nodeId))==null?void 0:ve.name)??((Vt=g(u).find(Ht=>Ht.nodeId===g(X).nodeId))==null?void 0:Vt.name)??null}),Le=ht(()=>{var ve,Vt;return g(X).endpointId!==void 0?((Vt=(ve=f.get(g(X).nodeId))==null?void 0:ve.endpoints.find(Ht=>Ht.endpointId===g(X).endpointId))==null?void 0:Vt.name)??null:null}),lt=ht(()=>g(X).attrName??g(X).clusterName);var Nt=AZ(),Oe=C(Nt),je=C(Oe),Be=I(Oe,2);{var Ot=ve=>{var Vt=NZ(),Ht=I(Lt(Vt),2),fi=C(Ht),mi=I(fi);{var Wi=st=>{var ft=Py(),ct=I(Lt(ft)),yt=C(ct);Z(()=>q(yt,`(#${g(X).nodeId??""})`)),T(st,ft)};K(mi,st=>{g(Ce)&&st(Wi)})}var J=I(Ht,2);let de;var Ke=C(J);Z(()=>{q(fi,g(Ce)??`#${g(X).nodeId}`),de=jt(J,1,"e-val svelte-1ua3isv",null,de,{"e-online":g(X).online,"e-offline":!g(X).online}),q(Ke,g(X).online?"online":"offline")}),T(ve,Vt)},qe=ve=>{var Vt=RZ(),Ht=I(Lt(Vt),2),fi=C(Ht),mi=I(fi);{var Wi=ei=>{var Li=Py(),tn=I(Lt(Li)),ze=C(tn);Z(()=>q(ze,`(#${g(X).nodeId??""})`)),T(ei,Li)};K(mi,ei=>{g(Ce)&&ei(Wi)})}var J=I(Ht,2),de=C(J),Ke=I(de);{var st=ei=>{var Li=Py(),tn=I(Lt(Li)),ze=C(tn);Z(()=>q(ze,`(ep ${g(X).endpointId??""})`)),T(ei,Li)};K(Ke,ei=>{g(Le)&&ei(st)})}var ft=I(J,2),ct=C(ft),yt=I(ft,2),ai=C(yt),Ti=I(yt,2),Yt=C(Ti);Z(ei=>{q(fi,g(Ce)??`#${g(X).nodeId}`),q(de,g(Le)??`ep${g(X).endpointId}`),q(ct,g(X).clusterName),q(ai,g(lt)),q(Yt,ei)},[()=>p(g(X).value)]),T(ve,Vt)};K(Be,ve=>{g(X).kind==="status"?ve(Ot):ve(qe,-1)})}Z(ve=>q(je,ve),[()=>D(g(X).ts)]),T(R,Nt)}),T(zt,Q)};K(mt,zt=>{g(Se).length===0?zt(Rt):zt(Pt,-1)})}T($,_e)};K(xn,$=>{g(G)&&$(Rn)})}Z(()=>{Ho(Ni,g(G)?`height: ${g(fe)}px;`:""),q(Dn,g(G)?"▾":"▸")}),oe("click",Hn,()=>k(Te,!g(Te))),oe("mousedown",an,Pe),oe("click",vn,()=>{k(G,!g(G))}),T(o,Ki),Io()}hr(["click","mousedown"]);var WZ=A("<button>›</button>"),BZ=A('<span class="chev-ph svelte-1vejtrc"></span>'),zZ=A('<span class="tv svelte-1vejtrc"> </span> <span class="tt svelte-1vejtrc"> </span>',1),VZ=A('<div class="tc svelte-1vejtrc"></div>'),UZ=A('<div class="tn svelte-1vejtrc"><div><!> <span class="seg svelte-1vejtrc"> </span> <!></div> <!></div>'),jZ=A("<option></option>"),$Z=A('<span class="pub-ok svelte-1vejtrc">✓</span>'),qZ=A('<span class="pub-err svelte-1vejtrc"> </span>'),KZ=A('<div class="info svelte-1vejtrc">Loading…</div>'),GZ=A('<div class="info err svelte-1vejtrc"> </div>'),ZZ=A('<div class="info svelte-1vejtrc">No topics match.</div>'),XZ=A('<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>'),YZ=A('<div class="vs svelte-1vejtrc"><div><div class="vrows-abs svelte-1vejtrc"></div></div></div>'),JZ=A('<div class="info svelte-1vejtrc">No topics yet.</div>'),QZ=A('<div class="tree-wrap svelte-1vejtrc"><!></div>'),eX=A('<span class="stream-badge"> </span>'),tX=A('<span class="stream-empty svelte-1vejtrc">Waiting for messages…</span>'),iX=A('<span class="s-ret svelte-1vejtrc" title="retained snapshot">⊛</span>'),nX=A('<div><span class="s-ts svelte-1vejtrc"> </span> <!> <span class="s-topic svelte-1vejtrc"> </span> <span class="s-val svelte-1vejtrc"> </span></div>'),sX=A('<div class="stream-body svelte-1vejtrc"><!></div>'),oX=A('<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),rX=A('<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>'),aX=A('<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),lX=A('<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 cX(o,e){Lo(e,!0);const t=(J,de=Gb)=>{const Ke=ht(()=>g(f).has(de().path)),st=ht(()=>g(a)>=0&&de().children.size>0),ft=ht(()=>g(a)>=0&&de().isLeaf&&!n.has(de().path));var ct=UZ(),yt=C(ct);let ai;var Ti=C(yt);{var Yt=he=>{var Ie=WZ();let pe;Z(()=>{pe=jt(Ie,1,"chev svelte-1vejtrc",null,pe,{open:g(Ke)}),Bn(Ie,"aria-label",g(Ke)?"Collapse":"Expand")}),oe("click",Ie,()=>p(de().path)),T(he,Ie)},ei=he=>{var Ie=BZ();T(he,Ie)};K(Ti,he=>{g(st)?he(Yt):he(ei,-1)})}var Li=I(Ti,2),tn=C(Li),ze=I(Li,2);{var j=he=>{var Ie=zZ(),pe=Lt(Ie),Fe=C(pe),It=I(pe,2),Ge=C(It);Z((dt,ni,F)=>{Bn(pe,"title",dt),q(Fe,ni),q(Ge,F)},[()=>{var dt;return kn((dt=zi(de().path))==null?void 0:dt.val)},()=>{var dt;return kn((dt=zi(de().path))==null?void 0:dt.val)},()=>{var dt;return((dt=zi(de().path))==null?void 0:dt.ts)!=null?Hn(zi(de().path).ts):""}]),T(he,Ie)},H=ht(()=>de().isLeaf&&i.has(de().path));K(ze,he=>{g(H)&&he(j)})}var te=I(yt,2);{var ye=he=>{var Ie=VZ();vi(Ie,21,()=>[...de().children.values()].sort((pe,Fe)=>pe.seg.localeCompare(Fe.seg)),pe=>pe.path,(pe,Fe)=>{t(pe,()=>g(Fe))}),T(he,Ie)};K(te,he=>{g(st)&&g(Ke)&&he(ye)})}Z(()=>{ai=jt(yt,1,"tr svelte-1vejtrc",null,ai,{stale:g(ft)}),q(tn,de().seg)}),oe("click",yt,()=>{k(wt,de().path+"/#")}),oe("contextmenu",yt,he=>{he.preventDefault(),k(at,{x:he.clientX,y:he.clientY,topic:de().path},!0)}),T(J,ct)},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 J of s)u(J);s.clear(),nI(a)}))}const h=new Map;function u(J){const de=J.split("/");let Ke=h,st="";for(let ft=0;ft<de.length;ft++){const ct=de[ft];st=ft===0?ct:`${st}/${ct}`,Ke.has(ct)||Ke.set(ct,{seg:ct,path:st,children:new Map,isLeaf:!1});const yt=Ke.get(ct);ft===de.length-1&&(yt.isLeaf=!0),Ke=yt.children}}let f=V(bi(new Set));function p(J){const de=new Set(g(f));de.has(J)?de.delete(J):de.add(J),k(f,de,!0)}let v=V("");const _=24,y=5;let S=V(0),D=V(300),E=ht(()=>{if(g(a),!g(v))return[];const J=g(v).toLowerCase().split(/\s+/).filter(Boolean),de=[];for(const[Ke,st]of i){const ft=Ke.toLowerCase();J.every(ct=>ft.includes(ct))&&de.push({topic:Ke,...st})}return de.sort((Ke,st)=>Ke.topic.localeCompare(st.topic))}),N=ht(()=>{const J=g(E).length,de=Math.max(0,Math.floor(g(S)/_)-y),Ke=Math.min(J,Math.ceil((g(S)+g(D))/_)+y);return{start:de,end:Ke,totalH:J*_,top:de*_}});const z=1e3,O=200,Y=20,G=36;let fe=0,Se=V(bi([])),Pe=V(bi([])),De=V(!0),wt=V("#"),Dt=V(200);Pn(()=>{const J=g(wt).trim(),de=gl(()=>g(Se)),Ke=!J||J==="#"?de.slice(0,O):de.filter(st=>Te(J,st.topic)).slice(0,O);if(J&&J!=="#"){const st=new Set(Ke.map(ct=>ct.topic)),ft=[];for(const[ct,yt]of i)st.has(ct)||Te(J,ct)&&ft.push({id:-(ft.length+1),topic:ct,val:yt.val,ts:yt.ts,retained:!0});ft.sort((ct,yt)=>ct.topic.localeCompare(yt.topic)),k(Pe,[...Ke,...ft],!0)}else k(Pe,Ke,!0)});function Te(J,de){if(J==="#")return!0;const Ke=J.split("/"),st=de.split("/");for(let ft=0;ft<Ke.length;ft++){if(Ke[ft]==="#")return!0;if(ft>=st.length||Ke[ft]!=="+"&&Ke[ft]!==st[ft])return!1}return Ke.length===st.length}function $t(J){J.preventDefault();const de=J.clientY,Ke=g(Dt);function st(ct){k(Dt,Math.max(60,Math.min(800,Ke+de-ct.clientY)),!0)}function ft(){document.removeEventListener("mousemove",st),document.removeEventListener("mouseup",ft)}document.addEventListener("mousemove",st),document.addEventListener("mouseup",ft)}let rt=ht(()=>{const J=Math.max(1,Math.floor((g(Dt)-G)/Y)+1);return g(Pe).slice(0,J)}),Mt=V(!0),ke=V(null);async function Ct(){k(Mt,!0),k(ke,null);try{const J=await JN();for(const de of J)i.set(de.topic,{val:de.val,ts:de.ts}),u(de.topic)}catch(J){k(ke,J instanceof Error?J.message:String(J),!0)}finally{k(Mt,!1),nI(a)}}const Ue=Hl("mqtt",J=>{const{topic:de,val:Ke,ts:st}=J;i.set(de,{val:Ke,ts:st}),n.add(de),s.add(de),c();const ft={id:fe++,topic:de,val:Ke,ts:st};k(Se,[ft,...g(Se).slice(0,z-1)],!0);const ct=g(wt).trim();(!ct||ct==="#"||Te(ct,de))&&k(Pe,[ft,...g(Pe).filter(yt=>!(yt.retained&&yt.topic===de)).slice(0,O-1)],!0)});let at=V(null),Et=V(null);async function Jt(J,de){const Ke=[J];if(de){const st=J+"/";for(const ft of i.keys())ft.startsWith(st)&&Ke.push(ft)}for(const st of Ke)await nD(st,"",!0,0)}let Qt=ht(()=>(g(a),[...i.keys()].sort())),Ft=V(""),At=V(""),ji=V(!1),en=V(0),jn=V(!1),Ki=V(null),Ri=V(!1);async function In(){if(g(Ft)){k(jn,!0),k(Ki,null),k(Ri,!1);try{await nD(g(Ft),g(At),g(ji),g(en)),k(Ri,!0),setTimeout(()=>{k(Ri,!1)},2e3)}catch(J){k(Ki,J instanceof Error?J.message:String(J),!0)}finally{k(jn,!1)}}}function kn(J){return J==null?"":typeof J=="object"?JSON.stringify(J):String(J)}function Hn(J){return new Date(J).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function fn(J){return new Date(J).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function zi(J){return g(a),i.get(J)}let Nn=ht(()=>(g(a),[...h.values()].sort((J,de)=>J.seg.localeCompare(de.seg)))),pn=ht(()=>(g(a),i.size));Wr(Ct),Qb(()=>{Ue(),r!==null&&cancelAnimationFrame(r)});var tt=lX(),qt=I(C(tt),2),ui=C(qt),gi=C(ui),ri=I(gi,2);vi(ri,20,()=>g(Qt),J=>J,(J,de)=>{var Ke=jZ(),st={};Z(()=>{st!==(st=de)&&(Ke.value=(Ke.__value=de)??"")}),T(J,Ke)});var mn=I(ri,2),Cn=I(mn,2),sn=C(Cn),Ni=I(Cn,2),an=C(Ni);an.value=an.__value=0;var _n=I(an);_n.value=_n.__value=1;var ln=I(_n);ln.value=ln.__value=2;var cn=I(Ni,2),vn=I(cn,2);{var Dn=J=>{var de=$Z();T(J,de)};K(vn,J=>{g(Ri)&&J(Dn)})}var xn=I(vn,2);{var Rn=J=>{var de=qZ(),Ke=C(de);Z(()=>q(Ke,g(Ki))),T(J,de)};K(xn,J=>{g(Ki)&&J(Rn)})}var $=I(ui,2),_e=C($),mt=I(_e,2),Rt=C(mt);{var Pt=J=>{var de=Tr();Z(()=>q(de,`${g(E).length??""} /`)),T(J,de)};K(Rt,J=>{g(v)&&J(Pt)})}var zt=I(Rt),Q=I($,2);{var Xe=J=>{var de=KZ();T(J,de)},R=J=>{var de=GZ(),Ke=C(de);Z(()=>q(Ke,g(ke))),T(J,de)},X=J=>{var de=ks(),Ke=Lt(de);{var st=ct=>{var yt=ZZ();T(ct,yt)},ft=ct=>{var yt=YZ(),ai=C(yt),Ti=C(ai);vi(Ti,21,()=>g(E).slice(g(N).start,g(N).end),Yt=>Yt.topic,(Yt,ei)=>{var Li=XZ(),tn=C(Li),ze=C(tn),j=I(tn,2),H=C(j),te=I(j,2),ye=C(te);Z((he,Ie,pe)=>{q(ze,g(ei).topic),Bn(j,"title",he),q(H,Ie),q(ye,pe)},[()=>kn(g(ei).val),()=>kn(g(ei).val),()=>Hn(g(ei).ts)]),T(Yt,Li)}),Z(()=>{Ho(ai,`height: ${g(N).totalH??""}px; position: relative;`),Ho(Ti,`top: ${g(N).top??""}px;`)}),Qn("scroll",yt,Yt=>{k(S,Yt.currentTarget.scrollTop,!0)}),bW(yt,"clientHeight",Yt=>k(D,Yt)),T(ct,yt)};K(Ke,ct=>{g(E).length===0?ct(st):ct(ft,-1)})}T(J,de)},Ce=J=>{var de=QZ(),Ke=C(de);{var st=ct=>{var yt=JZ();T(ct,yt)},ft=ct=>{var yt=ks(),ai=Lt(yt);vi(ai,17,()=>g(Nn),Ti=>Ti.path,(Ti,Yt)=>{t(Ti,()=>g(Yt))}),T(ct,yt)};K(Ke,ct=>{g(Nn).length===0?ct(st):ct(ft,-1)})}T(J,de)};K(Q,J=>{g(Mt)?J(Xe):g(ke)?J(R,1):g(v)?J(X,2):J(Ce,-1)})}var Le=I(qt,2),lt=C(Le),Nt=I(lt,2),Oe=C(Nt),je=I(Oe,2);{var Be=J=>{var de=eX(),Ke=C(de);Z(()=>q(Ke,g(Pe).length)),T(J,de)};K(je,J=>{!g(De)&&g(Pe).length>0&&J(Be)})}var Ot=I(je,2),qe=C(Ot),ve=I(Nt,2);{var Vt=J=>{var de=sX(),Ke=C(de);{var st=ct=>{var yt=tX();T(ct,yt)},ft=ct=>{var yt=ks(),ai=Lt(yt);vi(ai,17,()=>g(rt),Ti=>Ti.id,(Ti,Yt)=>{var ei=nX();let Li;var tn=C(ei),ze=C(tn),j=I(tn,2);{var H=pe=>{var Fe=iX();T(pe,Fe)};K(j,pe=>{g(Yt).retained&&pe(H)})}var te=I(j,2),ye=C(te),he=I(te,2),Ie=C(he);Z((pe,Fe,It)=>{Li=jt(ei,1,"sr svelte-1vejtrc",null,Li,{retained:g(Yt).retained}),q(ze,pe),q(ye,g(Yt).topic),Bn(he,"title",Fe),q(Ie,It)},[()=>fn(g(Yt).ts),()=>kn(g(Yt).val),()=>kn(g(Yt).val)]),T(Ti,ei)}),T(ct,yt)};K(Ke,ct=>{g(rt).length===0?ct(st):ct(ft,-1)})}T(J,de)};K(ve,J=>{g(De)&&J(Vt)})}var Ht=I(Le,2);{var fi=J=>{var de=oX(),Ke=Lt(de),st=I(Ke,2);let ft;var ct=C(st),yt=I(ct,2);Z(()=>ft=Ho(st,"",ft,{left:`${g(at).x??""}px`,top:`${g(at).y??""}px`})),oe("click",Ke,()=>k(at,null)),oe("contextmenu",Ke,ai=>{ai.preventDefault(),k(at,null)}),oe("click",ct,()=>{navigator.clipboard.writeText(g(at).topic),k(at,null)}),oe("click",yt,()=>{const ai=g(at).topic,Ti=ai+"/",Yt=[...i.keys()].some(ei=>ei.startsWith(Ti));k(Et,{topic:ai,hasChildren:Yt,recursive:!1},!0),k(at,null)}),T(J,de)};K(Ht,J=>{g(at)&&J(fi)})}var mi=I(Ht,2);{var Wi=J=>{var de=aX(),Ke=Lt(de),st=I(Ke,2),ft=I(C(st),2),ct=C(ft),yt=I(C(ct)),ai=C(yt),Ti=I(ct,2);{var Yt=ze=>{var j=rX(),H=C(j);no(H,()=>g(Et).recursive,te=>g(Et).recursive=te),T(ze,j)};K(Ti,ze=>{g(Et).hasChildren&&ze(Yt)})}var ei=I(ft,2),Li=C(ei),tn=I(Li,2);Z(()=>q(ai,g(Et).topic)),oe("click",Ke,()=>k(Et,null)),oe("click",Li,()=>k(Et,null)),oe("click",tn,()=>{const{topic:ze,recursive:j}=g(Et);k(Et,null),Jt(ze,j)}),T(J,de)};K(mi,J=>{g(Et)&&J(Wi)})}Z(()=>{cn.disabled=g(jn)||!g(Ft),q(zt,` ${g(pn)??""}`),Ho(Le,g(De)?`height: ${g(Dt)}px;`:""),q(qe,g(De)?"▾":"▸")}),Mi(gi,()=>g(Ft),J=>k(Ft,J)),Mi(mn,()=>g(At),J=>k(At,J)),no(sn,()=>g(ji),J=>k(ji,J)),za(Ni,()=>g(en),J=>k(en,J)),oe("click",cn,In),Mi(_e,()=>g(v),J=>k(v,J)),oe("mousedown",lt,$t),Mi(Oe,()=>g(wt),J=>k(wt,J)),oe("click",Ot,()=>{k(De,!g(De))}),T(o,tt),Io()}hr(["click","contextmenu","mousedown"]);var dX=A('<div class="restart-banner svelte-twakcj">⚠ Package changes require a daemon restart to take effect. Use the ↺ button in the topbar.</div>'),hX=A('<div class="err svelte-twakcj"> </div>'),uX=A('<span class="pane-count pane-count--warn svelte-twakcj"> </span>'),gX=A('<p class="empty svelte-twakcj">No packages installed.</p>'),fX=A('<p class="empty svelte-twakcj">No match.</p>'),pX=A('<span class="dep-latest svelte-twakcj"> </span>'),mX=nT('<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>'),_X=nT('<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>'),vX=A('<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>'),bX=A('<span class="result-desc svelte-twakcj"> </span>'),wX=A('<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>'),yX=A('<div class="results-list svelte-twakcj"></div>'),SX=A('<pre class="npm-output svelte-twakcj"> </pre>'),CX=A(`<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>`),xX=A('<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 LX(o,e){Lo(e,!0);let t=V(bi([])),i=V(""),n=V(bi({})),s=V(!1),r=V(""),a=V(bi([])),c=V(!1),h=V(!1),u=V(""),f=V(""),p=bi({});const v=ht(()=>g(i).trim()?g(t).filter(tt=>tt.name.toLowerCase().includes(g(i).toLowerCase())):g(t)),_=ht(()=>Object.keys(g(n)).length);Wr(async()=>{await Promise.all([y(),S()])});async function y(){try{k(t,await n8(),!0),k(u,"")}catch(tt){k(u,tt.message,!0)}}async function S(){try{k(n,await l8(),!0)}catch{}}async function D(){k(s,!0);try{k(n,await c8(),!0)}catch{}finally{k(s,!1)}}async function E(){const tt=g(r).trim();if(!tt){k(a,[],!0);return}k(h,!0),k(u,"");try{k(a,await s8(tt),!0)}catch(qt){k(u,qt.message,!0)}finally{k(h,!1)}}async function N(tt,qt){p[tt]=!0,k(u,""),k(f,"");try{const ui=await o8(tt,qt);k(f,ui.stdout||ui.stderr||"Done.",!0),k(c,!0),await y()}catch(ui){k(u,ui.message,!0)}finally{p[tt]=!1}}async function z(tt){p[tt]=!0,k(u,""),k(f,"");try{const qt=await r8(tt);k(f,qt.stdout||qt.stderr||"Done.",!0),k(c,!0);const ui={...g(n)};delete ui[tt],k(n,ui,!0),await y()}catch(qt){k(u,qt.message,!0)}finally{p[tt]=!1}}async function O(tt){p[tt]=!0,k(u,""),k(f,"");try{const qt=await a8(tt);k(f,qt.stdout||qt.stderr||"Done.",!0),k(c,!0);const ui={...g(n)};delete ui[tt],k(n,ui,!0),await y()}catch(qt){k(u,qt.message,!0)}finally{p[tt]=!1}}var Y=xX(),G=C(Y);{var fe=tt=>{var qt=dX();T(tt,qt)};K(G,tt=>{g(c)&&tt(fe)})}var Se=I(G,2);{var Pe=tt=>{var qt=hX(),ui=C(qt);Z(()=>q(ui,g(u))),T(tt,qt)};K(Se,tt=>{g(u)&&tt(Pe)})}var De=I(Se,2),wt=C(De),Dt=C(wt),Te=I(C(Dt),2),$t=C(Te),rt=I(Te,2);{var Mt=tt=>{var qt=uX(),ui=C(qt);Z(()=>q(ui,`${g(_)??""} outdated`)),T(tt,qt)};K(rt,tt=>{g(_)>0&&tt(Mt)})}var ke=I(rt,2),Ct=C(ke);let Ue;var at=I(Dt,2),Et=C(at),Jt=I(at,2),Qt=C(Jt);{var Ft=tt=>{var qt=gX();T(tt,qt)},At=tt=>{var qt=fX();T(tt,qt)},ji=tt=>{var qt=ks(),ui=Lt(qt);vi(ui,17,()=>g(v),gi=>gi.name,(gi,ri)=>{var mn=vX();let Cn;var sn=C(mn),Ni=C(sn),an=C(Ni),_n=I(Ni,2),ln=C(_n),cn=I(_n,2);{var vn=Pt=>{var zt=pX(),Q=C(zt);Z(()=>q(Q,`→ v${g(n)[g(ri).name].latest??""}`)),T(Pt,zt)};K(cn,Pt=>{g(n)[g(ri).name]&&Pt(vn)})}var Dn=I(sn,2),xn=C(Dn);let Rn;var $=C(xn);{var _e=Pt=>{var zt=mX();T(Pt,zt)},mt=Pt=>{var zt=_X();T(Pt,zt)};K($,Pt=>{p[g(ri).name]?Pt(_e):Pt(mt,-1)})}var Rt=I(xn,2);Z(()=>{Cn=jt(mn,1,"dep-row svelte-twakcj",null,Cn,{"dep-busy":!!p[g(ri).name]}),Bn(Ni,"href",g(ri).url??`https://www.npmjs.com/package/${g(ri).name}`),q(an,g(ri).name),q(ln,g(ri).installedVersion??g(ri).version),Rn=jt(xn,1,"icon-btn svelte-twakcj",null,Rn,{"icon-btn--update":!!g(n)[g(ri).name]}),xn.disabled=!!p[g(ri).name],Bn(xn,"title",g(n)[g(ri).name]?`Update to v${g(n)[g(ri).name].latest}`:"Update to latest"),Rt.disabled=!!p[g(ri).name]}),oe("click",xn,()=>O(g(ri).name)),oe("click",Rt,()=>z(g(ri).name)),T(gi,mn)}),T(tt,qt)};K(Qt,tt=>{g(t).length===0?tt(Ft):g(v).length===0?tt(At,1):tt(ji,-1)})}var en=I(wt,2),jn=I(C(en),2),Ki=C(jn),Ri=I(Ki,2),In=C(Ri),kn=I(jn,2);{var Hn=tt=>{var qt=yX();vi(qt,21,()=>g(a),ui=>ui.name,(ui,gi)=>{var ri=wX(),mn=C(ri),Cn=C(mn),sn=C(Cn),Ni=I(Cn,2),an=C(Ni),_n=I(Ni,2);{var ln=Dn=>{var xn=bX(),Rn=C(xn);Z(()=>q(Rn,g(gi).description)),T(Dn,xn)};K(_n,Dn=>{g(gi).description&&Dn(ln)})}var cn=I(mn,2),vn=C(cn);Z(()=>{Bn(Cn,"href",g(gi).url??`https://www.npmjs.com/package/${g(gi).name}`),q(sn,g(gi).name),q(an,g(gi).version),cn.disabled=!!p[g(gi).name],q(vn,p[g(gi).name]?"Installing…":"Install")}),oe("click",cn,()=>N(g(gi).name)),T(ui,ri)}),T(tt,qt)};K(kn,tt=>{g(a).length>0&&tt(Hn)})}var fn=I(kn,2);{var zi=tt=>{var qt=SX(),ui=C(qt);Z(()=>q(ui,g(f))),T(tt,qt)};K(fn,tt=>{g(f)&&tt(zi)})}var Nn=I(fn,2);{var pn=tt=>{var qt=CX();T(tt,qt)};K(Nn,tt=>{!g(a).length&&!g(f)&&tt(pn)})}Z(()=>{q($t,g(t).length),ke.disabled=g(s),Ue=jt(Ct,0,"svelte-twakcj",null,Ue,{spinning:g(s)}),Ri.disabled=g(h),q(In,g(h)?"Searching…":"Search")}),oe("click",ke,D),Mi(Et,()=>g(i),tt=>k(i,tt)),oe("keydown",Ki,tt=>tt.key==="Enter"&&E()),Mi(Ki,()=>g(r),tt=>k(r,tt)),oe("click",Ri,E),T(o,Y),Io()}hr(["click","keydown"]);var IX=A('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),kX=A('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),DX=A('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),EX=A('<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>'),PX=A('<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>'),TX=A('<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),MX=A('<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),NX=A('<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>'),RX=A('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),AX=A('<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>'),OX=A('<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>'),FX=A('<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>'),HX=A('<div class="login-error svelte-1n46o8q"> </div>'),WX=A('<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>'),BX=A('<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>'),zX=A("<!> <!> <!>",1);function VX(o,e){Lo(e,!0);const t=["scripts","mqtt","matter","db","logs","config","packages"];function i(){const Te=location.hash.slice(1);return t.includes(Te)?Te:"scripts"}let n=V(bi(i())),s=V(null),r=V(!1),a=V(!1),c=V(!1),h=V(!1),u=V("none"),f=V(""),p=V(!1),v=V(""),_=V(""),y=V(!1),S=V(!1);H7(()=>{k(p,!0)});async function D(){k(_,""),k(y,!0);try{await z7(g(v)),k(v,""),k(p,!1)}catch(Te){k(_,Te.message??"Login failed",!0)}finally{k(y,!1)}}async function E(){if(g(u)==="proxy"&&g(f)){window.location.href=g(f);return}await V7(),k(p,!0)}async function N(){if(confirm("Restart the she daemon? The page will reload after a moment."))try{await K7(),setTimeout(()=>location.reload(),2500)}catch{}}async function z(){k(c,!0);try{const Te=await Z7();g(s)&&k(s,{...g(s),latestVersion:Te.latestVersion??void 0},!0)}catch{}finally{k(c,!1)}}async function O(){var rt;if(!confirm(`Update to v${(rt=g(s))==null?void 0:rt.latestVersion}? The daemon will restart after the update completes.`))return;k(a,!1),k(h,!0);try{await G7()}catch{}let Te=!1;const $t=Date.now()+18e4;for(;Date.now()<$t;){await new Promise(Mt=>setTimeout(Mt,2e3));try{if(await Kx(),Te){location.reload();return}}catch{Te=!0}}location.reload()}function Y(Te){k(n,Te,!0),location.hash=Te}Wr(async()=>{location.hash||(location.hash=g(n));const Te=()=>{k(n,i(),!0)};window.addEventListener("hashchange",Te);try{const Mt=await B7();k(u,Mt.mode,!0),k(f,Mt.proxyLogoutUrl??"",!0),g(u)==="password"&&(await fetch("/she/scripts")).status===401&&k(p,!0)}catch{}k(S,!0);async function $t(){try{k(s,await Kx(),!0)}catch{}}$t();const rt=setInterval($t,5e3);return()=>{window.removeEventListener("hashchange",Te),clearInterval(rt)}});var G=zX();Qn("click",OP,()=>{g(r)&&k(r,!1),g(a)&&k(a,!1)});var fe=Lt(G);{var Se=Te=>{var $t=FX(),rt=C($t),Mt=I(C(rt),2);let ke;var Ct=I(Mt,2);let Ue;var at=I(Ct,2);let Et;var Jt=I(at,2);let Qt;var Ft=I(Jt,2);let At;var ji=I(Ft,2);let en;var jn=I(ji,4),Ki=I(C(jn),2),Ri=C(Ki),In=C(Ri);In.nodeValue="v0.23.1 ";var kn=I(In);{var Hn=Le=>{var lt=IX();T(Le,lt)};K(kn,Le=>{var lt;(lt=g(s))!=null&<.latestVersion&&Le(Hn)})}var fn=I(Ri,2);{var zi=Le=>{var lt=PX(),Nt=C(lt),Oe=I(C(Nt));Oe.textContent="v0.23.1";var je=I(Oe,2);{var Be=J=>{var de=kX(),Ke=I(Lt(de)),st=C(Ke);Z(()=>q(st,`v${g(s).latestVersion??""}`)),T(J,de)},Ot=J=>{var de=DX();T(J,de)};K(je,J=>{var de;(de=g(s))!=null&&de.latestVersion?J(Be):J(Ot,-1)})}var qe=I(Nt,2),ve=C(qe);{var Vt=J=>{var de=EX(),Ke=I(C(de));Z(()=>q(Ke,` Update to v${g(s).latestVersion??""}`)),oe("click",de,O),T(J,de)};K(ve,J=>{var de;(de=g(s))!=null&&de.latestVersion&&J(Vt)})}var Ht=I(ve,2),fi=C(Ht);let mi;var Wi=I(fi);Z(()=>{Ht.disabled=g(c),mi=jt(fi,0,"svelte-1n46o8q",null,mi,{spinning:g(c)}),q(Wi,` ${g(c)?"Checking…":"Check for updates"}`)}),oe("click",lt,J=>J.stopPropagation()),oe("click",Ht,z),T(Le,lt)};K(fn,Le=>{g(a)&&Le(zi)})}var Nn=I(Ki,2),pn=C(Nn),tt=I(pn,2);{var qt=Le=>{var lt=AX(),Nt=C(lt);{var Oe=qe=>{var ve=NX(),Vt=I(C(ve)),Ht=C(Vt),fi=I(Vt,3),mi=C(fi),Wi=I(fi,3),J=C(Wi),de=I(Wi,2);{var Ke=Li=>{var tn=TX(),ze=I(Lt(tn)),j=C(ze),H=I(ze,3),te=C(H);Z(()=>{q(j,g(s).matterNodes??0),q(te,g(s).matterEndpoints??0)}),T(Li,tn)};K(de,Li=>{g(s).matterEnabled&&Li(Ke)})}var st=I(de,2);{var ft=Li=>{var tn=MX(),ze=I(Lt(tn)),j=C(ze),H=I(ze,3),te=C(H);Z(()=>{q(j,g(s).dbDocs??"—"),q(te,g(s).dbViews??"—")}),T(Li,tn)};K(st,Li=>{g(s).dbEnabled&&Li(ft)})}var ct=I(st,3),yt=C(ct),ai=I(ct,3),Ti=C(ai),Yt=I(ai,3),ei=C(Yt);Z(()=>{q(Ht,g(s).scripts),q(mi,g(s).topics),q(J,g(s).mqttMsgPerSec??"—"),q(yt,g(s).handlers??"—"),q(Ti,g(s).memMb!=null?g(s).memMb+" MB":"—"),q(ei,g(s).cpuPercent!=null?g(s).cpuPercent+" %":"—")}),T(qe,ve)},je=qe=>{var ve=RX();T(qe,ve)};K(Nt,qe=>{g(s)?qe(Oe):qe(je,-1)})}var Be=I(Nt,2),Ot=C(Be);oe("click",lt,qe=>qe.stopPropagation()),oe("click",Ot,()=>{k(r,!1),N()}),T(Le,lt)};K(tt,Le=>{g(r)&&Le(qt)})}var ui=I(Nn,2);let gi;var ri=I(ui,2);{var mn=Le=>{var lt=OX();oe("click",lt,E),T(Le,lt)};K(ri,Le=>{g(u)==="password"&&Le(mn)})}var Cn=I(rt,2),sn=C(Cn);let Ni;var an=C(sn);{let Le=ht(()=>g(n)==="scripts");tG(an,{get active(){return g(Le)}})}var _n=I(sn,2);let ln;var cn=C(_n);LX(cn,{});var vn=I(_n,2);let Dn;var xn=C(vn);cX(xn,{});var Rn=I(vn,2);let $;var _e=C(Rn);HZ(_e,{});var mt=I(Rn,2);let Rt;var Pt=C(mt);G9(Pt,{});var zt=I(mt,2);let Q;var Xe=C(zt);BG(Xe,{});var R=I(zt,2);let X;var Ce=C(R);jG(Ce,{}),Z(()=>{ke=jt(Mt,1,"svelte-1n46o8q",null,ke,{active:g(n)==="scripts"}),Ue=jt(Ct,1,"svelte-1n46o8q",null,Ue,{active:g(n)==="packages"}),Et=jt(at,1,"svelte-1n46o8q",null,Et,{active:g(n)==="mqtt"}),Qt=jt(Jt,1,"svelte-1n46o8q",null,Qt,{active:g(n)==="matter"}),At=jt(Ft,1,"svelte-1n46o8q",null,At,{active:g(n)==="db"}),en=jt(ji,1,"svelte-1n46o8q",null,en,{active:g(n)==="logs"}),gi=jt(ui,1,"nav-settings svelte-1n46o8q",null,gi,{active:g(n)==="config"}),Ni=jt(sn,1,"page-wrap svelte-1n46o8q",null,Ni,{hidden:g(n)!=="scripts"}),ln=jt(_n,1,"page-wrap svelte-1n46o8q",null,ln,{hidden:g(n)!=="packages"}),Dn=jt(vn,1,"page-wrap svelte-1n46o8q",null,Dn,{hidden:g(n)!=="mqtt"}),$=jt(Rn,1,"page-wrap svelte-1n46o8q",null,$,{hidden:g(n)!=="matter"}),Rt=jt(mt,1,"page-wrap svelte-1n46o8q",null,Rt,{hidden:g(n)!=="db"}),Q=jt(zt,1,"page-wrap svelte-1n46o8q",null,Q,{hidden:g(n)!=="config"}),X=jt(R,1,"page-wrap svelte-1n46o8q",null,X,{hidden:g(n)!=="logs"})}),oe("click",Mt,()=>Y("scripts")),oe("click",Ct,()=>Y("packages")),oe("click",at,()=>Y("mqtt")),oe("click",Jt,()=>Y("matter")),oe("click",Ft,()=>Y("db")),oe("click",ji,()=>Y("logs")),oe("click",Ri,Le=>{Le.stopPropagation(),k(a,!g(a)),k(r,!1)}),oe("click",pn,Le=>{Le.stopPropagation(),k(r,!g(r)),k(a,!1)}),oe("click",ui,()=>Y("config")),T(Te,$t)};K(fe,Te=>{g(S)&&!g(p)&&Te(Se)})}var Pe=I(fe,2);{var De=Te=>{var $t=WX(),rt=C($t),Mt=I(C(rt),4),ke=I(C(Mt),2),Ct=I(Mt,2);{var Ue=Jt=>{var Qt=HX(),Ft=C(Qt);Z(()=>q(Ft,g(_))),T(Jt,Qt)};K(Ct,Jt=>{g(_)&&Jt(Ue)})}var at=I(Ct,2),Et=C(at);Z(()=>{ke.disabled=g(y),at.disabled=g(y)||!g(v),q(Et,g(y)?"Signing in…":"Sign in")}),Qn("submit",rt,Jt=>{Jt.preventDefault(),D()}),Mi(ke,()=>g(v),Jt=>k(v,Jt)),T(Te,$t)};K(Pe,Te=>{g(p)&&Te(De)})}var wt=I(Pe,2);{var Dt=Te=>{var $t=BX();T(Te,$t)};K(wt,Te=>{g(h)&&Te(Dt)})}T(o,G),Io()}hr(["click"]);oW(VX,{target:document.getElementById("app")});export{mT as t};
|
|
225
|
+
*[stopped]*`,toolEvents:g(De).length>0?[...g(De)]:void 0}],!0)}else k(c,H.message,!0)}finally{D=null,k(s,null),k(De,[],!0),k(a,!1)}}}function ri(){D==null||D.abort()}function mn(j){j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),gi())}function Cn(){k(n,[],!0),k(c,"")}const sn=["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 Ni(j){k(r,j,!0),Dt==null||Dt.focus()}var an=k9(),_n=Lt(an),ln=C(_n),cn=I(C(ln),2);{var vn=j=>{var H=$G(),te=C(H);{var ye=Ie=>{var pe=Tr();Z(()=>q(pe,`${g(h).provider??""} · ${(g(f)||g(h).model)??""}`)),T(Ie,pe)},he=Ie=>{var pe=Tr("Not configured");T(Ie,pe)};K(te,Ie=>{g(rt)?Ie(ye):Ie(he,-1)})}Z(()=>Bn(H,"title",`Provider: ${g(h).provider??""}`)),T(j,H)};K(cn,j=>{g(h)&&j(vn)})}var Dn=I(cn,2);{var xn=j=>{var H=qG();oe("click",H,Cn),T(j,H)};K(Dn,j=>{g(n).length>0&&j(xn)})}var Rn=I(ln,2),$=C(Rn);{var _e=j=>{var H=KG();T(j,H)},mt=j=>{var H=XG(),te=C(H),ye=C(te);{var he=Fe=>{var It=GG(),Ge=I(Lt(It)),dt=C(Ge);Z(()=>q(dt,t().id)),T(Fe,It)},Ie=Fe=>{var It=Tr("No view selected. Ask a general sheDB view question.");T(Fe,It)};K(ye,Fe=>{t()?Fe(he):Fe(Ie,-1)})}var pe=I(te,2);vi(pe,17,()=>sn,Fn,(Fe,It)=>{var Ge=ZG(),dt=C(Ge);Z(()=>q(dt,g(It))),oe("click",Ge,()=>Ni(g(It))),T(Fe,Ge)}),T(j,H)};K($,j=>{g(rt)?g(n).length===0&&g(s)===null&&j(mt,1):j(_e)})}var Rt=I($,2);vi(Rt,17,()=>g(n),Fn,(j,H,te)=>{var ye=i9(),he=C(ye);{var Ie=Fe=>{var It=YG(),Ge=C(It);Z(()=>q(Ge,g(H).content)),T(Fe,It)},pe=Fe=>{const It=ht(()=>Ct(g(H).content)),Ge=ht(()=>at(g(It)));var dt=t9(),ni=Lt(dt);{var F=it=>{var ge=ID();vi(ge,21,()=>g(H).toolEvents,Fn,(xe,Ye)=>{var Je=ks(),We=Lt(Je);{var Wt=le=>{var bt=xD(),xt=I(C(bt)),Si=C(xt);Z(Ii=>q(Si,Ii),[()=>g(Ye).name.replace(/_/g," ")]),T(le,bt)},ue=le=>{var bt=LD(),xt=I(C(bt)),Si=C(xt);Z(Ii=>q(Si,Ii),[()=>g(Ye).name.replace(/_/g," ")]),T(le,bt)};K(We,le=>{g(Ye).type==="tool_call"?le(Wt):le(ue,-1)})}T(xe,Je)}),T(it,ge)};K(ni,it=>{var ge;(ge=g(H).toolEvents)!=null&&ge.length&&it(F)})}var ie=I(ni,2),He=C(ie);vi(He,17,()=>g(It),Fn,(it,ge,xe)=>{var Ye=ks(),Je=Lt(Ye);{var We=ue=>{var le=kD();Nl(le,()=>en(g(ge).text),!0),T(ue,le)},Wt=ue=>{const le=ht(()=>`${te}:${xe}`),bt=ht(()=>Ft(g(ge).text)),xt=ht(()=>g(p).has(g(le))),Si=ht(()=>g(ge).lang==="filter");var Ii=QG(),Ee=C(Ii),Ze=C(Ee),ot=C(Ze),Ut=I(Ze,2),Ve=C(Ut),ti=I(Ee,2);let Xt;var An=C(ti),ki=C(An);Nl(ki,()=>ji(g(ge).text,g(ge).lang??""),!0);var Gt=I(An,2);{var Gi=$i=>{var is=JG(),us=C(is);Z(()=>q(us,g(xt)?"▲ collapse":"▼ expand")),oe("click",is,()=>At(g(le))),T($i,is)};K(Gt,$i=>{g(bt)&&$i(Gi)})}Z(()=>{q(ot,g(Si)?"filter":g(ge).lang),Xt=jt(ti,1,"code-body svelte-1twuiul",null,Xt,{collapsed:g(bt)&&!g(xt)})}),oe("click",Ve,()=>Ki(g(ge).text)),T(ue,Ii)};K(Je,ue=>{g(ge).type==="text"?ue(We):ue(Wt,-1)})}T(it,Ye)});var $e=I(He,2);{var be=it=>{var ge=e9(),xe=C(ge),Ye=C(xe);Z(Je=>q(Ye,Je),[()=>Jt(g(Ge))]),oe("click",xe,()=>e.onApplyView(g(Ge))),T(it,ge)},et=ht(()=>Et(g(Ge))&&e.onApplyView);K($e,it=>{g(et)&&it(be)})}T(Fe,dt)};K(he,Fe=>{g(H).role==="user"?Fe(Ie):Fe(pe,-1)})}Z(()=>jt(ye,1,`message ${g(H).role??""}`,"svelte-1twuiul")),T(j,ye)});var Pt=I(Rt,2);{var zt=j=>{var H=ID();vi(H,21,()=>g(De),Fn,(te,ye)=>{var he=ks(),Ie=Lt(he);{var pe=It=>{var Ge=xD(),dt=I(C(Ge)),ni=C(dt);Z(F=>q(ni,F),[()=>g(ye).name.replace(/_/g," ")]),T(It,Ge)},Fe=It=>{var Ge=LD(),dt=I(C(Ge)),ni=C(dt);Z(F=>q(ni,F),[()=>g(ye).name.replace(/_/g," ")]),T(It,Ge)};K(Ie,It=>{g(ye).type==="tool_call"?It(pe):It(Fe,-1)})}T(te,he)}),T(j,H)};K(Pt,j=>{g(De).length>0&&j(zt)})}var Q=I(Pt,2);{var Xe=j=>{var H=n9(),te=C(H),ye=C(te),he=C(ye);Z(()=>q(he,N[g(E)])),T(j,H)};K(Q,j=>{g(a)&&g(s)===null&&g(De).length===0&&j(Xe)})}var R=I(Q,2);{var X=j=>{var H=o9(),te=C(H);vi(te,21,()=>Ue(g(s)),Fn,(ye,he)=>{var Ie=ks(),pe=Lt(Ie);{var Fe=Ge=>{var dt=kD();Nl(dt,()=>en(g(he).text),!0),T(Ge,dt)},It=Ge=>{var dt=s9(),ni=C(dt),F=C(ni),ie=C(F),He=I(ni,2),$e=C(He);Nl($e,()=>ji(g(he).text,g(he).lang??""),!0),Z(()=>q(ie,g(he).lang)),T(Ge,dt)};K(pe,Ge=>{g(he).type==="text"?Ge(Fe):Ge(It,-1)})}T(ye,Ie)}),T(j,H)};K(R,j=>{g(s)!==null&&j(X)})}io(Rn,j=>Te=j,()=>Te);var Ce=I(Rn,2);{var Le=j=>{var H=r9(),te=C(H);Z(()=>q(te,g(c))),T(j,H)};K(Ce,j=>{g(c)&&j(Le)})}var lt=I(Ce,2),Nt=C(lt),Oe=C(Nt),je=I(Nt,2),Be=C(je),Ot=I(je,2),qe=C(Ot),ve=I(Ot,2),Vt=C(ve),Ht=I(lt,2),fi=C(Ht);{var mi=j=>{var H=a9();let te;var ye=I(C(H),2),he=C(ye),Ie=I(ye,2),pe=C(Ie);Z(()=>{te=jt(H,1,"file-chip svelte-1twuiul",null,te,{inactive:!g(fe)}),q(he,t().id),Bn(Ie,"title",g(fe)?"Remove from context":"Re-add to context"),q(pe,g(fe)?"×":"+")}),oe("click",Ie,()=>k(fe,!g(fe))),T(j,H)};K(fi,j=>{t()&&j(mi)})}var Wi=I(fi,2);vi(Wi,17,()=>g(G),Fn,(j,H,te)=>{const ye=ht(()=>kn(g(H).name));var he=l9(),Ie=C(he),pe=C(Ie),Fe=I(Ie,2),It=C(Fe),Ge=I(Fe,2);Z((dt,ni)=>{jt(Ie,1,`badge badge-${dt??""}`,"svelte-1twuiul"),q(pe,ni),q(It,g(H).name)},[()=>g(ye).toLowerCase(),()=>Hn(g(ye))]),oe("click",Ge,()=>fn(te)),T(j,he)});var J=I(Wi,2),de=I(J,2);io(de,j=>Pe=j,()=>Pe);var Ke=I(Ht,2);let st;var ft=C(Ke);let ct;var yt=C(ft);io(yt,j=>Dt=j,()=>Dt);var ai=I(ft,2);{var Ti=j=>{var H=c9();oe("click",H,ri),T(j,H)},Yt=j=>{var H=d9();Z(te=>H.disabled=te,[()=>!g(r).trim()||!g(rt)]),oe("click",H,gi),T(j,H)};K(ai,j=>{g(a)?j(Ti):j(Yt,-1)})}var ei=I(Ke,2);{var Li=j=>{var H=p9(),te=C(H),ye=C(te),he=I(te,2);{var Ie=Ge=>{var dt=u9();vi(dt,21,()=>g(u),Fn,(ni,F)=>{var ie=h9(),He=C(ie),$e={};Z(()=>{q(He,g(F)),$e!==($e=g(F))&&(ie.value=(ie.__value=g(F))??"")}),T(ni,ie)}),Z(()=>dt.disabled=g(a)),za(dt,()=>g(f),ni=>k(f,ni)),T(Ge,dt)},pe=Ge=>{var dt=g9(),ni=C(dt);Z(()=>q(ni,g(f)||g(h).model)),T(Ge,dt)};K(he,Ge=>{g(u).length>0?Ge(Ie):Ge(pe,-1)})}var Fe=I(he,2);{var It=Ge=>{var dt=f9();oe("click",dt,Ri),T(Ge,dt)};K(Fe,Ge=>{g(h).provider==="ollama"&&Ge(It)})}Z(()=>q(ye,g(h).provider)),T(j,H)};K(ei,j=>{g(rt)&&g(h)&&j(Li)})}var tn=I(_n,2);{var ze=j=>{var H=I9(),te=C(H),ye=C(te),he=C(ye),Ie=C(he),pe=I(he,2),Fe=I(ye,2),It=C(Fe);{var Ge=F=>{var ie=m9();T(F,ie)},dt=F=>{var ie=_9(),He=C(ie);Z(()=>q(He,g(S))),T(F,ie)},ni=F=>{var ie=L9(),He=C(ie);{var $e=ue=>{var le=v9(),bt=I(Lt(le)),xt=C(bt);Z(()=>q(xt,g(_).version)),T(ue,le)};K(He,ue=>{g(_).version&&ue($e)})}var be=I(He,2);{var et=ue=>{var le=b9(),bt=I(Lt(le)),xt=C(bt);Z(()=>q(xt,g(_).details.family)),T(ue,le)};K(be,ue=>{var le;(le=g(_).details)!=null&&le.family&&ue(et)})}var it=I(be,2);{var ge=ue=>{var le=w9(),bt=I(Lt(le)),xt=C(bt);Z(()=>q(xt,g(_).details.parameter_size)),T(ue,le)};K(it,ue=>{var le;(le=g(_).details)!=null&&le.parameter_size&&ue(ge)})}var xe=I(it,2);{var Ye=ue=>{var le=y9(),bt=I(Lt(le)),xt=C(bt);Z(()=>q(xt,g(_).details.quantization_level)),T(ue,le)};K(xe,ue=>{var le;(le=g(_).details)!=null&&le.quantization_level&&ue(Ye)})}var Je=I(xe,2);{var We=ue=>{var le=C9(),bt=I(Lt(le),2);vi(bt,21,()=>g(_).running,Fn,(xt,Si)=>{var Ii=S9(),Ee=C(Ii);Z(Ze=>q(Ee,`${g(Si).name??""} · ${Ze??""} VRAM`),[()=>In(g(Si).size_vram)]),T(xt,Ii)}),T(ue,le)},Wt=ue=>{var le=x9();T(ue,le)};K(Je,ue=>{g(_).running&&g(_).running.length>0?ue(We):g(_).running!==null&&ue(Wt,1)})}T(F,ie)};K(It,F=>{g(y)?F(Ge):g(S)?F(dt,1):g(_)&&F(ni,2)})}Z(()=>{var F;return q(Ie,`Ollama · ${(g(f)||((F=g(h))==null?void 0:F.model))??""}`)}),oe("click",H,()=>k(v,!1)),oe("click",te,F=>F.stopPropagation()),oe("click",pe,()=>k(v,!1)),T(j,H)};K(tn,j=>{g(v)&&j(ze)})}Z(j=>{q(Vt,j),st=jt(Ke,1,"input-row svelte-1twuiul",null,st,{"drag-over":g(Se)}),ct=jt(ft,1,"textarea-wrap svelte-1twuiul",null,ct,{loading:g(a)}),Bn(yt,"placeholder",g(rt)?"Ask anything… (Enter to send, Shift+Enter for newline, drag & drop files to add context)":"AI not configured"),yt.disabled=g(a)||!g(rt)},[()=>In(g(Mt))]),no(Oe,()=>g(z),j=>k(z,j)),no(Be,()=>g(O),j=>k(O,j)),no(qe,()=>g(Y),j=>k(Y,j)),oe("click",J,zi),oe("change",de,pn),Qn("dragover",Ke,qt),Qn("dragleave",Ke,ui),Qn("drop",Ke,tt),oe("keydown",yt,mn),Mi(yt,()=>g(r),j=>k(r,j)),T(o,an),Io()}hr(["click","change","keydown"]);var E9=A('<div class="me svelte-1pxdb1"></div>');function Ey(o,e){Lo(e,!0);let t=Ju(e,"value",15,""),i=Ju(e,"language",3,"javascript"),n,s,r=!1;Wr(()=>{const c=i()==="json"?{formatOnPaste:!0,autoIndent:"full"}:{};s=Ma.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())})}),Qb(()=>s==null?void 0:s.dispose()),Pn(()=>{!s||s.getValue()===t()||(r=!0,s.setValue(t()),r=!1)});var a=E9();io(a,c=>n=c,()=>n),T(o,a),Io()}const DD=o=>{var e=P9();T(o,e)};var P9=A('<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 — 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>'),T9=A('<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>'),ED=A('<div class="form-error svelte-rrt0o"> </div>'),M9=A('<div class="new-item-form svelte-rrt0o"><input placeholder="device/lamp1" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),PD=A("<li> </li>"),TD=A('<div class="error-bar svelte-rrt0o"> </div>'),MD=A('<div class="loading svelte-rrt0o">Loading…</div>'),N9=A('<div class="monaco-doc-wrap svelte-rrt0o"><!></div>'),R9=A('<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),A9=A('<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>'),O9=A('<div class="new-item-form svelte-rrt0o"><input placeholder="myView" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),F9=A('<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>'),H9=A('<span class="badge-error svelte-rrt0o">error</span>'),W9=A('<span class="badge-ok svelte-rrt0o"> </span>'),B9=A('<pre class="result-error svelte-rrt0o"> </pre>'),z9=A('<pre class="result-json svelte-rrt0o"> </pre>'),V9=A('<div class="view-result svelte-rrt0o"><div class="result-header svelte-rrt0o">Result <!></div> <!></div>'),U9=A('<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 · 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>'),j9=A('<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),$9=A('<div class="chat-resize-handle svelte-rrt0o" role="separator"></div> <div class="chat-pane svelte-rrt0o"><!></div>',1),q9=A('<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>'),K9=A('<div class="db-root svelte-rrt0o" role="presentation"><div class="panel-tabs svelte-rrt0o"><button>Documents</button> <button>Views</button> <!></div> <!></div>');function G9(o,e){Lo(e,!0);let t=V(bi([])),i=V(null),n=V("{}"),s=V(!1),r=V(null);const a="she-db-selected-view";let c=V(bi([])),h=V(bi(localStorage.getItem(a))),u=V("#"),f=V("// emit(this.someProperty)"),p=V(""),v=V(""),_=V(!1),y=V(!1),S=V(null),D=V(!1),E=V(null),N=V("she/db/view/");const z="she-db-panel";let O=V(bi(localStorage.getItem(z)??"docs")),Y=V(""),G=V(!1),fe=V(null),Se=V(""),Pe=V(!1),De=V(null);const wt="she-db-sidebar-width";let Dt=V(bi(parseInt(localStorage.getItem(wt)??"220",10))),Te=!1,$t=0,rt=0;const Mt="she-db-chat-width",ke="she-db-chat-open";let Ct=V(localStorage.getItem(ke)==="true"),Ue=V(bi(parseInt(localStorage.getItem(Mt)??"320",10))),at=!1,Et=0,Jt=0;const Qt=ht(()=>g(h)?{id:g(h),filter:g(u),map:g(f),reduce:g(p)}:null);function Ft($){$.filter!==void 0&&k(u,$.filter,!0),$.map!==void 0&&k(f,$.map,!0),$.reduce!==void 0&&k(p,$.reduce,!0)}Pn(()=>{localStorage.setItem(ke,String(g(Ct)))}),Pn(()=>{localStorage.setItem(z,g(O))}),Pn(()=>{g(h)?localStorage.setItem(a,g(h)):localStorage.removeItem(a)});function At($){Te=!0,$t=$.clientX,rt=g(Dt),$.preventDefault()}function ji($){Te&&k(Dt,Math.max(140,Math.min(500,rt+$.clientX-$t)),!0),at&&k(Ue,Math.max(240,Math.min(600,Jt-($.clientX-Et))),!0)}function en(){Te&&(Te=!1,localStorage.setItem(wt,String(g(Dt)))),at&&(at=!1,localStorage.setItem(Mt,String(g(Ue))))}function jn($){at=!0,Et=$.clientX,Jt=g(Ue),$.preventDefault()}async function Ki(){try{k(t,await ZN(),!0)}catch{}}async function Ri(){try{k(c,await XN(),!0)}catch{}}async function In($){k(i,$,!0),k(r,null),k(s,!0);try{const _e=await Q7($);k(n,JSON.stringify(_e,null,2),!0)}catch(_e){k(r,_e instanceof Error?_e.message:String(_e),!0)}finally{k(s,!1)}}async function kn(){if(g(i)){k(r,null);try{const $=JSON.parse(g(n));await eD(g(i),$)}catch($){k(r,$ instanceof Error?$.message:String($),!0)}}}async function Hn(){if(g(i)&&confirm(`Delete document "${g(i)}"?`))try{await e8(g(i)),k(i,null),k(n,"{}")}catch($){k(r,$ instanceof Error?$.message:String($),!0)}}async function fn(){const $=g(Y).trim();if($){k(fe,null);try{await eD($,{}),k(G,!1),k(Y,""),await In($)}catch(_e){k(fe,_e instanceof Error?_e.message:String(_e),!0)}}}async function zi($){k(h,$,!0),k(E,null),k(D,!0),k(S,null);try{const _e=await t8($);k(u,_e.filter??"",!0),k(f,_e.map,!0),k(p,_e.reduce??"",!0),k(v,_e.description??"",!0),k(_,_e.mqttpub??!1,!0),k(y,_e.retain??!1,!0),k(S,await ky($).catch(()=>null),!0)}catch(_e){k(E,_e instanceof Error?_e.message:String(_e),!0)}finally{k(D,!1)}}async function Nn(){if(g(h)){k(E,null);try{const $={map:g(f)};g(u).trim()&&($.filter=g(u).trim()),g(p).trim()&&($.reduce=g(p).trim()),g(v).trim()&&($.description=g(v).trim()),g(_)&&($.mqttpub=!0),g(y)&&($.retain=!0),await tD(g(h),$)}catch($){k(E,$ instanceof Error?$.message:String($),!0)}}}async function pn(){if(g(h))try{k(S,await ky(g(h)),!0)}catch($){k(E,$ instanceof Error?$.message:String($),!0)}}async function tt(){if(g(h)&&confirm(`Delete view "${g(h)}"?`))try{await i8(g(h)),k(h,null),k(u,""),k(f,"// emit(this.someProperty)"),k(p,""),k(v,""),k(_,!1),k(y,!1),k(S,null)}catch($){k(E,$ instanceof Error?$.message:String($),!0)}}async function qt(){if(!g(Se).trim())return;const $=g(Se).trim();k(De,null);try{await tD($,{map:"// emit(this.someProperty)"}),k(Pe,!1),k(Se,""),await Ri(),await zi($)}catch(_e){k(De,_e instanceof Error?_e.message:String(_e),!0)}}let ui=V(""),gi=V(""),ri=ht(()=>[...g(t)].filter($=>!g(ui)||$.toLowerCase().includes(g(ui).toLowerCase())).sort()),mn=ht(()=>[...g(c)].filter($=>!g(gi)||$.toLowerCase().includes(g(gi).toLowerCase())).sort());Wr(()=>{Ki(),Ri(),g(h)&&zi(g(h)),GN().then(Pt=>{const zt=Pt.dbPrefix||"she/db/",Q=zt.endsWith("/")?zt:zt+"/";k(N,Q+"view/")}).catch(()=>{});const $=Hl("db:ids",Pt=>{k(t,Pt.ids??[],!0)}),_e=Hl("db:viewIds",Pt=>{k(c,Pt.ids??[],!0)}),mt=Hl("db:change",async Pt=>{const zt=Pt.id;g(i)===zt&&(Pt.doc===null?(k(i,null),k(n,"{}")):k(n,JSON.stringify(Pt.doc,null,2),!0))}),Rt=Hl("db:viewUpdate",async Pt=>{const zt=Pt.id;g(h)===zt&&k(S,await ky(zt).catch(()=>null),!0)});return()=>{$(),_e(),mt(),Rt()}});var Cn=K9(),sn=C(Cn),Ni=C(sn);let an;var _n=I(Ni,2);let ln;var cn=I(_n,2);{var vn=$=>{var _e=T9();let mt;Z(()=>{mt=jt(_e,1,"ai-toggle svelte-rrt0o",null,mt,{"ai-open":g(Ct)}),Bn(_e,"title",g(Ct)?"Close AI assistant":"Open AI assistant")}),oe("click",_e,()=>k(Ct,!g(Ct))),T($,_e)};K(cn,$=>{g(O)==="views"&&$(vn)})}var Dn=I(sn,2);{var xn=$=>{var _e=A9(),mt=C(_e);let Rt;var Pt=C(mt),zt=C(Pt),Q=I(Pt,2);{var Xe=Be=>{var Ot=M9(),qe=Lt(Ot),ve=C(qe),Vt=I(ve,2),Ht=I(qe,2);{var fi=mi=>{var Wi=ED(),J=C(Wi);Z(()=>q(J,g(fe))),T(mi,Wi)};K(Ht,mi=>{g(fe)&&mi(fi)})}oe("keydown",ve,mi=>mi.key==="Enter"&&fn()),Mi(ve,()=>g(Y),mi=>k(Y,mi)),oe("click",Vt,fn),T(Be,Ot)};K(Q,Be=>{g(G)&&Be(Xe)})}var R=I(Q,2),X=C(R),Ce=I(R,2);vi(Ce,20,()=>g(ri),Be=>Be,(Be,Ot)=>{var qe=PD();let ve;var Vt=C(qe);Z(()=>{ve=jt(qe,1,"flat-item svelte-rrt0o",null,ve,{"active-item":g(i)===Ot}),q(Vt,Ot)}),oe("click",qe,()=>In(Ot)),T(Be,qe)});var Le=I(mt,2),lt=I(Le,2),Nt=C(lt);{var Oe=Be=>{var Ot=R9(),qe=Lt(Ot),ve=C(qe),Vt=C(ve),Ht=I(ve,2),fi=I(Ht,2),mi=I(qe,2);{var Wi=st=>{var ft=TD(),ct=C(ft);Z(()=>q(ct,g(r))),T(st,ft)};K(mi,st=>{g(r)&&st(Wi)})}var J=I(mi,2);{var de=st=>{var ft=MD();T(st,ft)},Ke=st=>{var ft=N9(),ct=C(ft);Ey(ct,{language:"json",get value(){return g(n)},set value(yt){k(n,yt,!0)}}),T(st,ft)};K(J,st=>{g(s)?st(de):st(Ke,-1)})}Z(()=>q(Vt,g(i))),oe("click",Ht,kn),oe("click",fi,Hn),T(Be,Ot)},je=Be=>{DD(Be)};K(Nt,Be=>{g(i)?Be(Oe):Be(je,-1)})}Z(()=>Rt=Ho(mt,"",Rt,{width:`${g(Dt)??""}px`})),oe("click",zt,()=>{k(G,!g(G)),k(fe,null)}),Mi(X,()=>g(ui),Be=>k(ui,Be)),oe("mousedown",Le,At),T($,_e)},Rn=$=>{var _e=q9(),mt=C(_e);let Rt;var Pt=C(mt),zt=C(Pt),Q=I(Pt,2);{var Xe=qe=>{var ve=O9(),Vt=Lt(ve),Ht=C(Vt),fi=I(Ht,2),mi=I(Vt,2);{var Wi=J=>{var de=ED(),Ke=C(de);Z(()=>q(Ke,g(De))),T(J,de)};K(mi,J=>{g(De)&&J(Wi)})}oe("keydown",Ht,J=>J.key==="Enter"&&qt()),Mi(Ht,()=>g(Se),J=>k(Se,J)),oe("click",fi,qt),T(qe,ve)};K(Q,qe=>{g(Pe)&&qe(Xe)})}var R=I(Q,2),X=C(R),Ce=I(R,2);vi(Ce,20,()=>g(mn),qe=>qe,(qe,ve)=>{var Vt=PD();let Ht;var fi=C(Vt);Z(()=>{Ht=jt(Vt,1,"flat-item svelte-rrt0o",null,Ht,{"active-item":g(h)===ve}),q(fi,ve)}),oe("click",Vt,()=>zi(ve)),T(qe,Vt)});var Le=I(mt,2),lt=I(Le,2),Nt=C(lt);{var Oe=qe=>{var ve=j9(),Vt=Lt(ve),Ht=C(Vt),fi=C(Ht),mi=I(Ht,2),Wi=I(mi,2),J=I(Wi,2),de=I(Vt,2);{var Ke=yt=>{var ai=TD(),Ti=C(ai);Z(()=>q(Ti,g(E))),T(yt,ai)};K(de,yt=>{g(E)&&yt(Ke)})}var st=I(de,2);{var ft=yt=>{var ai=MD();T(yt,ai)},ct=yt=>{var ai=U9(),Ti=C(ai),Yt=I(C(Ti),2),ei=C(Yt),Li=I(Ti,2),tn=I(C(Li),2),ze=C(tn),j=I(Li,2),H=I(C(j),2),te=C(H);Ey(te,{language:"javascript",get value(){return g(f)},set value(be){k(f,be,!0)}});var ye=I(j,2),he=I(C(ye),2),Ie=C(he);Ey(Ie,{language:"javascript",get value(){return g(p)},set value(be){k(p,be,!0)}});var pe=I(ye,2),Fe=C(pe),It=C(Fe),Ge=I(It,4),dt=I(C(Ge)),ni=C(dt),F=I(Fe,2);{var ie=be=>{var et=F9(),it=C(et);no(it,()=>g(y),ge=>k(y,ge)),T(be,et)};K(F,be=>{g(_)&&be(ie)})}var He=I(pe,2);{var $e=be=>{var et=V9(),it=C(et),ge=I(C(it));{var xe=ue=>{var le=H9();T(ue,le)},Ye=ue=>{var le=W9(),bt=C(le);Z(()=>q(bt,`${g(S).length??0??""} items · rev ${g(S)._rev??""}`)),T(ue,le)};K(ge,ue=>{g(S).error?ue(xe):ue(Ye,-1)})}var Je=I(it,2);{var We=ue=>{var le=B9(),bt=C(le);Z(()=>q(bt,g(S).error)),T(ue,le)},Wt=ue=>{var le=z9(),bt=C(le);Z(xt=>q(bt,xt),[()=>JSON.stringify(g(S).result,null,2)]),T(ue,le)};K(Je,ue=>{g(S).error?ue(We):ue(Wt,-1)})}T(be,et)};K(He,be=>{g(S)&&be($e)})}Z(()=>q(ni,`${g(N)??""}${g(h)??""} on every update`)),Mi(ei,()=>g(v),be=>k(v,be)),Mi(ze,()=>g(u),be=>k(u,be)),no(It,()=>g(_),be=>k(_,be)),T(yt,ai)};K(st,yt=>{g(D)?yt(ft):yt(ct,-1)})}Z(()=>q(fi,g(h))),oe("click",mi,Nn),oe("click",Wi,pn),oe("click",J,tt),T(qe,ve)},je=qe=>{DD(qe)};K(Nt,qe=>{g(h)?qe(Oe):qe(je,-1)})}var Be=I(lt,2);{var Ot=qe=>{var ve=$9(),Vt=Lt(ve),Ht=I(Vt,2);let fi;var mi=C(Ht);D9(mi,{get currentView(){return g(Qt)},onApplyView:Ft}),Z(()=>fi=Ho(Ht,"",fi,{width:`${g(Ue)??""}px`})),oe("mousedown",Vt,jn),T(qe,ve)};K(Be,qe=>{g(Ct)&&qe(Ot)})}Z(()=>Rt=Ho(mt,"",Rt,{width:`${g(Dt)??""}px`})),oe("click",zt,()=>{k(Pe,!g(Pe)),k(De,null)}),Mi(X,()=>g(gi),qe=>k(gi,qe)),oe("mousedown",Le,At),T($,_e)};K(Dn,$=>{g(O)==="docs"?$(xn):$(Rn,-1)})}Z(()=>{an=jt(Ni,1,"svelte-rrt0o",null,an,{active:g(O)==="docs"}),ln=jt(_n,1,"svelte-rrt0o",null,ln,{active:g(O)==="views"})}),oe("mousemove",Cn,ji),oe("mouseup",Cn,en),Qn("mouseleave",Cn,en),oe("click",Ni,()=>k(O,"docs")),oe("click",_n,()=>k(O,"views")),T(o,Cn),Io()}hr(["mousemove","mouseup","click","keydown","mousedown"]);var Z9=A('<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),X9=A('<label class="svelte-1ua3isv">Pairing Code / QR <input type="text" placeholder="MT:..." class="svelte-1ua3isv"/></label>'),ND=A('<p class="err svelte-1ua3isv"> </p>'),Y9=A('<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>'),J9=A('<span class="device-name svelte-1ua3isv"> </span> <span class="device-nodeid svelte-1ua3isv"> </span>',1),Q9=A('<span class="device-name svelte-1ua3isv"> </span>'),eZ=A('<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>'),tZ=A('<li class="empty svelte-1ua3isv">No paired devices</li>'),iZ=A('<p class="info svelte-1ua3isv">Loading…</p>'),nZ=A('<p class="device-subtitle svelte-1ua3isv"> </p>'),sZ=A('<span class="ep-chip svelte-1ua3isv"> </span>'),oZ=A('<span class="attr-id svelte-1ua3isv"> </span>'),rZ=A('<button class="attr-action-btn svelte-1ua3isv"> </button>'),aZ=A('<div class="attr-actions svelte-1ua3isv"></div>'),lZ=A('<span class="cmd-sep svelte-1ua3isv">,</span>'),cZ=A('<span class="cmd-name svelte-1ua3isv"> </span><span class="cmd-id svelte-1ua3isv"> </span>',1),dZ=A('<span class="cmd-id svelte-1ua3isv"> </span>'),hZ=A("<!> <!>",1),uZ=A('<span class="cmd-list svelte-1ua3isv"></span>'),gZ=A(' <span class="cmd-id svelte-1ua3isv"> </span>',1),fZ=A('<tr class="svelte-1ua3isv"><td class="svelte-1ua3isv"><!></td><td class="svelte-1ua3isv"> </td></tr>'),pZ=A('<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>'),mZ=A('<th class="svelte-1ua3isv"> </th>'),_Z=A('<td class="svelte-1ua3isv"> </td>'),vZ=A('<tr class="svelte-1ua3isv"></tr>'),bZ=A('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),wZ=A('<tr class="svelte-1ua3isv"><td class="attr-obj-key svelte-1ua3isv"> </td><td class="attr-obj-val svelte-1ua3isv"> </td></tr>'),yZ=A('<table class="attr-obj-table svelte-1ua3isv"><tbody class="svelte-1ua3isv"></tbody></table>'),SZ=A('<a class="attr-link svelte-1ua3isv" target="_blank" rel="noopener noreferrer"> </a>'),CZ=A('<span class="attr-val svelte-1ua3isv"> </span>'),xZ=A('<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>'),LZ=A('<tr class="cluster-hdr-row svelte-1ua3isv"><td colspan="3" class="cluster-hdr-cell svelte-1ua3isv"> </td></tr> <!>',1),IZ=A('<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>'),kZ=A('<p class="no-clusters svelte-1ua3isv">No clusters</p>'),DZ=A('<details class="svelte-1ua3isv"><summary class="svelte-1ua3isv"> <span class="ep-id svelte-1ua3isv"> </span> <span class="ep-chips svelte-1ua3isv"></span></summary> <!></details>'),EZ=A('<div class="detail-hdr svelte-1ua3isv"><h2 class="svelte-1ua3isv"> </h2> <!> <p class="detail-nodeid svelte-1ua3isv"> </p></div> <!>',1),PZ=A('<p class="info svelte-1ua3isv">Select a device to view its endpoints.</p>'),TZ=A('<span class="stream-badge svelte-1ua3isv"> </span>'),MZ=A('<span class="stream-empty svelte-1ua3isv">Waiting for events…</span>'),Py=A(' <span class="e-sub svelte-1ua3isv"> </span>',1),NZ=A('<span class="e-badge e-badge-status svelte-1ua3isv">status</span> <span class="e-node svelte-1ua3isv"> <!></span> <span> </span>',1),RZ=A('<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),AZ=A('<div class="er svelte-1ua3isv"><span class="e-ts svelte-1ua3isv"> </span> <!></div>'),OZ=A('<div class="stream-body svelte-1ua3isv"><!></div>'),FZ=A('<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>');function HZ(o,e){Lo(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($,_e,mt,Rt,Pt){try{await p8($,_e,mt,Rt,Pt)}catch(zt){console.error("matter command failed",zt)}}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($,_e){const mt=n[$];return _e.map(Rt=>{const Pt=typeof Rt=="number"?Rt:Number(Rt);return{id:Pt,name:(mt==null?void 0:mt[Pt])??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($){return"0x"+$.toString(16).toUpperCase().padStart(4,"0")}let u=V(bi([])),f=bi(new Map);function p($){if($==null)return"—";if(typeof $=="boolean"||typeof $=="number")return String($);if(typeof $=="string")return $.length>50?$.slice(0,47)+"…":$;const _e=JSON.stringify($);return _e.length>60?_e.slice(0,57)+"…":_e}function v($){return $==null?"—":typeof $=="boolean"||typeof $=="number"?String($):typeof $=="string"?$:JSON.stringify($)}function _($){return $!==null&&typeof $=="object"&&!Array.isArray($)}function y($){return Array.isArray($)&&$.length>0&&$.every(_)}function S($,_e){return!!(_e==="attributeList"||Array.isArray($)&&$.length===0||_($)&&Object.keys($).length===0)}function D($){return new Date($).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}const E=500,N=20,z=32;let O=0,Y=V(bi([])),G=V(!0),fe=V(180),Se=ht(()=>{const $=Math.max(1,Math.floor((g(fe)-z)/N)+1);return g(Y).slice(0,$)});function Pe($){$.preventDefault();const _e=$.clientY,mt=g(fe);function Rt(zt){k(fe,Math.max(60,Math.min(600,mt+_e-zt.clientY)),!0)}function Pt(){document.removeEventListener("mousemove",Rt),document.removeEventListener("mouseup",Pt)}document.addEventListener("mousemove",Rt),document.addEventListener("mouseup",Pt)}let De=V(null),wt=V(!1),Dt=V(null),Te=V(!1),$t=V("passcode"),rt=V(""),Mt=V(""),ke=V(""),Ct=V(!1),Ue=V(null),at=V("");const Et="she:matter:selectedNodeId";async function Jt(){try{k(u,await YN(),!0);for(const $ of g(u))d_($.nodeId).then(_e=>{f.set($.nodeId,_e)}).catch(()=>{});if(g(u).length>0&&!g(De)){const $=localStorage.getItem(Et),_e=$&&g(u).find(mt=>mt.nodeId===$)?$:g(u)[0].nodeId;Qt(_e)}}catch{k(u,[],!0)}}async function Qt($){k(wt,!0),k(Dt,null);try{k(De,await d_($),!0),f.set($,g(De)),localStorage.setItem(Et,$)}catch(_e){k(Dt,_e instanceof Error?_e.message:String(_e),!0)}finally{k(wt,!1)}}async function Ft($){var _e;if(confirm(`Unpair device ${$}?`))try{await f8($),((_e=g(De))==null?void 0:_e.nodeId)===$&&k(De,null),await Jt()}catch(mt){k(Dt,mt instanceof Error?mt.message:String(mt),!0)}}async function At(){k(Ct,!0),k(Ue,null);try{let $;g($t)==="passcode"?($={passcode:Number(g(rt))},g(Mt)&&($={...$,discriminator:Number(g(Mt))})):$={pairingCode:g(ke).trim()},g(at).trim()&&($={...$,discoveryAddress:g(at).trim()}),await g8($),k(Te,!1),k(rt,""),k(Mt,""),k(ke,""),k(at,""),await Jt()}catch($){k(Ue,$ instanceof Error?$.message:String($),!0)}finally{k(Ct,!1)}}Wr(()=>{Jt()});const ji=Hl("matter:deviceList",$=>{if(!Array.isArray($.devices))return;const _e=$.devices;for(const mt of _e)f.has(mt.nodeId)||d_(mt.nodeId).then(Rt=>{f.set(mt.nodeId,Rt)}).catch(()=>{});k(u,_e,!0)}),en=Hl("matter:deviceStatus",$=>{if($.nodeId===void 0)return;const _e=String($.nodeId),mt=!!$.online;k(u,g(u).map(Rt=>Rt.nodeId===_e?{...Rt,online:mt}:Rt),!0),k(Y,[{id:O++,kind:"status",nodeId:_e,online:mt,ts:Date.now()},...g(Y).slice(0,E-1)],!0)}),jn=Hl("matter:attr",$=>{const _e=String($.nodeId),mt=$.endpointId,Rt=String($.clusterName),Pt=String($.attrName),zt=$.value;if(g(De)&&g(De).nodeId===_e){const Xe=g(De).endpoints.find(X=>X.endpointId===mt),R=Xe==null?void 0:Xe.clusters.find(X=>X.name===Rt);R&&(R.attrs[Pt]=zt)}const Q=f.get(_e);if(Q){const Xe=Q.endpoints.find(X=>X.endpointId===mt),R=Xe==null?void 0:Xe.clusters.find(X=>X.name===Rt);R&&(R.attrs[Pt]=zt)}k(Y,[{id:O++,kind:"attr",nodeId:_e,endpointId:mt,clusterName:Rt,attrName:Pt,value:zt,ts:$.ts??Date.now()},...g(Y).slice(0,E-1)],!0)});Qb(()=>{ji(),en(),jn()});var Ki=FZ(),Ri=C(Ki),In=C(Ri),kn=C(In),Hn=I(C(kn),2),fn=I(kn,2);{var zi=$=>{var _e=Y9(),mt=C(_e),Rt=C(mt);let Pt;var zt=I(Rt,2);let Q;var Xe=I(mt,2);{var R=Be=>{var Ot=Z9(),qe=Lt(Ot),ve=I(C(qe)),Vt=I(qe,2),Ht=I(C(Vt));Mi(ve,()=>g(rt),fi=>k(rt,fi)),Mi(Ht,()=>g(Mt),fi=>k(Mt,fi)),T(Be,Ot)},X=Be=>{var Ot=X9(),qe=I(C(Ot));Mi(qe,()=>g(ke),ve=>k(ke,ve)),T(Be,Ot)};K(Xe,Be=>{g($t)==="passcode"?Be(R):Be(X,-1)})}var Ce=I(Xe,2),Le=I(C(Ce)),lt=I(Ce,2);{var Nt=Be=>{var Ot=ND(),qe=C(Ot);Z(()=>q(qe,g(Ue))),T(Be,Ot)};K(lt,Be=>{g(Ue)&&Be(Nt)})}var Oe=I(lt,2),je=C(Oe);Z(()=>{Pt=jt(Rt,1,"svelte-1ua3isv",null,Pt,{active:g($t)==="passcode"}),Q=jt(zt,1,"svelte-1ua3isv",null,Q,{active:g($t)==="pairingCode"}),Oe.disabled=g(Ct),q(je,g(Ct)?"Commissioning…":"Commission")}),oe("click",Rt,()=>k($t,"passcode")),oe("click",zt,()=>k($t,"pairingCode")),Mi(Le,()=>g(at),Be=>k(at,Be)),oe("click",Oe,At),T($,_e)};K(fn,$=>{g(Te)&&$(zi)})}var Nn=I(fn,2),pn=C(Nn);vi(pn,17,()=>g(u),$=>$.nodeId,($,_e)=>{var mt=eZ();let Rt;var Pt=C(mt),zt=C(Pt);let Q;var Xe=I(zt,2),R=C(Xe);{var X=lt=>{var Nt=J9(),Oe=Lt(Nt),je=C(Oe),Be=I(Oe,2),Ot=C(Be);Z(()=>{q(je,g(_e).name),q(Ot,`#${g(_e).nodeId??""}`)}),T(lt,Nt)},Ce=lt=>{var Nt=Q9(),Oe=C(Nt);Z(()=>q(Oe,`Node ${g(_e).nodeId??""}`)),T(lt,Nt)};K(R,lt=>{g(_e).name?lt(X):lt(Ce,-1)})}var Le=I(Pt,2);Z(()=>{var lt;Rt=jt(mt,1,"svelte-1ua3isv",null,Rt,{selected:((lt=g(De))==null?void 0:lt.nodeId)===g(_e).nodeId}),Q=jt(zt,1,"status-dot svelte-1ua3isv",null,Q,{online:g(_e).online})}),oe("click",Pt,()=>Qt(g(_e).nodeId)),oe("click",Le,()=>Ft(g(_e).nodeId)),T($,mt)});var tt=I(pn,2);{var qt=$=>{var _e=tZ();T($,_e)};K(tt,$=>{g(u).length===0&&$(qt)})}var ui=I(In,2),gi=C(ui);{var ri=$=>{var _e=iZ();T($,_e)},mn=$=>{var _e=ND(),mt=C(_e);Z(()=>q(mt,g(Dt))),T($,_e)},Cn=$=>{var _e=EZ(),mt=Lt(_e),Rt=C(mt),Pt=C(Rt),zt=I(Rt,2);{var Q=Ce=>{var Le=nZ(),lt=C(Le);Z(()=>q(lt,g(De).subtitle)),T(Ce,Le)};K(zt,Ce=>{g(De).subtitle&&Ce(Q)})}var Xe=I(zt,2),R=C(Xe),X=I(mt,2);vi(X,17,()=>g(De).endpoints,Ce=>Ce.endpointId,(Ce,Le)=>{var lt=DZ(),Nt=C(lt),Oe=C(Nt),je=I(Oe),Be=C(je),Ot=I(je,2);vi(Ot,21,()=>g(Le).clusters,Fn,(Ht,fi)=>{var mi=sZ(),Wi=C(mi);Z(()=>q(Wi,g(fi).name)),T(Ht,mi)});var qe=I(Nt,2);{var ve=Ht=>{var fi=IZ(),mi=I(C(fi));vi(mi,21,()=>g(Le).clusters,Fn,(Wi,J)=>{var de=LZ(),Ke=Lt(de),st=C(Ke),ft=C(st),ct=I(Ke,2);vi(ct,17,()=>Object.entries(g(J).attrs),Fn,(yt,ai)=>{var Ti=ht(()=>eI(g(ai),2));let Yt=()=>g(Ti)[0],ei=()=>g(Ti)[1];var Li=ks(),tn=Lt(Li);{var ze=H=>{const te=ht(()=>{var ue;return(ue=t[g(J).name])==null?void 0:ue[Yt()]}),ye=ht(()=>(Yt()==="acceptedCommandList"||Yt()==="generatedCommandList")&&Array.isArray(ei())),he=ht(()=>{var ue;return((ue=c[g(J).name])==null?void 0:ue[Yt()])??a[Yt()]});var Ie=xZ(),pe=C(Ie),Fe=C(pe),It=C(Fe),Ge=I(Fe);{var dt=ue=>{var le=oZ(),bt=C(le);Z(xt=>q(bt,`(${xt??""})`),[()=>h(g(he))]),T(ue,le)};K(Ge,ue=>{g(he)!==void 0&&ue(dt)})}var ni=I(pe),F=C(ni);{var ie=ue=>{var le=aZ();vi(le,21,()=>g(te),Fn,(bt,xt)=>{var Si=rZ(),Ii=C(Si);Z(()=>q(Ii,g(xt).label)),oe("click",Si,()=>i(g(De).nodeId,g(Le).endpointId,g(J).name,g(xt).command,g(xt).args)),T(bt,Si)}),T(ue,le)};K(F,ue=>{g(te)&&ue(ie)})}var He=I(ni),$e=C(He);{var be=ue=>{var le=uZ();vi(le,21,()=>s(g(J).name,ei()),Fn,(bt,xt,Si)=>{var Ii=hZ(),Ee=Lt(Ii);{var Ze=ti=>{var Xt=lZ();T(ti,Xt)};K(Ee,ti=>{Si>0&&ti(Ze)})}var ot=I(Ee,2);{var Ut=ti=>{var Xt=cZ(),An=Lt(Xt),ki=C(An),Gt=I(An),Gi=C(Gt);Z(()=>{q(ki,g(xt).name),q(Gi,`(${g(xt).id??""})`)}),T(ti,Xt)},Ve=ti=>{var Xt=dZ(),An=C(Xt);Z(()=>q(An,g(xt).id)),T(ti,Xt)};K(ot,ti=>{g(xt).name?ti(Ut):ti(Ve,-1)})}T(bt,Ii)}),T(ue,le)},et=ue=>{var le=pZ(),bt=I(C(le));vi(bt,21,ei,Fn,(xt,Si)=>{const Ii=ht(()=>g(Si)),Ee=ht(()=>g(Ii).deviceType),Ze=ht(()=>r[g(Ee)]);var ot=fZ(),Ut=C(ot),Ve=C(Ut);{var ti=Gt=>{var Gi=gZ(),$i=Lt(Gi),is=I($i),us=C(is);Z($n=>{q($i,`${g(Ze)??""} `),q(us,`(${$n??""})`)},[()=>h(g(Ee))]),T(Gt,Gi)},Xt=Gt=>{var Gi=Tr();Z($i=>q(Gi,$i),[()=>h(g(Ee))]),T(Gt,Gi)};K(Ve,Gt=>{g(Ze)?Gt(ti):Gt(Xt,-1)})}var An=I(Ut),ki=C(An);Z(Gt=>q(ki,Gt),[()=>v(g(Ii).revision)]),T(xt,ot)}),T(ue,le)},it=ht(()=>Yt()==="deviceTypeList"&&Array.isArray(ei())),ge=ue=>{const le=ht(()=>[...new Set(ei().flatMap(Ee=>Object.keys(Ee)))]);var bt=bZ(),xt=C(bt),Si=C(xt);vi(Si,21,()=>g(le),Fn,(Ee,Ze)=>{var ot=mZ(),Ut=C(ot);Z(()=>q(Ut,g(Ze))),T(Ee,ot)});var Ii=I(xt);vi(Ii,21,ei,Fn,(Ee,Ze)=>{var ot=vZ();vi(ot,21,()=>g(le),Fn,(Ut,Ve)=>{var ti=_Z(),Xt=C(ti);Z(An=>q(Xt,An),[()=>v(g(Ze)[g(Ve)])]),T(Ut,ti)}),T(Ee,ot)}),T(ue,bt)},xe=ht(()=>y(ei())),Ye=ue=>{var le=yZ(),bt=C(le);vi(bt,21,()=>Object.entries(ei()),Fn,(xt,Si)=>{var Ii=ht(()=>eI(g(Si),2));let Ee=()=>g(Ii)[0],Ze=()=>g(Ii)[1];var ot=wZ(),Ut=C(ot),Ve=C(Ut),ti=I(Ut),Xt=C(ti);Z(An=>{q(Ve,Ee()),q(Xt,An)},[()=>v(Ze())]),T(xt,ot)}),T(ue,le)},Je=ht(()=>_(ei())),We=ue=>{var le=SZ(),bt=C(le);Z(()=>{Bn(le,"href",ei()),q(bt,ei())}),T(ue,le)},Wt=ue=>{var le=CZ(),bt=C(le);Z(xt=>q(bt,xt),[()=>v(ei())]),T(ue,le)};K($e,ue=>{g(ye)?ue(be):g(it)?ue(et,1):g(xe)?ue(ge,2):g(Je)?ue(Ye,3):(Yt()==="productUrl"||Yt()==="productURL")&&typeof ei()=="string"?ue(We,4):ue(Wt,-1)})}Z(()=>{Bn(pe,"title",Yt()),q(It,Yt())}),T(H,Ie)},j=ht(()=>!S(ei(),Yt()));K(tn,H=>{g(j)&&H(ze)})}T(yt,Li)}),Z(()=>q(ft,g(J).name)),T(Wi,de)}),T(Ht,fi)},Vt=Ht=>{var fi=kZ();T(Ht,fi)};K(qe,Ht=>{g(Le).clusters.length>0?Ht(ve):Ht(Vt,-1)})}Z(()=>{q(Oe,`${g(Le).name??`Endpoint ${g(Le).endpointId}`??""} `),q(Be,`ep${g(Le).endpointId??""}`)}),T(Ce,lt)}),Z(()=>{q(Pt,g(De).name??`Node ${g(De).nodeId}`),q(R,`Node ID: ${g(De).nodeId??""}`)}),T($,_e)},sn=$=>{var _e=PZ();T($,_e)};K(gi,$=>{g(wt)?$(ri):g(Dt)?$(mn,1):g(De)?$(Cn,2):$(sn,-1)})}var Ni=I(Ri,2),an=C(Ni),_n=I(an,2),ln=I(C(_n),2);{var cn=$=>{var _e=TZ(),mt=C(_e);Z(()=>q(mt,g(Y).length)),T($,_e)};K(ln,$=>{!g(G)&&g(Y).length>0&&$(cn)})}var vn=I(ln,2),Dn=C(vn),xn=I(_n,2);{var Rn=$=>{var _e=OZ(),mt=C(_e);{var Rt=zt=>{var Q=MZ();T(zt,Q)},Pt=zt=>{var Q=ks(),Xe=Lt(Q);vi(Xe,17,()=>g(Se),R=>R.id,(R,X)=>{const Ce=ht(()=>{var ve,Vt;return((ve=f.get(g(X).nodeId))==null?void 0:ve.name)??((Vt=g(u).find(Ht=>Ht.nodeId===g(X).nodeId))==null?void 0:Vt.name)??null}),Le=ht(()=>{var ve,Vt;return g(X).endpointId!==void 0?((Vt=(ve=f.get(g(X).nodeId))==null?void 0:ve.endpoints.find(Ht=>Ht.endpointId===g(X).endpointId))==null?void 0:Vt.name)??null:null}),lt=ht(()=>g(X).attrName??g(X).clusterName);var Nt=AZ(),Oe=C(Nt),je=C(Oe),Be=I(Oe,2);{var Ot=ve=>{var Vt=NZ(),Ht=I(Lt(Vt),2),fi=C(Ht),mi=I(fi);{var Wi=st=>{var ft=Py(),ct=I(Lt(ft)),yt=C(ct);Z(()=>q(yt,`(#${g(X).nodeId??""})`)),T(st,ft)};K(mi,st=>{g(Ce)&&st(Wi)})}var J=I(Ht,2);let de;var Ke=C(J);Z(()=>{q(fi,g(Ce)??`#${g(X).nodeId}`),de=jt(J,1,"e-val svelte-1ua3isv",null,de,{"e-online":g(X).online,"e-offline":!g(X).online}),q(Ke,g(X).online?"online":"offline")}),T(ve,Vt)},qe=ve=>{var Vt=RZ(),Ht=I(Lt(Vt),2),fi=C(Ht),mi=I(fi);{var Wi=ei=>{var Li=Py(),tn=I(Lt(Li)),ze=C(tn);Z(()=>q(ze,`(#${g(X).nodeId??""})`)),T(ei,Li)};K(mi,ei=>{g(Ce)&&ei(Wi)})}var J=I(Ht,2),de=C(J),Ke=I(de);{var st=ei=>{var Li=Py(),tn=I(Lt(Li)),ze=C(tn);Z(()=>q(ze,`(ep ${g(X).endpointId??""})`)),T(ei,Li)};K(Ke,ei=>{g(Le)&&ei(st)})}var ft=I(J,2),ct=C(ft),yt=I(ft,2),ai=C(yt),Ti=I(yt,2),Yt=C(Ti);Z(ei=>{q(fi,g(Ce)??`#${g(X).nodeId}`),q(de,g(Le)??`ep${g(X).endpointId}`),q(ct,g(X).clusterName),q(ai,g(lt)),q(Yt,ei)},[()=>p(g(X).value)]),T(ve,Vt)};K(Be,ve=>{g(X).kind==="status"?ve(Ot):ve(qe,-1)})}Z(ve=>q(je,ve),[()=>D(g(X).ts)]),T(R,Nt)}),T(zt,Q)};K(mt,zt=>{g(Se).length===0?zt(Rt):zt(Pt,-1)})}T($,_e)};K(xn,$=>{g(G)&&$(Rn)})}Z(()=>{Ho(Ni,g(G)?`height: ${g(fe)}px;`:""),q(Dn,g(G)?"▾":"▸")}),oe("click",Hn,()=>k(Te,!g(Te))),oe("mousedown",an,Pe),oe("click",vn,()=>{k(G,!g(G))}),T(o,Ki),Io()}hr(["click","mousedown"]);var WZ=A("<button>›</button>"),BZ=A('<span class="chev-ph svelte-1vejtrc"></span>'),zZ=A('<span class="tv svelte-1vejtrc"> </span> <span class="tt svelte-1vejtrc"> </span>',1),VZ=A('<div class="tc svelte-1vejtrc"></div>'),UZ=A('<div class="tn svelte-1vejtrc"><div><!> <span class="seg svelte-1vejtrc"> </span> <!></div> <!></div>'),jZ=A("<option></option>"),$Z=A('<span class="pub-ok svelte-1vejtrc">✓</span>'),qZ=A('<span class="pub-err svelte-1vejtrc"> </span>'),KZ=A('<div class="info svelte-1vejtrc">Loading…</div>'),GZ=A('<div class="info err svelte-1vejtrc"> </div>'),ZZ=A('<div class="info svelte-1vejtrc">No topics match.</div>'),XZ=A('<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>'),YZ=A('<div class="vs svelte-1vejtrc"><div><div class="vrows-abs svelte-1vejtrc"></div></div></div>'),JZ=A('<div class="info svelte-1vejtrc">No topics yet.</div>'),QZ=A('<div class="tree-wrap svelte-1vejtrc"><!></div>'),eX=A('<span class="stream-badge"> </span>'),tX=A('<span class="stream-empty svelte-1vejtrc">Waiting for messages…</span>'),iX=A('<span class="s-ret svelte-1vejtrc" title="retained snapshot">⊛</span>'),nX=A('<div><span class="s-ts svelte-1vejtrc"> </span> <!> <span class="s-topic svelte-1vejtrc"> </span> <span class="s-val svelte-1vejtrc"> </span></div>'),sX=A('<div class="stream-body svelte-1vejtrc"><!></div>'),oX=A('<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),rX=A('<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>'),aX=A('<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),lX=A('<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 cX(o,e){Lo(e,!0);const t=(J,de=Gb)=>{const Ke=ht(()=>g(f).has(de().path)),st=ht(()=>g(a)>=0&&de().children.size>0),ft=ht(()=>g(a)>=0&&de().isLeaf&&!n.has(de().path));var ct=UZ(),yt=C(ct);let ai;var Ti=C(yt);{var Yt=he=>{var Ie=WZ();let pe;Z(()=>{pe=jt(Ie,1,"chev svelte-1vejtrc",null,pe,{open:g(Ke)}),Bn(Ie,"aria-label",g(Ke)?"Collapse":"Expand")}),oe("click",Ie,()=>p(de().path)),T(he,Ie)},ei=he=>{var Ie=BZ();T(he,Ie)};K(Ti,he=>{g(st)?he(Yt):he(ei,-1)})}var Li=I(Ti,2),tn=C(Li),ze=I(Li,2);{var j=he=>{var Ie=zZ(),pe=Lt(Ie),Fe=C(pe),It=I(pe,2),Ge=C(It);Z((dt,ni,F)=>{Bn(pe,"title",dt),q(Fe,ni),q(Ge,F)},[()=>{var dt;return kn((dt=zi(de().path))==null?void 0:dt.val)},()=>{var dt;return kn((dt=zi(de().path))==null?void 0:dt.val)},()=>{var dt;return((dt=zi(de().path))==null?void 0:dt.ts)!=null?Hn(zi(de().path).ts):""}]),T(he,Ie)},H=ht(()=>de().isLeaf&&i.has(de().path));K(ze,he=>{g(H)&&he(j)})}var te=I(yt,2);{var ye=he=>{var Ie=VZ();vi(Ie,21,()=>[...de().children.values()].sort((pe,Fe)=>pe.seg.localeCompare(Fe.seg)),pe=>pe.path,(pe,Fe)=>{t(pe,()=>g(Fe))}),T(he,Ie)};K(te,he=>{g(st)&&g(Ke)&&he(ye)})}Z(()=>{ai=jt(yt,1,"tr svelte-1vejtrc",null,ai,{stale:g(ft)}),q(tn,de().seg)}),oe("click",yt,()=>{k(wt,de().path+"/#")}),oe("contextmenu",yt,he=>{he.preventDefault(),k(at,{x:he.clientX,y:he.clientY,topic:de().path},!0)}),T(J,ct)},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 J of s)u(J);s.clear(),nI(a)}))}const h=new Map;function u(J){const de=J.split("/");let Ke=h,st="";for(let ft=0;ft<de.length;ft++){const ct=de[ft];st=ft===0?ct:`${st}/${ct}`,Ke.has(ct)||Ke.set(ct,{seg:ct,path:st,children:new Map,isLeaf:!1});const yt=Ke.get(ct);ft===de.length-1&&(yt.isLeaf=!0),Ke=yt.children}}let f=V(bi(new Set));function p(J){const de=new Set(g(f));de.has(J)?de.delete(J):de.add(J),k(f,de,!0)}let v=V("");const _=24,y=5;let S=V(0),D=V(300),E=ht(()=>{if(g(a),!g(v))return[];const J=g(v).toLowerCase().split(/\s+/).filter(Boolean),de=[];for(const[Ke,st]of i){const ft=Ke.toLowerCase();J.every(ct=>ft.includes(ct))&&de.push({topic:Ke,...st})}return de.sort((Ke,st)=>Ke.topic.localeCompare(st.topic))}),N=ht(()=>{const J=g(E).length,de=Math.max(0,Math.floor(g(S)/_)-y),Ke=Math.min(J,Math.ceil((g(S)+g(D))/_)+y);return{start:de,end:Ke,totalH:J*_,top:de*_}});const z=1e3,O=200,Y=20,G=36;let fe=0,Se=V(bi([])),Pe=V(bi([])),De=V(!0),wt=V("#"),Dt=V(200);Pn(()=>{const J=g(wt).trim(),de=gl(()=>g(Se)),Ke=!J||J==="#"?de.slice(0,O):de.filter(st=>Te(J,st.topic)).slice(0,O);if(J&&J!=="#"){const st=new Set(Ke.map(ct=>ct.topic)),ft=[];for(const[ct,yt]of i)st.has(ct)||Te(J,ct)&&ft.push({id:-(ft.length+1),topic:ct,val:yt.val,ts:yt.ts,retained:!0});ft.sort((ct,yt)=>ct.topic.localeCompare(yt.topic)),k(Pe,[...Ke,...ft],!0)}else k(Pe,Ke,!0)});function Te(J,de){if(J==="#")return!0;const Ke=J.split("/"),st=de.split("/");for(let ft=0;ft<Ke.length;ft++){if(Ke[ft]==="#")return!0;if(ft>=st.length||Ke[ft]!=="+"&&Ke[ft]!==st[ft])return!1}return Ke.length===st.length}function $t(J){J.preventDefault();const de=J.clientY,Ke=g(Dt);function st(ct){k(Dt,Math.max(60,Math.min(800,Ke+de-ct.clientY)),!0)}function ft(){document.removeEventListener("mousemove",st),document.removeEventListener("mouseup",ft)}document.addEventListener("mousemove",st),document.addEventListener("mouseup",ft)}let rt=ht(()=>{const J=Math.max(1,Math.floor((g(Dt)-G)/Y)+1);return g(Pe).slice(0,J)}),Mt=V(!0),ke=V(null);async function Ct(){k(Mt,!0),k(ke,null);try{const J=await JN();for(const de of J)i.set(de.topic,{val:de.val,ts:de.ts}),u(de.topic)}catch(J){k(ke,J instanceof Error?J.message:String(J),!0)}finally{k(Mt,!1),nI(a)}}const Ue=Hl("mqtt",J=>{const{topic:de,val:Ke,ts:st}=J;i.set(de,{val:Ke,ts:st}),n.add(de),s.add(de),c();const ft={id:fe++,topic:de,val:Ke,ts:st};k(Se,[ft,...g(Se).slice(0,z-1)],!0);const ct=g(wt).trim();(!ct||ct==="#"||Te(ct,de))&&k(Pe,[ft,...g(Pe).filter(yt=>!(yt.retained&&yt.topic===de)).slice(0,O-1)],!0)});let at=V(null),Et=V(null);async function Jt(J,de){const Ke=[J];if(de){const st=J+"/";for(const ft of i.keys())ft.startsWith(st)&&Ke.push(ft)}for(const st of Ke)await nD(st,"",!0,0)}let Qt=ht(()=>(g(a),[...i.keys()].sort())),Ft=V(""),At=V(""),ji=V(!1),en=V(0),jn=V(!1),Ki=V(null),Ri=V(!1);async function In(){if(g(Ft)){k(jn,!0),k(Ki,null),k(Ri,!1);try{await nD(g(Ft),g(At),g(ji),g(en)),k(Ri,!0),setTimeout(()=>{k(Ri,!1)},2e3)}catch(J){k(Ki,J instanceof Error?J.message:String(J),!0)}finally{k(jn,!1)}}}function kn(J){return J==null?"":typeof J=="object"?JSON.stringify(J):String(J)}function Hn(J){return new Date(J).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function fn(J){return new Date(J).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function zi(J){return g(a),i.get(J)}let Nn=ht(()=>(g(a),[...h.values()].sort((J,de)=>J.seg.localeCompare(de.seg)))),pn=ht(()=>(g(a),i.size));Wr(Ct),Qb(()=>{Ue(),r!==null&&cancelAnimationFrame(r)});var tt=lX(),qt=I(C(tt),2),ui=C(qt),gi=C(ui),ri=I(gi,2);vi(ri,20,()=>g(Qt),J=>J,(J,de)=>{var Ke=jZ(),st={};Z(()=>{st!==(st=de)&&(Ke.value=(Ke.__value=de)??"")}),T(J,Ke)});var mn=I(ri,2),Cn=I(mn,2),sn=C(Cn),Ni=I(Cn,2),an=C(Ni);an.value=an.__value=0;var _n=I(an);_n.value=_n.__value=1;var ln=I(_n);ln.value=ln.__value=2;var cn=I(Ni,2),vn=I(cn,2);{var Dn=J=>{var de=$Z();T(J,de)};K(vn,J=>{g(Ri)&&J(Dn)})}var xn=I(vn,2);{var Rn=J=>{var de=qZ(),Ke=C(de);Z(()=>q(Ke,g(Ki))),T(J,de)};K(xn,J=>{g(Ki)&&J(Rn)})}var $=I(ui,2),_e=C($),mt=I(_e,2),Rt=C(mt);{var Pt=J=>{var de=Tr();Z(()=>q(de,`${g(E).length??""} /`)),T(J,de)};K(Rt,J=>{g(v)&&J(Pt)})}var zt=I(Rt),Q=I($,2);{var Xe=J=>{var de=KZ();T(J,de)},R=J=>{var de=GZ(),Ke=C(de);Z(()=>q(Ke,g(ke))),T(J,de)},X=J=>{var de=ks(),Ke=Lt(de);{var st=ct=>{var yt=ZZ();T(ct,yt)},ft=ct=>{var yt=YZ(),ai=C(yt),Ti=C(ai);vi(Ti,21,()=>g(E).slice(g(N).start,g(N).end),Yt=>Yt.topic,(Yt,ei)=>{var Li=XZ(),tn=C(Li),ze=C(tn),j=I(tn,2),H=C(j),te=I(j,2),ye=C(te);Z((he,Ie,pe)=>{q(ze,g(ei).topic),Bn(j,"title",he),q(H,Ie),q(ye,pe)},[()=>kn(g(ei).val),()=>kn(g(ei).val),()=>Hn(g(ei).ts)]),T(Yt,Li)}),Z(()=>{Ho(ai,`height: ${g(N).totalH??""}px; position: relative;`),Ho(Ti,`top: ${g(N).top??""}px;`)}),Qn("scroll",yt,Yt=>{k(S,Yt.currentTarget.scrollTop,!0)}),bW(yt,"clientHeight",Yt=>k(D,Yt)),T(ct,yt)};K(Ke,ct=>{g(E).length===0?ct(st):ct(ft,-1)})}T(J,de)},Ce=J=>{var de=QZ(),Ke=C(de);{var st=ct=>{var yt=JZ();T(ct,yt)},ft=ct=>{var yt=ks(),ai=Lt(yt);vi(ai,17,()=>g(Nn),Ti=>Ti.path,(Ti,Yt)=>{t(Ti,()=>g(Yt))}),T(ct,yt)};K(Ke,ct=>{g(Nn).length===0?ct(st):ct(ft,-1)})}T(J,de)};K(Q,J=>{g(Mt)?J(Xe):g(ke)?J(R,1):g(v)?J(X,2):J(Ce,-1)})}var Le=I(qt,2),lt=C(Le),Nt=I(lt,2),Oe=C(Nt),je=I(Oe,2);{var Be=J=>{var de=eX(),Ke=C(de);Z(()=>q(Ke,g(Pe).length)),T(J,de)};K(je,J=>{!g(De)&&g(Pe).length>0&&J(Be)})}var Ot=I(je,2),qe=C(Ot),ve=I(Nt,2);{var Vt=J=>{var de=sX(),Ke=C(de);{var st=ct=>{var yt=tX();T(ct,yt)},ft=ct=>{var yt=ks(),ai=Lt(yt);vi(ai,17,()=>g(rt),Ti=>Ti.id,(Ti,Yt)=>{var ei=nX();let Li;var tn=C(ei),ze=C(tn),j=I(tn,2);{var H=pe=>{var Fe=iX();T(pe,Fe)};K(j,pe=>{g(Yt).retained&&pe(H)})}var te=I(j,2),ye=C(te),he=I(te,2),Ie=C(he);Z((pe,Fe,It)=>{Li=jt(ei,1,"sr svelte-1vejtrc",null,Li,{retained:g(Yt).retained}),q(ze,pe),q(ye,g(Yt).topic),Bn(he,"title",Fe),q(Ie,It)},[()=>fn(g(Yt).ts),()=>kn(g(Yt).val),()=>kn(g(Yt).val)]),T(Ti,ei)}),T(ct,yt)};K(Ke,ct=>{g(rt).length===0?ct(st):ct(ft,-1)})}T(J,de)};K(ve,J=>{g(De)&&J(Vt)})}var Ht=I(Le,2);{var fi=J=>{var de=oX(),Ke=Lt(de),st=I(Ke,2);let ft;var ct=C(st),yt=I(ct,2);Z(()=>ft=Ho(st,"",ft,{left:`${g(at).x??""}px`,top:`${g(at).y??""}px`})),oe("click",Ke,()=>k(at,null)),oe("contextmenu",Ke,ai=>{ai.preventDefault(),k(at,null)}),oe("click",ct,()=>{navigator.clipboard.writeText(g(at).topic),k(at,null)}),oe("click",yt,()=>{const ai=g(at).topic,Ti=ai+"/",Yt=[...i.keys()].some(ei=>ei.startsWith(Ti));k(Et,{topic:ai,hasChildren:Yt,recursive:!1},!0),k(at,null)}),T(J,de)};K(Ht,J=>{g(at)&&J(fi)})}var mi=I(Ht,2);{var Wi=J=>{var de=aX(),Ke=Lt(de),st=I(Ke,2),ft=I(C(st),2),ct=C(ft),yt=I(C(ct)),ai=C(yt),Ti=I(ct,2);{var Yt=ze=>{var j=rX(),H=C(j);no(H,()=>g(Et).recursive,te=>g(Et).recursive=te),T(ze,j)};K(Ti,ze=>{g(Et).hasChildren&&ze(Yt)})}var ei=I(ft,2),Li=C(ei),tn=I(Li,2);Z(()=>q(ai,g(Et).topic)),oe("click",Ke,()=>k(Et,null)),oe("click",Li,()=>k(Et,null)),oe("click",tn,()=>{const{topic:ze,recursive:j}=g(Et);k(Et,null),Jt(ze,j)}),T(J,de)};K(mi,J=>{g(Et)&&J(Wi)})}Z(()=>{cn.disabled=g(jn)||!g(Ft),q(zt,` ${g(pn)??""}`),Ho(Le,g(De)?`height: ${g(Dt)}px;`:""),q(qe,g(De)?"▾":"▸")}),Mi(gi,()=>g(Ft),J=>k(Ft,J)),Mi(mn,()=>g(At),J=>k(At,J)),no(sn,()=>g(ji),J=>k(ji,J)),za(Ni,()=>g(en),J=>k(en,J)),oe("click",cn,In),Mi(_e,()=>g(v),J=>k(v,J)),oe("mousedown",lt,$t),Mi(Oe,()=>g(wt),J=>k(wt,J)),oe("click",Ot,()=>{k(De,!g(De))}),T(o,tt),Io()}hr(["click","contextmenu","mousedown"]);var dX=A('<div class="restart-banner svelte-twakcj">⚠ Package changes require a daemon restart to take effect. Use the ↺ button in the topbar.</div>'),hX=A('<div class="err svelte-twakcj"> </div>'),uX=A('<span class="pane-count pane-count--warn svelte-twakcj"> </span>'),gX=A('<p class="empty svelte-twakcj">No packages installed.</p>'),fX=A('<p class="empty svelte-twakcj">No match.</p>'),pX=A('<span class="dep-latest svelte-twakcj"> </span>'),mX=nT('<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>'),_X=nT('<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>'),vX=A('<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>'),bX=A('<span class="result-desc svelte-twakcj"> </span>'),wX=A('<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>'),yX=A('<div class="results-list svelte-twakcj"></div>'),SX=A('<pre class="npm-output svelte-twakcj"> </pre>'),CX=A(`<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>`),xX=A('<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 LX(o,e){Lo(e,!0);let t=V(bi([])),i=V(""),n=V(bi({})),s=V(!1),r=V(""),a=V(bi([])),c=V(!1),h=V(!1),u=V(""),f=V(""),p=bi({});const v=ht(()=>g(i).trim()?g(t).filter(tt=>tt.name.toLowerCase().includes(g(i).toLowerCase())):g(t)),_=ht(()=>Object.keys(g(n)).length);Wr(async()=>{await Promise.all([y(),S()])});async function y(){try{k(t,await n8(),!0),k(u,"")}catch(tt){k(u,tt.message,!0)}}async function S(){try{k(n,await l8(),!0)}catch{}}async function D(){k(s,!0);try{k(n,await c8(),!0)}catch{}finally{k(s,!1)}}async function E(){const tt=g(r).trim();if(!tt){k(a,[],!0);return}k(h,!0),k(u,"");try{k(a,await s8(tt),!0)}catch(qt){k(u,qt.message,!0)}finally{k(h,!1)}}async function N(tt,qt){p[tt]=!0,k(u,""),k(f,"");try{const ui=await o8(tt,qt);k(f,ui.stdout||ui.stderr||"Done.",!0),k(c,!0),await y()}catch(ui){k(u,ui.message,!0)}finally{p[tt]=!1}}async function z(tt){p[tt]=!0,k(u,""),k(f,"");try{const qt=await r8(tt);k(f,qt.stdout||qt.stderr||"Done.",!0),k(c,!0);const ui={...g(n)};delete ui[tt],k(n,ui,!0),await y()}catch(qt){k(u,qt.message,!0)}finally{p[tt]=!1}}async function O(tt){p[tt]=!0,k(u,""),k(f,"");try{const qt=await a8(tt);k(f,qt.stdout||qt.stderr||"Done.",!0),k(c,!0);const ui={...g(n)};delete ui[tt],k(n,ui,!0),await y()}catch(qt){k(u,qt.message,!0)}finally{p[tt]=!1}}var Y=xX(),G=C(Y);{var fe=tt=>{var qt=dX();T(tt,qt)};K(G,tt=>{g(c)&&tt(fe)})}var Se=I(G,2);{var Pe=tt=>{var qt=hX(),ui=C(qt);Z(()=>q(ui,g(u))),T(tt,qt)};K(Se,tt=>{g(u)&&tt(Pe)})}var De=I(Se,2),wt=C(De),Dt=C(wt),Te=I(C(Dt),2),$t=C(Te),rt=I(Te,2);{var Mt=tt=>{var qt=uX(),ui=C(qt);Z(()=>q(ui,`${g(_)??""} outdated`)),T(tt,qt)};K(rt,tt=>{g(_)>0&&tt(Mt)})}var ke=I(rt,2),Ct=C(ke);let Ue;var at=I(Dt,2),Et=C(at),Jt=I(at,2),Qt=C(Jt);{var Ft=tt=>{var qt=gX();T(tt,qt)},At=tt=>{var qt=fX();T(tt,qt)},ji=tt=>{var qt=ks(),ui=Lt(qt);vi(ui,17,()=>g(v),gi=>gi.name,(gi,ri)=>{var mn=vX();let Cn;var sn=C(mn),Ni=C(sn),an=C(Ni),_n=I(Ni,2),ln=C(_n),cn=I(_n,2);{var vn=Pt=>{var zt=pX(),Q=C(zt);Z(()=>q(Q,`→ v${g(n)[g(ri).name].latest??""}`)),T(Pt,zt)};K(cn,Pt=>{g(n)[g(ri).name]&&Pt(vn)})}var Dn=I(sn,2),xn=C(Dn);let Rn;var $=C(xn);{var _e=Pt=>{var zt=mX();T(Pt,zt)},mt=Pt=>{var zt=_X();T(Pt,zt)};K($,Pt=>{p[g(ri).name]?Pt(_e):Pt(mt,-1)})}var Rt=I(xn,2);Z(()=>{Cn=jt(mn,1,"dep-row svelte-twakcj",null,Cn,{"dep-busy":!!p[g(ri).name]}),Bn(Ni,"href",g(ri).url??`https://www.npmjs.com/package/${g(ri).name}`),q(an,g(ri).name),q(ln,g(ri).installedVersion??g(ri).version),Rn=jt(xn,1,"icon-btn svelte-twakcj",null,Rn,{"icon-btn--update":!!g(n)[g(ri).name]}),xn.disabled=!!p[g(ri).name],Bn(xn,"title",g(n)[g(ri).name]?`Update to v${g(n)[g(ri).name].latest}`:"Update to latest"),Rt.disabled=!!p[g(ri).name]}),oe("click",xn,()=>O(g(ri).name)),oe("click",Rt,()=>z(g(ri).name)),T(gi,mn)}),T(tt,qt)};K(Qt,tt=>{g(t).length===0?tt(Ft):g(v).length===0?tt(At,1):tt(ji,-1)})}var en=I(wt,2),jn=I(C(en),2),Ki=C(jn),Ri=I(Ki,2),In=C(Ri),kn=I(jn,2);{var Hn=tt=>{var qt=yX();vi(qt,21,()=>g(a),ui=>ui.name,(ui,gi)=>{var ri=wX(),mn=C(ri),Cn=C(mn),sn=C(Cn),Ni=I(Cn,2),an=C(Ni),_n=I(Ni,2);{var ln=Dn=>{var xn=bX(),Rn=C(xn);Z(()=>q(Rn,g(gi).description)),T(Dn,xn)};K(_n,Dn=>{g(gi).description&&Dn(ln)})}var cn=I(mn,2),vn=C(cn);Z(()=>{Bn(Cn,"href",g(gi).url??`https://www.npmjs.com/package/${g(gi).name}`),q(sn,g(gi).name),q(an,g(gi).version),cn.disabled=!!p[g(gi).name],q(vn,p[g(gi).name]?"Installing…":"Install")}),oe("click",cn,()=>N(g(gi).name)),T(ui,ri)}),T(tt,qt)};K(kn,tt=>{g(a).length>0&&tt(Hn)})}var fn=I(kn,2);{var zi=tt=>{var qt=SX(),ui=C(qt);Z(()=>q(ui,g(f))),T(tt,qt)};K(fn,tt=>{g(f)&&tt(zi)})}var Nn=I(fn,2);{var pn=tt=>{var qt=CX();T(tt,qt)};K(Nn,tt=>{!g(a).length&&!g(f)&&tt(pn)})}Z(()=>{q($t,g(t).length),ke.disabled=g(s),Ue=jt(Ct,0,"svelte-twakcj",null,Ue,{spinning:g(s)}),Ri.disabled=g(h),q(In,g(h)?"Searching…":"Search")}),oe("click",ke,D),Mi(Et,()=>g(i),tt=>k(i,tt)),oe("keydown",Ki,tt=>tt.key==="Enter"&&E()),Mi(Ki,()=>g(r),tt=>k(r,tt)),oe("click",Ri,E),T(o,Y),Io()}hr(["click","keydown"]);var IX=A('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),kX=A('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),DX=A('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),EX=A('<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>'),PX=A('<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>'),TX=A('<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),MX=A('<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),NX=A('<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>'),RX=A('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),AX=A('<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>'),OX=A('<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>'),FX=A('<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>'),HX=A('<div class="login-error svelte-1n46o8q"> </div>'),WX=A('<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>'),BX=A('<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>'),zX=A("<!> <!> <!>",1);function VX(o,e){Lo(e,!0);const t=["scripts","mqtt","matter","db","logs","config","packages"];function i(){const Te=location.hash.slice(1);return t.includes(Te)?Te:"scripts"}let n=V(bi(i())),s=V(null),r=V(!1),a=V(!1),c=V(!1),h=V(!1),u=V("none"),f=V(""),p=V(!1),v=V(""),_=V(""),y=V(!1),S=V(!1);H7(()=>{k(p,!0)});async function D(){k(_,""),k(y,!0);try{await z7(g(v)),k(v,""),k(p,!1)}catch(Te){k(_,Te.message??"Login failed",!0)}finally{k(y,!1)}}async function E(){if(g(u)==="proxy"&&g(f)){window.location.href=g(f);return}await V7(),k(p,!0)}async function N(){if(confirm("Restart the she daemon? The page will reload after a moment."))try{await K7(),setTimeout(()=>location.reload(),2500)}catch{}}async function z(){k(c,!0);try{const Te=await Z7();g(s)&&k(s,{...g(s),latestVersion:Te.latestVersion??void 0},!0)}catch{}finally{k(c,!1)}}async function O(){var rt;if(!confirm(`Update to v${(rt=g(s))==null?void 0:rt.latestVersion}? The daemon will restart after the update completes.`))return;k(a,!1),k(h,!0);try{await G7()}catch{}let Te=!1;const $t=Date.now()+18e4;for(;Date.now()<$t;){await new Promise(Mt=>setTimeout(Mt,2e3));try{if(await Kx(),Te){location.reload();return}}catch{Te=!0}}location.reload()}function Y(Te){k(n,Te,!0),location.hash=Te}Wr(async()=>{location.hash||(location.hash=g(n));const Te=()=>{k(n,i(),!0)};window.addEventListener("hashchange",Te);try{const Mt=await B7();k(u,Mt.mode,!0),k(f,Mt.proxyLogoutUrl??"",!0),g(u)==="password"&&(await fetch("/she/scripts")).status===401&&k(p,!0)}catch{}k(S,!0);async function $t(){try{k(s,await Kx(),!0)}catch{}}$t();const rt=setInterval($t,5e3);return()=>{window.removeEventListener("hashchange",Te),clearInterval(rt)}});var G=zX();Qn("click",OP,()=>{g(r)&&k(r,!1),g(a)&&k(a,!1)});var fe=Lt(G);{var Se=Te=>{var $t=FX(),rt=C($t),Mt=I(C(rt),2);let ke;var Ct=I(Mt,2);let Ue;var at=I(Ct,2);let Et;var Jt=I(at,2);let Qt;var Ft=I(Jt,2);let At;var ji=I(Ft,2);let en;var jn=I(ji,4),Ki=I(C(jn),2),Ri=C(Ki),In=C(Ri);In.nodeValue="v0.23.2 ";var kn=I(In);{var Hn=Le=>{var lt=IX();T(Le,lt)};K(kn,Le=>{var lt;(lt=g(s))!=null&<.latestVersion&&Le(Hn)})}var fn=I(Ri,2);{var zi=Le=>{var lt=PX(),Nt=C(lt),Oe=I(C(Nt));Oe.textContent="v0.23.2";var je=I(Oe,2);{var Be=J=>{var de=kX(),Ke=I(Lt(de)),st=C(Ke);Z(()=>q(st,`v${g(s).latestVersion??""}`)),T(J,de)},Ot=J=>{var de=DX();T(J,de)};K(je,J=>{var de;(de=g(s))!=null&&de.latestVersion?J(Be):J(Ot,-1)})}var qe=I(Nt,2),ve=C(qe);{var Vt=J=>{var de=EX(),Ke=I(C(de));Z(()=>q(Ke,` Update to v${g(s).latestVersion??""}`)),oe("click",de,O),T(J,de)};K(ve,J=>{var de;(de=g(s))!=null&&de.latestVersion&&J(Vt)})}var Ht=I(ve,2),fi=C(Ht);let mi;var Wi=I(fi);Z(()=>{Ht.disabled=g(c),mi=jt(fi,0,"svelte-1n46o8q",null,mi,{spinning:g(c)}),q(Wi,` ${g(c)?"Checking…":"Check for updates"}`)}),oe("click",lt,J=>J.stopPropagation()),oe("click",Ht,z),T(Le,lt)};K(fn,Le=>{g(a)&&Le(zi)})}var Nn=I(Ki,2),pn=C(Nn),tt=I(pn,2);{var qt=Le=>{var lt=AX(),Nt=C(lt);{var Oe=qe=>{var ve=NX(),Vt=I(C(ve)),Ht=C(Vt),fi=I(Vt,3),mi=C(fi),Wi=I(fi,3),J=C(Wi),de=I(Wi,2);{var Ke=Li=>{var tn=TX(),ze=I(Lt(tn)),j=C(ze),H=I(ze,3),te=C(H);Z(()=>{q(j,g(s).matterNodes??0),q(te,g(s).matterEndpoints??0)}),T(Li,tn)};K(de,Li=>{g(s).matterEnabled&&Li(Ke)})}var st=I(de,2);{var ft=Li=>{var tn=MX(),ze=I(Lt(tn)),j=C(ze),H=I(ze,3),te=C(H);Z(()=>{q(j,g(s).dbDocs??"—"),q(te,g(s).dbViews??"—")}),T(Li,tn)};K(st,Li=>{g(s).dbEnabled&&Li(ft)})}var ct=I(st,3),yt=C(ct),ai=I(ct,3),Ti=C(ai),Yt=I(ai,3),ei=C(Yt);Z(()=>{q(Ht,g(s).scripts),q(mi,g(s).topics),q(J,g(s).mqttMsgPerSec??"—"),q(yt,g(s).handlers??"—"),q(Ti,g(s).memMb!=null?g(s).memMb+" MB":"—"),q(ei,g(s).cpuPercent!=null?g(s).cpuPercent+" %":"—")}),T(qe,ve)},je=qe=>{var ve=RX();T(qe,ve)};K(Nt,qe=>{g(s)?qe(Oe):qe(je,-1)})}var Be=I(Nt,2),Ot=C(Be);oe("click",lt,qe=>qe.stopPropagation()),oe("click",Ot,()=>{k(r,!1),N()}),T(Le,lt)};K(tt,Le=>{g(r)&&Le(qt)})}var ui=I(Nn,2);let gi;var ri=I(ui,2);{var mn=Le=>{var lt=OX();oe("click",lt,E),T(Le,lt)};K(ri,Le=>{g(u)==="password"&&Le(mn)})}var Cn=I(rt,2),sn=C(Cn);let Ni;var an=C(sn);{let Le=ht(()=>g(n)==="scripts");tG(an,{get active(){return g(Le)}})}var _n=I(sn,2);let ln;var cn=C(_n);LX(cn,{});var vn=I(_n,2);let Dn;var xn=C(vn);cX(xn,{});var Rn=I(vn,2);let $;var _e=C(Rn);HZ(_e,{});var mt=I(Rn,2);let Rt;var Pt=C(mt);G9(Pt,{});var zt=I(mt,2);let Q;var Xe=C(zt);BG(Xe,{});var R=I(zt,2);let X;var Ce=C(R);jG(Ce,{}),Z(()=>{ke=jt(Mt,1,"svelte-1n46o8q",null,ke,{active:g(n)==="scripts"}),Ue=jt(Ct,1,"svelte-1n46o8q",null,Ue,{active:g(n)==="packages"}),Et=jt(at,1,"svelte-1n46o8q",null,Et,{active:g(n)==="mqtt"}),Qt=jt(Jt,1,"svelte-1n46o8q",null,Qt,{active:g(n)==="matter"}),At=jt(Ft,1,"svelte-1n46o8q",null,At,{active:g(n)==="db"}),en=jt(ji,1,"svelte-1n46o8q",null,en,{active:g(n)==="logs"}),gi=jt(ui,1,"nav-settings svelte-1n46o8q",null,gi,{active:g(n)==="config"}),Ni=jt(sn,1,"page-wrap svelte-1n46o8q",null,Ni,{hidden:g(n)!=="scripts"}),ln=jt(_n,1,"page-wrap svelte-1n46o8q",null,ln,{hidden:g(n)!=="packages"}),Dn=jt(vn,1,"page-wrap svelte-1n46o8q",null,Dn,{hidden:g(n)!=="mqtt"}),$=jt(Rn,1,"page-wrap svelte-1n46o8q",null,$,{hidden:g(n)!=="matter"}),Rt=jt(mt,1,"page-wrap svelte-1n46o8q",null,Rt,{hidden:g(n)!=="db"}),Q=jt(zt,1,"page-wrap svelte-1n46o8q",null,Q,{hidden:g(n)!=="config"}),X=jt(R,1,"page-wrap svelte-1n46o8q",null,X,{hidden:g(n)!=="logs"})}),oe("click",Mt,()=>Y("scripts")),oe("click",Ct,()=>Y("packages")),oe("click",at,()=>Y("mqtt")),oe("click",Jt,()=>Y("matter")),oe("click",Ft,()=>Y("db")),oe("click",ji,()=>Y("logs")),oe("click",Ri,Le=>{Le.stopPropagation(),k(a,!g(a)),k(r,!1)}),oe("click",pn,Le=>{Le.stopPropagation(),k(r,!g(r)),k(a,!1)}),oe("click",ui,()=>Y("config")),T(Te,$t)};K(fe,Te=>{g(S)&&!g(p)&&Te(Se)})}var Pe=I(fe,2);{var De=Te=>{var $t=WX(),rt=C($t),Mt=I(C(rt),4),ke=I(C(Mt),2),Ct=I(Mt,2);{var Ue=Jt=>{var Qt=HX(),Ft=C(Qt);Z(()=>q(Ft,g(_))),T(Jt,Qt)};K(Ct,Jt=>{g(_)&&Jt(Ue)})}var at=I(Ct,2),Et=C(at);Z(()=>{ke.disabled=g(y),at.disabled=g(y)||!g(v),q(Et,g(y)?"Signing in…":"Sign in")}),Qn("submit",rt,Jt=>{Jt.preventDefault(),D()}),Mi(ke,()=>g(v),Jt=>k(v,Jt)),T(Te,$t)};K(Pe,Te=>{g(p)&&Te(De)})}var wt=I(Pe,2);{var Dt=Te=>{var $t=BX();T(Te,$t)};K(wt,Te=>{g(h)&&Te(Dt)})}T(o,G),Io()}hr(["click"]);oW(VX,{target:document.getElementById("app")});export{mT as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-
|
|
1
|
+
import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-IaTuET9d.js";/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
4
4
|
* Released under the MIT license
|
package/dist/web/index.html
CHANGED
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
}
|
|
156
156
|
})();
|
|
157
157
|
</script>
|
|
158
|
-
<script type="module" crossorigin src="/assets/index-
|
|
158
|
+
<script type="module" crossorigin src="/assets/index-IaTuET9d.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-BPk8Jr3B.css">
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1041,14 +1041,17 @@ function unloadScript(file) {
|
|
|
1041
1041
|
log.info(unloadLabel, 'unloading');
|
|
1042
1042
|
scriptOrigins.delete(file);
|
|
1043
1043
|
|
|
1044
|
+
let removedCallbacks = 0;
|
|
1045
|
+
let removedTimers = 0;
|
|
1046
|
+
|
|
1044
1047
|
// Remove MQTT subscriptions belonging to this script
|
|
1045
1048
|
for (let i = subscriptions.length - 1; i >= 0; i--) {
|
|
1046
|
-
if (subscriptions[i]._script === file) subscriptions.splice(i, 1);
|
|
1049
|
+
if (subscriptions[i]._script === file) { subscriptions.splice(i, 1); removedCallbacks++; }
|
|
1047
1050
|
}
|
|
1048
1051
|
|
|
1049
1052
|
// Remove MQTT event callbacks (connect/disconnect) belonging to this script
|
|
1050
1053
|
for (let i = mqttEventCallbacks.length - 1; i >= 0; i--) {
|
|
1051
|
-
if (mqttEventCallbacks[i]._script === file) mqttEventCallbacks.splice(i, 1);
|
|
1054
|
+
if (mqttEventCallbacks[i]._script === file) { mqttEventCallbacks.splice(i, 1); removedCallbacks++; }
|
|
1052
1055
|
}
|
|
1053
1056
|
|
|
1054
1057
|
// Remove HTTP routes registered by this script via she.api
|
|
@@ -1059,6 +1062,7 @@ function unloadScript(file) {
|
|
|
1059
1062
|
const jobs = scriptJobs.get(file);
|
|
1060
1063
|
if (jobs) {
|
|
1061
1064
|
jobs.forEach((job) => job && job.cancel());
|
|
1065
|
+
removedTimers += jobs.length;
|
|
1062
1066
|
scriptJobs.delete(file);
|
|
1063
1067
|
}
|
|
1064
1068
|
|
|
@@ -1067,6 +1071,7 @@ function unloadScript(file) {
|
|
|
1067
1071
|
if (sunEvents[i]._script === file) {
|
|
1068
1072
|
if (sunEvents[i]._job) sunEvents[i]._job.cancel();
|
|
1069
1073
|
sunEvents.splice(i, 1);
|
|
1074
|
+
removedTimers++;
|
|
1070
1075
|
}
|
|
1071
1076
|
}
|
|
1072
1077
|
|
|
@@ -1074,6 +1079,7 @@ function unloadScript(file) {
|
|
|
1074
1079
|
const timers = scriptTimers.get(file);
|
|
1075
1080
|
if (timers) {
|
|
1076
1081
|
timers.forEach((id) => clearTimeout(id));
|
|
1082
|
+
removedTimers += timers.size;
|
|
1077
1083
|
scriptTimers.delete(file);
|
|
1078
1084
|
}
|
|
1079
1085
|
|
|
@@ -1082,6 +1088,7 @@ function unloadScript(file) {
|
|
|
1082
1088
|
if (varSubscriptions[i]._script === file) {
|
|
1083
1089
|
store.removeListener('change', varSubscriptions[i].handler);
|
|
1084
1090
|
varSubscriptions.splice(i, 1);
|
|
1091
|
+
removedCallbacks++;
|
|
1085
1092
|
}
|
|
1086
1093
|
}
|
|
1087
1094
|
|
|
@@ -1095,6 +1102,13 @@ function unloadScript(file) {
|
|
|
1095
1102
|
matterSandbox.cleanup(file);
|
|
1096
1103
|
}
|
|
1097
1104
|
|
|
1105
|
+
if (removedCallbacks > 0 || removedTimers > 0) {
|
|
1106
|
+
const parts = [];
|
|
1107
|
+
if (removedCallbacks > 0) parts.push(`${removedCallbacks} callback${removedCallbacks !== 1 ? 's' : ''}`);
|
|
1108
|
+
if (removedTimers > 0) parts.push(`${removedTimers} timer${removedTimers !== 1 ? 's' : ''}`);
|
|
1109
|
+
log.debug(unloadLabel, `unregistered ${parts.join(' and ')}`);
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1098
1112
|
// Remove from scripts map so it can be re-loaded
|
|
1099
1113
|
delete scripts[file];
|
|
1100
1114
|
}
|