smart-home-engine 0.27.2 → 0.27.3
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-BvKJjsOI.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var rA=Object.defineProperty;var FL=o=>{throw TypeError(o)};var aA=(o,e,t)=>e in o?rA(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var Wi=(o,e,t)=>aA(o,typeof e!="symbol"?e+"":e,t),Xy=(o,e,t)=>e.has(o)||FL("Cannot "+t);var ee=(o,e,t)=>(Xy(o,e,"read from private field"),t?t.call(o):e.get(o)),Pi=(o,e,t)=>e.has(o)?FL("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,t),Ti=(o,e,t,i)=>(Xy(o,e,"write to private field"),i?i.call(o,t):e.set(o,t),t),En=(o,e,t)=>(Xy(o,e,"access private method"),t);import{_ as YD,m as JD,l as wt,A as io,C as ae,I as Mn,D as Hp,a as ns,g as QD,M as lt,b as Zt,E as qr,c as M,r as tn,d as vr,e as y,f as lA,h as wn,R as Ni,S as Ut,i as Ws,j as br,k as zi,n as vi,o as ne,p as Ce,K as rs,q as pt,s as ze,t as hs,u as z,v as Di,O as xa,w as ls,P as xt,x as Yy,y as Wp,z as eE,B as Qa,F as Kr,G as Yw,H as Cs,U as an,J as Gu,L as Lt,N as ol,Q as cA,T as Ys,V as Jw,W as dA,X as tE,$ as ft,Y as Ki,Z as Bi,a0 as $n,a1 as di,a2 as Mo,a3 as Uf,a4 as He,a5 as r_,a6 as hA,a7 as uA,a8 as ds,a9 as gA,aa as Gr,ab as no,ac as Mt,ad as iE,ae as Pn,af as fA,ag as pA,ah as Qs,ai as Lg,aj as as,ak as Gb,al as Ks,am as xc,an as S0,ao as Zb,ap as ys,aq as Zu,ar as ws,as as Xb,at as Yb,au as mA,av as Bp,aw as kg,ax as pl,ay as _A,az as Ig,aA as vA,aB as C0,aC as bA,aD as yA,aE as HL,aF as is,aG as el,aH as Gs,aI as mi,aJ as Za,aK as wA,aL as Da,aM as Eo,aN as ms,aO as Zr,aP as x0,aQ as us,aR as Qn,aS as N_,aT as pi,aU as nE,aV as SA,aW as L0,aX as Jb,aY as k0,aZ as I0,a_ as id,a$ as CA,b0 as D0,b1 as xA,b2 as E0,b3 as ml,b4 as _l,b5 as Xu,b6 as $f,b7 as vo,b8 as zp,b9 as R_,ba as Jy,bb as gn,bc as P0,bd as Vp,be as Qb,bf as LA,bg as sE,bh as qf,bi as Yu,bj as Kf,bk as jp,bl as ey,bm as ji,bn as Lc,bo as Up,bp as kA,bq as IA,br as T0,bs as DA,bt as A_,bu as Zo,bv as M0,bw as Ju,bx as vl,by as Dg,bz as ki,bA as Qu,bB as oE,bC as $p,bD as EA,bE as nd,bF as dt,bG as WL,bH as a_,bI as rE,bJ as Sr,bK as zr,bL as vn,bM as eg,bN as ur,bO as tg,bP as Un,bQ as Gf,bR as bh,bS as Qw,bT as aE,bU as lE,bV as cE,bW as N0,bX as uo,bY as Qi,bZ as qp,b_ as dE,b$ as tl,c0 as ty,c1 as PA,c2 as au,c3 as BL,c4 as Kp,c5 as hE,c6 as lu,c7 as TA,c8 as or,c9 as iy,ca as MA,cb as so,cc as Xr,cd as Gp,ce as Zf,cf as uE,cg as $o,ch as Zp,ci as ny,cj as NA,ck as RA,cl as AA,cm as Eg,cn as Ea,co as _s,cp as OA,cq as R0,cr as FA,cs as HA,ct as zL,cu as WA,cv as Xp,cw as rl,cx as eS,cy as eh,cz as al,cA as BA,cB as La,cC as gr,cD as ko,cE as VL,cF as zs,cG as Yp,cH as pc,cI as Pa,cJ as zA,cK as Yr,cL as Xf,cM as sy,cN as gE,cO as VA,cP as jA,cQ as A0,cR as UA,cS as Yf,cT as $A,cU as zl,cV as Jf,cW as jL,cX as qA,cY as KA,cZ as Na,c_ as GA,c$ as O0,d0 as fE,d1 as pE,d2 as mE,d3 as _E,d4 as ZA,d5 as XA,d6 as vE,d7 as bE,d8 as YA,d9 as F0,da as JA,db as QA,dc as Xn,dd as eO,de as H0,df as tO,dg as cu,dh as UL,di as iO,dj as nO,dk as sO,dl as oO,dm as rO,dn as aO,dp as ig,dq as oy,dr as tS,ds as lO,dt as cO,du as $L,dv as iS,dw as dO,dx as qL,dy as Qy,dz as hO,dA as yE,dB as uO,dC as wE,dD as nS,dE as gO,dF as fO,dG as pO,dH as SE,dI as CE,dJ as mO,dK as O_,dL as xE,dM as ry,dN as _O,dO as vO,dP as mc,dQ as W0,dR as bO,dS as KL,dT as GL,dU as yO,dV as du,dW as LE,dX as wO,dY as SO,dZ as CO,d_ as xO,d$ as kE,e0 as IE,e1 as DE,e2 as EE,e3 as LO,e4 as ka,e5 as ZL,e6 as kO,e7 as Jp,e8 as IO,e9 as rf,ea as PE,eb as XL,ec as Qf,ed as TE,ee as F_,ef as DO,eg as ME,eh as EO,ei as NE,ej as PO,ek as TO,el as RE,em as AE,en as ll,eo as ay,ep as MO,eq as OE,er as Po,es as sd,et as FE,eu as NO,ev as RO,ew as HE,ex as WE,ey as AO,ez as BE,eA as zE,eB as ep,eC as OO,eD as FO,eE as HO,eF as WO,eG as Gg,eH as YL,eI as BO,eJ as zO,eK as VO,eL as H_,eM as Is,eN as jO,eO as sS,eP as yh,eQ as UO,eR as Ga,eS as $O,eT as qO,eU as VE,eV as KO,eW as xf,eX as GO,eY as ZO,eZ as XO,e_ as YO,e$ as JL,f0 as QL,f1 as ek,f2 as wh,f3 as B0,f4 as jE,f5 as oS,f6 as l_,f7 as UE,f8 as W_,f9 as JO,fa as QO,fb as e2,fc as t2,fd as z0,fe as $E,ff as i2,fg as B_,fh as qE,fi as KE,fj as n2,fk as s2,fl as o2,fm as r2,fn as a2,fo as l2,fp as c2,fq as d2,fr as GE,fs as h2,ft as z_,fu as ZE,fv as u2,fw as XE,fx as g2,fy as YE,fz as JE,fA as f2,fB as tk,fC as QE,fD as ik,fE as p2,fF as ew,fG as nk,fH as m2,fI as _2,fJ as v2,fK as ma,fL as _c,fM as b2,fN as sk,fO as c_,fP as y2,fQ as Xa,fR as ly,fS as rS,fT as w2,fU as eP,fV as tP,fW as Vs,fX as ok,fY as Pm,fZ as V0,f_ as S2,f$ as C2,g0 as x2,g1 as L2,g2 as k2,g3 as I2,g4 as D2,g5 as E2,g6 as rk,g7 as P2,g8 as T2,g9 as M2,ga as ng,gb as Lf,gc as iP,gd as N2,ge as j0,gf as d_,gg as Tm,gh as tw,gi as R2,gj as A2,gk as nP,gl as O2,gm as U0,gn as F2,go as H2,gp as sP,gq as cy,gr as W2,gs as V_,gt as $0,gu as q0,gv as K0,gw as oP,gx as rP,gy as aP,gz as lP,gA as cP,gB as dP,gC as hP,gD as ak,gE as uP,gF as Wh,gG as B2,gH as z2,gI as V2,gJ as j2,gK as gP,gL as U2,gM as $2,gN as lk,gO as aS,gP as Zl,gQ as q2,gR as K2,gS as G2,gT as Z2,gU as X2,gV as Y2,gW as ck,gX as G0,gY as lS,gZ as J2,g_ as cS,g$ as Q2,h0 as eF,h1 as tF,h2 as iF,h3 as Z0,h4 as fP,h5 as dk,h6 as hk,h7 as nF,h8 as sF,h9 as oF,ha as uk,hb as iw,hc as rF,hd as aF,he as lF,hf as nw,hg as pP,hh as mP,hi as _P,hj as vP,hk as cl,hl as bP,hm as X0,hn as gk,ho as cF,hp as yP,hq as dF,hr as hF,hs as dy,ht as hy,hu as Sh,hv as uy,hw as Qp,hx as uF,hy as gy,hz as gF,hA as fF,hB as pF,hC as wP,hD as Zg,hE as mF,hF as _F,hG as vF,hH as bF,hI as em,hJ as yF,hK as SP,hL as CP,hM as xP,hN as dS,hO as wF,hP as SF,hQ as CF,hR as xF,hS as LF,hT as hS,hU as kF,hV as IF,hW as DF,hX as EF,hY as PF,hZ as TF,h_ as MF,h$ as NF,i0 as LP,i1 as RF,i2 as AF,i3 as OF,i4 as fk,i5 as FF,i6 as HF,i7 as Vc,i8 as tr,i9 as WF,ia as BF}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 kP=!1;var Y0=Array.isArray,zF=Array.prototype.indexOf,j_=Array.prototype.includes,fy=Array.from,VF=Object.defineProperty,Lu=Object.getOwnPropertyDescriptor,jF=Object.getOwnPropertyDescriptors,UF=Object.prototype,$F=Array.prototype,IP=Object.getPrototypeOf,pk=Object.isExtensible;const py=()=>{};function qF(o){for(var e=0;e<o.length;e++)o[e]()}function DP(){var o,e,t=new Promise((i,n)=>{o=i,e=n});return{promise:t,resolve:o,reject:e}}function KF(o,e,t=!1){return o===void 0?t?e():e:o}function mk(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 $s=2,sg=4,my=8,EP=1<<24,Vr=16,$r=32,vc=64,uS=128,mr=512,Ds=1024,Os=2048,Ta=4096,fo=8192,_r=16384,Pg=32768,gS=1<<25,og=65536,U_=1<<17,GF=1<<18,Tg=1<<19,ZF=1<<20,wa=1<<25,th=65536,$_=1<<21,ku=1<<22,Xl=1<<23,od=Symbol("$state"),XF=Symbol("legacy props"),YF=Symbol(""),h_=Symbol("attributes"),fS=Symbol("class"),pS=Symbol("style"),af=Symbol("text"),u_=Symbol("form reset"),_y=new class extends Error{constructor(){super(...arguments);Wi(this,"name","StaleReactionError");Wi(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 JF(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function QF(o,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function eH(o){throw new Error("https://svelte.dev/e/effect_in_teardown")}function tH(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function iH(o){throw new Error("https://svelte.dev/e/effect_orphan")}function nH(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function sH(o){throw new Error("https://svelte.dev/e/props_invalid_value")}function oH(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function rH(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function aH(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function lH(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const cH=1,dH=2,TP=4,hH=8,uH=16,gH=1,fH=4,pH=8,mH=16,_H=1,vH=2,ks=Symbol("uninitialized"),MP="http://www.w3.org/1999/xhtml",bH="http://www.w3.org/2000/svg",yH="http://www.w3.org/1998/Math/MathML";function wH(){console.warn("https://svelte.dev/e/derived_inert")}function SH(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function CH(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function NP(o){return o===this.v}function xH(o,e){return o!=o?e==e:o!==e||o!==null&&typeof o=="object"||typeof o=="function"}function RP(o){return!xH(o,this.v)}let LH=!1,Us=null;function rg(o){Us=o}function Ro(o,e=!1,t){Us={p:Us,i:!1,c:null,e:null,s:o,x:null,r:en,l:null}}function Ao(o){var e=Us,t=e.e;if(t!==null){e.e=null;for(var i of t)iT(i)}return o!==void 0&&(e.x=o),e.i=!0,Us=e.p,o??{}}function AP(){return!0}let Kc=[];function OP(){var o=Kc;Kc=[],qF(o)}function Yl(o){if(Kc.length===0&&!If){var e=Kc;queueMicrotask(()=>{e===Kc&&OP()})}Kc.push(o)}function kH(){for(;Kc.length>0;)OP()}function FP(o){var e=en;if(e===null)return Ji.f|=Xl,o;if((e.f&Pg)===0&&(e.f&sg)===0)throw o;Vl(o,e)}function Vl(o,e){for(;e!==null;){if((e.f&uS)!==0){if((e.f&Pg)===0)throw o;try{e.b.error(o);return}catch(t){o=t}}e=e.parent}throw o}const IH=-7169;function fs(o,e){o.f=o.f&IH|e}function J0(o){(o.f&mr)!==0||o.deps===null?fs(o,Ds):fs(o,Ta)}function HP(o){if(o!==null)for(const e of o)(e.f&$s)===0||(e.f&th)===0||(e.f^=th,HP(e.deps))}function WP(o,e,t){(o.f&Os)!==0?e.add(o):(o.f&Ta)!==0&&t.add(o),HP(o.deps),fs(o,Ds)}let Mm=!1;function DH(o){var e=Mm;try{return Mm=!1,[o(),Mm]}finally{Mm=e}}let sw=null,Bh=null,ui=null,kf=null,Bs=null,mS=null,If=!1,ow=!1,hu=null,g_=null;var _k=0;let EH=1;var Pu,Hl,Yc,Tu,Mu,Nu,Ua,Ru,Co,Mp,$a,Mr,ua,Au,Jc,Yn,_S,lf,vS,BP,zP,tu,PH,cf;const tb=class tb{constructor(){Pi(this,Yn);Wi(this,"id",EH++);Pi(this,Pu,!1);Wi(this,"linked",!0);Pi(this,Hl,null);Pi(this,Yc,null);Wi(this,"async_deriveds",new Map);Wi(this,"current",new Map);Wi(this,"previous",new Map);Pi(this,Tu,new Set);Pi(this,Mu,new Set);Pi(this,Nu,0);Pi(this,Ua,new Map);Pi(this,Ru,null);Pi(this,Co,[]);Pi(this,Mp,[]);Pi(this,$a,new Set);Pi(this,Mr,new Set);Pi(this,ua,new Map);Pi(this,Au,new Set);Wi(this,"is_fork",!1);Pi(this,Jc,!1);Bh===null?sw=Bh=this:(Ti(Bh,Yc,this),Ti(this,Hl,Bh)),Bh=this}skip_effect(e){ee(this,ua).has(e)||ee(this,ua).set(e,{d:[],m:[]}),ee(this,Au).delete(e)}unskip_effect(e,t=i=>this.schedule(i)){var i=ee(this,ua).get(e);if(i){ee(this,ua).delete(e);for(var n of i.d)fs(n,Os),t(n);for(n of i.m)fs(n,Ta),t(n)}ee(this,Au).add(e)}capture(e,t,i=!1){e.v!==ks&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Xl)===0&&(this.current.set(e,[t,i]),Bs==null||Bs.set(e,t)),this.is_fork||(e.v=t)}activate(){ui=this}deactivate(){ui=null,Bs=null}flush(){try{ow=!0,ui=this,En(this,Yn,lf).call(this)}finally{_k=0,mS=null,hu=null,g_=null,ow=!1,ui=null,Bs=null,rd.clear()}}discard(){var e;for(const t of ee(this,Mu))t(this);ee(this,Mu).clear(),En(this,Yn,cf).call(this),(e=ee(this,Ru))==null||e.resolve()}register_created_effect(e){ee(this,Mp).push(e)}increment(e,t){if(Ti(this,Nu,ee(this,Nu)+1),e){let i=ee(this,Ua).get(t)??0;ee(this,Ua).set(t,i+1)}}decrement(e,t){if(Ti(this,Nu,ee(this,Nu)-1),e){let i=ee(this,Ua).get(t)??0;i===1?ee(this,Ua).delete(t):ee(this,Ua).set(t,i-1)}ee(this,Jc)||(Ti(this,Jc,!0),Yl(()=>{Ti(this,Jc,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(const i of e)ee(this,$a).add(i);for(const i of t)ee(this,Mr).add(i);e.clear(),t.clear()}oncommit(e){ee(this,Tu).add(e)}ondiscard(e){ee(this,Mu).add(e)}settled(){return(ee(this,Ru)??Ti(this,Ru,DP())).promise}static ensure(){if(ui===null){const e=ui=new tb;!ow&&!If&&Yl(()=>{ee(e,Pu)||e.flush()})}return ui}apply(){{Bs=null;return}}schedule(e){var n;if(mS=e,(n=e.b)!=null&&n.is_pending&&(e.f&(sg|my|EP))!==0&&(e.f&Pg)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var i=t.f;if(hu!==null&&t===en&&(Ji===null||(Ji.f&$s)===0))return;if((i&(vc|$r))!==0){if((i&Ds)===0)return;t.f^=Ds}}ee(this,Co).push(t)}};Pu=new WeakMap,Hl=new WeakMap,Yc=new WeakMap,Tu=new WeakMap,Mu=new WeakMap,Nu=new WeakMap,Ua=new WeakMap,Ru=new WeakMap,Co=new WeakMap,Mp=new WeakMap,$a=new WeakMap,Mr=new WeakMap,ua=new WeakMap,Au=new WeakMap,Jc=new WeakMap,Yn=new WeakSet,_S=function(){if(this.is_fork)return!0;for(const i of ee(this,Ua).keys()){for(var e=i,t=!1;e.parent!==null;){if(ee(this,ua).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},lf=function(){var c,h,g,f;Ti(this,Pu,!0),_k++>1e3&&(En(this,Yn,cf).call(this),MH());for(const p of ee(this,$a))ee(this,Mr).delete(p),fs(p,Os),this.schedule(p);for(const p of ee(this,Mr))fs(p,Ta),this.schedule(p);const e=ee(this,Co);Ti(this,Co,[]),this.apply();var t=hu=[],i=[],n=g_=[];for(const p of e)try{En(this,Yn,vS).call(this,p,t,i)}catch(v){throw UP(p),En(this,Yn,_S).call(this)||this.discard(),v}if(ui=null,n.length>0){var s=tb.ensure();for(const p of n)s.schedule(p)}if(hu=null,g_=null,En(this,Yn,_S).call(this)){En(this,Yn,tu).call(this,i),En(this,Yn,tu).call(this,t);for(const[p,v]of ee(this,ua))jP(p,v);n.length>0&&En(c=ui,Yn,lf).call(c);return}const r=En(this,Yn,BP).call(this);if(r){En(this,Yn,tu).call(this,i),En(this,Yn,tu).call(this,t),En(h=r,Yn,zP).call(h,this);return}ee(this,$a).clear(),ee(this,Mr).clear();for(const p of ee(this,Tu))p(this);ee(this,Tu).clear(),kf=this,vk(i),vk(t),kf=null,(g=ee(this,Ru))==null||g.resolve();var a=ui;if(ee(this,Nu)===0&&(ee(this,Co).length===0||a!==null)&&En(this,Yn,cf).call(this),ee(this,Co).length>0)if(a!==null){const p=a;ee(p,Co).push(...ee(this,Co).filter(v=>!ee(p,Co).includes(v)))}else a=this;a!==null&&En(f=a,Yn,lf).call(f)},vS=function(e,t,i){e.f^=Ds;for(var n=e.first;n!==null;){var s=n.f,r=(s&($r|vc))!==0,a=r&&(s&Ds)!==0,c=a||(s&fo)!==0||ee(this,ua).has(n);if(!c&&n.fn!==null){r?n.f^=Ds:(s&sg)!==0?t.push(n):im(n)&&((s&Vr)!==0&&ee(this,Mr).add(n),lg(n));var h=n.first;if(h!==null){n=h;continue}}for(;n!==null;){var g=n.next;if(g!==null){n=g;break}n=n.parent}}},BP=function(){for(var e=ee(this,Hl);e!==null;){if(!e.is_fork){for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e}e=ee(e,Hl)}return null},zP=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,$a),ee(e,Mr));const t=n=>{var s=n.reactions;if(s!==null)for(const c of s){var r=c.f;if((r&$s)!==0)t(c);else{var a=c;r&(ku|Vr)&&!this.async_deriveds.has(a)&&(ee(this,Mr).delete(a),fs(a,Os),this.schedule(a))}}};for(const n of this.current.keys())t(n);this.oncommit(()=>e.discard()),En(i=e,Yn,cf).call(i),ui=this,En(this,Yn,lf).call(this)},tu=function(e){for(var t=0;t<e.length;t+=1)WP(e[t],ee(this,$a),ee(this,Mr))},PH=function(){var g;for(let f=sw;f!==null;f=ee(f,Yc)){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,Pu)){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,Au))f.unskip_effect(p,v=>{var _;(v.f&(Vr|ku))!==0?f.schedule(v):En(_=f,Yn,tu).call(_,[v])});f.activate();var s=new Set,r=new Map;for(var a of t)VP(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&(_r|fo|U_))===0&&Q0(p,c,r)&&((p.f&(ku|Vr))!==0?(fs(p,Os),f.schedule(p)):ee(f,$a).add(p));if(ee(f,Co).length>0&&!ee(f,Jc)){f.apply();for(var h of ee(f,Co))En(g=f,Yn,vS).call(g,h,[],[]);Ti(f,Co,[])}f.deactivate()}}}},cf=function(){if(this.linked){var e=ee(this,Hl),t=ee(this,Yc);e===null?sw=t:Ti(e,Yc,t),t===null?Bh=e:Ti(t,Hl,e),this.linked=!1}};let ih=tb;function TH(o){var e=If;If=!0;try{for(var t;;){if(kH(),ui===null)return t;ui.flush()}}finally{If=e}}function MH(){try{nH()}catch(o){Vl(o,mS)}}let Er=null;function vk(o){var e=o.length;if(e!==0){for(var t=0;t<e;){var i=o[t++];if((i.f&(_r|fo))===0&&im(i)&&(Er=new Set,lg(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&oT(i),(Er==null?void 0:Er.size)>0)){rd.clear();for(const n of Er){if((n.f&(_r|fo))!==0)continue;const s=[n];let r=n.parent;for(;r!==null;)Er.has(r)&&(Er.delete(r),s.push(r)),r=r.parent;for(let a=s.length-1;a>=0;a--){const c=s[a];(c.f&(_r|fo))===0&&lg(c)}}Er.clear()}}Er=null}}function VP(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&$s)!==0?VP(n,e,t,i):(s&(ku|Vr))!==0&&(s&Os)===0&&Q0(n,e,i)&&(fs(n,Os),e1(n))}}function Q0(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(j_.call(e,n))return!0;if((n.f&$s)!==0&&Q0(n,e,t))return t.set(n,!0),!0}return t.set(o,!1),!1}function e1(o){ui.schedule(o)}function jP(o,e){if(!((o.f&$r)!==0&&(o.f&Ds)!==0)){(o.f&Os)!==0?e.d.push(o):(o.f&Ta)!==0&&e.m.push(o),fs(o,Ds);for(var t=o.first;t!==null;)jP(t,e),t=t.next}}function UP(o){fs(o,Ds);for(var e=o.first;e!==null;)UP(e),e=e.next}function NH(o){let e=0,t=nh(0),i;return()=>{s1()&&(u(t),by(()=>(e===0&&(i=yl(()=>o(()=>Df(t)))),e+=1,()=>{Yl(()=>{e-=1,e===0&&(i==null||i(),i=void 0,Df(t))})})))}}var RH=og|Tg;function AH(o,e,t,i){new OH(o,e,t,i)}var ar,w0,lr,Qc,xo,cr,co,zo,qa,ed,Wl,Ou,Np,Rp,Ka,ib,ps,FH,HH,WH,bS,f_,p_,yS,wS;class OH{constructor(e,t,i,n){Pi(this,ps);Wi(this,"parent");Wi(this,"is_pending",!1);Wi(this,"transform_error");Pi(this,ar);Pi(this,w0,null);Pi(this,lr);Pi(this,Qc);Pi(this,xo);Pi(this,cr,null);Pi(this,co,null);Pi(this,zo,null);Pi(this,qa,null);Pi(this,ed,0);Pi(this,Wl,0);Pi(this,Ou,!1);Pi(this,Np,new Set);Pi(this,Rp,new Set);Pi(this,Ka,null);Pi(this,ib,NH(()=>(Ti(this,Ka,nh(ee(this,ed))),()=>{Ti(this,Ka,null)})));var s;Ti(this,ar,e),Ti(this,lr,t),Ti(this,Qc,r=>{var a=en;a.b=this,a.f|=uS,i(r)}),this.parent=en.b,this.transform_error=n??((s=this.parent)==null?void 0:s.transform_error)??(r=>r),Ti(this,xo,a1(()=>{En(this,ps,bS).call(this)},RH))}defer_effect(e){WP(e,ee(this,Np),ee(this,Rp))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!ee(this,lr).pending}update_pending_count(e,t){En(this,ps,yS).call(this,e,t),Ti(this,ed,ee(this,ed)+e),!(!ee(this,Ka)||ee(this,Ou))&&(Ti(this,Ou,!0),Yl(()=>{Ti(this,Ou,!1),ee(this,Ka)&&ag(ee(this,Ka),ee(this,ed))}))}get_effect_pending(){return ee(this,ib).call(this),u(ee(this,Ka))}error(e){if(!ee(this,lr).onerror&&!ee(this,lr).failed)throw e;ui!=null&&ui.is_fork?(ee(this,cr)&&ui.skip_effect(ee(this,cr)),ee(this,co)&&ui.skip_effect(ee(this,co)),ee(this,zo)&&ui.skip_effect(ee(this,zo)),ui.oncommit(()=>{En(this,ps,wS).call(this,e)})):En(this,ps,wS).call(this,e)}}ar=new WeakMap,w0=new WeakMap,lr=new WeakMap,Qc=new WeakMap,xo=new WeakMap,cr=new WeakMap,co=new WeakMap,zo=new WeakMap,qa=new WeakMap,ed=new WeakMap,Wl=new WeakMap,Ou=new WeakMap,Np=new WeakMap,Rp=new WeakMap,Ka=new WeakMap,ib=new WeakMap,ps=new WeakSet,FH=function(){try{Ti(this,cr,dr(()=>ee(this,Qc).call(this,ee(this,ar))))}catch(e){this.error(e)}},HH=function(e){const t=ee(this,lr).failed;t&&Ti(this,zo,dr(()=>{t(ee(this,ar),()=>e,()=>()=>{})}))},WH=function(){const e=ee(this,lr).pending;e&&(this.is_pending=!0,Ti(this,co,dr(()=>e(ee(this,ar)))),Yl(()=>{var t=Ti(this,qa,document.createDocumentFragment()),i=il();t.append(i),Ti(this,cr,En(this,ps,p_).call(this,()=>dr(()=>ee(this,Qc).call(this,i)))),ee(this,Wl)===0&&(ee(this,ar).before(t),Ti(this,qa,null),ld(ee(this,co),()=>{Ti(this,co,null)}),En(this,ps,f_).call(this,ui))}))},bS=function(){try{if(this.is_pending=this.has_pending_snippet(),Ti(this,Wl,0),Ti(this,ed,0),Ti(this,cr,dr(()=>{ee(this,Qc).call(this,ee(this,ar))})),ee(this,Wl)>0){var e=Ti(this,qa,document.createDocumentFragment());c1(ee(this,cr),e);const t=ee(this,lr).pending;Ti(this,co,dr(()=>t(ee(this,ar))))}else En(this,ps,f_).call(this,ui)}catch(t){this.error(t)}},f_=function(e){this.is_pending=!1,e.transfer_effects(ee(this,Np),ee(this,Rp))},p_=function(e){var t=en,i=Ji,n=Us;Ma(ee(this,xo)),yr(ee(this,xo)),rg(ee(this,xo).ctx);try{return ih.ensure(),e()}catch(s){return FP(s),null}finally{Ma(t),yr(i),rg(n)}},yS=function(e,t){var i;if(!this.has_pending_snippet()){this.parent&&En(i=this.parent,ps,yS).call(i,e,t);return}Ti(this,Wl,ee(this,Wl)+e),ee(this,Wl)===0&&(En(this,ps,f_).call(this,t),ee(this,co)&&ld(ee(this,co),()=>{Ti(this,co,null)}),ee(this,qa)&&(ee(this,ar).before(ee(this,qa)),Ti(this,qa,null)))},wS=function(e){ee(this,cr)&&(To(ee(this,cr)),Ti(this,cr,null)),ee(this,co)&&(To(ee(this,co)),Ti(this,co,null)),ee(this,zo)&&(To(ee(this,zo)),Ti(this,zo,null));var t=ee(this,lr).onerror;let i=ee(this,lr).failed;var n=!1,s=!1;const r=()=>{if(n){CH();return}n=!0,s&&lH(),ee(this,zo)!==null&&ld(ee(this,zo),()=>{Ti(this,zo,null)}),En(this,ps,p_).call(this,()=>{En(this,ps,bS).call(this)})},a=c=>{try{s=!0,t==null||t(c,r),s=!1}catch(h){Vl(h,ee(this,xo)&&ee(this,xo).parent)}i&&Ti(this,zo,En(this,ps,p_).call(this,()=>{try{return dr(()=>{var h=en;h.b=this,h.f|=uS,i(ee(this,ar),()=>c,()=>r)})}catch(h){return Vl(h,ee(this,xo).parent),null}}))};Yl(()=>{var c;try{c=this.transform_error(e)}catch(h){Vl(h,ee(this,xo)&&ee(this,xo).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(a,h=>Vl(h,ee(this,xo)&&ee(this,xo).parent)):a(c)})};function BH(o,e,t,i){const n=tp;var s=o.filter(p=>!p.settled);if(t.length===0&&s.length===0){i(e.map(n));return}var r=en,a=zH(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(p=>p.promise)):null;function h(p){if((r.f&_r)===0){a();try{i(p)}catch(v){Vl(v,r)}q_()}}var g=$P();if(t.length===0){c.then(()=>h(e.map(n))).finally(g);return}function f(){Promise.all(t.map(p=>VH(p))).then(p=>h([...e.map(n),...p])).catch(p=>Vl(p,r)).finally(g)}c?c.then(()=>{a(),f(),q_()}):f()}function zH(){var o=en,e=Ji,t=Us,i=ui;return function(s=!0){Ma(o),yr(e),rg(t),s&&(o.f&_r)===0&&(i==null||i.activate(),i==null||i.apply())}}function q_(o=!0){Ma(null),yr(null),rg(null),o&&(ui==null||ui.deactivate())}function $P(){var o=en,e=o.b,t=ui,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 tp(o){var e=$s|Os;return en!==null&&(en.f|=Tg),{ctx:Us,deps:null,effects:null,equals:NP,f:e,fn:o,reactions:null,rv:0,v:ks,wv:0,parent:en,ac:null}}const Nm=Symbol("obsolete");function VH(o,e,t){let i=en;i===null&&JF();var n=void 0,s=nh(ks),r=!Ji,a=new Set;return eW(()=>{var v,_;var c=en,h=DP();n=h.promise;try{Promise.resolve(o()).then(h.resolve,w=>{w!==_y&&h.reject(w)}).finally(q_)}catch(w){h.reject(w),q_()}var g=ui;if(r){if((c.f&Pg)!==0)var f=$P();if((v=i.b)!=null&&v.is_rendered())(_=g.async_deriveds.get(c))==null||_.reject(Nm);else for(const w of a.values())w.reject(Nm);a.add(h),g.async_deriveds.set(c,h)}const p=(w,S=void 0)=>{f==null||f(),a.delete(h),S!==Nm&&(g.activate(),S?(s.f|=Xl,ag(s,S)):((s.f&Xl)!==0&&(s.f^=Xl),ag(s,w)),g.deactivate())};h.promise.then(p,w=>p(null,w||"unknown"))}),o1(()=>{for(const c of a)c.reject(Nm)}),new Promise(c=>{function h(g){function f(){g===n?c(s):h(n)}g.then(f,f)}h(n)})}function ot(o){const e=tp(o);return lT(e),e}function t1(o){const e=tp(o);return e.equals=RP,e}function jH(o){var e=o.effects;if(e!==null){o.effects=null;for(var t=0;t<e.length;t+=1)To(e[t])}}function i1(o){var e,t=en,i=o.parent;if(!dl&&i!==null&&o.v!==ks&&(i.f&(_r|fo))!==0)return wH(),o.v;Ma(i);try{o.f&=~th,jH(o),e=uT(o)}finally{Ma(t)}return e}function qP(o){var e=i1(o);if(!o.equals(e)&&(o.wv=dT(),(!(ui!=null&&ui.is_fork)||o.deps===null)&&(ui!==null?(ui.capture(o,e,!0),kf==null||kf.capture(o,e,!0)):o.v=e,o.deps===null))){fs(o,Ds);return}dl||(Bs!==null?(s1()||ui!=null&&ui.is_fork)&&Bs.set(o,e):J0(o))}function UH(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(_y),i.fn!==null&&(i.teardown=py),i.ac=null,ip(i,0),l1(i))}function KP(o){if(o.effects!==null)for(const e of o.effects)e.teardown&&e.fn!==null&&lg(e)}let K_=new Set;const rd=new Map;let GP=!1;function nh(o,e){var t={f:0,v:o,reactions:null,equals:NP,rv:0,wv:0};return t}function B(o,e){const t=nh(o);return lT(t),t}function $H(o,e=!1,t=!0){const i=nh(o);return e||(i.equals=RP),i}function k(o,e,t=!1){Ji!==null&&(!jr||(Ji.f&U_)!==0)&&AP()&&(Ji.f&($s|Vr|ku|U_))!==0&&(Ia===null||!Ia.has(o))&&aH();let i=t?wi(e):e;return ag(o,i,g_)}function ag(o,e,t=null){if(!o.equals(e)){rd.set(o,dl?e:o.v);var i=ih.ensure();if(i.capture(o,e),(o.f&$s)!==0){const n=o;(o.f&Os)!==0&&i1(n),Bs===null&&J0(n)}o.wv=dT(),ZP(o,Os,t),en!==null&&(en.f&Ds)!==0&&(en.f&($r|vc))===0&&(rr===null?iW([o]):rr.push(o)),!i.is_fork&&K_.size>0&&!GP&&qH()}return e}function qH(){GP=!1;for(const o of K_){(o.f&Ds)!==0&&fs(o,Ta);let e;try{e=im(o)}catch{e=!0}e&&lg(o)}K_.clear()}function bk(o,e=1){var t=u(o),i=e===1?t++:t--;return k(o,t),i}function Df(o){k(o,o.v+1)}function ZP(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&Os)===0;if(c&&fs(r,e),(a&U_)!==0)K_.add(r);else if((a&$s)!==0){var h=r;Bs==null||Bs.delete(h),(a&th)===0&&(a&mr&&(en===null||(en.f&$_)===0)&&(r.f|=th),ZP(h,Ta,t))}else if(c){var g=r;(a&Vr)!==0&&Er!==null&&Er.add(g),t!==null?t.push(g):e1(g)}}}function wi(o){if(typeof o!="object"||o===null||od in o)return o;const e=IP(o);if(e!==UF&&e!==$F)return o;var t=new Map,i=Y0(o),n=B(0),s=cd,r=a=>{if(cd===s)return a();var c=Ji,h=cd;yr(null),Ck(s);var g=a();return yr(c),Ck(h),g};return i&&t.set("length",B(o.length)),new Proxy(o,{defineProperty(a,c,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&oH();var g=t.get(c);return g===void 0?r(()=>{var f=B(h.value);return t.set(c,f),f}):k(g,h.value,!0),!0},deleteProperty(a,c){var h=t.get(c);if(h===void 0){if(c in a){const g=r(()=>B(ks));t.set(c,g),Df(n)}}else k(h,ks),Df(n);return!0},get(a,c,h){var v;if(c===od)return o;var g=t.get(c),f=c in a;if(g===void 0&&(!f||(v=Lu(a,c))!=null&&v.writable)&&(g=r(()=>{var _=wi(f?a[c]:ks),w=B(_);return w}),t.set(c,g)),g!==void 0){var p=u(g);return p===ks?void 0:p}return Reflect.get(a,c,h)},getOwnPropertyDescriptor(a,c){var h=Reflect.getOwnPropertyDescriptor(a,c);if(h&&"value"in h){var g=t.get(c);g&&(h.value=u(g))}else if(h===void 0){var f=t.get(c),p=f==null?void 0:f.v;if(f!==void 0&&p!==ks)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return h},has(a,c){var p;if(c===od)return!0;var h=t.get(c),g=h!==void 0&&h.v!==ks||Reflect.has(a,c);if(h!==void 0||en!==null&&(!g||(p=Lu(a,c))!=null&&p.writable)){h===void 0&&(h=r(()=>{var v=g?wi(a[c]):ks,_=B(v);return _}),t.set(c,h));var f=u(h);if(f===ks)return!1}return g},set(a,c,h,g){var N;var f=t.get(c),p=c in a;if(i&&c==="length")for(var v=h;v<f.v;v+=1){var _=t.get(v+"");_!==void 0?k(_,ks):v in a&&(_=r(()=>B(ks)),t.set(v+"",_))}if(f===void 0)(!p||(N=Lu(a,c))!=null&&N.writable)&&(f=r(()=>B(void 0)),k(f,wi(h)),t.set(c,f));else{p=f.v!==ks;var w=r(()=>wi(h));k(f,w)}var S=Reflect.getOwnPropertyDescriptor(a,c);if(S!=null&&S.set&&S.set.call(g,h),!p){if(i&&typeof c=="string"){var D=t.get("length"),P=Number(c);Number.isInteger(P)&&P>=D.v&&k(D,P+1)}Df(n)}return!0},ownKeys(a){u(n);var c=Reflect.ownKeys(a).filter(f=>{var p=t.get(f);return p===void 0||p.v!==ks});for(var[h,g]of t)g.v!==ks&&!(h in a)&&c.push(h);return c},setPrototypeOf(){rH()}})}function yk(o){try{if(o!==null&&typeof o=="object"&&od in o)return o[od]}catch{}return o}function KH(o,e){return Object.is(yk(o),yk(e))}var ad,XP,YP,JP,QP;function GH(){if(ad===void 0){ad=window,XP=document,YP=/Firefox/.test(navigator.userAgent);var o=Element.prototype,e=Node.prototype,t=Text.prototype;JP=Lu(e,"firstChild").get,QP=Lu(e,"nextSibling").get,pk(o)&&(o[fS]=void 0,o[h_]=null,o[pS]=void 0,o.__e=void 0),pk(t)&&(t[af]=void 0)}}function il(o=""){return document.createTextNode(o)}function Sa(o){return JP.call(o)}function tm(o){return QP.call(o)}function C(o,e){return Sa(o)}function _t(o,e=!1){{var t=Sa(o);return t instanceof Comment&&t.data===""?tm(t):t}}function x(o,e=1,t=!1){let i=o;for(;e--;)i=tm(i);return i}function ZH(o){o.textContent=""}function eT(){return!1}function tT(o,e,t){return e==null||e===MP?t?document.createElement(o,{is:t}):document.createElement(o):t?document.createElementNS(e,o,{is:t}):document.createElementNS(e,o)}let wk=!1;function XH(){wk||(wk=!0,document.addEventListener("reset",o=>{Promise.resolve().then(()=>{var e;if(!o.defaultPrevented)for(const t of o.target.elements)(e=t[u_])==null||e.call(t)})},{capture:!0}))}function vy(o){var e=Ji,t=en;yr(null),Ma(null);try{return o()}finally{yr(e),Ma(t)}}function n1(o,e,t,i=t){o.addEventListener(e,()=>vy(t));const n=o[u_];n?o[u_]=()=>{n(),i(!0)}:o[u_]=()=>i(!0),XH()}function YH(o){en===null&&(Ji===null&&iH(),tH()),dl&&eH()}function JH(o,e){var t=e.last;t===null?e.last=e.first=o:(t.next=o,o.prev=t,e.last=o)}function bl(o,e){var t=en;t!==null&&(t.f&fo)!==0&&(o|=fo);var i={ctx:Us,deps:null,nodes:null,f:o|Os|mr,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};ui==null||ui.register_created_effect(i);var n=i;if((o&sg)!==0)hu!==null?hu.push(i):ih.ensure().schedule(i);else if(e!==null){try{lg(i)}catch(r){throw To(i),r}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&Tg)===0&&(n=n.first,(o&Vr)!==0&&(o&og)!==0&&n!==null&&(n.f|=og))}if(n!==null&&(n.parent=t,t!==null&&JH(n,t),Ji!==null&&(Ji.f&$s)!==0&&(o&vc)===0)){var s=Ji;(s.effects??(s.effects=[])).push(n)}return i}function s1(){return Ji!==null&&!jr}function o1(o){const e=bl(my,null);return fs(e,Ds),e.teardown=o,e}function Vn(o){YH();var e=en.f,t=!Ji&&(e&$r)!==0&&Us!==null&&!Us.i;if(t){var i=Us;(i.e??(i.e=[])).push(o)}else return iT(o)}function iT(o){return bl(sg|ZF,o)}function QH(o){ih.ensure();const e=bl(vc|Tg,o);return(t={})=>new Promise(i=>{t.outro?ld(e,()=>{To(e),i(void 0)}):(To(e),i(void 0))})}function r1(o){return bl(sg,o)}function eW(o){return bl(ku|Tg,o)}function by(o,e=0){return bl(my|e,o)}function G(o,e=[],t=[],i=[]){BH(i,e,t,n=>{bl(my,()=>o(...n.map(u)))})}function a1(o,e=0){var t=bl(Vr|e,o);return t}function dr(o){return bl($r|Tg,o)}function nT(o){var e=o.teardown;if(e!==null){const t=dl,i=Ji;Sk(!0),yr(null);try{e.call(null)}finally{Sk(t),yr(i)}}}function l1(o,e=!1){var t=o.first;for(o.first=o.last=null;t!==null;){const n=t.ac;n!==null&&vy(()=>{n.abort(_y)});var i=t.next;(t.f&vc)!==0?t.parent=null:To(t,e),t=i}}function tW(o){for(var e=o.first;e!==null;){var t=e.next;(e.f&$r)===0&&To(e),e=t}}function To(o,e=!0){var t=!1;(e||(o.f&GF)!==0)&&o.nodes!==null&&o.nodes.end!==null&&(sT(o.nodes.start,o.nodes.end),t=!0),fs(o,gS),l1(o,e&&!t),ip(o,0);var i=o.nodes&&o.nodes.t;if(i!==null)for(const s of i)s.stop();nT(o),o.f^=gS,o.f|=_r;var n=o.parent;n!==null&&n.first!==null&&oT(o),o.next=o.prev=o.teardown=o.ctx=o.deps=o.fn=o.nodes=o.ac=o.b=null}function sT(o,e){for(;o!==null;){var t=o===e?null:tm(o);o.remove(),o=t}}function oT(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 ld(o,e,t=!0){var i=[];rT(o,i,!0);var n=()=>{t&&To(o),e&&e()},s=i.length;if(s>0){var r=()=>--s||n();for(var a of i)a.out(r)}else n()}function rT(o,e,t){if((o.f&fo)===0){o.f^=fo;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&vc)===0){var r=(n.f&og)!==0||(n.f&$r)!==0&&(o.f&Vr)!==0;rT(n,e,r?t:!1)}n=s}}}function G_(o){aT(o,!0)}function aT(o,e){if((o.f&fo)!==0){o.f^=fo,(o.f&Ds)===0&&(fs(o,Os),ih.ensure().schedule(o));for(var t=o.first;t!==null;){var i=t.next,n=(t.f&og)!==0||(t.f&$r)!==0;aT(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 c1(o,e){if(o.nodes)for(var t=o.nodes.start,i=o.nodes.end;t!==null;){var n=t===i?null:tm(t);e.append(t),t=n}}let m_=!1,dl=!1;function Sk(o){dl=o}let Ji=null,jr=!1;function yr(o){Ji=o}let en=null;function Ma(o){en=o}let Ia=null;function lT(o){Ji!==null&&(Ia??(Ia=new Set)).add(o)}let Lo=null,Wo=0,rr=null;function iW(o){rr=o}let cT=1,Gc=0,cd=Gc;function Ck(o){cd=o}function dT(){return++cT}function im(o){var e=o.f;if((e&Os)!==0)return!0;if(e&$s&&(o.f&=~th),(e&Ta)!==0){for(var t=o.deps,i=t.length,n=0;n<i;n++){var s=t[n];if(im(s)&&qP(s),s.wv>o.wv)return!0}(e&mr)!==0&&Bs===null&&fs(o,Ds)}return!1}function hT(o,e,t=!0){var i=o.reactions;if(i!==null&&!(Ia!==null&&Ia.has(o)))for(var n=0;n<i.length;n++){var s=i[n];(s.f&$s)!==0?hT(s,e,!1):e===s&&(t?fs(s,Os):(s.f&Ds)!==0&&fs(s,Ta),e1(s))}}function uT(o){var w;var e=Lo,t=Wo,i=rr,n=Ji,s=Ia,r=Us,a=jr,c=cd,h=o.f;Lo=null,Wo=0,rr=null,Ji=(h&($r|vc))===0?o:null,Ia=null,rg(o.ctx),jr=!1,cd=++Gc,o.ac!==null&&(vy(()=>{o.ac.abort(_y)}),o.ac=null);try{o.f|=$_;var g=o.fn,f=g();o.f|=Pg;var p=o.deps,v=ui==null?void 0:ui.is_fork;if(Lo!==null){var _;if(v||ip(o,Wo),p!==null&&Wo>0)for(p.length=Wo+Lo.length,_=0;_<Lo.length;_++)p[Wo+_]=Lo[_];else o.deps=p=Lo;if(s1()&&(o.f&mr)!==0)for(_=Wo;_<p.length;_++)((w=p[_]).reactions??(w.reactions=[])).push(o)}else!v&&p!==null&&Wo<p.length&&(ip(o,Wo),p.length=Wo);if(AP()&&rr!==null&&!jr&&p!==null&&(o.f&($s|Ta|Os))===0)for(_=0;_<rr.length;_++)hT(rr[_],o);if(n!==null&&n!==o){if(Gc++,n.deps!==null)for(let S=0;S<t;S+=1)n.deps[S].rv=Gc;if(e!==null)for(const S of e)S.rv=Gc;rr!==null&&(i===null?i=rr:i.push(...rr))}return(o.f&Xl)!==0&&(o.f^=Xl),f}catch(S){return FP(S)}finally{o.f^=$_,Lo=e,Wo=t,rr=i,Ji=n,Ia=s,rg(r),jr=a,cd=c}}function nW(o,e){let t=e.reactions;if(t!==null){var i=zF.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&$s)!==0&&(Lo===null||!j_.call(Lo,e))){var s=e;(s.f&mr)!==0&&(s.f^=mr,s.f&=~th),s.v!==ks&&J0(s),UH(s),ip(s,0)}}function ip(o,e){var t=o.deps;if(t!==null)for(var i=e;i<t.length;i++)nW(o,t[i])}function lg(o){var e=o.f;if((e&_r)===0){fs(o,Ds);var t=en,i=m_;en=o,m_=!0;try{(e&(Vr|EP))!==0?tW(o):l1(o),nT(o);var n=uT(o);o.teardown=typeof n=="function"?n:null,o.wv=cT;var s;kP&&LH&&(o.f&Os)!==0&&o.deps}finally{m_=i,en=t}}}async function __(){await Promise.resolve(),TH()}function u(o){var e=o.f,t=(e&$s)!==0;if(Ji!==null&&!jr){var i=en!==null&&(en.f&_r)!==0;if(!i&&(Ia===null||!Ia.has(o))){var n=Ji.deps;if((Ji.f&$_)!==0)o.rv<Gc&&(o.rv=Gc,Lo===null&&n!==null&&n[Wo]===o?Wo++:Lo===null?Lo=[o]:Lo.push(o));else{Ji.deps??(Ji.deps=[]),j_.call(Ji.deps,o)||Ji.deps.push(o);var s=o.reactions;s===null?o.reactions=[Ji]:j_.call(s,Ji)||s.push(Ji)}}}if(dl&&rd.has(o))return rd.get(o);if(t){var r=o;if(dl){var a=r.v;return((r.f&Ds)===0&&r.reactions!==null||fT(r))&&(a=i1(r)),rd.set(r,a),a}var c=(r.f&mr)===0&&!jr&&Ji!==null&&(m_||(Ji.f&mr)!==0),h=(r.f&Pg)===0;im(r)&&(c&&(r.f|=mr),qP(r)),c&&!h&&(KP(r),gT(r))}if(Bs!=null&&Bs.has(o))return Bs.get(o);if((o.f&Xl)!==0)throw o.v;return o.v}function gT(o){if(o.f|=mr,o.deps!==null)for(const e of o.deps)(e.reactions??(e.reactions=[])).push(o),(e.f&$s)!==0&&(e.f&mr)===0&&(KP(e),gT(e))}function fT(o){if(o.v===ks)return!0;if(o.deps===null)return!1;for(const e of o.deps)if(rd.has(e)||(e.f&$s)!==0&&fT(e))return!0;return!1}function yl(o){var e=jr;try{return jr=!0,o()}finally{jr=e}}const sW=["touchstart","touchmove"];function oW(o){return sW.includes(o)}const Zc=Symbol("events"),pT=new Set,SS=new Set;function rW(o,e,t,i={}){function n(s){if(i.capture||CS.call(e,s),!s.cancelBubble)return vy(()=>t==null?void 0:t.call(this,s))}return o.startsWith("pointer")||o.startsWith("touch")||o==="wheel"?Yl(()=>{e.addEventListener(o,n,i)}):e.addEventListener(o,n,i),n}function os(o,e,t,i,n){var s={capture:i,passive:n},r=rW(o,e,t,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&o1(()=>{e.removeEventListener(o,r,s)})}function te(o,e,t){(e[Zc]??(e[Zc]={}))[o]=t}function Cr(o){for(var e=0;e<o.length;e++)pT.add(o[e]);for(var t of SS)t(o)}let xk=null;function CS(o){var w,S;var e=this,t=e.ownerDocument,i=o.type,n=((w=o.composedPath)==null?void 0:w.call(o))||[],s=n[0]||o.target;xk=o;var r=0,a=xk===o&&o[Zc];if(a){var c=n.indexOf(a);if(c!==-1&&(e===document||e===window)){o[Zc]=e;return}var h=n.indexOf(e);if(h===-1)return;c<=h&&(r=c)}if(s=n[r]||o.target,s!==e){VF(o,"currentTarget",{configurable:!0,get(){return s||t}});var g=Ji,f=en;yr(null),Ma(null);try{for(var p,v=[];s!==null&&s!==e;){try{var _=(S=s[Zc])==null?void 0:S[i];_!=null&&(!s.disabled||o.target===s)&&_.call(s,o)}catch(D){p?v.push(D):p=D}if(o.cancelBubble)break;r++,s=r<n.length?n[r]:null}if(p){for(let D of v)queueMicrotask(()=>{throw D});throw p}}finally{o[Zc]=e,delete o.currentTarget,yr(g),Ma(f)}}}var ZD;const rw=((ZD=globalThis==null?void 0:globalThis.window)==null?void 0:ZD.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:o=>o});function aW(o){return(rw==null?void 0:rw.createHTML(o))??o}function mT(o){var e=tT("template");return e.innerHTML=aW(o.replaceAll("<!>","<!---->")),e.content}function sh(o,e){var t=en;t.nodes===null&&(t.nodes={start:o,end:e,a:null,t:null})}function R(o,e){var t=(e&_H)!==0,i=(e&vH)!==0,n,s=!o.startsWith("<!>");return()=>{n===void 0&&(n=mT(s?o:"<!>"+o),t||(n=Sa(n)));var r=i||YP?document.importNode(n,!0):n.cloneNode(!0);if(t){var a=Sa(r),c=r.lastChild;sh(a,c)}else sh(r,r);return r}}function lW(o,e,t="svg"){var i=!o.startsWith("<!>"),n=`<${t}>${i?o:"<!>"+o}</${t}>`,s;return()=>{if(!s){var r=mT(n),a=Sa(r);s=Sa(a)}var c=s.cloneNode(!0);return sh(c,c),c}}function _T(o,e){return lW(o,e,"svg")}function Ur(o=""){{var e=il(o+"");return sh(e,e),e}}function Fs(){var o=document.createDocumentFragment(),e=document.createComment(""),t=il();return o.append(e,t),sh(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[af]??(o[af]=o.nodeValue))&&(o[af]=t,o.nodeValue=`${t}`)}function cW(o,e){return dW(o,e)}const Rm=new Map;function dW(o,{target:e,anchor:t,props:i={},events:n,context:s,intro:r=!0,transformError:a}){GH();var c=void 0,h=QH(()=>{var g=t??e.appendChild(il());AH(g,{pending:()=>{}},v=>{Ro({});var _=Us;s&&(_.c=s),n&&(i.$$events=n),c=o(v,i)||{},Ao()},a);var f=new Set,p=v=>{for(var _=0;_<v.length;_++){var w=v[_];if(!f.has(w)){f.add(w);var S=oW(w);for(const N of[e,document]){var D=Rm.get(N);D===void 0&&(D=new Map,Rm.set(N,D));var P=D.get(w);P===void 0?(N.addEventListener(w,CS,{passive:S}),D.set(w,1)):D.set(w,P+1)}}}};return p(fy(pT)),SS.add(p),()=>{var S;for(var v of f)for(const D of[e,document]){var _=Rm.get(D),w=_.get(v);--w==0?(D.removeEventListener(v,CS),_.delete(v),_.size===0&&Rm.delete(D)):_.set(v,w)}SS.delete(p),g!==t&&((S=g.parentNode)==null||S.removeChild(g))}});return hW.set(c,h),c}let hW=new WeakMap;var Nr,ga,Vo,td,Ap,Op,nb;class uW{constructor(e,t=!0){Wi(this,"anchor");Pi(this,Nr,new Map);Pi(this,ga,new Map);Pi(this,Vo,new Map);Pi(this,td,new Set);Pi(this,Ap,!0);Pi(this,Op,e=>{if(ee(this,Nr).has(e)){var t=ee(this,Nr).get(e),i=ee(this,ga).get(t);if(i)G_(i),ee(this,td).delete(t);else{var n=ee(this,Vo).get(t);n&&(G_(n.effect),ee(this,ga).set(t,n.effect),ee(this,Vo).delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[s,r]of ee(this,Nr)){if(ee(this,Nr).delete(s),s===e)break;const a=ee(this,Vo).get(r);a&&(To(a.effect),ee(this,Vo).delete(r))}for(const[s,r]of ee(this,ga)){if(s===t||ee(this,td).has(s))continue;const a=()=>{if(Array.from(ee(this,Nr).values()).includes(s)){var h=document.createDocumentFragment();c1(r,h),h.append(il()),ee(this,Vo).set(s,{effect:r,fragment:h})}else To(r);ee(this,td).delete(s),ee(this,ga).delete(s)};ee(this,Ap)||!i?(ee(this,td).add(s),ld(r,a,!1)):a()}}});Pi(this,nb,e=>{ee(this,Nr).delete(e);const t=Array.from(ee(this,Nr).values());for(const[i,n]of ee(this,Vo))t.includes(i)||(To(n.effect),ee(this,Vo).delete(i))});this.anchor=e,Ti(this,Ap,t)}ensure(e,t){var i=ui,n=eT();if(t&&!ee(this,ga).has(e)&&!ee(this,Vo).has(e))if(n){var s=document.createDocumentFragment(),r=il();s.append(r),ee(this,Vo).set(e,{effect:dr(()=>t(r)),fragment:s})}else ee(this,ga).set(e,dr(()=>t(this.anchor)));if(ee(this,Nr).set(i,e),n){for(const[a,c]of ee(this,ga))a===e?i.unskip_effect(c):i.skip_effect(c);for(const[a,c]of ee(this,Vo))a===e?i.unskip_effect(c.effect):i.skip_effect(c.effect);i.oncommit(ee(this,Op)),i.ondiscard(ee(this,nb))}else ee(this,Op).call(this,i)}}Nr=new WeakMap,ga=new WeakMap,Vo=new WeakMap,td=new WeakMap,Ap=new WeakMap,Op=new WeakMap,nb=new WeakMap;function $(o,e,t=!1){var i=new uW(o),n=t?og:0;function s(r,a){i.ensure(r,a)}a1(()=>{var r=!1;e((a,c=0)=>{r=!0,s(c,a)}),r||s(-1,null)},n)}function jn(o,e){return e}function gW(o,e,t){for(var i=[],n=e.length,s,r=e.length,a=0;a<n;a++){let f=e[a];ld(f,()=>{if(s){if(s.pending.delete(f),s.done.add(f),s.pending.size===0){var p=o.outrogroups;xS(o,fy(s.done)),p.delete(s),p.size===0&&(o.outrogroups=null)}}else r-=1},!1)}if(r===0){var c=i.length===0&&t!==null;if(c){var h=t,g=h.parentNode;ZH(g),g.append(h),o.items.clear()}xS(o,e,!c)}else s={pending:new Set(e),done:new Set},(o.outrogroups??(o.outrogroups=new Set)).add(s)}function xS(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|=wa;const r=document.createDocumentFragment();c1(s,r)}else To(e[n],t)}}var Lk;function _i(o,e,t,i,n,s=null){var r=o,a=new Map,c=(e&TP)!==0;if(c){var h=o;r=h.appendChild(il())}var g=null,f=t1(()=>{var N=t();return Y0(N)?N:N==null?[]:fy(N)}),p,v=new Map,_=!0;function w(N){(P.effect.f&_r)===0&&(P.pending.delete(N),P.fallback=g,fW(P,p,r,e,i),g!==null&&(p.length===0?(g.f&wa)===0?G_(g):(g.f^=wa,df(g,null,r)):ld(g,()=>{g=null})))}function S(N){P.pending.delete(N)}var D=a1(()=>{p=u(f);for(var N=p.length,V=new Set,F=ui,Y=eT(),X=0;X<N;X+=1){var ue=p[X],Pe=i(ue,X),Ve=_?null:a.get(Pe);Ve?(Ve.v&&ag(Ve.v,ue),Ve.i&&ag(Ve.i,X),Y&&F.unskip_effect(Ve.e)):(Ve=pW(a,_?r:Lk??(Lk=il()),ue,Pe,X,n,e,t),_||(Ve.e.f|=wa),a.set(Pe,Ve)),V.add(Pe)}if(N===0&&s&&!g&&(_?g=dr(()=>s(r)):(g=dr(()=>s(Lk??(Lk=il()))),g.f|=wa)),N>V.size&&QF(),!_)if(v.set(F,V),Y){for(const[ve,tt]of a)V.has(ve)||F.skip_effect(tt.e);F.oncommit(w),F.ondiscard(S)}else w(F);u(f)}),P={effect:D,items:a,pending:v,outrogroups:null,fallback:g};_=!1}function Xg(o){for(;o!==null&&(o.f&$r)===0;)o=o.next;return o}function fW(o,e,t,i,n){var Ve,ve,tt,At,mt,hi,Vt,Jt,he;var s=(i&hH)!==0,r=e.length,a=o.items,c=Xg(o.effect.first),h,g=null,f,p=[],v=[],_,w,S,D;if(s)for(D=0;D<r;D+=1)_=e[D],w=n(_,D),S=a.get(w).e,(S.f&wa)===0&&((ve=(Ve=S.nodes)==null?void 0:Ve.a)==null||ve.measure(),(f??(f=new Set)).add(S));for(D=0;D<r;D+=1){if(_=e[D],w=n(_,D),S=a.get(w).e,o.outrogroups!==null)for(const kt of o.outrogroups)kt.pending.delete(S),kt.done.delete(S);if((S.f&fo)!==0&&(G_(S),s&&((At=(tt=S.nodes)==null?void 0:tt.a)==null||At.unfix(),(f??(f=new Set)).delete(S))),(S.f&wa)!==0)if(S.f^=wa,S===c)df(S,null,t);else{var P=g?g.next:c;S===o.effect.last&&(o.effect.last=S.prev),S.prev&&(S.prev.next=S.next),S.next&&(S.next.prev=S.prev),kl(o,g,S),kl(o,S,P),df(S,P,t),g=S,p=[],v=[],c=Xg(g.next);continue}if(S!==c){if(h!==void 0&&h.has(S)){if(p.length<v.length){var N=v[0],V;g=N.prev;var F=p[0],Y=p[p.length-1];for(V=0;V<p.length;V+=1)df(p[V],N,t);for(V=0;V<v.length;V+=1)h.delete(v[V]);kl(o,F.prev,Y.next),kl(o,g,F),kl(o,Y,N),c=N,g=Y,D-=1,p=[],v=[]}else h.delete(S),df(S,c,t),kl(o,S.prev,S.next),kl(o,S,g===null?o.effect.first:g.next),kl(o,g,S),g=S;continue}for(p=[],v=[];c!==null&&c!==S;)(h??(h=new Set)).add(c),v.push(c),c=Xg(c.next);if(c===null)continue}(S.f&wa)===0&&p.push(S),g=S,c=Xg(S.next)}if(o.outrogroups!==null){for(const kt of o.outrogroups)kt.pending.size===0&&(xS(o,fy(kt.done)),(mt=o.outrogroups)==null||mt.delete(kt));o.outrogroups.size===0&&(o.outrogroups=null)}if(c!==null||h!==void 0){var X=[];if(h!==void 0)for(S of h)(S.f&fo)===0&&X.push(S);for(;c!==null;)(c.f&fo)===0&&c!==o.fallback&&X.push(c),c=Xg(c.next);var ue=X.length;if(ue>0){var Pe=(i&TP)!==0&&r===0?t:null;if(s){for(D=0;D<ue;D+=1)(Vt=(hi=X[D].nodes)==null?void 0:hi.a)==null||Vt.measure();for(D=0;D<ue;D+=1)(he=(Jt=X[D].nodes)==null?void 0:Jt.a)==null||he.fix()}gW(o,X,Pe)}}s&&Yl(()=>{var kt,Oe;if(f!==void 0)for(S of f)(Oe=(kt=S.nodes)==null?void 0:kt.a)==null||Oe.apply()})}function pW(o,e,t,i,n,s,r,a){var c=(r&cH)!==0?(r&uH)===0?$H(t,!1,!1):nh(t):null,h=(r&dH)!==0?nh(n):null;return{v:c,i:h,e:dr(()=>(s(e,c??t,h??n,a),()=>{o.delete(i)}))}}function df(o,e,t){if(o.nodes)for(var i=o.nodes.start,n=o.nodes.end,s=e&&(e.f&wa)===0?e.nodes.start:t;i!==null;){var r=tm(i);if(s.before(i),i===n)return;i=r}}function kl(o,e,t){e===null?o.effect.first=t:e.next=t,t===null?o.effect.last=e:t.prev=e}function jl(o,e,t=!1,i=!1,n=!1,s=!1){var r=o,a="";if(t)var c=o;G(()=>{var h=en;if(a!==(a=e()??"")){if(t){h.nodes=null,c.innerHTML=a,a!==""&&sh(Sa(c),c.lastChild);return}if(h.nodes!==null&&(sT(h.nodes.start,h.nodes.end),h.nodes=null),a!==""){var g=i?bH:n?yH:void 0,f=tT(i?"svg":n?"math":"template",g);f.innerHTML=a;var p=i||n?f:f.content;if(sh(Sa(p),p.lastChild),i||n)for(;Sa(p);)r.before(Sa(p));else r.before(p)}}})}const kk=[...`
|
|
3
3
|
\r\f \v\uFEFF`];function mW(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||kk.includes(i[r-1]))&&(a===i.length||kk.includes(i[a]))?i=(r===0?"":i.substring(0,r))+i.substring(a+1):r=a}}return i===""?null:i}function Ik(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 aw(o){return o[0]!=="-"||o[1]!=="-"?o.toLowerCase():o}function _W(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(aw)),n&&c.push(...Object.keys(n).map(aw));var h=0,g=-1;const w=o.length;for(var f=0;f<w;f++){var p=o[f];if(a?p==="/"&&o[f-1]==="*"&&(a=!1):s?s===p&&(s=!1):p==="/"&&o[f+1]==="*"?a=!0:p==='"'||p==="'"?s=p:p==="("?r++:p===")"&&r--,!a&&s===!1&&r===0){if(p===":"&&g===-1)g=f;else if(p===";"||f===w-1){if(g!==-1){var v=aw(o.substring(h,g).trim());if(!c.includes(v)){p!==";"&&f++;var _=o.substring(h,f).trim();t+=" "+_+";"}}h=f+1,g=-1}}}}return i&&(t+=Ik(i)),n&&(t+=Ik(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[fS];if(r!==t||r===void 0){var a=mW(t,i,s);a==null?o.removeAttribute("class"):e?o.className=a:o.setAttribute("class",a),o[fS]=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 lw(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 Ko(o,e,t,i){var n=o[pS];if(n!==e){var s=_W(e,i);s==null?o.removeAttribute("style"):o.style.cssText=s,o[pS]=e}else i&&(Array.isArray(i)?(lw(o,t==null?void 0:t[0],i[0]),lw(o,t==null?void 0:t[1],i[1],"important")):lw(o,t,i));return i}function vT(o,e,t=!1){if(o.multiple){if(e==null)return;if(!Y0(e))return SH();for(var i of o.options)i.selected=e.includes(Ef(i));return}for(i of o.options){var n=Ef(i);if(KH(n,e)){i.selected=!0;return}}(!t||e!==void 0)&&(o.selectedIndex=-1)}function vW(o){var e=new MutationObserver(()=>{vT(o,o.__value)});e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),o1(()=>{e.disconnect()})}function _a(o,e,t=e){var i=new WeakSet,n=!0;n1(o,"change",s=>{var r=s?"[selected]":":checked",a;if(o.multiple)a=[].map.call(o.querySelectorAll(r),Ef);else{var c=o.querySelector(r)??o.querySelector("option:not([disabled])");a=c&&Ef(c)}t(a),o.__value=a,ui!==null&&i.add(ui)}),r1(()=>{var s=e();if(o===document.activeElement){var r=ui;if(i.has(r))return}if(vT(o,s,n),n&&s===void 0){var a=o.querySelector(":checked");a!==null&&(s=Ef(a),t(s))}o.__value=s,n=!1}),vW(o)}function Ef(o){return"__value"in o?o.__value:o.value}const bW=Symbol("is custom element"),yW=Symbol("is html");function cw(o,e){var t=bT(o);t.checked!==(t.checked=e??void 0)&&(o.checked=e)}function Hn(o,e,t,i){var n=bT(o);n[e]!==(n[e]=t)&&(e==="loading"&&(o[YF]=t),t==null?o.removeAttribute(e):typeof t!="string"&&wW(o).includes(e)?o[e]=t:o.setAttribute(e,t))}function bT(o){return o[h_]??(o[h_]={[bW]:o.nodeName.includes("-"),[yW]:o.namespaceURI===MP})}var Dk=new Map;function wW(o){var e=o.getAttribute("is")||o.nodeName,t=Dk.get(e);if(t)return t;Dk.set(e,t=[]);for(var i,n=o,s=Element.prototype;s!==n;){i=jF(n);for(var r in i)i[r].set&&r!=="innerHTML"&&r!=="textContent"&&r!=="innerText"&&t.push(r);n=IP(n)}return t}function Mi(o,e,t=e){var i=new WeakSet;n1(o,"input",async n=>{var s=n?o.defaultValue:o.value;if(s=dw(o)?hw(s):s,t(s),ui!==null&&i.add(ui),await __(),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))}}}),yl(e)==null&&o.value&&(t(dw(o)?hw(o.value):o.value),ui!==null&&i.add(ui)),by(()=>{var n=e();if(o===document.activeElement){var s=ui;if(i.has(s))return}dw(o)&&n===hw(o.value)||o.type==="date"&&!n&&!o.value||n!==o.value&&(o.value=n??"")})}function As(o,e,t=e){n1(o,"change",i=>{var n=i?o.defaultChecked:o.checked;t(n)}),yl(e)==null&&t(o.checked),by(()=>{var i=e();o.checked=!!i})}function dw(o){var e=o.type;return e==="number"||e==="range"}function hw(o){return o===""?null:+o}var Bl,Fu,Fp,sb,yT;const ob=class ob{constructor(e){Pi(this,sb);Pi(this,Bl,new WeakMap);Pi(this,Fu);Pi(this,Fp);Ti(this,Fp,e)}observe(e,t){var i=ee(this,Bl).get(e)||new Set;return i.add(t),ee(this,Bl).set(e,i),En(this,sb,yT).call(this).observe(e,ee(this,Fp)),()=>{var n=ee(this,Bl).get(e);n.delete(t),n.size===0&&(ee(this,Bl).delete(e),ee(this,Fu).unobserve(e))}}};Bl=new WeakMap,Fu=new WeakMap,Fp=new WeakMap,sb=new WeakSet,yT=function(){return ee(this,Fu)??Ti(this,Fu,new ResizeObserver(e=>{for(var t of e){ob.entries.set(t.target,t);for(var i of ee(this,Bl).get(t.target)||[])i(t)}}))},Wi(ob,"entries",new WeakMap);let LS=ob;var SW=new LS({box:"border-box"});function CW(o,e,t){var i=SW.observe(o,()=>t(o[e]));r1(()=>(yl(()=>t(o[e])),i))}function uw(o,e){return o===e||(o==null?void 0:o[od])===e}function bs(o={},e,t,i){var n=Us.r,s=en;return r1(()=>{var r,a;return by(()=>{r=a,a=[],yl(()=>{uw(t(...a),o)||(e(o,...a),r&&uw(t(...r),o)&&e(null,...r))})}),()=>{let c=s;for(;c!==n&&c.parent!==null&&c.parent.f&gS;)c=c.parent;const h=()=>{a&&uw(t(...a),o)&&e(null,...a)},g=c.teardown;c.teardown=()=>{h(),g==null||g()}}}),o}function cg(o,e,t,i){var V;var n=!0,s=(t&pH)!==0,r=(t&mH)!==0,a=i,c=!0,h=void 0,g=()=>r&&n?(h??(h=tp(i)),u(h)):(c&&(c=!1,a=r?yl(i):i),a);let f;if(s){var p=od in o||XF in o;f=((V=Lu(o,e))==null?void 0:V.set)??(p&&e in o?F=>o[e]=F:void 0)}var v,_=!1;s?[v,_]=DH(()=>o[e]):v=o[e],v===void 0&&i!==void 0&&(v=g(),f&&(sH(),f(v)));var w;if(w=()=>{var F=o[e];return F===void 0?g():(c=!0,F)},(t&fH)===0)return w;if(f){var S=o.$$legacy;return(function(F,Y){return arguments.length>0?((!Y||S||_)&&f(Y?w():F),F):w()})}var D=!1,P=((t&gH)!==0?tp:t1)(()=>(D=!1,w()));s&&u(P);var N=en;return(function(F,Y){if(arguments.length>0){const X=Y?u(P):s?wi(F):F;return k(P,X),D=!0,a!==void 0&&(a=X),F}return dl&&D||(N.f&_r)!==0?P.v:u(P)})}function xr(o){Us===null&&PP(),Vn(()=>{const e=yl(o);if(typeof e=="function")return e})}function yy(o){Us===null&&PP(),xr(()=>()=>yl(o))}const xW="5";var XD;typeof window<"u"&&((XD=window.__svelte??(window.__svelte={})).v??(XD.v=new Set)).add(xW);/*!-----------------------------------------------------------------------------
|
|
4
4
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10,7 +10,7 @@ var rA=Object.defineProperty;var FL=o=>{throw TypeError(o)};var aA=(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 AW=Object.defineProperty,OW=Object.getOwnPropertyDescriptor,FW=Object.getOwnPropertyNames,HW=Object.prototype.hasOwnProperty,WW=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of FW(e))!HW.call(o,n)&&n!==t&&AW(o,n,{get:()=>e[n],enumerable:!(i=OW(e,n))||i.enumerable});return o},BW=(o,e,t)=>(WW(o,e,"default"),t),zW="5.4.5",dg={};BW(dg,JD);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||{}),xT=(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))(xT||{}),LT=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(LT||{}),kT=(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))(kT||{}),IT=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(IT||{}),DT=class{constructor(o,e,t,i,n){this._onDidChange=new dg.Emitter,this._onDidExtraLibsChange=new dg.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)}},VW=zW,ET={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},PT=new DT({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},ET),TT=new DT({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},ET),jW=()=>wy().then(o=>o.getTypeScriptWorker()),UW=()=>wy().then(o=>o.getJavaScriptWorker());dg.languages.typescript={ModuleKind:CT,JsxEmit:xT,NewLineKind:LT,ScriptTarget:kT,ModuleResolutionKind:IT,typescriptVersion:VW,typescriptDefaults:PT,javascriptDefaults:TT,getTypeScriptWorker:jW,getJavaScriptWorker:UW};function wy(){return YD(()=>import("./tsMode-C0zTO8Xc.js"),__vite__mapDeps([3,1,2]))}dg.languages.onLanguage("typescript",()=>wy().then(o=>o.setupTypeScript(PT)));dg.languages.onLanguage("javascript",()=>wy().then(o=>o.setupJavaScript(TT)));class $W extends io{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:wt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Zt.map,toggled:ae.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ae.has("isInDiffEditor"),menu:{when:ae.has("isInDiffEditor"),id:lt.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Mn),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class MT extends io{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:wt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Mn),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class NT extends io{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:wt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Mn),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const sm=wt("diffEditor","Diff Editor");class qW extends qr{constructor(){super({id:"diffEditor.switchSide",title:wt("switchSide","Switch Side"),icon:Zt.arrowSwap,precondition:ae.has("isInDiffEditor"),f1:!0,category:sm})}runEditorCommand(e,t,i){const n=Mg(e);if(n instanceof Hp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class KW extends qr{constructor(){super({id:"diffEditor.exitCompareMove",title:wt("exitCompareMove","Exit Compare Move"),icon:Zt.close,precondition:M.comparingMovedCode,f1:!1,category:sm,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Mg(e);n instanceof Hp&&n.exitCompareMove()}}class GW extends qr{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:wt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Zt.fold,precondition:ae.has("isInDiffEditor"),f1:!0,category:sm})}runEditorCommand(e,t,...i){const n=Mg(e);n instanceof Hp&&n.collapseAllUnchangedRegions()}}class ZW extends qr{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:wt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Zt.unfold,precondition:ae.has("isInDiffEditor"),f1:!0,category:sm})}runEditorCommand(e,t,...i){const n=Mg(e);n instanceof Hp&&n.showAllUnchangedRegions()}}class kS extends io{constructor(){super({id:"diffEditor.revert",title:wt("revert","Revert"),f1:!1,category:sm})}run(e,t){const i=XW(e,t.originalUri,t.modifiedUri);i instanceof Hp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const RT=wt("accessibleDiffViewer","Accessible Diff Viewer"),rb=class rb extends io{constructor(){super({id:rb.id,title:wt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:RT,precondition:ae.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Mg(e);t==null||t.accessibleDiffViewerNext()}};rb.id="editor.action.accessibleDiffViewer.next";let np=rb;const ab=class ab extends io{constructor(){super({id:ab.id,title:wt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:RT,precondition:ae.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Mg(e);t==null||t.accessibleDiffViewerPrev()}};ab.id="editor.action.accessibleDiffViewer.prev";let Z_=ab;function XW(o,e,t){return o.get(ns).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 Mg(o){const t=o.get(ns).listDiffEditors(),i=QD();if(i)for(const n of t){const s=n.getContainerDomNode();if(YW(s,i))return n}return null}function YW(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}tn($W);tn(MT);tn(NT);vr.appendMenuItem(lt.EditorTitle,{command:{id:new NT().desc.id,title:y("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ae.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ae.has("isInDiffEditor")},order:11,group:"1_diff",when:ae.and(M.diffEditorRenderSideBySideInlineBreakpointReached,ae.has("isInDiffEditor"))});vr.appendMenuItem(lt.EditorTitle,{command:{id:new MT().desc.id,title:y("showMoves","Show Moved Code Blocks"),icon:Zt.move,toggled:lA.create("config.diffEditor.experimental.showMoves",!0),precondition:ae.has("isInDiffEditor")},order:10,group:"1_diff",when:ae.has("isInDiffEditor")});tn(kS);for(const o of[{icon:Zt.arrowRight,key:M.diffEditorInlineMode.toNegated()},{icon:Zt.discard,key:M.diffEditorInlineMode}])vr.appendMenuItem(lt.DiffEditorHunkToolbar,{command:{id:new kS().desc.id,title:y("revertHunk","Revert Block"),icon:o.icon},when:ae.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),vr.appendMenuItem(lt.DiffEditorSelectionToolbar,{command:{id:new kS().desc.id,title:y("revertSelection","Revert Selection"),icon:o.icon},when:ae.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"});tn(qW);tn(KW);tn(GW);tn(ZW);vr.appendMenuItem(lt.EditorTitle,{command:{id:np.id,title:y("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ae.has("isInDiffEditor")},order:10,group:"2_diff",when:ae.and(M.accessibleDiffViewerVisible.negate(),ae.has("isInDiffEditor"))});wn.registerCommandAlias("editor.action.diffReview.next",np.id);tn(np);wn.registerCommandAlias("editor.action.diffReview.prev",Z_.id);tn(Z_);var JW=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},QW=function(o,e){return function(t,i){e(t,i,o)}},IS;const Sy=new Ni("selectionAnchorSet",!1);var gd;let bc=(gd=class{static get(e){return e.getContribution(IS.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Sy.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(Ut.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Ws().appendText(y("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),br(y("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Ut.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()}},IS=gd,gd.ID="editor.contrib.selectionAnchorController",gd);bc=IS=JW([QW(1,zi)],bc);class e3 extends Ce{constructor(){super({id:"editor.action.setSelectionAnchor",label:y("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:rs(2089,2080),weight:100}})}async run(e,t){var i;(i=bc.get(t))==null||i.setSelectionAnchor()}}class t3 extends Ce{constructor(){super({id:"editor.action.goToSelectionAnchor",label:y("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Sy})}async run(e,t){var i;(i=bc.get(t))==null||i.goToSelectionAnchor()}}class i3 extends Ce{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:y("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Sy,kbOpts:{kbExpr:M.editorTextFocus,primary:rs(2089,2089),weight:100}})}async run(e,t){var i;(i=bc.get(t))==null||i.selectFromAnchorToCursor()}}class n3 extends Ce{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:y("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Sy,kbOpts:{kbExpr:M.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=bc.get(t))==null||i.cancelSelectionAnchor()}}vi(bc.ID,bc,4);ne(e3);ne(t3);ne(i3);ne(n3);const s3=pt("editorOverviewRuler.bracketMatchForeground","#A0A0A0",y("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class o3 extends Ce{constructor(){super({id:"editor.action.jumpToBracket",label:y("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=oh.get(t))==null||i.jumpToBracket()}}class r3 extends Ce{constructor(){super({id:"editor.action.selectToBracket",label:y("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:wt("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=oh.get(t))==null||s.selectToBracket(n)}}class a3 extends Ce{constructor(){super({id:"editor.action.removeBrackets",label:y("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=oh.get(t))==null||i.removeBrackets(this.id)}}class l3{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Nl=class Nl extends ze{static get(e){return e.getContribution(Nl.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new hs(()=>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 Ut(r.lineNumber,r.column,r.lineNumber,r.column):new Ut(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(z.compareRangesUsingStarts);const[h,g]=r;if(a=e?h.getStartPosition():h.getEndPosition(),c=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(s)){const f=a;a=c,c=f}}a&&c&&i.push(new Ut(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(xt.compare);const a=[];let c=0,h=0;const g=n.length;for(let f=0,p=s.length;f<p;f++){const v=s[f];for(;h<g&&n[h].position.isBefore(v);)h++;if(h<g&&n[h].position.equals(v))a[c++]=n[h];else{let _=t.bracketPairs.matchBracket(v,20),w=Nl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(v,20),w=Nl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[c++]=new l3(v,_,w)}}this._lastBracketsData=a,this._lastVersionId=i}};Nl.ID="editor.contrib.bracketMatchingController",Nl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Di.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ls(s3),position:xa.Center}}),Nl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Di.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let oh=Nl;vi(oh.ID,oh,1);ne(r3);ne(o3);ne(a3);vr.appendMenuItem(lt.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:y({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class c3{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 z(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new z(i,s,i,s),a)}else{const r=new z(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new z(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new Ut(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Ut(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class AT extends Ce{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 c3(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class d3 extends AT{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:y("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:M.writable})}}class h3 extends AT{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:y("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:M.writable})}}ne(d3);ne(h3);class u3 extends Ce{constructor(){super({id:"editor.action.transposeLetters",label:y("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,c=r.startColumn,h=i.getLineMaxColumn(a);if(a===1&&(c===1||c===2&&h===2))continue;const g=c===h?r.getPosition():Yy.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),f=Yy.leftPosition(i,g),p=Yy.leftPosition(i,f),v=i.getValueInRange(z.fromPositions(p,f)),_=i.getValueInRange(z.fromPositions(f,g)),w=z.fromPositions(p,g);n.push(new Wp(w,_+v))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}ne(u3);const Cy=(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 d1(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function g3(o,e,t){const i={id:Cy(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class OT{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"),HT(X_(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 X_(e)}}function X_(o){return o.toLowerCase()}function FT(o,e){return HT(X_(o),e.map(X_))}function HT(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 xy=Object.freeze({create:o=>eE(o.map(e=>e.toString())).join(`\r
|
|
13
|
+
*-----------------------------------------------------------------------------*/var AW=Object.defineProperty,OW=Object.getOwnPropertyDescriptor,FW=Object.getOwnPropertyNames,HW=Object.prototype.hasOwnProperty,WW=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of FW(e))!HW.call(o,n)&&n!==t&&AW(o,n,{get:()=>e[n],enumerable:!(i=OW(e,n))||i.enumerable});return o},BW=(o,e,t)=>(WW(o,e,"default"),t),zW="5.4.5",dg={};BW(dg,JD);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||{}),xT=(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))(xT||{}),LT=(o=>(o[o.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",o[o.LineFeed=1]="LineFeed",o))(LT||{}),kT=(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))(kT||{}),IT=(o=>(o[o.Classic=1]="Classic",o[o.NodeJs=2]="NodeJs",o))(IT||{}),DT=class{constructor(o,e,t,i,n){this._onDidChange=new dg.Emitter,this._onDidExtraLibsChange=new dg.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)}},VW=zW,ET={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},PT=new DT({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},ET),TT=new DT({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},ET),jW=()=>wy().then(o=>o.getTypeScriptWorker()),UW=()=>wy().then(o=>o.getJavaScriptWorker());dg.languages.typescript={ModuleKind:CT,JsxEmit:xT,NewLineKind:LT,ScriptTarget:kT,ModuleResolutionKind:IT,typescriptVersion:VW,typescriptDefaults:PT,javascriptDefaults:TT,getTypeScriptWorker:jW,getJavaScriptWorker:UW};function wy(){return YD(()=>import("./tsMode-BvKJjsOI.js"),__vite__mapDeps([3,1,2]))}dg.languages.onLanguage("typescript",()=>wy().then(o=>o.setupTypeScript(PT)));dg.languages.onLanguage("javascript",()=>wy().then(o=>o.setupJavaScript(TT)));class $W extends io{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:wt("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Zt.map,toggled:ae.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:ae.has("isInDiffEditor"),menu:{when:ae.has("isInDiffEditor"),id:lt.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Mn),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class MT extends io{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:wt("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Mn),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class NT extends io{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:wt("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:ae.has("isInDiffEditor")})}run(e,...t){const i=e.get(Mn),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const sm=wt("diffEditor","Diff Editor");class qW extends qr{constructor(){super({id:"diffEditor.switchSide",title:wt("switchSide","Switch Side"),icon:Zt.arrowSwap,precondition:ae.has("isInDiffEditor"),f1:!0,category:sm})}runEditorCommand(e,t,i){const n=Mg(e);if(n instanceof Hp){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class KW extends qr{constructor(){super({id:"diffEditor.exitCompareMove",title:wt("exitCompareMove","Exit Compare Move"),icon:Zt.close,precondition:M.comparingMovedCode,f1:!1,category:sm,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=Mg(e);n instanceof Hp&&n.exitCompareMove()}}class GW extends qr{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:wt("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Zt.fold,precondition:ae.has("isInDiffEditor"),f1:!0,category:sm})}runEditorCommand(e,t,...i){const n=Mg(e);n instanceof Hp&&n.collapseAllUnchangedRegions()}}class ZW extends qr{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:wt("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Zt.unfold,precondition:ae.has("isInDiffEditor"),f1:!0,category:sm})}runEditorCommand(e,t,...i){const n=Mg(e);n instanceof Hp&&n.showAllUnchangedRegions()}}class kS extends io{constructor(){super({id:"diffEditor.revert",title:wt("revert","Revert"),f1:!1,category:sm})}run(e,t){const i=XW(e,t.originalUri,t.modifiedUri);i instanceof Hp&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const RT=wt("accessibleDiffViewer","Accessible Diff Viewer"),rb=class rb extends io{constructor(){super({id:rb.id,title:wt("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:RT,precondition:ae.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=Mg(e);t==null||t.accessibleDiffViewerNext()}};rb.id="editor.action.accessibleDiffViewer.next";let np=rb;const ab=class ab extends io{constructor(){super({id:ab.id,title:wt("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:RT,precondition:ae.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=Mg(e);t==null||t.accessibleDiffViewerPrev()}};ab.id="editor.action.accessibleDiffViewer.prev";let Z_=ab;function XW(o,e,t){return o.get(ns).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 Mg(o){const t=o.get(ns).listDiffEditors(),i=QD();if(i)for(const n of t){const s=n.getContainerDomNode();if(YW(s,i))return n}return null}function YW(o,e){let t=e;for(;t;){if(t===o)return!0;t=t.parentElement}return!1}tn($W);tn(MT);tn(NT);vr.appendMenuItem(lt.EditorTitle,{command:{id:new NT().desc.id,title:y("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:ae.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:ae.has("isInDiffEditor")},order:11,group:"1_diff",when:ae.and(M.diffEditorRenderSideBySideInlineBreakpointReached,ae.has("isInDiffEditor"))});vr.appendMenuItem(lt.EditorTitle,{command:{id:new MT().desc.id,title:y("showMoves","Show Moved Code Blocks"),icon:Zt.move,toggled:lA.create("config.diffEditor.experimental.showMoves",!0),precondition:ae.has("isInDiffEditor")},order:10,group:"1_diff",when:ae.has("isInDiffEditor")});tn(kS);for(const o of[{icon:Zt.arrowRight,key:M.diffEditorInlineMode.toNegated()},{icon:Zt.discard,key:M.diffEditorInlineMode}])vr.appendMenuItem(lt.DiffEditorHunkToolbar,{command:{id:new kS().desc.id,title:y("revertHunk","Revert Block"),icon:o.icon},when:ae.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"}),vr.appendMenuItem(lt.DiffEditorSelectionToolbar,{command:{id:new kS().desc.id,title:y("revertSelection","Revert Selection"),icon:o.icon},when:ae.and(M.diffEditorModifiedWritable,o.key),order:5,group:"primary"});tn(qW);tn(KW);tn(GW);tn(ZW);vr.appendMenuItem(lt.EditorTitle,{command:{id:np.id,title:y("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:ae.has("isInDiffEditor")},order:10,group:"2_diff",when:ae.and(M.accessibleDiffViewerVisible.negate(),ae.has("isInDiffEditor"))});wn.registerCommandAlias("editor.action.diffReview.next",np.id);tn(np);wn.registerCommandAlias("editor.action.diffReview.prev",Z_.id);tn(Z_);var JW=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},QW=function(o,e){return function(t,i){e(t,i,o)}},IS;const Sy=new Ni("selectionAnchorSet",!1);var gd;let bc=(gd=class{static get(e){return e.getContribution(IS.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Sy.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(Ut.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Ws().appendText(y("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),br(y("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Ut.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()}},IS=gd,gd.ID="editor.contrib.selectionAnchorController",gd);bc=IS=JW([QW(1,zi)],bc);class e3 extends Ce{constructor(){super({id:"editor.action.setSelectionAnchor",label:y("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:rs(2089,2080),weight:100}})}async run(e,t){var i;(i=bc.get(t))==null||i.setSelectionAnchor()}}class t3 extends Ce{constructor(){super({id:"editor.action.goToSelectionAnchor",label:y("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Sy})}async run(e,t){var i;(i=bc.get(t))==null||i.goToSelectionAnchor()}}class i3 extends Ce{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:y("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Sy,kbOpts:{kbExpr:M.editorTextFocus,primary:rs(2089,2089),weight:100}})}async run(e,t){var i;(i=bc.get(t))==null||i.selectFromAnchorToCursor()}}class n3 extends Ce{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:y("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Sy,kbOpts:{kbExpr:M.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=bc.get(t))==null||i.cancelSelectionAnchor()}}vi(bc.ID,bc,4);ne(e3);ne(t3);ne(i3);ne(n3);const s3=pt("editorOverviewRuler.bracketMatchForeground","#A0A0A0",y("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class o3 extends Ce{constructor(){super({id:"editor.action.jumpToBracket",label:y("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=oh.get(t))==null||i.jumpToBracket()}}class r3 extends Ce{constructor(){super({id:"editor.action.selectToBracket",label:y("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:wt("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=oh.get(t))==null||s.selectToBracket(n)}}class a3 extends Ce{constructor(){super({id:"editor.action.removeBrackets",label:y("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:M.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=oh.get(t))==null||i.removeBrackets(this.id)}}class l3{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Nl=class Nl extends ze{static get(e){return e.getContribution(Nl.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new hs(()=>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 Ut(r.lineNumber,r.column,r.lineNumber,r.column):new Ut(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(z.compareRangesUsingStarts);const[h,g]=r;if(a=e?h.getStartPosition():h.getEndPosition(),c=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(s)){const f=a;a=c,c=f}}a&&c&&i.push(new Ut(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(xt.compare);const a=[];let c=0,h=0;const g=n.length;for(let f=0,p=s.length;f<p;f++){const v=s[f];for(;h<g&&n[h].position.isBefore(v);)h++;if(h<g&&n[h].position.equals(v))a[c++]=n[h];else{let _=t.bracketPairs.matchBracket(v,20),w=Nl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(v,20),w=Nl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[c++]=new l3(v,_,w)}}this._lastBracketsData=a,this._lastVersionId=i}};Nl.ID="editor.contrib.bracketMatchingController",Nl._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Di.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ls(s3),position:xa.Center}}),Nl._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Di.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let oh=Nl;vi(oh.ID,oh,1);ne(r3);ne(o3);ne(a3);vr.appendMenuItem(lt.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:y({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class c3{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 z(i,n-1,i,n),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new z(i,s,i,s),a)}else{const r=new z(i,s,i,s+1),a=e.getValueInRange(r);t.addEditOperation(r,null),t.addEditOperation(new z(i,n,i,n),a)}}computeCursorState(e,t){return this._isMovingLeft?new Ut(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Ut(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class AT extends Ce{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 c3(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class d3 extends AT{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:y("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:M.writable})}}class h3 extends AT{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:y("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:M.writable})}}ne(d3);ne(h3);class u3 extends Ce{constructor(){super({id:"editor.action.transposeLetters",label:y("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:M.writable,kbOpts:{kbExpr:M.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const r of s){if(!r.isEmpty())continue;const a=r.startLineNumber,c=r.startColumn,h=i.getLineMaxColumn(a);if(a===1&&(c===1||c===2&&h===2))continue;const g=c===h?r.getPosition():Yy.rightPosition(i,r.getPosition().lineNumber,r.getPosition().column),f=Yy.leftPosition(i,g),p=Yy.leftPosition(i,f),v=i.getValueInRange(z.fromPositions(p,f)),_=i.getValueInRange(z.fromPositions(f,g)),w=z.fromPositions(p,g);n.push(new Wp(w,_+v))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}ne(u3);const Cy=(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 d1(o){return{asString:async()=>o,asFile:()=>{},value:typeof o=="string"?o:void 0}}function g3(o,e,t){const i={id:Cy(),name:o,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class OT{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"),HT(X_(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 X_(e)}}function X_(o){return o.toLowerCase()}function FT(o,e){return HT(X_(o),e.map(X_))}function HT(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 xy=Object.freeze({create:o=>eE(o.map(e=>e.toString())).join(`\r
|
|
14
14
|
`),split:o=>o.split(`\r
|
|
15
15
|
`),parse:o=>xy.split(o).filter(e=>!e.startsWith("#"))}),la=class la{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+la.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new la((this.value?[this.value,...e]:e).join(la.sep))}};la.sep=".",la.None=new la("@@none@@"),la.Empty=new la("");let Tn=la;const Ek={EDITORS:"CodeEditors",FILES:"CodeFiles"};class f3{}const p3={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Kr.add(p3.DragAndDropContribution,new f3);const Bf=class Bf{constructor(){}static getInstance(){return Bf.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};Bf.INSTANCE=new Bf;let DS=Bf;function WT(o){const e=new OT;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,d1(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,m3(n))}}return e}function m3(o){const e=o.path?an.parse(o.path):void 0;return g3(o.name,e,async()=>new Uint8Array(await o.arrayBuffer()))}const _3=Object.freeze([Ek.EDITORS,Ek.FILES,Yw.RESOURCES,Yw.INTERNAL_URI_LIST]);function BT(o,e=!1){const t=WT(o),i=t.get(Yw.INTERNAL_URI_LIST);if(i)t.replace(Cs.uriList,i);else if(e||!t.has(Cs.uriList)){const n=[];for(const s of o.items){const r=s.getAsFile();if(r){const a=r.path;try{a?n.push(an.file(a).toString()):n.push(an.parse(r.name,!0).toString())}catch{}}}n.length&&t.replace(Cs.uriList,d1(xy.create(n)))}for(const n of _3)t.delete(n);return t}var h1=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},sp=function(o,e){return function(t,i){e(t,i,o)}};class u1{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 zf=class zf extends u1{constructor(){super(...arguments),this.kind=zf.kind,this.dropMimeTypes=[Cs.text],this.pasteMimeTypes=[Cs.text]}async getEdit(e,t){const i=e.get(Cs.text);if(!i||e.has(Cs.uriList))return;const n=await i.asString();return{handledMimeType:Cs.text,title:y("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};zf.id="text",zf.kind=new Tn("text.plain");let rh=zf;class zT extends u1{constructor(){super(...arguments),this.kind=new Tn("uri.absolute"),this.dropMimeTypes=[Cs.uriList],this.pasteMimeTypes=[Cs.uriList]}async getEdit(e,t){const i=await VT(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:a,originalText:c})=>a.scheme===Ys.file?a.fsPath:(n++,c)).join(" ");let r;return n>0?r=i.length>1?y("defaultDropProvider.uriList.uris","Insert Uris"):y("defaultDropProvider.uriList.uri","Insert Uri"):r=i.length>1?y("defaultDropProvider.uriList.paths","Insert Paths"):y("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Cs.uriList,insertText:s,title:r,kind:this.kind}}}let Y_=class extends u1{constructor(e){super(),this._workspaceContextService=e,this.kind=new Tn("uri.relative"),this.dropMimeTypes=[Cs.uriList],this.pasteMimeTypes=[Cs.uriList]}async getEdit(e,t){const i=await VT(e);if(!i.length||t.isCancellationRequested)return;const n=ol(i.map(({uri:s})=>{const r=this._workspaceContextService.getWorkspaceFolder(s);return r?cA(r.uri,s):void 0}));if(n.length)return{handledMimeType:Cs.uriList,insertText:n.join(" "),title:i.length>1?y("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):y("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};Y_=h1([sp(0,Gu)],Y_);class v3{constructor(){this.kind=new Tn("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Cs.text}]}async provideDocumentPasteEdits(e,t,i,n,s){var c;if(n.triggerKind!==Jw.PasteAs&&!((c=n.only)!=null&&c.contains(this.kind)))return;const r=i.get("text/html"),a=await(r==null?void 0:r.asString());if(!(!a||s.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:y("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function VT(o){const e=o.get(Cs.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of xy.parse(t))try{i.push({uri:an.parse(n),originalText:n})}catch{}return i}let ES=class extends ze{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new rh)),this._register(e.documentDropEditProvider.register("*",new zT)),this._register(e.documentDropEditProvider.register("*",new Y_(t)))}};ES=h1([sp(0,Lt),sp(1,Gu)],ES);let PS=class extends ze{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new rh)),this._register(e.documentPasteEditProvider.register("*",new zT)),this._register(e.documentPasteEditProvider.register("*",new Y_(t))),this._register(e.documentPasteEditProvider.register("*",new v3))}};PS=h1([sp(0,Lt),sp(1,Gu)],PS);const ir=class ir{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=ir._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(ir.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(ir.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(ir.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(ir.isVariableCharacter(i)||ir.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 ir._table[i]>"u"&&!ir.isDigitCharacter(i)&&!ir.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};ir._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let TS=ir;class Ng{constructor(){this._children=[]}appendChild(e){return e instanceof go&&this._children[this._children.length-1]instanceof go?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 om)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}let go=class jT extends Ng{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new jT(this.value)}};class UT extends Ng{}class qo extends UT{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 Rg?this._children[0]:void 0}clone(){const e=new qo(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Rg extends Ng{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof go&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Rg;return this.options.forEach(e.appendChild,e),e}}class g1 extends Ng{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 Rr&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Rr){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new g1;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 Rr extends Ng{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 Rr(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class op extends UT{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 go(t)],!0):!1}clone(){const e=new op(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function Pk(o,e){const t=[...o];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class om extends Ng{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof qo&&(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 Pk([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof qo&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof op&&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 om;return this._children=this.children.map(t=>t.clone()),e}walk(e){Pk(this.children,e)}}class ah{constructor(){this._scanner=new TS,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 om;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 qo&&(c.isFinalTabstop?n.set(0,void 0):!n.has(c.index)&&c.children.length>0?n.set(c.index,c.children):s.push(c)),!0));const r=(c,h)=>{const g=n.get(c.index);if(!g)return;const f=new qo(c.index);f.transform=c.transform;for(const p of g){const v=p.clone();f.appendChild(v),v instanceof qo&&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 qo(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 go(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 qo(Number(t)):new op(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 qo(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new go("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const r=new Rg;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 go(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 op(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new go("${"+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 g1;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 go(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 Rr(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Rr(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 Rr(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new Rr(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new Rr(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 Rr(Number(n),void 0,s,r)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new Rr(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new go(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function $T(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 dA(o,{range:s,text:typeof t.insertText=="string"?ah.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function qT(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 b3=function(o,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,t,i);else for(var a=o.length-1;a>=0;a--)(r=o[a])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},y3=function(o,e){return function(t,i){e(t,i,o)}};const w3=Di.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:tE,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),lb=class lb extends ze{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=ft(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=ft("span.icon");this.domNode.append(t),t.classList.add(...Ki.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(Bi(this.domNode,$n.CLICK,n=>{this.delegate.cancel()}))}getId(){return lb.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)}};lb.baseId="editor.widget.inlineProgressWidget";let MS=lb,J_=class extends ze{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Mo),this._currentWidget=this._register(new Mo),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=Uf(()=>{const a=z.fromPositions(e);this._currentDecorations.set([{range:a,options:w3}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(MS,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()}};J_=b3([y3(2,di)],J_);var S3=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},Tk=function(o,e){return function(t,i){e(t,i,o)}},v_,Ql;let po=(Ql=class{static get(e){return e.getContribution(v_.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Mo,this._messageListeners=new He,this._mouseOverMessage=!1,this._editor=e,this._visible=v_.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){br(r_(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=r_(e)?hA(e,{actionHandler:{callback:n=>{this.closeMessage(),uA(this._openerService,n,r_(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new Mk(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(ds.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&gA(QD(),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(Bi(this._messageWidget.value.getDomNode(),$n.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(Bi(this._messageWidget.value.getDomNode(),$n.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 z(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(Mk.fadeOut(this._messageWidget.value))}},v_=Ql,Ql.ID="editor.contrib.messageController",Ql.MESSAGE_VISIBLE=new Ni("messageVisible",!1,y("messageVisible","Whether the editor is currently showing an inline message")),Ql);po=v_=S3([Tk(1,zi),Tk(2,Gr)],po);const C3=no.bindToContribution(po.get);Mt(new C3({id:"leaveEditorMessage",precondition:po.MESSAGE_VISIBLE,handler:o=>o.closeMessage(),kbOpts:{weight:130,primary:9}}));let Mk=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const r=document.createElement("div");typeof n=="string"?(r.classList.add("message"),r.textContent=n):(n.classList.add("message"),r.appendChild(n)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};vi(po.ID,po,4);function gw(o,e){return e&&(o.stack||o.stacktrace)?y("stackTrace.format","{0}: {1}",Rk(o),Nk(o.stack)||Nk(o.stacktrace)):Rk(o)}function Nk(o){return Array.isArray(o)?o.join(`
|
|
16
16
|
`):o}function Rk(o){return o.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${o.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof o.code=="string"&&typeof o.errno=="number"&&typeof o.syscall=="string"?y("nodeExceptionMessage","A system error occurred ({0})",o.message):o.message||y("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function Q_(o=null,e=!1){if(!o)return y("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(o)){const t=ol(o),i=Q_(t[0],e);return t.length>1?y("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(iE(o))return o;if(o.detail){const t=o.detail;if(t.error)return gw(t.error,e);if(t.exception)return gw(t.exception,e)}return o.stack?gw(o,e):o.message?o.message:y("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var KT=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},Iu=function(o,e){return function(t,i){e(t,i,o)}},NS,fd;let RS=(fd=class extends ze{constructor(e,t,i,n,s,r,a,c,h,g){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=r,this.onSelectNewEdit=a,this._contextMenuService=c,this._keybindingService=g,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(h),this.visibleContext.set(!0),this._register(Pn(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Pn((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(f=>{s.containsPosition(f.position)||this.dispose()})),this._register(ds.runAndSubscribe(g.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=ft(".post-edit-widget"),this.button=this._register(new fA(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(Bi(this.domNode,$n.CLICK,()=>this.showSelector()))}getId(){return NS.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Qs(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>pA({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},NS=fd,fd.baseId="editor.widget.postEditWidget",fd);RS=NS=KT([Iu(7,Lg),Iu(8,zi),Iu(9,as)],RS);let ev=class extends ze{constructor(e,t,i,n,s,r,a){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=r,this._notificationService=a,this._currentWidget=this._register(new Mo),this._register(ds.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)=>{xc(S)||(this._notificationService.error(D),i&&this.show(e[0],t,c))};let g;try{g=await n(a,s)}catch(S){return h(S,y("resolveError",`Error resolving edit '{0}':
|
|
@@ -222,4 +222,4 @@ declare const she: {
|
|
|
222
222
|
`).trim())}}return K}function Si(A){return A.filter!==void 0||A.map!==void 0||A.reduce!==void 0}function Qt(A){const K=[];return A.filter!==void 0&&K.push("filter"),A.map!==void 0&&K.push("map"),A.reduce!==void 0&&K.push("reduce"),`Apply ${K.join(" + ")}`}const Ht=15;function St(A){return A.split(`
|
|
223
223
|
`).length>Ht}function ri(A){const K=new Set(u(p));K.has(A)?K.delete(A):K.add(A),k(p,K,!0)}function Ii(A,K){if(ln(K))try{return Xv.highlight(A,{language:"javascript"}).value}catch{}return A.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Sn(A){return Wn.parse(A)}function ln(A){return!A||A==="js"||A==="javascript"}function Nn(A){navigator.clipboard.writeText(A).catch(()=>{})}async function cn(){if(k(v,!0),!(u(_)||u(w))){k(w,!0),k(S,"");try{k(_,await pR(u(f)||u(h).model),!0)}catch(A){k(S,A.message,!0)}k(w,!1)}}function Ri(A){return A>=1e9?`${(A/1e9).toFixed(1)} GB`:A>=1e6?`${(A/1e6).toFixed(0)} MB`:`${A} B`}function Bn(A){const K=A.match(/\.([^.]+)$/);return K?K[1].toUpperCase():"?"}function Zi(A){switch(A){case"SH":case"BASH":return"$";case"MD":case"MARKDOWN":return"↓";case"JSON":case"JSONC":return"{}";default:return A}}function fn(A){k(X,u(X).filter((K,Re)=>Re!==A),!0)}function nn(){Ve.click()}async function Ui(A){if(!(!A||A.length===0))for(const K of Array.from(A)){const Re=await K.text();k(X,[...u(X),{name:K.name,content:Re}],!0)}}function pn(A){const K=A.target;Ui(K.files),K.value=""}function Rn(A){var K;A.preventDefault(),k(Pe,!1),Ui(((K=A.dataTransfer)==null?void 0:K.files)??null)}function Cn(A){var K;(K=A.dataTransfer)!=null&&K.types.includes("Files")&&(A.preventDefault(),k(Pe,!0))}function zn(){k(Pe,!1)}async function xn(){const A=u(r).trim();if(!(!A||u(a))){k(r,""),k(c,""),k(a,!0),k(n,[...u(n),{role:"user",content:A}],!0),D=new AbortController,k(ve,[],!0);try{await _R({messages:u(n),currentView:u(he),context:u(hi),modelOverride:u(f)||void 0,extraFiles:u(X).length>0?u(X):void 0},K=>{k(s,(u(s)??"")+K)},D.signal,K=>{k(ve,[...u(ve),K],!0)}),k(n,[...u(n),{role:"assistant",content:u(s)??"",toolEvents:u(ve).length>0?[...u(ve)]:void 0}],!0),k(ve,[],!0)}catch(K){if(K.name==="AbortError"){const Re=u(s);Re!=null&&Re.trim()&&k(n,[...u(n),{role:"assistant",content:Re+`
|
|
224
224
|
|
|
225
|
-
*[stopped]*`,toolEvents:u(ve).length>0?[...u(ve)]:void 0}],!0)}else k(c,K.message,!0)}finally{D=null,k(s,null),k(ve,[],!0),k(a,!1)}}}function Ln(){D==null||D.abort()}function Xi(A){A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),xn())}function Ke(){k(n,[],!0),k(c,"")}const Ot=["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 gi(A){k(r,A,!0),At==null||At.focus()}var xi=U9(),Li=_t(xi),sn=C(Li),mn=x(C(sn),2);{var Kn=A=>{var K=l9(),Re=C(K);{var Se=Le=>{var re=Ur();G(()=>q(re,`${u(h).provider??""} · ${(u(f)||u(h).model)??""}`)),T(Le,re)},Ne=Le=>{var re=Ur("Not configured");T(Le,re)};$(Re,Le=>{u(Vt)?Le(Se):Le(Ne,-1)})}G(()=>Hn(K,"title",`Provider: ${u(h).provider??""}`)),T(A,K)};$(mn,A=>{u(h)&&A(Kn)})}var dn=x(mn,2);{var An=A=>{var K=c9();te("click",K,Ke),T(A,K)};$(dn,A=>{u(n).length>0&&A(An)})}var on=x(sn,2),kn=C(on);{var Ae=A=>{var K=d9();T(A,K)},Z=A=>{var K=g9(),Re=C(K),Se=C(Re);{var Ne=st=>{var Ue=h9(),Ee=x(_t(Ue)),Tt=C(Ee);G(()=>q(Tt,t().id)),T(st,Ue)},Le=st=>{var Ue=Ur("No view selected. Ask a general sheDB view question.");T(st,Ue)};$(Se,st=>{t()?st(Ne):st(Le,-1)})}var re=x(Re,2);_i(re,17,()=>Ot,jn,(st,Ue)=>{var Ee=u9(),Tt=C(Ee);G(()=>q(Tt,u(Ue))),te("click",Ee,()=>gi(u(Ue))),T(st,Ee)}),T(A,K)};$(kn,A=>{u(Vt)?u(n).length===0&&u(s)===null&&A(Z,1):A(Ae)})}var Fe=x(kn,2);_i(Fe,17,()=>u(n),jn,(A,K,Re)=>{var Se=b9(),Ne=C(Se);{var Le=st=>{var Ue=f9(),Ee=C(Ue);G(()=>q(Ee,u(K).content)),T(st,Ue)},re=st=>{const Ue=ot(()=>Oe(u(K).content)),Ee=ot(()=>Rt(u(Ue)));var Tt=v9(),We=_t(Tt);{var H=ut=>{var ye=VD();_i(ye,21,()=>u(K).toolEvents,jn,(Dt,ht)=>{var ge=Fs(),yt=_t(ge);{var Xe=le=>{var _e=BD(),Je=x(C(_e)),zt=C(Je);G(fe=>q(zt,fe),[()=>u(ht).name.replace(/_/g," ")]),T(le,_e)},De=le=>{var _e=zD(),Je=x(C(_e)),zt=C(Je);G(fe=>q(zt,fe),[()=>u(ht).name.replace(/_/g," ")]),T(le,_e)};$(yt,le=>{u(ht).type==="tool_call"?le(Xe):le(De,-1)})}T(Dt,ge)}),T(ut,ye)};$(We,ut=>{var ye;(ye=u(K).toolEvents)!=null&&ye.length&&ut(H)})}var Q=x(We,2),ke=C(Q);_i(ke,17,()=>u(Ue),jn,(ut,ye,Dt)=>{var ht=Fs(),ge=_t(ht);{var yt=De=>{var le=jD();jl(le,()=>Sn(u(ye).text),!0),T(De,le)},Xe=De=>{const le=ot(()=>`${Re}:${Dt}`),_e=ot(()=>St(u(ye).text)),Je=ot(()=>u(p).has(u(le))),zt=ot(()=>u(ye).lang==="filter");var fe=m9(),Ge=C(fe),gt=C(Ge),Et=C(gt),Qe=x(gt,2),li=C(Qe),Yt=x(Ge,2);let Gn;var $i=C(Yt),si=C($i);jl(si,()=>Ii(u(ye).text,u(ye).lang??""),!0);var qt=x($i,2);{var _n=oi=>{var On=p9(),Yi=C(On);G(()=>q(Yi,u(Je)?"▲ collapse":"▼ expand")),te("click",On,()=>ri(u(le))),T(oi,On)};$(qt,oi=>{u(_e)&&oi(_n)})}G(()=>{q(Et,u(zt)?"filter":u(ye).lang),Gn=jt(Yt,1,"code-body svelte-1twuiul",null,Gn,{collapsed:u(_e)&&!u(Je)})}),te("click",li,()=>Nn(u(ye).text)),T(De,fe)};$(ge,De=>{u(ye).type==="text"?De(yt):De(Xe,-1)})}T(ut,ht)});var Ze=x(ke,2);{var nt=ut=>{var ye=_9(),Dt=C(ye),ht=C(Dt);G(ge=>q(ht,ge),[()=>Qt(u(Ee))]),te("click",Dt,()=>e.onApplyView(u(Ee))),T(ut,ye)},rt=ot(()=>Si(u(Ee))&&e.onApplyView);$(Ze,ut=>{u(rt)&&ut(nt)})}T(st,Tt)};$(Ne,st=>{u(K).role==="user"?st(Le):st(re,-1)})}G(()=>jt(Se,1,`message ${u(K).role??""}`,"svelte-1twuiul")),T(A,Se)});var vt=x(Fe,2);{var It=A=>{var K=VD();_i(K,21,()=>u(ve),jn,(Re,Se)=>{var Ne=Fs(),Le=_t(Ne);{var re=Ue=>{var Ee=BD(),Tt=x(C(Ee)),We=C(Tt);G(H=>q(We,H),[()=>u(Se).name.replace(/_/g," ")]),T(Ue,Ee)},st=Ue=>{var Ee=zD(),Tt=x(C(Ee)),We=C(Tt);G(H=>q(We,H),[()=>u(Se).name.replace(/_/g," ")]),T(Ue,Ee)};$(Le,Ue=>{u(Se).type==="tool_call"?Ue(re):Ue(st,-1)})}T(Re,Ne)}),T(A,K)};$(vt,A=>{u(ve).length>0&&A(It)})}var Nt=x(vt,2);{var O=A=>{var K=y9(),Re=C(K),Se=C(Re),Ne=C(Se);G(()=>q(Ne,N[u(P)])),T(A,K)};$(Nt,A=>{u(a)&&u(s)===null&&u(ve).length===0&&A(O)})}var se=x(Nt,2);{var be=A=>{var K=S9(),Re=C(K);_i(Re,21,()=>at(u(s)),jn,(Se,Ne)=>{var Le=Fs(),re=_t(Le);{var st=Ee=>{var Tt=jD();jl(Tt,()=>Sn(u(Ne).text),!0),T(Ee,Tt)},Ue=Ee=>{var Tt=w9(),We=C(Tt),H=C(We),Q=C(H),ke=x(We,2),Ze=C(ke);jl(Ze,()=>Ii(u(Ne).text,u(Ne).lang??""),!0),G(()=>q(Q,u(Ne).lang)),T(Ee,Tt)};$(re,Ee=>{u(Ne).type==="text"?Ee(st):Ee(Ue,-1)})}T(Se,Le)}),T(A,K)};$(se,A=>{u(s)!==null&&A(be)})}bs(on,A=>mt=A,()=>mt);var j=x(on,2);{var pe=A=>{var K=C9(),Re=C(K);G(()=>q(Re,u(c))),T(A,K)};$(j,A=>{u(c)&&A(pe)})}var qe=x(j,2),xe=C(qe),Te=C(xe),Ie=x(xe,2),bt=C(Ie),ct=x(Ie,2),Me=C(ct),Wt=x(ct,2),ni=C(Wt),Gt=x(qe,2),$t=C(Gt);{var ii=A=>{var K=x9();let Re;var Se=x(C(K),2),Ne=C(Se),Le=x(Se,2),re=C(Le);G(()=>{Re=jt(K,1,"file-chip svelte-1twuiul",null,Re,{inactive:!u(ue)}),q(Ne,t().id),Hn(Le,"title",u(ue)?"Remove from context":"Re-add to context"),q(re,u(ue)?"×":"+")}),te("click",Le,()=>k(ue,!u(ue))),T(A,K)};$($t,A=>{t()&&A(ii)})}var J=x($t,2);_i(J,17,()=>u(X),jn,(A,K,Re)=>{const Se=ot(()=>Bn(u(K).name));var Ne=L9(),Le=C(Ne),re=C(Le),st=x(Le,2),Ue=C(st),Ee=x(st,2);G((Tt,We)=>{jt(Le,1,`badge badge-${Tt??""}`,"svelte-1twuiul"),q(re,We),q(Ue,u(K).name)},[()=>u(Se).toLowerCase(),()=>Zi(u(Se))]),te("click",Ee,()=>fn(Re)),T(A,Ne)});var me=x(J,2),$e=x(me,2);bs($e,A=>Ve=A,()=>Ve);var it=x(Gt,2);let Ct;var je=C(it);let Ye;var Xt=C(je);bs(Xt,A=>At=A,()=>At);var ai=x(je,2);{var ei=A=>{var K=k9();te("click",K,Ln),T(A,K)},Vi=A=>{var K=I9();G(Re=>K.disabled=Re,[()=>!u(r).trim()||!u(Vt)]),te("click",K,xn),T(A,K)};$(ai,A=>{u(a)?A(ei):A(Vi,-1)})}var In=x(it,2);{var Fi=A=>{var K=M9(),Re=C(K),Se=C(Re),Ne=x(Re,2);{var Le=Ee=>{var Tt=E9();_i(Tt,21,()=>u(g),jn,(We,H)=>{var Q=D9(),ke=C(Q),Ze={};G(()=>{q(ke,u(H)),Ze!==(Ze=u(H))&&(Q.value=(Q.__value=u(H))??"")}),T(We,Q)}),G(()=>Tt.disabled=u(a)),_a(Tt,()=>u(f),We=>k(f,We)),T(Ee,Tt)},re=Ee=>{var Tt=P9(),We=C(Tt);G(()=>q(We,u(f)||u(h).model)),T(Ee,Tt)};$(Ne,Ee=>{u(g).length>0?Ee(Le):Ee(re,-1)})}var st=x(Ne,2);{var Ue=Ee=>{var Tt=T9();te("click",Tt,cn),T(Ee,Tt)};$(st,Ee=>{u(h).provider==="ollama"&&Ee(Ue)})}G(()=>q(Se,u(h).provider)),T(A,K)};$(In,A=>{u(Vt)&&u(h)&&A(Fi)})}var ti=x(Li,2);{var Hi=A=>{var K=j9(),Re=C(K),Se=C(Re),Ne=C(Se),Le=C(Ne),re=x(Ne,2),st=x(Se,2),Ue=C(st);{var Ee=H=>{var Q=N9();T(H,Q)},Tt=H=>{var Q=R9(),ke=C(Q);G(()=>q(ke,u(S))),T(H,Q)},We=H=>{var Q=V9(),ke=C(Q);{var Ze=De=>{var le=A9(),_e=x(_t(le)),Je=C(_e);G(()=>q(Je,u(_).version)),T(De,le)};$(ke,De=>{u(_).version&&De(Ze)})}var nt=x(ke,2);{var rt=De=>{var le=O9(),_e=x(_t(le)),Je=C(_e);G(()=>q(Je,u(_).details.family)),T(De,le)};$(nt,De=>{var le;(le=u(_).details)!=null&&le.family&&De(rt)})}var ut=x(nt,2);{var ye=De=>{var le=F9(),_e=x(_t(le)),Je=C(_e);G(()=>q(Je,u(_).details.parameter_size)),T(De,le)};$(ut,De=>{var le;(le=u(_).details)!=null&&le.parameter_size&&De(ye)})}var Dt=x(ut,2);{var ht=De=>{var le=H9(),_e=x(_t(le)),Je=C(_e);G(()=>q(Je,u(_).details.quantization_level)),T(De,le)};$(Dt,De=>{var le;(le=u(_).details)!=null&&le.quantization_level&&De(ht)})}var ge=x(Dt,2);{var yt=De=>{var le=B9(),_e=x(_t(le),2);_i(_e,21,()=>u(_).running,jn,(Je,zt)=>{var fe=W9(),Ge=C(fe);G(gt=>q(Ge,`${u(zt).name??""} · ${gt??""} VRAM`),[()=>Ri(u(zt).size_vram)]),T(Je,fe)}),T(De,le)},Xe=De=>{var le=z9();T(De,le)};$(ge,De=>{u(_).running&&u(_).running.length>0?De(yt):u(_).running!==null&&De(Xe,1)})}T(H,Q)};$(Ue,H=>{u(w)?H(Ee):u(S)?H(Tt,1):u(_)&&H(We,2)})}G(()=>{var H;return q(Le,`Ollama · ${(u(f)||((H=u(h))==null?void 0:H.model))??""}`)}),te("click",K,()=>k(v,!1)),te("click",Re,H=>H.stopPropagation()),te("click",re,()=>k(v,!1)),T(A,K)};$(ti,A=>{u(v)&&A(Hi)})}G(A=>{q(ni,A),Ct=jt(it,1,"input-row svelte-1twuiul",null,Ct,{"drag-over":u(Pe)}),Ye=jt(je,1,"textarea-wrap svelte-1twuiul",null,Ye,{loading:u(a)}),Hn(Xt,"placeholder",u(Vt)?"Ask anything… (Enter to send, Shift+Enter for newline, drag & drop files to add context)":"AI not configured"),Xt.disabled=u(a)||!u(Vt)},[()=>Ri(u(Jt))]),As(Te,()=>u(V),A=>k(V,A)),As(bt,()=>u(F),A=>k(F,A)),As(Me,()=>u(Y),A=>k(Y,A)),te("click",me,nn),te("change",$e,pn),os("dragover",it,Cn),os("dragleave",it,zn),os("drop",it,Rn),te("keydown",Xt,Xi),Mi(Xt,()=>u(r),A=>k(r,A)),T(o,xi),Ao()}Cr(["click","change","keydown"]);var q9=R('<div class="me svelte-1pxdb1"></div>');function Zw(o,e){Ro(e,!0);let t=cg(e,"value",15,""),i=cg(e,"language",3,"javascript"),n,s,r=!1;xr(()=>{const c=i()==="json"?{formatOnPaste:!0,autoIndent:"full"}:{};s=tr.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())})}),yy(()=>s==null?void 0:s.dispose()),Vn(()=>{!s||s.getValue()===t()||(r=!0,s.setValue(t()),r=!1)});var a=q9();bs(a,c=>n=c,()=>n),T(o,a),Ao()}var K9=R('<!> <div class="welcome svelte-rrt0o"><div class="welcome-inner svelte-rrt0o"><div class="welcome-logo svelte-rrt0o">db</div> <p class="welcome-sub svelte-rrt0o">sheDB — embedded JSON document store with MapReduce views</p> <div class="welcome-hint svelte-rrt0o"><strong>In scripts:</strong> use <code class="svelte-rrt0o">she.db.get(id)</code>, <code class="svelte-rrt0o">she.db.set(id, doc)</code>, <code class="svelte-rrt0o">she.db.extend(id, partial)</code>, <code class="svelte-rrt0o">she.db.sub(pattern, cb)</code>.<br/> <strong>Views:</strong> <code class="svelte-rrt0o">this</code> = current document — call <code class="svelte-rrt0o">emit(value)</code> to add to result.</div> <div class="welcome-links svelte-rrt0o"><a href="https://github.com/hobbyquaker/she/blob/main/doc/db/README.md" target="_blank" rel="noopener" class="svelte-rrt0o">sheDB docs</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she/blob/main/doc/db/view-examples.md" target="_blank" rel="noopener" class="svelte-rrt0o">View examples</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" class="svelte-rrt0o">GitHub</a></div></div></div>',1),G9=R('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><line x1="5.5" y1="5" x2="4" y2="2.5"></line><line x1="10.5" y1="5" x2="12" y2="2.5"></line><path d="M3 11 V7 A5 3.5 0 0 0 13 7 V11 Z" stroke-linejoin="round"></path><circle cx="6" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle><circle cx="10" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle></svg> AI</button>'),UD=R('<div class="form-error svelte-rrt0o"> </div>'),Z9=R('<div class="new-item-form svelte-rrt0o"><input placeholder="device/lamp1" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),$D=R("<li> </li>"),qD=R('<div class="error-bar svelte-rrt0o"> </div>'),KD=R('<div class="loading svelte-rrt0o">Loading…</div>'),X9=R('<div class="monaco-doc-wrap svelte-rrt0o"><!></div>'),Y9=R('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),J9=R('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ Doc</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main></div>'),Q9=R('<div class="new-item-form svelte-rrt0o"><input placeholder="myView" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),eZ=R('<label class="opt-check svelte-rrt0o"><input type="checkbox" class="svelte-rrt0o"/> <span class="checkmark svelte-rrt0o"></span> Retain <span class="section-hint svelte-rrt0o">— send as retained MQTT message</span></label>'),tZ=R('<span class="badge-error svelte-rrt0o">error</span>'),iZ=R('<span class="badge-ok svelte-rrt0o"> </span>'),nZ=R('<pre class="result-error svelte-rrt0o"> </pre>'),sZ=R('<pre class="result-json svelte-rrt0o"> </pre>'),oZ=R('<div class="view-result svelte-rrt0o"><div class="result-header svelte-rrt0o">Result <!></div> <!></div>'),rZ=R('<div class="view-sections svelte-rrt0o"><div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Description <span class="section-hint svelte-rrt0o">— optional, shown in sidebar</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="(optional description)"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Filter <span class="section-hint svelte-rrt0o">— MQTT wildcard, optional</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="#"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Map <span class="section-hint svelte-rrt0o">— <code>this</code> = document · 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>'),aZ=R('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button title="Re-run view" class="svelte-rrt0o">Refresh</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),lZ=R('<div class="chat-resize-handle svelte-rrt0o" role="separator"></div> <div class="chat-pane svelte-rrt0o"><!></div>',1),cZ=R('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ View</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main> <!></div>'),dZ=R('<div class="db-root svelte-rrt0o" role="presentation"><div class="panel-tabs svelte-rrt0o"><button>Documents</button> <button>Views</button> <!></div> <!></div>');function hZ(o,e){Ro(e,!0);const t=Ae=>{var Z=K9(),Fe=_t(Z);bs(Hg(Fe,{}),vt=>Zi=vt,()=>Zi),T(Ae,Z)};let i=B(wi([])),n=B(null),s=B("{}"),r=B(!1),a=B(null);const c="she-db-selected-view";let h=B(wi([])),g=B(wi(localStorage.getItem(c))),f=B("#"),p=B("// emit(this.someProperty)"),v=B(""),_=B(""),w=B(!1),S=B(!1),D=B(null),P=B(!1),N=B(null),V=B("she/db/view/");const F="she-db-panel";let Y=B(wi(localStorage.getItem(F)??"docs")),X=B(""),ue=B(!1),Pe=B(null),Ve=B(""),ve=B(!1),tt=B(null);const At="she-db-sidebar-width";let mt=B(wi(parseInt(localStorage.getItem(At)??"220",10))),hi=!1,Vt=0,Jt=0;const he="she-db-chat-width",kt="she-db-chat-open";let Oe=B(localStorage.getItem(kt)==="true"),at=B(wi(parseInt(localStorage.getItem(he)??"320",10))),Rt=!1,Si=0,Qt=0;const Ht=ot(()=>u(g)?{id:u(g),filter:u(f),map:u(p),reduce:u(v)}:null);function St(Ae){Ae.filter!==void 0&&k(f,Ae.filter,!0),Ae.map!==void 0&&k(p,Ae.map,!0),Ae.reduce!==void 0&&k(v,Ae.reduce,!0)}Vn(()=>{localStorage.setItem(kt,String(u(Oe)))}),Vn(()=>{localStorage.setItem(F,u(Y))}),Vn(()=>{u(g)?localStorage.setItem(c,u(g)):localStorage.removeItem(c)});function ri(Ae){hi=!0,Vt=Ae.clientX,Jt=u(mt),Ae.preventDefault()}function Ii(Ae){hi&&k(mt,Math.max(140,Math.min(500,Jt+Ae.clientX-Vt)),!0),Rt&&k(at,Math.max(240,Math.min(600,Qt-(Ae.clientX-Si))),!0)}function Sn(){hi&&(hi=!1,localStorage.setItem(At,String(u(mt)))),Rt&&(Rt=!1,localStorage.setItem(he,String(u(at))))}function ln(Ae){Rt=!0,Si=Ae.clientX,Qt=u(at),Ae.preventDefault()}async function Nn(){try{k(i,await cR(),!0)}catch{}}async function cn(){try{k(h,await dR(),!0)}catch{}}async function Ri(Ae){k(n,Ae,!0),k(a,null),k(r,!0);try{const Z=await o8(Ae);k(s,JSON.stringify(Z,null,2),!0)}catch(Z){k(a,Z instanceof Error?Z.message:String(Z),!0)}finally{k(r,!1)}}async function Bn(){if(u(n)){k(a,null);try{const Ae=JSON.parse(u(s));await pD(u(n),Ae)}catch(Ae){k(a,Ae instanceof Error?Ae.message:String(Ae),!0)}}}let Zi;async function fn(){if(u(n)&&await Zi.show(`Delete document "${u(n)}"?`,{confirm:"Delete",danger:!0}))try{await r8(u(n)),k(n,null),k(s,"{}")}catch(Ae){k(a,Ae instanceof Error?Ae.message:String(Ae),!0)}}async function nn(){const Ae=u(X).trim();if(Ae){k(Pe,null);try{await pD(Ae,{}),k(ue,!1),k(X,""),await Ri(Ae)}catch(Z){k(Pe,Z instanceof Error?Z.message:String(Z),!0)}}}async function Ui(Ae){k(g,Ae,!0),k(N,null),k(P,!0),k(D,null);try{const Z=await a8(Ae);k(f,Z.filter??"",!0),k(p,Z.map,!0),k(v,Z.reduce??"",!0),k(_,Z.description??"",!0),k(w,Z.mqttpub??!1,!0),k(S,Z.retain??!1,!0),k(D,await Kw(Ae).catch(()=>null),!0)}catch(Z){k(N,Z instanceof Error?Z.message:String(Z),!0)}finally{k(P,!1)}}async function pn(){if(u(g)){k(N,null);try{const Ae={map:u(p)};u(f).trim()&&(Ae.filter=u(f).trim()),u(v).trim()&&(Ae.reduce=u(v).trim()),u(_).trim()&&(Ae.description=u(_).trim()),u(w)&&(Ae.mqttpub=!0),u(S)&&(Ae.retain=!0),await mD(u(g),Ae)}catch(Ae){k(N,Ae instanceof Error?Ae.message:String(Ae),!0)}}}async function Rn(){if(u(g))try{k(D,await Kw(u(g)),!0)}catch(Ae){k(N,Ae instanceof Error?Ae.message:String(Ae),!0)}}async function Cn(){if(u(g)&&await Zi.show(`Delete view "${u(g)}"?`,{confirm:"Delete",danger:!0}))try{await l8(u(g)),k(g,null),k(f,""),k(p,"// emit(this.someProperty)"),k(v,""),k(_,""),k(w,!1),k(S,!1),k(D,null)}catch(Ae){k(N,Ae instanceof Error?Ae.message:String(Ae),!0)}}async function zn(){if(!u(Ve).trim())return;const Ae=u(Ve).trim();k(tt,null);try{await mD(Ae,{map:"// emit(this.someProperty)"}),k(ve,!1),k(Ve,""),await cn(),await Ui(Ae)}catch(Z){k(tt,Z instanceof Error?Z.message:String(Z),!0)}}let xn=B(""),Ln=B(""),Xi=ot(()=>[...u(i)].filter(Ae=>!u(xn)||Ae.toLowerCase().includes(u(xn).toLowerCase())).sort()),Ke=ot(()=>[...u(h)].filter(Ae=>!u(Ln)||Ae.toLowerCase().includes(u(Ln).toLowerCase())).sort());xr(()=>{Nn(),cn().then(()=>{u(g)&&u(h).includes(u(g))?Ui(u(g)):k(g,null)}),iL().then(It=>{const Nt=It.dbPrefix||"she/db/",O=Nt.endsWith("/")?Nt:Nt+"/";k(V,O+"view/")}).catch(()=>{});const Ae=Gl("db:ids",It=>{k(i,It.ids??[],!0)}),Z=Gl("db:viewIds",It=>{k(h,It.ids??[],!0)}),Fe=Gl("db:change",async It=>{const Nt=It.id;u(n)===Nt&&(It.doc===null?(k(n,null),k(s,"{}")):k(s,JSON.stringify(It.doc,null,2),!0))}),vt=Gl("db:viewUpdate",async It=>{const Nt=It.id;u(g)===Nt&&k(D,await Kw(Nt).catch(()=>null),!0)});return()=>{Ae(),Z(),Fe(),vt()}});var Ot=dZ(),gi=C(Ot),xi=C(gi);let Li;var sn=x(xi,2);let mn;var Kn=x(sn,2);{var dn=Ae=>{var Z=G9();let Fe;G(()=>{Fe=jt(Z,1,"ai-toggle svelte-rrt0o",null,Fe,{"ai-open":u(Oe)}),Hn(Z,"title",u(Oe)?"Close AI assistant":"Open AI assistant")}),te("click",Z,()=>k(Oe,!u(Oe))),T(Ae,Z)};$(Kn,Ae=>{u(Y)==="views"&&Ae(dn)})}var An=x(gi,2);{var on=Ae=>{var Z=J9(),Fe=C(Z);let vt;var It=C(Fe),Nt=C(It),O=x(It,2);{var se=ct=>{var Me=Z9(),Wt=_t(Me),ni=C(Wt),Gt=x(ni,2),$t=x(Wt,2);{var ii=J=>{var me=UD(),$e=C(me);G(()=>q($e,u(Pe))),T(J,me)};$($t,J=>{u(Pe)&&J(ii)})}te("keydown",ni,J=>J.key==="Enter"&&nn()),Mi(ni,()=>u(X),J=>k(X,J)),te("click",Gt,nn),T(ct,Me)};$(O,ct=>{u(ue)&&ct(se)})}var be=x(O,2),j=C(be),pe=x(be,2);_i(pe,20,()=>u(Xi),ct=>ct,(ct,Me)=>{var Wt=$D();let ni;var Gt=C(Wt);G(()=>{ni=jt(Wt,1,"flat-item svelte-rrt0o",null,ni,{"active-item":u(n)===Me}),q(Gt,Me)}),te("click",Wt,()=>Ri(Me)),T(ct,Wt)});var qe=x(Fe,2),xe=x(qe,2),Te=C(xe);{var Ie=ct=>{var Me=Y9(),Wt=_t(Me),ni=C(Wt),Gt=C(ni),$t=x(ni,2),ii=x($t,2),J=x(Wt,2);{var me=je=>{var Ye=qD(),Xt=C(Ye);G(()=>q(Xt,u(a))),T(je,Ye)};$(J,je=>{u(a)&&je(me)})}var $e=x(J,2);{var it=je=>{var Ye=KD();T(je,Ye)},Ct=je=>{var Ye=X9(),Xt=C(Ye);Zw(Xt,{language:"json",get value(){return u(s)},set value(ai){k(s,ai,!0)}}),T(je,Ye)};$($e,je=>{u(r)?je(it):je(Ct,-1)})}G(()=>q(Gt,u(n))),te("click",$t,Bn),te("click",ii,fn),T(ct,Me)},bt=ct=>{t(ct)};$(Te,ct=>{u(n)?ct(Ie):ct(bt,-1)})}G(()=>vt=Ko(Fe,"",vt,{width:`${u(mt)??""}px`})),te("click",Nt,()=>{k(ue,!u(ue)),k(Pe,null)}),Mi(j,()=>u(xn),ct=>k(xn,ct)),te("mousedown",qe,ri),T(Ae,Z)},kn=Ae=>{var Z=cZ(),Fe=C(Z);let vt;var It=C(Fe),Nt=C(It),O=x(It,2);{var se=Wt=>{var ni=Q9(),Gt=_t(ni),$t=C(Gt),ii=x($t,2),J=x(Gt,2);{var me=$e=>{var it=UD(),Ct=C(it);G(()=>q(Ct,u(tt))),T($e,it)};$(J,$e=>{u(tt)&&$e(me)})}te("keydown",$t,$e=>$e.key==="Enter"&&zn()),Mi($t,()=>u(Ve),$e=>k(Ve,$e)),te("click",ii,zn),T(Wt,ni)};$(O,Wt=>{u(ve)&&Wt(se)})}var be=x(O,2),j=C(be),pe=x(be,2);_i(pe,20,()=>u(Ke),Wt=>Wt,(Wt,ni)=>{var Gt=$D();let $t;var ii=C(Gt);G(()=>{$t=jt(Gt,1,"flat-item svelte-rrt0o",null,$t,{"active-item":u(g)===ni}),q(ii,ni)}),te("click",Gt,()=>Ui(ni)),T(Wt,Gt)});var qe=x(Fe,2),xe=x(qe,2),Te=C(xe);{var Ie=Wt=>{var ni=aZ(),Gt=_t(ni),$t=C(Gt),ii=C($t),J=x($t,2),me=x(J,2),$e=x(me,2),it=x(Gt,2);{var Ct=ai=>{var ei=qD(),Vi=C(ei);G(()=>q(Vi,u(N))),T(ai,ei)};$(it,ai=>{u(N)&&ai(Ct)})}var je=x(it,2);{var Ye=ai=>{var ei=KD();T(ai,ei)},Xt=ai=>{var ei=rZ(),Vi=C(ei),In=x(C(Vi),2),Fi=C(In),ti=x(Vi,2),Hi=x(C(ti),2),A=C(Hi),K=x(ti,2),Re=x(C(K),2),Se=C(Re);Zw(Se,{language:"javascript",get value(){return u(p)},set value(rt){k(p,rt,!0)}});var Ne=x(K,2),Le=x(C(Ne),2),re=C(Le);Zw(re,{language:"javascript",get value(){return u(v)},set value(rt){k(v,rt,!0)}});var st=x(Ne,2),Ue=C(st),Ee=C(Ue),Tt=x(Ee,4),We=x(C(Tt)),H=C(We),Q=x(Ue,2);{var ke=rt=>{var ut=eZ(),ye=C(ut);As(ye,()=>u(S),Dt=>k(S,Dt)),T(rt,ut)};$(Q,rt=>{u(w)&&rt(ke)})}var Ze=x(st,2);{var nt=rt=>{var ut=oZ(),ye=C(ut),Dt=x(C(ye));{var ht=le=>{var _e=tZ();T(le,_e)},ge=le=>{var _e=iZ(),Je=C(_e);G(()=>q(Je,`${u(D).length??0??""} items · rev ${u(D)._rev??""}`)),T(le,_e)};$(Dt,le=>{u(D).error?le(ht):le(ge,-1)})}var yt=x(ye,2);{var Xe=le=>{var _e=nZ(),Je=C(_e);G(()=>q(Je,u(D).error)),T(le,_e)},De=le=>{var _e=sZ(),Je=C(_e);G(zt=>q(Je,zt),[()=>JSON.stringify(u(D).result,null,2)]),T(le,_e)};$(yt,le=>{u(D).error?le(Xe):le(De,-1)})}T(rt,ut)};$(Ze,rt=>{u(D)&&rt(nt)})}G(()=>q(H,`${u(V)??""}${u(g)??""} on every update`)),Mi(Fi,()=>u(_),rt=>k(_,rt)),Mi(A,()=>u(f),rt=>k(f,rt)),As(Ee,()=>u(w),rt=>k(w,rt)),T(ai,ei)};$(je,ai=>{u(P)?ai(Ye):ai(Xt,-1)})}G(()=>q(ii,u(g))),te("click",J,pn),te("click",me,Rn),te("click",$e,Cn),T(Wt,ni)},bt=Wt=>{t(Wt)};$(Te,Wt=>{u(g)?Wt(Ie):Wt(bt,-1)})}var ct=x(xe,2);{var Me=Wt=>{var ni=lZ(),Gt=_t(ni),$t=x(Gt,2);let ii;var J=C($t);$9(J,{get currentView(){return u(Ht)},onApplyView:St}),G(()=>ii=Ko($t,"",ii,{width:`${u(at)??""}px`})),te("mousedown",Gt,ln),T(Wt,ni)};$(ct,Wt=>{u(Oe)&&Wt(Me)})}G(()=>vt=Ko(Fe,"",vt,{width:`${u(mt)??""}px`})),te("click",Nt,()=>{k(ve,!u(ve)),k(tt,null)}),Mi(j,()=>u(Ln),Wt=>k(Ln,Wt)),te("mousedown",qe,ri),T(Ae,Z)};$(An,Ae=>{u(Y)==="docs"?Ae(on):Ae(kn,-1)})}G(()=>{Li=jt(xi,1,"svelte-rrt0o",null,Li,{active:u(Y)==="docs"}),mn=jt(sn,1,"svelte-rrt0o",null,mn,{active:u(Y)==="views"})}),te("mousemove",Ot,Ii),te("mouseup",Ot,Sn),os("mouseleave",Ot,Sn),te("click",xi,()=>k(Y,"docs")),te("click",sn,()=>k(Y,"views")),T(o,Ot),Ao()}Cr(["mousemove","mouseup","click","keydown","mousedown"]);var uZ=R('<label class="svelte-1ua3isv">Passcode <input type="number" placeholder="20202021" class="svelte-1ua3isv"/></label> <label class="svelte-1ua3isv">Discriminator (optional) <input type="number" placeholder="3840" class="svelte-1ua3isv"/></label>',1),gZ=R('<label class="svelte-1ua3isv">Pairing Code / QR <input type="text" placeholder="MT:..." class="svelte-1ua3isv"/></label>'),GD=R('<p class="err svelte-1ua3isv"> </p>'),fZ=R('<div class="wizard svelte-1ua3isv"><div class="wizard-tabs svelte-1ua3isv"><button>Passcode</button> <button>QR / Code</button></div> <!> <label class="svelte-1ua3isv">IP Address (optional, bypasses mDNS) <input type="text" placeholder="192.168.1.100 or 192.168.1.100:5540" class="svelte-1ua3isv"/></label> <!> <button class="commission-btn svelte-1ua3isv"> </button></div>'),pZ=R('<span class="device-name svelte-1ua3isv"> </span> <span class="device-nodeid svelte-1ua3isv"> </span>',1),mZ=R('<span class="device-name svelte-1ua3isv"> </span>'),_Z=R('<li><button class="device-select-btn svelte-1ua3isv"><span></span> <span class="device-label svelte-1ua3isv"><!></span></button> <button class="unpair-btn svelte-1ua3isv" title="Unpair">✕</button></li>'),vZ=R('<li class="empty svelte-1ua3isv">No paired devices</li>'),bZ=R('<p class="info svelte-1ua3isv">Loading…</p>'),yZ=R('<p class="device-subtitle svelte-1ua3isv"> </p>'),wZ=R('<span class="ep-chip svelte-1ua3isv"> </span>'),SZ=R('<span class="attr-id svelte-1ua3isv"> </span>'),CZ=R('<button class="attr-action-btn svelte-1ua3isv"> </button>'),xZ=R('<div class="attr-actions svelte-1ua3isv"></div>'),LZ=R('<span class="cmd-sep svelte-1ua3isv">,</span>'),kZ=R('<span class="cmd-name svelte-1ua3isv"> </span><span class="cmd-id svelte-1ua3isv"> </span>',1),IZ=R('<span class="cmd-id svelte-1ua3isv"> </span>'),DZ=R("<!> <!>",1),EZ=R('<span class="cmd-list svelte-1ua3isv"></span>'),PZ=R(' <span class="cmd-id svelte-1ua3isv"> </span>',1),TZ=R('<tr class="svelte-1ua3isv"><td class="svelte-1ua3isv"><!></td><td class="svelte-1ua3isv"> </td></tr>'),MZ=R('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"><th class="svelte-1ua3isv">deviceType</th><th class="svelte-1ua3isv">revision</th></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),NZ=R('<th class="svelte-1ua3isv"> </th>'),RZ=R('<td class="svelte-1ua3isv"> </td>'),AZ=R('<tr class="svelte-1ua3isv"></tr>'),OZ=R('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),FZ=R('<tr class="svelte-1ua3isv"><td class="attr-obj-key svelte-1ua3isv"> </td><td class="attr-obj-val svelte-1ua3isv"> </td></tr>'),HZ=R('<table class="attr-obj-table svelte-1ua3isv"><tbody class="svelte-1ua3isv"></tbody></table>'),WZ=R('<a class="attr-link svelte-1ua3isv" target="_blank" rel="noopener noreferrer"> </a>'),BZ=R('<span class="attr-val svelte-1ua3isv"> </span>'),zZ=R('<tr class="svelte-1ua3isv"><td class="attr-name-cell svelte-1ua3isv"><span class="attr-key svelte-1ua3isv"> </span><!></td><td class="attr-actions-cell svelte-1ua3isv"><!></td><td class="attr-val-cell svelte-1ua3isv"><!></td></tr>'),VZ=R('<tr class="cluster-hdr-row svelte-1ua3isv"><td colspan="3" class="cluster-hdr-cell svelte-1ua3isv"> </td></tr> <!>',1),jZ=R('<table class="cluster-table svelte-1ua3isv"><colgroup><col class="col-attr-name svelte-1ua3isv"/><col class="col-attr-actions svelte-1ua3isv"/><col class="col-attr-val"/></colgroup><tbody class="svelte-1ua3isv"></tbody></table>'),UZ=R('<p class="no-clusters svelte-1ua3isv">No clusters</p>'),$Z=R('<details class="svelte-1ua3isv"><summary class="svelte-1ua3isv"> <span class="ep-id svelte-1ua3isv"> </span> <span class="ep-chips svelte-1ua3isv"></span></summary> <!></details>'),qZ=R('<div class="detail-hdr svelte-1ua3isv"><h2 class="svelte-1ua3isv"> </h2> <!> <p class="detail-nodeid svelte-1ua3isv"> </p></div> <!>',1),KZ=R('<p class="info svelte-1ua3isv">Select a device to view its endpoints.</p>'),GZ=R('<span class="stream-badge svelte-1ua3isv"> </span>'),ZZ=R('<span class="stream-empty svelte-1ua3isv">Waiting for events…</span>'),Xw=R(' <span class="e-sub svelte-1ua3isv"> </span>',1),XZ=R('<span class="e-badge e-badge-status svelte-1ua3isv">status</span> <span class="e-node svelte-1ua3isv"> <!></span> <span> </span>',1),YZ=R('<span class="e-badge e-badge-attr svelte-1ua3isv">attr</span> <span class="e-node svelte-1ua3isv"> <!></span> <span class="e-ep svelte-1ua3isv"> <!></span> <span class="e-cluster svelte-1ua3isv"> </span> <span class="e-attr svelte-1ua3isv"> </span> <span class="e-val svelte-1ua3isv"> </span>',1),JZ=R('<div class="er svelte-1ua3isv"><span class="e-ts svelte-1ua3isv"> </span> <!></div>'),QZ=R('<div class="stream-body svelte-1ua3isv"><!></div>'),eX=R('<!> <div class="matter-page svelte-1ua3isv"><div class="matter-main svelte-1ua3isv"><div class="sidebar svelte-1ua3isv"><div class="sidebar-header svelte-1ua3isv"><span class="sidebar-title svelte-1ua3isv">Matter Devices</span> <button class="add-btn svelte-1ua3isv" title="Commission new device">+</button></div> <!> <ul class="device-list svelte-1ua3isv"><!> <!></ul></div> <div class="detail svelte-1ua3isv"><!></div></div> <div class="stream-panel svelte-1ua3isv"><div class="stream-resize svelte-1ua3isv"></div> <div class="stream-hdr-row svelte-1ua3isv"><span class="stream-title svelte-1ua3isv">Matter Events</span> <!> <button class="stream-toggle svelte-1ua3isv" title="Toggle event feed"> </button></div> <!></div></div>',1);function tX(o,e){Ro(e,!0);const t={onOff:{onOff:[{label:"On",command:"on"},{label:"Off",command:"off"},{label:"Toggle",command:"toggle"}]},levelControl:{currentLevel:[{label:"Step ▲",command:"stepWithOnOff",args:{stepMode:0,stepSize:25,transitionTime:5}},{label:"Step ▼",command:"stepWithOnOff",args:{stepMode:1,stepSize:25,transitionTime:5}}]},windowCovering:{currentPositionLiftPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}],currentPositionTiltPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}]}};async function i(Z,Fe,vt,It,Nt){try{await w8(Z,Fe,vt,It,Nt)}catch(O){console.error("matter command failed",O)}}const n={identify:{0:"identify",1:"triggerEffect"},groups:{0:"addGroup",1:"viewGroup",2:"getGroupMembership",3:"removeGroup",4:"removeAllGroups",5:"addGroupIfIdentifying"},scenes:{0:"addScene",1:"viewScene",2:"removeScene",3:"removeAllScenes",4:"storeScene",5:"recallScene",6:"getSceneMembership",64:"enhancedAddScene",65:"enhancedViewScene",66:"copyScene"},onOff:{0:"off",1:"on",2:"toggle",64:"offWithEffect",65:"onWithRecallGlobalScene",66:"onWithTimedOff"},levelControl:{0:"moveToLevel",1:"move",2:"step",3:"stop",4:"moveToLevelWithOnOff",5:"moveWithOnOff",6:"stepWithOnOff",7:"stopWithOnOff",8:"moveToClosestFrequency"},colorControl:{0:"moveToHue",1:"moveHue",2:"stepHue",3:"moveToSaturation",4:"moveSaturation",5:"stepSaturation",6:"moveToHueAndSaturation",7:"moveToColor",8:"moveColor",9:"stepColor",10:"moveToColorTemperature",64:"enhancedMoveToHue",65:"enhancedMoveHue",66:"enhancedStepHue",67:"enhancedMoveToHueAndSaturation",68:"colorLoopSet",71:"stopMoveStep",75:"moveColorTemperature",76:"stepColorTemperature"},thermostat:{0:"setpointRaiseLower",1:"setWeeklySchedule",2:"getWeeklySchedule",3:"clearWeeklySchedule"},doorLock:{0:"lockDoor",1:"unlockDoor",3:"unlockWithTimeout",11:"setWeekDaySchedule",12:"getWeekDaySchedule",13:"clearWeekDaySchedule",14:"setYearDaySchedule",15:"getYearDaySchedule",16:"clearYearDaySchedule",17:"setHolidaySchedule",18:"getHolidaySchedule",19:"clearHolidaySchedule",26:"setUser",27:"getUser",28:"clearUser",34:"setCredential",36:"getCredential",38:"clearCredential"},windowCovering:{0:"upOrOpen",1:"downOrClose",2:"stopMotion",4:"goToLiftValue",5:"goToLiftPercentage",7:"goToTiltValue",8:"goToTiltPercentage"},fanControl:{0:"step"}};function s(Z,Fe){const vt=n[Z];return Fe.map(It=>{const Nt=typeof It=="number"?It:Number(It);return{id:Nt,name:(vt==null?void 0:vt[Nt])??null}})}const r={10:"Door Lock",11:"Door Lock Controller",14:"Aggregator",15:"Generic Switch",17:"On/Off Plug-In Unit",18:"Dimmable Plug-In Unit",19:"Pump",20:"On/Off Light Switch",21:"Dimmer Switch",22:"Color Dimmer Switch",23:"Control Bridge",24:"Pump Controller",256:"On/Off Light",257:"Dimmable Light",268:"Extended Color Light",269:"Color Temperature Light",262:"Light Sensor",263:"Occupancy Sensor",514:"Window Covering",515:"Window Covering Controller",768:"Heating/Cooling Unit",769:"Thermostat",770:"Temperature Sensor",771:"Pressure Sensor",772:"Flow Sensor",773:"Humidity Sensor",774:"On/Off Sensor",2112:"Air Quality Sensor"},a={generatedCommandList:65528,acceptedCommandList:65529,eventList:65530,attributeList:65531,featureMap:65532,clusterRevision:65533},c={descriptor:{deviceTypeList:0,serverList:1,clientList:2,partsList:3,tagList:4},basicInformation:{dataModelRevision:0,vendorName:1,vendorID:2,vendorId:2,productName:3,productID:4,productId:4,nodeLabel:5,location:6,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,localConfigDisabled:16,reachable:17,uniqueID:18,uniqueId:18,capabilityMinima:19,productAppearance:20,specificationVersion:21,maxPathsPerInvoke:22},bridgedDeviceBasicInformation:{vendorName:1,vendorID:2,vendorId:2,productName:3,productId:4,nodeLabel:5,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,reachable:17,uniqueID:18,uniqueId:18,productAppearance:20},identify:{identifyTime:0,identifyType:1},groups:{nameSupport:0},onOff:{onOff:0,globalSceneControl:16384,onTime:16385,offWaitTime:16386,startUpOnOff:16387},levelControl:{currentLevel:0,remainingTime:1,minLevel:2,maxLevel:3,currentFrequency:4,minFrequency:5,maxFrequency:6,options:15,onOffTransitionTime:16,onLevel:17,onTransitionTime:18,offTransitionTime:19,defaultMoveRate:20,startUpCurrentLevel:16384},colorControl:{currentHue:0,currentSaturation:1,remainingTime:2,currentX:3,currentY:4,colorTemperatureMireds:7,colorMode:8,options:15,enhancedCurrentHue:16384,enhancedColorMode:16385,colorLoopActive:16386,colorLoopDirection:16387,colorLoopTime:16388,colorCapabilities:16394,colorTempPhysicalMinMireds:16395,colorTempPhysicalMaxMireds:16396,coupleColorTempToLevelMinMireds:16397,startUpColorTemperatureMireds:16400},thermostat:{localTemperature:0,outdoorTemperature:1,occupancy:2,absMinHeatSetpointLimit:3,absMaxHeatSetpointLimit:4,absMinCoolSetpointLimit:5,absMaxCoolSetpointLimit:6,piCoolingDemand:7,piHeatingDemand:8,localTemperatureCalibration:16,occupiedCoolingSetpoint:17,occupiedHeatingSetpoint:18,unoccupiedCoolingSetpoint:19,unoccupiedHeatingSetpoint:20,minHeatSetpointLimit:21,maxHeatSetpointLimit:22,minCoolSetpointLimit:23,maxCoolSetpointLimit:24,minSetpointDeadBand:25,remoteSensing:26,controlSequenceOfOperation:27,systemMode:28,thermostatRunningMode:30,startOfWeek:32,numberOfWeeklyTransitions:33,numberOfDailyTransitions:34,temperatureSetpointHold:35,temperatureSetpointHoldDuration:36,thermostatProgrammingOperationMode:37,thermostatRunningState:41,setpointChangeSource:48,setpointChangeAmount:49,setpointChangeSourceTimestamp:50,occupiedSetback:52,unoccupiedSetback:55,emergencyHeatDelta:58},windowCovering:{type:0,physicalClosedLimitLift:1,physicalClosedLimitTilt:2,currentPositionLift:3,currentPositionTilt:4,numberOfActuationsLift:5,numberOfActuationsTilt:6,configStatus:7,currentPositionLiftPercentage:8,currentPositionTiltPercentage:9,operationalStatus:10,targetPositionLiftPercent100ths:11,targetPositionTiltPercent100ths:12,endProductType:13,currentPositionLiftPercent100ths:14,currentPositionTiltPercent100ths:15,installedOpenLimitLift:16,installedClosedLimitLift:17,installedOpenLimitTilt:18,installedClosedLimitTilt:19,mode:23,safetyStatus:26},doorLock:{lockState:0,lockType:1,actuatorEnabled:2,doorState:3,numberOfTotalUsersSupported:17,numberOfPINUsersSupported:18,maxPINCodeLength:23,minPINCodeLength:24,language:33,autoRelockTime:35,soundVolume:36,operatingMode:37,supportedOperatingModes:38,wrongCodeEntryLimit:48},fanControl:{fanMode:0,fanModeSequence:1,percentSetting:2,percentCurrent:3,speedMax:4,speedSetting:5,speedCurrent:6,rockSupport:7,rockSetting:8,windSupport:9,windSetting:10,airflowDirectionSupport:11,airflowDirection:12},occupancySensing:{occupancy:0,occupancySensorType:1,occupancySensorTypeBitmap:2,holdTime:3,pirOccupiedToUnoccupiedDelay:16,pirUnoccupiedToOccupiedDelay:17},illuminanceMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,lightSensorType:4},temperatureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},pressureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,scaledValue:16,minScaledValue:17,maxScaledValue:18,scale:20},flowMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},relativeHumidityMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},powerSource:{status:0,order:1,description:2,batVoltage:11,batPercentRemaining:12,batTimeRemaining:13,batChargeLevel:14,batReplacementNeeded:15,batReplaceability:16,batPresent:17,activeBatFaults:18,batChargeState:26}};function h(Z){return"0x"+Z.toString(16).toUpperCase().padStart(4,"0")}let g=B(wi([])),f=wi(new Map);function p(Z){if(Z==null)return"—";if(typeof Z=="boolean"||typeof Z=="number")return String(Z);if(typeof Z=="string")return Z.length>50?Z.slice(0,47)+"…":Z;const Fe=JSON.stringify(Z);return Fe.length>60?Fe.slice(0,57)+"…":Fe}function v(Z){return Z==null?"—":typeof Z=="boolean"||typeof Z=="number"?String(Z):typeof Z=="string"?Z:JSON.stringify(Z)}function _(Z){return Z!==null&&typeof Z=="object"&&!Array.isArray(Z)}function w(Z){return Array.isArray(Z)&&Z.length>0&&Z.every(_)}function S(Z,Fe){return!!(Fe==="attributeList"||Array.isArray(Z)&&Z.length===0||_(Z)&&Object.keys(Z).length===0)}function D(Z){return new Date(Z).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}const P=500,N=20,V=32;let F=0,Y=B(wi([])),X=B(!0),ue=B(180),Pe=ot(()=>{const Z=Math.max(1,Math.floor((u(ue)-V)/N)+1);return u(Y).slice(0,Z)});function Ve(Z){Z.preventDefault();const Fe=Z.clientY,vt=u(ue);function It(O){k(ue,Math.max(60,Math.min(600,vt+Fe-O.clientY)),!0)}function Nt(){document.removeEventListener("mousemove",It),document.removeEventListener("mouseup",Nt)}document.addEventListener("mousemove",It),document.addEventListener("mouseup",Nt)}let ve=B(null),tt=B(!1),At=B(null),mt=B(!1),hi=B("passcode"),Vt=B(""),Jt=B(""),he=B(""),kt=B(!1),Oe=B(null),at=B("");const Rt="she:matter:selectedNodeId";async function Si(){try{k(g,await hR(),!0);for(const Z of u(g))T_(Z.nodeId).then(Fe=>{f.set(Z.nodeId,Fe)}).catch(()=>{});if(u(g).length>0&&!u(ve)){const Z=localStorage.getItem(Rt),Fe=Z&&u(g).find(vt=>vt.nodeId===Z)?Z:u(g)[0].nodeId;Qt(Fe)}}catch{k(g,[],!0)}}async function Qt(Z){k(tt,!0),k(At,null);try{k(ve,await T_(Z),!0),f.set(Z,u(ve)),localStorage.setItem(Rt,Z)}catch(Fe){k(At,Fe instanceof Error?Fe.message:String(Fe),!0)}finally{k(tt,!1)}}let Ht;async function St(Z){var Fe;if(await Ht.show(`Unpair device ${Z}?`,{confirm:"Unpair",danger:!0}))try{await y8(Z),((Fe=u(ve))==null?void 0:Fe.nodeId)===Z&&k(ve,null),await Si()}catch(vt){k(At,vt instanceof Error?vt.message:String(vt),!0)}}async function ri(){k(kt,!0),k(Oe,null);try{let Z;u(hi)==="passcode"?(Z={passcode:Number(u(Vt))},u(Jt)&&(Z={...Z,discriminator:Number(u(Jt))})):Z={pairingCode:u(he).trim()},u(at).trim()&&(Z={...Z,discoveryAddress:u(at).trim()}),await b8(Z),k(mt,!1),k(Vt,""),k(Jt,""),k(he,""),k(at,""),await Si()}catch(Z){k(Oe,Z instanceof Error?Z.message:String(Z),!0)}finally{k(kt,!1)}}xr(()=>{Si()});const Ii=Gl("matter:deviceList",Z=>{if(!Array.isArray(Z.devices))return;const Fe=Z.devices;for(const vt of Fe)f.has(vt.nodeId)||T_(vt.nodeId).then(It=>{f.set(vt.nodeId,It)}).catch(()=>{});k(g,Fe,!0)}),Sn=Gl("matter:deviceStatus",Z=>{if(Z.nodeId===void 0)return;const Fe=String(Z.nodeId),vt=!!Z.online;k(g,u(g).map(It=>It.nodeId===Fe?{...It,online:vt}:It),!0),k(Y,[{id:F++,kind:"status",nodeId:Fe,online:vt,ts:Date.now()},...u(Y).slice(0,P-1)],!0)}),ln=Gl("matter:attr",Z=>{const Fe=String(Z.nodeId),vt=Z.endpointId,It=String(Z.clusterName),Nt=String(Z.attrName),O=Z.value;if(u(ve)&&u(ve).nodeId===Fe){const be=u(ve).endpoints.find(pe=>pe.endpointId===vt),j=be==null?void 0:be.clusters.find(pe=>pe.name===It);j&&(j.attrs[Nt]=O)}const se=f.get(Fe);if(se){const be=se.endpoints.find(pe=>pe.endpointId===vt),j=be==null?void 0:be.clusters.find(pe=>pe.name===It);j&&(j.attrs[Nt]=O)}k(Y,[{id:F++,kind:"attr",nodeId:Fe,endpointId:vt,clusterName:It,attrName:Nt,value:O,ts:Z.ts??Date.now()},...u(Y).slice(0,P-1)],!0)});yy(()=>{Ii(),Sn(),ln()});var Nn=eX(),cn=_t(Nn);bs(Hg(cn,{}),Z=>Ht=Z,()=>Ht);var Ri=x(cn,2),Bn=C(Ri),Zi=C(Bn),fn=C(Zi),nn=x(C(fn),2),Ui=x(fn,2);{var pn=Z=>{var Fe=fZ(),vt=C(Fe),It=C(vt);let Nt;var O=x(It,2);let se;var be=x(vt,2);{var j=Me=>{var Wt=uZ(),ni=_t(Wt),Gt=x(C(ni)),$t=x(ni,2),ii=x(C($t));Mi(Gt,()=>u(Vt),J=>k(Vt,J)),Mi(ii,()=>u(Jt),J=>k(Jt,J)),T(Me,Wt)},pe=Me=>{var Wt=gZ(),ni=x(C(Wt));Mi(ni,()=>u(he),Gt=>k(he,Gt)),T(Me,Wt)};$(be,Me=>{u(hi)==="passcode"?Me(j):Me(pe,-1)})}var qe=x(be,2),xe=x(C(qe)),Te=x(qe,2);{var Ie=Me=>{var Wt=GD(),ni=C(Wt);G(()=>q(ni,u(Oe))),T(Me,Wt)};$(Te,Me=>{u(Oe)&&Me(Ie)})}var bt=x(Te,2),ct=C(bt);G(()=>{Nt=jt(It,1,"svelte-1ua3isv",null,Nt,{active:u(hi)==="passcode"}),se=jt(O,1,"svelte-1ua3isv",null,se,{active:u(hi)==="pairingCode"}),bt.disabled=u(kt),q(ct,u(kt)?"Commissioning…":"Commission")}),te("click",It,()=>k(hi,"passcode")),te("click",O,()=>k(hi,"pairingCode")),Mi(xe,()=>u(at),Me=>k(at,Me)),te("click",bt,ri),T(Z,Fe)};$(Ui,Z=>{u(mt)&&Z(pn)})}var Rn=x(Ui,2),Cn=C(Rn);_i(Cn,17,()=>u(g),Z=>Z.nodeId,(Z,Fe)=>{var vt=_Z();let It;var Nt=C(vt),O=C(Nt);let se;var be=x(O,2),j=C(be);{var pe=Te=>{var Ie=pZ(),bt=_t(Ie),ct=C(bt),Me=x(bt,2),Wt=C(Me);G(()=>{q(ct,u(Fe).name),q(Wt,`#${u(Fe).nodeId??""}`)}),T(Te,Ie)},qe=Te=>{var Ie=mZ(),bt=C(Ie);G(()=>q(bt,`Node ${u(Fe).nodeId??""}`)),T(Te,Ie)};$(j,Te=>{u(Fe).name?Te(pe):Te(qe,-1)})}var xe=x(Nt,2);G(()=>{var Te;It=jt(vt,1,"svelte-1ua3isv",null,It,{selected:((Te=u(ve))==null?void 0:Te.nodeId)===u(Fe).nodeId}),se=jt(O,1,"status-dot svelte-1ua3isv",null,se,{online:u(Fe).online})}),te("click",Nt,()=>Qt(u(Fe).nodeId)),te("click",xe,()=>St(u(Fe).nodeId)),T(Z,vt)});var zn=x(Cn,2);{var xn=Z=>{var Fe=vZ();T(Z,Fe)};$(zn,Z=>{u(g).length===0&&Z(xn)})}var Ln=x(Zi,2),Xi=C(Ln);{var Ke=Z=>{var Fe=bZ();T(Z,Fe)},Ot=Z=>{var Fe=GD(),vt=C(Fe);G(()=>q(vt,u(At))),T(Z,Fe)},gi=Z=>{var Fe=qZ(),vt=_t(Fe),It=C(vt),Nt=C(It),O=x(It,2);{var se=qe=>{var xe=yZ(),Te=C(xe);G(()=>q(Te,u(ve).subtitle)),T(qe,xe)};$(O,qe=>{u(ve).subtitle&&qe(se)})}var be=x(O,2),j=C(be),pe=x(vt,2);_i(pe,17,()=>u(ve).endpoints,qe=>qe.endpointId,(qe,xe)=>{var Te=$Z(),Ie=C(Te),bt=C(Ie),ct=x(bt),Me=C(ct),Wt=x(ct,2);_i(Wt,21,()=>u(xe).clusters,jn,(ii,J)=>{var me=wZ(),$e=C(me);G(()=>q($e,u(J).name)),T(ii,me)});var ni=x(Ie,2);{var Gt=ii=>{var J=jZ(),me=x(C(J));_i(me,21,()=>u(xe).clusters,jn,($e,it)=>{var Ct=VZ(),je=_t(Ct),Ye=C(je),Xt=C(Ye),ai=x(je,2);_i(ai,17,()=>Object.entries(u(it).attrs),jn,(ei,Vi)=>{var In=ot(()=>mk(u(Vi),2));let Fi=()=>u(In)[0],ti=()=>u(In)[1];var Hi=Fs(),A=_t(Hi);{var K=Se=>{const Ne=ot(()=>{var _e;return(_e=t[u(it).name])==null?void 0:_e[Fi()]}),Le=ot(()=>(Fi()==="acceptedCommandList"||Fi()==="generatedCommandList")&&Array.isArray(ti())),re=ot(()=>{var _e;return((_e=c[u(it).name])==null?void 0:_e[Fi()])??a[Fi()]});var st=zZ(),Ue=C(st),Ee=C(Ue),Tt=C(Ee),We=x(Ee);{var H=_e=>{var Je=SZ(),zt=C(Je);G(fe=>q(zt,`(${fe??""})`),[()=>h(u(re))]),T(_e,Je)};$(We,_e=>{u(re)!==void 0&&_e(H)})}var Q=x(Ue),ke=C(Q);{var Ze=_e=>{var Je=xZ();_i(Je,21,()=>u(Ne),jn,(zt,fe)=>{var Ge=CZ(),gt=C(Ge);G(()=>q(gt,u(fe).label)),te("click",Ge,()=>i(u(ve).nodeId,u(xe).endpointId,u(it).name,u(fe).command,u(fe).args)),T(zt,Ge)}),T(_e,Je)};$(ke,_e=>{u(Ne)&&_e(Ze)})}var nt=x(Q),rt=C(nt);{var ut=_e=>{var Je=EZ();_i(Je,21,()=>s(u(it).name,ti()),jn,(zt,fe,Ge)=>{var gt=DZ(),Et=_t(gt);{var Qe=$i=>{var si=LZ();T($i,si)};$(Et,$i=>{Ge>0&&$i(Qe)})}var li=x(Et,2);{var Yt=$i=>{var si=kZ(),qt=_t(si),_n=C(qt),oi=x(qt),On=C(oi);G(()=>{q(_n,u(fe).name),q(On,`(${u(fe).id??""})`)}),T($i,si)},Gn=$i=>{var si=IZ(),qt=C(si);G(()=>q(qt,u(fe).id)),T($i,si)};$(li,$i=>{u(fe).name?$i(Yt):$i(Gn,-1)})}T(zt,gt)}),T(_e,Je)},ye=_e=>{var Je=MZ(),zt=x(C(Je));_i(zt,21,ti,jn,(fe,Ge)=>{const gt=ot(()=>u(Ge)),Et=ot(()=>u(gt).deviceType),Qe=ot(()=>r[u(Et)]);var li=TZ(),Yt=C(li),Gn=C(Yt);{var $i=oi=>{var On=PZ(),Yi=_t(On),Ps=x(Yi),Oo=C(Ps);G(Lr=>{q(Yi,`${u(Qe)??""} `),q(Oo,`(${Lr??""})`)},[()=>h(u(Et))]),T(oi,On)},si=oi=>{var On=Ur();G(Yi=>q(On,Yi),[()=>h(u(Et))]),T(oi,On)};$(Gn,oi=>{u(Qe)?oi($i):oi(si,-1)})}var qt=x(Yt),_n=C(qt);G(oi=>q(_n,oi),[()=>v(u(gt).revision)]),T(fe,li)}),T(_e,Je)},Dt=ot(()=>Fi()==="deviceTypeList"&&Array.isArray(ti())),ht=_e=>{const Je=ot(()=>[...new Set(ti().flatMap(Et=>Object.keys(Et)))]);var zt=OZ(),fe=C(zt),Ge=C(fe);_i(Ge,21,()=>u(Je),jn,(Et,Qe)=>{var li=NZ(),Yt=C(li);G(()=>q(Yt,u(Qe))),T(Et,li)});var gt=x(fe);_i(gt,21,ti,jn,(Et,Qe)=>{var li=AZ();_i(li,21,()=>u(Je),jn,(Yt,Gn)=>{var $i=RZ(),si=C($i);G(qt=>q(si,qt),[()=>v(u(Qe)[u(Gn)])]),T(Yt,$i)}),T(Et,li)}),T(_e,zt)},ge=ot(()=>w(ti())),yt=_e=>{var Je=HZ(),zt=C(Je);_i(zt,21,()=>Object.entries(ti()),jn,(fe,Ge)=>{var gt=ot(()=>mk(u(Ge),2));let Et=()=>u(gt)[0],Qe=()=>u(gt)[1];var li=FZ(),Yt=C(li),Gn=C(Yt),$i=x(Yt),si=C($i);G(qt=>{q(Gn,Et()),q(si,qt)},[()=>v(Qe())]),T(fe,li)}),T(_e,Je)},Xe=ot(()=>_(ti())),De=_e=>{var Je=WZ(),zt=C(Je);G(()=>{Hn(Je,"href",ti()),q(zt,ti())}),T(_e,Je)},le=_e=>{var Je=BZ(),zt=C(Je);G(fe=>q(zt,fe),[()=>v(ti())]),T(_e,Je)};$(rt,_e=>{u(Le)?_e(ut):u(Dt)?_e(ye,1):u(ge)?_e(ht,2):u(Xe)?_e(yt,3):(Fi()==="productUrl"||Fi()==="productURL")&&typeof ti()=="string"?_e(De,4):_e(le,-1)})}G(()=>{Hn(Ue,"title",Fi()),q(Tt,Fi())}),T(Se,st)},Re=ot(()=>!S(ti(),Fi()));$(A,Se=>{u(Re)&&Se(K)})}T(ei,Hi)}),G(()=>q(Xt,u(it).name)),T($e,Ct)}),T(ii,J)},$t=ii=>{var J=UZ();T(ii,J)};$(ni,ii=>{u(xe).clusters.length>0?ii(Gt):ii($t,-1)})}G(()=>{q(bt,`${u(xe).name??`Endpoint ${u(xe).endpointId}`??""} `),q(Me,`ep${u(xe).endpointId??""}`)}),T(qe,Te)}),G(()=>{q(Nt,u(ve).name??`Node ${u(ve).nodeId}`),q(j,`Node ID: ${u(ve).nodeId??""}`)}),T(Z,Fe)},xi=Z=>{var Fe=KZ();T(Z,Fe)};$(Xi,Z=>{u(tt)?Z(Ke):u(At)?Z(Ot,1):u(ve)?Z(gi,2):Z(xi,-1)})}var Li=x(Bn,2),sn=C(Li),mn=x(sn,2),Kn=x(C(mn),2);{var dn=Z=>{var Fe=GZ(),vt=C(Fe);G(()=>q(vt,u(Y).length)),T(Z,Fe)};$(Kn,Z=>{!u(X)&&u(Y).length>0&&Z(dn)})}var An=x(Kn,2),on=C(An),kn=x(mn,2);{var Ae=Z=>{var Fe=QZ(),vt=C(Fe);{var It=O=>{var se=ZZ();T(O,se)},Nt=O=>{var se=Fs(),be=_t(se);_i(be,17,()=>u(Pe),j=>j.id,(j,pe)=>{const qe=ot(()=>{var Gt,$t;return((Gt=f.get(u(pe).nodeId))==null?void 0:Gt.name)??(($t=u(g).find(ii=>ii.nodeId===u(pe).nodeId))==null?void 0:$t.name)??null}),xe=ot(()=>{var Gt,$t;return u(pe).endpointId!==void 0?(($t=(Gt=f.get(u(pe).nodeId))==null?void 0:Gt.endpoints.find(ii=>ii.endpointId===u(pe).endpointId))==null?void 0:$t.name)??null:null}),Te=ot(()=>u(pe).attrName??u(pe).clusterName);var Ie=JZ(),bt=C(Ie),ct=C(bt),Me=x(bt,2);{var Wt=Gt=>{var $t=XZ(),ii=x(_t($t),2),J=C(ii),me=x(J);{var $e=Ye=>{var Xt=Xw(),ai=x(_t(Xt)),ei=C(ai);G(()=>q(ei,`(#${u(pe).nodeId??""})`)),T(Ye,Xt)};$(me,Ye=>{u(qe)&&Ye($e)})}var it=x(ii,2);let Ct;var je=C(it);G(()=>{q(J,u(qe)??`#${u(pe).nodeId}`),Ct=jt(it,1,"e-val svelte-1ua3isv",null,Ct,{"e-online":u(pe).online,"e-offline":!u(pe).online}),q(je,u(pe).online?"online":"offline")}),T(Gt,$t)},ni=Gt=>{var $t=YZ(),ii=x(_t($t),2),J=C(ii),me=x(J);{var $e=ti=>{var Hi=Xw(),A=x(_t(Hi)),K=C(A);G(()=>q(K,`(#${u(pe).nodeId??""})`)),T(ti,Hi)};$(me,ti=>{u(qe)&&ti($e)})}var it=x(ii,2),Ct=C(it),je=x(Ct);{var Ye=ti=>{var Hi=Xw(),A=x(_t(Hi)),K=C(A);G(()=>q(K,`(ep ${u(pe).endpointId??""})`)),T(ti,Hi)};$(je,ti=>{u(xe)&&ti(Ye)})}var Xt=x(it,2),ai=C(Xt),ei=x(Xt,2),Vi=C(ei),In=x(ei,2),Fi=C(In);G(ti=>{q(J,u(qe)??`#${u(pe).nodeId}`),q(Ct,u(xe)??`ep${u(pe).endpointId}`),q(ai,u(pe).clusterName),q(Vi,u(Te)),q(Fi,ti)},[()=>p(u(pe).value)]),T(Gt,$t)};$(Me,Gt=>{u(pe).kind==="status"?Gt(Wt):Gt(ni,-1)})}G(Gt=>q(ct,Gt),[()=>D(u(pe).ts)]),T(j,Ie)}),T(O,se)};$(vt,O=>{u(Pe).length===0?O(It):O(Nt,-1)})}T(Z,Fe)};$(kn,Z=>{u(X)&&Z(Ae)})}G(()=>{Ko(Li,u(X)?`height: ${u(ue)}px;`:""),q(on,u(X)?"▾":"▸")}),te("click",nn,()=>k(mt,!u(mt))),te("mousedown",sn,Ve),te("click",An,()=>{k(X,!u(X))}),T(o,Nn),Ao()}Cr(["click","mousedown"]);var iX=R("<button>›</button>"),nX=R('<span class="chev-ph svelte-1vejtrc"></span>'),sX=R('<span class="tv svelte-1vejtrc"> </span> <span class="tt svelte-1vejtrc"> </span>',1),oX=R('<div class="tc svelte-1vejtrc"></div>'),rX=R('<div class="tn svelte-1vejtrc"><div><!> <span class="seg svelte-1vejtrc"> </span> <!></div> <!></div>'),aX=R("<option></option>"),lX=R('<span class="pub-ok svelte-1vejtrc">✓</span>'),cX=R('<span class="pub-err svelte-1vejtrc"> </span>'),dX=R('<div class="info svelte-1vejtrc">Loading…</div>'),hX=R('<div class="info err svelte-1vejtrc"> </div>'),uX=R('<div class="info svelte-1vejtrc">No topics match.</div>'),gX=R('<div class="vr svelte-1vejtrc"><span class="v-topic svelte-1vejtrc"> </span> <span class="v-val svelte-1vejtrc"> </span> <span class="v-ts svelte-1vejtrc"> </span></div>'),fX=R('<div class="vs svelte-1vejtrc"><div><div class="vrows-abs svelte-1vejtrc"></div></div></div>'),pX=R('<div class="info svelte-1vejtrc">No topics yet.</div>'),mX=R('<div class="tree-wrap svelte-1vejtrc"><!></div>'),_X=R('<span class="stream-badge"> </span>'),vX=R('<span class="stream-empty svelte-1vejtrc">Waiting for messages…</span>'),bX=R('<span class="s-ret svelte-1vejtrc" title="retained snapshot">⊛</span>'),yX=R('<div><span class="s-ts svelte-1vejtrc"> </span> <!> <span class="s-topic svelte-1vejtrc"> </span> <span class="s-val svelte-1vejtrc"> </span></div>'),wX=R('<div class="stream-body svelte-1vejtrc"><!></div>'),SX=R('<div class="ctx-bd svelte-1vejtrc"></div> <div class="ctx-menu svelte-1vejtrc"><button class="svelte-1vejtrc">Copy topic</button> <button class="svelte-1vejtrc">Clear retained</button></div>',1),CX=R('<label class="modal-check svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> Recursive — also clear all child topics</label>'),xX=R('<div class="modal-bd svelte-1vejtrc"></div> <div class="modal svelte-1vejtrc"><div class="modal-title svelte-1vejtrc">Clear retained</div> <div class="modal-body svelte-1vejtrc"><p class="svelte-1vejtrc">Clear retained value for <code class="svelte-1vejtrc"> </code>?</p> <!></div> <div class="modal-footer svelte-1vejtrc"><button class="btn-cancel svelte-1vejtrc">Cancel</button> <button class="btn-confirm svelte-1vejtrc">Clear</button></div></div>',1),LX=R('<div class="page svelte-1vejtrc"><div class="toolbar svelte-1vejtrc"><h2 class="svelte-1vejtrc">MQTT</h2></div> <div class="main-group svelte-1vejtrc"><div class="pub-bar svelte-1vejtrc"><input class="pt svelte-1vejtrc" type="text" placeholder="topic" list="pub-topic-list" autocomplete="off"/> <datalist id="pub-topic-list"></datalist> <input class="pp svelte-1vejtrc" type="text" placeholder="payload"/> <label class="rl svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> retain</label> <select class="svelte-1vejtrc"><option>QoS 0</option><option>QoS 1</option><option>QoS 2</option></select> <button class="svelte-1vejtrc">Publish</button> <!> <!></div> <div class="tree-filter-bar svelte-1vejtrc"><input class="filter-in svelte-1vejtrc" type="search" placeholder="Filter topics…"/> <span class="count svelte-1vejtrc"><!> </span></div> <!></div> <div class="stream-panel svelte-1vejtrc"><div class="stream-resize svelte-1vejtrc"></div> <div class="stream-hdr-row svelte-1vejtrc"><input class="filter-in stream-filter-in svelte-1vejtrc" type="search" placeholder="Live stream filter (MQTT wildcard, default: #)"/> <!> <button class="stream-toggle svelte-1vejtrc" title="Toggle live stream"> </button></div> <!></div> <!> <!></div>');function kX(o,e){Ro(e,!0);const t=(J,me=py)=>{const $e=ot(()=>u(f).has(me().path)),it=ot(()=>u(a)>=0&&me().children.size>0),Ct=ot(()=>u(a)>=0&&me().isLeaf&&!n.has(me().path));var je=rX(),Ye=C(je);let Xt;var ai=C(Ye);{var ei=Se=>{var Ne=iX();let Le;G(()=>{Le=jt(Ne,1,"chev svelte-1vejtrc",null,Le,{open:u($e)}),Hn(Ne,"aria-label",u($e)?"Collapse":"Expand")}),te("click",Ne,()=>p(me().path)),T(Se,Ne)},Vi=Se=>{var Ne=nX();T(Se,Ne)};$(ai,Se=>{u(it)?Se(ei):Se(Vi,-1)})}var In=x(ai,2),Fi=C(In),ti=x(In,2);{var Hi=Se=>{var Ne=sX(),Le=_t(Ne),re=C(Le),st=x(Le,2),Ue=C(st);G((Ee,Tt,We)=>{Hn(Le,"title",Ee),q(re,Tt),q(Ue,We)},[()=>{var Ee;return Ri((Ee=fn(me().path))==null?void 0:Ee.val)},()=>{var Ee;return Ri((Ee=fn(me().path))==null?void 0:Ee.val)},()=>{var Ee;return((Ee=fn(me().path))==null?void 0:Ee.ts)!=null?Bn(fn(me().path).ts):""}]),T(Se,Ne)},A=ot(()=>me().isLeaf&&i.has(me().path));$(ti,Se=>{u(A)&&Se(Hi)})}var K=x(Ye,2);{var Re=Se=>{var Ne=oX();_i(Ne,21,()=>[...me().children.values()].sort((Le,re)=>Le.seg.localeCompare(re.seg)),Le=>Le.path,(Le,re)=>{t(Le,()=>u(re))}),T(Se,Ne)};$(K,Se=>{u(it)&&u($e)&&Se(Re)})}G(()=>{Xt=jt(Ye,1,"tr svelte-1vejtrc",null,Xt,{stale:u(Ct)}),q(Fi,me().seg)}),te("click",Ye,()=>{k(tt,me().path+"/#")}),te("contextmenu",Ye,Se=>{Se.preventDefault(),k(at,{x:Se.clientX,y:Se.clientY,topic:me().path},!0)}),T(J,je)},i=new Map,n=new Set,s=new Set;let r=null,a=B(0);function c(){r===null&&(r=requestAnimationFrame(()=>{r=null;for(const J of s)g(J);s.clear(),bk(a)}))}const h=new Map;function g(J){const me=J.split("/");let $e=h,it="";for(let Ct=0;Ct<me.length;Ct++){const je=me[Ct];it=Ct===0?je:`${it}/${je}`,$e.has(je)||$e.set(je,{seg:je,path:it,children:new Map,isLeaf:!1});const Ye=$e.get(je);Ct===me.length-1&&(Ye.isLeaf=!0),$e=Ye.children}}let f=B(wi(new Set));function p(J){const me=new Set(u(f));me.has(J)?me.delete(J):me.add(J),k(f,me,!0)}let v=B("");const _=24,w=5;let S=B(0),D=B(300),P=ot(()=>{if(u(a),!u(v))return[];const J=u(v).toLowerCase().split(/\s+/).filter(Boolean),me=[];for(const[$e,it]of i){const Ct=$e.toLowerCase();J.every(je=>Ct.includes(je))&&me.push({topic:$e,...it})}return me.sort(($e,it)=>$e.topic.localeCompare(it.topic))}),N=ot(()=>{const J=u(P).length,me=Math.max(0,Math.floor(u(S)/_)-w),$e=Math.min(J,Math.ceil((u(S)+u(D))/_)+w);return{start:me,end:$e,totalH:J*_,top:me*_}});const V=1e3,F=200,Y=20,X=36;let ue=0,Pe=B(wi([])),Ve=B(wi([])),ve=B(!0),tt=B("#"),At=B(200);Vn(()=>{const J=u(tt).trim(),me=yl(()=>u(Pe)),$e=!J||J==="#"?me.slice(0,F):me.filter(it=>mt(J,it.topic)).slice(0,F);if(J&&J!=="#"){const it=new Set($e.map(je=>je.topic)),Ct=[];for(const[je,Ye]of i)it.has(je)||mt(J,je)&&Ct.push({id:-(Ct.length+1),topic:je,val:Ye.val,ts:Ye.ts,retained:!0});Ct.sort((je,Ye)=>je.topic.localeCompare(Ye.topic)),k(Ve,[...$e,...Ct],!0)}else k(Ve,$e,!0)});function mt(J,me){if(J==="#")return!0;const $e=J.split("/"),it=me.split("/");for(let Ct=0;Ct<$e.length;Ct++){if($e[Ct]==="#")return!0;if(Ct>=it.length||$e[Ct]!=="+"&&$e[Ct]!==it[Ct])return!1}return $e.length===it.length}function hi(J){J.preventDefault();const me=J.clientY,$e=u(At);function it(je){k(At,Math.max(60,Math.min(800,$e+me-je.clientY)),!0)}function Ct(){document.removeEventListener("mousemove",it),document.removeEventListener("mouseup",Ct)}document.addEventListener("mousemove",it),document.addEventListener("mouseup",Ct)}let Vt=ot(()=>{const J=Math.max(1,Math.floor((u(At)-X)/Y)+1);return u(Ve).slice(0,J)}),Jt=B(!0),he=B(null);async function kt(){k(Jt,!0),k(he,null);try{const J=await uR();for(const me of J)i.set(me.topic,{val:me.val,ts:me.ts}),g(me.topic)}catch(J){k(he,J instanceof Error?J.message:String(J),!0)}finally{k(Jt,!1),bk(a)}}const Oe=Gl("mqtt",J=>{const{topic:me,val:$e,ts:it}=J;i.set(me,{val:$e,ts:it}),n.add(me),s.add(me),c();const Ct={id:ue++,topic:me,val:$e,ts:it};k(Pe,[Ct,...u(Pe).slice(0,V-1)],!0);const je=u(tt).trim();(!je||je==="#"||mt(je,me))&&k(Ve,[Ct,...u(Ve).filter(Ye=>!(Ye.retained&&Ye.topic===me)).slice(0,F-1)],!0)});let at=B(null),Rt=B(null);async function Si(J,me){const $e=[J];if(me){const it=J+"/";for(const Ct of i.keys())Ct.startsWith(it)&&$e.push(Ct)}for(const it of $e)await vD(it,"",!0,0)}let Qt=ot(()=>(u(a),[...i.keys()].sort())),Ht=B(""),St=B(""),ri=B(!1),Ii=B(0),Sn=B(!1),ln=B(null),Nn=B(!1);async function cn(){if(u(Ht)){k(Sn,!0),k(ln,null),k(Nn,!1);try{await vD(u(Ht),u(St),u(ri),u(Ii)),k(Nn,!0),setTimeout(()=>{k(Nn,!1)},2e3)}catch(J){k(ln,J instanceof Error?J.message:String(J),!0)}finally{k(Sn,!1)}}}function Ri(J){return J==null?"":typeof J=="object"?JSON.stringify(J):String(J)}function Bn(J){return new Date(J).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Zi(J){return new Date(J).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function fn(J){return u(a),i.get(J)}let nn=ot(()=>(u(a),[...h.values()].sort((J,me)=>J.seg.localeCompare(me.seg)))),Ui=ot(()=>(u(a),i.size));xr(kt),yy(()=>{Oe(),r!==null&&cancelAnimationFrame(r)});var pn=LX(),Rn=x(C(pn),2),Cn=C(Rn),zn=C(Cn),xn=x(zn,2);_i(xn,20,()=>u(Qt),J=>J,(J,me)=>{var $e=aX(),it={};G(()=>{it!==(it=me)&&($e.value=($e.__value=me)??"")}),T(J,$e)});var Ln=x(xn,2),Xi=x(Ln,2),Ke=C(Xi),Ot=x(Xi,2),gi=C(Ot);gi.value=gi.__value=0;var xi=x(gi);xi.value=xi.__value=1;var Li=x(xi);Li.value=Li.__value=2;var sn=x(Ot,2),mn=x(sn,2);{var Kn=J=>{var me=lX();T(J,me)};$(mn,J=>{u(Nn)&&J(Kn)})}var dn=x(mn,2);{var An=J=>{var me=cX(),$e=C(me);G(()=>q($e,u(ln))),T(J,me)};$(dn,J=>{u(ln)&&J(An)})}var on=x(Cn,2),kn=C(on),Ae=x(kn,2),Z=C(Ae);{var Fe=J=>{var me=Ur();G(()=>q(me,`${u(P).length??""} /`)),T(J,me)};$(Z,J=>{u(v)&&J(Fe)})}var vt=x(Z),It=x(on,2);{var Nt=J=>{var me=dX();T(J,me)},O=J=>{var me=hX(),$e=C(me);G(()=>q($e,u(he))),T(J,me)},se=J=>{var me=Fs(),$e=_t(me);{var it=je=>{var Ye=uX();T(je,Ye)},Ct=je=>{var Ye=fX(),Xt=C(Ye),ai=C(Xt);_i(ai,21,()=>u(P).slice(u(N).start,u(N).end),ei=>ei.topic,(ei,Vi)=>{var In=gX(),Fi=C(In),ti=C(Fi),Hi=x(Fi,2),A=C(Hi),K=x(Hi,2),Re=C(K);G((Se,Ne,Le)=>{q(ti,u(Vi).topic),Hn(Hi,"title",Se),q(A,Ne),q(Re,Le)},[()=>Ri(u(Vi).val),()=>Ri(u(Vi).val),()=>Bn(u(Vi).ts)]),T(ei,In)}),G(()=>{Ko(Xt,`height: ${u(N).totalH??""}px; position: relative;`),Ko(ai,`top: ${u(N).top??""}px;`)}),os("scroll",Ye,ei=>{k(S,ei.currentTarget.scrollTop,!0)}),CW(Ye,"clientHeight",ei=>k(D,ei)),T(je,Ye)};$($e,je=>{u(P).length===0?je(it):je(Ct,-1)})}T(J,me)},be=J=>{var me=mX(),$e=C(me);{var it=je=>{var Ye=pX();T(je,Ye)},Ct=je=>{var Ye=Fs(),Xt=_t(Ye);_i(Xt,17,()=>u(nn),ai=>ai.path,(ai,ei)=>{t(ai,()=>u(ei))}),T(je,Ye)};$($e,je=>{u(nn).length===0?je(it):je(Ct,-1)})}T(J,me)};$(It,J=>{u(Jt)?J(Nt):u(he)?J(O,1):u(v)?J(se,2):J(be,-1)})}var j=x(Rn,2),pe=C(j),qe=x(pe,2),xe=C(qe),Te=x(xe,2);{var Ie=J=>{var me=_X(),$e=C(me);G(()=>q($e,u(Ve).length)),T(J,me)};$(Te,J=>{!u(ve)&&u(Ve).length>0&&J(Ie)})}var bt=x(Te,2),ct=C(bt),Me=x(qe,2);{var Wt=J=>{var me=wX(),$e=C(me);{var it=je=>{var Ye=vX();T(je,Ye)},Ct=je=>{var Ye=Fs(),Xt=_t(Ye);_i(Xt,17,()=>u(Vt),ai=>ai.id,(ai,ei)=>{var Vi=yX();let In;var Fi=C(Vi),ti=C(Fi),Hi=x(Fi,2);{var A=Le=>{var re=bX();T(Le,re)};$(Hi,Le=>{u(ei).retained&&Le(A)})}var K=x(Hi,2),Re=C(K),Se=x(K,2),Ne=C(Se);G((Le,re,st)=>{In=jt(Vi,1,"sr svelte-1vejtrc",null,In,{retained:u(ei).retained}),q(ti,Le),q(Re,u(ei).topic),Hn(Se,"title",re),q(Ne,st)},[()=>Zi(u(ei).ts),()=>Ri(u(ei).val),()=>Ri(u(ei).val)]),T(ai,Vi)}),T(je,Ye)};$($e,je=>{u(Vt).length===0?je(it):je(Ct,-1)})}T(J,me)};$(Me,J=>{u(ve)&&J(Wt)})}var ni=x(j,2);{var Gt=J=>{var me=SX(),$e=_t(me),it=x($e,2);let Ct;var je=C(it),Ye=x(je,2);G(()=>Ct=Ko(it,"",Ct,{left:`${u(at).x??""}px`,top:`${u(at).y??""}px`})),te("click",$e,()=>k(at,null)),te("contextmenu",$e,Xt=>{Xt.preventDefault(),k(at,null)}),te("click",je,()=>{navigator.clipboard.writeText(u(at).topic),k(at,null)}),te("click",Ye,()=>{const Xt=u(at).topic,ai=Xt+"/",ei=[...i.keys()].some(Vi=>Vi.startsWith(ai));k(Rt,{topic:Xt,hasChildren:ei,recursive:!1},!0),k(at,null)}),T(J,me)};$(ni,J=>{u(at)&&J(Gt)})}var $t=x(ni,2);{var ii=J=>{var me=xX(),$e=_t(me),it=x($e,2),Ct=x(C(it),2),je=C(Ct),Ye=x(C(je)),Xt=C(Ye),ai=x(je,2);{var ei=ti=>{var Hi=CX(),A=C(Hi);As(A,()=>u(Rt).recursive,K=>u(Rt).recursive=K),T(ti,Hi)};$(ai,ti=>{u(Rt).hasChildren&&ti(ei)})}var Vi=x(Ct,2),In=C(Vi),Fi=x(In,2);G(()=>q(Xt,u(Rt).topic)),te("click",$e,()=>k(Rt,null)),te("click",In,()=>k(Rt,null)),te("click",Fi,()=>{const{topic:ti,recursive:Hi}=u(Rt);k(Rt,null),Si(ti,Hi)}),T(J,me)};$($t,J=>{u(Rt)&&J(ii)})}G(()=>{sn.disabled=u(Sn)||!u(Ht),q(vt,` ${u(Ui)??""}`),Ko(j,u(ve)?`height: ${u(At)}px;`:""),q(ct,u(ve)?"▾":"▸")}),Mi(zn,()=>u(Ht),J=>k(Ht,J)),Mi(Ln,()=>u(St),J=>k(St,J)),As(Ke,()=>u(ri),J=>k(ri,J)),_a(Ot,()=>u(Ii),J=>k(Ii,J)),te("click",sn,cn),Mi(kn,()=>u(v),J=>k(v,J)),te("mousedown",pe,hi),Mi(xe,()=>u(tt),J=>k(tt,J)),te("click",bt,()=>{k(ve,!u(ve))}),T(o,pn),Ao()}Cr(["click","contextmenu","mousedown"]);var IX=R('<div class="restart-banner restart-banner--restarting svelte-twakcj">Restarting daemon…</div>'),DX=R('<div class="restart-banner svelte-twakcj">⚠ Package changes require a daemon restart to take effect. <button class="restart-btn svelte-twakcj">Restart now</button></div>'),EX=R('<div class="err svelte-twakcj"> </div>'),PX=R('<span class="pane-count pane-count--warn svelte-twakcj"> </span>'),TX=R('<p class="empty svelte-twakcj">No packages installed.</p>'),MX=R('<p class="empty svelte-twakcj">No match.</p>'),NX=R('<span class="dep-latest svelte-twakcj"> </span>'),RX=_T('<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>'),AX=_T('<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>'),OX=R('<div><div class="dep-info svelte-twakcj"><a class="dep-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="dep-ver svelte-twakcj"> </span> <!></div> <div class="dep-btns svelte-twakcj"><button><!></button> <button class="icon-btn icon-btn--danger svelte-twakcj" title="Uninstall"><svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><line x1="2" y1="2" x2="14" y2="14"></line><line x1="14" y1="2" x2="2" y2="14"></line></svg></button></div></div>'),FX=R('<span class="result-author svelte-twakcj"> </span>'),HX=R('<span class="result-date svelte-twakcj"> </span>'),WX=R('<span class="result-desc svelte-twakcj"> </span>'),BX=R('<div class="result-row svelte-twakcj"><div class="result-info svelte-twakcj"><a class="result-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="result-ver svelte-twakcj"> </span> <!> <!> <!></div> <button class="install-btn svelte-twakcj"> </button></div>'),zX=R('<div class="results-list svelte-twakcj"></div>'),VX=R('<pre class="npm-output svelte-twakcj"> </pre>'),jX=R(`<p class="hint svelte-twakcj">Install npm packages into <code class="svelte-twakcj">~/.she/</code>. Scripts can then <code class="svelte-twakcj">require('package-name')</code> directly.</p>`),UX=R('<!> <div class="pkg-shell svelte-twakcj"><!> <!> <div class="pkg-body svelte-twakcj"><div class="pkg-left svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Installed</span> <span class="pane-count svelte-twakcj"> </span> <!> <button class="icon-btn check-outdated-btn svelte-twakcj" title="Check for package updates"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13 8A5 5 0 1 1 10.5 3.67"></path><polyline points="10.5,1.5 10.5,4 13,4"></polyline></svg></button></div> <div class="filter-row svelte-twakcj"><input class="filter-in svelte-twakcj" type="search" placeholder="Filter…"/></div> <div class="installed-list svelte-twakcj"><!></div></div> <div class="pkg-right svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Search npm</span></div> <div class="search-row svelte-twakcj"><input class="search-in svelte-twakcj" type="text" placeholder="Package name, e.g. axios, lodash…"/> <button class="search-btn svelte-twakcj"> </button></div> <!> <!> <!></div></div></div>',1);function $X(o,e){Ro(e,!0);let t=B(wi([])),i=B(""),n=B(wi({})),s=B(!1),r=B(""),a=B(wi([])),c=B(!1),h=B(!1),g=B(!1),f=B(""),p=B(""),v=wi({});const _=ot(()=>u(i).trim()?u(t).filter(Ke=>Ke.name.toLowerCase().includes(u(i).toLowerCase())):u(t)),w=ot(()=>Object.keys(u(n)).length);xr(async()=>{await Promise.all([S(),D()])});async function S(){try{k(t,await c8(),!0),k(f,"")}catch(Ke){k(f,Ke.message,!0)}}async function D(){try{k(n,await f8(),!0)}catch{}}async function P(){k(s,!0);try{k(n,await p8(),!0)}catch{}finally{k(s,!1)}}async function N(){const Ke=u(r).trim();if(!Ke){k(a,[],!0);return}k(g,!0),k(f,"");try{k(a,await d8(Ke),!0)}catch(Ot){k(f,Ot.message,!0)}finally{k(g,!1)}}function V(Ke){if(!Ke)return"";try{return new Date(Ke).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}async function F(Ke,Ot){v[Ke]=!0,k(f,""),k(p,"");try{const gi=await h8(Ke,Ot);k(p,gi.stdout||gi.stderr||"Done.",!0),k(c,!0),await S()}catch(gi){k(f,gi.message,!0)}finally{v[Ke]=!1}}async function Y(Ke){v[Ke]=!0,k(f,""),k(p,"");try{const Ot=await u8(Ke);k(p,Ot.stdout||Ot.stderr||"Done.",!0),k(c,!0);const gi={...u(n)};delete gi[Ke],k(n,gi,!0),await S()}catch(Ot){k(f,Ot.message,!0)}finally{v[Ke]=!1}}async function X(Ke){v[Ke]=!0,k(f,""),k(p,"");try{const Ot=await g8(Ke);k(p,Ot.stdout||Ot.stderr||"Done.",!0),k(c,!0);const gi={...u(n)};delete gi[Ke],k(n,gi,!0),await S()}catch(Ot){k(f,Ot.message,!0)}finally{v[Ke]=!1}}let ue;async function Pe(){if(await ue.show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"})){k(h,!0);try{await lR()}catch{}setTimeout(()=>{window.location.reload()},3e3)}}var Ve=UX(),ve=_t(Ve);bs(Hg(ve,{}),Ke=>ue=Ke,()=>ue);var tt=x(ve,2),At=C(tt);{var mt=Ke=>{var Ot=IX();T(Ke,Ot)},hi=Ke=>{var Ot=DX(),gi=x(C(Ot));te("click",gi,Pe),T(Ke,Ot)};$(At,Ke=>{u(h)?Ke(mt):u(c)&&Ke(hi,1)})}var Vt=x(At,2);{var Jt=Ke=>{var Ot=EX(),gi=C(Ot);G(()=>q(gi,u(f))),T(Ke,Ot)};$(Vt,Ke=>{u(f)&&Ke(Jt)})}var he=x(Vt,2),kt=C(he),Oe=C(kt),at=x(C(Oe),2),Rt=C(at),Si=x(at,2);{var Qt=Ke=>{var Ot=PX(),gi=C(Ot);G(()=>q(gi,`${u(w)??""} outdated`)),T(Ke,Ot)};$(Si,Ke=>{u(w)>0&&Ke(Qt)})}var Ht=x(Si,2),St=C(Ht);let ri;var Ii=x(Oe,2),Sn=C(Ii),ln=x(Ii,2),Nn=C(ln);{var cn=Ke=>{var Ot=TX();T(Ke,Ot)},Ri=Ke=>{var Ot=MX();T(Ke,Ot)},Bn=Ke=>{var Ot=Fs(),gi=_t(Ot);_i(gi,17,()=>u(_),xi=>xi.name,(xi,Li)=>{var sn=OX();let mn;var Kn=C(sn),dn=C(Kn),An=C(dn),on=x(dn,2),kn=C(on),Ae=x(on,2);{var Z=j=>{var pe=NX(),qe=C(pe);G(()=>q(qe,`→ v${u(n)[u(Li).name].latest??""}`)),T(j,pe)};$(Ae,j=>{u(n)[u(Li).name]&&j(Z)})}var Fe=x(Kn,2),vt=C(Fe);let It;var Nt=C(vt);{var O=j=>{var pe=RX();T(j,pe)},se=j=>{var pe=AX();T(j,pe)};$(Nt,j=>{v[u(Li).name]?j(O):j(se,-1)})}var be=x(vt,2);G(()=>{mn=jt(sn,1,"dep-row svelte-twakcj",null,mn,{"dep-busy":!!v[u(Li).name]}),Hn(dn,"href",u(Li).url??`https://www.npmjs.com/package/${u(Li).name}`),q(An,u(Li).name),q(kn,u(Li).installedVersion??u(Li).version),It=jt(vt,1,"icon-btn svelte-twakcj",null,It,{"icon-btn--update":!!u(n)[u(Li).name]}),vt.disabled=!!v[u(Li).name],Hn(vt,"title",u(n)[u(Li).name]?`Update to v${u(n)[u(Li).name].latest}`:"Update to latest"),be.disabled=!!v[u(Li).name]}),te("click",vt,()=>X(u(Li).name)),te("click",be,()=>Y(u(Li).name)),T(xi,sn)}),T(Ke,Ot)};$(Nn,Ke=>{u(t).length===0?Ke(cn):u(_).length===0?Ke(Ri,1):Ke(Bn,-1)})}var Zi=x(kt,2),fn=x(C(Zi),2),nn=C(fn),Ui=x(nn,2),pn=C(Ui),Rn=x(fn,2);{var Cn=Ke=>{var Ot=zX();_i(Ot,21,()=>u(a),gi=>gi.name,(gi,xi)=>{var Li=BX(),sn=C(Li),mn=C(sn),Kn=C(mn),dn=x(mn,2),An=C(dn),on=x(dn,2);{var kn=O=>{var se=FX(),be=C(se);G(()=>q(be,u(xi).author)),T(O,se)};$(on,O=>{u(xi).author&&O(kn)})}var Ae=x(on,2);{var Z=O=>{var se=HX(),be=C(se);G(j=>{Hn(se,"title",u(xi).date),q(be,j)},[()=>V(u(xi).date)]),T(O,se)};$(Ae,O=>{u(xi).date&&O(Z)})}var Fe=x(Ae,2);{var vt=O=>{var se=WX(),be=C(se);G(()=>q(be,u(xi).description)),T(O,se)};$(Fe,O=>{u(xi).description&&O(vt)})}var It=x(sn,2),Nt=C(It);G(()=>{Hn(mn,"href",u(xi).url??`https://www.npmjs.com/package/${u(xi).name}`),q(Kn,u(xi).name),q(An,u(xi).version),It.disabled=!!v[u(xi).name],q(Nt,v[u(xi).name]?"Installing…":"Install")}),te("click",It,()=>F(u(xi).name)),T(gi,Li)}),T(Ke,Ot)};$(Rn,Ke=>{u(a).length>0&&Ke(Cn)})}var zn=x(Rn,2);{var xn=Ke=>{var Ot=VX(),gi=C(Ot);G(()=>q(gi,u(p))),T(Ke,Ot)};$(zn,Ke=>{u(p)&&Ke(xn)})}var Ln=x(zn,2);{var Xi=Ke=>{var Ot=jX();T(Ke,Ot)};$(Ln,Ke=>{!u(a).length&&!u(p)&&Ke(Xi)})}G(()=>{q(Rt,u(t).length),Ht.disabled=u(s),ri=jt(St,0,"svelte-twakcj",null,ri,{spinning:u(s)}),Ui.disabled=u(g),q(pn,u(g)?"Searching…":"Search")}),te("click",Ht,P),Mi(Sn,()=>u(i),Ke=>k(i,Ke)),te("keydown",nn,Ke=>Ke.key==="Enter"&&N()),Mi(nn,()=>u(r),Ke=>k(r,Ke)),te("click",Ui,N),T(o,Ve),Ao()}Cr(["click","keydown"]);var qX=R('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),KX=R('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),GX=R('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),ZX=R('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> </button>'),XX=R('<div class="version-popup svelte-1n46o8q"><dl class="svelte-1n46o8q"><dt class="svelte-1n46o8q">Installed</dt><dd class="svelte-1n46o8q"></dd> <!></dl> <div class="version-actions svelte-1n46o8q"><!> <button class="check-btn svelte-1n46o8q" title="Check for updates now"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> </button></div></div>'),YX=R('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),JX=R('<dt class="svelte-1n46o8q">Matter nodes</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Matter endpoints</dt><dd class="svelte-1n46o8q"> </dd>',1),QX=R('<dt class="svelte-1n46o8q">DB docs</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">DB views</dt><dd class="svelte-1n46o8q"> </dd>',1),eY=R('<dl class="svelte-1n46o8q"><!> <dt class="svelte-1n46o8q">Scripts</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT topics</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT msg/s</dt><dd class="svelte-1n46o8q"> </dd> <!> <!> <dt class="svelte-1n46o8q">Handlers</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Memory</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">CPU</dt><dd class="svelte-1n46o8q"> </dd></dl>'),tY=R('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),iY=R('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path><line x1="12" y1="2" x2="12" y2="12"></line></svg> Restart daemon</button></div></div>'),nY=R('<button class="nav-logout svelte-1n46o8q" title="Logout"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg></button>'),sY=R('<div class="shell svelte-1n46o8q"><nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="5,3 1,8 5,13"></polyline><polyline points="11,3 15,8 11,13"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1"></rect><path d="M2,11 V5 H5 V11"></path><path d="M6,12 V5 H9 V8 H6"></path><path d="M10,11 V5 H15 V11"></path><line x1="12.5" y1="5" x2="12.5" y2="11"></line></svg> Packages</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z"></path></svg> MQTT</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M8,2 L8,7"></path><path d="M6,5 L8,7.5 L10,5"></path><path d="M2.5,14 L6,10"></path><path d="M6.2,12.8 L6,10 L3.2,10.2"></path><path d="M13.5,14 L10,10"></path><path d="M9.8,12.8 L10,10 L12.8,10.2"></path></svg> Matter</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="8" cy="4.5" rx="5" ry="1.8"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7"></path><path d="M3,8 a5,1.8 0,0,0 10,0"></path></svg> DB</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="2" y1="5" x2="14" y2="5"></line><line x1="2" y1="8" x2="14" y2="8"></line><line x1="2" y1="11" x2="9" y2="11"></line></svg> Logs</button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),oY=R('<div class="login-error svelte-1n46o8q"> </div>'),rY=R('<div class="login-overlay svelte-1n46o8q"><form class="login-box svelte-1n46o8q"><div class="login-brand svelte-1n46o8q">she</div> <h2 class="svelte-1n46o8q">Sign in</h2> <div class="login-field svelte-1n46o8q"><label for="she-password" class="svelte-1n46o8q">Password</label> <input id="she-password" type="password" placeholder="Enter password" autocomplete="current-password" class="svelte-1n46o8q"/></div> <!> <button type="submit" class="login-btn svelte-1n46o8q"> </button></form></div>'),aY=R('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> Restarting smart-home-engine…</div></div>'),lY=R('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> Updating smart-home-engine…</div></div>'),cY=R("<!> <!> <!> <!>",1);function dY(o,e){Ro(e,!0);const t=["scripts","mqtt","matter","db","logs","config","packages"];function i(){const he=location.hash.slice(1);return t.includes(he)?he:"scripts"}let n=B(wi(i())),s=B(null),r=B(!1),a=B(!1),c=B(!1),h=B(!1),g=B("none"),f=B(""),p=B(!1),v=B(""),_=B(""),w=B(!1),S=B(!1);V7(()=>{k(p,!0)});async function D(){k(_,""),k(w,!0);try{await $7(u(v)),k(v,""),k(p,!1)}catch(he){k(_,he.message??"Login failed",!0)}finally{k(w,!1)}}async function P(){if(u(g)==="proxy"&&u(f)){window.location.href=u(f);return}await q7(),k(p,!0)}let N=B(null),V=B(!1);async function F(){if(!await u(N).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;k(V,!0);let he;try{he=(await wf()).startedAt}catch{}try{await lR()}catch{}const kt=Date.now()+6e4;for(;Date.now()<kt;){await new Promise(Oe=>setTimeout(Oe,250));try{const Oe=await wf();if(he===void 0||Oe.startedAt!==he){location.reload();return}}catch{}}location.reload()}async function Y(){k(c,!0);try{const he=await J7();u(s)&&k(s,{...u(s),latestVersion:he.latestVersion??void 0},!0)}catch{}finally{k(c,!1)}}async function X(){var Oe,at;if(!await u(N).show(`Update to v${(Oe=u(s))==null?void 0:Oe.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;k(a,!1),k(h,!0);const he=(at=u(s))==null?void 0:at.startedAt;try{await Y7()}catch{}const kt=Date.now()+18e4;for(;Date.now()<kt;){await new Promise(Rt=>setTimeout(Rt,1e3));try{const Rt=await wf();if(he===void 0||Rt.startedAt!==he){location.reload();return}}catch{k(h,!1),k(V,!0)}}location.reload()}function ue(he){k(n,he,!0),location.hash=he}xr(async()=>{location.hash||(location.hash=u(n));const he=()=>{k(n,i(),!0)};window.addEventListener("hashchange",he);try{const at=await U7();k(g,at.mode,!0),k(f,at.proxyLogoutUrl??"",!0),u(g)==="password"&&(await fetch("/she/scripts")).status===401&&k(p,!0)}catch{}k(S,!0);async function kt(){try{k(s,await wf(),!0)}catch{}}kt();const Oe=setInterval(kt,5e3);return()=>{window.removeEventListener("hashchange",he),clearInterval(Oe)}});var Pe=cY();os("click",XP,()=>{u(r)&&k(r,!1),u(a)&&k(a,!1)});var Ve=_t(Pe);{var ve=he=>{var kt=sY(),Oe=C(kt),at=x(C(Oe),2);let Rt;var Si=x(at,2);let Qt;var Ht=x(Si,2);let St;var ri=x(Ht,2);let Ii;var Sn=x(ri,2);let ln;var Nn=x(Sn,2);let cn;var Ri=x(Nn,4),Bn=x(C(Ri),2),Zi=C(Bn),fn=C(Zi);fn.nodeValue="v0.27.2 ";var nn=x(fn);{var Ui=Ie=>{var bt=qX();T(Ie,bt)};$(nn,Ie=>{var bt;(bt=u(s))!=null&&bt.latestVersion&&Ie(Ui)})}var pn=x(Zi,2);{var Rn=Ie=>{var bt=XX(),ct=C(bt),Me=x(C(ct));Me.textContent="v0.27.2";var Wt=x(Me,2);{var ni=je=>{var Ye=KX(),Xt=x(_t(Ye)),ai=C(Xt);G(()=>q(ai,`v${u(s).latestVersion??""}`)),T(je,Ye)},Gt=je=>{var Ye=GX();T(je,Ye)};$(Wt,je=>{var Ye;(Ye=u(s))!=null&&Ye.latestVersion?je(ni):je(Gt,-1)})}var $t=x(ct,2),ii=C($t);{var J=je=>{var Ye=ZX(),Xt=x(C(Ye));G(()=>q(Xt,` Update to v${u(s).latestVersion??""}`)),te("click",Ye,X),T(je,Ye)};$(ii,je=>{var Ye;(Ye=u(s))!=null&&Ye.latestVersion&&je(J)})}var me=x(ii,2),$e=C(me);let it;var Ct=x($e);G(()=>{me.disabled=u(c),it=jt($e,0,"svelte-1n46o8q",null,it,{spinning:u(c)}),q(Ct,` ${u(c)?"Checking…":"Check for updates"}`)}),te("click",bt,je=>je.stopPropagation()),te("click",me,Y),T(Ie,bt)};$(pn,Ie=>{u(a)&&Ie(Rn)})}var Cn=x(Bn,2),zn=C(Cn),xn=x(zn,2);{var Ln=Ie=>{var bt=iY(),ct=C(bt);{var Me=$t=>{var ii=eY(),J=C(ii);{var me=Se=>{const Ne=ot(()=>Math.floor((Date.now()-u(s).startedAt)/1e3)),Le=ot(()=>Math.floor(u(Ne)/86400)),re=ot(()=>Math.floor(u(Ne)%86400/3600)),st=ot(()=>Math.floor(u(Ne)%3600/60));var Ue=YX(),Ee=x(_t(Ue)),Tt=C(Ee);G(()=>q(Tt,`${u(Le)>0?u(Le)+"d ":""}${u(re)>0||u(Le)>0?u(re)+"h ":""}${u(st)??""}m`)),T(Se,Ue)};$(J,Se=>{u(s).startedAt&&Se(me)})}var $e=x(J,3),it=C($e),Ct=x($e,3),je=C(Ct),Ye=x(Ct,3),Xt=C(Ye),ai=x(Ye,2);{var ei=Se=>{var Ne=JX(),Le=x(_t(Ne)),re=C(Le),st=x(Le,3),Ue=C(st);G(()=>{q(re,u(s).matterNodes??0),q(Ue,u(s).matterEndpoints??0)}),T(Se,Ne)};$(ai,Se=>{u(s).matterEnabled&&Se(ei)})}var Vi=x(ai,2);{var In=Se=>{var Ne=QX(),Le=x(_t(Ne)),re=C(Le),st=x(Le,3),Ue=C(st);G(()=>{q(re,u(s).dbDocs??"—"),q(Ue,u(s).dbViews??"—")}),T(Se,Ne)};$(Vi,Se=>{u(s).dbEnabled&&Se(In)})}var Fi=x(Vi,3),ti=C(Fi),Hi=x(Fi,3),A=C(Hi),K=x(Hi,3),Re=C(K);G(()=>{q(it,u(s).scripts),q(je,u(s).topics),q(Xt,u(s).mqttMsgPerSec??"—"),q(ti,u(s).handlers??"—"),q(A,u(s).memMb!=null?u(s).memMb+" MB":"—"),q(Re,u(s).cpuPercent!=null?u(s).cpuPercent+" %":"—")}),T($t,ii)},Wt=$t=>{var ii=tY();T($t,ii)};$(ct,$t=>{u(s)?$t(Me):$t(Wt,-1)})}var ni=x(ct,2),Gt=C(ni);te("click",bt,$t=>$t.stopPropagation()),te("click",Gt,()=>{k(r,!1),F()}),T(Ie,bt)};$(xn,Ie=>{u(r)&&Ie(Ln)})}var Xi=x(Cn,2);let Ke;var Ot=x(Xi,2);{var gi=Ie=>{var bt=nY();te("click",bt,P),T(Ie,bt)};$(Ot,Ie=>{u(g)==="password"&&Ie(gi)})}var xi=x(Oe,2),Li=C(xi);bs(Hg(Li,{}),Ie=>k(N,Ie,!0),()=>u(N));var sn=x(Li,2);let mn;var Kn=C(sn);{let Ie=ot(()=>u(n)==="scripts");_G(Kn,{get active(){return u(Ie)}})}var dn=x(sn,2);let An;var on=C(dn);$X(on,{});var kn=x(dn,2);let Ae;var Z=C(kn);kX(Z,{});var Fe=x(kn,2);let vt;var It=C(Fe);tX(It,{});var Nt=x(Fe,2);let O;var se=C(Nt);hZ(se,{});var be=x(Nt,2);let j;var pe=C(be);n9(pe,{});var qe=x(be,2);let xe;var Te=C(qe);a9(Te,{}),G(()=>{Rt=jt(at,1,"svelte-1n46o8q",null,Rt,{active:u(n)==="scripts"}),Qt=jt(Si,1,"svelte-1n46o8q",null,Qt,{active:u(n)==="packages"}),St=jt(Ht,1,"svelte-1n46o8q",null,St,{active:u(n)==="mqtt"}),Ii=jt(ri,1,"svelte-1n46o8q",null,Ii,{active:u(n)==="matter"}),ln=jt(Sn,1,"svelte-1n46o8q",null,ln,{active:u(n)==="db"}),cn=jt(Nn,1,"svelte-1n46o8q",null,cn,{active:u(n)==="logs"}),Ke=jt(Xi,1,"nav-settings svelte-1n46o8q",null,Ke,{active:u(n)==="config"}),mn=jt(sn,1,"page-wrap svelte-1n46o8q",null,mn,{hidden:u(n)!=="scripts"}),An=jt(dn,1,"page-wrap svelte-1n46o8q",null,An,{hidden:u(n)!=="packages"}),Ae=jt(kn,1,"page-wrap svelte-1n46o8q",null,Ae,{hidden:u(n)!=="mqtt"}),vt=jt(Fe,1,"page-wrap svelte-1n46o8q",null,vt,{hidden:u(n)!=="matter"}),O=jt(Nt,1,"page-wrap svelte-1n46o8q",null,O,{hidden:u(n)!=="db"}),j=jt(be,1,"page-wrap svelte-1n46o8q",null,j,{hidden:u(n)!=="config"}),xe=jt(qe,1,"page-wrap svelte-1n46o8q",null,xe,{hidden:u(n)!=="logs"})}),te("click",at,()=>ue("scripts")),te("click",Si,()=>ue("packages")),te("click",Ht,()=>ue("mqtt")),te("click",ri,()=>ue("matter")),te("click",Sn,()=>ue("db")),te("click",Nn,()=>ue("logs")),te("click",Zi,Ie=>{Ie.stopPropagation(),k(a,!u(a)),k(r,!1)}),te("click",zn,Ie=>{Ie.stopPropagation(),k(r,!u(r)),k(a,!1)}),te("click",Xi,()=>ue("config")),T(he,kt)};$(Ve,he=>{u(S)&&!u(p)&&he(ve)})}var tt=x(Ve,2);{var At=he=>{var kt=rY(),Oe=C(kt),at=x(C(Oe),4),Rt=x(C(at),2),Si=x(at,2);{var Qt=ri=>{var Ii=oY(),Sn=C(Ii);G(()=>q(Sn,u(_))),T(ri,Ii)};$(Si,ri=>{u(_)&&ri(Qt)})}var Ht=x(Si,2),St=C(Ht);G(()=>{Rt.disabled=u(w),Ht.disabled=u(w)||!u(v),q(St,u(w)?"Signing in…":"Sign in")}),os("submit",Oe,ri=>{ri.preventDefault(),D()}),Mi(Rt,()=>u(v),ri=>k(v,ri)),T(he,kt)};$(tt,he=>{u(p)&&he(At)})}var mt=x(tt,2);{var hi=he=>{var kt=aY();T(he,kt)};$(mt,he=>{u(V)&&he(hi)})}var Vt=x(mt,2);{var Jt=he=>{var kt=lY();T(he,kt)};$(Vt,he=>{u(h)&&he(Jt)})}T(o,Pe),Ao()}Cr(["click"]);cW(dY,{target:document.getElementById("app")});export{PT as t};
|
|
225
|
+
*[stopped]*`,toolEvents:u(ve).length>0?[...u(ve)]:void 0}],!0)}else k(c,K.message,!0)}finally{D=null,k(s,null),k(ve,[],!0),k(a,!1)}}}function Ln(){D==null||D.abort()}function Xi(A){A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),xn())}function Ke(){k(n,[],!0),k(c,"")}const Ot=["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 gi(A){k(r,A,!0),At==null||At.focus()}var xi=U9(),Li=_t(xi),sn=C(Li),mn=x(C(sn),2);{var Kn=A=>{var K=l9(),Re=C(K);{var Se=Le=>{var re=Ur();G(()=>q(re,`${u(h).provider??""} · ${(u(f)||u(h).model)??""}`)),T(Le,re)},Ne=Le=>{var re=Ur("Not configured");T(Le,re)};$(Re,Le=>{u(Vt)?Le(Se):Le(Ne,-1)})}G(()=>Hn(K,"title",`Provider: ${u(h).provider??""}`)),T(A,K)};$(mn,A=>{u(h)&&A(Kn)})}var dn=x(mn,2);{var An=A=>{var K=c9();te("click",K,Ke),T(A,K)};$(dn,A=>{u(n).length>0&&A(An)})}var on=x(sn,2),kn=C(on);{var Ae=A=>{var K=d9();T(A,K)},Z=A=>{var K=g9(),Re=C(K),Se=C(Re);{var Ne=st=>{var Ue=h9(),Ee=x(_t(Ue)),Tt=C(Ee);G(()=>q(Tt,t().id)),T(st,Ue)},Le=st=>{var Ue=Ur("No view selected. Ask a general sheDB view question.");T(st,Ue)};$(Se,st=>{t()?st(Ne):st(Le,-1)})}var re=x(Re,2);_i(re,17,()=>Ot,jn,(st,Ue)=>{var Ee=u9(),Tt=C(Ee);G(()=>q(Tt,u(Ue))),te("click",Ee,()=>gi(u(Ue))),T(st,Ee)}),T(A,K)};$(kn,A=>{u(Vt)?u(n).length===0&&u(s)===null&&A(Z,1):A(Ae)})}var Fe=x(kn,2);_i(Fe,17,()=>u(n),jn,(A,K,Re)=>{var Se=b9(),Ne=C(Se);{var Le=st=>{var Ue=f9(),Ee=C(Ue);G(()=>q(Ee,u(K).content)),T(st,Ue)},re=st=>{const Ue=ot(()=>Oe(u(K).content)),Ee=ot(()=>Rt(u(Ue)));var Tt=v9(),We=_t(Tt);{var H=ut=>{var ye=VD();_i(ye,21,()=>u(K).toolEvents,jn,(Dt,ht)=>{var ge=Fs(),yt=_t(ge);{var Xe=le=>{var _e=BD(),Je=x(C(_e)),zt=C(Je);G(fe=>q(zt,fe),[()=>u(ht).name.replace(/_/g," ")]),T(le,_e)},De=le=>{var _e=zD(),Je=x(C(_e)),zt=C(Je);G(fe=>q(zt,fe),[()=>u(ht).name.replace(/_/g," ")]),T(le,_e)};$(yt,le=>{u(ht).type==="tool_call"?le(Xe):le(De,-1)})}T(Dt,ge)}),T(ut,ye)};$(We,ut=>{var ye;(ye=u(K).toolEvents)!=null&&ye.length&&ut(H)})}var Q=x(We,2),ke=C(Q);_i(ke,17,()=>u(Ue),jn,(ut,ye,Dt)=>{var ht=Fs(),ge=_t(ht);{var yt=De=>{var le=jD();jl(le,()=>Sn(u(ye).text),!0),T(De,le)},Xe=De=>{const le=ot(()=>`${Re}:${Dt}`),_e=ot(()=>St(u(ye).text)),Je=ot(()=>u(p).has(u(le))),zt=ot(()=>u(ye).lang==="filter");var fe=m9(),Ge=C(fe),gt=C(Ge),Et=C(gt),Qe=x(gt,2),li=C(Qe),Yt=x(Ge,2);let Gn;var $i=C(Yt),si=C($i);jl(si,()=>Ii(u(ye).text,u(ye).lang??""),!0);var qt=x($i,2);{var _n=oi=>{var On=p9(),Yi=C(On);G(()=>q(Yi,u(Je)?"▲ collapse":"▼ expand")),te("click",On,()=>ri(u(le))),T(oi,On)};$(qt,oi=>{u(_e)&&oi(_n)})}G(()=>{q(Et,u(zt)?"filter":u(ye).lang),Gn=jt(Yt,1,"code-body svelte-1twuiul",null,Gn,{collapsed:u(_e)&&!u(Je)})}),te("click",li,()=>Nn(u(ye).text)),T(De,fe)};$(ge,De=>{u(ye).type==="text"?De(yt):De(Xe,-1)})}T(ut,ht)});var Ze=x(ke,2);{var nt=ut=>{var ye=_9(),Dt=C(ye),ht=C(Dt);G(ge=>q(ht,ge),[()=>Qt(u(Ee))]),te("click",Dt,()=>e.onApplyView(u(Ee))),T(ut,ye)},rt=ot(()=>Si(u(Ee))&&e.onApplyView);$(Ze,ut=>{u(rt)&&ut(nt)})}T(st,Tt)};$(Ne,st=>{u(K).role==="user"?st(Le):st(re,-1)})}G(()=>jt(Se,1,`message ${u(K).role??""}`,"svelte-1twuiul")),T(A,Se)});var vt=x(Fe,2);{var It=A=>{var K=VD();_i(K,21,()=>u(ve),jn,(Re,Se)=>{var Ne=Fs(),Le=_t(Ne);{var re=Ue=>{var Ee=BD(),Tt=x(C(Ee)),We=C(Tt);G(H=>q(We,H),[()=>u(Se).name.replace(/_/g," ")]),T(Ue,Ee)},st=Ue=>{var Ee=zD(),Tt=x(C(Ee)),We=C(Tt);G(H=>q(We,H),[()=>u(Se).name.replace(/_/g," ")]),T(Ue,Ee)};$(Le,Ue=>{u(Se).type==="tool_call"?Ue(re):Ue(st,-1)})}T(Re,Ne)}),T(A,K)};$(vt,A=>{u(ve).length>0&&A(It)})}var Nt=x(vt,2);{var O=A=>{var K=y9(),Re=C(K),Se=C(Re),Ne=C(Se);G(()=>q(Ne,N[u(P)])),T(A,K)};$(Nt,A=>{u(a)&&u(s)===null&&u(ve).length===0&&A(O)})}var se=x(Nt,2);{var be=A=>{var K=S9(),Re=C(K);_i(Re,21,()=>at(u(s)),jn,(Se,Ne)=>{var Le=Fs(),re=_t(Le);{var st=Ee=>{var Tt=jD();jl(Tt,()=>Sn(u(Ne).text),!0),T(Ee,Tt)},Ue=Ee=>{var Tt=w9(),We=C(Tt),H=C(We),Q=C(H),ke=x(We,2),Ze=C(ke);jl(Ze,()=>Ii(u(Ne).text,u(Ne).lang??""),!0),G(()=>q(Q,u(Ne).lang)),T(Ee,Tt)};$(re,Ee=>{u(Ne).type==="text"?Ee(st):Ee(Ue,-1)})}T(Se,Le)}),T(A,K)};$(se,A=>{u(s)!==null&&A(be)})}bs(on,A=>mt=A,()=>mt);var j=x(on,2);{var pe=A=>{var K=C9(),Re=C(K);G(()=>q(Re,u(c))),T(A,K)};$(j,A=>{u(c)&&A(pe)})}var qe=x(j,2),xe=C(qe),Te=C(xe),Ie=x(xe,2),bt=C(Ie),ct=x(Ie,2),Me=C(ct),Wt=x(ct,2),ni=C(Wt),Gt=x(qe,2),$t=C(Gt);{var ii=A=>{var K=x9();let Re;var Se=x(C(K),2),Ne=C(Se),Le=x(Se,2),re=C(Le);G(()=>{Re=jt(K,1,"file-chip svelte-1twuiul",null,Re,{inactive:!u(ue)}),q(Ne,t().id),Hn(Le,"title",u(ue)?"Remove from context":"Re-add to context"),q(re,u(ue)?"×":"+")}),te("click",Le,()=>k(ue,!u(ue))),T(A,K)};$($t,A=>{t()&&A(ii)})}var J=x($t,2);_i(J,17,()=>u(X),jn,(A,K,Re)=>{const Se=ot(()=>Bn(u(K).name));var Ne=L9(),Le=C(Ne),re=C(Le),st=x(Le,2),Ue=C(st),Ee=x(st,2);G((Tt,We)=>{jt(Le,1,`badge badge-${Tt??""}`,"svelte-1twuiul"),q(re,We),q(Ue,u(K).name)},[()=>u(Se).toLowerCase(),()=>Zi(u(Se))]),te("click",Ee,()=>fn(Re)),T(A,Ne)});var me=x(J,2),$e=x(me,2);bs($e,A=>Ve=A,()=>Ve);var it=x(Gt,2);let Ct;var je=C(it);let Ye;var Xt=C(je);bs(Xt,A=>At=A,()=>At);var ai=x(je,2);{var ei=A=>{var K=k9();te("click",K,Ln),T(A,K)},Vi=A=>{var K=I9();G(Re=>K.disabled=Re,[()=>!u(r).trim()||!u(Vt)]),te("click",K,xn),T(A,K)};$(ai,A=>{u(a)?A(ei):A(Vi,-1)})}var In=x(it,2);{var Fi=A=>{var K=M9(),Re=C(K),Se=C(Re),Ne=x(Re,2);{var Le=Ee=>{var Tt=E9();_i(Tt,21,()=>u(g),jn,(We,H)=>{var Q=D9(),ke=C(Q),Ze={};G(()=>{q(ke,u(H)),Ze!==(Ze=u(H))&&(Q.value=(Q.__value=u(H))??"")}),T(We,Q)}),G(()=>Tt.disabled=u(a)),_a(Tt,()=>u(f),We=>k(f,We)),T(Ee,Tt)},re=Ee=>{var Tt=P9(),We=C(Tt);G(()=>q(We,u(f)||u(h).model)),T(Ee,Tt)};$(Ne,Ee=>{u(g).length>0?Ee(Le):Ee(re,-1)})}var st=x(Ne,2);{var Ue=Ee=>{var Tt=T9();te("click",Tt,cn),T(Ee,Tt)};$(st,Ee=>{u(h).provider==="ollama"&&Ee(Ue)})}G(()=>q(Se,u(h).provider)),T(A,K)};$(In,A=>{u(Vt)&&u(h)&&A(Fi)})}var ti=x(Li,2);{var Hi=A=>{var K=j9(),Re=C(K),Se=C(Re),Ne=C(Se),Le=C(Ne),re=x(Ne,2),st=x(Se,2),Ue=C(st);{var Ee=H=>{var Q=N9();T(H,Q)},Tt=H=>{var Q=R9(),ke=C(Q);G(()=>q(ke,u(S))),T(H,Q)},We=H=>{var Q=V9(),ke=C(Q);{var Ze=De=>{var le=A9(),_e=x(_t(le)),Je=C(_e);G(()=>q(Je,u(_).version)),T(De,le)};$(ke,De=>{u(_).version&&De(Ze)})}var nt=x(ke,2);{var rt=De=>{var le=O9(),_e=x(_t(le)),Je=C(_e);G(()=>q(Je,u(_).details.family)),T(De,le)};$(nt,De=>{var le;(le=u(_).details)!=null&&le.family&&De(rt)})}var ut=x(nt,2);{var ye=De=>{var le=F9(),_e=x(_t(le)),Je=C(_e);G(()=>q(Je,u(_).details.parameter_size)),T(De,le)};$(ut,De=>{var le;(le=u(_).details)!=null&&le.parameter_size&&De(ye)})}var Dt=x(ut,2);{var ht=De=>{var le=H9(),_e=x(_t(le)),Je=C(_e);G(()=>q(Je,u(_).details.quantization_level)),T(De,le)};$(Dt,De=>{var le;(le=u(_).details)!=null&&le.quantization_level&&De(ht)})}var ge=x(Dt,2);{var yt=De=>{var le=B9(),_e=x(_t(le),2);_i(_e,21,()=>u(_).running,jn,(Je,zt)=>{var fe=W9(),Ge=C(fe);G(gt=>q(Ge,`${u(zt).name??""} · ${gt??""} VRAM`),[()=>Ri(u(zt).size_vram)]),T(Je,fe)}),T(De,le)},Xe=De=>{var le=z9();T(De,le)};$(ge,De=>{u(_).running&&u(_).running.length>0?De(yt):u(_).running!==null&&De(Xe,1)})}T(H,Q)};$(Ue,H=>{u(w)?H(Ee):u(S)?H(Tt,1):u(_)&&H(We,2)})}G(()=>{var H;return q(Le,`Ollama · ${(u(f)||((H=u(h))==null?void 0:H.model))??""}`)}),te("click",K,()=>k(v,!1)),te("click",Re,H=>H.stopPropagation()),te("click",re,()=>k(v,!1)),T(A,K)};$(ti,A=>{u(v)&&A(Hi)})}G(A=>{q(ni,A),Ct=jt(it,1,"input-row svelte-1twuiul",null,Ct,{"drag-over":u(Pe)}),Ye=jt(je,1,"textarea-wrap svelte-1twuiul",null,Ye,{loading:u(a)}),Hn(Xt,"placeholder",u(Vt)?"Ask anything… (Enter to send, Shift+Enter for newline, drag & drop files to add context)":"AI not configured"),Xt.disabled=u(a)||!u(Vt)},[()=>Ri(u(Jt))]),As(Te,()=>u(V),A=>k(V,A)),As(bt,()=>u(F),A=>k(F,A)),As(Me,()=>u(Y),A=>k(Y,A)),te("click",me,nn),te("change",$e,pn),os("dragover",it,Cn),os("dragleave",it,zn),os("drop",it,Rn),te("keydown",Xt,Xi),Mi(Xt,()=>u(r),A=>k(r,A)),T(o,xi),Ao()}Cr(["click","change","keydown"]);var q9=R('<div class="me svelte-1pxdb1"></div>');function Zw(o,e){Ro(e,!0);let t=cg(e,"value",15,""),i=cg(e,"language",3,"javascript"),n,s,r=!1;xr(()=>{const c=i()==="json"?{formatOnPaste:!0,autoIndent:"full"}:{};s=tr.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())})}),yy(()=>s==null?void 0:s.dispose()),Vn(()=>{!s||s.getValue()===t()||(r=!0,s.setValue(t()),r=!1)});var a=q9();bs(a,c=>n=c,()=>n),T(o,a),Ao()}var K9=R('<!> <div class="welcome svelte-rrt0o"><div class="welcome-inner svelte-rrt0o"><div class="welcome-logo svelte-rrt0o">db</div> <p class="welcome-sub svelte-rrt0o">sheDB — embedded JSON document store with MapReduce views</p> <div class="welcome-hint svelte-rrt0o"><strong>In scripts:</strong> use <code class="svelte-rrt0o">she.db.get(id)</code>, <code class="svelte-rrt0o">she.db.set(id, doc)</code>, <code class="svelte-rrt0o">she.db.extend(id, partial)</code>, <code class="svelte-rrt0o">she.db.sub(pattern, cb)</code>.<br/> <strong>Views:</strong> <code class="svelte-rrt0o">this</code> = current document — call <code class="svelte-rrt0o">emit(value)</code> to add to result.</div> <div class="welcome-links svelte-rrt0o"><a href="https://github.com/hobbyquaker/she/blob/main/doc/db/README.md" target="_blank" rel="noopener" class="svelte-rrt0o">sheDB docs</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she/blob/main/doc/db/view-examples.md" target="_blank" rel="noopener" class="svelte-rrt0o">View examples</a> <span class="svelte-rrt0o">·</span> <a href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" class="svelte-rrt0o">GitHub</a></div></div></div>',1),G9=R('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><line x1="5.5" y1="5" x2="4" y2="2.5"></line><line x1="10.5" y1="5" x2="12" y2="2.5"></line><path d="M3 11 V7 A5 3.5 0 0 0 13 7 V11 Z" stroke-linejoin="round"></path><circle cx="6" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle><circle cx="10" cy="8.2" r="0.7" fill="currentColor" stroke="none"></circle></svg> AI</button>'),UD=R('<div class="form-error svelte-rrt0o"> </div>'),Z9=R('<div class="new-item-form svelte-rrt0o"><input placeholder="device/lamp1" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),$D=R("<li> </li>"),qD=R('<div class="error-bar svelte-rrt0o"> </div>'),KD=R('<div class="loading svelte-rrt0o">Loading…</div>'),X9=R('<div class="monaco-doc-wrap svelte-rrt0o"><!></div>'),Y9=R('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),J9=R('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ Doc</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main></div>'),Q9=R('<div class="new-item-form svelte-rrt0o"><input placeholder="myView" class="svelte-rrt0o"/> <button class="svelte-rrt0o">Create</button></div> <!>',1),eZ=R('<label class="opt-check svelte-rrt0o"><input type="checkbox" class="svelte-rrt0o"/> <span class="checkmark svelte-rrt0o"></span> Retain <span class="section-hint svelte-rrt0o">— send as retained MQTT message</span></label>'),tZ=R('<span class="badge-error svelte-rrt0o">error</span>'),iZ=R('<span class="badge-ok svelte-rrt0o"> </span>'),nZ=R('<pre class="result-error svelte-rrt0o"> </pre>'),sZ=R('<pre class="result-json svelte-rrt0o"> </pre>'),oZ=R('<div class="view-result svelte-rrt0o"><div class="result-header svelte-rrt0o">Result <!></div> <!></div>'),rZ=R('<div class="view-sections svelte-rrt0o"><div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Description <span class="section-hint svelte-rrt0o">— optional, shown in sidebar</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="(optional description)"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Filter <span class="section-hint svelte-rrt0o">— MQTT wildcard, optional</span></div> <div class="section-body svelte-rrt0o"><input class="filter-input svelte-rrt0o" placeholder="#"/></div></div> <div class="view-section svelte-rrt0o"><div class="section-title svelte-rrt0o">Map <span class="section-hint svelte-rrt0o">— <code>this</code> = document · 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>'),aZ=R('<div class="editor-toolbar svelte-rrt0o"><span class="editor-title svelte-rrt0o"> </span> <button class="svelte-rrt0o">Save</button> <button title="Re-run view" class="svelte-rrt0o">Refresh</button> <button class="btn-danger svelte-rrt0o">Delete</button></div> <!> <!>',1),lZ=R('<div class="chat-resize-handle svelte-rrt0o" role="separator"></div> <div class="chat-pane svelte-rrt0o"><!></div>',1),cZ=R('<div class="panel svelte-rrt0o"><aside class="sidebar svelte-rrt0o"><div class="toolbar svelte-rrt0o"><button class="svelte-rrt0o">+ View</button></div> <!> <div class="sidebar-search svelte-rrt0o"><input type="search" placeholder="Filter…" class="svelte-rrt0o"/></div> <ul class="flat-list svelte-rrt0o"></ul></aside> <div class="resize-handle svelte-rrt0o" role="separator"></div> <main class="editor-area svelte-rrt0o"><!></main> <!></div>'),dZ=R('<div class="db-root svelte-rrt0o" role="presentation"><div class="panel-tabs svelte-rrt0o"><button>Documents</button> <button>Views</button> <!></div> <!></div>');function hZ(o,e){Ro(e,!0);const t=Ae=>{var Z=K9(),Fe=_t(Z);bs(Hg(Fe,{}),vt=>Zi=vt,()=>Zi),T(Ae,Z)};let i=B(wi([])),n=B(null),s=B("{}"),r=B(!1),a=B(null);const c="she-db-selected-view";let h=B(wi([])),g=B(wi(localStorage.getItem(c))),f=B("#"),p=B("// emit(this.someProperty)"),v=B(""),_=B(""),w=B(!1),S=B(!1),D=B(null),P=B(!1),N=B(null),V=B("she/db/view/");const F="she-db-panel";let Y=B(wi(localStorage.getItem(F)??"docs")),X=B(""),ue=B(!1),Pe=B(null),Ve=B(""),ve=B(!1),tt=B(null);const At="she-db-sidebar-width";let mt=B(wi(parseInt(localStorage.getItem(At)??"220",10))),hi=!1,Vt=0,Jt=0;const he="she-db-chat-width",kt="she-db-chat-open";let Oe=B(localStorage.getItem(kt)==="true"),at=B(wi(parseInt(localStorage.getItem(he)??"320",10))),Rt=!1,Si=0,Qt=0;const Ht=ot(()=>u(g)?{id:u(g),filter:u(f),map:u(p),reduce:u(v)}:null);function St(Ae){Ae.filter!==void 0&&k(f,Ae.filter,!0),Ae.map!==void 0&&k(p,Ae.map,!0),Ae.reduce!==void 0&&k(v,Ae.reduce,!0)}Vn(()=>{localStorage.setItem(kt,String(u(Oe)))}),Vn(()=>{localStorage.setItem(F,u(Y))}),Vn(()=>{u(g)?localStorage.setItem(c,u(g)):localStorage.removeItem(c)});function ri(Ae){hi=!0,Vt=Ae.clientX,Jt=u(mt),Ae.preventDefault()}function Ii(Ae){hi&&k(mt,Math.max(140,Math.min(500,Jt+Ae.clientX-Vt)),!0),Rt&&k(at,Math.max(240,Math.min(600,Qt-(Ae.clientX-Si))),!0)}function Sn(){hi&&(hi=!1,localStorage.setItem(At,String(u(mt)))),Rt&&(Rt=!1,localStorage.setItem(he,String(u(at))))}function ln(Ae){Rt=!0,Si=Ae.clientX,Qt=u(at),Ae.preventDefault()}async function Nn(){try{k(i,await cR(),!0)}catch{}}async function cn(){try{k(h,await dR(),!0)}catch{}}async function Ri(Ae){k(n,Ae,!0),k(a,null),k(r,!0);try{const Z=await o8(Ae);k(s,JSON.stringify(Z,null,2),!0)}catch(Z){k(a,Z instanceof Error?Z.message:String(Z),!0)}finally{k(r,!1)}}async function Bn(){if(u(n)){k(a,null);try{const Ae=JSON.parse(u(s));await pD(u(n),Ae)}catch(Ae){k(a,Ae instanceof Error?Ae.message:String(Ae),!0)}}}let Zi;async function fn(){if(u(n)&&await Zi.show(`Delete document "${u(n)}"?`,{confirm:"Delete",danger:!0}))try{await r8(u(n)),k(n,null),k(s,"{}")}catch(Ae){k(a,Ae instanceof Error?Ae.message:String(Ae),!0)}}async function nn(){const Ae=u(X).trim();if(Ae){k(Pe,null);try{await pD(Ae,{}),k(ue,!1),k(X,""),await Ri(Ae)}catch(Z){k(Pe,Z instanceof Error?Z.message:String(Z),!0)}}}async function Ui(Ae){k(g,Ae,!0),k(N,null),k(P,!0),k(D,null);try{const Z=await a8(Ae);k(f,Z.filter??"",!0),k(p,Z.map,!0),k(v,Z.reduce??"",!0),k(_,Z.description??"",!0),k(w,Z.mqttpub??!1,!0),k(S,Z.retain??!1,!0),k(D,await Kw(Ae).catch(()=>null),!0)}catch(Z){k(N,Z instanceof Error?Z.message:String(Z),!0)}finally{k(P,!1)}}async function pn(){if(u(g)){k(N,null);try{const Ae={map:u(p)};u(f).trim()&&(Ae.filter=u(f).trim()),u(v).trim()&&(Ae.reduce=u(v).trim()),u(_).trim()&&(Ae.description=u(_).trim()),u(w)&&(Ae.mqttpub=!0),u(S)&&(Ae.retain=!0),await mD(u(g),Ae)}catch(Ae){k(N,Ae instanceof Error?Ae.message:String(Ae),!0)}}}async function Rn(){if(u(g))try{k(D,await Kw(u(g)),!0)}catch(Ae){k(N,Ae instanceof Error?Ae.message:String(Ae),!0)}}async function Cn(){if(u(g)&&await Zi.show(`Delete view "${u(g)}"?`,{confirm:"Delete",danger:!0}))try{await l8(u(g)),k(g,null),k(f,""),k(p,"// emit(this.someProperty)"),k(v,""),k(_,""),k(w,!1),k(S,!1),k(D,null)}catch(Ae){k(N,Ae instanceof Error?Ae.message:String(Ae),!0)}}async function zn(){if(!u(Ve).trim())return;const Ae=u(Ve).trim();k(tt,null);try{await mD(Ae,{map:"// emit(this.someProperty)"}),k(ve,!1),k(Ve,""),await cn(),await Ui(Ae)}catch(Z){k(tt,Z instanceof Error?Z.message:String(Z),!0)}}let xn=B(""),Ln=B(""),Xi=ot(()=>[...u(i)].filter(Ae=>!u(xn)||Ae.toLowerCase().includes(u(xn).toLowerCase())).sort()),Ke=ot(()=>[...u(h)].filter(Ae=>!u(Ln)||Ae.toLowerCase().includes(u(Ln).toLowerCase())).sort());xr(()=>{Nn(),cn().then(()=>{u(g)&&u(h).includes(u(g))?Ui(u(g)):k(g,null)}),iL().then(It=>{const Nt=It.dbPrefix||"she/db/",O=Nt.endsWith("/")?Nt:Nt+"/";k(V,O+"view/")}).catch(()=>{});const Ae=Gl("db:ids",It=>{k(i,It.ids??[],!0)}),Z=Gl("db:viewIds",It=>{k(h,It.ids??[],!0)}),Fe=Gl("db:change",async It=>{const Nt=It.id;u(n)===Nt&&(It.doc===null?(k(n,null),k(s,"{}")):k(s,JSON.stringify(It.doc,null,2),!0))}),vt=Gl("db:viewUpdate",async It=>{const Nt=It.id;u(g)===Nt&&k(D,await Kw(Nt).catch(()=>null),!0)});return()=>{Ae(),Z(),Fe(),vt()}});var Ot=dZ(),gi=C(Ot),xi=C(gi);let Li;var sn=x(xi,2);let mn;var Kn=x(sn,2);{var dn=Ae=>{var Z=G9();let Fe;G(()=>{Fe=jt(Z,1,"ai-toggle svelte-rrt0o",null,Fe,{"ai-open":u(Oe)}),Hn(Z,"title",u(Oe)?"Close AI assistant":"Open AI assistant")}),te("click",Z,()=>k(Oe,!u(Oe))),T(Ae,Z)};$(Kn,Ae=>{u(Y)==="views"&&Ae(dn)})}var An=x(gi,2);{var on=Ae=>{var Z=J9(),Fe=C(Z);let vt;var It=C(Fe),Nt=C(It),O=x(It,2);{var se=ct=>{var Me=Z9(),Wt=_t(Me),ni=C(Wt),Gt=x(ni,2),$t=x(Wt,2);{var ii=J=>{var me=UD(),$e=C(me);G(()=>q($e,u(Pe))),T(J,me)};$($t,J=>{u(Pe)&&J(ii)})}te("keydown",ni,J=>J.key==="Enter"&&nn()),Mi(ni,()=>u(X),J=>k(X,J)),te("click",Gt,nn),T(ct,Me)};$(O,ct=>{u(ue)&&ct(se)})}var be=x(O,2),j=C(be),pe=x(be,2);_i(pe,20,()=>u(Xi),ct=>ct,(ct,Me)=>{var Wt=$D();let ni;var Gt=C(Wt);G(()=>{ni=jt(Wt,1,"flat-item svelte-rrt0o",null,ni,{"active-item":u(n)===Me}),q(Gt,Me)}),te("click",Wt,()=>Ri(Me)),T(ct,Wt)});var qe=x(Fe,2),xe=x(qe,2),Te=C(xe);{var Ie=ct=>{var Me=Y9(),Wt=_t(Me),ni=C(Wt),Gt=C(ni),$t=x(ni,2),ii=x($t,2),J=x(Wt,2);{var me=je=>{var Ye=qD(),Xt=C(Ye);G(()=>q(Xt,u(a))),T(je,Ye)};$(J,je=>{u(a)&&je(me)})}var $e=x(J,2);{var it=je=>{var Ye=KD();T(je,Ye)},Ct=je=>{var Ye=X9(),Xt=C(Ye);Zw(Xt,{language:"json",get value(){return u(s)},set value(ai){k(s,ai,!0)}}),T(je,Ye)};$($e,je=>{u(r)?je(it):je(Ct,-1)})}G(()=>q(Gt,u(n))),te("click",$t,Bn),te("click",ii,fn),T(ct,Me)},bt=ct=>{t(ct)};$(Te,ct=>{u(n)?ct(Ie):ct(bt,-1)})}G(()=>vt=Ko(Fe,"",vt,{width:`${u(mt)??""}px`})),te("click",Nt,()=>{k(ue,!u(ue)),k(Pe,null)}),Mi(j,()=>u(xn),ct=>k(xn,ct)),te("mousedown",qe,ri),T(Ae,Z)},kn=Ae=>{var Z=cZ(),Fe=C(Z);let vt;var It=C(Fe),Nt=C(It),O=x(It,2);{var se=Wt=>{var ni=Q9(),Gt=_t(ni),$t=C(Gt),ii=x($t,2),J=x(Gt,2);{var me=$e=>{var it=UD(),Ct=C(it);G(()=>q(Ct,u(tt))),T($e,it)};$(J,$e=>{u(tt)&&$e(me)})}te("keydown",$t,$e=>$e.key==="Enter"&&zn()),Mi($t,()=>u(Ve),$e=>k(Ve,$e)),te("click",ii,zn),T(Wt,ni)};$(O,Wt=>{u(ve)&&Wt(se)})}var be=x(O,2),j=C(be),pe=x(be,2);_i(pe,20,()=>u(Ke),Wt=>Wt,(Wt,ni)=>{var Gt=$D();let $t;var ii=C(Gt);G(()=>{$t=jt(Gt,1,"flat-item svelte-rrt0o",null,$t,{"active-item":u(g)===ni}),q(ii,ni)}),te("click",Gt,()=>Ui(ni)),T(Wt,Gt)});var qe=x(Fe,2),xe=x(qe,2),Te=C(xe);{var Ie=Wt=>{var ni=aZ(),Gt=_t(ni),$t=C(Gt),ii=C($t),J=x($t,2),me=x(J,2),$e=x(me,2),it=x(Gt,2);{var Ct=ai=>{var ei=qD(),Vi=C(ei);G(()=>q(Vi,u(N))),T(ai,ei)};$(it,ai=>{u(N)&&ai(Ct)})}var je=x(it,2);{var Ye=ai=>{var ei=KD();T(ai,ei)},Xt=ai=>{var ei=rZ(),Vi=C(ei),In=x(C(Vi),2),Fi=C(In),ti=x(Vi,2),Hi=x(C(ti),2),A=C(Hi),K=x(ti,2),Re=x(C(K),2),Se=C(Re);Zw(Se,{language:"javascript",get value(){return u(p)},set value(rt){k(p,rt,!0)}});var Ne=x(K,2),Le=x(C(Ne),2),re=C(Le);Zw(re,{language:"javascript",get value(){return u(v)},set value(rt){k(v,rt,!0)}});var st=x(Ne,2),Ue=C(st),Ee=C(Ue),Tt=x(Ee,4),We=x(C(Tt)),H=C(We),Q=x(Ue,2);{var ke=rt=>{var ut=eZ(),ye=C(ut);As(ye,()=>u(S),Dt=>k(S,Dt)),T(rt,ut)};$(Q,rt=>{u(w)&&rt(ke)})}var Ze=x(st,2);{var nt=rt=>{var ut=oZ(),ye=C(ut),Dt=x(C(ye));{var ht=le=>{var _e=tZ();T(le,_e)},ge=le=>{var _e=iZ(),Je=C(_e);G(()=>q(Je,`${u(D).length??0??""} items · rev ${u(D)._rev??""}`)),T(le,_e)};$(Dt,le=>{u(D).error?le(ht):le(ge,-1)})}var yt=x(ye,2);{var Xe=le=>{var _e=nZ(),Je=C(_e);G(()=>q(Je,u(D).error)),T(le,_e)},De=le=>{var _e=sZ(),Je=C(_e);G(zt=>q(Je,zt),[()=>JSON.stringify(u(D).result,null,2)]),T(le,_e)};$(yt,le=>{u(D).error?le(Xe):le(De,-1)})}T(rt,ut)};$(Ze,rt=>{u(D)&&rt(nt)})}G(()=>q(H,`${u(V)??""}${u(g)??""} on every update`)),Mi(Fi,()=>u(_),rt=>k(_,rt)),Mi(A,()=>u(f),rt=>k(f,rt)),As(Ee,()=>u(w),rt=>k(w,rt)),T(ai,ei)};$(je,ai=>{u(P)?ai(Ye):ai(Xt,-1)})}G(()=>q(ii,u(g))),te("click",J,pn),te("click",me,Rn),te("click",$e,Cn),T(Wt,ni)},bt=Wt=>{t(Wt)};$(Te,Wt=>{u(g)?Wt(Ie):Wt(bt,-1)})}var ct=x(xe,2);{var Me=Wt=>{var ni=lZ(),Gt=_t(ni),$t=x(Gt,2);let ii;var J=C($t);$9(J,{get currentView(){return u(Ht)},onApplyView:St}),G(()=>ii=Ko($t,"",ii,{width:`${u(at)??""}px`})),te("mousedown",Gt,ln),T(Wt,ni)};$(ct,Wt=>{u(Oe)&&Wt(Me)})}G(()=>vt=Ko(Fe,"",vt,{width:`${u(mt)??""}px`})),te("click",Nt,()=>{k(ve,!u(ve)),k(tt,null)}),Mi(j,()=>u(Ln),Wt=>k(Ln,Wt)),te("mousedown",qe,ri),T(Ae,Z)};$(An,Ae=>{u(Y)==="docs"?Ae(on):Ae(kn,-1)})}G(()=>{Li=jt(xi,1,"svelte-rrt0o",null,Li,{active:u(Y)==="docs"}),mn=jt(sn,1,"svelte-rrt0o",null,mn,{active:u(Y)==="views"})}),te("mousemove",Ot,Ii),te("mouseup",Ot,Sn),os("mouseleave",Ot,Sn),te("click",xi,()=>k(Y,"docs")),te("click",sn,()=>k(Y,"views")),T(o,Ot),Ao()}Cr(["mousemove","mouseup","click","keydown","mousedown"]);var uZ=R('<label class="svelte-1ua3isv">Passcode <input type="number" placeholder="20202021" class="svelte-1ua3isv"/></label> <label class="svelte-1ua3isv">Discriminator (optional) <input type="number" placeholder="3840" class="svelte-1ua3isv"/></label>',1),gZ=R('<label class="svelte-1ua3isv">Pairing Code / QR <input type="text" placeholder="MT:..." class="svelte-1ua3isv"/></label>'),GD=R('<p class="err svelte-1ua3isv"> </p>'),fZ=R('<div class="wizard svelte-1ua3isv"><div class="wizard-tabs svelte-1ua3isv"><button>Passcode</button> <button>QR / Code</button></div> <!> <label class="svelte-1ua3isv">IP Address (optional, bypasses mDNS) <input type="text" placeholder="192.168.1.100 or 192.168.1.100:5540" class="svelte-1ua3isv"/></label> <!> <button class="commission-btn svelte-1ua3isv"> </button></div>'),pZ=R('<span class="device-name svelte-1ua3isv"> </span> <span class="device-nodeid svelte-1ua3isv"> </span>',1),mZ=R('<span class="device-name svelte-1ua3isv"> </span>'),_Z=R('<li><button class="device-select-btn svelte-1ua3isv"><span></span> <span class="device-label svelte-1ua3isv"><!></span></button> <button class="unpair-btn svelte-1ua3isv" title="Unpair">✕</button></li>'),vZ=R('<li class="empty svelte-1ua3isv">No paired devices</li>'),bZ=R('<p class="info svelte-1ua3isv">Loading…</p>'),yZ=R('<p class="device-subtitle svelte-1ua3isv"> </p>'),wZ=R('<span class="ep-chip svelte-1ua3isv"> </span>'),SZ=R('<span class="attr-id svelte-1ua3isv"> </span>'),CZ=R('<button class="attr-action-btn svelte-1ua3isv"> </button>'),xZ=R('<div class="attr-actions svelte-1ua3isv"></div>'),LZ=R('<span class="cmd-sep svelte-1ua3isv">,</span>'),kZ=R('<span class="cmd-name svelte-1ua3isv"> </span><span class="cmd-id svelte-1ua3isv"> </span>',1),IZ=R('<span class="cmd-id svelte-1ua3isv"> </span>'),DZ=R("<!> <!>",1),EZ=R('<span class="cmd-list svelte-1ua3isv"></span>'),PZ=R(' <span class="cmd-id svelte-1ua3isv"> </span>',1),TZ=R('<tr class="svelte-1ua3isv"><td class="svelte-1ua3isv"><!></td><td class="svelte-1ua3isv"> </td></tr>'),MZ=R('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"><th class="svelte-1ua3isv">deviceType</th><th class="svelte-1ua3isv">revision</th></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),NZ=R('<th class="svelte-1ua3isv"> </th>'),RZ=R('<td class="svelte-1ua3isv"> </td>'),AZ=R('<tr class="svelte-1ua3isv"></tr>'),OZ=R('<table class="attr-arr-table svelte-1ua3isv"><thead class="svelte-1ua3isv"><tr class="svelte-1ua3isv"></tr></thead><tbody class="svelte-1ua3isv"></tbody></table>'),FZ=R('<tr class="svelte-1ua3isv"><td class="attr-obj-key svelte-1ua3isv"> </td><td class="attr-obj-val svelte-1ua3isv"> </td></tr>'),HZ=R('<table class="attr-obj-table svelte-1ua3isv"><tbody class="svelte-1ua3isv"></tbody></table>'),WZ=R('<a class="attr-link svelte-1ua3isv" target="_blank" rel="noopener noreferrer"> </a>'),BZ=R('<span class="attr-val svelte-1ua3isv"> </span>'),zZ=R('<tr class="svelte-1ua3isv"><td class="attr-name-cell svelte-1ua3isv"><span class="attr-key svelte-1ua3isv"> </span><!></td><td class="attr-actions-cell svelte-1ua3isv"><!></td><td class="attr-val-cell svelte-1ua3isv"><!></td></tr>'),VZ=R('<tr class="cluster-hdr-row svelte-1ua3isv"><td colspan="3" class="cluster-hdr-cell svelte-1ua3isv"> </td></tr> <!>',1),jZ=R('<table class="cluster-table svelte-1ua3isv"><colgroup><col class="col-attr-name svelte-1ua3isv"/><col class="col-attr-actions svelte-1ua3isv"/><col class="col-attr-val"/></colgroup><tbody class="svelte-1ua3isv"></tbody></table>'),UZ=R('<p class="no-clusters svelte-1ua3isv">No clusters</p>'),$Z=R('<details class="svelte-1ua3isv"><summary class="svelte-1ua3isv"> <span class="ep-id svelte-1ua3isv"> </span> <span class="ep-chips svelte-1ua3isv"></span></summary> <!></details>'),qZ=R('<div class="detail-hdr svelte-1ua3isv"><h2 class="svelte-1ua3isv"> </h2> <!> <p class="detail-nodeid svelte-1ua3isv"> </p></div> <!>',1),KZ=R('<p class="info svelte-1ua3isv">Select a device to view its endpoints.</p>'),GZ=R('<span class="stream-badge svelte-1ua3isv"> </span>'),ZZ=R('<span class="stream-empty svelte-1ua3isv">Waiting for events…</span>'),Xw=R(' <span class="e-sub svelte-1ua3isv"> </span>',1),XZ=R('<span class="e-badge e-badge-status svelte-1ua3isv">status</span> <span class="e-node svelte-1ua3isv"> <!></span> <span> </span>',1),YZ=R('<span class="e-badge e-badge-attr svelte-1ua3isv">attr</span> <span class="e-node svelte-1ua3isv"> <!></span> <span class="e-ep svelte-1ua3isv"> <!></span> <span class="e-cluster svelte-1ua3isv"> </span> <span class="e-attr svelte-1ua3isv"> </span> <span class="e-val svelte-1ua3isv"> </span>',1),JZ=R('<div class="er svelte-1ua3isv"><span class="e-ts svelte-1ua3isv"> </span> <!></div>'),QZ=R('<div class="stream-body svelte-1ua3isv"><!></div>'),eX=R('<!> <div class="matter-page svelte-1ua3isv"><div class="matter-main svelte-1ua3isv"><div class="sidebar svelte-1ua3isv"><div class="sidebar-header svelte-1ua3isv"><span class="sidebar-title svelte-1ua3isv">Matter Devices</span> <button class="add-btn svelte-1ua3isv" title="Commission new device">+</button></div> <!> <ul class="device-list svelte-1ua3isv"><!> <!></ul></div> <div class="detail svelte-1ua3isv"><!></div></div> <div class="stream-panel svelte-1ua3isv"><div class="stream-resize svelte-1ua3isv"></div> <div class="stream-hdr-row svelte-1ua3isv"><span class="stream-title svelte-1ua3isv">Matter Events</span> <!> <button class="stream-toggle svelte-1ua3isv" title="Toggle event feed"> </button></div> <!></div></div>',1);function tX(o,e){Ro(e,!0);const t={onOff:{onOff:[{label:"On",command:"on"},{label:"Off",command:"off"},{label:"Toggle",command:"toggle"}]},levelControl:{currentLevel:[{label:"Step ▲",command:"stepWithOnOff",args:{stepMode:0,stepSize:25,transitionTime:5}},{label:"Step ▼",command:"stepWithOnOff",args:{stepMode:1,stepSize:25,transitionTime:5}}]},windowCovering:{currentPositionLiftPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}],currentPositionTiltPercent100ths:[{label:"Open",command:"upOrOpen"},{label:"Close",command:"downOrClose"},{label:"Stop",command:"stopMotion"}]}};async function i(Z,Fe,vt,It,Nt){try{await w8(Z,Fe,vt,It,Nt)}catch(O){console.error("matter command failed",O)}}const n={identify:{0:"identify",1:"triggerEffect"},groups:{0:"addGroup",1:"viewGroup",2:"getGroupMembership",3:"removeGroup",4:"removeAllGroups",5:"addGroupIfIdentifying"},scenes:{0:"addScene",1:"viewScene",2:"removeScene",3:"removeAllScenes",4:"storeScene",5:"recallScene",6:"getSceneMembership",64:"enhancedAddScene",65:"enhancedViewScene",66:"copyScene"},onOff:{0:"off",1:"on",2:"toggle",64:"offWithEffect",65:"onWithRecallGlobalScene",66:"onWithTimedOff"},levelControl:{0:"moveToLevel",1:"move",2:"step",3:"stop",4:"moveToLevelWithOnOff",5:"moveWithOnOff",6:"stepWithOnOff",7:"stopWithOnOff",8:"moveToClosestFrequency"},colorControl:{0:"moveToHue",1:"moveHue",2:"stepHue",3:"moveToSaturation",4:"moveSaturation",5:"stepSaturation",6:"moveToHueAndSaturation",7:"moveToColor",8:"moveColor",9:"stepColor",10:"moveToColorTemperature",64:"enhancedMoveToHue",65:"enhancedMoveHue",66:"enhancedStepHue",67:"enhancedMoveToHueAndSaturation",68:"colorLoopSet",71:"stopMoveStep",75:"moveColorTemperature",76:"stepColorTemperature"},thermostat:{0:"setpointRaiseLower",1:"setWeeklySchedule",2:"getWeeklySchedule",3:"clearWeeklySchedule"},doorLock:{0:"lockDoor",1:"unlockDoor",3:"unlockWithTimeout",11:"setWeekDaySchedule",12:"getWeekDaySchedule",13:"clearWeekDaySchedule",14:"setYearDaySchedule",15:"getYearDaySchedule",16:"clearYearDaySchedule",17:"setHolidaySchedule",18:"getHolidaySchedule",19:"clearHolidaySchedule",26:"setUser",27:"getUser",28:"clearUser",34:"setCredential",36:"getCredential",38:"clearCredential"},windowCovering:{0:"upOrOpen",1:"downOrClose",2:"stopMotion",4:"goToLiftValue",5:"goToLiftPercentage",7:"goToTiltValue",8:"goToTiltPercentage"},fanControl:{0:"step"}};function s(Z,Fe){const vt=n[Z];return Fe.map(It=>{const Nt=typeof It=="number"?It:Number(It);return{id:Nt,name:(vt==null?void 0:vt[Nt])??null}})}const r={10:"Door Lock",11:"Door Lock Controller",14:"Aggregator",15:"Generic Switch",17:"On/Off Plug-In Unit",18:"Dimmable Plug-In Unit",19:"Pump",20:"On/Off Light Switch",21:"Dimmer Switch",22:"Color Dimmer Switch",23:"Control Bridge",24:"Pump Controller",256:"On/Off Light",257:"Dimmable Light",268:"Extended Color Light",269:"Color Temperature Light",262:"Light Sensor",263:"Occupancy Sensor",514:"Window Covering",515:"Window Covering Controller",768:"Heating/Cooling Unit",769:"Thermostat",770:"Temperature Sensor",771:"Pressure Sensor",772:"Flow Sensor",773:"Humidity Sensor",774:"On/Off Sensor",2112:"Air Quality Sensor"},a={generatedCommandList:65528,acceptedCommandList:65529,eventList:65530,attributeList:65531,featureMap:65532,clusterRevision:65533},c={descriptor:{deviceTypeList:0,serverList:1,clientList:2,partsList:3,tagList:4},basicInformation:{dataModelRevision:0,vendorName:1,vendorID:2,vendorId:2,productName:3,productID:4,productId:4,nodeLabel:5,location:6,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,localConfigDisabled:16,reachable:17,uniqueID:18,uniqueId:18,capabilityMinima:19,productAppearance:20,specificationVersion:21,maxPathsPerInvoke:22},bridgedDeviceBasicInformation:{vendorName:1,vendorID:2,vendorId:2,productName:3,productId:4,nodeLabel:5,hardwareVersion:7,hardwareVersionString:8,softwareVersion:9,softwareVersionString:10,manufacturingDate:11,partNumber:12,productURL:13,productUrl:13,productLabel:14,serialNumber:15,reachable:17,uniqueID:18,uniqueId:18,productAppearance:20},identify:{identifyTime:0,identifyType:1},groups:{nameSupport:0},onOff:{onOff:0,globalSceneControl:16384,onTime:16385,offWaitTime:16386,startUpOnOff:16387},levelControl:{currentLevel:0,remainingTime:1,minLevel:2,maxLevel:3,currentFrequency:4,minFrequency:5,maxFrequency:6,options:15,onOffTransitionTime:16,onLevel:17,onTransitionTime:18,offTransitionTime:19,defaultMoveRate:20,startUpCurrentLevel:16384},colorControl:{currentHue:0,currentSaturation:1,remainingTime:2,currentX:3,currentY:4,colorTemperatureMireds:7,colorMode:8,options:15,enhancedCurrentHue:16384,enhancedColorMode:16385,colorLoopActive:16386,colorLoopDirection:16387,colorLoopTime:16388,colorCapabilities:16394,colorTempPhysicalMinMireds:16395,colorTempPhysicalMaxMireds:16396,coupleColorTempToLevelMinMireds:16397,startUpColorTemperatureMireds:16400},thermostat:{localTemperature:0,outdoorTemperature:1,occupancy:2,absMinHeatSetpointLimit:3,absMaxHeatSetpointLimit:4,absMinCoolSetpointLimit:5,absMaxCoolSetpointLimit:6,piCoolingDemand:7,piHeatingDemand:8,localTemperatureCalibration:16,occupiedCoolingSetpoint:17,occupiedHeatingSetpoint:18,unoccupiedCoolingSetpoint:19,unoccupiedHeatingSetpoint:20,minHeatSetpointLimit:21,maxHeatSetpointLimit:22,minCoolSetpointLimit:23,maxCoolSetpointLimit:24,minSetpointDeadBand:25,remoteSensing:26,controlSequenceOfOperation:27,systemMode:28,thermostatRunningMode:30,startOfWeek:32,numberOfWeeklyTransitions:33,numberOfDailyTransitions:34,temperatureSetpointHold:35,temperatureSetpointHoldDuration:36,thermostatProgrammingOperationMode:37,thermostatRunningState:41,setpointChangeSource:48,setpointChangeAmount:49,setpointChangeSourceTimestamp:50,occupiedSetback:52,unoccupiedSetback:55,emergencyHeatDelta:58},windowCovering:{type:0,physicalClosedLimitLift:1,physicalClosedLimitTilt:2,currentPositionLift:3,currentPositionTilt:4,numberOfActuationsLift:5,numberOfActuationsTilt:6,configStatus:7,currentPositionLiftPercentage:8,currentPositionTiltPercentage:9,operationalStatus:10,targetPositionLiftPercent100ths:11,targetPositionTiltPercent100ths:12,endProductType:13,currentPositionLiftPercent100ths:14,currentPositionTiltPercent100ths:15,installedOpenLimitLift:16,installedClosedLimitLift:17,installedOpenLimitTilt:18,installedClosedLimitTilt:19,mode:23,safetyStatus:26},doorLock:{lockState:0,lockType:1,actuatorEnabled:2,doorState:3,numberOfTotalUsersSupported:17,numberOfPINUsersSupported:18,maxPINCodeLength:23,minPINCodeLength:24,language:33,autoRelockTime:35,soundVolume:36,operatingMode:37,supportedOperatingModes:38,wrongCodeEntryLimit:48},fanControl:{fanMode:0,fanModeSequence:1,percentSetting:2,percentCurrent:3,speedMax:4,speedSetting:5,speedCurrent:6,rockSupport:7,rockSetting:8,windSupport:9,windSetting:10,airflowDirectionSupport:11,airflowDirection:12},occupancySensing:{occupancy:0,occupancySensorType:1,occupancySensorTypeBitmap:2,holdTime:3,pirOccupiedToUnoccupiedDelay:16,pirUnoccupiedToOccupiedDelay:17},illuminanceMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,lightSensorType:4},temperatureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},pressureMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3,scaledValue:16,minScaledValue:17,maxScaledValue:18,scale:20},flowMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},relativeHumidityMeasurement:{measuredValue:0,minMeasuredValue:1,maxMeasuredValue:2,tolerance:3},powerSource:{status:0,order:1,description:2,batVoltage:11,batPercentRemaining:12,batTimeRemaining:13,batChargeLevel:14,batReplacementNeeded:15,batReplaceability:16,batPresent:17,activeBatFaults:18,batChargeState:26}};function h(Z){return"0x"+Z.toString(16).toUpperCase().padStart(4,"0")}let g=B(wi([])),f=wi(new Map);function p(Z){if(Z==null)return"—";if(typeof Z=="boolean"||typeof Z=="number")return String(Z);if(typeof Z=="string")return Z.length>50?Z.slice(0,47)+"…":Z;const Fe=JSON.stringify(Z);return Fe.length>60?Fe.slice(0,57)+"…":Fe}function v(Z){return Z==null?"—":typeof Z=="boolean"||typeof Z=="number"?String(Z):typeof Z=="string"?Z:JSON.stringify(Z)}function _(Z){return Z!==null&&typeof Z=="object"&&!Array.isArray(Z)}function w(Z){return Array.isArray(Z)&&Z.length>0&&Z.every(_)}function S(Z,Fe){return!!(Fe==="attributeList"||Array.isArray(Z)&&Z.length===0||_(Z)&&Object.keys(Z).length===0)}function D(Z){return new Date(Z).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}const P=500,N=20,V=32;let F=0,Y=B(wi([])),X=B(!0),ue=B(180),Pe=ot(()=>{const Z=Math.max(1,Math.floor((u(ue)-V)/N)+1);return u(Y).slice(0,Z)});function Ve(Z){Z.preventDefault();const Fe=Z.clientY,vt=u(ue);function It(O){k(ue,Math.max(60,Math.min(600,vt+Fe-O.clientY)),!0)}function Nt(){document.removeEventListener("mousemove",It),document.removeEventListener("mouseup",Nt)}document.addEventListener("mousemove",It),document.addEventListener("mouseup",Nt)}let ve=B(null),tt=B(!1),At=B(null),mt=B(!1),hi=B("passcode"),Vt=B(""),Jt=B(""),he=B(""),kt=B(!1),Oe=B(null),at=B("");const Rt="she:matter:selectedNodeId";async function Si(){try{k(g,await hR(),!0);for(const Z of u(g))T_(Z.nodeId).then(Fe=>{f.set(Z.nodeId,Fe)}).catch(()=>{});if(u(g).length>0&&!u(ve)){const Z=localStorage.getItem(Rt),Fe=Z&&u(g).find(vt=>vt.nodeId===Z)?Z:u(g)[0].nodeId;Qt(Fe)}}catch{k(g,[],!0)}}async function Qt(Z){k(tt,!0),k(At,null);try{k(ve,await T_(Z),!0),f.set(Z,u(ve)),localStorage.setItem(Rt,Z)}catch(Fe){k(At,Fe instanceof Error?Fe.message:String(Fe),!0)}finally{k(tt,!1)}}let Ht;async function St(Z){var Fe;if(await Ht.show(`Unpair device ${Z}?`,{confirm:"Unpair",danger:!0}))try{await y8(Z),((Fe=u(ve))==null?void 0:Fe.nodeId)===Z&&k(ve,null),await Si()}catch(vt){k(At,vt instanceof Error?vt.message:String(vt),!0)}}async function ri(){k(kt,!0),k(Oe,null);try{let Z;u(hi)==="passcode"?(Z={passcode:Number(u(Vt))},u(Jt)&&(Z={...Z,discriminator:Number(u(Jt))})):Z={pairingCode:u(he).trim()},u(at).trim()&&(Z={...Z,discoveryAddress:u(at).trim()}),await b8(Z),k(mt,!1),k(Vt,""),k(Jt,""),k(he,""),k(at,""),await Si()}catch(Z){k(Oe,Z instanceof Error?Z.message:String(Z),!0)}finally{k(kt,!1)}}xr(()=>{Si()});const Ii=Gl("matter:deviceList",Z=>{if(!Array.isArray(Z.devices))return;const Fe=Z.devices;for(const vt of Fe)f.has(vt.nodeId)||T_(vt.nodeId).then(It=>{f.set(vt.nodeId,It)}).catch(()=>{});k(g,Fe,!0)}),Sn=Gl("matter:deviceStatus",Z=>{if(Z.nodeId===void 0)return;const Fe=String(Z.nodeId),vt=!!Z.online;k(g,u(g).map(It=>It.nodeId===Fe?{...It,online:vt}:It),!0),k(Y,[{id:F++,kind:"status",nodeId:Fe,online:vt,ts:Date.now()},...u(Y).slice(0,P-1)],!0)}),ln=Gl("matter:attr",Z=>{const Fe=String(Z.nodeId),vt=Z.endpointId,It=String(Z.clusterName),Nt=String(Z.attrName),O=Z.value;if(u(ve)&&u(ve).nodeId===Fe){const be=u(ve).endpoints.find(pe=>pe.endpointId===vt),j=be==null?void 0:be.clusters.find(pe=>pe.name===It);j&&(j.attrs[Nt]=O)}const se=f.get(Fe);if(se){const be=se.endpoints.find(pe=>pe.endpointId===vt),j=be==null?void 0:be.clusters.find(pe=>pe.name===It);j&&(j.attrs[Nt]=O)}k(Y,[{id:F++,kind:"attr",nodeId:Fe,endpointId:vt,clusterName:It,attrName:Nt,value:O,ts:Z.ts??Date.now()},...u(Y).slice(0,P-1)],!0)});yy(()=>{Ii(),Sn(),ln()});var Nn=eX(),cn=_t(Nn);bs(Hg(cn,{}),Z=>Ht=Z,()=>Ht);var Ri=x(cn,2),Bn=C(Ri),Zi=C(Bn),fn=C(Zi),nn=x(C(fn),2),Ui=x(fn,2);{var pn=Z=>{var Fe=fZ(),vt=C(Fe),It=C(vt);let Nt;var O=x(It,2);let se;var be=x(vt,2);{var j=Me=>{var Wt=uZ(),ni=_t(Wt),Gt=x(C(ni)),$t=x(ni,2),ii=x(C($t));Mi(Gt,()=>u(Vt),J=>k(Vt,J)),Mi(ii,()=>u(Jt),J=>k(Jt,J)),T(Me,Wt)},pe=Me=>{var Wt=gZ(),ni=x(C(Wt));Mi(ni,()=>u(he),Gt=>k(he,Gt)),T(Me,Wt)};$(be,Me=>{u(hi)==="passcode"?Me(j):Me(pe,-1)})}var qe=x(be,2),xe=x(C(qe)),Te=x(qe,2);{var Ie=Me=>{var Wt=GD(),ni=C(Wt);G(()=>q(ni,u(Oe))),T(Me,Wt)};$(Te,Me=>{u(Oe)&&Me(Ie)})}var bt=x(Te,2),ct=C(bt);G(()=>{Nt=jt(It,1,"svelte-1ua3isv",null,Nt,{active:u(hi)==="passcode"}),se=jt(O,1,"svelte-1ua3isv",null,se,{active:u(hi)==="pairingCode"}),bt.disabled=u(kt),q(ct,u(kt)?"Commissioning…":"Commission")}),te("click",It,()=>k(hi,"passcode")),te("click",O,()=>k(hi,"pairingCode")),Mi(xe,()=>u(at),Me=>k(at,Me)),te("click",bt,ri),T(Z,Fe)};$(Ui,Z=>{u(mt)&&Z(pn)})}var Rn=x(Ui,2),Cn=C(Rn);_i(Cn,17,()=>u(g),Z=>Z.nodeId,(Z,Fe)=>{var vt=_Z();let It;var Nt=C(vt),O=C(Nt);let se;var be=x(O,2),j=C(be);{var pe=Te=>{var Ie=pZ(),bt=_t(Ie),ct=C(bt),Me=x(bt,2),Wt=C(Me);G(()=>{q(ct,u(Fe).name),q(Wt,`#${u(Fe).nodeId??""}`)}),T(Te,Ie)},qe=Te=>{var Ie=mZ(),bt=C(Ie);G(()=>q(bt,`Node ${u(Fe).nodeId??""}`)),T(Te,Ie)};$(j,Te=>{u(Fe).name?Te(pe):Te(qe,-1)})}var xe=x(Nt,2);G(()=>{var Te;It=jt(vt,1,"svelte-1ua3isv",null,It,{selected:((Te=u(ve))==null?void 0:Te.nodeId)===u(Fe).nodeId}),se=jt(O,1,"status-dot svelte-1ua3isv",null,se,{online:u(Fe).online})}),te("click",Nt,()=>Qt(u(Fe).nodeId)),te("click",xe,()=>St(u(Fe).nodeId)),T(Z,vt)});var zn=x(Cn,2);{var xn=Z=>{var Fe=vZ();T(Z,Fe)};$(zn,Z=>{u(g).length===0&&Z(xn)})}var Ln=x(Zi,2),Xi=C(Ln);{var Ke=Z=>{var Fe=bZ();T(Z,Fe)},Ot=Z=>{var Fe=GD(),vt=C(Fe);G(()=>q(vt,u(At))),T(Z,Fe)},gi=Z=>{var Fe=qZ(),vt=_t(Fe),It=C(vt),Nt=C(It),O=x(It,2);{var se=qe=>{var xe=yZ(),Te=C(xe);G(()=>q(Te,u(ve).subtitle)),T(qe,xe)};$(O,qe=>{u(ve).subtitle&&qe(se)})}var be=x(O,2),j=C(be),pe=x(vt,2);_i(pe,17,()=>u(ve).endpoints,qe=>qe.endpointId,(qe,xe)=>{var Te=$Z(),Ie=C(Te),bt=C(Ie),ct=x(bt),Me=C(ct),Wt=x(ct,2);_i(Wt,21,()=>u(xe).clusters,jn,(ii,J)=>{var me=wZ(),$e=C(me);G(()=>q($e,u(J).name)),T(ii,me)});var ni=x(Ie,2);{var Gt=ii=>{var J=jZ(),me=x(C(J));_i(me,21,()=>u(xe).clusters,jn,($e,it)=>{var Ct=VZ(),je=_t(Ct),Ye=C(je),Xt=C(Ye),ai=x(je,2);_i(ai,17,()=>Object.entries(u(it).attrs),jn,(ei,Vi)=>{var In=ot(()=>mk(u(Vi),2));let Fi=()=>u(In)[0],ti=()=>u(In)[1];var Hi=Fs(),A=_t(Hi);{var K=Se=>{const Ne=ot(()=>{var _e;return(_e=t[u(it).name])==null?void 0:_e[Fi()]}),Le=ot(()=>(Fi()==="acceptedCommandList"||Fi()==="generatedCommandList")&&Array.isArray(ti())),re=ot(()=>{var _e;return((_e=c[u(it).name])==null?void 0:_e[Fi()])??a[Fi()]});var st=zZ(),Ue=C(st),Ee=C(Ue),Tt=C(Ee),We=x(Ee);{var H=_e=>{var Je=SZ(),zt=C(Je);G(fe=>q(zt,`(${fe??""})`),[()=>h(u(re))]),T(_e,Je)};$(We,_e=>{u(re)!==void 0&&_e(H)})}var Q=x(Ue),ke=C(Q);{var Ze=_e=>{var Je=xZ();_i(Je,21,()=>u(Ne),jn,(zt,fe)=>{var Ge=CZ(),gt=C(Ge);G(()=>q(gt,u(fe).label)),te("click",Ge,()=>i(u(ve).nodeId,u(xe).endpointId,u(it).name,u(fe).command,u(fe).args)),T(zt,Ge)}),T(_e,Je)};$(ke,_e=>{u(Ne)&&_e(Ze)})}var nt=x(Q),rt=C(nt);{var ut=_e=>{var Je=EZ();_i(Je,21,()=>s(u(it).name,ti()),jn,(zt,fe,Ge)=>{var gt=DZ(),Et=_t(gt);{var Qe=$i=>{var si=LZ();T($i,si)};$(Et,$i=>{Ge>0&&$i(Qe)})}var li=x(Et,2);{var Yt=$i=>{var si=kZ(),qt=_t(si),_n=C(qt),oi=x(qt),On=C(oi);G(()=>{q(_n,u(fe).name),q(On,`(${u(fe).id??""})`)}),T($i,si)},Gn=$i=>{var si=IZ(),qt=C(si);G(()=>q(qt,u(fe).id)),T($i,si)};$(li,$i=>{u(fe).name?$i(Yt):$i(Gn,-1)})}T(zt,gt)}),T(_e,Je)},ye=_e=>{var Je=MZ(),zt=x(C(Je));_i(zt,21,ti,jn,(fe,Ge)=>{const gt=ot(()=>u(Ge)),Et=ot(()=>u(gt).deviceType),Qe=ot(()=>r[u(Et)]);var li=TZ(),Yt=C(li),Gn=C(Yt);{var $i=oi=>{var On=PZ(),Yi=_t(On),Ps=x(Yi),Oo=C(Ps);G(Lr=>{q(Yi,`${u(Qe)??""} `),q(Oo,`(${Lr??""})`)},[()=>h(u(Et))]),T(oi,On)},si=oi=>{var On=Ur();G(Yi=>q(On,Yi),[()=>h(u(Et))]),T(oi,On)};$(Gn,oi=>{u(Qe)?oi($i):oi(si,-1)})}var qt=x(Yt),_n=C(qt);G(oi=>q(_n,oi),[()=>v(u(gt).revision)]),T(fe,li)}),T(_e,Je)},Dt=ot(()=>Fi()==="deviceTypeList"&&Array.isArray(ti())),ht=_e=>{const Je=ot(()=>[...new Set(ti().flatMap(Et=>Object.keys(Et)))]);var zt=OZ(),fe=C(zt),Ge=C(fe);_i(Ge,21,()=>u(Je),jn,(Et,Qe)=>{var li=NZ(),Yt=C(li);G(()=>q(Yt,u(Qe))),T(Et,li)});var gt=x(fe);_i(gt,21,ti,jn,(Et,Qe)=>{var li=AZ();_i(li,21,()=>u(Je),jn,(Yt,Gn)=>{var $i=RZ(),si=C($i);G(qt=>q(si,qt),[()=>v(u(Qe)[u(Gn)])]),T(Yt,$i)}),T(Et,li)}),T(_e,zt)},ge=ot(()=>w(ti())),yt=_e=>{var Je=HZ(),zt=C(Je);_i(zt,21,()=>Object.entries(ti()),jn,(fe,Ge)=>{var gt=ot(()=>mk(u(Ge),2));let Et=()=>u(gt)[0],Qe=()=>u(gt)[1];var li=FZ(),Yt=C(li),Gn=C(Yt),$i=x(Yt),si=C($i);G(qt=>{q(Gn,Et()),q(si,qt)},[()=>v(Qe())]),T(fe,li)}),T(_e,Je)},Xe=ot(()=>_(ti())),De=_e=>{var Je=WZ(),zt=C(Je);G(()=>{Hn(Je,"href",ti()),q(zt,ti())}),T(_e,Je)},le=_e=>{var Je=BZ(),zt=C(Je);G(fe=>q(zt,fe),[()=>v(ti())]),T(_e,Je)};$(rt,_e=>{u(Le)?_e(ut):u(Dt)?_e(ye,1):u(ge)?_e(ht,2):u(Xe)?_e(yt,3):(Fi()==="productUrl"||Fi()==="productURL")&&typeof ti()=="string"?_e(De,4):_e(le,-1)})}G(()=>{Hn(Ue,"title",Fi()),q(Tt,Fi())}),T(Se,st)},Re=ot(()=>!S(ti(),Fi()));$(A,Se=>{u(Re)&&Se(K)})}T(ei,Hi)}),G(()=>q(Xt,u(it).name)),T($e,Ct)}),T(ii,J)},$t=ii=>{var J=UZ();T(ii,J)};$(ni,ii=>{u(xe).clusters.length>0?ii(Gt):ii($t,-1)})}G(()=>{q(bt,`${u(xe).name??`Endpoint ${u(xe).endpointId}`??""} `),q(Me,`ep${u(xe).endpointId??""}`)}),T(qe,Te)}),G(()=>{q(Nt,u(ve).name??`Node ${u(ve).nodeId}`),q(j,`Node ID: ${u(ve).nodeId??""}`)}),T(Z,Fe)},xi=Z=>{var Fe=KZ();T(Z,Fe)};$(Xi,Z=>{u(tt)?Z(Ke):u(At)?Z(Ot,1):u(ve)?Z(gi,2):Z(xi,-1)})}var Li=x(Bn,2),sn=C(Li),mn=x(sn,2),Kn=x(C(mn),2);{var dn=Z=>{var Fe=GZ(),vt=C(Fe);G(()=>q(vt,u(Y).length)),T(Z,Fe)};$(Kn,Z=>{!u(X)&&u(Y).length>0&&Z(dn)})}var An=x(Kn,2),on=C(An),kn=x(mn,2);{var Ae=Z=>{var Fe=QZ(),vt=C(Fe);{var It=O=>{var se=ZZ();T(O,se)},Nt=O=>{var se=Fs(),be=_t(se);_i(be,17,()=>u(Pe),j=>j.id,(j,pe)=>{const qe=ot(()=>{var Gt,$t;return((Gt=f.get(u(pe).nodeId))==null?void 0:Gt.name)??(($t=u(g).find(ii=>ii.nodeId===u(pe).nodeId))==null?void 0:$t.name)??null}),xe=ot(()=>{var Gt,$t;return u(pe).endpointId!==void 0?(($t=(Gt=f.get(u(pe).nodeId))==null?void 0:Gt.endpoints.find(ii=>ii.endpointId===u(pe).endpointId))==null?void 0:$t.name)??null:null}),Te=ot(()=>u(pe).attrName??u(pe).clusterName);var Ie=JZ(),bt=C(Ie),ct=C(bt),Me=x(bt,2);{var Wt=Gt=>{var $t=XZ(),ii=x(_t($t),2),J=C(ii),me=x(J);{var $e=Ye=>{var Xt=Xw(),ai=x(_t(Xt)),ei=C(ai);G(()=>q(ei,`(#${u(pe).nodeId??""})`)),T(Ye,Xt)};$(me,Ye=>{u(qe)&&Ye($e)})}var it=x(ii,2);let Ct;var je=C(it);G(()=>{q(J,u(qe)??`#${u(pe).nodeId}`),Ct=jt(it,1,"e-val svelte-1ua3isv",null,Ct,{"e-online":u(pe).online,"e-offline":!u(pe).online}),q(je,u(pe).online?"online":"offline")}),T(Gt,$t)},ni=Gt=>{var $t=YZ(),ii=x(_t($t),2),J=C(ii),me=x(J);{var $e=ti=>{var Hi=Xw(),A=x(_t(Hi)),K=C(A);G(()=>q(K,`(#${u(pe).nodeId??""})`)),T(ti,Hi)};$(me,ti=>{u(qe)&&ti($e)})}var it=x(ii,2),Ct=C(it),je=x(Ct);{var Ye=ti=>{var Hi=Xw(),A=x(_t(Hi)),K=C(A);G(()=>q(K,`(ep ${u(pe).endpointId??""})`)),T(ti,Hi)};$(je,ti=>{u(xe)&&ti(Ye)})}var Xt=x(it,2),ai=C(Xt),ei=x(Xt,2),Vi=C(ei),In=x(ei,2),Fi=C(In);G(ti=>{q(J,u(qe)??`#${u(pe).nodeId}`),q(Ct,u(xe)??`ep${u(pe).endpointId}`),q(ai,u(pe).clusterName),q(Vi,u(Te)),q(Fi,ti)},[()=>p(u(pe).value)]),T(Gt,$t)};$(Me,Gt=>{u(pe).kind==="status"?Gt(Wt):Gt(ni,-1)})}G(Gt=>q(ct,Gt),[()=>D(u(pe).ts)]),T(j,Ie)}),T(O,se)};$(vt,O=>{u(Pe).length===0?O(It):O(Nt,-1)})}T(Z,Fe)};$(kn,Z=>{u(X)&&Z(Ae)})}G(()=>{Ko(Li,u(X)?`height: ${u(ue)}px;`:""),q(on,u(X)?"▾":"▸")}),te("click",nn,()=>k(mt,!u(mt))),te("mousedown",sn,Ve),te("click",An,()=>{k(X,!u(X))}),T(o,Nn),Ao()}Cr(["click","mousedown"]);var iX=R("<button>›</button>"),nX=R('<span class="chev-ph svelte-1vejtrc"></span>'),sX=R('<span class="tv svelte-1vejtrc"> </span> <span class="tt svelte-1vejtrc"> </span>',1),oX=R('<div class="tc svelte-1vejtrc"></div>'),rX=R('<div class="tn svelte-1vejtrc"><div><!> <span class="seg svelte-1vejtrc"> </span> <!></div> <!></div>'),aX=R("<option></option>"),lX=R('<span class="pub-ok svelte-1vejtrc">✓</span>'),cX=R('<span class="pub-err svelte-1vejtrc"> </span>'),dX=R('<div class="info svelte-1vejtrc">Loading…</div>'),hX=R('<div class="info err svelte-1vejtrc"> </div>'),uX=R('<div class="info svelte-1vejtrc">No topics match.</div>'),gX=R('<div class="vr svelte-1vejtrc"><span class="v-topic svelte-1vejtrc"> </span> <span class="v-val svelte-1vejtrc"> </span> <span class="v-ts svelte-1vejtrc"> </span></div>'),fX=R('<div class="vs svelte-1vejtrc"><div><div class="vrows-abs svelte-1vejtrc"></div></div></div>'),pX=R('<div class="info svelte-1vejtrc">No topics yet.</div>'),mX=R('<div class="tree-wrap svelte-1vejtrc"><!></div>'),_X=R('<span class="stream-badge"> </span>'),vX=R('<span class="stream-empty svelte-1vejtrc">Waiting for messages…</span>'),bX=R('<span class="s-ret svelte-1vejtrc" title="retained snapshot">⊛</span>'),yX=R('<div><span class="s-ts svelte-1vejtrc"> </span> <!> <span class="s-topic svelte-1vejtrc"> </span> <span class="s-val svelte-1vejtrc"> </span></div>'),wX=R('<div class="stream-body svelte-1vejtrc"><!></div>'),SX=R('<div class="ctx-bd svelte-1vejtrc"></div> <div class="ctx-menu svelte-1vejtrc"><button class="svelte-1vejtrc">Copy topic</button> <button class="svelte-1vejtrc">Clear retained</button></div>',1),CX=R('<label class="modal-check svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> Recursive — also clear all child topics</label>'),xX=R('<div class="modal-bd svelte-1vejtrc"></div> <div class="modal svelte-1vejtrc"><div class="modal-title svelte-1vejtrc">Clear retained</div> <div class="modal-body svelte-1vejtrc"><p class="svelte-1vejtrc">Clear retained value for <code class="svelte-1vejtrc"> </code>?</p> <!></div> <div class="modal-footer svelte-1vejtrc"><button class="btn-cancel svelte-1vejtrc">Cancel</button> <button class="btn-confirm svelte-1vejtrc">Clear</button></div></div>',1),LX=R('<div class="page svelte-1vejtrc"><div class="toolbar svelte-1vejtrc"><h2 class="svelte-1vejtrc">MQTT</h2></div> <div class="main-group svelte-1vejtrc"><div class="pub-bar svelte-1vejtrc"><input class="pt svelte-1vejtrc" type="text" placeholder="topic" list="pub-topic-list" autocomplete="off"/> <datalist id="pub-topic-list"></datalist> <input class="pp svelte-1vejtrc" type="text" placeholder="payload"/> <label class="rl svelte-1vejtrc"><input type="checkbox" class="svelte-1vejtrc"/> <span class="checkmark svelte-1vejtrc"></span> retain</label> <select class="svelte-1vejtrc"><option>QoS 0</option><option>QoS 1</option><option>QoS 2</option></select> <button class="svelte-1vejtrc">Publish</button> <!> <!></div> <div class="tree-filter-bar svelte-1vejtrc"><input class="filter-in svelte-1vejtrc" type="search" placeholder="Filter topics…"/> <span class="count svelte-1vejtrc"><!> </span></div> <!></div> <div class="stream-panel svelte-1vejtrc"><div class="stream-resize svelte-1vejtrc"></div> <div class="stream-hdr-row svelte-1vejtrc"><input class="filter-in stream-filter-in svelte-1vejtrc" type="search" placeholder="Live stream filter (MQTT wildcard, default: #)"/> <!> <button class="stream-toggle svelte-1vejtrc" title="Toggle live stream"> </button></div> <!></div> <!> <!></div>');function kX(o,e){Ro(e,!0);const t=(J,me=py)=>{const $e=ot(()=>u(f).has(me().path)),it=ot(()=>u(a)>=0&&me().children.size>0),Ct=ot(()=>u(a)>=0&&me().isLeaf&&!n.has(me().path));var je=rX(),Ye=C(je);let Xt;var ai=C(Ye);{var ei=Se=>{var Ne=iX();let Le;G(()=>{Le=jt(Ne,1,"chev svelte-1vejtrc",null,Le,{open:u($e)}),Hn(Ne,"aria-label",u($e)?"Collapse":"Expand")}),te("click",Ne,()=>p(me().path)),T(Se,Ne)},Vi=Se=>{var Ne=nX();T(Se,Ne)};$(ai,Se=>{u(it)?Se(ei):Se(Vi,-1)})}var In=x(ai,2),Fi=C(In),ti=x(In,2);{var Hi=Se=>{var Ne=sX(),Le=_t(Ne),re=C(Le),st=x(Le,2),Ue=C(st);G((Ee,Tt,We)=>{Hn(Le,"title",Ee),q(re,Tt),q(Ue,We)},[()=>{var Ee;return Ri((Ee=fn(me().path))==null?void 0:Ee.val)},()=>{var Ee;return Ri((Ee=fn(me().path))==null?void 0:Ee.val)},()=>{var Ee;return((Ee=fn(me().path))==null?void 0:Ee.ts)!=null?Bn(fn(me().path).ts):""}]),T(Se,Ne)},A=ot(()=>me().isLeaf&&i.has(me().path));$(ti,Se=>{u(A)&&Se(Hi)})}var K=x(Ye,2);{var Re=Se=>{var Ne=oX();_i(Ne,21,()=>[...me().children.values()].sort((Le,re)=>Le.seg.localeCompare(re.seg)),Le=>Le.path,(Le,re)=>{t(Le,()=>u(re))}),T(Se,Ne)};$(K,Se=>{u(it)&&u($e)&&Se(Re)})}G(()=>{Xt=jt(Ye,1,"tr svelte-1vejtrc",null,Xt,{stale:u(Ct)}),q(Fi,me().seg)}),te("click",Ye,()=>{k(tt,me().path+"/#")}),te("contextmenu",Ye,Se=>{Se.preventDefault(),k(at,{x:Se.clientX,y:Se.clientY,topic:me().path},!0)}),T(J,je)},i=new Map,n=new Set,s=new Set;let r=null,a=B(0);function c(){r===null&&(r=requestAnimationFrame(()=>{r=null;for(const J of s)g(J);s.clear(),bk(a)}))}const h=new Map;function g(J){const me=J.split("/");let $e=h,it="";for(let Ct=0;Ct<me.length;Ct++){const je=me[Ct];it=Ct===0?je:`${it}/${je}`,$e.has(je)||$e.set(je,{seg:je,path:it,children:new Map,isLeaf:!1});const Ye=$e.get(je);Ct===me.length-1&&(Ye.isLeaf=!0),$e=Ye.children}}let f=B(wi(new Set));function p(J){const me=new Set(u(f));me.has(J)?me.delete(J):me.add(J),k(f,me,!0)}let v=B("");const _=24,w=5;let S=B(0),D=B(300),P=ot(()=>{if(u(a),!u(v))return[];const J=u(v).toLowerCase().split(/\s+/).filter(Boolean),me=[];for(const[$e,it]of i){const Ct=$e.toLowerCase();J.every(je=>Ct.includes(je))&&me.push({topic:$e,...it})}return me.sort(($e,it)=>$e.topic.localeCompare(it.topic))}),N=ot(()=>{const J=u(P).length,me=Math.max(0,Math.floor(u(S)/_)-w),$e=Math.min(J,Math.ceil((u(S)+u(D))/_)+w);return{start:me,end:$e,totalH:J*_,top:me*_}});const V=1e3,F=200,Y=20,X=36;let ue=0,Pe=B(wi([])),Ve=B(wi([])),ve=B(!0),tt=B("#"),At=B(200);Vn(()=>{const J=u(tt).trim(),me=yl(()=>u(Pe)),$e=!J||J==="#"?me.slice(0,F):me.filter(it=>mt(J,it.topic)).slice(0,F);if(J&&J!=="#"){const it=new Set($e.map(je=>je.topic)),Ct=[];for(const[je,Ye]of i)it.has(je)||mt(J,je)&&Ct.push({id:-(Ct.length+1),topic:je,val:Ye.val,ts:Ye.ts,retained:!0});Ct.sort((je,Ye)=>je.topic.localeCompare(Ye.topic)),k(Ve,[...$e,...Ct],!0)}else k(Ve,$e,!0)});function mt(J,me){if(J==="#")return!0;const $e=J.split("/"),it=me.split("/");for(let Ct=0;Ct<$e.length;Ct++){if($e[Ct]==="#")return!0;if(Ct>=it.length||$e[Ct]!=="+"&&$e[Ct]!==it[Ct])return!1}return $e.length===it.length}function hi(J){J.preventDefault();const me=J.clientY,$e=u(At);function it(je){k(At,Math.max(60,Math.min(800,$e+me-je.clientY)),!0)}function Ct(){document.removeEventListener("mousemove",it),document.removeEventListener("mouseup",Ct)}document.addEventListener("mousemove",it),document.addEventListener("mouseup",Ct)}let Vt=ot(()=>{const J=Math.max(1,Math.floor((u(At)-X)/Y)+1);return u(Ve).slice(0,J)}),Jt=B(!0),he=B(null);async function kt(){k(Jt,!0),k(he,null);try{const J=await uR();for(const me of J)i.set(me.topic,{val:me.val,ts:me.ts}),g(me.topic)}catch(J){k(he,J instanceof Error?J.message:String(J),!0)}finally{k(Jt,!1),bk(a)}}const Oe=Gl("mqtt",J=>{const{topic:me,val:$e,ts:it}=J;i.set(me,{val:$e,ts:it}),n.add(me),s.add(me),c();const Ct={id:ue++,topic:me,val:$e,ts:it};k(Pe,[Ct,...u(Pe).slice(0,V-1)],!0);const je=u(tt).trim();(!je||je==="#"||mt(je,me))&&k(Ve,[Ct,...u(Ve).filter(Ye=>!(Ye.retained&&Ye.topic===me)).slice(0,F-1)],!0)});let at=B(null),Rt=B(null);async function Si(J,me){const $e=[J];if(me){const it=J+"/";for(const Ct of i.keys())Ct.startsWith(it)&&$e.push(Ct)}for(const it of $e)await vD(it,"",!0,0)}let Qt=ot(()=>(u(a),[...i.keys()].sort())),Ht=B(""),St=B(""),ri=B(!1),Ii=B(0),Sn=B(!1),ln=B(null),Nn=B(!1);async function cn(){if(u(Ht)){k(Sn,!0),k(ln,null),k(Nn,!1);try{await vD(u(Ht),u(St),u(ri),u(Ii)),k(Nn,!0),setTimeout(()=>{k(Nn,!1)},2e3)}catch(J){k(ln,J instanceof Error?J.message:String(J),!0)}finally{k(Sn,!1)}}}function Ri(J){return J==null?"":typeof J=="object"?JSON.stringify(J):String(J)}function Bn(J){return new Date(J).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function Zi(J){return new Date(J).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function fn(J){return u(a),i.get(J)}let nn=ot(()=>(u(a),[...h.values()].sort((J,me)=>J.seg.localeCompare(me.seg)))),Ui=ot(()=>(u(a),i.size));xr(kt),yy(()=>{Oe(),r!==null&&cancelAnimationFrame(r)});var pn=LX(),Rn=x(C(pn),2),Cn=C(Rn),zn=C(Cn),xn=x(zn,2);_i(xn,20,()=>u(Qt),J=>J,(J,me)=>{var $e=aX(),it={};G(()=>{it!==(it=me)&&($e.value=($e.__value=me)??"")}),T(J,$e)});var Ln=x(xn,2),Xi=x(Ln,2),Ke=C(Xi),Ot=x(Xi,2),gi=C(Ot);gi.value=gi.__value=0;var xi=x(gi);xi.value=xi.__value=1;var Li=x(xi);Li.value=Li.__value=2;var sn=x(Ot,2),mn=x(sn,2);{var Kn=J=>{var me=lX();T(J,me)};$(mn,J=>{u(Nn)&&J(Kn)})}var dn=x(mn,2);{var An=J=>{var me=cX(),$e=C(me);G(()=>q($e,u(ln))),T(J,me)};$(dn,J=>{u(ln)&&J(An)})}var on=x(Cn,2),kn=C(on),Ae=x(kn,2),Z=C(Ae);{var Fe=J=>{var me=Ur();G(()=>q(me,`${u(P).length??""} /`)),T(J,me)};$(Z,J=>{u(v)&&J(Fe)})}var vt=x(Z),It=x(on,2);{var Nt=J=>{var me=dX();T(J,me)},O=J=>{var me=hX(),$e=C(me);G(()=>q($e,u(he))),T(J,me)},se=J=>{var me=Fs(),$e=_t(me);{var it=je=>{var Ye=uX();T(je,Ye)},Ct=je=>{var Ye=fX(),Xt=C(Ye),ai=C(Xt);_i(ai,21,()=>u(P).slice(u(N).start,u(N).end),ei=>ei.topic,(ei,Vi)=>{var In=gX(),Fi=C(In),ti=C(Fi),Hi=x(Fi,2),A=C(Hi),K=x(Hi,2),Re=C(K);G((Se,Ne,Le)=>{q(ti,u(Vi).topic),Hn(Hi,"title",Se),q(A,Ne),q(Re,Le)},[()=>Ri(u(Vi).val),()=>Ri(u(Vi).val),()=>Bn(u(Vi).ts)]),T(ei,In)}),G(()=>{Ko(Xt,`height: ${u(N).totalH??""}px; position: relative;`),Ko(ai,`top: ${u(N).top??""}px;`)}),os("scroll",Ye,ei=>{k(S,ei.currentTarget.scrollTop,!0)}),CW(Ye,"clientHeight",ei=>k(D,ei)),T(je,Ye)};$($e,je=>{u(P).length===0?je(it):je(Ct,-1)})}T(J,me)},be=J=>{var me=mX(),$e=C(me);{var it=je=>{var Ye=pX();T(je,Ye)},Ct=je=>{var Ye=Fs(),Xt=_t(Ye);_i(Xt,17,()=>u(nn),ai=>ai.path,(ai,ei)=>{t(ai,()=>u(ei))}),T(je,Ye)};$($e,je=>{u(nn).length===0?je(it):je(Ct,-1)})}T(J,me)};$(It,J=>{u(Jt)?J(Nt):u(he)?J(O,1):u(v)?J(se,2):J(be,-1)})}var j=x(Rn,2),pe=C(j),qe=x(pe,2),xe=C(qe),Te=x(xe,2);{var Ie=J=>{var me=_X(),$e=C(me);G(()=>q($e,u(Ve).length)),T(J,me)};$(Te,J=>{!u(ve)&&u(Ve).length>0&&J(Ie)})}var bt=x(Te,2),ct=C(bt),Me=x(qe,2);{var Wt=J=>{var me=wX(),$e=C(me);{var it=je=>{var Ye=vX();T(je,Ye)},Ct=je=>{var Ye=Fs(),Xt=_t(Ye);_i(Xt,17,()=>u(Vt),ai=>ai.id,(ai,ei)=>{var Vi=yX();let In;var Fi=C(Vi),ti=C(Fi),Hi=x(Fi,2);{var A=Le=>{var re=bX();T(Le,re)};$(Hi,Le=>{u(ei).retained&&Le(A)})}var K=x(Hi,2),Re=C(K),Se=x(K,2),Ne=C(Se);G((Le,re,st)=>{In=jt(Vi,1,"sr svelte-1vejtrc",null,In,{retained:u(ei).retained}),q(ti,Le),q(Re,u(ei).topic),Hn(Se,"title",re),q(Ne,st)},[()=>Zi(u(ei).ts),()=>Ri(u(ei).val),()=>Ri(u(ei).val)]),T(ai,Vi)}),T(je,Ye)};$($e,je=>{u(Vt).length===0?je(it):je(Ct,-1)})}T(J,me)};$(Me,J=>{u(ve)&&J(Wt)})}var ni=x(j,2);{var Gt=J=>{var me=SX(),$e=_t(me),it=x($e,2);let Ct;var je=C(it),Ye=x(je,2);G(()=>Ct=Ko(it,"",Ct,{left:`${u(at).x??""}px`,top:`${u(at).y??""}px`})),te("click",$e,()=>k(at,null)),te("contextmenu",$e,Xt=>{Xt.preventDefault(),k(at,null)}),te("click",je,()=>{navigator.clipboard.writeText(u(at).topic),k(at,null)}),te("click",Ye,()=>{const Xt=u(at).topic,ai=Xt+"/",ei=[...i.keys()].some(Vi=>Vi.startsWith(ai));k(Rt,{topic:Xt,hasChildren:ei,recursive:!1},!0),k(at,null)}),T(J,me)};$(ni,J=>{u(at)&&J(Gt)})}var $t=x(ni,2);{var ii=J=>{var me=xX(),$e=_t(me),it=x($e,2),Ct=x(C(it),2),je=C(Ct),Ye=x(C(je)),Xt=C(Ye),ai=x(je,2);{var ei=ti=>{var Hi=CX(),A=C(Hi);As(A,()=>u(Rt).recursive,K=>u(Rt).recursive=K),T(ti,Hi)};$(ai,ti=>{u(Rt).hasChildren&&ti(ei)})}var Vi=x(Ct,2),In=C(Vi),Fi=x(In,2);G(()=>q(Xt,u(Rt).topic)),te("click",$e,()=>k(Rt,null)),te("click",In,()=>k(Rt,null)),te("click",Fi,()=>{const{topic:ti,recursive:Hi}=u(Rt);k(Rt,null),Si(ti,Hi)}),T(J,me)};$($t,J=>{u(Rt)&&J(ii)})}G(()=>{sn.disabled=u(Sn)||!u(Ht),q(vt,` ${u(Ui)??""}`),Ko(j,u(ve)?`height: ${u(At)}px;`:""),q(ct,u(ve)?"▾":"▸")}),Mi(zn,()=>u(Ht),J=>k(Ht,J)),Mi(Ln,()=>u(St),J=>k(St,J)),As(Ke,()=>u(ri),J=>k(ri,J)),_a(Ot,()=>u(Ii),J=>k(Ii,J)),te("click",sn,cn),Mi(kn,()=>u(v),J=>k(v,J)),te("mousedown",pe,hi),Mi(xe,()=>u(tt),J=>k(tt,J)),te("click",bt,()=>{k(ve,!u(ve))}),T(o,pn),Ao()}Cr(["click","contextmenu","mousedown"]);var IX=R('<div class="restart-banner restart-banner--restarting svelte-twakcj">Restarting daemon…</div>'),DX=R('<div class="restart-banner svelte-twakcj">⚠ Package changes require a daemon restart to take effect. <button class="restart-btn svelte-twakcj">Restart now</button></div>'),EX=R('<div class="err svelte-twakcj"> </div>'),PX=R('<span class="pane-count pane-count--warn svelte-twakcj"> </span>'),TX=R('<p class="empty svelte-twakcj">No packages installed.</p>'),MX=R('<p class="empty svelte-twakcj">No match.</p>'),NX=R('<span class="dep-latest svelte-twakcj"> </span>'),RX=_T('<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>'),AX=_T('<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>'),OX=R('<div><div class="dep-info svelte-twakcj"><a class="dep-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="dep-ver svelte-twakcj"> </span> <!></div> <div class="dep-btns svelte-twakcj"><button><!></button> <button class="icon-btn icon-btn--danger svelte-twakcj" title="Uninstall"><svg width="11" height="11" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"><line x1="2" y1="2" x2="14" y2="14"></line><line x1="14" y1="2" x2="2" y2="14"></line></svg></button></div></div>'),FX=R('<span class="result-author svelte-twakcj"> </span>'),HX=R('<span class="result-date svelte-twakcj"> </span>'),WX=R('<span class="result-desc svelte-twakcj"> </span>'),BX=R('<div class="result-row svelte-twakcj"><div class="result-info svelte-twakcj"><a class="result-name svelte-twakcj" target="_blank" rel="noopener noreferrer"> </a> <span class="result-ver svelte-twakcj"> </span> <!> <!> <!></div> <button class="install-btn svelte-twakcj"> </button></div>'),zX=R('<div class="results-list svelte-twakcj"></div>'),VX=R('<pre class="npm-output svelte-twakcj"> </pre>'),jX=R(`<p class="hint svelte-twakcj">Install npm packages into <code class="svelte-twakcj">~/.she/</code>. Scripts can then <code class="svelte-twakcj">require('package-name')</code> directly.</p>`),UX=R('<!> <div class="pkg-shell svelte-twakcj"><!> <!> <div class="pkg-body svelte-twakcj"><div class="pkg-left svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Installed</span> <span class="pane-count svelte-twakcj"> </span> <!> <button class="icon-btn check-outdated-btn svelte-twakcj" title="Check for package updates"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M13 8A5 5 0 1 1 10.5 3.67"></path><polyline points="10.5,1.5 10.5,4 13,4"></polyline></svg></button></div> <div class="filter-row svelte-twakcj"><input class="filter-in svelte-twakcj" type="search" placeholder="Filter…"/></div> <div class="installed-list svelte-twakcj"><!></div></div> <div class="pkg-right svelte-twakcj"><div class="pane-hdr svelte-twakcj"><span class="pane-title svelte-twakcj">Search npm</span></div> <div class="search-row svelte-twakcj"><input class="search-in svelte-twakcj" type="text" placeholder="Package name, e.g. axios, lodash…"/> <button class="search-btn svelte-twakcj"> </button></div> <!> <!> <!></div></div></div>',1);function $X(o,e){Ro(e,!0);let t=B(wi([])),i=B(""),n=B(wi({})),s=B(!1),r=B(""),a=B(wi([])),c=B(!1),h=B(!1),g=B(!1),f=B(""),p=B(""),v=wi({});const _=ot(()=>u(i).trim()?u(t).filter(Ke=>Ke.name.toLowerCase().includes(u(i).toLowerCase())):u(t)),w=ot(()=>Object.keys(u(n)).length);xr(async()=>{await Promise.all([S(),D()])});async function S(){try{k(t,await c8(),!0),k(f,"")}catch(Ke){k(f,Ke.message,!0)}}async function D(){try{k(n,await f8(),!0)}catch{}}async function P(){k(s,!0);try{k(n,await p8(),!0)}catch{}finally{k(s,!1)}}async function N(){const Ke=u(r).trim();if(!Ke){k(a,[],!0);return}k(g,!0),k(f,"");try{k(a,await d8(Ke),!0)}catch(Ot){k(f,Ot.message,!0)}finally{k(g,!1)}}function V(Ke){if(!Ke)return"";try{return new Date(Ke).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}async function F(Ke,Ot){v[Ke]=!0,k(f,""),k(p,"");try{const gi=await h8(Ke,Ot);k(p,gi.stdout||gi.stderr||"Done.",!0),k(c,!0),await S()}catch(gi){k(f,gi.message,!0)}finally{v[Ke]=!1}}async function Y(Ke){v[Ke]=!0,k(f,""),k(p,"");try{const Ot=await u8(Ke);k(p,Ot.stdout||Ot.stderr||"Done.",!0),k(c,!0);const gi={...u(n)};delete gi[Ke],k(n,gi,!0),await S()}catch(Ot){k(f,Ot.message,!0)}finally{v[Ke]=!1}}async function X(Ke){v[Ke]=!0,k(f,""),k(p,"");try{const Ot=await g8(Ke);k(p,Ot.stdout||Ot.stderr||"Done.",!0),k(c,!0);const gi={...u(n)};delete gi[Ke],k(n,gi,!0),await S()}catch(Ot){k(f,Ot.message,!0)}finally{v[Ke]=!1}}let ue;async function Pe(){if(await ue.show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"})){k(h,!0);try{await lR()}catch{}setTimeout(()=>{window.location.reload()},3e3)}}var Ve=UX(),ve=_t(Ve);bs(Hg(ve,{}),Ke=>ue=Ke,()=>ue);var tt=x(ve,2),At=C(tt);{var mt=Ke=>{var Ot=IX();T(Ke,Ot)},hi=Ke=>{var Ot=DX(),gi=x(C(Ot));te("click",gi,Pe),T(Ke,Ot)};$(At,Ke=>{u(h)?Ke(mt):u(c)&&Ke(hi,1)})}var Vt=x(At,2);{var Jt=Ke=>{var Ot=EX(),gi=C(Ot);G(()=>q(gi,u(f))),T(Ke,Ot)};$(Vt,Ke=>{u(f)&&Ke(Jt)})}var he=x(Vt,2),kt=C(he),Oe=C(kt),at=x(C(Oe),2),Rt=C(at),Si=x(at,2);{var Qt=Ke=>{var Ot=PX(),gi=C(Ot);G(()=>q(gi,`${u(w)??""} outdated`)),T(Ke,Ot)};$(Si,Ke=>{u(w)>0&&Ke(Qt)})}var Ht=x(Si,2),St=C(Ht);let ri;var Ii=x(Oe,2),Sn=C(Ii),ln=x(Ii,2),Nn=C(ln);{var cn=Ke=>{var Ot=TX();T(Ke,Ot)},Ri=Ke=>{var Ot=MX();T(Ke,Ot)},Bn=Ke=>{var Ot=Fs(),gi=_t(Ot);_i(gi,17,()=>u(_),xi=>xi.name,(xi,Li)=>{var sn=OX();let mn;var Kn=C(sn),dn=C(Kn),An=C(dn),on=x(dn,2),kn=C(on),Ae=x(on,2);{var Z=j=>{var pe=NX(),qe=C(pe);G(()=>q(qe,`→ v${u(n)[u(Li).name].latest??""}`)),T(j,pe)};$(Ae,j=>{u(n)[u(Li).name]&&j(Z)})}var Fe=x(Kn,2),vt=C(Fe);let It;var Nt=C(vt);{var O=j=>{var pe=RX();T(j,pe)},se=j=>{var pe=AX();T(j,pe)};$(Nt,j=>{v[u(Li).name]?j(O):j(se,-1)})}var be=x(vt,2);G(()=>{mn=jt(sn,1,"dep-row svelte-twakcj",null,mn,{"dep-busy":!!v[u(Li).name]}),Hn(dn,"href",u(Li).url??`https://www.npmjs.com/package/${u(Li).name}`),q(An,u(Li).name),q(kn,u(Li).installedVersion??u(Li).version),It=jt(vt,1,"icon-btn svelte-twakcj",null,It,{"icon-btn--update":!!u(n)[u(Li).name]}),vt.disabled=!!v[u(Li).name],Hn(vt,"title",u(n)[u(Li).name]?`Update to v${u(n)[u(Li).name].latest}`:"Update to latest"),be.disabled=!!v[u(Li).name]}),te("click",vt,()=>X(u(Li).name)),te("click",be,()=>Y(u(Li).name)),T(xi,sn)}),T(Ke,Ot)};$(Nn,Ke=>{u(t).length===0?Ke(cn):u(_).length===0?Ke(Ri,1):Ke(Bn,-1)})}var Zi=x(kt,2),fn=x(C(Zi),2),nn=C(fn),Ui=x(nn,2),pn=C(Ui),Rn=x(fn,2);{var Cn=Ke=>{var Ot=zX();_i(Ot,21,()=>u(a),gi=>gi.name,(gi,xi)=>{var Li=BX(),sn=C(Li),mn=C(sn),Kn=C(mn),dn=x(mn,2),An=C(dn),on=x(dn,2);{var kn=O=>{var se=FX(),be=C(se);G(()=>q(be,u(xi).author)),T(O,se)};$(on,O=>{u(xi).author&&O(kn)})}var Ae=x(on,2);{var Z=O=>{var se=HX(),be=C(se);G(j=>{Hn(se,"title",u(xi).date),q(be,j)},[()=>V(u(xi).date)]),T(O,se)};$(Ae,O=>{u(xi).date&&O(Z)})}var Fe=x(Ae,2);{var vt=O=>{var se=WX(),be=C(se);G(()=>q(be,u(xi).description)),T(O,se)};$(Fe,O=>{u(xi).description&&O(vt)})}var It=x(sn,2),Nt=C(It);G(()=>{Hn(mn,"href",u(xi).url??`https://www.npmjs.com/package/${u(xi).name}`),q(Kn,u(xi).name),q(An,u(xi).version),It.disabled=!!v[u(xi).name],q(Nt,v[u(xi).name]?"Installing…":"Install")}),te("click",It,()=>F(u(xi).name)),T(gi,Li)}),T(Ke,Ot)};$(Rn,Ke=>{u(a).length>0&&Ke(Cn)})}var zn=x(Rn,2);{var xn=Ke=>{var Ot=VX(),gi=C(Ot);G(()=>q(gi,u(p))),T(Ke,Ot)};$(zn,Ke=>{u(p)&&Ke(xn)})}var Ln=x(zn,2);{var Xi=Ke=>{var Ot=jX();T(Ke,Ot)};$(Ln,Ke=>{!u(a).length&&!u(p)&&Ke(Xi)})}G(()=>{q(Rt,u(t).length),Ht.disabled=u(s),ri=jt(St,0,"svelte-twakcj",null,ri,{spinning:u(s)}),Ui.disabled=u(g),q(pn,u(g)?"Searching…":"Search")}),te("click",Ht,P),Mi(Sn,()=>u(i),Ke=>k(i,Ke)),te("keydown",nn,Ke=>Ke.key==="Enter"&&N()),Mi(nn,()=>u(r),Ke=>k(r,Ke)),te("click",Ui,N),T(o,Ve),Ao()}Cr(["click","keydown"]);var qX=R('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),KX=R('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),GX=R('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),ZX=R('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> </button>'),XX=R('<div class="version-popup svelte-1n46o8q"><dl class="svelte-1n46o8q"><dt class="svelte-1n46o8q">Installed</dt><dd class="svelte-1n46o8q"></dd> <!></dl> <div class="version-actions svelte-1n46o8q"><!> <button class="check-btn svelte-1n46o8q" title="Check for updates now"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> </button></div></div>'),YX=R('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),JX=R('<dt class="svelte-1n46o8q">Matter nodes</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Matter endpoints</dt><dd class="svelte-1n46o8q"> </dd>',1),QX=R('<dt class="svelte-1n46o8q">DB docs</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">DB views</dt><dd class="svelte-1n46o8q"> </dd>',1),eY=R('<dl class="svelte-1n46o8q"><!> <dt class="svelte-1n46o8q">Scripts</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT topics</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT msg/s</dt><dd class="svelte-1n46o8q"> </dd> <!> <!> <dt class="svelte-1n46o8q">Handlers</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Memory</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">CPU</dt><dd class="svelte-1n46o8q"> </dd></dl>'),tY=R('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),iY=R('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18.36 6.64a9 9 0 1 1-12.73 0"></path><line x1="12" y1="2" x2="12" y2="12"></line></svg> Restart daemon</button></div></div>'),nY=R('<button class="nav-logout svelte-1n46o8q" title="Logout"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg></button>'),sY=R('<div class="shell svelte-1n46o8q"><nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="5,3 1,8 5,13"></polyline><polyline points="11,3 15,8 11,13"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1"></rect><path d="M2,11 V5 H5 V11"></path><path d="M6,12 V5 H9 V8 H6"></path><path d="M10,11 V5 H15 V11"></path><line x1="12.5" y1="5" x2="12.5" y2="11"></line></svg> Packages</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z"></path></svg> MQTT</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M8,2 L8,7"></path><path d="M6,5 L8,7.5 L10,5"></path><path d="M2.5,14 L6,10"></path><path d="M6.2,12.8 L6,10 L3.2,10.2"></path><path d="M13.5,14 L10,10"></path><path d="M9.8,12.8 L10,10 L12.8,10.2"></path></svg> Matter</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="8" cy="4.5" rx="5" ry="1.8"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7"></path><path d="M3,8 a5,1.8 0,0,0 10,0"></path></svg> DB</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="2" y1="5" x2="14" y2="5"></line><line x1="2" y1="8" x2="14" y2="8"></line><line x1="2" y1="11" x2="9" y2="11"></line></svg> Logs</button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="20" x2="18" y2="10"></line><line x1="12" y1="20" x2="12" y2="4"></line><line x1="6" y1="20" x2="6" y2="14"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),oY=R('<div class="login-error svelte-1n46o8q"> </div>'),rY=R('<div class="login-overlay svelte-1n46o8q"><form class="login-box svelte-1n46o8q"><div class="login-brand svelte-1n46o8q">she</div> <h2 class="svelte-1n46o8q">Sign in</h2> <div class="login-field svelte-1n46o8q"><label for="she-password" class="svelte-1n46o8q">Password</label> <input id="she-password" type="password" placeholder="Enter password" autocomplete="current-password" class="svelte-1n46o8q"/></div> <!> <button type="submit" class="login-btn svelte-1n46o8q"> </button></form></div>'),aY=R('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> Restarting smart-home-engine…</div></div>'),lY=R('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10"></polyline><path d="M4 10A9 9 0 1 0 6.5 5"></path></svg> Updating smart-home-engine…</div></div>'),cY=R("<!> <!> <!> <!>",1);function dY(o,e){Ro(e,!0);const t=["scripts","mqtt","matter","db","logs","config","packages"];function i(){const he=location.hash.slice(1);return t.includes(he)?he:"scripts"}let n=B(wi(i())),s=B(null),r=B(!1),a=B(!1),c=B(!1),h=B(!1),g=B("none"),f=B(""),p=B(!1),v=B(""),_=B(""),w=B(!1),S=B(!1);V7(()=>{k(p,!0)});async function D(){k(_,""),k(w,!0);try{await $7(u(v)),k(v,""),k(p,!1)}catch(he){k(_,he.message??"Login failed",!0)}finally{k(w,!1)}}async function P(){if(u(g)==="proxy"&&u(f)){window.location.href=u(f);return}await q7(),k(p,!0)}let N=B(null),V=B(!1);async function F(){if(!await u(N).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;k(V,!0);let he;try{he=(await wf()).startedAt}catch{}try{await lR()}catch{}const kt=Date.now()+6e4;for(;Date.now()<kt;){await new Promise(Oe=>setTimeout(Oe,250));try{const Oe=await wf();if(he===void 0||Oe.startedAt!==he){location.reload();return}}catch{}}location.reload()}async function Y(){k(c,!0);try{const he=await J7();u(s)&&k(s,{...u(s),latestVersion:he.latestVersion??void 0},!0)}catch{}finally{k(c,!1)}}async function X(){var Oe,at;if(!await u(N).show(`Update to v${(Oe=u(s))==null?void 0:Oe.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;k(a,!1),k(h,!0);const he=(at=u(s))==null?void 0:at.startedAt;try{await Y7()}catch{}const kt=Date.now()+18e4;for(;Date.now()<kt;){await new Promise(Rt=>setTimeout(Rt,1e3));try{const Rt=await wf();if(he===void 0||Rt.startedAt!==he){location.reload();return}}catch{k(h,!1),k(V,!0)}}location.reload()}function ue(he){k(n,he,!0),location.hash=he}xr(async()=>{location.hash||(location.hash=u(n));const he=()=>{k(n,i(),!0)};window.addEventListener("hashchange",he);try{const at=await U7();k(g,at.mode,!0),k(f,at.proxyLogoutUrl??"",!0),u(g)==="password"&&(await fetch("/she/scripts")).status===401&&k(p,!0)}catch{}k(S,!0);async function kt(){try{k(s,await wf(),!0)}catch{}}kt();const Oe=setInterval(kt,5e3);return()=>{window.removeEventListener("hashchange",he),clearInterval(Oe)}});var Pe=cY();os("click",XP,()=>{u(r)&&k(r,!1),u(a)&&k(a,!1)});var Ve=_t(Pe);{var ve=he=>{var kt=sY(),Oe=C(kt),at=x(C(Oe),2);let Rt;var Si=x(at,2);let Qt;var Ht=x(Si,2);let St;var ri=x(Ht,2);let Ii;var Sn=x(ri,2);let ln;var Nn=x(Sn,2);let cn;var Ri=x(Nn,4),Bn=x(C(Ri),2),Zi=C(Bn),fn=C(Zi);fn.nodeValue="v0.27.3 ";var nn=x(fn);{var Ui=Ie=>{var bt=qX();T(Ie,bt)};$(nn,Ie=>{var bt;(bt=u(s))!=null&&bt.latestVersion&&Ie(Ui)})}var pn=x(Zi,2);{var Rn=Ie=>{var bt=XX(),ct=C(bt),Me=x(C(ct));Me.textContent="v0.27.3";var Wt=x(Me,2);{var ni=je=>{var Ye=KX(),Xt=x(_t(Ye)),ai=C(Xt);G(()=>q(ai,`v${u(s).latestVersion??""}`)),T(je,Ye)},Gt=je=>{var Ye=GX();T(je,Ye)};$(Wt,je=>{var Ye;(Ye=u(s))!=null&&Ye.latestVersion?je(ni):je(Gt,-1)})}var $t=x(ct,2),ii=C($t);{var J=je=>{var Ye=ZX(),Xt=x(C(Ye));G(()=>q(Xt,` Update to v${u(s).latestVersion??""}`)),te("click",Ye,X),T(je,Ye)};$(ii,je=>{var Ye;(Ye=u(s))!=null&&Ye.latestVersion&&je(J)})}var me=x(ii,2),$e=C(me);let it;var Ct=x($e);G(()=>{me.disabled=u(c),it=jt($e,0,"svelte-1n46o8q",null,it,{spinning:u(c)}),q(Ct,` ${u(c)?"Checking…":"Check for updates"}`)}),te("click",bt,je=>je.stopPropagation()),te("click",me,Y),T(Ie,bt)};$(pn,Ie=>{u(a)&&Ie(Rn)})}var Cn=x(Bn,2),zn=C(Cn),xn=x(zn,2);{var Ln=Ie=>{var bt=iY(),ct=C(bt);{var Me=$t=>{var ii=eY(),J=C(ii);{var me=Se=>{const Ne=ot(()=>Math.floor((Date.now()-u(s).startedAt)/1e3)),Le=ot(()=>Math.floor(u(Ne)/86400)),re=ot(()=>Math.floor(u(Ne)%86400/3600)),st=ot(()=>Math.floor(u(Ne)%3600/60));var Ue=YX(),Ee=x(_t(Ue)),Tt=C(Ee);G(()=>q(Tt,`${u(Le)>0?u(Le)+"d ":""}${u(re)>0||u(Le)>0?u(re)+"h ":""}${u(st)??""}m`)),T(Se,Ue)};$(J,Se=>{u(s).startedAt&&Se(me)})}var $e=x(J,3),it=C($e),Ct=x($e,3),je=C(Ct),Ye=x(Ct,3),Xt=C(Ye),ai=x(Ye,2);{var ei=Se=>{var Ne=JX(),Le=x(_t(Ne)),re=C(Le),st=x(Le,3),Ue=C(st);G(()=>{q(re,u(s).matterNodes??0),q(Ue,u(s).matterEndpoints??0)}),T(Se,Ne)};$(ai,Se=>{u(s).matterEnabled&&Se(ei)})}var Vi=x(ai,2);{var In=Se=>{var Ne=QX(),Le=x(_t(Ne)),re=C(Le),st=x(Le,3),Ue=C(st);G(()=>{q(re,u(s).dbDocs??"—"),q(Ue,u(s).dbViews??"—")}),T(Se,Ne)};$(Vi,Se=>{u(s).dbEnabled&&Se(In)})}var Fi=x(Vi,3),ti=C(Fi),Hi=x(Fi,3),A=C(Hi),K=x(Hi,3),Re=C(K);G(()=>{q(it,u(s).scripts),q(je,u(s).topics),q(Xt,u(s).mqttMsgPerSec??"—"),q(ti,u(s).handlers??"—"),q(A,u(s).memMb!=null?u(s).memMb+" MB":"—"),q(Re,u(s).cpuPercent!=null?u(s).cpuPercent+" %":"—")}),T($t,ii)},Wt=$t=>{var ii=tY();T($t,ii)};$(ct,$t=>{u(s)?$t(Me):$t(Wt,-1)})}var ni=x(ct,2),Gt=C(ni);te("click",bt,$t=>$t.stopPropagation()),te("click",Gt,()=>{k(r,!1),F()}),T(Ie,bt)};$(xn,Ie=>{u(r)&&Ie(Ln)})}var Xi=x(Cn,2);let Ke;var Ot=x(Xi,2);{var gi=Ie=>{var bt=nY();te("click",bt,P),T(Ie,bt)};$(Ot,Ie=>{u(g)==="password"&&Ie(gi)})}var xi=x(Oe,2),Li=C(xi);bs(Hg(Li,{}),Ie=>k(N,Ie,!0),()=>u(N));var sn=x(Li,2);let mn;var Kn=C(sn);{let Ie=ot(()=>u(n)==="scripts");_G(Kn,{get active(){return u(Ie)}})}var dn=x(sn,2);let An;var on=C(dn);$X(on,{});var kn=x(dn,2);let Ae;var Z=C(kn);kX(Z,{});var Fe=x(kn,2);let vt;var It=C(Fe);tX(It,{});var Nt=x(Fe,2);let O;var se=C(Nt);hZ(se,{});var be=x(Nt,2);let j;var pe=C(be);n9(pe,{});var qe=x(be,2);let xe;var Te=C(qe);a9(Te,{}),G(()=>{Rt=jt(at,1,"svelte-1n46o8q",null,Rt,{active:u(n)==="scripts"}),Qt=jt(Si,1,"svelte-1n46o8q",null,Qt,{active:u(n)==="packages"}),St=jt(Ht,1,"svelte-1n46o8q",null,St,{active:u(n)==="mqtt"}),Ii=jt(ri,1,"svelte-1n46o8q",null,Ii,{active:u(n)==="matter"}),ln=jt(Sn,1,"svelte-1n46o8q",null,ln,{active:u(n)==="db"}),cn=jt(Nn,1,"svelte-1n46o8q",null,cn,{active:u(n)==="logs"}),Ke=jt(Xi,1,"nav-settings svelte-1n46o8q",null,Ke,{active:u(n)==="config"}),mn=jt(sn,1,"page-wrap svelte-1n46o8q",null,mn,{hidden:u(n)!=="scripts"}),An=jt(dn,1,"page-wrap svelte-1n46o8q",null,An,{hidden:u(n)!=="packages"}),Ae=jt(kn,1,"page-wrap svelte-1n46o8q",null,Ae,{hidden:u(n)!=="mqtt"}),vt=jt(Fe,1,"page-wrap svelte-1n46o8q",null,vt,{hidden:u(n)!=="matter"}),O=jt(Nt,1,"page-wrap svelte-1n46o8q",null,O,{hidden:u(n)!=="db"}),j=jt(be,1,"page-wrap svelte-1n46o8q",null,j,{hidden:u(n)!=="config"}),xe=jt(qe,1,"page-wrap svelte-1n46o8q",null,xe,{hidden:u(n)!=="logs"})}),te("click",at,()=>ue("scripts")),te("click",Si,()=>ue("packages")),te("click",Ht,()=>ue("mqtt")),te("click",ri,()=>ue("matter")),te("click",Sn,()=>ue("db")),te("click",Nn,()=>ue("logs")),te("click",Zi,Ie=>{Ie.stopPropagation(),k(a,!u(a)),k(r,!1)}),te("click",zn,Ie=>{Ie.stopPropagation(),k(r,!u(r)),k(a,!1)}),te("click",Xi,()=>ue("config")),T(he,kt)};$(Ve,he=>{u(S)&&!u(p)&&he(ve)})}var tt=x(Ve,2);{var At=he=>{var kt=rY(),Oe=C(kt),at=x(C(Oe),4),Rt=x(C(at),2),Si=x(at,2);{var Qt=ri=>{var Ii=oY(),Sn=C(Ii);G(()=>q(Sn,u(_))),T(ri,Ii)};$(Si,ri=>{u(_)&&ri(Qt)})}var Ht=x(Si,2),St=C(Ht);G(()=>{Rt.disabled=u(w),Ht.disabled=u(w)||!u(v),q(St,u(w)?"Signing in…":"Sign in")}),os("submit",Oe,ri=>{ri.preventDefault(),D()}),Mi(Rt,()=>u(v),ri=>k(v,ri)),T(he,kt)};$(tt,he=>{u(p)&&he(At)})}var mt=x(tt,2);{var hi=he=>{var kt=aY();T(he,kt)};$(mt,he=>{u(V)&&he(hi)})}var Vt=x(mt,2);{var Jt=he=>{var kt=lY();T(he,kt)};$(Vt,he=>{u(h)&&he(Jt)})}T(o,Pe),Ao()}Cr(["click"]);cW(dY,{target:document.getElementById("app")});export{PT 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-Ck2pAcwb.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-Ck2pAcwb.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-6dbanXAb.css">
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -243,10 +243,11 @@ let connected = false;
|
|
|
243
243
|
|
|
244
244
|
// Deferred start — wait for retained MQTT state before running scripts
|
|
245
245
|
let _started = false;
|
|
246
|
-
let _startupTimeout = null;
|
|
247
|
-
let
|
|
248
|
-
|
|
246
|
+
let _startupTimeout = null; // fires if broker never connects
|
|
247
|
+
let _sentinelTimeout = null; // fires if sentinel never arrives after connecting
|
|
248
|
+
let _sentinelValue = null; // unique value for this boot's sentinel
|
|
249
249
|
const _STARTUP_TIMEOUT_MS = 10000; // ms to wait for broker before starting anyway
|
|
250
|
+
const _SENTINEL_TIMEOUT_MS = 10000; // ms to wait for sentinel after connecting
|
|
250
251
|
|
|
251
252
|
function startOnce(reason) {
|
|
252
253
|
if (_started) return;
|
|
@@ -255,9 +256,9 @@ function startOnce(reason) {
|
|
|
255
256
|
clearTimeout(_startupTimeout);
|
|
256
257
|
_startupTimeout = null;
|
|
257
258
|
}
|
|
258
|
-
if (
|
|
259
|
-
clearTimeout(
|
|
260
|
-
|
|
259
|
+
if (_sentinelTimeout) {
|
|
260
|
+
clearTimeout(_sentinelTimeout);
|
|
261
|
+
_sentinelTimeout = null;
|
|
261
262
|
}
|
|
262
263
|
if (reason) log.info(reason);
|
|
263
264
|
start();
|
|
@@ -346,10 +347,28 @@ if (config.url) {
|
|
|
346
347
|
mqtt.subscribe('#');
|
|
347
348
|
mqttEventCallbacks.filter((c) => c.event === 'connect').forEach((c) => c.callback());
|
|
348
349
|
|
|
349
|
-
// Arm the quiet-period timer (only needed on first connect, before scripts start)
|
|
350
350
|
if (!_started) {
|
|
351
|
-
|
|
352
|
-
|
|
351
|
+
// Cancel the “broker not connecting” startup timeout — we’re connected.
|
|
352
|
+
if (_startupTimeout) {
|
|
353
|
+
clearTimeout(_startupTimeout);
|
|
354
|
+
_startupTimeout = null;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Publish a non-retained sentinel immediately after subscribing to #.
|
|
358
|
+
// MQTT.js sends packets in order on a single TCP connection, so the
|
|
359
|
+
// broker receives SUBSCRIBE before this PUBLISH. Retained messages are
|
|
360
|
+
// queued for us when SUBSCRIBE is processed; the sentinel is queued
|
|
361
|
+
// afterwards. Receiving the sentinel means all retained messages have
|
|
362
|
+
// been delivered — deterministic, no heuristic timer needed.
|
|
363
|
+
_sentinelValue = String(Date.now());
|
|
364
|
+
mqtt.publish(config.name + '/she-sentinel', _sentinelValue, { retain: false });
|
|
365
|
+
log.debug('mqtt: waiting for retained-state sentinel');
|
|
366
|
+
|
|
367
|
+
// Fallback: if sentinel never arrives (e.g. abnormal broker behaviour)
|
|
368
|
+
_sentinelTimeout = setTimeout(() => {
|
|
369
|
+
log.warn('mqtt sentinel timeout — starting scripts without full retained state');
|
|
370
|
+
startOnce();
|
|
371
|
+
}, _SENTINEL_TIMEOUT_MS);
|
|
353
372
|
}
|
|
354
373
|
});
|
|
355
374
|
|
|
@@ -368,10 +387,12 @@ if (config.url) {
|
|
|
368
387
|
mqtt.on('message', (topic, payload, msg) => {
|
|
369
388
|
_mqttMsgCount++;
|
|
370
389
|
|
|
371
|
-
//
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
390
|
+
// Sentinel detection: a non-retained message we publish to ourselves right
|
|
391
|
+
// after subscribing to #. When it arrives, all retained messages from the
|
|
392
|
+
// broker have already been delivered and stored.
|
|
393
|
+
if (!_started && _sentinelValue !== null && !msg.retain && topic === config.name + '/she-sentinel' && payload.toString() === _sentinelValue) {
|
|
394
|
+
startOnce('mqtt: retained state ready, starting scripts');
|
|
395
|
+
return; // sentinel is internal — don’t process further
|
|
375
396
|
}
|
|
376
397
|
|
|
377
398
|
if (shedb.handleMqttMessage(topic, payload)) return;
|