@reddb-io/ui 0.3.1 → 0.3.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.
- package/build/_app/immutable/assets/0.CEQwbG0J.css +1 -0
- package/build/_app/immutable/chunks/C-kqMbRi.js +1 -0
- package/build/_app/immutable/chunks/{CLBx21Hz.js → C3SGj6Qd.js} +2 -2
- package/build/_app/immutable/chunks/{DV9PDoM3.js → C9pP73gT.js} +1 -1
- package/build/_app/immutable/chunks/{CJFJ501n.js → CEBul73-.js} +1 -1
- package/build/_app/immutable/chunks/CHvQYbpl.js +1 -0
- package/build/_app/immutable/chunks/{8zg2gJwV.js → CXuFZWQe.js} +1 -1
- package/build/_app/immutable/chunks/CgIoFKBK.js +1 -0
- package/build/_app/immutable/chunks/D02PB2u7.js +1 -0
- package/build/_app/immutable/chunks/D6XJvoMn.js +404 -0
- package/build/_app/immutable/chunks/DLDgyIn5.js +1164 -0
- package/build/_app/immutable/chunks/{Bq4DTWK2.js → DN7v3Tar.js} +1 -1
- package/build/_app/immutable/entry/{app.BDog2y0J.js → app.BBk9O_OI.js} +2 -2
- package/build/_app/immutable/entry/start.C9qfj9ex.js +1 -0
- package/build/_app/immutable/nodes/0.BBf1ZyjL.js +2 -0
- package/build/_app/immutable/nodes/1.BmVeJAGw.js +1 -0
- package/build/_app/immutable/nodes/{10.D_FCLs0Z.js → 10.DZmZgLvj.js} +1 -1
- package/build/_app/immutable/nodes/{12.DPE6v6Zf.js → 12.CzMvqoYS.js} +2 -2
- package/build/_app/immutable/nodes/15.CRwZaU1B.js +60 -0
- package/build/_app/version.json +1 -1
- package/build/index.html +13 -13
- package/dist/embed/{AnalyticsView-D8z1Nsed.js → AnalyticsView-BWwvQS2I.js} +849 -849
- package/dist/embed/{AnalyticsView-D8z1Nsed.js.map → AnalyticsView-BWwvQS2I.js.map} +1 -1
- package/dist/embed/RedUiEmbedRoot-DAB-6DEr.js +35587 -0
- package/dist/embed/RedUiEmbedRoot-DAB-6DEr.js.map +1 -0
- package/dist/embed/event-BvRbkLjD.js +46 -0
- package/dist/embed/event-BvRbkLjD.js.map +1 -0
- package/dist/embed/index-BVxMkfHe.js +8 -0
- package/dist/embed/index-BVxMkfHe.js.map +1 -0
- package/dist/embed/index-Bgo4yw4C.js +856 -0
- package/dist/embed/index-Bgo4yw4C.js.map +1 -0
- package/dist/embed/{index-client-BeiP-va5.js → index-client-BHUUkI8H.js} +121 -120
- package/dist/embed/{index-client-BeiP-va5.js.map → index-client-BHUUkI8H.js.map} +1 -1
- package/dist/embed/index.js +1 -1
- package/dist/embed/{sigma.esm-qqKBpvin.js → sigma.esm-BOgYLguI.js} +2 -2
- package/dist/embed/{sigma.esm-qqKBpvin.js.map → sigma.esm-BOgYLguI.js.map} +1 -1
- package/dist/embed/window-ZR8_mM8o.js +1889 -0
- package/dist/embed/window-ZR8_mM8o.js.map +1 -0
- package/package.json +5 -3
- package/src/app.css +5 -0
- package/src/lib/ConnectDropdown.svelte +60 -3
- package/src/lib/DevConsole.svelte +155 -0
- package/src/lib/ErrorBoundary.fixture.svelte +11 -0
- package/src/lib/ErrorBoundary.fixtures.svelte.ts +5 -0
- package/src/lib/ErrorBoundary.svelte +78 -0
- package/src/lib/ErrorBoundaryCrashChild.fixture.svelte +9 -0
- package/src/lib/LoadingOverlay.svelte +109 -0
- package/src/lib/StatusBar.svelte +19 -1
- package/src/lib/Workspace.svelte +118 -2
- package/src/lib/connections.svelte.ts +95 -1
- package/src/lib/embed/RedUiEmbedRoot.svelte +13 -8
- package/src/lib/embed/index.ts +34 -1
- package/src/lib/index.ts +7 -0
- package/src/lib/loading.svelte.ts +142 -0
- package/src/lib/reddb/client.ts +133 -15
- package/src/lib/reddb/desktop-error.ts +89 -0
- package/src/lib/reddb/dev-console.ts +186 -0
- package/src/lib/reddb/index.ts +2 -0
- package/src/lib/reddb/local-url-provider.ts +4 -8
- package/src/lib/reddb/tauri-encrypted-store.ts +4 -9
- package/src/lib/tabs.svelte.ts +5 -0
- package/src/lib/workspace-session.ts +81 -0
- package/build/_app/immutable/assets/0.DgbuWrJy.css +0 -1
- package/build/_app/immutable/chunks/85-Fh5Zp.js +0 -404
- package/build/_app/immutable/chunks/CnD4hwxC.js +0 -1106
- package/build/_app/immutable/chunks/DQCYUNtS.js +0 -1
- package/build/_app/immutable/entry/start.D1J45dq5.js +0 -1
- package/build/_app/immutable/nodes/0.BTrC4th2.js +0 -1
- package/build/_app/immutable/nodes/1.Ds1Tbjsm.js +0 -1
- package/build/_app/immutable/nodes/15.CcJlZGxa.js +0 -60
- package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js +0 -31302
- package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js.map +0 -1
- package/dist/embed/index-w1Qo_uW0.js +0 -677
- package/dist/embed/index-w1Qo_uW0.js.map +0 -1
|
@@ -1,1106 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CJFJ501n.js","./Bzak7iHL.js","./CGFL56WJ.js","./DIeogL5L.js","./Bq4DTWK2.js","./DCJ0QyYH.js","./85-Fh5Zp.js","./69_IOA4Y.js","./BRIMmWzq.js","./Btd6PFkC.js","./CLBx21Hz.js","../assets/EmptyState.RXcH7ryE.css","./DRlh90Cv.js","../assets/AnalyticsView.BLAJezw4.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var bu=Object.defineProperty;var js=t=>{throw TypeError(t)};var xu=(t,e,r)=>e in t?bu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var jt=(t,e,r)=>xu(t,typeof e!="symbol"?e+"":e,r),vi=(t,e,r)=>e.has(t)||js("Cannot "+r);var fe=(t,e,r)=>(vi(t,e,"read from private field"),r?r.call(t):e.get(t)),Fe=(t,e,r)=>e.has(t)?js("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Qr=(t,e,r,a)=>(vi(t,e,"write to private field"),a?a.call(t,r):e.set(t,r),r),Bs=(t,e,r)=>(vi(t,e,"access private method"),r);import{_ as xc,p as Ye,l as pt,s as lt,b as sr,c as Wr,r as Ur}from"./BRIMmWzq.js";import"./Bzak7iHL.js";import{a as Fr,o as Qo}from"./Btd6PFkC.js";import{aO as mu,aA as _u,b4 as yu,aF as Rr,aD as Fi,aU as wu,a2 as ku,aT as Ws,s as Su,br as qi,bx as Cu,bs as Us,ba as Eu,aK as gi,ac as Gs,e as Nu,bJ as Mu,aR as zu,as as Tu,by as Ys,X as Pu,b0 as Xs,a4 as Au,bG as L,ay as ka,Y as Lu,bd as Iu,aE as Zs,f as Ou,az as Ru,aH as Du,q as $u,aa as Vu,x as Hu,w as Fu,al as ms,bK as mr,bf as qu,ad as Ku,bk as ju,b9 as ot,bm as m,aq as ue,at as n,b6 as it,bz as _e,a6 as d,b3 as Kn,bg as l,bw as u,bN as y,b8 as Bt,b2 as Ce,bn as _s,av as Jo,bO as an,bI as er,be as Va,aC as Bu,bP as Wu,am as mc,ap as Vn,a as jn,ao as Uu}from"./CGFL56WJ.js";import{b as pi,d as De,a as v,j as x,g as tn,t as S,h as we,i as kr,v as _t,k as En,e as Gu,q as Ki}from"./Bq4DTWK2.js";import{B as Yu,i as B}from"./DCJ0QyYH.js";import{j as Ve,k as kn,e as Ke,g as Pe,r as en,d as Tn,i as aa,h as Ta,s as oa,c as ji,b as Xu,l as Jn,a as zr,C as ys,S as ei}from"./CLBx21Hz.js";import"./69_IOA4Y.js";import{q as _c,g as Ct,y as pn,I as ht,x as bt,j as Ue,c as lr,l as Qe,X as Rn,p as bn,r as Zu,h as Qu,N as Ju,S as Xn,v as _n,f as yc,k as Pa,d as ti,e as ef,G as tf,o as nf,T as rf,a as hi,z as af,L as of,P as sf,R as lf,E as Fn,F as cf,b as df,w as uf,t as ff}from"./85-Fh5Zp.js";const vf=[];function wc(t,e=!1,r=!1){return ko(t,new Map,"",vf,null,r)}function ko(t,e,r,a,o=null,s=!1){if(typeof t=="object"&&t!==null){var i=e.get(t);if(i!==void 0)return i;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(mu(t)){var c=Array(t.length);e.set(t,c),o!==null&&e.set(o,c);for(var f=0;f<t.length;f+=1){var g=t[f];f in t&&(c[f]=ko(g,e,r,a,null,s))}return c}if(_u(t)===yu){c={},e.set(t,c),o!==null&&e.set(o,c);for(var p of Object.keys(t))c[p]=ko(t[p],e,r,a,null,s);return c}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function"&&!s)return ko(t.toJSON(),e,r,a,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return t}}const Qs=0,Js=1,gf=2;function pf(t,e,r,a,o){Rr&&Fi();var s=wu(),i=Pu,c=s?Ys(i):Xs(i,!1,!1),f=s?Ys(i):Xs(i,!1,!1),g=new Yu(t);ku(()=>{var p=Gs,b=e(),h=!1;let w=Rr&&Ws(b)===(t.data===Su);if(w&&(qi(Cu()),Us(!1)),Ws(b)){var M=Au(),P=!1;const V=O=>{if(!h){P=!0,M(!1),Gs===p&&p.deactivate(),Nu.ensure();try{O()}finally{Mu(!1),zu||Tu()}}};b.then(O=>{V(()=>{gi(c,O),g.ensure(Js,a&&(k=>a(k,c)))})},O=>{V(()=>{if(gi(f,O),g.ensure(gf,o&&(k=>o(k,f))),!o)throw f.v})}),Rr?g.ensure(Qs,r):Eu(()=>{P||V(()=>{g.ensure(Qs,r)})})}else gi(c,b),g.ensure(Js,a&&(V=>a(V,c)));return w&&Us(!0),()=>{h=!0}})}function hf(t,e,r=!1,a=!1,o=!1,s=!1){var i=t,c="";if(r){var f=t;Rr&&(i=qi(ka(f)))}L(()=>{var g=Lu;if(c===(c=e()??"")){Rr&&Fi();return}if(r&&!Rr){g.nodes=null,f.innerHTML=c,c!==""&&pi(ka(f),f.lastChild);return}if(g.nodes!==null&&(Iu(g.nodes.start,g.nodes.end),g.nodes=null),c!==""){if(Rr){Zs.data;for(var p=Fi(),b=p;p!==null&&(p.nodeType!==Ou||p.data!=="");)b=p,p=Ru(p);if(p===null)throw Du(),$u;pi(Zs,b),i=qi(p);return}var h=a?Hu:o?Fu:void 0,w=Vu(a?"svg":o?"math":"template",h);w.innerHTML=c;var M=a||o?w:w.content;if(pi(ka(M),M.lastChild),a||o)for(;ka(M);)i.before(ka(M));else i.before(M)}})}function Hn(t,e,r){ms(()=>{var a=mr(()=>e(t,r==null?void 0:r())||{});if(r&&(a!=null&&a.update)){var o=!1,s={};qu(()=>{var i=r();Ku(i),o&&ju(s,i)&&(s=i,a.update(i))}),o=!0}if(a!=null&&a.destroy)return()=>a.destroy()})}var Nr,fa,Ua,Xo,kc;const Zo=class Zo{constructor(e){Fe(this,Xo);Fe(this,Nr,new WeakMap);Fe(this,fa);Fe(this,Ua);Qr(this,Ua,e)}observe(e,r){var a=fe(this,Nr).get(e)||new Set;return a.add(r),fe(this,Nr).set(e,a),Bs(this,Xo,kc).call(this).observe(e,fe(this,Ua)),()=>{var o=fe(this,Nr).get(e);o.delete(r),o.size===0&&(fe(this,Nr).delete(e),fe(this,fa).unobserve(e))}}};Nr=new WeakMap,fa=new WeakMap,Ua=new WeakMap,Xo=new WeakSet,kc=function(){return fe(this,fa)??Qr(this,fa,new ResizeObserver(e=>{for(var r of e){Zo.entries.set(r.target,r);for(var a of fe(this,Nr).get(r.target)||[])a(r)}}))},jt(Zo,"entries",new WeakMap);let Bi=Zo;var bf=new Bi({box:"border-box"});function el(t,e,r){var a=bf.observe(t,()=>r(t[e]));ms(()=>(mr(()=>r(t[e])),a))}var xf=x('<div><div class="flex items-center gap-2 svelte-1js76h4"><div class="w-2 h-2 rounded-full bg-accent shadow-[0_0_12px_var(--color-accent-glow)] svelte-1js76h4"></div> <span class="font-mono font-semibold text-fg-0 text-[15px] tracking-tight">red<span class="text-accent mx-px">·</span>ui</span></div></div>');function mf(t,e){ot(e,!0);let r=_e(!0),a=_e(0);Fr(()=>{const c=setTimeout(()=>m(a,1),20),f=setTimeout(()=>m(a,2),800),g=setTimeout(()=>{var p;m(r,!1),(p=e.onDone)==null||p.call(e)},1e3);return()=>{clearTimeout(c),clearTimeout(f),clearTimeout(g)}});var o=De(),s=ue(o);{var i=c=>{var f=xf();let g,p;L(()=>{g=Ve(f,1,"fixed inset-0 z-[9999] grid place-items-center bg-bg-0 transition-opacity duration-200 ease-out svelte-1js76h4",null,g,{"opacity-0":n(a)===2,"opacity-100":n(a)===1,"pointer-events-none":n(a)===2}),p=kn(f,"",p,{opacity:n(a)===0?0:void 0})}),v(c,f)};B(s,c=>{n(r)&&c(i)})}v(t,o),it()}var _f=x('<div class="global-progress" role="progressbar" aria-label="reddb activity" aria-valuetext="Loading"><div class="global-progress__bar"></div></div>');function yf(t,e){ot(e,!1),_c();var r=De(),a=ue(r);{var o=s=>{var i=_f();v(s,i)};B(a,s=>{Ct.active&&s(o)})}v(t,r),it()}var wf=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),tl=t=>t===!1?"false":t===!0?"true":t===0?"0":t,$n=t=>{if(!t||typeof t!="object")return!0;for(let e in t)return!1;return!0},kf=(t,e)=>{if(t===e)return!0;if(!t||!e)return!1;let r=Object.keys(t),a=Object.keys(e);if(r.length!==a.length)return!1;for(let o=0;o<r.length;o++){let s=r[o];if(!a.includes(s)||t[s]!==e[s])return!1}return!0};function Sc(t,e){for(let r=0;r<t.length;r++){let a=t[r];Array.isArray(a)?Sc(a,e):e.push(a)}}var Cc=(...t)=>{let e=[];Sc(t,e);let r=[];for(let a=0;a<e.length;a++)e[a]&&r.push(e[a]);return r},Ec=(t,e)=>{let r={};for(let a in t){let o=t[a];if(a in e){let s=e[a];Array.isArray(o)||Array.isArray(s)?r[a]=Cc(s,o):typeof o=="object"&&typeof s=="object"&&o&&s?r[a]=Ec(o,s):r[a]=s+" "+o}else r[a]=o}for(let a in e)a in t||(r[a]=e[a]);return r},Sf=/\s+/g,nl=t=>!t||typeof t!="string"?t:t.replace(Sf," ").trim(),na=null,So=null,Cf=async()=>na||So||(So=xc(()=>import("./3j4cZ58b.js"),[],import.meta.url).then(t=>(na=t,t)).catch(()=>null),So),Ef=t=>e=>{if(So&&!na)return e;if(na){let{twMerge:r,extendTailwindMerge:a}=na;return($n(t)?r:a({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(e)}try{let{twMerge:r,extendTailwindMerge:a}=wf("tailwind-merge");return na={twMerge:r,extendTailwindMerge:a},($n(t)?r:a({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}))(e)}catch{return Cf(),e}},Nf={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},Io=(...t)=>{let e=[];Nc(t,e);let r="";for(let a=0;a<e.length;a++)e[a]&&(r&&(r+=" "),r+=e[a]);return r||void 0};function Nc(t,e){for(let r=0;r<t.length;r++){let a=t[r];Array.isArray(a)?Nc(a,e):a&&e.push(a)}}var bi=null,Wi={},Ui=!1,uo=(...t)=>e=>{let r=Io(t);return!r||!e.twMerge?r:((!bi||Ui)&&(Ui=!1,bi=Ef(Wi)),bi(r)||void 0)},rl=(t,e)=>{for(let r in e)r in t?t[r]=Io(t[r],e[r]):t[r]=e[r];return t},ws=(t,e)=>{let{extend:r=null,slots:a={},variants:o={},compoundVariants:s=[],compoundSlots:i=[],defaultVariants:c={}}=t,f={...Nf,...e},g=r!=null&&r.base?Io(r.base,t==null?void 0:t.base):t==null?void 0:t.base,p=r!=null&&r.variants&&!$n(r.variants)?Ec(o,r.variants):o,b=r!=null&&r.defaultVariants&&!$n(r.defaultVariants)?{...r.defaultVariants,...c}:c;!$n(f.twMergeConfig)&&!kf(f.twMergeConfig,Wi)&&(Ui=!0,Wi=f.twMergeConfig);let h=$n(r==null?void 0:r.slots),w=$n(a)?{}:{base:Io(t==null?void 0:t.base,h&&(r==null?void 0:r.base)),...a},M=h?w:rl({...r==null?void 0:r.slots},$n(w)?{base:t==null?void 0:t.base}:w),P=$n(r==null?void 0:r.compoundVariants)?s:Cc(r==null?void 0:r.compoundVariants,s),V=k=>{if($n(p)&&$n(a)&&h)return uo(g,k==null?void 0:k.class,k==null?void 0:k.className)(f);if(P&&!Array.isArray(P))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof P}`);if(i&&!Array.isArray(i))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof i}`);let F=(C,N,_=[],z)=>{let I=_;if(typeof N=="string"){let D=nl(N).split(" ");for(let T=0;T<D.length;T++)I.push(`${C}:${D[T]}`)}else if(Array.isArray(N))for(let D=0;D<N.length;D++)I.push(`${C}:${N[D]}`);else if(typeof N=="object"&&typeof z=="string"&&z in N){let D=N[z];if(D&&typeof D=="string"){let T=nl(D).split(" "),$=[];for(let X=0;X<T.length;X++)$.push(`${C}:${T[X]}`);I[z]=I[z]?I[z].concat($):$}else if(Array.isArray(D)&&D.length>0){let T=[];for(let $=0;$<D.length;$++)T.push(`${C}:${D[$]}`);I[z]=T}}return I},U=(C,N=p,_=null,z=null)=>{let I=N[C];if(!I||$n(I))return null;let D=(z==null?void 0:z[C])??(k==null?void 0:k[C]);if(D===null)return null;let T=tl(D),$=Array.isArray(f.responsiveVariants)&&f.responsiveVariants.length>0||f.responsiveVariants===!0,X=b==null?void 0:b[C],H=[];if(typeof T=="object"&&$)for(let[ae,ge]of Object.entries(T)){let ie=I[ge];if(ae==="initial"){X=ge;continue}Array.isArray(f.responsiveVariants)&&!f.responsiveVariants.includes(ae)||(H=F(ae,ie,H,_))}let W=T!=null&&typeof T!="object"?T:tl(X),Y=I[W||"false"];return typeof H=="object"&&typeof _=="string"&&H[_]?rl(H,Y):H.length>0?(H.push(Y),_==="base"?H.join(" "):H):Y},Q=()=>{if(!p)return null;let C=Object.keys(p),N=[];for(let _=0;_<C.length;_++){let z=U(C[_],p);z&&N.push(z)}return N},se=(C,N)=>{if(!p||typeof p!="object")return null;let _=[];for(let z in p){let I=U(z,p,C,N),D=C==="base"&&typeof I=="string"?I:I&&I[C];D&&_.push(D)}return _},xe={};for(let C in k){let N=k[C];N!==void 0&&(xe[C]=N)}let le=(C,N)=>{var z;let _=typeof(k==null?void 0:k[C])=="object"?{[C]:(z=k[C])==null?void 0:z.initial}:{};return{...b,...xe,..._,...N}},te=(C=[],N)=>{let _=[],z=C.length;for(let I=0;I<z;I++){let{class:D,className:T,...$}=C[I],X=!0,H=le(null,N);for(let W in $){let Y=$[W],ae=H[W];if(Array.isArray(Y)){if(!Y.includes(ae)){X=!1;break}}else{if((Y==null||Y===!1)&&(ae==null||ae===!1))continue;if(ae!==Y){X=!1;break}}}X&&(D&&_.push(D),T&&_.push(T))}return _},be=C=>{let N=te(P,C);if(!Array.isArray(N))return N;let _={},z=uo;for(let I=0;I<N.length;I++){let D=N[I];if(typeof D=="string")_.base=z(_.base,D)(f);else if(typeof D=="object")for(let T in D)_[T]=z(_[T],D[T])(f)}return _},K=C=>{if(i.length<1)return null;let N={},_=le(null,C);for(let z=0;z<i.length;z++){let{slots:I=[],class:D,className:T,...$}=i[z];if(!$n($)){let X=!0;for(let H in $){let W=_[H],Y=$[H];if(W===void 0||(Array.isArray(Y)?!Y.includes(W):Y!==W)){X=!1;break}}if(!X)continue}for(let X=0;X<I.length;X++){let H=I[X];N[H]||(N[H]=[]),N[H].push([D,T])}}return N};if(!$n(a)||!h){let C={};if(typeof M=="object"&&!$n(M)){let N=uo;for(let _ in M)C[_]=z=>{let I=be(z),D=K(z);return N(M[_],se(_,z),I?I[_]:void 0,D?D[_]:void 0,z==null?void 0:z.class,z==null?void 0:z.className)(f)}}return C}return uo(g,Q(),te(P),k==null?void 0:k.class,k==null?void 0:k.className)(f)},O=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return V.variantKeys=O(),V.extend=r,V.base=g,V.slots=M,V.variants=p,V.defaultVariants=b,V.compoundSlots=i,V.compoundVariants=P,V};ws({base:"inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium tracking-tight border border-transparent cursor-pointer transition-[background,border-color,color,box-shadow] duration-150 active:scale-[0.98] disabled:opacity-40 disabled:cursor-not-allowed disabled:active:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40",variants:{variant:{primary:"bg-accent text-white shadow-[0_0_0_1px_var(--color-accent),0_4px_14px_-4px_var(--color-accent-glow)] hover:bg-[#ff3868] hover:shadow-[0_0_0_1px_#ff3868,0_6px_18px_-4px_var(--color-accent-glow)]",ghost:"bg-bg-2 text-fg-1 border-line-2 hover:bg-bg-3 hover:text-fg-0 hover:border-line-3",danger:"bg-danger text-white hover:bg-[#ff6f88]"},size:{sm:"h-6 px-2.5 text-[11px]",md:"h-7 px-3 text-[12px]",lg:"h-8 px-4 text-[13px]"}},defaultVariants:{variant:"ghost",size:"md"}});tn(["click"]);const Mf=ws({base:"inline-flex items-center px-1.5 py-px rounded-full text-[10px] font-medium font-mono uppercase tracking-[0.06em] border",variants:{tone:{neutral:"bg-bg-2 text-fg-2 border-line-2",ok:"bg-ok/15 text-ok border-ok/30",warn:"bg-warn/15 text-warn border-warn/30",danger:"bg-danger/15 text-danger border-danger/30",info:"bg-info/15 text-info border-info/30",accent:"bg-accent/15 text-accent border-accent/30"}},defaultVariants:{tone:"neutral"}});var zf=x("<span><!></span>");function Wn(t,e){ot(e,!0);let r=Ye(e,"tone",3,"neutral"),a=Ye(e,"class",3,"");var o=zf(),s=d(o);pn(s,()=>e.children??Kn),l(o),L(i=>Ve(o,1,i),[()=>Ke(Mf({tone:r(),class:a()}))]),v(t,o),it()}var Tf=x('<header class="px-4 h-9 flex items-center font-mono text-[10px] uppercase tracking-[0.1em] text-fg-2 border-b border-line-1 bg-bg-1"> </header>'),Pf=x('<section><!> <div class="p-4"><!></div></section>');function Cr(t,e){let r=Ye(e,"floating",3,!1),a=Ye(e,"class",3,"");const o=y(()=>r()?"bg-bg-1/[0.92] border-line-2 shadow-[0_16px_48px_rgba(0,0,0,0.6)]":"bg-bg-1 border-line-1");var s=Pf(),i=d(s);{var c=p=>{var b=Tf(),h=d(b,!0);l(b),L(()=>S(h,e.title)),v(p,b)};B(i,p=>{e.title&&p(c)})}var f=u(i,2),g=d(f);pn(g,()=>e.children??Kn),l(f),l(s),L(()=>Ve(s,1,`rounded-lg border overflow-hidden backdrop-blur-md ${n(o)??""} ${a()??""}`)),v(t,s)}var Af=x('<span class="inline-flex items-center gap-1.5 font-mono text-[11px] text-fg-1 uppercase tracking-[0.06em]"><span></span> <span> </span></span>');function Lf(t,e){ot(e,!0);const r=y(()=>({primary:"bg-role-primary text-role-primary",replica:"bg-role-replica text-role-replica",embedded:"bg-role-embedded text-role-embedded"})[e.role]);var a=Af(),o=d(a),s=u(o,2),i=d(s,!0);l(s),l(a),L(()=>{Ve(o,1,`w-1.5 h-1.5 rounded-full ${n(r)??""} shadow-[0_0_0_3px_currentColor]/20`),S(i,e.label??e.role)}),v(t,a),it()}var If=x('<kbd class="inline-flex items-center justify-center min-w-[18px] h-[18px] px-1.5 font-mono text-[10px] text-fg-1 bg-bg-2 border border-line-2 border-b-2 rounded-sm"><!></kbd>');function Un(t,e){var r=If(),a=d(r);pn(a,()=>e.children??Kn),l(r),v(t,r)}tn(["click"]);var Of=x('<span class="shrink-0 font-mono text-[11px] text-fg-2"> </span>'),Rf=x('<p class="mt-0.5 text-[12px] leading-snug text-fg-2"> </p>'),Df=x("<div><!></div>"),$f=x('<div class="w-full"><!></div>'),Vf=x('<div><div><div class="min-w-0"><div class="flex items-baseline gap-2"><span class="truncate text-[13px] text-fg-0"> </span> <!></div> <!></div></div> <!> <!></div>');function pr(t,e){ot(e,!0);let r=Ye(e,"wide",3,!1),a=Ye(e,"class",3,"");var o=Vf(),s=d(o),i=d(s),c=d(i),f=d(c),g=d(f,!0);l(f);var p=u(f,2);{var b=k=>{var F=Of(),U=d(F,!0);l(F),L(()=>S(U,e.hint)),v(k,F)};B(p,k=>{e.hint&&k(b)})}l(c);var h=u(c,2);{var w=k=>{var F=Rf(),U=d(F,!0);l(F),L(()=>S(U,e.description)),v(k,F)};B(h,k=>{e.description&&k(w)})}l(i),l(s);var M=u(s,2);{var P=k=>{var F=Df(),U=d(F);pn(U,()=>e.action),l(F),L(Q=>Ve(F,1,Q),[()=>Ke(["flex items-center gap-2",r()?"w-full":"shrink-0"].join(" "))]),v(k,F)};B(M,k=>{e.action&&k(P)})}var V=u(M,2);{var O=k=>{var F=$f(),U=d(F);pn(U,()=>e.below),l(F),v(k,F)};B(V,k=>{e.below&&k(O)})}l(o),L((k,F)=>{Pe(o,"data-wide",r()?"":void 0),Ve(o,1,k),Ve(s,1,F),S(g,e.title)},[()=>Ke(["px-3 py-2.5",r()?"flex flex-col gap-2":"flex items-center gap-3",a()].join(" ")),()=>Ke(["flex min-w-0 items-baseline gap-2",r()?"":"flex-1"].join(" "))]),v(t,o),it()}var Hf=x('<span class="flex size-4 shrink-0 items-center justify-center text-fg-2"><!></span>'),Ff=x('<span class="ml-0.5"><!></span>'),qf=x('<div><!> <h2 class="text-[11px] font-mono uppercase tracking-[0.1em] text-fg-2"> </h2> <!></div>');function fo(t,e){let r=Ye(e,"class",3,"");var a=qf(),o=d(a);{var s=p=>{var b=Hf(),h=d(b);pn(h,()=>e.icon),l(b),v(p,b)};B(o,p=>{e.icon&&p(s)})}var i=u(o,2),c=d(i,!0);l(i);var f=u(i,2);{var g=p=>{var b=Ff(),h=d(b);pn(h,()=>e.meta),l(b),v(p,b)};B(f,p=>{e.meta&&p(g)})}l(a),L(()=>{Ve(a,1,`flex items-center gap-2 ${r()??""}`),S(c,e.title)}),v(t,a)}const Kf=ws({base:"inline-flex items-center gap-1 px-1.5 h-[18px] rounded-full text-[11px] font-mono leading-none border",variants:{tone:{muted:"bg-bg-2 text-fg-2 border-line-2",accent:"bg-accent/15 text-accent border-accent/30"}},defaultVariants:{tone:"muted"}});var jf=x("<span><!></span>");function Pr(t,e){ot(e,!0);let r=Ye(e,"tone",3,"muted"),a=Ye(e,"class",3,"");var o=jf(),s=d(o);pn(s,()=>e.children??Kn),l(o),L(i=>Ve(o,1,i),[()=>Ke(Kf({tone:r(),class:a()}))]),v(t,o),it()}var Bf=x('<span class="flex size-3.5 shrink-0 items-center justify-center"><!></span>'),Wf=x('<span class="shrink-0"><!></span>'),Uf=x('<a><!> <span class="flex-1 truncate"> </span> <!></a>'),Gf=x('<span class="flex size-3.5 shrink-0 items-center justify-center"><!></span>'),Yf=x('<span class="shrink-0"><!></span>'),Xf=x('<button type="button"><!> <span class="flex-1 truncate"> </span> <!></button>');function Zf(t,e){ot(e,!0);let r=Ye(e,"active",3,!1),a=Ye(e,"class",3,"");const o=y(()=>["inline-flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] transition-colors",r()?"bg-bg-2 text-fg-0":"text-fg-2 hover:bg-bg-2 hover:text-fg-0",a()].join(" "));var s=De(),i=ue(s);{var c=g=>{var p=Uf(),b=d(p);{var h=O=>{var k=Bf(),F=d(k);pn(F,()=>e.icon),l(k),v(O,k)};B(b,O=>{e.icon&&O(h)})}var w=u(b,2),M=d(w,!0);l(w);var P=u(w,2);{var V=O=>{var k=Wf(),F=d(k);pn(F,()=>e.trailing),l(k),v(O,k)};B(P,O=>{e.trailing&&O(V)})}l(p),L(()=>{Pe(p,"href",e.href),Pe(p,"aria-current",r()?"page":void 0),Ve(p,1,Ke(n(o))),S(M,e.label)}),we("click",p,function(...O){var k;(k=e.onclick)==null||k.apply(this,O)}),v(g,p)},f=g=>{var p=Xf(),b=d(p);{var h=O=>{var k=Gf(),F=d(k);pn(F,()=>e.icon),l(k),v(O,k)};B(b,O=>{e.icon&&O(h)})}var w=u(b,2),M=d(w,!0);l(w);var P=u(w,2);{var V=O=>{var k=Yf(),F=d(k);pn(F,()=>e.trailing),l(k),v(O,k)};B(P,O=>{e.trailing&&O(V)})}l(p),L(()=>{Pe(p,"aria-current",r()?"page":void 0),Ve(p,1,Ke(n(o))),S(M,e.label)}),we("click",p,function(...O){var k;(k=e.onclick)==null||k.apply(this,O)}),v(g,p)};B(i,g=>{e.href?g(c):g(f,-1)})}v(t,s),it()}tn(["click"]);function ks(t){return!!t&&typeof t=="object"&&t.available===!1}function Bn(t){if(!(t==null||ks(t)))return t}function Qf(t){return ks(t)?t.reason:void 0}function Jf(t,e,r){var s,i,c;const a=Bn((s=t==null?void 0:t.deployment)==null?void 0:s.process_role)??Bn((i=t==null?void 0:t.replication)==null?void 0:i.role)??(e==null?void 0:e.role);if(a==="primary"||a==="replica")return"replicated";const o=Bn((c=t==null?void 0:t.deployment)==null?void 0:c.shape);return o==="serverless"?"serverless":o==="embedded"||o==="file"?"embedded":o==="server"?"server":r==="primary"||r==="replica"?"replicated":r==="embedded"?"embedded":r==="standalone"||r==="server"?"server":"unknown"}function ev(t){const e=t==null?void 0:t.started_at_unix_ms,r=t==null?void 0:t.ready_at_unix_ms;if(e===void 0||r===void 0)return null;const a=r-e;return a>=0?a:null}function tv(t){const e=t==null?void 0:t.replicas;if(!e||e.length===0)return null;let r=0,a=!1;for(const o of e)typeof o.lag_seconds=="number"&&Number.isFinite(o.lag_seconds)&&(r=Math.max(r,o.lag_seconds),a=!0);return a?r:null}function nv(t){if(!t)return[];const e=[],r=(a,o,s)=>{if(ks(a)){e.push({path:o,reason:a.reason});return}if(!(s>=4||!a||typeof a!="object"||Array.isArray(a)))for(const[i,c]of Object.entries(a))r(c,o?`${o}.${i}`:i,s+1)};return r(t,"",0),e}const al=/\[\^(\d+)\]/g;function rv(t){const e=[],r=[],a=/```[\s\S]*?```|`[^`\n]*`/g;let o;for(;(o=a.exec(t))!==null;)r.push([o.index,o.index+o[0].length]);const s=f=>r.some(([g,p])=>f>=g&&f<p);let i=0,c;for(al.lastIndex=0;(c=al.exec(t))!==null;){const f=c.index;f>0&&t[f-1]==="\\"||s(f)||(f>i&&e.push({type:"text",value:t.slice(i,f)}),e.push({type:"cite",marker:Number(c[1])}),i=f+c[0].length)}return i<t.length&&e.push({type:"text",value:t.slice(i)}),e.map(f=>f.type==="text"?{type:"text",value:f.value.replace(/\\([[\]])/g,"$1")}:f)}function av(t){const e=/^reddb:([^/]+)\/(.+?)(?:#.*)?$/.exec(t);return e?{collection:e[1],id:e[2]}:null}const ov=[1e3,2e3,4e3,8e3,3e4];class iv{constructor(e){this.opts=e}subscribe(e={}){return new sv(this,e)}buildSseUrl(e,r){const a=this.opts.client.baseUrl??"",o=new URLSearchParams;r>0&&o.set("since",String(r)),e&&o.set("collection",e);const s=o.toString();return`${a}/changes/stream${s?`?${s}`:""}`}}class sv{constructor(e,r){jt(this,"events");jt(this,"controller");jt(this,"closed",!1);jt(this,"lastSeenLsn");jt(this,"currentSse",null);jt(this,"pollTimer",null);jt(this,"reconnectTimer",null);jt(this,"backoffIdx",0);jt(this,"transport",null);this.parent=e,this.opts=r,this.lastSeenLsn=r.sinceLsn??0,this.events=new ReadableStream({start:a=>{this.controller=a},cancel:()=>this.close()}),this.connect()}timers(){return this.parent.opts.timers??{setTimeout:(e,r)=>globalThis.setTimeout(e,r),clearTimeout:e=>globalThis.clearTimeout(e)}}async connect(){if(!this.closed){if(this.transport===null){const e=this.parent.opts.sseFactory;if(e==null)this.transport="rest";else{const r=this.parent.opts.sseProbe??(async()=>!0);let a=!1;try{a=await r()}catch{a=!1}if(this.closed)return;this.transport=a?"sse":"rest"}}this.transport==="sse"?this.startSse():this.startRest()}}startSse(){const e=this.parent.opts.sseFactory;if(!e){this.transport="rest",this.startRest();return}const r=this.parent.buildSseUrl(this.opts.collection,this.lastSeenLsn);let a;try{a=e(r)}catch{this.scheduleReconnect();return}this.currentSse=a,a.onopen=()=>{this.backoffIdx=0},a.onmessage=o=>{try{const s=JSON.parse(o.data);this.emit(s)}catch{}},a.onerror=()=>{if(!this.closed){try{a.close()}catch{}this.currentSse===a&&(this.currentSse=null),this.scheduleReconnect()}}}startRest(){const e=async()=>{if(!this.closed)try{const r=this.opts.collection?await this.parent.opts.client.changes(this.lastSeenLsn,{collection:this.opts.collection}):await this.parent.opts.client.changes(this.lastSeenLsn);if(this.closed)return;for(const o of r)this.emit(o);this.backoffIdx=0;const a=this.parent.opts.pollIntervalMs??1e3;this.pollTimer=this.timers().setTimeout(()=>{this.pollTimer=null,e()},a)}catch{if(this.closed)return;this.scheduleReconnect()}};e()}emit(e){if(!this.closed&&!(e.lsn<=this.lastSeenLsn)){this.lastSeenLsn=e.lsn;try{this.controller.enqueue(e)}catch{this.close()}}}scheduleReconnect(){if(this.closed)return;const e=this.parent.opts.backoffMs??ov,r=e[Math.min(this.backoffIdx,e.length-1)];this.backoffIdx++,this.reconnectTimer=this.timers().setTimeout(()=>{this.reconnectTimer=null,this.transport==="sse"?this.startSse():this.startRest()},r)}close(){if(this.closed)return;if(this.closed=!0,this.currentSse){try{this.currentSse.close()}catch{}this.currentSse=null}const{clearTimeout:e}=this.timers();this.pollTimer&&(e(this.pollTimer),this.pollTimer=null),this.reconnectTimer&&(e(this.reconnectTimer),this.reconnectTimer=null);try{this.controller.close()}catch{}}}function Ha(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
3
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* ISC License
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
8
|
-
*
|
|
9
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
10
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
11
|
-
* copyright notice and this permission notice appear in all copies.
|
|
12
|
-
*
|
|
13
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
14
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
15
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
16
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
17
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
18
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
19
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
-
*
|
|
21
|
-
*/const a=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}]];ht(t,lt({name:"activity"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function lv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
22
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* ISC License
|
|
25
|
-
*
|
|
26
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
27
|
-
*
|
|
28
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
29
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
30
|
-
* copyright notice and this permission notice appear in all copies.
|
|
31
|
-
*
|
|
32
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
33
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
34
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
35
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
36
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
37
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
38
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
39
|
-
*
|
|
40
|
-
*/const a=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]];ht(t,lt({name:"arrow-right"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function va(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
41
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
42
|
-
*
|
|
43
|
-
* ISC License
|
|
44
|
-
*
|
|
45
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
46
|
-
*
|
|
47
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
48
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
49
|
-
* copyright notice and this permission notice appear in all copies.
|
|
50
|
-
*
|
|
51
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
52
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
53
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
54
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
55
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
56
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
57
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
58
|
-
*
|
|
59
|
-
*/const a=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}]];ht(t,lt({name:"braces"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function cv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
60
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
61
|
-
*
|
|
62
|
-
* ISC License
|
|
63
|
-
*
|
|
64
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
65
|
-
*
|
|
66
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
67
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
68
|
-
* copyright notice and this permission notice appear in all copies.
|
|
69
|
-
*
|
|
70
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
71
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
72
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
73
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
74
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
75
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
76
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
77
|
-
*
|
|
78
|
-
*/const a=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2"}],["path",{d:"M10 6h4"}],["path",{d:"M10 10h4"}],["path",{d:"M10 14h4"}],["path",{d:"M10 18h4"}]];ht(t,lt({name:"building-2"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function dv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
79
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
80
|
-
*
|
|
81
|
-
* ISC License
|
|
82
|
-
*
|
|
83
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
84
|
-
*
|
|
85
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
86
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
87
|
-
* copyright notice and this permission notice appear in all copies.
|
|
88
|
-
*
|
|
89
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
90
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
91
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
92
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
93
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
94
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
95
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
96
|
-
*
|
|
97
|
-
*/const a=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"M18 17V9"}],["path",{d:"M13 17V5"}],["path",{d:"M8 17v-3"}]];ht(t,lt({name:"chart-column"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Mc(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
98
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
99
|
-
*
|
|
100
|
-
* ISC License
|
|
101
|
-
*
|
|
102
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
103
|
-
*
|
|
104
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
105
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
106
|
-
* copyright notice and this permission notice appear in all copies.
|
|
107
|
-
*
|
|
108
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
109
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
110
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
111
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
112
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
113
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
114
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
115
|
-
*
|
|
116
|
-
*/const a=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"m19 9-5 5-4-4-3 3"}]];ht(t,lt({name:"chart-line"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function uv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
117
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* ISC License
|
|
120
|
-
*
|
|
121
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
122
|
-
*
|
|
123
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
124
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
125
|
-
* copyright notice and this permission notice appear in all copies.
|
|
126
|
-
*
|
|
127
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
128
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
129
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
130
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
131
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
132
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
133
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
134
|
-
*
|
|
135
|
-
*/const a=[["path",{d:"M20 6 9 17l-5-5"}]];ht(t,lt({name:"check"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function fv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
136
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* ISC License
|
|
139
|
-
*
|
|
140
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
141
|
-
*
|
|
142
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
143
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
144
|
-
* copyright notice and this permission notice appear in all copies.
|
|
145
|
-
*
|
|
146
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
147
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
148
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
149
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
150
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
151
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
152
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
153
|
-
*
|
|
154
|
-
*/const a=[["path",{d:"m6 9 6 6 6-6"}]];ht(t,lt({name:"chevron-down"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function ia(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
155
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* ISC License
|
|
158
|
-
*
|
|
159
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
160
|
-
*
|
|
161
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
162
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
163
|
-
* copyright notice and this permission notice appear in all copies.
|
|
164
|
-
*
|
|
165
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
166
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
167
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
168
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
169
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
170
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
171
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
172
|
-
*
|
|
173
|
-
*/const a=[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]];ht(t,lt({name:"circle-alert"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Ss(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
174
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
175
|
-
*
|
|
176
|
-
* ISC License
|
|
177
|
-
*
|
|
178
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
179
|
-
*
|
|
180
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
181
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
182
|
-
* copyright notice and this permission notice appear in all copies.
|
|
183
|
-
*
|
|
184
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
185
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
186
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
187
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
188
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
189
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
190
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
191
|
-
*
|
|
192
|
-
*/const a=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];ht(t,lt({name:"circle-check"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function vv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
193
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
194
|
-
*
|
|
195
|
-
* ISC License
|
|
196
|
-
*
|
|
197
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
198
|
-
*
|
|
199
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
200
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
201
|
-
* copyright notice and this permission notice appear in all copies.
|
|
202
|
-
*
|
|
203
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
204
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
205
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
206
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
207
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
208
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
209
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
210
|
-
*
|
|
211
|
-
*/const a=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m15 9-6 6"}],["path",{d:"m9 9 6 6"}]];ht(t,lt({name:"circle-x"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function gv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
212
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* ISC License
|
|
215
|
-
*
|
|
216
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
217
|
-
*
|
|
218
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
219
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
220
|
-
* copyright notice and this permission notice appear in all copies.
|
|
221
|
-
*
|
|
222
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
223
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
224
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
225
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
226
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
227
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
228
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
229
|
-
*
|
|
230
|
-
*/const a=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}],["path",{d:"M12 11h4"}],["path",{d:"M12 16h4"}],["path",{d:"M8 11h.01"}],["path",{d:"M8 16h.01"}]];ht(t,lt({name:"clipboard-list"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function pv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
231
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* ISC License
|
|
234
|
-
*
|
|
235
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
236
|
-
*
|
|
237
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
238
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
239
|
-
* copyright notice and this permission notice appear in all copies.
|
|
240
|
-
*
|
|
241
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
242
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
243
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
244
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
245
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
246
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
247
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
248
|
-
*
|
|
249
|
-
*/const a=[["circle",{cx:"12",cy:"12",r:"10"}],["polyline",{points:"12 6 12 12 16 14"}]];ht(t,lt({name:"clock"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function hv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
250
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* ISC License
|
|
253
|
-
*
|
|
254
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
255
|
-
*
|
|
256
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
257
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
258
|
-
* copyright notice and this permission notice appear in all copies.
|
|
259
|
-
*
|
|
260
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
261
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
262
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
263
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
264
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
265
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
266
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
267
|
-
*
|
|
268
|
-
*/const a=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"M15 3v18"}]];ht(t,lt({name:"columns-3"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function bv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
269
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
270
|
-
*
|
|
271
|
-
* ISC License
|
|
272
|
-
*
|
|
273
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
274
|
-
*
|
|
275
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
276
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
277
|
-
* copyright notice and this permission notice appear in all copies.
|
|
278
|
-
*
|
|
279
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
280
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
281
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
282
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
283
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
284
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
285
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
286
|
-
*
|
|
287
|
-
*/const a=[["polyline",{points:"9 10 4 15 9 20"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4"}]];ht(t,lt({name:"corner-down-left"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Oo(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
288
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
289
|
-
*
|
|
290
|
-
* ISC License
|
|
291
|
-
*
|
|
292
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
293
|
-
*
|
|
294
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
295
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
296
|
-
* copyright notice and this permission notice appear in all copies.
|
|
297
|
-
*
|
|
298
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
299
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
300
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
301
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
302
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
303
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
304
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
305
|
-
*
|
|
306
|
-
*/const a=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 21 12"}]];ht(t,lt({name:"database"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function xv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
307
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* ISC License
|
|
310
|
-
*
|
|
311
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
312
|
-
*
|
|
313
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
314
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
315
|
-
* copyright notice and this permission notice appear in all copies.
|
|
316
|
-
*
|
|
317
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
318
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
319
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
320
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
321
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
322
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
323
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
324
|
-
*
|
|
325
|
-
*/const a=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["polyline",{points:"7 10 12 15 17 10"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3"}]];ht(t,lt({name:"download"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function zc(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
326
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* ISC License
|
|
329
|
-
*
|
|
330
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
331
|
-
*
|
|
332
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
333
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
334
|
-
* copyright notice and this permission notice appear in all copies.
|
|
335
|
-
*
|
|
336
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
337
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
338
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
339
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
340
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
341
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
342
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
343
|
-
*
|
|
344
|
-
*/const a=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];ht(t,lt({name:"eye-off"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Tc(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
345
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* ISC License
|
|
348
|
-
*
|
|
349
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
350
|
-
*
|
|
351
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
352
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
353
|
-
* copyright notice and this permission notice appear in all copies.
|
|
354
|
-
*
|
|
355
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
356
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
357
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
358
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
359
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
360
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
361
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
362
|
-
*
|
|
363
|
-
*/const a=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];ht(t,lt({name:"eye"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Pc(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
364
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
365
|
-
*
|
|
366
|
-
* ISC License
|
|
367
|
-
*
|
|
368
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
369
|
-
*
|
|
370
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
371
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
372
|
-
* copyright notice and this permission notice appear in all copies.
|
|
373
|
-
*
|
|
374
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
375
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
376
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
377
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
378
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
379
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
380
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
381
|
-
*
|
|
382
|
-
*/const a=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"m5 12-3 3 3 3"}],["path",{d:"m9 18 3-3-3-3"}]];ht(t,lt({name:"file-code-2"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function mv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
383
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
384
|
-
*
|
|
385
|
-
* ISC License
|
|
386
|
-
*
|
|
387
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
388
|
-
*
|
|
389
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
390
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
391
|
-
* copyright notice and this permission notice appear in all copies.
|
|
392
|
-
*
|
|
393
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
394
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
395
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
396
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
397
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
398
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
399
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
400
|
-
*
|
|
401
|
-
*/const a=[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}],["path",{d:"M8 18h1"}]];ht(t,lt({name:"file-pen-line"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function _v(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
402
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
403
|
-
*
|
|
404
|
-
* ISC License
|
|
405
|
-
*
|
|
406
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
407
|
-
*
|
|
408
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
409
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
410
|
-
* copyright notice and this permission notice appear in all copies.
|
|
411
|
-
*
|
|
412
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
413
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
414
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
415
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
416
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
417
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
418
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
419
|
-
*
|
|
420
|
-
*/const a=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];ht(t,lt({name:"file-text"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Ac(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
421
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* ISC License
|
|
424
|
-
*
|
|
425
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
426
|
-
*
|
|
427
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
428
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
429
|
-
* copyright notice and this permission notice appear in all copies.
|
|
430
|
-
*
|
|
431
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
432
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
433
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
434
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
435
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
436
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
437
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
438
|
-
*
|
|
439
|
-
*/const a=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"}]];ht(t,lt({name:"filter"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Lc(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
440
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
441
|
-
*
|
|
442
|
-
* ISC License
|
|
443
|
-
*
|
|
444
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
445
|
-
*
|
|
446
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
447
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
448
|
-
* copyright notice and this permission notice appear in all copies.
|
|
449
|
-
*
|
|
450
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
451
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
452
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
453
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
454
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
455
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
456
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
457
|
-
*
|
|
458
|
-
*/const a=[["path",{d:"m12 14 4-4"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}]];ht(t,lt({name:"gauge"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function yv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
459
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
460
|
-
*
|
|
461
|
-
* ISC License
|
|
462
|
-
*
|
|
463
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
464
|
-
*
|
|
465
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
466
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
467
|
-
* copyright notice and this permission notice appear in all copies.
|
|
468
|
-
*
|
|
469
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
470
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
471
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
472
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
473
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
474
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
475
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
476
|
-
*
|
|
477
|
-
*/const a=[["line",{x1:"6",x2:"6",y1:"3",y2:"15"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}],["path",{d:"M18 9a9 9 0 0 1-9 9"}]];ht(t,lt({name:"git-branch"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function wv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
478
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
479
|
-
*
|
|
480
|
-
* ISC License
|
|
481
|
-
*
|
|
482
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
483
|
-
*
|
|
484
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
485
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
486
|
-
* copyright notice and this permission notice appear in all copies.
|
|
487
|
-
*
|
|
488
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
489
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
490
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
491
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
492
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
493
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
494
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
495
|
-
*
|
|
496
|
-
*/const a=[["circle",{cx:"12",cy:"12",r:"3"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12"}]];ht(t,lt({name:"git-commit-horizontal"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Gi(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
497
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
498
|
-
*
|
|
499
|
-
* ISC License
|
|
500
|
-
*
|
|
501
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
502
|
-
*
|
|
503
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
504
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
505
|
-
* copyright notice and this permission notice appear in all copies.
|
|
506
|
-
*
|
|
507
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
508
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
509
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
510
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
511
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
512
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
513
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
514
|
-
*
|
|
515
|
-
*/const a=[["circle",{cx:"5",cy:"6",r:"3"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7"}],["path",{d:"m15 9-3-3 3-3"}],["circle",{cx:"19",cy:"18",r:"3"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9"}],["path",{d:"m9 15 3 3-3 3"}]];ht(t,lt({name:"git-compare-arrows"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function kv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
516
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
517
|
-
*
|
|
518
|
-
* ISC License
|
|
519
|
-
*
|
|
520
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
521
|
-
*
|
|
522
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
523
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
524
|
-
* copyright notice and this permission notice appear in all copies.
|
|
525
|
-
*
|
|
526
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
527
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
528
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
529
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
530
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
531
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
532
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
533
|
-
*
|
|
534
|
-
*/const a=[["line",{x1:"22",x2:"2",y1:"12",y2:"12"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16"}]];ht(t,lt({name:"hard-drive"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Na(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
535
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
536
|
-
*
|
|
537
|
-
* ISC License
|
|
538
|
-
*
|
|
539
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
540
|
-
*
|
|
541
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
542
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
543
|
-
* copyright notice and this permission notice appear in all copies.
|
|
544
|
-
*
|
|
545
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
546
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
547
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
548
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
549
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
550
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
551
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
552
|
-
*
|
|
553
|
-
*/const a=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor"}]];ht(t,lt({name:"key-round"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Sv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
554
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
555
|
-
*
|
|
556
|
-
* ISC License
|
|
557
|
-
*
|
|
558
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
559
|
-
*
|
|
560
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
561
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
562
|
-
* copyright notice and this permission notice appear in all copies.
|
|
563
|
-
*
|
|
564
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
565
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
566
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
567
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
568
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
569
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
570
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
571
|
-
*
|
|
572
|
-
*/const a=[["path",{d:"M3 6h18"}],["path",{d:"M7 12h10"}],["path",{d:"M10 18h4"}]];ht(t,lt({name:"list-filter"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Cv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
573
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
574
|
-
*
|
|
575
|
-
* ISC License
|
|
576
|
-
*
|
|
577
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
578
|
-
*
|
|
579
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
580
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
581
|
-
* copyright notice and this permission notice appear in all copies.
|
|
582
|
-
*
|
|
583
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
584
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
585
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
586
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
587
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
588
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
589
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
590
|
-
*
|
|
591
|
-
*/const a=[["path",{d:"M21 12h-8"}],["path",{d:"M21 6H8"}],["path",{d:"M21 18h-8"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3"}]];ht(t,lt({name:"list-tree"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Ev(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
592
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
593
|
-
*
|
|
594
|
-
* ISC License
|
|
595
|
-
*
|
|
596
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
597
|
-
*
|
|
598
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
599
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
600
|
-
* copyright notice and this permission notice appear in all copies.
|
|
601
|
-
*
|
|
602
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
603
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
604
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
605
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
606
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
607
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
608
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
609
|
-
*
|
|
610
|
-
*/const a=[["path",{d:"M3 12h.01"}],["path",{d:"M3 18h.01"}],["path",{d:"M3 6h.01"}],["path",{d:"M8 12h13"}],["path",{d:"M8 18h13"}],["path",{d:"M8 6h13"}]];ht(t,lt({name:"list"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Gr(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
611
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
612
|
-
*
|
|
613
|
-
* ISC License
|
|
614
|
-
*
|
|
615
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
616
|
-
*
|
|
617
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
618
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
619
|
-
* copyright notice and this permission notice appear in all copies.
|
|
620
|
-
*
|
|
621
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
622
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
623
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
624
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
625
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
626
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
627
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
628
|
-
*
|
|
629
|
-
*/const a=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}]];ht(t,lt({name:"lock"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Nv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
630
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
631
|
-
*
|
|
632
|
-
* ISC License
|
|
633
|
-
*
|
|
634
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
635
|
-
*
|
|
636
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
637
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
638
|
-
* copyright notice and this permission notice appear in all copies.
|
|
639
|
-
*
|
|
640
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
641
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
642
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
643
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
644
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
645
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
646
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
647
|
-
*
|
|
648
|
-
*/const a=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"}]];ht(t,lt({name:"moon"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Mv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
649
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
650
|
-
*
|
|
651
|
-
* ISC License
|
|
652
|
-
*
|
|
653
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
654
|
-
*
|
|
655
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
656
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
657
|
-
* copyright notice and this permission notice appear in all copies.
|
|
658
|
-
*
|
|
659
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
660
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
661
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
662
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
663
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
664
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
665
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
666
|
-
*
|
|
667
|
-
*/const a=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}]];ht(t,lt({name:"pause"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Ic(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
668
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
669
|
-
*
|
|
670
|
-
* ISC License
|
|
671
|
-
*
|
|
672
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
673
|
-
*
|
|
674
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
675
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
676
|
-
* copyright notice and this permission notice appear in all copies.
|
|
677
|
-
*
|
|
678
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
679
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
680
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
681
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
682
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
683
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
684
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
685
|
-
*
|
|
686
|
-
*/const a=[["path",{d:"M12 22v-5"}],["path",{d:"M9 8V2"}],["path",{d:"M15 8V2"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z"}]];ht(t,lt({name:"plug"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Aa(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
687
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
688
|
-
*
|
|
689
|
-
* ISC License
|
|
690
|
-
*
|
|
691
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
692
|
-
*
|
|
693
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
694
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
695
|
-
* copyright notice and this permission notice appear in all copies.
|
|
696
|
-
*
|
|
697
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
698
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
699
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
700
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
701
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
702
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
703
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
704
|
-
*
|
|
705
|
-
*/const a=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];ht(t,lt({name:"plus"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function zv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
706
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
707
|
-
*
|
|
708
|
-
* ISC License
|
|
709
|
-
*
|
|
710
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
711
|
-
*
|
|
712
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
713
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
714
|
-
* copyright notice and this permission notice appear in all copies.
|
|
715
|
-
*
|
|
716
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
717
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
718
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
719
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
720
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
721
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
722
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
723
|
-
*
|
|
724
|
-
*/const a=[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5"}],["circle",{cx:"12",cy:"9",r:"2"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1"}],["path",{d:"M9.5 18h5"}],["path",{d:"m8 22 4-11 4 11"}]];ht(t,lt({name:"radio-tower"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Tv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
725
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
726
|
-
*
|
|
727
|
-
* ISC License
|
|
728
|
-
*
|
|
729
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
730
|
-
*
|
|
731
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
732
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
733
|
-
* copyright notice and this permission notice appear in all copies.
|
|
734
|
-
*
|
|
735
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
736
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
737
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
738
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
739
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
740
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
741
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
742
|
-
*
|
|
743
|
-
*/const a=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5"}],["circle",{cx:"12",cy:"12",r:"2"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19"}]];ht(t,lt({name:"radio"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Cs(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
744
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
745
|
-
*
|
|
746
|
-
* ISC License
|
|
747
|
-
*
|
|
748
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
749
|
-
*
|
|
750
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
751
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
752
|
-
* copyright notice and this permission notice appear in all copies.
|
|
753
|
-
*
|
|
754
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
755
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
756
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
757
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
758
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
759
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
760
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
761
|
-
*
|
|
762
|
-
*/const a=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];ht(t,lt({name:"refresh-cw"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Yi(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
763
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
764
|
-
*
|
|
765
|
-
* ISC License
|
|
766
|
-
*
|
|
767
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
768
|
-
*
|
|
769
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
770
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
771
|
-
* copyright notice and this permission notice appear in all copies.
|
|
772
|
-
*
|
|
773
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
774
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
775
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
776
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
777
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
778
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
779
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
780
|
-
*
|
|
781
|
-
*/const a=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M21 9H3"}],["path",{d:"M21 15H3"}]];ht(t,lt({name:"rows-3"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function ol(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
782
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
783
|
-
*
|
|
784
|
-
* ISC License
|
|
785
|
-
*
|
|
786
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
787
|
-
*
|
|
788
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
789
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
790
|
-
* copyright notice and this permission notice appear in all copies.
|
|
791
|
-
*
|
|
792
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
793
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
794
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
795
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
796
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
797
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
798
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
799
|
-
*
|
|
800
|
-
*/const a=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7"}]];ht(t,lt({name:"save"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Pv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
801
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
802
|
-
*
|
|
803
|
-
* ISC License
|
|
804
|
-
*
|
|
805
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
806
|
-
*
|
|
807
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
808
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
809
|
-
* copyright notice and this permission notice appear in all copies.
|
|
810
|
-
*
|
|
811
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
812
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
813
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
814
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
815
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
816
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
817
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
818
|
-
*
|
|
819
|
-
*/const a=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"}],["path",{d:"M7 12h10"}]];ht(t,lt({name:"scan-line"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Av(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
820
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
821
|
-
*
|
|
822
|
-
* ISC License
|
|
823
|
-
*
|
|
824
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
825
|
-
*
|
|
826
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
827
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
828
|
-
* copyright notice and this permission notice appear in all copies.
|
|
829
|
-
*
|
|
830
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
831
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
832
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
833
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
834
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
835
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
836
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
837
|
-
*
|
|
838
|
-
*/const a=[["path",{d:"M15 12h-5"}],["path",{d:"M15 8h-5"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3"}]];ht(t,lt({name:"scroll-text"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function il(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
839
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
840
|
-
*
|
|
841
|
-
* ISC License
|
|
842
|
-
*
|
|
843
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
844
|
-
*
|
|
845
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
846
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
847
|
-
* copyright notice and this permission notice appear in all copies.
|
|
848
|
-
*
|
|
849
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
850
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
851
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
852
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
853
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
854
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
855
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
856
|
-
*
|
|
857
|
-
*/const a=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"}],["path",{d:"m21.854 2.147-10.94 10.939"}]];ht(t,lt({name:"send"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Lv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
858
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
859
|
-
*
|
|
860
|
-
* ISC License
|
|
861
|
-
*
|
|
862
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
863
|
-
*
|
|
864
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
865
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
866
|
-
* copyright notice and this permission notice appear in all copies.
|
|
867
|
-
*
|
|
868
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
869
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
870
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
871
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
872
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
873
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
874
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
875
|
-
*
|
|
876
|
-
*/const a=[["path",{d:"M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2"}],["path",{d:"M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2"}],["path",{d:"M6 6h.01"}],["path",{d:"M6 18h.01"}],["path",{d:"m13 6-4 6h6l-4 6"}]];ht(t,lt({name:"server-crash"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Xi(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
877
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
878
|
-
*
|
|
879
|
-
* ISC License
|
|
880
|
-
*
|
|
881
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
882
|
-
*
|
|
883
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
884
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
885
|
-
* copyright notice and this permission notice appear in all copies.
|
|
886
|
-
*
|
|
887
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
888
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
889
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
890
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
891
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
892
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
893
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
894
|
-
*
|
|
895
|
-
*/const a=[["path",{d:"M20 7h-9"}],["path",{d:"M14 17H5"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]];ht(t,lt({name:"settings-2"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Sa(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
896
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
897
|
-
*
|
|
898
|
-
* ISC License
|
|
899
|
-
*
|
|
900
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
901
|
-
*
|
|
902
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
903
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
904
|
-
* copyright notice and this permission notice appear in all copies.
|
|
905
|
-
*
|
|
906
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
907
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
908
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
909
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
910
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
911
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
912
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
913
|
-
*
|
|
914
|
-
*/const a=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"M12 8v4"}],["path",{d:"M12 16h.01"}]];ht(t,lt({name:"shield-alert"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Iv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
915
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
916
|
-
*
|
|
917
|
-
* ISC License
|
|
918
|
-
*
|
|
919
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
920
|
-
*
|
|
921
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
922
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
923
|
-
* copyright notice and this permission notice appear in all copies.
|
|
924
|
-
*
|
|
925
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
926
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
927
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
928
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
929
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
930
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
931
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
932
|
-
*
|
|
933
|
-
*/const a=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m9 12 2 2 4-4"}]];ht(t,lt({name:"shield-check"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function xi(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
934
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
935
|
-
*
|
|
936
|
-
* ISC License
|
|
937
|
-
*
|
|
938
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
939
|
-
*
|
|
940
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
941
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
942
|
-
* copyright notice and this permission notice appear in all copies.
|
|
943
|
-
*
|
|
944
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
945
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
946
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
947
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
948
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
949
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
950
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
951
|
-
*
|
|
952
|
-
*/const a=[["path",{d:"m2 2 20 20"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264"}]];ht(t,lt({name:"shield-off"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Ov(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
953
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
954
|
-
*
|
|
955
|
-
* ISC License
|
|
956
|
-
*
|
|
957
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
958
|
-
*
|
|
959
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
960
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
961
|
-
* copyright notice and this permission notice appear in all copies.
|
|
962
|
-
*
|
|
963
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
964
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
965
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
966
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
967
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
968
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
969
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
970
|
-
*
|
|
971
|
-
*/const a=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}]];ht(t,lt({name:"shield"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Rv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
972
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
973
|
-
*
|
|
974
|
-
* ISC License
|
|
975
|
-
*
|
|
976
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
977
|
-
*
|
|
978
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
979
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
980
|
-
* copyright notice and this permission notice appear in all copies.
|
|
981
|
-
*
|
|
982
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
983
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
984
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
985
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
986
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
987
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
988
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
989
|
-
*
|
|
990
|
-
*/const a=[["line",{x1:"21",x2:"14",y1:"4",y2:"4"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22"}]];ht(t,lt({name:"sliders-horizontal"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Co(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
991
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
992
|
-
*
|
|
993
|
-
* ISC License
|
|
994
|
-
*
|
|
995
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
996
|
-
*
|
|
997
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
998
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
999
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1000
|
-
*
|
|
1001
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1002
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1003
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1004
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1005
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1006
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1007
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1008
|
-
*
|
|
1009
|
-
*/const a=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"}],["path",{d:"M20 3v4"}],["path",{d:"M22 5h-4"}],["path",{d:"M4 17v2"}],["path",{d:"M5 18H3"}]];ht(t,lt({name:"sparkles"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Dv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1010
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1011
|
-
*
|
|
1012
|
-
* ISC License
|
|
1013
|
-
*
|
|
1014
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
1015
|
-
*
|
|
1016
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1017
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1018
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1019
|
-
*
|
|
1020
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1021
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1022
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1023
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1024
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1025
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1026
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1027
|
-
*
|
|
1028
|
-
*/const a=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];ht(t,lt({name:"sun"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Ro(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1029
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1030
|
-
*
|
|
1031
|
-
* ISC License
|
|
1032
|
-
*
|
|
1033
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
1034
|
-
*
|
|
1035
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1036
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1037
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1038
|
-
*
|
|
1039
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1040
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1041
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1042
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1043
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1044
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1045
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1046
|
-
*
|
|
1047
|
-
*/const a=[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17"}]];ht(t,lt({name:"trash-2"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function sl(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1048
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1049
|
-
*
|
|
1050
|
-
* ISC License
|
|
1051
|
-
*
|
|
1052
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
1053
|
-
*
|
|
1054
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1055
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1056
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1057
|
-
*
|
|
1058
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1059
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1060
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1061
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1062
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1063
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1064
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1065
|
-
*
|
|
1066
|
-
*/const a=[["path",{d:"m19 5 3-3"}],["path",{d:"m2 22 3-3"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z"}],["path",{d:"M7.5 13.5 10 11"}],["path",{d:"M10.5 16.5 13 14"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z"}]];ht(t,lt({name:"unplug"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function $v(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1067
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1068
|
-
*
|
|
1069
|
-
* ISC License
|
|
1070
|
-
*
|
|
1071
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
1072
|
-
*
|
|
1073
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1074
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1075
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1076
|
-
*
|
|
1077
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1078
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1079
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1080
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1081
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1082
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1083
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1084
|
-
*
|
|
1085
|
-
*/const a=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}],["circle",{cx:"9",cy:"7",r:"4"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}]];ht(t,lt({name:"users"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}function Vv(t,e){const r=pt(e,["children","$$slots","$$events","$$legacy"]);/**
|
|
1086
|
-
* @license lucide-svelte v0.475.0 - ISC
|
|
1087
|
-
*
|
|
1088
|
-
* ISC License
|
|
1089
|
-
*
|
|
1090
|
-
* Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
1091
|
-
*
|
|
1092
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
1093
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
1094
|
-
* copyright notice and this permission notice appear in all copies.
|
|
1095
|
-
*
|
|
1096
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
1097
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
1098
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
1099
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
1100
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
1101
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
1102
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
1103
|
-
*
|
|
1104
|
-
*/const a=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];ht(t,lt({name:"zap"},()=>r,{get iconNode(){return a},children:(o,s)=>{var i=De(),c=ue(i);bt(c,e,"default",{},null),v(o,i)},$$slots:{default:!0}}))}var Hv=x("<!> Connecting…",1),Fv=x("<!> Connect",1),qv=x('<!> <span class="text-ok"> </span>',1),Kv=x('<!> <span class="text-danger truncate"> </span>',1),jv=x("<span> </span>"),Bv=x('<div class="group flex items-center gap-1 rounded hover:bg-bg-2 transition-colors"><button type="button" class="flex-1 flex items-center justify-between gap-3 px-2 py-1.5 text-left cursor-pointer bg-transparent border-0 disabled:cursor-not-allowed disabled:opacity-50 min-w-0"><code class="font-mono text-[11px] text-fg-1 truncate"> </code> <span class="font-mono text-[10px] text-fg-3 shrink-0 flex items-center gap-1.5"><!> <span> </span></span></button> <button type="button" title="Remove from history" class="opacity-0 group-hover:opacity-100 p-1 mr-0.5 text-fg-3 hover:text-danger transition-all cursor-pointer bg-transparent border-0"><!></button></div>'),Wv=x('<div class="mt-3 pt-3 border-t border-line-1"><div class="flex items-center gap-1.5 mb-2"><!> <span class="type-label">Recent</span></div> <div class="grid gap-0.5 max-h-[180px] overflow-y-auto"></div></div>'),Uv=x('<div class="fixed inset-0 z-40" role="presentation"></div> <div class="absolute top-[calc(100%+6px)] left-0 z-50 w-[380px] bg-bg-1 border border-line-2 rounded-lg shadow-2xl p-4" role="dialog" aria-label="Connect to reddb"><form><label for="connect-url" class="type-label block mb-1.5">Instance URL</label> <input id="connect-url" spellcheck="false" placeholder="red://localhost" class="w-full h-9 px-3 mb-1 bg-bg-0 border border-line-2 rounded-md font-mono text-[13px] text-fg-0 outline-none transition-colors focus:border-accent placeholder:text-fg-3"/> <div class="mb-2 text-[10px] font-mono text-fg-3"> </div> <button type="submit" class="w-full h-9 bg-accent text-white font-medium rounded-md cursor-pointer transition-colors hover:bg-[#ff3868] disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2 text-[13px]"><!></button> <div class="h-5 mt-2 flex items-center gap-1.5 text-[11px] font-mono"><!></div></form> <!></div>',1),Gv=x('<div class="relative"><button type="button" aria-haspopup="dialog" class="inline-flex items-center gap-2 h-7 pl-2 pr-1.5 bg-bg-2 border border-line-2 rounded-md text-fg-1 cursor-pointer text-xs transition-colors hover:border-line-3 hover:text-fg-0"><span></span> <!> <span class="font-mono"> </span> <span class="font-mono text-[10px] text-fg-3"> </span> <!></button> <!></div>');function Yv(t,e){ot(e,!0);const r="red://localhost";function a(){var D,T;return(D=Ue.history[0])!=null&&D.url?Ue.history[0].url:(T=Ue.history[0])!=null&&T.label?Ue.history[0].label:Ue.active.url?Ue.active.url:r}let o=_e(!1),s=_e(Bt(a())),i=_e("idle"),c=_e(null),f=_e(null),g=_e(void 0),p=_e(void 0);async function b(D){const T=D.trim().replace(/\/$/,"");if(!T)return;if(m(s,T,!0),!Ue.canReach(T)){m(i,"error"),m(c,`This app can't reach that transport here — supported: ${n(F)}`);return}m(i,"probing"),m(c,null),m(f,null),await Ue.tryConnect(Zu(T))?(m(i,"ok"),m(f,Ue.probe.rtt_ms??null,!0),setTimeout(()=>m(o,!1),350)):(m(i,"error"),m(c,Ue.probe.error??"unreachable",!0))}function h(D){D.preventDefault(),b(n(s))}function w(D){const T=Date.now()-D;return T<6e4?"just now":T<36e5?`${Math.round(T/6e4)}m ago`:T<864e5?`${Math.round(T/36e5)}h ago`:`${Math.round(T/864e5)}d ago`}function M(D,T){D.stopPropagation(),Ue.forgetById(T)}function P(){m(o,!n(o)),n(o)&&setTimeout(()=>{var D;return(D=n(p))==null?void 0:D.focus()},0)}Fr(()=>{const D=()=>{m(o,!0),setTimeout(()=>{var T;return(T=n(p))==null?void 0:T.focus()},0)};return window.addEventListener("red:open-connect",D),()=>window.removeEventListener("red:open-connect",D)});const V=y(()=>Ue.connected?"bg-ok":n(i)==="error"?"bg-danger":"bg-fg-3"),O=y(()=>Ue.connected?Ue.active.label:"Connect"),k=y(()=>Ue.connected&&Ue.probe.rtt_ms!==void 0?`${Ue.probe.rtt_ms}ms`:Ue.connected?"live":"no connection"),F=y(()=>{const D=Ue.supportedTransports,T=[];return(D.includes("http")||D.includes("https"))&&T.push("http(s)://"),D.includes("unix")&&T.push("file://"),T.join(" · ")}),U=y(()=>Ue.history.filter(D=>!D.url||Ue.canReach(D.url)));var Q=Gv(),se=d(Q),xe=d(se),le=u(xe,2);{var te=D=>{Ic(D,{class:"size-3 text-fg-3"})};B(le,D=>{Ue.connected||D(te)})}var be=u(le,2),K=d(be,!0);l(be);var C=u(be,2),N=d(C,!0);l(C);var _=u(C,2);fv(_,{class:"size-3 text-fg-3"}),l(se);var z=u(se,2);{var I=D=>{var T=Uv(),$=ue(T),X=u($,2),H=d(X),W=u(d(H),2);en(W),sr(W,J=>m(p,J),()=>n(p));var Y=u(W,2),ae=d(Y);l(Y);var ge=u(Y,2),ie=d(ge);{var ee=J=>{var oe=Hv(),me=ue(oe);lr(me,{class:"size-3.5 animate-spin"}),Ce(),v(J,oe)},q=J=>{var oe=Fv(),me=ue(oe);Vv(me,{class:"size-3.5"}),Ce(),v(J,oe)};B(ie,J=>{n(i)==="probing"?J(ee):J(q,-1)})}l(ge);var G=u(ge,2),E=d(G);{var j=J=>{var oe=qv(),me=ue(oe);Ss(me,{class:"size-3 text-ok"});var pe=u(me,2),Ee=d(pe);l(pe),L(()=>S(Ee,`Connected${n(f)!==null?` · ${n(f)}ms`:""}`)),v(J,oe)},R=J=>{var oe=Kv(),me=ue(oe);ia(me,{class:"size-3 text-danger"});var pe=u(me,2),Ee=d(pe,!0);l(pe),L(()=>S(Ee,n(c))),v(J,oe)};B(E,J=>{n(i)==="ok"?J(j):n(i)==="error"&&J(R,1)})}l(G),l(H);var A=u(H,2);{var Z=J=>{var oe=Wv(),me=d(oe),pe=d(me);pv(pe,{class:"size-3 text-fg-3"}),Ce(2),l(me);var Ee=u(me,2);Qe(Ee,21,()=>n(U),bn,(Se,ve)=>{var ce=Bv(),Oe=d(ce),re=d(Oe),de=d(re,!0);l(re);var he=u(re,2),Ie=d(he);{var Ae=Me=>{var Xe=jv(),Re=d(Xe);l(Xe),L(()=>S(Re,`${n(ve).rtt_ms??""}ms`)),v(Me,Xe)};B(Ie,Me=>{n(ve).rtt_ms!==void 0&&Me(Ae)})}var ke=u(Ie,2),Te=d(ke,!0);l(ke),l(he),l(Oe);var ze=u(Oe,2),Ne=d(ze);Rn(Ne,{class:"size-3"}),l(ze),l(ce),L(Me=>{Oe.disabled=n(i)==="probing",Pe(Oe,"title",n(ve).url?void 0:"Enter credentials to reconnect"),S(de,n(ve).url??n(ve).label),S(Te,Me)},[()=>w(n(ve).last_used)]),we("click",Oe,()=>{n(ve).url?b(n(ve).url):(m(s,n(ve).label,!0),setTimeout(()=>{var Me;return(Me=n(p))==null?void 0:Me.focus()},0))}),we("click",ze,Me=>M(Me,n(ve).id)),v(Se,ce)}),l(Ee),l(oe),v(J,oe)};B(A,J=>{n(U).length>0&&J(Z)})}l(X),sr(X,J=>m(g,J),()=>n(g)),L(J=>{S(ae,`reachable here: ${n(F)??""}`),ge.disabled=J},[()=>n(i)==="probing"||!n(s).trim()]),we("click",$,()=>m(o,!1)),kr("submit",H,h),Tn(W,()=>n(s),J=>m(s,J)),v(D,T)};B(z,D=>{n(o)&&D(I)})}l(Q),L(D=>{Pe(se,"aria-expanded",n(o)),Pe(se,"title",Ue.connected?"Switch connection":"Connect to reddb"),Ve(xe,1,D),S(K,n(O)),S(N,n(k))},[()=>Ke(["w-1.5 h-1.5 rounded-full shrink-0",n(V)].join(" "))]),we("click",se,P),v(t,Q),it()}tn(["click"]);var Xv=x("<!> <span> </span>",1),Zv=x('<!> <span class="text-fg-3">idle</span>',1),Qv=x('<button type="button" title="Force-clear the in-flight counter (use when a request hangs)" class="px-1.5 py-0.5 rounded border border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2 cursor-pointer text-[10px]">reset</button>'),Jv=x('<div class="px-3 py-3 text-fg-3">No activity yet.</div>'),eg=x('<div class="text-danger text-[10px] truncate"> </div>'),tg=x('<div class="px-3 py-1.5 border-b border-line-1/50 last:border-0 grid grid-cols-[16px_1fr_auto] items-center gap-2"><span aria-hidden="true"><!></span> <div class="min-w-0"><div class="text-fg-1 truncate"> </div> <!></div> <div class="text-fg-3 text-[10px] tabular-nums whitespace-nowrap"><!></div></div>'),ng=x('<div class="fixed inset-0 z-40" role="presentation"></div> <div role="dialog" aria-label="Activity log" class="absolute top-[calc(100%+6px)] right-0 z-50 w-[360px] bg-bg-1 border border-line-2 rounded-lg shadow-2xl text-[11px] font-mono"><header class="flex items-center justify-between px-3 py-2 border-b border-line-1"><span class="type-label">Recent reddb requests</span> <div class="flex items-center gap-2"><span class="text-fg-3"> </span> <!></div></header> <div class="max-h-[320px] overflow-y-auto py-1"><!></div></div>',1),rg=x('<div class="relative"><button type="button" title="reddb activity"><!></button> <!></div>');function ag(t,e){ot(e,!0);let r=_e(!1);function a(h){return h===null?"…":h<1e3?`${h}ms`:`${(h/1e3).toFixed(1)}s`}function o(h){const w=Date.now()-h;return w<1e3?"just now":w<6e4?`${Math.round(w/1e3)}s ago`:`${Math.round(w/6e4)}m ago`}var s=rg(),i=d(s),c=d(i);{var f=h=>{var w=Xv(),M=ue(w);lr(M,{class:"size-3.5 animate-spin"});var P=u(M,2),V=d(P,!0);l(P),L(()=>S(V,Ct.inflight)),v(h,w)},g=h=>{var w=Zv(),M=ue(w);Ha(M,{class:"size-3.5"}),Ce(2),v(h,w)};B(c,h=>{Ct.inflight>0?h(f):h(g,-1)})}l(i);var p=u(i,2);{var b=h=>{var w=ng(),M=ue(w),P=u(M,2),V=d(P),O=u(d(V),2),k=d(O),F=d(k);l(k);var U=u(k,2);{var Q=be=>{var K=Qv();we("click",K,()=>Ct.reset()),v(be,K)};B(U,be=>{Ct.inflight>0&&be(Q)})}l(O),l(V);var se=u(V,2),xe=d(se);{var le=be=>{var K=Jv();v(be,K)},te=be=>{var K=De(),C=ue(K);Qe(C,17,()=>Ct.log,N=>N.id,(N,_)=>{var z=tg(),I=d(z),D=d(I);{var T=E=>{lr(E,{class:"size-3 animate-spin text-accent"})},$=E=>{Ss(E,{class:"size-3 text-ok"})},X=E=>{ia(E,{class:"size-3 text-danger"})};B(D,E=>{n(_).status==="pending"?E(T):n(_).status==="ok"?E($,1):E(X,-1)})}l(I);var H=u(I,2),W=d(H),Y=d(W,!0);l(W);var ae=u(W,2);{var ge=E=>{var j=eg(),R=d(j,!0);l(j),L(()=>S(R,n(_).error)),v(E,j)};B(ae,E=>{n(_).status==="error"&&n(_).error&&E(ge)})}l(H);var ie=u(H,2),ee=d(ie);{var q=E=>{var j=_t();L(R=>S(j,R),[()=>o(n(_).startedAt)]),v(E,j)},G=E=>{var j=_t();L(R=>S(j,R),[()=>a(n(_).durationMs)]),v(E,j)};B(ee,E=>{n(_).status==="pending"?E(q):E(G,-1)})}l(ie),l(z),L(()=>S(Y,n(_).label)),v(N,z)}),v(be,K)};B(xe,be=>{Ct.log.length===0?be(le):be(te,-1)})}l(se),l(P),L(()=>S(F,`${Ct.inflight??""} active`)),we("click",M,()=>m(r,!1)),v(h,w)};B(p,h=>{n(r)&&h(b)})}l(s),L(h=>{Pe(i,"aria-pressed",n(r)),Ve(i,1,h)},[()=>Ke(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md border text-xs font-mono transition-colors cursor-pointer",Ct.inflight>0?"border-accent/40 bg-accent/10 text-accent":"border-line-2 bg-bg-2 text-fg-3 hover:text-fg-1"].join(" "))]),we("click",i,()=>m(r,!n(r))),v(t,s),it()}tn(["click"]);const Oc="red-ui-theme",Eo="light";function og(t,e,r){const a=t==null?void 0:t.dataset.theme;if(a==="dark"||a==="light")return a;if(!e||typeof localStorage>"u")return r??Eo;const o=localStorage.getItem(Oc);return o==="dark"||o==="light"?o:r??Eo}function ll(t,e){if(e){e.dataset.theme=t;return}typeof document<"u"&&(document.documentElement.dataset.theme=t)}function ig(t,e){e&&(typeof localStorage>"u"||localStorage.setItem(Oc,t))}var Ga;class sg{constructor(){Fe(this,Ga,_e(Eo));jt(this,"target",null);jt(this,"persistTheme",!0)}get current(){return n(fe(this,Ga))}set current(e){m(fe(this,Ga),e,!0)}init(e={}){this.target=e.target??null,this.persistTheme=e.persist??!0,this.current=og(this.target,this.persistTheme,e.initial),ll(this.current,this.target)}set(e){this.current=e,ll(e,this.target),ig(e,this.persistTheme)}toggle(){this.set(this.current==="dark"?"light":"dark")}}Ga=new WeakMap;const Dr=new sg;function cl(t){switch(t.view){case"ask":return"/ask";case"query":return"/query";case"collections":return"/collections";case"cluster":return"/cluster";case"security":return"/security";case"analytics":return"/analytics";case"settings":return"/settings";case"appearance":return"/appearance";case"collection":return Qu(t.collection,t.subpage)}}function lg(t){return t.view==="collection"?{view:"collections",collection:t.collection,subpage:t.subpage}:{view:t.view,collection:null,subpage:null}}function cg(t){if(t.startsWith("/ask"))return{view:"ask",collection:null,subpage:null};if(t.startsWith("/query"))return{view:"query",collection:null,subpage:null};if(t.startsWith("/cluster"))return{view:"cluster",collection:null,subpage:null};if(t.startsWith("/security"))return{view:"security",collection:null,subpage:null};if(t.startsWith("/analytics"))return{view:"analytics",collection:null,subpage:null};if(t.startsWith("/settings"))return{view:"settings",collection:null,subpage:null};if(t.startsWith("/appearance"))return{view:"appearance",collection:null,subpage:null};const e=t.match(/^\/c\/([^/]+)(?:\/p\/([^/]+))?/);return e?{view:"collections",collection:decodeURIComponent(e[1]),subpage:e[2]?decodeURIComponent(e[2]):null}:{view:"collections",collection:null,subpage:null}}function Rc(t){let e=_e(Bt({view:"collections",collection:null,subpage:null}));return{get view(){return n(e).view},get collection(){return n(e).collection},get subpage(){return n(e).subpage},get path(){return cl(n(e).collection?{view:"collection",collection:n(e).collection,subpage:n(e).subpage??"table"}:{view:n(e).view})},href:r=>cl(r),go:(r,a)=>{a==null||a.preventDefault(),m(e,lg(r),!0)}}}const Dc=Symbol("red-ui-router");let mi=null;function dg(t){return _s(Dc,t),t}function ya(){const t=Jo(Dc);return t||(mi||(mi=Rc()),mi)}var ug=x('<div class="w-px h-[18px] bg-line-2"></div> <!> <div class="w-px h-[18px] bg-line-2 ml-1"></div>',1),fg=x('<div class="w-px h-[18px] bg-line-2"></div>'),vg=x('<header class="h-11 flex items-center justify-between px-3.5 bg-bg-1/80 backdrop-blur-md border-b border-line-1 relative z-10"><div class="flex items-center gap-2.5"><a class="font-mono font-semibold text-[13px] tracking-tight text-fg-0 no-underline hover:text-accent transition-colors">red<span class="text-accent mx-px">·</span>ui</a> <!> <nav class="flex items-center gap-0.5"><a title="Ask — grounded natural-language query"><!> <span>Ask</span></a> <a title="Query"><!> <span>Query</span></a> <a title="Collections"><!> <span>Collections</span></a> <a title="Cluster topology"><!> <span>Cluster</span></a> <a title="Security"><!> <span>Security</span></a> <a title="Analytics"><!> <span>Analytics</span></a> <a title="Settings"><!> <span>Settings</span></a></nav></div> <div class="flex items-center gap-2.5"><!> <button type="button" class="inline-flex items-center justify-center size-7 bg-bg-2 border border-line-2 rounded-md text-fg-2 cursor-pointer transition-colors hover:border-line-3 hover:text-fg-0"><!></button> <button class="inline-flex items-center gap-2 h-7 pl-2.5 pr-2 bg-bg-2 border border-line-2 rounded-md text-fg-2 cursor-pointer text-xs transition-colors hover:border-line-3 hover:text-fg-1"><!> <span>Search or run</span> <span class="inline-flex gap-0.5 ml-1"><!><!></span></button></div></header>');function gg(t,e){ot(e,!0);let r=Ye(e,"showConnect",3,!0);const a=ya();function o(){window.dispatchEvent(new KeyboardEvent("keydown",{key:"k",metaKey:!0,ctrlKey:!0,bubbles:!0}))}const s=y(()=>a.view==="ask"),i=y(()=>a.view==="query"),c=y(()=>a.view==="collections"),f=y(()=>a.view==="cluster"),g=y(()=>a.view==="security"),p=y(()=>a.view==="analytics"),b=y(()=>a.view==="settings");var h=vg(),w=d(h),M=d(w),P=u(M,2);{var V=q=>{var G=ug(),E=u(ue(G),2);Yv(E,{}),Ce(2),v(q,G)},O=q=>{var G=fg();v(q,G)};B(P,q=>{r()?q(V):q(O,-1)})}var k=u(P,2),F=d(k),U=d(F);Co(U,{class:"size-3.5"}),Ce(2),l(F);var Q=u(F,2),se=d(Q);Pc(se,{class:"size-3.5"}),Ce(2),l(Q);var xe=u(Q,2),le=d(xe);Oo(le,{class:"size-3.5"}),Ce(2),l(xe);var te=u(xe,2),be=d(te);Ju(be,{class:"size-3.5"}),Ce(2),l(te);var K=u(te,2),C=d(K);Ov(C,{class:"size-3.5"}),Ce(2),l(K);var N=u(K,2),_=d(N);Mc(_,{class:"size-3.5"}),Ce(2),l(N);var z=u(N,2),I=d(z);Xi(I,{class:"size-3.5"}),Ce(2),l(z),l(k),l(w);var D=u(w,2),T=d(D);ag(T,{});var $=u(T,2),X=d($);{var H=q=>{Dv(q,{class:"size-3.5"})},W=q=>{Nv(q,{class:"size-3.5"})};B(X,q=>{Dr.current==="dark"?q(H):q(W,-1)})}l($);var Y=u($,2),ae=d(Y);Xn(ae,{class:"size-3.5 text-fg-3"});var ge=u(ae,4),ie=d(ge);Un(ie,{children:(q,G)=>{Ce();var E=_t("⌘");v(q,E)}});var ee=u(ie);Un(ee,{children:(q,G)=>{Ce();var E=_t("K");v(q,E)}}),l(ge),l(Y),l(D),l(h),L((q,G,E,j,R,A,Z,J,oe,me,pe,Ee,Se,ve,ce)=>{Pe(M,"href",q),Pe(F,"href",G),Pe(F,"aria-current",n(s)?"page":void 0),Ve(F,1,E),Pe(Q,"href",j),Pe(Q,"aria-current",n(i)?"page":void 0),Ve(Q,1,R),Pe(xe,"href",A),Pe(xe,"aria-current",n(c)?"page":void 0),Ve(xe,1,Z),Pe(te,"href",J),Pe(te,"aria-current",n(f)?"page":void 0),Ve(te,1,oe),Pe(K,"href",me),Pe(K,"aria-current",n(g)?"page":void 0),Ve(K,1,pe),Pe(N,"href",Ee),Pe(N,"aria-current",n(p)?"page":void 0),Ve(N,1,Se),Pe(z,"href",ve),Pe(z,"aria-current",n(b)?"page":void 0),Ve(z,1,ce),Pe($,"title",Dr.current==="dark"?"Switch to light theme":"Switch to dark theme"),Pe($,"aria-label",Dr.current==="dark"?"Switch to light theme":"Switch to dark theme")},[()=>a.href({view:"collections"}),()=>a.href({view:"ask"}),()=>Ke(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(s)?"bg-bg-2 text-accent":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"query"}),()=>Ke(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(i)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"collections"}),()=>Ke(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(c)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"cluster"}),()=>Ke(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(f)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"security"}),()=>Ke(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(g)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"analytics"}),()=>Ke(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(p)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" ")),()=>a.href({view:"settings"}),()=>Ke(["inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs no-underline transition-colors",n(b)?"bg-bg-2 text-fg-0":"text-fg-2 hover:text-fg-0 hover:bg-bg-2"].join(" "))]),we("click",M,q=>a.go({view:"collections"},q)),we("click",F,q=>a.go({view:"ask"},q)),we("click",Q,q=>a.go({view:"query"},q)),we("click",xe,q=>a.go({view:"collections"},q)),we("click",te,q=>a.go({view:"cluster"},q)),we("click",K,q=>a.go({view:"security"},q)),we("click",N,q=>a.go({view:"analytics"},q)),we("click",z,q=>a.go({view:"settings"},q)),we("click",$,()=>Dr.toggle()),we("click",Y,o),v(t,h),it()}tn(["click"]);function pg(t){return`'${t.replace(/'/g,"''")}'`}function hg(){return Math.random().toString(36).slice(2,10)}function Es(t){return`UPDATE ${t.table} SET ${t.col} = ${pg(t.newValue)} WHERE rid = ${t.row};`}var Ya,Xa;class bg{constructor(){Fe(this,Ya,_e(Bt([])));Fe(this,Xa,y(()=>this.changes.length));jt(this,"executor",null)}get changes(){return n(fe(this,Ya))}set changes(e){m(fe(this,Ya),e,!0)}get count(){return n(fe(this,Xa))}set count(e){m(fe(this,Xa),e)}setExecutor(e){this.executor=e}stage(e,r,a,o,s){const i=this.changes.findIndex(f=>f.table===e&&f.row===r&&f.col===a);if(i>=0){const f=this.changes[i],g={...f,oldValue:f.oldValue,newValue:s,error:void 0},p=this.changes.slice();return p[i]=g,this.changes=p,f.id}const c=hg();return this.changes=[...this.changes,{id:c,table:e,row:r,col:a,oldValue:o,newValue:s}],c}unstage(e){this.changes=this.changes.filter(r=>r.id!==e)}find(e,r,a){return this.changes.find(o=>o.table===e&&o.row===r&&o.col===a)}previewSql(){return this.changes.map(Es)}async commitAll(){if(this.changes.length===0)return{applied:0,failed:[]};if(!this.executor)throw new Error("PendingChanges: no commit executor configured");const e=this.changes.slice(),r=await this.executor(e),a=new Map(r.map(g=>[g.id,g])),o=[];let s=0;for(const g of e){const p=a.get(g.id);p!=null&&p.ok?s+=1:o.push({...g,error:(p==null?void 0:p.error)??"commit failed"})}const i=new Set(o.map(g=>g.id)),c=this.changes.filter(g=>!e.some(p=>p.id===g.id)),f=new Map(o.map(g=>[g.id,g]));return this.changes=[...this.changes.filter(g=>i.has(g.id)).map(g=>f.get(g.id)??g),...c],{applied:s,failed:o}}discardAll(){this.changes=[]}clear(){this.changes=[]}}Ya=new WeakMap,Xa=new WeakMap;const On=new bg;function _i(t){try{const e=t();return typeof e=="string"&&e.length>0?e:void 0}catch{return}}function xg(t){return t.startsWith("v")?t.slice(1):t}function $c(){return{version:xg(_i(()=>"0.3.1")??"0.0.0-dev"),gitSha:_i(()=>"unknown")??"unknown",buildTime:_i(()=>"unknown")??"unknown"}}$c().version;var mg=x('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">rtt</span> <span class="text-fg-1 tabular-nums"> </span><span class="text-fg-3">ms</span></span>',1),_g=x('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">lag</span> <span> </span></span>',1),yg=x('<span class="text-fg-3">·</span> <span class="text-fg-2"><span class="text-fg-3">lsn</span> <span class="text-fg-1 tabular-nums"> </span></span>',1),wg=x('<span class="text-fg-3">·</span> <span class="inline-flex items-center gap-1 shrink-0 text-warn"><!> <span class="uppercase tracking-wider text-[10px]">read-only — file in use</span></span>',1),kg=x('<span class="inline-flex items-center gap-1.5 shrink-0"><span class="w-1.5 h-1.5 rounded-full"></span> <span class="text-fg-1 uppercase tracking-wider text-[10px]"> </span></span> <span class="text-fg-3">·</span> <span class="text-fg-1 truncate"> </span> <!> <!> <!> <!>',1),Sg=x('<span class="inline-flex items-center gap-1.5 shrink-0"><span class="w-1.5 h-1.5 rounded-full bg-fg-3"></span> <span class="text-fg-3">Not connected</span></span>'),Cg=x('<button type="button" data-no-nav="" class="inline-flex items-center gap-1.5 px-3 text-accent hover:bg-bg-2/60 transition-colors cursor-pointer bg-transparent border-0 border-l border-line-1"><!> <span class="tabular-nums"> </span></button>'),Eg=x('<button type="button" data-no-nav="" class="inline-flex items-center gap-1 px-3 text-fg-2 hover:text-fg-0 hover:bg-bg-2/60 transition-colors cursor-pointer bg-transparent border-0 border-l border-line-1"><span>Connect</span> <!></button>'),Ng=x('<div class="h-8 flex items-stretch border-b border-line-1 bg-bg-1/60 text-[11px] font-mono select-none" role="status" aria-label="Connection status"><div role="button" tabindex="0" title="Open cluster overview" class="flex-1 flex items-center gap-3 px-3 cursor-pointer hover:bg-bg-2/40 transition-colors min-w-0"><!></div> <!> <!> <span class="inline-flex items-center px-3 shrink-0 font-mono text-fg-3 border-l border-line-1 select-none"> </span></div>');function Mg(t,e){ot(e,!0);const r=$c(),a=ya(),o=y(()=>On.count),s=y(()=>Ue.readOnly),i=y(()=>Ue.readOnlyReason);function c(){window.dispatchEvent(new CustomEvent("red:open-pending-changes"))}const f=y(()=>Ue.connected),g=y(()=>{var K,C;return((K=Ue.probe.replication)==null?void 0:K.role)??((C=Ue.active)==null?void 0:C.role)??"standalone"}),p=y(()=>n(g)==="primary"?"var(--color-role-primary)":n(g)==="replica"?"var(--color-role-replica)":n(g)==="embedded"?"var(--color-role-embedded)":"var(--color-fg-3)"),b=y(()=>{var K,C;return((K=Ue.probe.replication)==null?void 0:K.wal_lsn)??((C=Ue.probe.replication)==null?void 0:C.last_applied_lsn)}),h=y(()=>{const K=Ue.probe.replication;if(!(!K||n(g)!=="replica")&&!(K.last_seen_primary_lsn===void 0||K.last_applied_lsn===void 0))return Math.max(0,K.last_seen_primary_lsn-K.last_applied_lsn)});function w(){window.dispatchEvent(new CustomEvent("red:open-connect"))}function M(K){const C=K.target;C!=null&&C.closest("button, a, [data-no-nav]")||a.go({view:"cluster"})}function P(K){(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),a.go({view:"cluster"}))}var V=Ng(),O=d(V),k=d(O);{var F=K=>{var C=kg(),N=ue(C),_=d(N);let z;var I=u(_,2),D=d(I,!0);l(I),l(N);var T=u(N,4),$=d(T,!0);l(T);var X=u(T,2);{var H=q=>{var G=mg(),E=u(ue(G),2),j=u(d(E),2),R=d(j,!0);l(j),Ce(),l(E),L(()=>S(R,Ue.probe.rtt_ms)),v(q,G)};B(X,q=>{Ue.probe.rtt_ms!==void 0&&q(H)})}var W=u(X,2);{var Y=q=>{var G=_g(),E=u(ue(G),2),j=u(d(E),2);let R;var A=d(j,!0);l(j),l(E),L(()=>{R=Ve(j,1,"text-fg-1 tabular-nums",null,R,{"text-warn":(n(h)??0)>0}),S(A,n(h))}),v(q,G)};B(W,q=>{n(g)==="replica"&&n(h)!==void 0&&q(Y)})}var ae=u(W,2);{var ge=q=>{var G=yg(),E=u(ue(G),2),j=u(d(E),2),R=d(j,!0);l(j),l(E),L(()=>S(R,n(b))),v(q,G)};B(ae,q=>{n(b)!==void 0&&q(ge)})}var ie=u(ae,2);{var ee=q=>{var G=wg(),E=u(ue(G),2),j=d(E);Gr(j,{class:"size-3"}),Ce(2),l(E),L(()=>Pe(E,"title",n(i)??"The server is open read-only — mutations are disabled.")),v(q,G)};B(ie,q=>{n(s)&&q(ee)})}L(()=>{z=kn(_,"",z,{"background-color":n(p)}),S(D,n(g)),S($,Ue.active.label)}),v(K,C)},U=K=>{var C=Sg();v(K,C)};B(k,K=>{n(f)?K(F):K(U,-1)})}l(O);var Q=u(O,2);{var se=K=>{var C=Cg(),N=d(C);mv(N,{class:"size-3"});var _=u(N,2),z=d(_);l(_),l(C),L(()=>{Pe(C,"aria-label",`${n(o)} pending changes`),S(z,`Pending changes (${n(o)??""})`)}),we("click",C,c),v(K,C)};B(Q,K=>{n(o)>0&&K(se)})}var xe=u(Q,2);{var le=K=>{var C=Eg(),N=u(d(C),2);lv(N,{class:"size-3"}),l(C),we("click",C,w),v(K,C)};B(xe,K=>{n(f)||K(le)})}var te=u(xe,2),be=d(te);l(te),l(V),L(()=>{Pe(te,"title",`red-ui ${r.version} · ${r.gitSha} · built ${r.buildTime}`),S(be,`v${r.version??""}`)}),we("click",O,M),we("keydown",O,P),v(t,V),it()}tn(["click","keydown"]);var zg=x('<span class="hint svelte-1yq04zr"> </span>'),Tg=x('<button><span class="label svelte-1yq04zr"> </span> <!> <!></button>'),Pg=x('<div class="group-label svelte-1yq04zr"> </div> <!>',1),Ag=x('<div class="empty svelte-1yq04zr"> </div>'),Lg=x('<div class="scrim svelte-1yq04zr" role="presentation"></div> <div class="palette svelte-1yq04zr" role="dialog" aria-modal="true"><div class="input-wrap svelte-1yq04zr"><span class="search-icon svelte-1yq04zr">⌕</span> <input placeholder="Search or run a command…" spellcheck="false" class="svelte-1yq04zr"/> <!></div> <div class="list svelte-1yq04zr"><!> <!></div> <footer class="svelte-1yq04zr"><span><!> <!> navigate</span> <span><!> run</span> <span><!><!> toggle</span></footer></div>',1);function Ig(t,e){ot(e,!0);const r=ya();let a=_e(!1),o=_e(""),s=_e(0),i=_e(void 0);function c(F){window.dispatchEvent(new CustomEvent(F))}const f=[{id:"ask",group:"navigate",label:"Open ask",hint:"/ask",run:()=>p({view:"ask"})},{id:"query",group:"navigate",label:"Open query",hint:"/query",run:()=>p({view:"query"})},{id:"collections",group:"navigate",label:"Open collections",hint:"/collections",run:()=>p({view:"collections"})},{id:"topology",group:"navigate",label:"Open cluster",hint:"/cluster",run:()=>p({view:"cluster"})},{id:"security",group:"navigate",label:"Open security",hint:"/security",run:()=>p({view:"security"})},{id:"analytics",group:"navigate",label:"Open analytics",hint:"/analytics",run:()=>p({view:"analytics"})},{id:"settings",group:"navigate",label:"Open settings",hint:"/settings",run:()=>p({view:"settings"})},{id:"appearance",group:"navigate",label:"Open appearance",hint:"/appearance",run:()=>p({view:"appearance"})},{id:"new-query",group:"data",label:"New query",shortcut:"⌘T",run:()=>{c("red:new-query"),b()}},{id:"open-connect",group:"actions",label:"Open Connect dropdown",shortcut:"⌘⇧C",run:()=>{c("red:open-connect"),b()}},{id:"apply-pending",group:"actions",label:"Apply pending changes",run:()=>{c("red:apply-pending"),b()}},{id:"discard-pending",group:"actions",label:"Discard pending changes",run:()=>{c("red:discard-pending"),b()}},{id:"toggle-theme",group:"view",label:"Toggle theme (light / dark)",hint:"theme",run:()=>{Dr.toggle(),b()}},{id:"show-shortcuts",group:"view",label:"Show keyboard shortcuts",shortcut:"?",run:()=>{b(),c("red:open-shortcuts")}}],g=y(()=>n(o).trim()===""?f:f.filter(F=>F.label.toLowerCase().includes(n(o).toLowerCase())));function p(F){r.go(F),b()}function b(){m(a,!1),m(o,""),m(s,0)}function h(F){if(!(F instanceof HTMLElement))return!1;if(F.isContentEditable)return!0;const U=F.tagName;return U==="INPUT"||U==="TEXTAREA"||U==="SELECT"}function w(F){var se;const U=F.metaKey||F.ctrlKey,Q=F.key.toLowerCase();if(U&&Q==="k"){F.preventDefault(),m(a,!n(a)),n(a)&&setTimeout(()=>{var xe;return(xe=n(i))==null?void 0:xe.focus()},0);return}if(U&&F.shiftKey&&Q==="c"){F.preventDefault(),c("red:open-connect");return}if(U&&!F.shiftKey&&Q==="t"&&!h(F.target)){F.preventDefault(),c("red:new-query");return}if(n(a)){if(F.key==="Escape"){b();return}F.key==="ArrowDown"&&(F.preventDefault(),m(s,Math.min(n(s)+1,n(g).length-1),!0)),F.key==="ArrowUp"&&(F.preventDefault(),m(s,Math.max(n(s)-1,0),!0)),F.key==="Enter"&&(F.preventDefault(),(se=n(g)[n(s)])==null||se.run())}}Fr(()=>{window.addEventListener("keydown",w);const F=()=>{m(a,!0),setTimeout(()=>{var U;return(U=n(i))==null?void 0:U.focus()},0)};return window.addEventListener("red:open-palette",F),()=>{window.removeEventListener("keydown",w),window.removeEventListener("red:open-palette",F)}});const M=["navigate","data","actions","view"],P={navigate:"Navigate",data:"Data",actions:"Actions",view:"View"};var V=De(),O=ue(V);{var k=F=>{var U=Lg(),Q=ue(U),se=u(Q,2),xe=d(se),le=u(d(xe),2);en(le),sr(le,Y=>m(i,Y),()=>n(i));var te=u(le,2);Un(te,{children:(Y,ae)=>{Ce();var ge=_t("esc");v(Y,ge)}}),l(xe);var be=u(xe,2),K=d(be);Qe(K,17,()=>M,bn,(Y,ae)=>{const ge=y(()=>n(g).filter(G=>G.group===n(ae)));var ie=De(),ee=ue(ie);{var q=G=>{var E=Pg(),j=ue(E),R=d(j,!0);l(j);var A=u(j,2);Qe(A,17,()=>n(ge),bn,(Z,J)=>{const oe=y(()=>n(g).indexOf(n(J)));var me=Tg();let pe;var Ee=d(me),Se=d(Ee,!0);l(Ee);var ve=u(Ee,2);{var ce=de=>{var he=zg(),Ie=d(he,!0);l(he),L(()=>S(Ie,n(J).hint)),v(de,he)};B(ve,de=>{n(J).hint&&de(ce)})}var Oe=u(ve,2);{var re=de=>{Un(de,{children:(he,Ie)=>{Ce();var Ae=_t();L(()=>S(Ae,n(J).shortcut)),v(he,Ae)}})};B(Oe,de=>{n(J).shortcut&&de(re)})}l(me),L(()=>{pe=Ve(me,1,"row svelte-1yq04zr",null,pe,{active:n(oe)===n(s)}),S(Se,n(J).label)}),kr("mouseenter",me,()=>m(s,n(oe),!0)),we("click",me,()=>n(J).run()),v(Z,me)}),L(()=>S(R,P[n(ae)])),v(G,E)};B(ee,G=>{n(ge).length&&G(q)})}v(Y,ie)});var C=u(K,2);{var N=Y=>{var ae=Ag(),ge=d(ae);l(ae),L(()=>S(ge,`No commands match "${n(o)??""}"`)),v(Y,ae)};B(C,Y=>{n(g).length===0&&Y(N)})}l(be);var _=u(be,2),z=d(_),I=d(z);Un(I,{children:(Y,ae)=>{Ce();var ge=_t("↑");v(Y,ge)}});var D=u(I,2);Un(D,{children:(Y,ae)=>{Ce();var ge=_t("↓");v(Y,ge)}}),Ce(),l(z);var T=u(z,2),$=d(T);Un($,{children:(Y,ae)=>{Ce();var ge=_t("↵");v(Y,ge)}}),Ce(),l(T);var X=u(T,2),H=d(X);Un(H,{children:(Y,ae)=>{Ce();var ge=_t("⌘");v(Y,ge)}});var W=u(H);Un(W,{children:(Y,ae)=>{Ce();var ge=_t("K");v(Y,ge)}}),Ce(),l(X),l(_),l(se),we("click",Q,b),we("keydown",Q,function(...Y){}),we("input",le,()=>m(s,0)),Tn(le,()=>n(o),Y=>m(o,Y)),v(F,U)};B(O,F=>{n(a)&&F(k)})}v(t,V),it()}tn(["click","keydown","input"]);const Og=[{id:"palette",context:"Global",keys:["⌘","K"],label:"Open command palette"},{id:"shortcuts",context:"Global",keys:["?"],label:"Show keyboard shortcuts"},{id:"new-query",context:"Global",keys:["⌘","T"],label:"New query"},{id:"open-connect",context:"Connection",keys:["⌘","⇧","C"],label:"Open Connect dropdown"},{id:"dismiss",context:"Editing",keys:["Esc"],label:"Cancel / dismiss overlay or palette"}],Rg=["Global","Connection","Workspace","Editing"];var Dg=x('<li class="flex items-center justify-between gap-3 px-2 py-1.5 rounded hover:bg-bg-2"><span class="text-fg-1 text-[13px]"> </span> <span class="inline-flex gap-1 shrink-0"></span></li>'),$g=x('<section><div class="flex items-baseline justify-between mb-2"><h3 class="type-label m-0"> </h3> <span class="text-fg-3 text-[11px]"> </span></div> <ul class="grid gap-1 m-0 p-0 list-none"></ul></section>'),Vg=x('<div class="fixed inset-0 z-[200] bg-bg-0/70 backdrop-blur-md flex items-center justify-center p-6" role="presentation"><div class="w-full max-w-[640px] max-h-[80vh] overflow-y-auto bg-bg-1 border border-line-2 rounded-lg shadow-2xl" role="dialog" aria-modal="true" aria-label="Keyboard shortcuts" tabindex="-1"><header class="flex items-center justify-between px-5 py-3 border-b border-line-1"><div class="flex items-center gap-2"><span class="type-label">Keyboard shortcuts</span></div> <div class="flex items-center gap-1.5 text-fg-3 text-[11px]"><!> close</div></header> <div class="p-5 grid gap-5"></div></div></div>');function Hg(t,e){ot(e,!0);let r=_e(!1);function a(){m(r,!1)}function o(b){if(!(b instanceof HTMLElement))return!1;if(b.isContentEditable)return!0;const h=b.tagName;return h==="INPUT"||h==="TEXTAREA"||h==="SELECT"}function s(b){if(b.key==="Escape"&&n(r)){b.preventDefault(),a();return}if(b.key==="?"&&!b.metaKey&&!b.ctrlKey&&!b.altKey){if(o(b.target))return;b.preventDefault(),m(r,!n(r))}}Fr(()=>{window.addEventListener("keydown",s);const b=()=>{m(r,!0)};return window.addEventListener("red:open-shortcuts",b),()=>{window.removeEventListener("keydown",s),window.removeEventListener("red:open-shortcuts",b)}});const i=y(()=>Rg.map(b=>({ctx:b,items:Og.filter(h=>h.context===b)})).filter(b=>b.items.length>0)),c={Global:"Available anywhere in the app",Connection:"Manage which reddb you talk to",Workspace:"Move between tabs and panes",Editing:"While editing data or running queries"};var f=De(),g=ue(f);{var p=b=>{var h=Vg(),w=d(h),M=d(w),P=u(d(M),2),V=d(P);Un(V,{children:(k,F)=>{Ce();var U=_t("Esc");v(k,U)}}),Ce(),l(P),l(M);var O=u(M,2);Qe(O,21,()=>n(i),bn,(k,F)=>{var U=$g(),Q=d(U),se=d(Q),xe=d(se,!0);l(se);var le=u(se,2),te=d(le,!0);l(le),l(Q);var be=u(Q,2);Qe(be,21,()=>n(F).items,bn,(K,C)=>{var N=Dg(),_=d(N),z=d(_,!0);l(_);var I=u(_,2);Qe(I,21,()=>n(C).keys,bn,(D,T)=>{Un(D,{children:($,X)=>{Ce();var H=_t();L(()=>S(H,n(T))),v($,H)}})}),l(I),l(N),L(()=>S(z,n(C).label)),v(K,N)}),l(be),l(U),L(()=>{S(xe,n(F).ctx),S(te,c[n(F).ctx])}),v(k,U)}),l(O),l(w),l(h),we("click",h,a),we("click",w,k=>k.stopPropagation()),we("keydown",w,function(...k){}),v(b,h)};B(g,b=>{n(r)&&b(p)})}v(t,f),it()}tn(["click","keydown"]);var Fg=x('<label for="mp-confirm" class="type-label block mb-1">Confirm</label> <input id="mp-confirm" type="password" autocomplete="new-password" spellcheck="false" class="w-full h-9 px-3 mb-2 bg-bg-0 border border-line-2 rounded-md font-mono text-[13px] text-fg-0 outline-none transition-colors focus:border-accent"/>',1),qg=x("<!> ",1),Kg=x('<!> <span class="text-danger truncate"> </span>',1),jg=x('<button type="button" class="inline-flex items-center gap-1.5 text-fg-3 hover:text-danger transition-colors cursor-pointer bg-transparent border-0 p-0"><!> <span>Start fresh — wipe this browser</span></button>'),Bg=x('<div class="flex items-center justify-between gap-2"><span class="text-danger">Erase the encrypted store and all saved connections?</span></div> <div class="flex items-center gap-2 mt-1.5"><button type="button" class="inline-flex items-center gap-1.5 px-2 py-1 rounded border border-danger/40 bg-danger/10 text-danger hover:bg-danger/20 cursor-pointer"><!> Yes, wipe</button> <button type="button" class="px-2 py-1 rounded border border-line-2 text-fg-2 hover:text-fg-0 cursor-pointer">Cancel</button></div>',1),Wg=x('<div class="fixed inset-0 z-[100] flex items-center justify-center bg-bg-0/70 backdrop-blur-sm motion-reduce:backdrop-blur-none" role="dialog" aria-modal="true" aria-labelledby="mp-title"><form class="w-[380px] bg-bg-1 border border-line-2 rounded-lg shadow-2xl p-5"><div class="flex items-center gap-2 mb-1.5 text-fg-0"><!> <h2 id="mp-title" class="type-h2 m-0"> </h2></div> <p class="text-fg-3 text-[12px] leading-relaxed m-0 mb-3"> </p> <label for="mp-pwd" class="type-label block mb-1">Master password</label> <input id="mp-pwd" type="password" spellcheck="false" class="w-full h-9 px-3 mb-2 bg-bg-0 border border-line-2 rounded-md font-mono text-[13px] text-fg-0 outline-none transition-colors focus:border-accent"/> <!> <button type="submit" class="w-full h-9 mt-1 bg-accent text-white font-medium rounded-md cursor-pointer transition-colors hover:bg-[#ff3868] disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2 text-[13px]"><!></button> <div class="h-5 mt-2 flex items-center gap-1.5 text-[11px] font-mono"><!></div> <div class="mt-3 pt-3 border-t border-line-1 text-[11px] font-mono"><!></div></form></div>');function Ug(t,e){ot(e,!0);let r=_e(""),a=_e(""),o=_e(!1),s=_e(!1),i=_e(void 0);function c(){_n.error=null,m(s,!0)}function f(){m(s,!1)}function g(){_n.wipe(),m(r,""),m(a,""),m(s,!1),setTimeout(()=>{var k;return(k=n(i))==null?void 0:k.focus()},0)}const p=y(()=>_n.needsSetup),b=y(()=>_n.error),h=y(()=>n(p)?"Set a master password":"Unlock credentials"),w=y(()=>n(p)?"Picks a key that encrypts your connection history at rest. The password lives in this browser session only — there is no recovery.":"Enter the master password used to encrypt your saved connections.");an(()=>{_n.locked&&setTimeout(()=>{var k;return(k=n(i))==null?void 0:k.focus()},0)});async function M(k){if(k.preventDefault(),n(o)||!n(r))return;if(n(p)&&n(r)!==n(a)){_n.error="Passwords don't match";return}m(o,!0);const F=await _n.unlock(n(r));m(o,!1),F&&(m(r,""),m(a,""),Ue.refresh())}var P=De(),V=ue(P);{var O=k=>{var F=Wg(),U=d(F),Q=d(U),se=d(Q);{var xe=ee=>{Na(ee,{class:"size-4 text-accent"})},le=ee=>{Gr(ee,{class:"size-4 text-accent"})};B(se,ee=>{n(p)?ee(xe):ee(le,-1)})}var te=u(se,2),be=d(te,!0);l(te),l(Q);var K=u(Q,2),C=d(K,!0);l(K);var N=u(K,4);en(N),sr(N,ee=>m(i,ee),()=>n(i));var _=u(N,2);{var z=ee=>{var q=Fg(),G=u(ue(q),2);en(G),Tn(G,()=>n(a),E=>m(a,E)),v(ee,q)};B(_,ee=>{n(p)&&ee(z)})}var I=u(_,2),D=d(I);{var T=ee=>{var q=qg(),G=ue(q);lr(G,{class:"size-3.5 animate-spin"});var E=u(G);L(()=>S(E,` ${n(p)?"Setting up…":"Unlocking…"}`)),v(ee,q)},$=ee=>{var q=_t();L(()=>S(q,n(p)?"Set password":"Unlock")),v(ee,q)};B(D,ee=>{n(o)?ee(T):ee($,-1)})}l(I);var X=u(I,2),H=d(X);{var W=ee=>{var q=Kg(),G=ue(q);ia(G,{class:"size-3 text-danger"});var E=u(G,2),j=d(E,!0);l(E),L(()=>S(j,n(b))),v(ee,q)};B(H,ee=>{n(b)&&ee(W)})}l(X);var Y=u(X,2),ae=d(Y);{var ge=ee=>{var q=jg(),G=d(q);Ro(G,{class:"size-3"}),Ce(2),l(q),we("click",q,c),v(ee,q)},ie=ee=>{var q=Bg(),G=u(ue(q),2),E=d(G),j=d(E);Ro(j,{class:"size-3"}),Ce(),l(E);var R=u(E,2);l(G),we("click",E,g),we("click",R,f),v(ee,q)};B(ae,ee=>{n(s)?ee(ie,-1):ee(ge)})}l(Y),l(U),l(F),L(()=>{S(be,n(h)),S(C,n(w)),Pe(N,"autocomplete",n(p)?"new-password":"current-password"),I.disabled=n(o)||!n(r)||n(p)&&!n(a)}),kr("submit",U,M),Tn(N,()=>n(r),ee=>m(r,ee)),v(k,F)};B(V,k=>{_n.backend==="web"&&_n.locked&&k(O)})}v(t,P),it()}tn(["click"]);var Gg=x('<div class="text-fg-3 text-[12px] font-mono py-6 text-center">No staged changes.</div>'),Yg=x('<div class="text-warn text-[11px] mt-1 inline-flex items-center gap-1"><!> </div>'),Xg=x('<li class="border border-line-1 rounded px-2 py-1.5 bg-bg-2/30"><div class="flex items-center justify-between gap-2 mb-1"><span class="text-fg-2"><span class="text-fg-1"> </span> <span class="text-fg-3">· rid</span> <span class="text-fg-1 tabular-nums"> </span> <span class="text-fg-3">·</span> <span class="text-fg-1"> </span></span> <button type="button" class="text-fg-3 hover:text-fg-1 text-[11px]">Unstage</button></div> <div class="text-[11px] grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5"><span class="text-fg-3">old</span> <span class="text-fg-2 truncate"> </span> <span class="text-fg-3">new</span> <span class="text-accent truncate"> </span></div> <div class="text-fg-3 text-[10.5px] mt-1 truncate"> </div> <!></li>'),Zg=x('<ul class="space-y-2 text-[12px] font-mono"></ul>'),Qg=x('<div class="text-warn text-[11px] font-mono mt-2"> </div>'),Jg=x('<div class="flex items-center gap-1.5 px-4 py-2 text-warn text-[11px] font-mono border-t border-line-1 bg-warn/5"><!> <span> </span></div>'),ep=x('<div class="fixed inset-0 z-50 grid place-items-center bg-bg-0/70 backdrop-blur-sm motion-reduce:backdrop-blur-none" role="dialog" aria-modal="true" aria-label="Pending changes"><div class="w-full max-w-2xl mx-4 bg-bg-1 border border-line-1 rounded-md shadow-lg overflow-hidden"><div class="flex items-center justify-between px-4 py-3 border-b border-line-1"><div><h2 class="type-h3 m-0">Pending changes</h2> <p class="text-fg-3 text-[11px] font-mono m-0 mt-0.5"> </p></div> <button type="button" class="p-1 text-fg-3 hover:text-fg-1" aria-label="Close"><!></button></div> <div class="max-h-[50vh] overflow-auto px-4 py-3"><!> <!></div> <!> <div class="flex items-center justify-end gap-2 px-4 py-3 border-t border-line-1 bg-bg-1/60"><button type="button" class="text-[12px] font-mono px-3 py-1 text-fg-3 hover:text-fg-1">Cancel</button> <button type="button" class="text-[12px] font-mono px-3 py-1 text-fg-1 border border-line-1 rounded hover:bg-bg-2">Discard all</button> <button type="button" class="text-[12px] font-mono px-3 py-1 bg-accent text-white rounded disabled:opacity-50"> </button></div></div></div>');function tp(t,e){ot(e,!0);const r=y(()=>Ue.readOnly),a=y(()=>Ue.readOnlyReason);let o=_e(!1),s=_e(null);async function i(){if(!n(o)){m(o,!0),m(s,null);try{(await On.commitAll()).failed.length===0&&e.onClose()}catch(b){m(s,b.message,!0)}finally{m(o,!1)}}}function c(){On.discardAll(),e.onClose()}var f=De(),g=ue(f);{var p=b=>{var h=ep(),w=d(h),M=d(w),P=d(M),V=u(d(P),2),O=d(V);l(V),l(P);var k=u(P,2),F=d(k);Rn(F,{class:"size-4"}),l(k),l(M);var U=u(M,2),Q=d(U);{var se=D=>{var T=Gg();v(D,T)},xe=D=>{var T=Zg();Qe(T,21,()=>On.changes,$=>$.id,($,X)=>{var H=Xg(),W=d(H),Y=d(W),ae=d(Y),ge=d(ae,!0);l(ae);var ie=u(ae,4),ee=d(ie,!0);l(ie);var q=u(ie,4),G=d(q,!0);l(q),l(Y);var E=u(Y,2);l(W);var j=u(W,2),R=u(d(j),2),A=d(R,!0);l(R);var Z=u(R,4),J=d(Z,!0);l(Z),l(j);var oe=u(j,2),me=d(oe,!0);l(oe);var pe=u(oe,2);{var Ee=Se=>{var ve=Yg(),ce=d(ve);yc(ce,{class:"size-3"});var Oe=u(ce);l(ve),L(()=>S(Oe,` ${n(X).error??""}`)),v(Se,ve)};B(pe,Se=>{n(X).error&&Se(Ee)})}l(H),L((Se,ve)=>{S(ge,n(X).table),S(ee,n(X).row),S(G,n(X).col),S(A,Se),S(J,n(X).newValue),S(me,ve)},[()=>String(n(X).oldValue??"NULL"),()=>Es(n(X))]),we("click",E,()=>On.unstage(n(X).id)),v($,H)}),l(T),v(D,T)};B(Q,D=>{On.count===0?D(se):D(xe,-1)})}var le=u(Q,2);{var te=D=>{var T=Qg(),$=d(T,!0);l(T),L(()=>S($,n(s))),v(D,T)};B(le,D=>{n(s)&&D(te)})}l(U);var be=u(U,2);{var K=D=>{var T=Jg(),$=d(T);Gr($,{class:"size-3 shrink-0"});var X=u($,2),H=d(X,!0);l(X),l(T),L(()=>S(H,n(a)??"Server is read-only (file in use) — changes can’t be applied.")),v(D,T)};B(be,D=>{n(r)&&D(K)})}var C=u(be,2),N=d(C),_=u(N,2),z=u(_,2),I=d(z,!0);l(z),l(C),l(w),l(h),L(()=>{S(O,`${On.count??""} staged · review before applying`),_.disabled=On.count===0,z.disabled=On.count===0||n(o)||n(r),Pe(z,"title",n(r)?n(a)??"Server is read-only — mutations are disabled.":void 0),S(I,n(o)?"Applying…":"Apply all")}),we("click",k,function(...D){var T;(T=e.onClose)==null||T.apply(this,D)}),we("click",N,function(...D){var T;(T=e.onClose)==null||T.apply(this,D)}),we("click",_,c),we("click",z,i),v(b,h)};B(g,b=>{e.open&&b(p)})}v(t,f),it()}tn(["click"]);const np=["vector","queue","stats","diff","hypertable","graph","kv","document","table"],Vc={table:"table",structured:"table",graph:"graph",node:"graph",edge:"graph",hypertable:"hypertable",timeseries:"hypertable","time-series":"hypertable",kv:"kv","key-value":"kv",vector:"vector",embedding:"vector",queue:"queue",stream:"queue",message:"queue",stats:"stats",statistic:"stats",statistics:"stats",metric:"stats",metrics:"stats",document:"document",doc:"document",time_series:"hypertable",key_value:"kv",mixed:"table",hll:"stats",sketch:"stats",filter:"stats",cuckoo_filter:"stats",diff:"diff",vcs_diff:"diff"};function rp(t){return`'${t.replace(/'/g,"''")}'`}function dl(t){if(!t||t.length===0)return"table";const e=new Set;for(const r of t){const a=String(r).toLowerCase(),o=Vc[a];o&&e.add(o)}for(const r of np)if(e.has(r))return r;return"table"}function ap(t){var o,s;const e=[];if(t.kind&&e.push(t.kind),t.capability&&e.push(t.capability),Array.isArray(t.capabilities))for(const i of t.capabilities)typeof i=="string"&&e.push(i);const r=(o=t.schema)==null?void 0:o.kind;typeof r=="string"&&e.push(r);const a=(s=t.schema)==null?void 0:s.capability;return typeof a=="string"&&e.push(a),e}function op(t){return typeof t!="string"?null:Vc[t.toLowerCase()]??null}async function ul(t,e){const r=e.replace(/[^A-Za-z0-9_./-]/g,"");for(const a of[`HLL INFO ${r}`,`SKETCH INFO ${r}`,`FILTER INFO ${r}`])try{if((await t.query(a)).ok)return"stats"}catch{}return null}function ip(t){var a,o,s,i;const e=new Set((((a=t.result)==null?void 0:a.columns)??[]).map(c=>c.toLowerCase())),r=(i=(s=(o=t.result)==null?void 0:o.records)==null?void 0:s[0])==null?void 0:i.values;if(r)for(const c of Object.keys(r))e.add(c.toLowerCase());return[...e]}function sp(t){var i,c,f;const e=ip(t),r=g=>e.includes(g),a=g=>g.some(r),o=(f=(c=(i=t.result)==null?void 0:i.records)==null?void 0:c[0])==null?void 0:f.values,s=(o==null?void 0:o.kind)??(o==null?void 0:o.red_kind)??(o==null?void 0:o.red_entity_type);return s==="node"||s==="edge"||s==="graph"?"graph":s==="document"?"document":s==="kv"||r("key")&&r("value")?"kv":a(["message","payload","body"])&&a(["message_id","state","status","consumer","delivery_state"])?"queue":a(["timestamp","time","ts","event_time","bucket"])&&a(["value","count","metric"])?"hypertable":a(["metric","stat","name","table"])&&a(["value","count","total","avg","rate","row_count","page_count","cardinality","memory_bytes"])?"stats":null}async function Hc(t,e,r={}){var a,o,s,i,c,f,g;if(r.useMetadata)try{const p=await t.collection(e),b=ap(p);if(b.length>0)return dl(b)}catch{}try{const b=(i=(s=(o=(a=(await t.query(`SELECT model FROM red.collections WHERE name = ${rp(e)} LIMIT 1`)).result)==null?void 0:a.records)==null?void 0:o[0])==null?void 0:s.values)==null?void 0:i.model,h=op(b);if(h&&h!=="table")return h;if(typeof b=="string"&&b.toLowerCase()==="mixed"){const w=await ul(t,e);if(w)return w}}catch{}try{const p=e.replace(/[^A-Za-z0-9_./-]/g,""),b=await t.query(`SELECT * FROM ${p} LIMIT 1`),h=[];b.capability&&h.push(b.capability);const w=(g=(f=(c=b.result)==null?void 0:c.records)==null?void 0:f[0])==null?void 0:g.values,M=w?w.red_capabilities:void 0;if(Array.isArray(M))for(const V of M)typeof V=="string"&&h.push(V);else if(typeof M=="string")for(const V of M.split(/[,\s]+/))V&&h.push(V);const P=dl(h);return P!=="table"?P:sp(b)??"table"}catch{return await ul(t,e)??"table"}}const yi={table:{glyph:"▦",label:"Table"},graph:{glyph:"◇",label:"Graph"},hypertable:{glyph:"⊞",label:"Hypertable"},kv:{glyph:"⋮",label:"Key-value"},vector:{glyph:"→",label:"Vector"},queue:{glyph:"≡",label:"Queue"},stats:{glyph:"◔",label:"Stats"},diff:{glyph:"⇄",label:"Diff"},document:{glyph:"¶",label:"Document"}},lp=/^red[._]/i;function cp(t){return lp.test(t)}var dp=x('<span class="font-mono text-[10px] text-fg-3"> </span>'),up=x('<div class="p-3 flex flex-col items-start gap-2 text-[12px] text-fg-3 font-mono leading-relaxed"><!> <span class="text-fg-1">Locked.</span> <span>Enter your master password to load the schema.</span></div>'),fp=x('<div class="p-3 flex flex-col items-start gap-2 text-[12px] text-fg-3 font-mono leading-relaxed"><!> <span>No schema to show.</span> <span>Connect to a reddb instance to inspect collections.</span></div>'),vp=x(`<div class="p-3 text-[12px] text-fg-3 font-mono leading-relaxed"><div class="text-fg-2">Couldn't load collections.</div> <div class="mt-1 break-words"> </div></div>`),gp=x('<div class="h-5 rounded border border-line-1 bg-bg-1 px-1.5 motion-safe:animate-pulse"></div>'),pp=x('<li class="flex h-7 items-center gap-2 px-3"><div class="h-4 w-4 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-3 rounded bg-bg-2 motion-safe:animate-pulse"></div></li>'),hp=x('<div class="schema-skeleton" aria-busy="true" aria-label="Loading schema"><div class="p-2 border-b border-line-1 grid gap-2"><div class="flex items-center gap-1.5 h-7 rounded border border-line-1 bg-bg-0 px-2"><!> <div class="h-3 w-32 rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <div class="flex flex-wrap gap-1"></div></div> <ul class="py-1" role="presentation"></ul></div>'),bp=x('<div class="p-3 flex flex-col items-start gap-2 text-[12px] text-fg-3 font-mono leading-relaxed"><span class="text-fg-2">No user collections.</span> <span>Seed the instance to populate the schema.</span> <code class="px-2 py-1 bg-bg-2 border border-line-1 rounded text-[11px]"> </code></div>'),xp=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear collection search"><!></button>'),mp=x('<button type="button"> </button>'),_p=x('<li class="px-3 py-2 font-mono text-[12px] text-fg-3">No matching collections.</li>'),yp=x('<li><a><span class="inline-block w-4 text-center text-fg-3" aria-hidden="true"> </span> <span class="truncate"> </span> <span class="sr-only"> </span></a></li>'),wp=x('<div class="p-2 border-b border-line-1 grid gap-2"><div class="flex items-center gap-1.5 h-7 rounded border border-line-1 bg-bg-0 px-2 text-[11px] font-mono"><!> <input type="text" placeholder="search collections…" class="min-w-0 flex-1 bg-transparent text-fg-1 outline-none placeholder:text-fg-3"/> <!></div> <div class="flex flex-wrap gap-1"><button type="button"> </button> <!></div></div> <ul class="py-1" role="list"><!> <!></ul>',1),kp=x('<div class="px-3 py-2 border-b border-line-1 flex items-center justify-between text-fg-3"><div class="flex items-center gap-2"><!> <span class="type-label">Schema</span></div> <!></div> <!>',1);function Sp(t,e){ot(e,!0);const r=ya(),a=y(()=>r.collection);let o=_e(Bt([])),s=_e(!1),i=_e(null),c=_e(""),f=_e("all");const g=Array.from({length:10},(N,_)=>_),p=Array.from({length:4},(N,_)=>_),b=y(()=>Ue.connected),h=y(()=>Ue.active.url),w=y(()=>{const N=new Map;for(const _ of n(o))N.set(_.capability,(N.get(_.capability)??0)+1);return[...N.entries()].sort((_,z)=>_[0].localeCompare(z[0]))}),M=y(()=>{const N=n(c).trim().toLowerCase();return n(o).filter(_=>{if(n(f)!=="all"&&_.capability!==n(f))return!1;if(!N)return!0;const z=yi[_.capability];return _.name.toLowerCase().includes(N)||z.label.toLowerCase().includes(N)})});async function P(){const N=Ue.client;if(!N||!n(b)){m(o,[],!0);return}m(s,!0),m(i,null);const _=n(h);try{const I=(await Ct.track("schema · list collections",()=>N.collections())).filter(T=>!cp(T)).sort();m(o,I.map(T=>({name:T,capability:"table"})),!0);const D=I.map(T=>Ct.track(`schema · probe ${T}`,async()=>{const $=await Hc(N,T);_===n(h)&&m(o,n(o).map(X=>X.name===T?{...X,capability:$}:X),!0)}));await Promise.all(D)}catch(z){m(i,z.message,!0),m(o,[],!0)}finally{m(s,!1)}}an(()=>{_n.locked||(n(b),n(h),P())});var V=kp(),O=ue(V),k=d(O),F=d(k);Oo(F,{class:"size-3.5"}),Ce(2),l(k);var U=u(k,2);{var Q=N=>{var _=dp(),z=d(_,!0);l(_),L(()=>S(z,n(o).length)),v(N,_)};B(U,N=>{n(b)&&n(o).length>0&&N(Q)})}l(O);var se=u(O,2);{var xe=N=>{var _=up(),z=d(_);Gr(z,{class:"size-4 text-accent"}),Ce(4),l(_),v(N,_)},le=N=>{var _=fp(),z=d(_);Ic(z,{class:"size-4 text-fg-3"}),Ce(4),l(_),v(N,_)},te=N=>{var _=vp(),z=u(d(_),2),I=d(z,!0);l(z),l(_),L(()=>S(I,n(i))),v(N,_)},be=N=>{var _=hp(),z=d(_),I=d(z),D=d(I);Xn(D,{class:"size-3 text-fg-3"}),Ce(2),l(I);var T=u(I,2);Qe(T,20,()=>p,X=>X,(X,H)=>{var W=gp();L(()=>kn(W,`width: ${H===0?42:28+H*8}px`)),v(X,W)}),l(T),l(z);var $=u(z,2);Qe($,20,()=>g,X=>X,(X,H)=>{var W=pp(),Y=u(d(W),2);l(W),L(()=>kn(Y,`width: ${H%3===0?132:H%3===1?96:164}px`)),v(X,W)}),l($),l(_),v(N,_)},K=N=>{var _=bp(),z=u(d(_),4),I=d(z);l(z),l(_),L(()=>S(I,`./scripts/seed.sh ${n(h)??""}`)),v(N,_)},C=N=>{var _=wp(),z=ue(_),I=d(z),D=d(I);Xn(D,{class:"size-3 text-fg-3"});var T=u(D,2);en(T);var $=u(T,2);{var X=G=>{var E=xp(),j=d(E);Rn(j,{class:"size-3"}),l(E),we("click",E,()=>m(c,"")),v(G,E)};B($,G=>{n(c)&&G(X)})}l(I);var H=u(I,2),W=d(H),Y=d(W);l(W);var ae=u(W,2);Qe(ae,17,()=>n(w),([G,E])=>G,(G,E)=>{var j=y(()=>er(n(E),2));let R=()=>n(j)[0],A=()=>n(j)[1];const Z=y(()=>yi[R()]);var J=mp(),oe=d(J);l(J),L(me=>{Pe(J,"title",n(Z).label),Ve(J,1,me),S(oe,`${n(Z).glyph??""} ${A()??""}`)},[()=>Ke(["h-5 rounded border px-1.5 font-mono text-[10px] cursor-pointer transition-colors",n(f)===R()?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),we("click",J,()=>m(f,R(),!0)),v(G,J)}),l(H),l(z);var ge=u(z,2),ie=d(ge);{var ee=G=>{var E=_p();v(G,E)};B(ie,G=>{n(M).length===0&&G(ee)})}var q=u(ie,2);Qe(q,17,()=>n(M),G=>G.name,(G,E)=>{const j=y(()=>yi[n(E).capability]),R=y(()=>n(E).name===n(a)),A=y(()=>({view:"collection",collection:n(E).name,subpage:Pa(n(E).capability)}));var Z=yp(),J=d(Z),oe=d(J),me=d(oe,!0);l(oe);var pe=u(oe,2),Ee=d(pe,!0);l(pe);var Se=u(pe,2),ve=d(Se,!0);l(Se),l(J),l(Z),L((ce,Oe)=>{Pe(J,"href",ce),Pe(J,"aria-current",n(R)?"page":void 0),Pe(J,"title",`${n(j).label} · ${n(E).name}`),Ve(J,1,Oe),S(me,n(j).glyph),S(Ee,n(E).name),S(ve,n(j).label)},[()=>r.href(n(A)),()=>Ke(["w-full flex items-center gap-2 px-3 py-1 font-mono text-[12px] no-underline transition-colors",n(R)?"bg-bg-1 text-fg-0":"text-fg-2 hover:bg-bg-1 hover:text-fg-0"].join(" "))]),we("click",J,ce=>r.go(n(A),ce)),v(G,Z)}),l(ge),L(G=>{Ve(W,1,G),S(Y,`all ${n(o).length??""}`)},[()=>Ke(["h-5 rounded border px-1.5 font-mono text-[10px] cursor-pointer transition-colors",n(f)==="all"?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),Tn(T,()=>n(c),G=>m(c,G)),we("click",W,()=>m(f,"all")),v(N,_)};B(se,N=>{_n.locked?N(xe):n(b)?n(i)?N(te,2):n(s)&&n(o).length===0?N(be,3):n(o).length===0?N(K,4):N(C,-1):N(le,1)})}v(t,V),it()}tn(["click"]);function Cp(){return Math.random().toString(36).slice(2,10)}var Za,Qa,Ja;class Ep{constructor(){Fe(this,Za,_e(Bt([])));Fe(this,Qa,_e(null));Fe(this,Ja,y(()=>this.tabs.find(e=>e.id===this.activeId)??null))}get tabs(){return n(fe(this,Za))}set tabs(e){m(fe(this,Za),e,!0)}get activeId(){return n(fe(this,Qa))}set activeId(e){m(fe(this,Qa),e,!0)}get active(){return n(fe(this,Ja))}set active(e){m(fe(this,Ja),e)}open(e,r=!1){if(!r){const o=this.tabs.find(s=>s.kind===e.kind&&s.key===e.key);if(o){const s={...o,...e,id:o.id};return this.tabs=this.tabs.map(i=>i===o?s:i),this.activeId=o.id,s}}const a={...e,id:Cp()};return this.tabs=[...this.tabs,a],this.activeId=a.id,a}focus(e){this.tabs.some(r=>r.id===e)&&(this.activeId=e)}close(e,r){const a=this.tabs.findIndex(s=>s.id===e);if(a<0)return;const o=this.activeId===e;if(this.tabs=this.tabs.filter(s=>s.id!==e),o)if(r&&this.tabs.some(s=>s.id===r))this.activeId=r;else if(this.tabs.length===0)this.activeId=null;else{const s=this.tabs[Math.max(0,a-1)];this.activeId=(s==null?void 0:s.id)??null}}rename(e,r){this.tabs=this.tabs.map(a=>a.id===e?{...a,label:r}:a)}setOverride(e,r){this.tabs=this.tabs.map(a=>a.id===e?{...a,overrideCapability:r}:a)}setShowSystem(e,r){this.tabs=this.tabs.map(a=>a.id===e?{...a,showSystemColumns:r}:a)}clear(){this.tabs=[],this.activeId=null}}Za=new WeakMap,Qa=new WeakMap,Ja=new WeakMap;const Gt=new Ep;function Np(){return{sql:"",result:null,error:null,running:!1,runningStartedAt:null}}function Mp(t){const e=t.replace(/\s+/g," ").trim();return e.length<=80?`query · ${e}`:`query · ${e.slice(0,79).trimEnd()}…`}function zp(t){return t instanceof DOMException&&t.name==="AbortError"||t instanceof Error&&t.name==="AbortError"}function Tp(t){if(t<1e3)return`${t}ms`;if(t<6e4)return`${(t/1e3).toFixed(1)}s`;const e=Math.floor(t/6e4),r=Math.floor(t%6e4/1e3);return`${e}m ${r.toString().padStart(2,"0")}s`}var eo;class Pp{constructor(){Fe(this,eo,_e(Bt({})));jt(this,"counter",0);jt(this,"executor",null);jt(this,"runSeq",0);jt(this,"inFlight",new Map)}get states(){return n(fe(this,eo))}set states(e){m(fe(this,eo),e,!0)}setExecutor(e){this.executor=e}nextLabel(){return this.counter+=1,`Query ${this.counter}`}ensure(e){return this.states[e]||(this.states[e]=Np()),this.states[e]}setSql(e,r){const a=this.ensure(e);a.sql=r}get(e){return this.states[e]}has(e){return this.states[e]!==void 0}remove(e){this.cancel(e),delete this.states[e]}isDirty(e){const r=this.states[e];return r?r.sql.trim().length>0:!1}async run(e){var i,c,f;const r=this.ensure(e);if(r.running)return;if(!this.executor){r.error="No connection — connect to a reddb instance first.",r.result=null;return}const a=r.sql.trim();if(!a){r.error="Empty query.",r.result=null;return}const o=new AbortController,s=++this.runSeq;this.inFlight.set(e,{token:s,controller:o}),r.running=!0,r.runningStartedAt=Date.now(),r.error=null;try{const g=await Ct.track(Mp(a),()=>this.executor(a,{signal:o.signal}));if(((i=this.inFlight.get(e))==null?void 0:i.token)!==s)return;r.result=g,r.error=g.ok?null:g.error??"Query failed."}catch(g){if(((c=this.inFlight.get(e))==null?void 0:c.token)!==s)return;if(o.signal.aborted||zp(g)){r.error=null;return}r.error=g.message,r.result=null}finally{((f=this.inFlight.get(e))==null?void 0:f.token)===s&&(this.inFlight.delete(e),r.running=!1,r.runningStartedAt=null)}}cancel(e){const r=this.inFlight.get(e);if(!r)return!1;this.inFlight.delete(e),r.controller.abort();const a=this.states[e];return a&&(a.running=!1,a.runningStartedAt=null,a.error=null),!0}clear(){for(const e of this.inFlight.values())e.controller.abort();this.inFlight.clear(),this.states={},this.counter=0,this.executor=null,this.runSeq=0}}eo=new WeakMap;const Gn=new Pp;function Ap(t,e,r=24){const a=t.trim();if(!a)return e;const o=a.match(/^\s*select\s+([\s\S]+?)\s+from\b/i);if(!o)return e;const s=o[1].replace(/\s+/g," ").trim();return!s||s==="*"?e:s.length<=r?s:s.slice(0,r-1).trimEnd()+"…"}function Zi(t){return t.replace(/[^A-Za-z0-9_./-]/g,"")}function fl(t,e){const r=Zi(t);return e==="kv"?`LIST KV ${r} LIMIT 200`:`SELECT * FROM ${r} LIMIT 200`}function Lp(t){return`'${t.replace(/'/g,"''")}'`}function Ip(t){return["SELECT name, model, schema_mode, entities, segments, indices,","in_memory_bytes, on_disk_bytes, internal, tenant_id, queue_mode,","dimension, metric, session_key, session_gap_ms","FROM red.collections",`WHERE name = ${Lp(t)}`,"LIMIT 1"].join(" ")}function Ar(t){return typeof t=="string"&&t.length>0?t:void 0}function Lr(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){const e=Number(t);if(Number.isFinite(e))return e}}function Op(t){if(typeof t=="boolean")return t;if(typeof t=="string"){if(t.toLowerCase()==="true")return!0;if(t.toLowerCase()==="false")return!1}}function Rp(t){if(!t)return null;const e=t.values,r=Ar(e.name);return r?{name:r,model:Ar(e.model),schemaMode:Ar(e.schema_mode),entities:Lr(e.entities),segments:Lr(e.segments),indices:Lr(e.indices),inMemoryBytes:Lr(e.in_memory_bytes),onDiskBytes:Lr(e.on_disk_bytes),internal:Op(e.internal),tenantId:Ar(e.tenant_id),queueMode:Ar(e.queue_mode),dimension:Lr(e.dimension),metric:Ar(e.metric),sessionKey:Ar(e.session_key),sessionGapMs:Lr(e.session_gap_ms)}:null}function No(t){return t===void 0?"n/a":new Intl.NumberFormat("en-US").format(t)}function vl(t){if(t===void 0)return"n/a";if(t===0)return"0 B";const e=["B","KiB","MiB","GiB","TiB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),e.length-1),a=t/1024**r,o=a>=100||r===0?0:1;return`${a.toFixed(o)} ${e[r]}`}function Dp(t){return t===void 0?null:t<1e3?`${t} ms`:t<6e4?`${(t/1e3).toFixed(t>=1e4?0:1)} s`:t<36e5?`${(t/6e4).toFixed(t>=6e5?0:1)} min`:`${(t/36e5).toFixed(t>=36e6?0:1)} h`}function gl(t){const e=[];t.schemaMode&&e.push(t.schemaMode),t.dimension!==void 0&&e.push(`${No(t.dimension)}d`),t.metric&&e.push(t.metric),t.queueMode&&e.push(t.queueMode),t.sessionKey&&e.push(`session: ${t.sessionKey}`);const r=Dp(t.sessionGapMs);return r&&e.push(`gap ${r}`),t.internal&&e.push("internal"),e}class $p{constructor(){jt(this,"renderers",[])}register(e){const r=this.renderers.findIndex(a=>a.capability===e.capability);r>=0?this.renderers[r]=e:this.renderers.push(e)}unregister(e){this.renderers=this.renderers.filter(r=>r.capability!==e)}list(){return this.renderers}has(e){return this.renderers.some(r=>r.capability===e)}pick(e,r,a){if(a){const i=this.renderers.find(c=>c.capability===a);if(i)return i}if(e){const i=this.renderers.find(c=>c.capability===e);if(i&&i.renders(r))return i}const o=this.renderers.find(i=>i.renders(r));if(o)return o;const s=this.renderers.find(i=>i.capability==="table");if(!s)throw new Error("No renderer matched and no table fallback is registered");return s}}const tr=new $p,Vp=80,Fc=["rid","collection","kind","tenant","created_at","updated_at"],Hp=new Set(Fc);function Qi(t){return Hp.has(t.toLowerCase())}function Fp(t,e={}){const r=t.result.columns,a=r.filter(g=>!g.startsWith("red_")&&g!=="body"),o=a.filter(g=>!Qi(g)),s=o.find(g=>g.toLowerCase()==="id"),i=o.filter(g=>g!==s),c=[s,...i].filter(g=>!!g);return e.showSystem?[...Fc.filter(g=>a.includes(g)),...c]:c.length>0?c:r}function pl(t){const e=t.toLowerCase();return e==="rid"?"rid":e==="id"?"id":null}function qp(t){return t.find(e=>e.toLowerCase()==="rid")??t.find(e=>e.toLowerCase()==="id")??t.find(e=>e.toLowerCase().endsWith("_id"))??t[0]??null}function Kp(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function jp(t){return t==null}function Bp(t,e=Vp){return t.result.records.slice(0,e).map(r=>r.values)}var Wp=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6"> </div>'),Up=x('<button type="button" class="inline-flex items-center gap-1 h-6 px-2 rounded border border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2 cursor-pointer" title="Return to the original result"><!> reset</button>'),Gp=x('<button type="button" title="Build a SELECT for this collection"><!> <span>select</span></button> <button type="button" class="inline-flex items-center gap-1 h-6 px-2 rounded border border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2 cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed" title="Run the current SELECT against reddb"><!> run</button> <!> <div class="h-4 w-px bg-line-1"></div>',1),Yp=x('<span class="text-[9px] px-1 rounded bg-accent text-white"> </span>'),Xp=x('<button type="button" class="inline-flex items-center gap-1 h-6 px-2 rounded border border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2 cursor-pointer" title="Clear all filters"><!> clear</button>'),Zp=x('<label><input type="checkbox" class="sr-only"/> </label>'),Qp=x('<span class="text-warn"> </span>'),Jp=x('<div class="border-b border-line-1 bg-bg-1/20 px-3 py-2 text-[11px] font-mono"><div class="mb-2 flex items-center gap-2"><span class="text-fg-3">columns:</span> <button type="button" class="rounded border border-line-1 px-1.5 py-0.5 text-fg-3 hover:text-fg-1 hover:border-line-2">all</button> <button type="button" class="rounded border border-line-1 px-1.5 py-0.5 text-fg-3 hover:text-fg-1 hover:border-line-2">none</button> <label class="ml-auto inline-flex items-center gap-1.5 text-fg-3">limit <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1 py-0.5"><option>50</option><option>100</option><option>200</option><option>500</option><option>1k</option></select></label></div> <div class="flex flex-wrap gap-1"></div> <div class="mt-2 flex items-center gap-2 text-fg-3"><code class="min-w-0 flex-1 truncate rounded border border-line-1 bg-bg-0 px-2 py-1 text-fg-1"> </code> <!></div></div>'),eh=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">Empty result.</div>'),th=x(`<span class="ml-1 text-[9px] px-1 py-0.5 rounded bg-accent text-white uppercase tracking-wider font-semibold" title="System-assigned row id — reddb's canonical address">sys</span>`),nh=x('<span class="ml-1 text-[9px] px-1 py-0.5 rounded border border-line-2 text-fg-3 uppercase tracking-wider" title="Reserved system field — written by reddb">sys</span>'),rh=x('<span class="ml-1 text-[9px] px-1 py-0.5 rounded border border-line-2 text-fg-2 uppercase tracking-wider" title="User-defined identifier">pk</span>'),ah=x('<span class="ml-1 text-[10px] text-fg-3 uppercase tracking-wide" title="Inferred primary key">pk</span>'),oh=x("<th><span> </span> <!></th>"),ih=x('<button type="button" class="absolute right-1 top-1/2 -translate-y-1/2 text-fg-3 hover:text-fg-1 cursor-pointer"><!></button>'),sh=x('<th class="px-1 py-1"><div class="relative"><input type="text" class="w-full h-6 pl-2 pr-5 bg-bg-1 text-fg-1 border border-line-1 rounded text-[11px] font-mono outline-none focus:border-accent placeholder:text-fg-3"/> <!></div></th>'),lh=x('<tr class="border-b border-line-1 bg-bg-0"><th class="px-2 py-1"></th><!></tr>'),ch=x('<input class="w-full bg-bg-2 text-fg-1 border border-accent/60 rounded px-1 py-0.5 outline-none"/>'),dh=x('<span class="text-fg-3 italic">NULL</span>'),uh=x('<span class="block truncate"> </span>'),fh=x("<td><!></td>"),vh=x('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-right text-fg-3 select-none"></td><!></tr>'),gh=x('· <span class="text-fg-2"> </span>',1),ph=x('<span>· pk <code class="text-fg-2"> </code></span>'),hh=x('<div class="flex-1 overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-right w-10 font-normal">#</th><!></tr><!></thead><tbody></tbody></table></div> <div class="border-t border-line-1 px-3 py-1.5 text-[11px] font-mono text-fg-3 flex items-center gap-3"><span> <!> <!></span> <span>· double-click a cell to stage edit</span> <!></div>',1),bh=x('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><!> <button type="button"><!> <span>filters</span> <!></button> <!> <div class="ml-auto text-fg-3"> <!> rows</div></div> <!> <!>',1),xh=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function mh(t,e){ot(e,!0);let r=Ye(e,"showSystem",3,!1),a=_e(null);const o=y(()=>n(a)??e.result),s=y(()=>Bp(n(o))),i=y(()=>Fp(n(o),{showSystem:r()})),c=y(()=>qp(n(i))),f=y(()=>n(i).filter(H=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(H)));let g=_e(!1),p=_e(Bt({})),b=_e(200),h=_e(!1),w=_e(null);an(()=>{const H={...n(p)};let W=!1;for(const Y of n(f))H[Y]===void 0&&(H[Y]=!0,W=!0);for(const Y of Object.keys(H))n(f).includes(Y)||(delete H[Y],W=!0);W&&m(p,H,!0)});let M=_e(Bt({})),P=_e(!1);const V=y(()=>{const H=Object.entries(n(M)).filter(([,W])=>W.trim().length>0);return H.length===0?n(s):n(s).filter(W=>H.every(([Y,ae])=>{const ge=W[Y];return ge==null?!1:String(ge).toLowerCase().includes(ae.toLowerCase())}))}),O=y(()=>n(V)),k=y(()=>Object.values(n(M)).filter(H=>H.trim().length>0).length);function F(H){const W={...n(M)};delete W[H],m(M,W,!0)}function U(){m(M,{},!0)}function Q(){if(!e.collection)return null;const H=e.collection.replace(/[^A-Za-z0-9_./-]/g,"");return H.length>0?H:null}function se(){const H=n(f).filter(W=>n(p)[W]);return H.length===0||H.length===n(f).length?"*":H.join(", ")}function xe(){const H=Q();return H?`SELECT ${se()} FROM ${H} LIMIT ${n(b)}`:null}async function le(){const H=Ue.client,W=xe();if(!(!H||!W)){m(h,!0),m(w,null);try{const Y=await Ct.track(`${e.collection} · ${W}`,()=>H.query(W));if(!Y.ok){m(w,Y.error??"query failed",!0);return}m(a,Y,!0),m(M,{},!0),m(be,null)}catch(Y){m(w,Y.message,!0)}finally{m(h,!1)}}}function te(){m(a,null),m(M,{},!0),m(w,null)}let be=_e(null),K=_e("");function C(H,W,Y){if(n(be)||!e.collection||Ue.readOnly)return;m(be,{row:H,col:W},!0);const ae=On.find(e.collection,H,W);m(K,ae?ae.newValue:String(Y??""),!0)}function N(){var ge;if(!n(be)||!e.collection)return;const{row:H,col:W}=n(be),Y=(ge=n(O)[H])==null?void 0:ge[W],ae=n(K);if(String(Y??"")!==ae)On.stage(e.collection,H,W,Y,ae);else{const ie=On.find(e.collection,H,W);ie&&On.unstage(ie.id)}m(be,null)}function _(){m(be,null)}function z(H){H.focus(),H.select()}function I(H,W,Y){if(!e.collection)return{value:Y,staged:!1};const ae=On.find(e.collection,H,W);return ae?{value:ae.newValue,staged:!0}:{value:Y,staged:!1}}var D=xh(),T=d(D);{var $=H=>{var W=Wp(),Y=d(W,!0);l(W),L(()=>S(Y,n(o).error??"Query failed.")),v(H,W)},X=H=>{var W=bh(),Y=ue(W),ae=d(Y);{var ge=ve=>{var ce=Gp(),Oe=ue(ce),re=d(Oe);hv(re,{class:"size-3"}),Ce(2),l(Oe);var de=u(Oe,2),he=d(de);{var Ie=ze=>{lr(ze,{class:"size-3 animate-spin"})},Ae=ze=>{ti(ze,{class:"size-3"})};B(he,ze=>{n(h)?ze(Ie):ze(Ae,-1)})}Ce(),l(de);var ke=u(de,2);{var Te=ze=>{var Ne=Up(),Me=d(Ne);ef(Me,{class:"size-3"}),Ce(),l(Ne),we("click",Ne,te),v(ze,Ne)};B(ke,ze=>{n(a)&&ze(Te)})}Ce(2),L(ze=>{Pe(Oe,"aria-pressed",n(g)),Ve(Oe,1,ze),de.disabled=n(h)||!Ue.connected},[()=>Ke(["inline-flex items-center gap-1.5 h-6 px-2 rounded border transition-colors cursor-pointer",n(g)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),we("click",Oe,()=>m(g,!n(g))),we("click",de,le),v(ve,ce)};B(ae,ve=>{e.collection&&ve(ge)})}var ie=u(ae,2),ee=d(ie);Ac(ee,{class:"size-3"});var q=u(ee,4);{var G=ve=>{var ce=Yp(),Oe=d(ce,!0);l(ce),L(()=>S(Oe,n(k))),v(ve,ce)};B(q,ve=>{n(k)>0&&ve(G)})}l(ie);var E=u(ie,2);{var j=ve=>{var ce=Xp(),Oe=d(ce);Rn(Oe,{class:"size-3"}),Ce(),l(ce),we("click",ce,U),v(ve,ce)};B(E,ve=>{n(k)>0&&ve(j)})}var R=u(E,2),A=d(R,!0),Z=u(A);{var J=ve=>{var ce=_t();L(Oe=>S(ce,`of ${Oe??""}`),[()=>n(s).length.toLocaleString()]),v(ve,ce)};B(Z,ve=>{n(k)>0&&ve(J)})}Ce(),l(R),l(Y);var oe=u(Y,2);{var me=ve=>{var ce=Jp(),Oe=d(ce),re=u(d(Oe),2),de=u(re,2),he=u(de,2),Ie=u(d(he)),Ae=d(Ie);Ae.value=Ae.__value=50;var ke=u(Ae);ke.value=ke.__value=100;var Te=u(ke);Te.value=Te.__value=200;var ze=u(Te);ze.value=ze.__value=500;var Ne=u(ze);Ne.value=Ne.__value=1e3,l(Ie);var Me;aa(Ie),l(he),l(Oe);var Xe=u(Oe,2);Qe(Xe,20,()=>n(f),$e=>$e,($e,je)=>{var at=Zp(),ne=d(at);en(ne);var nt=u(ne);l(at),L(Ze=>{Ve(at,1,Ze),Ta(ne,n(p)[je]??!1),S(nt,` ${je??""}`)},[()=>Ke(["inline-flex h-5 items-center gap-1 rounded border px-1.5 cursor-pointer",n(p)[je]?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1"].join(" "))]),we("change",ne,Ze=>m(p,{...n(p),[je]:Ze.currentTarget.checked},!0)),v($e,at)}),l(Xe);var Re=u(Xe,2),Je=d(Re),dt=d(Je,!0);l(Je);var ft=u(Je,2);{var qe=$e=>{var je=Qp(),at=d(je,!0);l(je),L(()=>S(at,n(w))),v($e,je)};B(ft,$e=>{n(w)&&$e(qe)})}l(Re),l(ce),L($e=>{Me!==(Me=n(b))&&(Ie.value=(Ie.__value=n(b))??"",oa(Ie,n(b))),S(dt,$e)},[()=>xe()??"No collection selected"]),we("click",re,()=>{const $e={};for(const je of n(f))$e[je]=!0;m(p,$e,!0)}),we("click",de,()=>m(p,{},!0)),we("change",Ie,$e=>m(b,Number($e.currentTarget.value),!0)),v(ve,ce)};B(oe,ve=>{n(g)&&e.collection&&ve(me)})}var pe=u(oe,2);{var Ee=ve=>{var ce=eh();v(ve,ce)},Se=ve=>{var ce=hh(),Oe=ue(ce),re=d(Oe),de=d(re),he=d(de),Ie=u(d(he));Qe(Ie,17,()=>n(i),bn,($e,je)=>{const at=y(()=>pl(n(je))),ne=y(()=>Qi(n(je)));var nt=oh(),Ze=d(nt),Be=d(Ze,!0);l(Ze);var ut=u(Ze,2);{var Nt=mt=>{var yt=th();v(mt,yt)},Pt=mt=>{var yt=nh();v(mt,yt)},Mt=mt=>{var yt=rh();v(mt,yt)},Et=mt=>{var yt=ah();v(mt,yt)};B(ut,mt=>{n(at)==="rid"?mt(Nt):n(ne)?mt(Pt,1):n(at)==="id"?mt(Mt,2):n(je)===n(c)&&mt(Et,3)})}l(nt),L(mt=>{Ve(nt,1,mt),Ve(Ze,1,Ke(n(at)||n(ne)?"font-semibold":"")),S(Be,n(je))},[()=>Ke(["px-2 py-1.5 text-left font-normal whitespace-nowrap",n(at)==="rid"?"bg-accent/5 text-fg-0":n(ne)?"bg-bg-1 text-fg-2":n(at)==="id"?"text-fg-1":""].join(" "))]),v($e,nt)}),l(he);var Ae=u(he);{var ke=$e=>{var je=lh(),at=u(d(je));Qe(at,17,()=>n(i),bn,(ne,nt)=>{var Ze=sh(),Be=d(Ze),ut=d(Be);en(ut);var Nt=u(ut,2);{var Pt=Mt=>{var Et=ih(),mt=d(Et);Rn(mt,{class:"size-3"}),l(Et),L(()=>Pe(Et,"aria-label",`Clear filter for ${n(nt)??""}`)),we("click",Et,()=>F(n(nt))),v(Mt,Et)};B(Nt,Mt=>{var Et;(Et=n(M)[n(nt)])!=null&&Et.length&&Mt(Pt)})}l(Be),l(Ze),L(()=>Pe(ut,"placeholder",`filter ${n(nt)??""}…`)),Tn(ut,()=>n(M)[n(nt)],Mt=>n(M)[n(nt)]=Mt),v(ne,Ze)}),l(je),v($e,je)};B(Ae,$e=>{n(P)&&$e(ke)})}l(de);var Te=u(de);Qe(Te,21,()=>n(O),bn,($e,je,at)=>{var ne=vh(),nt=d(ne);nt.textContent=at+1;var Ze=u(nt);Qe(Ze,17,()=>n(i),bn,(Be,ut)=>{const Nt=y(()=>n(je)[n(ut)]),Pt=y(()=>I(at,n(ut),n(Nt))),Mt=y(()=>{var rt;return((rt=n(be))==null?void 0:rt.row)===at&&n(be).col===n(ut)}),Et=y(()=>pl(n(ut))),mt=y(()=>Qi(n(ut)));var yt=fh(),kt=d(yt);{var It=rt=>{var ct=ch();en(ct),ms(()=>Tn(ct,()=>n(K),Lt=>m(K,Lt))),Hn(ct,Lt=>z==null?void 0:z(Lt)),kr("blur",ct,N),we("keydown",ct,Lt=>{Lt.key==="Enter"?N():Lt.key==="Escape"&&_()}),v(rt,ct)},Xt=rt=>{var ct=dh();v(rt,ct)},hn=y(()=>jp(n(Pt).value)),xn=rt=>{var ct=uh(),Lt=d(ct,!0);l(ct),L(Ft=>S(Lt,Ft),[()=>Kp(n(Pt).value)]),v(rt,ct)};B(kt,rt=>{n(Mt)?rt(It):n(hn)?rt(Xt,1):rt(xn,-1)})}l(yt),L(rt=>{Ve(yt,1,rt),Pe(yt,"title",n(Pt).staged?"Staged change — open Pending Changes to commit":void 0)},[()=>Ke(["px-2 py-1 max-w-[260px] truncate align-top",n(Et)==="rid"?"bg-accent/5 text-accent font-semibold":n(mt)?"bg-bg-1 text-fg-2 font-mono":n(Et)==="id"?"text-fg-0":"",n(Pt).staged&&!n(Mt)?"bg-warn/15 text-fg-1":""].join(" "))]),we("dblclick",yt,()=>C(at,n(ut),n(Nt))),v(Be,yt)}),l(ne),v($e,ne)}),l(Te),l(re),l(Oe);var ze=u(Oe,2),Ne=d(ze),Me=d(Ne),Xe=u(Me);{var Re=$e=>{var je=_t("· filtered");v($e,je)};B(Xe,$e=>{n(k)>0&&$e(Re)})}var Je=u(Xe,2);{var dt=$e=>{var je=gh(),at=u(ue(je)),ne=d(at,!0);l(at),L(()=>S(ne,e.collection)),v($e,je)};B(Je,$e=>{e.collection&&$e(dt)})}l(Ne);var ft=u(Ne,4);{var qe=$e=>{var je=ph(),at=u(d(je)),ne=d(at,!0);l(at),l(je),L(()=>S(ne,n(c))),v($e,je)};B(ft,$e=>{n(c)&&$e(qe)})}l(ze),L(()=>S(Me,`${n(O).length??""} of ${n(o).record_count??""} rows `)),v(ve,ce)};B(pe,ve=>{n(o).result.records.length?ve(Se,-1):ve(Ee)})}L((ve,ce)=>{Pe(ie,"aria-pressed",n(P)),Pe(ie,"title",n(P)?"Hide column filters":"Show column filters"),Ve(ie,1,ve),S(A,ce)},[()=>Ke(["inline-flex items-center gap-1.5 h-6 px-2 rounded border transition-colors cursor-pointer",n(P)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>n(O).length.toLocaleString()]),we("click",ie,()=>m(P,!n(P))),v(H,W)};B(T,H=>{n(o).ok?H(X,-1):H($)})}l(D),v(t,D),it()}tn(["click","change","dblclick","keydown"]);const _h={capability:"table",renders:t=>!!(t!=null&&t.result)&&Array.isArray(t.result.columns),component:mh},yh={capability:"graph",renders:t=>nf(t),component:tf};function qc(t){return t.find(e=>e.toLowerCase()==="key")??t.find(e=>e.toLowerCase()==="k")??t.find(e=>/(^|_)key$/i.test(e))??null}function Kc(t){return t.find(e=>e.toLowerCase()==="value")??t.find(e=>e.toLowerCase()==="v")??t.find(e=>/(^|_)value$/i.test(e))??null}function wh(t){const e=t.result.columns,r=qc(e),a=Kc(e);return!r||!a?[]:t.result.records.map(o=>({key:String(o.values[r]??""),value:o.values[a]}))}function kh(t){var r;const e=((r=t.result)==null?void 0:r.columns)??[];return qc(e)!==null&&Kc(e)!==null}function Sh(t,e){const r={};for(const a of t){if(!a.key.startsWith(e))continue;const s=a.key.slice(e.length).replace(/^\/+/,"").split("/").filter(Boolean);if(s.length===0){r.$value=a.value;continue}let i=r;for(let c=0;c<s.length;c+=1){const f=s[c];if(c===s.length-1){const p=i[f];p&&typeof p=="object"&&!Array.isArray(p)?p.$value=a.value:i[f]=a.value;continue}const g=i[f];if(!g||typeof g!="object"||Array.isArray(g)){const p={};g!==void 0&&(p.$value=g),i[f]=p,i=p}else i=g}}return r}function Ch(t){const e={name:"",fullKey:null,value:void 0,children:[]};for(const r of t){const a=r.key.split("/").filter(s=>s.length>0);if(a.length===0)continue;let o=e;a.forEach((s,i)=>{let c=o.children.find(f=>f.name===s);if(!c){c={name:s,fullKey:null,value:void 0,children:[]};const f=o.children.findIndex(g=>g.name>s);f<0?o.children.push(c):o.children.splice(f,0,c)}i===a.length-1&&(c.fullKey=r.key,c.value=r.value),o=c})}return e}function hl(t){return t==null?"null":typeof t=="object"?JSON.stringify(t):String(t)}var Eh=x('<span class="text-fg-3 ml-2"> </span>'),Nh=x("<ul></ul>"),Mh=x('<li><button type="button"><span class="text-fg-1"> </span> <!></button> <!></li>'),zh=x(`<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No KV shape — expected <code>key</code> and <code>value</code> columns
|
|
1105
|
-
(also accepts <code>*_key</code>/<code>*_value</code>).</div>`),Th=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear prefix"><!></button>'),Ph=x('· <span class="text-fg-2"> </span>',1),Ah=x('<li class="px-3 py-2 text-fg-3">No keys match prefix.</li>'),Lh=x('<div class="text-fg-3 mb-2"> </div> <pre class="text-fg-1 whitespace-pre-wrap break-all"> </pre>',1),Ih=x('<div class="text-fg-3">Click a key to inspect.</div>'),Oh=x('<div class="flex-1 grid grid-cols-[280px_1fr] min-h-0"><ul class="overflow-auto border-r border-line-1 text-[12px] font-mono py-1"><!></ul> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>'),Rh=x('<div class="text-fg-3">No keys match prefix.</div>'),Dh=x('<pre class="whitespace-pre text-fg-1"> </pre>'),$h=x('<div class="flex-1 overflow-auto p-3 text-[12px] font-mono"><!></div>'),Vh=x('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> Tree</button> <button type="button"><!> JSON</button></div> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="key prefix…" class="bg-transparent text-fg-1 outline-none w-[220px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto text-fg-3"> <!> keys <!></div></div> <!>',1),Hh=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function Fh(t,e){ot(e,!0);const r=(P,V=Kn,O=Kn)=>{var k=Mh(),F=d(k);let U,Q;var se=d(F),xe=d(se,!0);l(se);var le=u(se,2);{var te=C=>{var N=Eh(),_=d(N,!0);l(N),L(z=>S(_,z),[()=>p(V().value)]),v(C,N)};B(le,C=>{V().fullKey!==null&&C(te)})}l(F);var be=u(F,2);{var K=C=>{var N=Nh();Qe(N,21,()=>V().children,_=>_.name,(_,z)=>{r(_,()=>n(z),()=>O()+1)}),l(N),v(C,N)};B(be,C=>{V().children.length>0&&C(K)})}l(k),L(()=>{U=Ve(F,1,"w-full text-left px-2 py-0.5 hover:bg-bg-1/60",null,U,{"text-accent":n(s)===V()}),Q=kn(F,"",Q,{"padding-left":`${8+O()*12}px`}),S(xe,V().name)}),we("click",F,()=>m(s,V(),!0)),v(P,k)};let a=_e(""),o=_e("tree"),s=_e(null);const i=y(()=>wh(e.result)),c=y(()=>n(a).trim()?n(i).filter(P=>P.key.startsWith(n(a).trim())):n(i)),f=y(()=>Ch(n(c))),g=y(()=>Sh(n(i),n(a).trim()));function p(P){const V=hl(P);return V.length>60?V.slice(0,59)+"…":V}var b=Hh(),h=d(b);{var w=P=>{var V=zh();v(P,V)},M=P=>{var V=Vh(),O=ue(V),k=d(O),F=d(k),U=d(F);Cv(U,{class:"size-3"}),Ce(),l(F);var Q=u(F,2),se=d(Q);va(se,{class:"size-3"}),Ce(),l(Q),l(k);var xe=u(k,2),le=d(xe);Xn(le,{class:"size-3 text-fg-3"});var te=u(le,2);en(te);var be=u(te,2);{var K=H=>{var W=Th(),Y=d(W);Rn(Y,{class:"size-3"}),l(W),we("click",W,()=>m(a,"")),v(H,W)};B(be,H=>{n(a)&&H(K)})}l(xe);var C=u(xe,2),N=d(C,!0),_=u(N);{var z=H=>{var W=_t();L(Y=>S(W,`of ${Y??""}`),[()=>n(i).length.toLocaleString()]),v(H,W)};B(_,H=>{n(a)&&H(z)})}var I=u(_,2);{var D=H=>{var W=Ph(),Y=u(ue(W)),ae=d(Y,!0);l(Y),L(()=>S(ae,e.collection)),v(H,W)};B(I,H=>{e.collection&&H(D)})}l(C),l(O);var T=u(O,2);{var $=H=>{var W=Oh(),Y=d(W),ae=d(Y);{var ge=j=>{var R=Ah();v(j,R)},ie=j=>{var R=De(),A=ue(R);Qe(A,17,()=>n(f).children,Z=>Z.name,(Z,J)=>{r(Z,()=>n(J),()=>0)}),v(j,R)};B(ae,j=>{n(f).children.length===0?j(ge):j(ie,-1)})}l(Y);var ee=u(Y,2),q=d(ee);{var G=j=>{var R=Lh(),A=ue(R),Z=d(A,!0);l(A);var J=u(A,2),oe=d(J,!0);l(J),L(me=>{S(Z,n(s).fullKey??n(s).name),S(oe,me)},[()=>hl(n(s).value)]),v(j,R)},E=j=>{var R=Ih();v(j,R)};B(q,j=>{n(s)?j(G):j(E,-1)})}l(ee),l(W),v(H,W)},X=H=>{var W=$h(),Y=d(W);{var ae=ee=>{var q=Rh();v(ee,q)},ge=y(()=>Object.keys(n(g)).length===0),ie=ee=>{var q=Dh(),G=d(q,!0);l(q),L(E=>S(G,E),[()=>JSON.stringify(n(g),null,2)]),v(ee,q)};B(Y,ee=>{n(ge)?ee(ae):ee(ie,-1)})}l(W),v(H,W)};B(T,H=>{n(o)==="tree"?H($):H(X,-1)})}L((H,W,Y)=>{Ve(F,1,H),Pe(F,"aria-pressed",n(o)==="tree"),Ve(Q,1,W),Pe(Q,"aria-pressed",n(o)==="json"),S(N,Y)},[()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(o)==="tree"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(o)==="json"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>n(c).length.toLocaleString()]),we("click",F,()=>m(o,"tree")),we("click",Q,()=>m(o,"json")),Tn(te,()=>n(a),H=>m(a,H)),v(P,V)};B(h,P=>{n(i).length===0?P(w):P(M,-1)})}l(b),v(t,b),it()}tn(["click"]);const qh={capability:"kv",renders:t=>kh(t),component:Fh},sa="__all__",Kh=["time","timestamp","ts","event_time","bucket","created_at"],jh=new Set(["created_at","updated_at","time","timestamp","timestamp_ns","rid","tenant"]),jc=640,Bc=180,Wc=16;function La(t){if(typeof t=="number")return Number.isFinite(t);if(typeof t=="string"&&t.trim()!==""){const e=Number(t);return Number.isFinite(e)}return!1}function wi(t){return typeof t=="number"?t:Number(t)}function Mo(t){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?t:null;if(t instanceof Date)return t.getTime();if(typeof t=="string"){const e=Number(t);if(Number.isFinite(e))return e;const r=Date.parse(t);return Number.isNaN(r)?null:r}return null}function Uc(t){var a,o;const e=((a=t.result)==null?void 0:a.columns)??[];for(const s of Kh){const i=e.find(c=>c.toLowerCase()===s);if(i)return i}const r=((o=t.result)==null?void 0:o.records)??[];if(r.length===0)return null;for(const s of e){const i=r.find(c=>c.values[s]!==null&&c.values[s]!==void 0);if(i&&Mo(i.values[s])!==null&&!La(i.values[s]))return s}return null}function Gc(t,e){var s,i;const r=((s=t.result)==null?void 0:s.columns)??[],a=((i=t.result)==null?void 0:i.records)??[];if(a.length===0)return[];const o=[];for(const c of r){if(c===e||c.startsWith("red_")||jh.has(c.toLowerCase()))continue;const f=a.find(g=>g.values[c]!==null&&g.values[c]!==void 0);f&&La(f.values[c])&&o.push(c)}return o}function Bh(t){const e=Uc(t);return e?Gc(t,e).length>0:!1}function Wh(t,e){const r=Uc(t);if(!r)return null;const a=t.result.columns.find(f=>f.toLowerCase()==="metric")??null,o=t.result.columns.find(f=>f.toLowerCase()==="value")??null;if(a&&o){const f=new Set,g=[];for(const b of t.result.records){const h=b.values[a],w=b.values[o];if((typeof h=="string"||typeof h=="number")&&La(w)){f.add(String(h));const M=Mo(b.values[r]);M!==null&&g.push({t:M,v:wi(w),raw:b.values})}}const p=[...f].sort();if(p.length>0){if(!e||e===sa)return g.sort((w,M)=>w.t-M.t),{timeColumn:r,metricColumn:o,metrics:[sa,...p],points:g,metricNameColumn:a};const b=p.includes(e)?e:p[0],h=[];for(const w of t.result.records){if(String(w.values[a])!==b)continue;const M=Mo(w.values[r]);if(M===null)continue;const P=w.values[o];La(P)&&h.push({t:M,v:wi(P),raw:w.values})}return h.sort((w,M)=>w.t-M.t),{timeColumn:r,metricColumn:o,metrics:[sa,...p],points:h,metricNameColumn:a}}}const s=Gc(t,r);if(s.length===0)return null;const i=e&&s.includes(e)?e:s[0],c=[];for(const f of t.result.records){const g=f.values[r],p=f.values[i],b=Mo(g);b!==null&&La(p)&&c.push({t:b,v:wi(p),raw:f.values})}return c.sort((f,g)=>f.t-g.t),{timeColumn:r,metricColumn:i,metrics:s,points:c,metricNameColumn:null}}function Uh(t,e=jc,r=Bc,a=Wc){const o=t.points;if(o.length===0)return null;const s=o[0].t,i=o[o.length-1].t;let c=1/0,f=-1/0;for(const M of o)M.v<c&&(c=M.v),M.v>f&&(f=M.v);if(!Number.isFinite(c)||!Number.isFinite(f))return null;const g=i-s||1,p=f-c||1,b=e-a*2,h=r-a*2,w=[];return o.forEach((M,P)=>{const V=a+(M.t-s)/g*b,O=a+h-(M.v-c)/p*h;w.push(`${P===0?"M":"L"}${V.toFixed(2)},${O.toFixed(2)}`)}),{width:e,height:r,padding:a,path:w.join(" "),minT:s,maxT:i,minV:c,maxV:f}}function Gh(t,e=6e4){if(t.points.length===0)return[];const r=t.points[0].t,a=t.points[t.points.length-1].t,o=Math.floor(r/e)*e,s=Math.floor(a/e)*e,i=new Map;for(let c=o;c<=s;c+=e)i.set(c,{t:c,count:0,sum:0});for(const c of t.points){const f=Math.floor(c.t/e)*e,g=i.get(f);g&&(g.count+=1,g.sum+=c.v)}return[...i.values()].sort((c,f)=>c.t-f.t)}function Yh(t,e=jc,r=Bc,a=Wc){if(t.length===0)return null;const o=t.reduce((p,b)=>Math.max(p,b.count),0);if(o===0)return null;const s=e-a*2,i=r-a*2,c=s/t.length,f=Math.max(1,c-1),g=t.map((p,b)=>{const w=p.count/o*i;return{x:a+b*c,y:a+i-w,w:f,h:w,bucket:p}});return{width:e,height:r,padding:a,bars:g,maxCount:o}}var Xh=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No timeseries shape (need a time column and a numeric metric).</div>'),Zh=x("<option> </option>"),Qh=x('<label class="inline-flex items-center gap-1.5 text-fg-3">bucket: <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1.5 py-0.5"><option>1s</option><option>10s</option><option>1min</option><option>5min</option><option>10min</option><option>1hr</option></select></label>'),Jh=x('<button type="button" class="inline-flex items-center gap-1 px-2 py-1 rounded border border-line-1 text-fg-3 hover:text-fg-1 cursor-pointer" title="Show all rows again"><!> clear bucket</button>'),e1=x('· <span class="text-fg-2"> </span>',1),t1=En('<rect class="cursor-pointer transition-opacity" fill="var(--color-accent)" role="button" tabindex="0"><title> </title></rect>'),n1=En('<svg class="block w-full h-[180px]" aria-label="Writes per bucket"><!><text class="text-[9px] fill-fg-3 font-mono"> </text><text text-anchor="end" class="text-[9px] fill-fg-3 font-mono"> </text></svg>'),r1=En('<svg class="block w-full h-[180px] text-accent" aria-label="Timeseries chart"><path fill="none" stroke="currentColor" stroke-width="1.5"></path></svg>'),a1=x('<th class="px-2 py-1.5 text-left font-normal">metric</th>'),o1=x('<td class="px-2 py-1 text-fg-2"> </td>'),i1=x('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1"> </td><!><td class="px-2 py-1 text-right text-accent"> </td><td class="px-2 py-1 text-fg-2"> </td></tr>'),s1=x('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> </button> <button type="button"><!> Value</button></div> <label class="inline-flex items-center gap-1.5 text-fg-3"><!> metric: <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1.5 py-0.5"></select></label> <!> <!> <div class="ml-auto text-fg-3"><span class="text-fg-2"> </span> <!> inserts <!></div></div> <div class="px-3 pt-2"><!></div> <div class="flex-1 min-h-0 overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">time</th><!><th class="px-2 py-1.5 text-right font-normal">value</th><th class="px-2 py-1.5 text-left font-normal">log</th></tr></thead><tbody></tbody></table></div> <div class="border-t border-line-1 px-3 py-1.5 text-[11px] font-mono text-fg-3"> <!></div>',1),l1=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function c1(t,e){ot(e,!0);let r=_e(Bt(sa)),a=_e("rate"),o=_e(6e4),s=_e(null);const i=y(()=>Wh(e.result,n(r))),c=y(()=>n(i)&&n(a)==="line"?Uh(n(i)):null),f=y(()=>n(i)?Gh(n(i),n(o)):[]),g=y(()=>n(i)&&n(a)==="rate"?Yh(n(f)):null),p=y(()=>{if(!n(i))return[];if(!n(s))return n(i).points;const Q=n(s).t,se=Q+n(o);return n(i).points.filter(xe=>xe.t>=Q&&xe.t<se)});function b(Q){try{return new Date(Q).toISOString().replace("T"," ").slice(0,19)}catch{return String(Q)}}function h(Q){return Q==null?"":typeof Q=="object"?JSON.stringify(Q):String(Q)}function w(Q){var be;const se=[],xe=(be=n(i))!=null&&be.metricNameColumn?Q.raw[n(i).metricNameColumn]:void 0;xe!==void 0&&se.push(String(xe));const le=Q.raw.tags;if(le&&typeof le=="object"){const K=Object.entries(le).map(([C,N])=>`${C}=${h(N)}`).join(" ");K&&se.push(K)}const te=Q.raw.event??Q.raw.action??Q.raw.message??Q.raw.payload;return te!==void 0&&se.push(h(te)),se.join(" · ")}function M(Q){return Q===1e3?"1s":Q===1e4?"10s":Q===6e4?"1min":Q===3e5?"5min":Q===6e5?"10min":Q===36e5?"1hr":`${Q}ms`}function P(Q){return Q===sa?"all writes":Q}function V(){return n(i)?!n(r)||n(r)===sa?"all writes":n(r):""}var O=l1(),k=d(O);{var F=Q=>{var se=Xh();v(Q,se)},U=Q=>{var se=s1(),xe=ue(se),le=d(xe),te=d(le),be=d(te);dv(be,{class:"size-3"});var K=u(be);l(te);var C=u(te,2),N=d(C);Mc(N,{class:"size-3"}),Ce(),l(C),l(le);var _=u(le,2),z=d(_);Ha(z,{class:"size-3"});var I=u(z,2);Qe(I,20,()=>n(i).metrics,re=>re,(re,de)=>{var he=Zh(),Ie=d(he,!0);l(he);var Ae={};L(ke=>{S(Ie,ke),Ae!==(Ae=de)&&(he.value=(he.__value=de)??"")},[()=>P(de)]),v(re,he)}),l(I),l(_);var D=u(_,2);{var T=re=>{var de=Qh(),he=u(d(de)),Ie=d(he);Ie.value=Ie.__value=1e3;var Ae=u(Ie);Ae.value=Ae.__value=1e4;var ke=u(Ae);ke.value=ke.__value=6e4;var Te=u(ke);Te.value=Te.__value=3e5;var ze=u(Te);ze.value=ze.__value=6e5;var Ne=u(ze);Ne.value=Ne.__value=36e5,l(he);var Me;aa(he),l(de),L(()=>{Me!==(Me=n(o))&&(he.value=(he.__value=n(o))??"",oa(he,n(o)))}),we("change",he,Xe=>{m(o,Number(Xe.currentTarget.value),!0),m(s,null)}),v(re,de)};B(D,re=>{n(a)==="rate"&&re(T)})}var $=u(D,2);{var X=re=>{var de=Jh(),he=d(de);Rn(he,{class:"size-3"}),Ce(),l(de),we("click",de,()=>m(s,null)),v(re,de)};B($,re=>{n(s)&&re(X)})}var H=u($,2),W=d(H),Y=d(W,!0);l(W);var ae=u(W),ge=u(ae);{var ie=re=>{var de=_t();L(he=>S(de,`of ${he??""}`),[()=>n(i).points.length.toLocaleString()]),v(re,de)};B(ge,re=>{n(s)&&re(ie)})}var ee=u(ge,2);{var q=re=>{var de=e1(),he=u(ue(de)),Ie=d(he,!0);l(he),L(()=>S(Ie,e.collection)),v(re,de)};B(ee,re=>{e.collection&&re(q)})}l(H),l(xe);var G=u(xe,2),E=d(G);{var j=re=>{var de=n1(),he=d(de);Qe(he,17,()=>n(g).bars,ze=>ze.bucket.t,(ze,Ne)=>{var Me=t1(),Xe=d(Me),Re=d(Xe);l(Xe),l(Me),L((Je,dt,ft)=>{Pe(Me,"x",n(Ne).x),Pe(Me,"y",n(Ne).y),Pe(Me,"width",n(Ne).w),Pe(Me,"height",n(Ne).h),Pe(Me,"opacity",!n(s)||n(s).t===n(Ne).bucket.t?.9:.3),Pe(Me,"aria-label",`Bucket starting at ${Je??""} with ${n(Ne).bucket.count??""} writes`),S(Re,`${dt??""} — ${n(Ne).bucket.count??""} writes (sum ${ft??""})`)},[()=>b(n(Ne).bucket.t),()=>b(n(Ne).bucket.t),()=>n(Ne).bucket.sum.toFixed(2)]),we("click",Me,()=>{var Je;return m(s,((Je=n(s))==null?void 0:Je.t)===n(Ne).bucket.t?null:n(Ne).bucket,!0)}),we("keydown",Me,Je=>{var dt;(Je.key==="Enter"||Je.key===" ")&&(Je.preventDefault(),m(s,((dt=n(s))==null?void 0:dt.t)===n(Ne).bucket.t?null:n(Ne).bucket,!0))}),v(ze,Me)});var Ie=u(he),Ae=d(Ie,!0);l(Ie);var ke=u(Ie),Te=d(ke);l(ke),l(de),L((ze,Ne)=>{Pe(de,"viewBox",`0 0 ${n(g).width} ${n(g).height}`),Pe(Ie,"x",n(g).padding),Pe(Ie,"y",n(g).height-2),S(Ae,ze),Pe(ke,"x",n(g).width-n(g).padding),Pe(ke,"y",n(g).height-2),S(Te,`peak ${n(g).maxCount??""}/${Ne??""}`)},[()=>{var ze;return b(((ze=n(g).bars[0])==null?void 0:ze.bucket.t)??0)},()=>M(n(o))]),v(re,de)},R=re=>{var de=r1(),he=d(de);l(de),L(()=>{Pe(de,"viewBox",`0 0 ${n(c).width} ${n(c).height}`),Pe(he,"d",n(c).path)}),v(re,de)};B(E,re=>{n(a)==="rate"&&n(g)?re(j):n(c)&&re(R,1)})}l(G);var A=u(G,2),Z=d(A),J=d(Z),oe=d(J),me=u(d(oe));{var pe=re=>{var de=a1();v(re,de)};B(me,re=>{n(i).metricNameColumn&&re(pe)})}Ce(2),l(oe),l(J);var Ee=u(J);Qe(Ee,21,()=>n(p),bn,(re,de)=>{var he=i1(),Ie=d(he),Ae=d(Ie,!0);l(Ie);var ke=u(Ie);{var Te=Re=>{var Je=o1(),dt=d(Je,!0);l(Je),L(ft=>S(dt,ft),[()=>String(n(de).raw[n(i).metricNameColumn]??"")]),v(Re,Je)};B(ke,Re=>{n(i).metricNameColumn&&Re(Te)})}var ze=u(ke),Ne=d(ze,!0);l(ze);var Me=u(ze),Xe=d(Me,!0);l(Me),l(he),L((Re,Je)=>{S(Ae,Re),S(Ne,n(de).v),S(Xe,Je)},[()=>b(n(de).t),()=>w(n(de))]),v(re,he)}),l(Ee),l(Z),l(A);var Se=u(A,2),ve=d(Se),ce=u(ve);{var Oe=re=>{var de=_t();L((he,Ie)=>S(de,`· bucket ${he??""} (+${Ie??""})`),[()=>b(n(s).t),()=>M(n(o))]),v(re,de)};B(ce,re=>{n(s)&&re(Oe)})}l(Se),L((re,de,he,Ie,Ae)=>{Ve(te,1,re),Pe(te,"aria-pressed",n(a)==="rate"),S(K,` Writes/${de??""}`),Ve(C,1,he),Pe(C,"aria-pressed",n(a)==="line"),S(Y,Ie),S(ae,` · ${Ae??""}`),S(ve,`${n(p).length??""} inserts${e.collection?" · ":""}${e.collection??""??""} `)},[()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(a)==="rate"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>M(n(o)),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(a)==="line"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>V(),()=>n(p).length.toLocaleString()]),we("click",te,()=>m(a,"rate")),we("click",C,()=>m(a,"line")),ji(I,()=>n(r),re=>m(r,re)),v(Q,se)};B(k,Q=>{n(i)?Q(U,-1):Q(F)})}l(O),v(t,O),it()}tn(["click","change","keydown"]);const d1={capability:"hypertable",renders:t=>Bh(t),component:c1};function u1(t){return{query:t.query,capability:t.capability,record_count:t.record_count,records:t.result.records}}function f1(t){return JSON.stringify(t,null,2)}function v1(t){let e="",r=0;const a=t.length;for(;r<a;){const o=t[r];if(o==='"'){let s=r+1;for(;s<a;){if(t[s]==="\\"){s+=2;continue}if(t[s]==='"')break;s+=1}const i=t.slice(r,s+1);let c=s+1;for(;c<a&&(t[c]===" "||t[c]===" ");)c+=1;const f=t[c]===":";e+=`<span class="${f?"k":"s"}">${ki(i)}</span>`,r=s+1;continue}if(o>="0"&&o<="9"||o==="-"&&t[r+1]>="0"&&t[r+1]<="9"){let s=r+1;for(;s<a&&/[0-9eE+\-.]/.test(t[s]);)s+=1;e+=`<span class="n">${ki(t.slice(r,s))}</span>`,r=s;continue}if(t.startsWith("true",r)||t.startsWith("false",r)){const s=t[r]==="t"?4:5;e+=`<span class="b">${t.slice(r,r+s)}</span>`,r+=s;continue}if(t.startsWith("null",r)){e+='<span class="z">null</span>',r+=4;continue}e+=ki(o),r+=1}return e}function ki(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}var g1=x('<div class="flex h-full flex-col text-fg-1"><div class="flex-1 min-h-0 overflow-auto"><pre class="json text-[12px] font-mono p-3 leading-relaxed svelte-1h2o46f"></pre></div> <div class="border-t border-line-1 px-3 py-1.5 text-[11px] font-mono text-fg-3"> </div></div>');function p1(t,e){ot(e,!0);const r=y(()=>f1(u1(e.result))),a=y(()=>v1(n(r)));var o=g1(),s=d(o),i=d(s);hf(i,()=>n(a),!0),l(i),l(s);var c=u(s,2),f=d(c);l(c),l(o),L(()=>S(f,`${e.result.record_count??""} records · raw shape${e.collection?" · ":""}${e.collection??""??""}`)),v(t,o),it()}const h1={capability:"json",renders:()=>!1,component:p1},b1=/(^|_)(vector|embedding|embeddings|turbovec)($|_)/i,x1=/(^|_)(scalar|score|distance|similarity|magnitude|norm)($|_)/i,m1=new Set(["rid","entity_id","red_entity_id","red_entity_type","red_kind","red_collection","red_sequence_id","collection","kind","tenant","created_at","updated_at","dimension"]);function Ji(t){return Array.isArray(t)&&t.length>0&&t.every(e=>typeof e=="number"&&Number.isFinite(e))}function _1(t){const e=Object.entries(t).find(([a,o])=>b1.test(a)&&Ji(o));if(e)return e;const r=Object.entries(t).find(([,a])=>Ji(a));return r||null}function y1(t,e){const r=Object.entries(t).find(([a,o])=>a!==e&&x1.test(a)&&typeof o=="number"&&Number.isFinite(o));return r||null}function bl(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?Math.floor(t):null}function es(t){return t.result.records.map((e,r)=>{var g;const a=e.values??{},o=((g=e.vector_results)==null?void 0:g.find(p=>Ji(p.vector)))??null,s=o!=null&&o.vector?["vector_results.vector",o.vector]:_1(a),i=y1(a,(s==null?void 0:s[0])??null),c=(s==null?void 0:s[1].length)??bl(a.dimension)??bl(a.vector_dimension)??0,f={};for(const[p,b]of Object.entries(a))p===(s==null?void 0:s[0])||p===(i==null?void 0:i[0])||m1.has(p)||(f[p]=b);return{index:r,id:String(a.id??a.entity_id??a.red_entity_id??a.rid??r+1),vectorColumn:(s==null?void 0:s[0])??null,vector:(s==null?void 0:s[1])??[],dimension:c,scalarColumn:(i==null?void 0:i[0])??null,scalar:(i==null?void 0:i[1])??null,metadata:f}})}function w1(t){return t.capability==="vector"||t.result.records.some(e=>{var r;return(((r=e.vector_results)==null?void 0:r.length)??0)>0})?!0:es(t).some(e=>e.vector.length>0||e.dimension>0||e.scalar!==null)}function vo(t){return Math.sqrt(t.reduce((e,r)=>e+r*r,0))}function Si(t){return t.scalarColumn?/distance/i.test(t.scalarColumn)?`search distance · ${t.scalarColumn}`:/similarity/i.test(t.scalarColumn)?`similarity score · ${t.scalarColumn}`:/score/i.test(t.scalarColumn)?`score · ${t.scalarColumn}`:/turbovec|scalar/i.test(t.scalarColumn)?`scalar projection · ${t.scalarColumn}`:/magnitude|norm/i.test(t.scalarColumn)?`vector magnitude · ${t.scalarColumn}`:`ranking metric · ${t.scalarColumn}`:"ranking metric"}function Ci(t){return t==null?"NULL":typeof t=="object"?JSON.stringify(t):String(t)}function k1(t){return/^VECTOR\s+SEARCH\s+\S+\s+SIMILAR\s+TO\s+\[1(?:\.0)?,\s*0(?:\.0)?/i.test(t.query.trim())}function S1(t){return/^VECTOR\s+SEARCH\s+/i.test(t.query.trim())}function C1(t){const e=t.replace(/[\[\]]/g," ").split(/[,\s]+/).map(a=>a.trim()).filter(Boolean).map(Number);if(e.length===0)throw new Error("Paste a numeric vector first.");if(e.find(a=>!Number.isFinite(a))!==void 0)throw new Error("Vector contains a non-numeric value.");return e}function E1(t){return`[${t.map(e=>Number(e.toPrecision(8))).join(", ")}]`}function N1(t){return`'${t.replace(/'/g,"''")}'`}function M1(t){return t.replace(/[^A-Za-z0-9_./-]/g,"")}function xl(t,e,r){const a=Math.max(1,Math.min(200,Math.floor(Number(r)||20))),o=e.kind==="text"?N1(e.text):E1(e.vector);return`VECTOR SEARCH ${M1(t)} SIMILAR TO ${o} INCLUDE VECTORS LIMIT ${a}`}var z1=x('<input type="text" placeholder="text query…" class="h-7 w-full rounded border border-line-1 bg-bg-0 px-2 text-fg-1 outline-none placeholder:text-fg-3 focus:border-line-3"/>'),T1=x('<input type="text" placeholder="[0.12, -0.04, 0.91, …]" class="h-7 w-full rounded border border-line-1 bg-bg-0 px-2 text-fg-1 outline-none placeholder:text-fg-3 focus:border-line-3"/>'),P1=x('<div class="inline-flex shrink-0 overflow-hidden rounded border border-line-2"><button type="button">text</button> <button type="button">vector</button></div> <div class="min-w-[260px] flex-1"><!></div> <label class="inline-flex h-7 items-center gap-1 rounded border border-line-1 bg-bg-0 px-2 text-fg-3"><span>limit</span> <input type="number" min="1" max="200" class="w-12 bg-transparent text-right text-fg-1 outline-none"/></label> <button type="button"><!> search</button>',1),A1=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear vector row filter"><!></button>'),L1=x('<div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="filter rows…" class="bg-transparent text-fg-1 outline-none w-[180px] placeholder:text-fg-3"/> <!></div>'),I1=x("<span> </span>"),O1=x('<div class="mt-1.5 text-warn"> </div>'),R1=x('<div class="border-b border-line-1 bg-bg-1/30 px-3 py-1.5 text-[11px] font-mono text-fg-3">Preview search: distances and scores are computed against the synthetic basis vector <span class="text-fg-1">[1, 0, 0, …]</span>.</div>'),D1=x('<div class="flex-1 grid place-items-center p-6 text-center font-mono text-[12px] text-fg-3"><div><!> <div class="text-fg-1"> </div> <div class="mt-1">Text queries are embedded by RedDB.</div></div></div>'),$1=x('<div class="flex-1 grid place-items-center p-6 text-center font-mono text-[12px] text-fg-3"><div><!> <div class="text-fg-1">No vector rows returned.</div></div></div>'),V1=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear vector result filter"><!></button>'),H1=x('<div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="filter results…" class="bg-transparent text-fg-1 outline-none w-[180px] placeholder:text-fg-3"/> <!></div>'),F1=x('<span class="ml-auto text-fg-1"> </span>'),q1=x('<div class="mt-0.5 truncate text-fg-3"> </div>'),K1=x('<button type="button"><div class="flex items-baseline gap-2"><span class="text-accent"> </span> <span class="text-fg-3"> </span> <!></div> <!></button>'),j1=x('<div class="text-fg-3">No vector selected.</div>'),B1=x('<div class="text-fg-3">vector column</div> <div class="text-fg-0"> </div>',1),W1=x('<div class="text-fg-3">ranking metric</div> <div class="text-fg-0"> </div>',1),U1=x('<div class="text-fg-3 truncate"> </div> <div class="text-fg-1 break-words"> </div>',1),G1=x('<div class="grid grid-cols-[160px_1fr] gap-x-3 gap-y-1.5"><div class="text-fg-3">id</div> <div class="text-fg-0"> </div> <div class="text-fg-3">dimension</div> <div class="text-fg-0"> </div> <div class="text-fg-3">magnitude</div> <div class="text-fg-0"> </div> <div class="text-fg-3">coordinates</div> <div class="text-fg-0"> </div> <!> <!> <!></div>'),Y1=x('<div class="border border-line-1 bg-bg-1/40 px-3 py-2 text-fg-3"> </div>'),X1=x('<div class="grid grid-cols-[52px_1fr_90px] items-center gap-2"><span class="text-fg-3 text-right"></span> <div class="h-2 bg-bg-2 rounded overflow-hidden"><div class="h-full bg-accent/80"></div></div> <span> </span></div>'),Z1=x('<div class="mt-2 text-fg-3">Showing first 256 dimensions.</div>'),Q1=x('<div class="mb-2 flex items-center justify-between text-fg-3"><span> </span> <span> </span></div> <div class="grid gap-1"></div> <!>',1),J1=x('<tr class="border-b border-line-1/60 hover:bg-bg-1/40 cursor-pointer"><td class="px-2 py-1 text-accent"> </td><td class="px-2 py-1 text-right"> </td><td class="px-2 py-1 text-right"> </td></tr>'),eb=x('<table class="w-full border-collapse"><thead class="sticky top-0 bg-bg-0"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">id</th><th class="px-2 py-1.5 text-right font-normal">ranking metric</th><th class="px-2 py-1.5 text-right font-normal">magnitude</th></tr></thead><tbody></tbody></table>'),tb=x('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-0"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> metadata</button> <button type="button"><!> vector</button> <button type="button"><!> scores</button></div> <!> <div class="ml-auto text-fg-3"> <!> </div></div> <div class="flex-1 min-h-0 grid grid-cols-[320px_1fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"></div> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>',1),nb=x('<div class="flex h-full flex-col text-fg-1"><div class="border-b border-line-1 bg-bg-1/40 px-3 py-2 font-mono text-[11px]"><div class="flex flex-wrap items-center gap-2"><div class="inline-flex shrink-0 overflow-hidden rounded border border-line-2"><button type="button"><!> browse</button> <button type="button"><!> search</button></div> <!> <div class="ml-auto flex items-center gap-2 text-fg-3"><span> </span> <!></div></div> <!></div> <!> <!></div>');function rb(t,e){ot(e,!0);let r=_e("browse"),a=_e("metadata"),o=_e("text"),s=_e(""),i=_e(""),c=_e(20),f=_e(""),g=_e(null),p=_e(null),b=_e(!1),h=_e(null);const w=y(()=>es(e.result)),M=y(()=>{var Z;return((Z=n(w).find(J=>J.dimension>0))==null?void 0:Z.dimension)??null}),P=y(()=>n(p)??(S1(e.result)?e.result:null)),V=y(()=>n(P)?es(n(P)):[]),O=y(()=>n(r)==="search"?n(V):n(w)),k=y(()=>n(P)?k1(n(P)):!1),F=y(()=>{const Z=n(f).trim().toLowerCase();return Z?n(O).filter(J=>J.id.toLowerCase().includes(Z)||Object.values(J.metadata).some(oe=>Ci(oe).toLowerCase().includes(Z))):n(O)}),U=y(()=>n(g)??n(F)[0]??null),Q=y(()=>Math.max(1,...n(F).map(Z=>vo(Z.vector)))),se=y(()=>n(P)!==null);function xe(Z){const J=Object.entries(Z.metadata).slice(0,3);return J.length===0?"":J.map(([oe,me])=>`${oe}=${Ci(me)}`).join(" · ")}function le(Z,J){const oe=Math.max(1,...J.map(me=>Math.abs(me)));return Math.max(2,Math.abs(Z)/oe*100)}async function te(){if(!e.client||!e.collection){m(h,"No active RedDB connection for vector search.");return}m(h,null),m(b,!0);try{const Z=n(s).trim();if(n(o)==="text"&&Z.length===0)throw new Error("Enter text for RedDB to embed.");const J=n(o)==="text"?xl(e.collection,{kind:"text",text:Z},n(c)):xl(e.collection,{kind:"vector",vector:C1(n(i))},n(c)),oe=await e.client.query(J);m(p,oe,!0),m(g,null),m(r,"search"),m(a,"metadata")}catch(Z){m(h,Z.message,!0)}finally{m(b,!1)}}var be=nb(),K=d(be),C=d(K),N=d(C),_=d(N),z=d(_);Yi(z,{class:"size-3"}),Ce(),l(_);var I=u(_,2),D=d(I);Xn(D,{class:"size-3"}),Ce(),l(I),l(N);var T=u(N,2);{var $=Z=>{var J=P1(),oe=ue(J),me=d(oe),pe=u(me,2);l(oe);var Ee=u(oe,2),Se=d(Ee);{var ve=ke=>{var Te=z1();en(Te),we("keydown",Te,ze=>{ze.key==="Enter"&&te()}),Tn(Te,()=>n(s),ze=>m(s,ze)),v(ke,Te)},ce=ke=>{var Te=T1();en(Te),we("keydown",Te,ze=>{ze.key==="Enter"&&te()}),Tn(Te,()=>n(i),ze=>m(i,ze)),v(ke,Te)};B(Se,ke=>{n(o)==="text"?ke(ve):ke(ce,-1)})}l(Ee);var Oe=u(Ee,2),re=u(d(Oe),2);en(re),l(Oe);var de=u(Oe,2),he=d(de);{var Ie=ke=>{lr(ke,{class:"size-3 animate-spin"})},Ae=ke=>{ti(ke,{class:"size-3"})};B(he,ke=>{n(b)?ke(Ie):ke(Ae,-1)})}Ce(),l(de),L((ke,Te,ze)=>{Ve(me,1,ke),Pe(me,"aria-pressed",n(o)==="text"),Ve(pe,1,Te),Pe(pe,"aria-pressed",n(o)==="vector"),Ve(de,1,ze),de.disabled=n(b)},[()=>Ke(["inline-flex h-7 items-center gap-1 px-2 transition-colors",n(o)==="text"?"bg-bg-3 text-fg-0":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2 transition-colors",n(o)==="vector"?"bg-bg-3 text-fg-0":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex h-7 items-center gap-1 rounded border px-2 transition-colors",n(b)?"border-line-1 bg-bg-2 text-fg-3":"border-accent/40 bg-accent text-white hover:bg-accent/90"].join(" "))]),we("click",me,()=>m(o,"text")),we("click",pe,()=>m(o,"vector")),Tn(re,()=>n(c),ke=>m(c,ke)),we("click",de,()=>void te()),v(Z,J)},X=Z=>{var J=L1(),oe=d(J);Xn(oe,{class:"size-3 text-fg-3"});var me=u(oe,2);en(me);var pe=u(me,2);{var Ee=Se=>{var ve=A1(),ce=d(ve);Rn(ce,{class:"size-3"}),l(ve),we("click",ve,()=>m(f,"")),v(Se,ve)};B(pe,Se=>{n(f)&&Se(Ee)})}l(J),Tn(me,()=>n(f),Se=>m(f,Se)),v(Z,J)};B(T,Z=>{n(r)==="search"?Z($):Z(X,-1)})}var H=u(T,2),W=d(H),Y=d(W,!0);l(W);var ae=u(W,2);{var ge=Z=>{var J=I1(),oe=d(J,!0);l(J),L(()=>S(oe,e.collection)),v(Z,J)};B(ae,Z=>{e.collection&&Z(ge)})}l(H),l(C);var ie=u(C,2);{var ee=Z=>{var J=O1(),oe=d(J,!0);l(J),L(()=>S(oe,n(h))),v(Z,J)};B(ie,Z=>{n(h)&&Z(ee)})}l(K);var q=u(K,2);{var G=Z=>{var J=R1();v(Z,J)};B(q,Z=>{n(r)==="search"&&n(k)&&Z(G)})}var E=u(q,2);{var j=Z=>{var J=D1(),oe=d(J),me=d(oe);Xn(me,{class:"mx-auto mb-3 size-7 text-fg-3",strokeWidth:1.4});var pe=u(me,2),Ee=d(pe,!0);l(pe),Ce(2),l(oe),l(J),L(()=>S(Ee,n(se)?"No search results.":"No vector search has been run.")),v(Z,J)},R=Z=>{var J=$1(),oe=d(J),me=d(oe);Yi(me,{class:"mx-auto mb-3 size-7 text-fg-3",strokeWidth:1.4}),Ce(2),l(oe),l(J),v(Z,J)},A=Z=>{var J=tb(),oe=ue(J),me=d(oe),pe=d(me),Ee=d(pe);va(Ee,{class:"size-3"}),Ce(),l(pe);var Se=u(pe,2),ve=d(Se);Sv(ve,{class:"size-3"}),Ce(),l(Se);var ce=u(Se,2),Oe=d(ce);Lc(Oe,{class:"size-3"}),Ce(),l(ce),l(me);var re=u(me,2);{var de=qe=>{var $e=H1(),je=d($e);Xn(je,{class:"size-3 text-fg-3"});var at=u(je,2);en(at);var ne=u(at,2);{var nt=Ze=>{var Be=V1(),ut=d(Be);Rn(ut,{class:"size-3"}),l(Be),we("click",Be,()=>m(f,"")),v(Ze,Be)};B(ne,Ze=>{n(f)&&Ze(nt)})}l($e),Tn(at,()=>n(f),Ze=>m(f,Ze)),v(qe,$e)};B(re,qe=>{n(r)==="search"&&qe(de)})}var he=u(re,2),Ie=d(he,!0),Ae=u(Ie);{var ke=qe=>{var $e=_t();L(je=>S($e,`of ${je??""}`),[()=>n(O).length.toLocaleString()]),v(qe,$e)};B(Ae,qe=>{n(f)&&qe(ke)})}var Te=u(Ae);l(he),l(oe);var ze=u(oe,2),Ne=d(ze);Qe(Ne,21,()=>n(F),qe=>qe.id,(qe,$e)=>{var je=K1(),at=d(je),ne=d(at),nt=d(ne,!0);l(ne);var Ze=u(ne,2),Be=d(Ze);l(Ze);var ut=u(Ze,2);{var Nt=mt=>{var yt=F1(),kt=d(yt,!0);l(yt),L((It,Xt)=>{Pe(yt,"title",It),S(kt,Xt)},[()=>Si(n($e)),()=>n($e).scalar.toFixed(4)]),v(mt,yt)};B(ut,mt=>{n(r)==="search"&&n($e).scalar!==null&&mt(Nt)})}l(at);var Pt=u(at,2);{var Mt=mt=>{var yt=q1(),kt=d(yt,!0);l(yt),L(It=>S(kt,It),[()=>xe(n($e))]),v(mt,yt)},Et=y(()=>xe(n($e)));B(Pt,mt=>{n(Et)&&mt(Mt)})}l(je),L(mt=>{Ve(je,1,mt),S(nt,n($e).id),S(Be,`${n($e).dimension??""}d`)},[()=>Ke(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",n(U)===n($e)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),we("click",je,()=>m(g,n($e),!0)),v(qe,je)}),l(Ne);var Me=u(Ne,2),Xe=d(Me);{var Re=qe=>{var $e=j1();v(qe,$e)},Je=qe=>{var $e=G1(),je=u(d($e),2),at=d(je,!0);l(je);var ne=u(je,4),nt=d(ne,!0);l(ne);var Ze=u(ne,4),Be=d(Ze,!0);l(Ze);var ut=u(Ze,4),Nt=d(ut,!0);l(ut);var Pt=u(ut,2);{var Mt=kt=>{var It=B1(),Xt=u(ue(It),2),hn=d(Xt,!0);l(Xt),L(()=>S(hn,n(U).vectorColumn)),v(kt,It)};B(Pt,kt=>{n(U).vectorColumn&&kt(Mt)})}var Et=u(Pt,2);{var mt=kt=>{var It=W1(),Xt=u(ue(It),2),hn=d(Xt,!0);l(Xt),L(xn=>S(hn,xn),[()=>Si(n(U))]),v(kt,It)};B(Et,kt=>{n(r)==="search"&&n(U).scalarColumn&&kt(mt)})}var yt=u(Et,2);Qe(yt,17,()=>Object.entries(n(U).metadata),bn,(kt,It)=>{var Xt=y(()=>er(n(It),2));let hn=()=>n(Xt)[0],xn=()=>n(Xt)[1];var rt=U1(),ct=ue(rt),Lt=d(ct,!0);l(ct);var Ft=u(ct,2),on=d(Ft,!0);l(Ft),L(sn=>{S(Lt,hn()),S(on,sn)},[()=>Ci(xn())]),v(kt,rt)}),l($e),L(kt=>{S(at,n(U).id),S(nt,n(U).dimension),S(Be,kt),S(Nt,n(U).vector.length>0?"returned":"not returned")},[()=>n(U).vector.length>0?vo(n(U).vector).toFixed(6):"n/a"]),v(qe,$e)},dt=qe=>{var $e=De(),je=ue($e);{var at=nt=>{var Ze=Y1(),Be=d(Ze);l(Ze),L(()=>S(Be,`This result reports a ${n(U).dimension??""}d vector, but the coordinate array was not returned by RedDB.`)),v(nt,Ze)},ne=nt=>{var Ze=Q1(),Be=ue(Ze),ut=d(Be),Nt=d(ut);l(ut);var Pt=u(ut,2),Mt=d(Pt);l(Pt),l(Be);var Et=u(Be,2);Qe(Et,21,()=>n(U).vector.slice(0,256),bn,(kt,It,Xt)=>{var hn=X1(),xn=d(hn);xn.textContent=Xt;var rt=u(xn,2),ct=d(rt);let Lt;l(rt);var Ft=u(rt,2),on=d(Ft,!0);l(Ft),l(hn),L((sn,ln)=>{Lt=kn(ct,"",Lt,sn),Ve(Ft,1,Ke(n(It)<0?"text-warn text-right":"text-fg-1 text-right")),S(on,ln)},[()=>({width:`${le(n(It),n(U).vector)}%`}),()=>n(It).toFixed(5)]),v(kt,hn)}),l(Et);var mt=u(Et,2);{var yt=kt=>{var It=Z1();v(kt,It)};B(mt,kt=>{n(U).vector.length>256&&kt(yt)})}L((kt,It)=>{S(Nt,`${n(U).vector.length??""} dimensions`),S(Mt,`|v| ${kt??""} / max visible ${It??""}`)},[()=>vo(n(U).vector).toFixed(6),()=>n(Q).toFixed(2)]),v(nt,Ze)};B(je,nt=>{n(U).vector.length===0?nt(at):nt(ne,-1)})}v(qe,$e)},ft=qe=>{var $e=eb(),je=u(d($e));Qe(je,21,()=>n(F),at=>at.id,(at,ne)=>{var nt=J1(),Ze=d(nt),Be=d(Ze,!0);l(Ze);var ut=u(Ze),Nt=d(ut,!0);l(ut);var Pt=u(ut),Mt=d(Pt,!0);l(Pt),l(nt),L((Et,mt,yt)=>{S(Be,n(ne).id),Pe(ut,"title",Et),S(Nt,mt),S(Mt,yt)},[()=>Si(n(ne)),()=>n(ne).scalar===null?"n/a":n(ne).scalar.toFixed(6),()=>vo(n(ne).vector).toFixed(6)]),we("click",nt,()=>m(g,n(ne),!0)),v(at,nt)}),l(je),l($e),v(qe,$e)};B(Xe,qe=>{n(U)?n(a)==="metadata"?qe(Je,1):n(a)==="vector"?qe(dt,2):qe(ft,-1):qe(Re)})}l(Me),l(ze),L((qe,$e,je,at)=>{Ve(pe,1,qe),Pe(pe,"aria-pressed",n(a)==="metadata"),Ve(Se,1,$e),Pe(Se,"aria-pressed",n(a)==="vector"),Ve(ce,1,je),Pe(ce,"aria-pressed",n(a)==="scalar"),S(Ie,at),S(Te,` ${n(r)==="search"?" results":" rows"}`)},[()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(a)==="metadata"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(a)==="vector"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(a)==="scalar"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>n(F).length.toLocaleString()]),we("click",pe,()=>m(a,"metadata")),we("click",Se,()=>m(a,"vector")),we("click",ce,()=>m(a,"scalar")),v(Z,J)};B(E,Z=>{n(r)==="search"&&n(V).length===0?Z(j):n(O).length===0?Z(R,1):Z(A,-1)})}l(be),L((Z,J)=>{Ve(_,1,Z),Pe(_,"aria-pressed",n(r)==="browse"),Ve(I,1,J),Pe(I,"aria-pressed",n(r)==="search"),S(Y,n(M)?`${n(M)}d`:"dimension n/a")},[()=>Ke(["inline-flex h-7 items-center gap-1 px-2 transition-colors",n(r)==="browse"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2 transition-colors",n(r)==="search"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),we("click",_,()=>{m(r,"browse"),m(g,null)}),we("click",I,()=>{m(r,"search"),m(g,null)}),v(t,be),it()}tn(["click","keydown"]);const ab={capability:"vector",renders:t=>w1(t),component:rb},ts=["message","payload","body","value","data"],Yc=["state","status","delivery_state"],Xc=["consumer","consumer_id","worker","lease_owner"],Zc=["dlc","dlq","dead_letter_collection","dead_letter_queue"];function go(t,e){for(const a of e)if(a in t)return[a,t[a]];return Object.entries(t).find(([a])=>e.includes(a.toLowerCase()))??null}function ob(t){return t.result.records.map((e,r)=>{const a=e.values??{},o=go(a,ts),s=go(a,Yc),i=go(a,Xc),c=go(a,Zc);return{index:r,id:String(a.message_id??a.id??a.rid??r+1),messageColumn:(o==null?void 0:o[0])??null,message:(o==null?void 0:o[1])??a,state:String((s==null?void 0:s[1])??"ready"),consumer:(i==null?void 0:i[1])===void 0||(i==null?void 0:i[1])===null?null:String(i[1]),dlc:(c==null?void 0:c[1])===void 0||(c==null?void 0:c[1])===null?null:String(c[1]),values:a}})}function ib(t){return t.capability==="queue"?!0:t.result.records.some(e=>{const r=Object.keys(e.values??{}).map(a=>a.toLowerCase());return r.includes("message_id")&&ts.some(a=>r.includes(a))?!0:ts.some(a=>r.includes(a))&&(Yc.some(a=>r.includes(a))||Xc.some(a=>r.includes(a))||Zc.some(a=>r.includes(a)))})}function sb(t){const e=new Set,r=new Map,a=new Set,o=new Map,s=new Set;for(const i of t)if(r.set(i.state,(r.get(i.state)??0)+1),i.consumer&&/active|leased|processing|running/i.test(i.state)&&e.add(i.consumer),i.dlc&&a.add(i.dlc),i.message&&typeof i.message=="object"&&!Array.isArray(i.message)){const c=i.message,f=c.op,g=c.collection;typeof f=="string"&&o.set(f,(o.get(f)??0)+1),typeof g=="string"&&s.add(g)}return{activeConsumers:e.size,states:[...r.entries()],dlcs:[...a],operations:[...o.entries()].sort((i,c)=>i[0].localeCompare(c[0])),sources:[...s].sort()}}function ml(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const e=Number(t);if(Number.isFinite(e))return e}return null}function lb(t){const e=[];for(const r of t){if(!r.message||typeof r.message!="object"||Array.isArray(r.message))continue;const a=r.message,o=a.collection,s=a.op;if(typeof o!="string"||typeof s!="string")continue;const i=a.id??(a.after&&typeof a.after=="object"&&!Array.isArray(a.after)?a.after.id:void 0);e.push({messageId:r.id,collection:o,op:s,entityId:i==null?String(a.rid??r.id):String(i),lsn:ml(a.lsn),ts:ml(a.ts),before:a.before,after:a.after,payload:a})}return e}function cb(t){const e=t.replace(/[^A-Za-z0-9_./-]/g,""),r="red-ui-preview",a="showcase";return[{label:"Backlog depth",query:`QUEUE LEN ${e}`,mutates:!1,note:"Read-only count of messages currently stored in the queue."},{label:"Peek messages",query:`QUEUE PEEK ${e} 25`,mutates:!1,note:"Read-only inspection. Does not lease, ack, or remove messages."},{label:"Read as fanout consumer",query:`QUEUE READ ${e} CONSUMER ${r} COUNT 5`,mutates:!0,note:"Leases messages for this consumer. ACK/NACK decides what happens next."},{label:"Read through explicit group",query:`QUEUE READ ${e} GROUP ${a} CONSUMER worker-a COUNT 5`,mutates:!0,note:"Creates/uses consumer group delivery state for an application tier."},{label:"Inspect pending group messages",query:`QUEUE PENDING ${e} GROUP ${a}`,mutates:!1,note:"Shows leased-but-unacked messages for a group."},{label:"Ack a delivered message",query:`QUEUE ACK ${e} GROUP ${a} 'message-id'`,mutates:!0,note:"Removes a successfully processed message for that group."},{label:"Nack a delivered message",query:`QUEUE NACK ${e} GROUP ${a} 'message-id'`,mutates:!0,note:"Returns or retries a failed message according to queue policy."}]}function db(t,e){const r=t.replace(/[^A-Za-z0-9_./-]/g,""),a=typeof e=="string"?`'${e.replace(/'/g,"''")}'`:JSON.stringify(e??null);return`QUEUE PUSH ${r} ${a}`}var ub=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear queue filter"><!></button>'),fb=x("<span> </span>"),vb=x('<span>from <span class="text-fg-2"> </span></span>'),gb=x('<span>dlc <span class="text-fg-2"> </span></span>'),pb=x('<span class="text-fg-2"> </span>'),hb=x('<div class="mt-1.5 text-warn"> </div>'),bb=x('<div class="mt-1.5 text-ok"> </div>'),xb=x('<div class="border-b border-line-1 bg-bg-1/20 px-3 py-2 text-[11px] font-mono"><div class="flex gap-2"><textarea rows="3" class="flex-1 resize-none rounded border border-line-1 bg-bg-0 px-2 py-1 text-[12px] text-fg-1 outline-none placeholder:text-fg-3 focus:border-accent"></textarea> <button type="button" class="inline-flex h-7 items-center gap-1.5 rounded bg-accent px-3 text-white disabled:opacity-40 disabled:cursor-not-allowed"><!> insert</button></div> <!></div>'),mb=x('<div class="p-3 text-[12px] font-mono text-fg-3">No WITH EVENTS envelopes detected in this queue result.</div>'),_b=x('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-fg-2"> </td><td class="px-2 py-1 text-fg-0"> </td><td class="px-2 py-1"><span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 text-accent"> </span></td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1 text-right text-fg-3"> </td><td class="px-2 py-1 text-fg-2 truncate max-w-[520px]"> </td></tr>'),yb=x('<table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">time</th><th class="px-2 py-1.5 text-left font-normal">source</th><th class="px-2 py-1.5 text-left font-normal">op</th><th class="px-2 py-1.5 text-left font-normal">entity</th><th class="px-2 py-1.5 text-right font-normal">lsn</th><th class="px-2 py-1.5 text-left font-normal">after</th></tr></thead><tbody></tbody></table>'),wb=x('<div class="flex-1 min-h-0 overflow-auto"><!></div>'),kb=x('<div class="rounded border border-line-1 bg-bg-1 px-3 py-2"><div class="mb-1 flex items-center gap-2"><span class="text-fg-0"> </span> <span> </span></div> <pre class="m-0 overflow-x-auto rounded bg-bg-0 px-2 py-1 text-fg-1"> </pre> <div class="mt-1 text-fg-3"> </div></div>'),Sb=x('<div class="flex-1 min-h-0 overflow-auto p-3 text-[12px] font-mono"><div class="grid gap-2"></div></div>'),Cb=x('<div class="p-3 text-fg-3">No queue messages in this result.</div>'),Eb=x('<span class="ml-auto text-fg-3"> </span>'),Nb=x('<button type="button"><div class="flex items-center gap-2"><span class="text-accent"> </span> <span class="rounded border border-line-1 px-1 py-0.5 text-[10px] text-fg-3"> </span> <!></div> <div class="mt-1 truncate text-fg-1"> </div></button>'),Mb=x('<pre class="whitespace-pre-wrap text-fg-1"> </pre>'),zb=x('<div class="grid grid-cols-[120px_1fr] gap-x-3 gap-y-1.5"><span class="text-fg-3">id</span><span class="text-fg-0"> </span> <span class="text-fg-3">state</span><span class="text-fg-0"> </span> <span class="text-fg-3">consumer</span><span class="text-fg-0"> </span> <span class="text-fg-3">dlc</span><span class="text-fg-0"> </span> <span class="text-fg-3">message</span><pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre></div>'),Tb=x('<div class="text-fg-3">Select a message to inspect payload, delivery state, consumer, and DLC link.</div>'),Pb=x('<div class="flex-1 min-h-0 grid grid-cols-[minmax(360px,0.9fr)_1.1fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"><!></div> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>'),Ab=x('<span><span class="text-fg-2"> </span> </span>'),Lb=x('<span><span class="text-fg-2"> </span> </span>'),Ib=x('<div class="flex h-full flex-col text-fg-1"><div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> events</button> <button type="button"><!> messages</button> <button type="button"><!> commands</button> <button type="button"><!> json</button></div> <button type="button"><!> insert</button> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="message/state…" class="bg-transparent text-fg-1 outline-none w-[180px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto flex items-center gap-3 text-fg-3"><span> </span> <!> <span> </span> <!> <!> <!></div></div> <!> <!> <div class="border-t border-line-1 px-3 py-1.5 text-[10px] font-mono text-fg-3 flex items-center gap-3"><!> <!></div></div>');function Ob(t,e){ot(e,!0);let r=_e("events"),a=_e(""),o=_e(null),s=_e(!1),i=_e(""),c=_e(!1),f=_e(null),g=_e(0);const p='{"type":"email","to":"ops@example.com"}',b=y(()=>ob(e.result)),h=y(()=>sb(n(b))),w=y(()=>lb(n(b))),M=y(()=>e.collection?cb(e.collection):[]),P=y(()=>{const re=n(a).trim().toLowerCase();return re?n(b).filter(de=>de.id.toLowerCase().includes(re)||de.state.toLowerCase().includes(re)||JSON.stringify(de.message).toLowerCase().includes(re)):n(b)});function V(re){return typeof re=="string"?re:JSON.stringify(re)}function O(re){if(re===null)return"-";try{return new Date(re).toISOString().replace("T"," ").slice(0,19)}catch{return String(re)}}function k(){const re=n(i).trim();if(!re)return"";try{return JSON.parse(re)}catch{return re}}async function F(){const re=Ue.client;if(!(!re||!e.collection||!n(i).trim())){m(c,!0),m(f,null);try{await Ct.track(`${e.collection} · enqueue message`,()=>re.query(db(e.collection,k()))),m(i,""),m(g,n(g)+1)}catch(de){m(f,de.message,!0)}finally{m(c,!1)}}}var U=Ib(),Q=d(U),se=d(Q),xe=d(se),le=d(xe);Tv(le,{class:"size-3"}),Ce(),l(xe);var te=u(xe,2),be=d(te);il(be,{class:"size-3"}),Ce(),l(te);var K=u(te,2),C=d(K);gv(C,{class:"size-3"}),Ce(),l(K);var N=u(K,2),_=d(N);va(_,{class:"size-3"}),Ce(),l(N),l(se);var z=u(se,2),I=d(z);Aa(I,{class:"size-3"}),Ce(),l(z);var D=u(z,2),T=d(D);Xn(T,{class:"size-3 text-fg-3"});var $=u(T,2);en($);var X=u($,2);{var H=re=>{var de=ub(),he=d(de);Rn(he,{class:"size-3"}),l(de),we("click",de,()=>m(a,"")),v(re,de)};B(X,re=>{n(a)&&re(H)})}l(D);var W=u(D,2),Y=d(W),ae=d(Y);l(Y);var ge=u(Y,2);{var ie=re=>{var de=fb(),he=d(de);l(de),L(Ie=>S(he,`${Ie??""} events`),[()=>n(w).length.toLocaleString()]),v(re,de)};B(ge,re=>{n(w).length&&re(ie)})}var ee=u(ge,2),q=d(ee);l(ee);var G=u(ee,2);{var E=re=>{var de=vb(),he=u(d(de)),Ie=d(he,!0);l(he),l(de),L(Ae=>S(Ie,Ae),[()=>n(h).sources.join(", ")]),v(re,de)};B(G,re=>{n(h).sources.length&&re(E)})}var j=u(G,2);{var R=re=>{var de=gb(),he=u(d(de)),Ie=d(he,!0);l(he),l(de),L(Ae=>S(Ie,Ae),[()=>n(h).dlcs.join(", ")]),v(re,de)};B(j,re=>{n(h).dlcs.length&&re(R)})}var A=u(j,2);{var Z=re=>{var de=pb(),he=d(de,!0);l(de),L(()=>S(he,e.collection)),v(re,de)};B(A,re=>{e.collection&&re(Z)})}l(W),l(Q);var J=u(Q,2);{var oe=re=>{var de=xb(),he=d(de),Ie=d(he);Va(Ie),Pe(Ie,"placeholder",p);var Ae=u(Ie,2),ke=d(Ae);{var Te=Re=>{lr(Re,{class:"size-3 animate-spin"})},ze=Re=>{il(Re,{class:"size-3"})};B(ke,Re=>{n(c)?Re(Te):Re(ze,-1)})}Ce(),l(Ae),l(he);var Ne=u(he,2);{var Me=Re=>{var Je=hb(),dt=d(Je,!0);l(Je),L(()=>S(dt,n(f))),v(Re,Je)},Xe=Re=>{var Je=bb(),dt=d(Je);l(Je),L(()=>S(dt,`${n(g)??""} inserted. Refresh the collection to reload from reddb.`)),v(Re,Je)};B(Ne,Re=>{n(f)?Re(Me):n(g)>0&&Re(Xe,1)})}l(de),L(Re=>Ae.disabled=Re,[()=>n(c)||!n(i).trim()||!e.collection]),Tn(Ie,()=>n(i),Re=>m(i,Re)),we("click",Ae,F),v(re,de)};B(J,re=>{n(s)&&re(oe)})}var me=u(J,2);{var pe=re=>{var de=wb(),he=d(de);{var Ie=ke=>{var Te=mb();v(ke,Te)},Ae=ke=>{var Te=yb(),ze=u(d(Te));Qe(ze,21,()=>n(w),Ne=>`${Ne.messageId}-${Ne.lsn??Ne.entityId}`,(Ne,Me)=>{var Xe=_b(),Re=d(Xe),Je=d(Re,!0);l(Re);var dt=u(Re),ft=d(dt,!0);l(dt);var qe=u(dt),$e=d(qe),je=d($e,!0);l($e),l(qe);var at=u(qe),ne=d(at,!0);l(at);var nt=u(at),Ze=d(nt,!0);l(nt);var Be=u(nt),ut=d(Be,!0);l(Be),l(Xe),L((Nt,Pt)=>{S(Je,Nt),S(ft,n(Me).collection),S(je,n(Me).op),S(ne,n(Me).entityId),S(Ze,n(Me).lsn??"-"),S(ut,Pt)},[()=>O(n(Me).ts),()=>V(n(Me).after)]),v(Ne,Xe)}),l(ze),l(Te),v(ke,Te)};B(he,ke=>{n(w).length===0?ke(Ie):ke(Ae,-1)})}l(de),v(re,de)},Ee=re=>{var de=Sb(),he=d(de);Qe(he,21,()=>n(M),Ie=>Ie.query,(Ie,Ae)=>{var ke=kb(),Te=d(ke),ze=d(Te),Ne=d(ze,!0);l(ze);var Me=u(ze,2),Xe=d(Me,!0);l(Me),l(Te);var Re=u(Te,2),Je=d(Re,!0);l(Re);var dt=u(Re,2),ft=d(dt,!0);l(dt),l(ke),L(qe=>{S(Ne,n(Ae).label),Ve(Me,1,qe),S(Xe,n(Ae).mutates?"mutates":"read-only"),S(Je,n(Ae).query),S(ft,n(Ae).note)},[()=>Ke(["rounded border px-1.5 py-0.5 text-[10px]",n(Ae).mutates?"border-warn/30 bg-warn/10 text-warn":"border-ok/30 bg-ok/10 text-ok"].join(" "))]),v(Ie,ke)}),l(he),l(de),v(re,de)},Se=re=>{var de=Pb(),he=d(de),Ie=d(he);{var Ae=Re=>{var Je=Cb();v(Re,Je)},ke=Re=>{var Je=De(),dt=ue(Je);Qe(dt,17,()=>n(P),ft=>ft.id,(ft,qe)=>{var $e=Nb(),je=d($e),at=d(je),ne=d(at,!0);l(at);var nt=u(at,2),Ze=d(nt,!0);l(nt);var Be=u(nt,2);{var ut=Mt=>{var Et=Eb(),mt=d(Et,!0);l(Et),L(()=>S(mt,n(qe).consumer)),v(Mt,Et)};B(Be,Mt=>{n(qe).consumer&&Mt(ut)})}l(je);var Nt=u(je,2),Pt=d(Nt,!0);l(Nt),l($e),L((Mt,Et)=>{Ve($e,1,Mt),S(ne,n(qe).id),S(Ze,n(qe).state),S(Pt,Et)},[()=>Ke(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",n(o)===n(qe)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" ")),()=>V(n(qe).message)]),we("click",$e,()=>m(o,n(qe),!0)),v(ft,$e)}),v(Re,Je)};B(Ie,Re=>{n(P).length===0?Re(Ae):Re(ke,-1)})}l(he);var Te=u(he,2),ze=d(Te);{var Ne=Re=>{var Je=Mb(),dt=d(Je,!0);l(Je),L(ft=>S(dt,ft),[()=>JSON.stringify(n(P).map(ft=>ft.values),null,2)]),v(Re,Je)},Me=Re=>{var Je=zb(),dt=u(d(Je)),ft=d(dt,!0);l(dt);var qe=u(dt,3),$e=d(qe,!0);l(qe);var je=u(qe,3),at=d(je,!0);l(je);var ne=u(je,3),nt=d(ne,!0);l(ne);var Ze=u(ne,3),Be=d(Ze,!0);l(Ze),l(Je),L(ut=>{S(ft,n(o).id),S($e,n(o).state),S(at,n(o).consumer??"none"),S(nt,n(o).dlc??"none"),S(Be,ut)},[()=>V(n(o).message)]),v(Re,Je)},Xe=Re=>{var Je=Tb();v(Re,Je)};B(ze,Re=>{n(r)==="json"?Re(Ne):n(o)?Re(Me,1):Re(Xe,-1)})}l(Te),l(de),v(re,de)};B(me,re=>{n(r)==="events"?re(pe):n(r)==="commands"?re(Ee,1):re(Se,-1)})}var ve=u(me,2),ce=d(ve);Qe(ce,17,()=>n(h).states,([re,de])=>re,(re,de)=>{var he=y(()=>er(n(de),2));let Ie=()=>n(he)[0],Ae=()=>n(he)[1];var ke=Ab(),Te=d(ke),ze=d(Te,!0);l(Te);var Ne=u(Te);l(ke),L(Me=>{S(ze,Ie()),S(Ne,` ${Me??""}`)},[()=>Ae().toLocaleString()]),v(re,ke)});var Oe=u(ce,2);Qe(Oe,17,()=>n(h).operations,([re,de])=>re,(re,de)=>{var he=y(()=>er(n(de),2));let Ie=()=>n(he)[0],Ae=()=>n(he)[1];var ke=Lb(),Te=d(ke),ze=d(Te,!0);l(Te);var Ne=u(Te);l(ke),L(Me=>{S(ze,Ie()),S(Ne,` ${Me??""}`)},[()=>Ae().toLocaleString()]),v(re,ke)}),l(ve),l(U),L((re,de,he,Ie,Ae,ke)=>{Ve(xe,1,re),Pe(xe,"aria-pressed",n(r)==="events"),Ve(te,1,de),Pe(te,"aria-pressed",n(r)==="messages"),Ve(K,1,he),Pe(K,"aria-pressed",n(r)==="commands"),Ve(N,1,Ie),Pe(N,"aria-pressed",n(r)==="json"),z.disabled=!e.collection,Ve(z,1,Ae),Pe(z,"aria-pressed",n(s)),Pe(z,"title",e.collection?"Insert a queue message":"Open this as a collection to insert messages"),S(ae,`${ke??""} messages`),S(q,`${n(h).activeConsumers??""} active consumers`)},[()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(r)==="events"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="messages"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="commands"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="json"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 h-6 px-2 rounded border cursor-pointer transition-colors disabled:opacity-40 disabled:cursor-not-allowed",n(s)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>n(P).length.toLocaleString()]),we("click",xe,()=>m(r,"events")),we("click",te,()=>m(r,"messages")),we("click",K,()=>m(r,"commands")),we("click",N,()=>m(r,"json")),we("click",z,()=>m(s,!n(s))),Tn($,()=>n(a),re=>m(a,re)),v(t,U),it()}tn(["click"]);const Rb={capability:"queue",renders:t=>ib(t),component:Ob},Db=["metric","stat","name","key"],$b=["value","count","total","avg","rate","p50","p95","p99"],_l=["unit","units"];function yl(t){return/bytes?|memory|storage|wal/i.test(t)?"bytes":/rps|rate|requests?_per_second|writes?_per_second|reads?_per_second/i.test(t)?"/s":/ms|latency|response/i.test(t)?"ms":/percent|ratio|usage/i.test(t)?"%":""}function Vb(t){for(const r of _l){const a=t[r];if(typeof a=="string"&&a.trim())return a.trim()}const e=Object.entries(t).find(([r,a])=>_l.includes(r.toLowerCase())&&typeof a=="string"&&a.trim());return e?String(e[1]).trim():null}function Qc(t){const e=[];for(const r of t.result.records){const a=r.values??{},o=Object.entries(a).find(([i,c])=>Db.includes(i.toLowerCase())&&(typeof c=="string"||typeof c=="number")),s=Object.entries(a).find(([i,c])=>$b.includes(i.toLowerCase())&&typeof c=="number"&&Number.isFinite(c));if(o&&s){const i=String(o[1]);e.push({key:i,label:i,value:s[1],unit:Vb(a)??yl(i),source:a});continue}for(const[i,c]of Object.entries(a))typeof c!="number"||!Number.isFinite(c)||e.push({key:i,label:i,value:c,unit:yl(i),source:a})}return e}function Hb(t){if(t.capability==="stats")return!0;const e=Qc(t);return e.length>0&&e.length>=t.result.records.length}function wl(t,e){if(e==="bytes"){const r=Math.abs(t);return r>=1024**3?`${(t/1024**3).toFixed(1)} GiB`:r>=1024**2?`${(t/1024**2).toFixed(1)} MiB`:r>=1024?`${(t/1024).toFixed(1)} KiB`:`${t} B`}return e==="%"||e==="ms"||e==="/s"?`${t.toLocaleString()}${e}`:t.toLocaleString()}var Fb=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No numeric statistics in this result.</div>'),qb=x('· <span class="text-fg-2"> </span>',1),Kb=x('<div class="rounded border border-line-1 bg-bg-1 px-3 py-2"><div class="type-label truncate"> </div> <div class="mt-1 font-mono text-[20px] font-semibold text-fg-0"> </div></div>'),jb=x('<div class="flex-1 overflow-auto p-3"><div class="grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-2"></div></div>'),Bb=x('<div class="rounded border border-line-1 bg-bg-1 px-3 py-3 text-center"><svg viewBox="0 0 120 70" class="mx-auto h-[82px] w-[150px]"><path d="M 15 60 A 45 45 0 0 1 105 60" fill="none" stroke="var(--color-line-2)" stroke-width="10" stroke-linecap="round"></path><path d="M 15 60 A 45 45 0 0 1 105 60" fill="none" stroke="var(--color-accent)" stroke-width="10" stroke-linecap="round" pathLength="100"></path><text x="60" y="58" text-anchor="middle" class="fill-fg-0 font-mono text-[13px] font-semibold"> </text></svg> <div class="mt-1 truncate font-mono text-[11px] text-fg-2"> </div></div>'),Wb=x('<div class="flex-1 overflow-auto p-3"><div class="grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2"></div></div>'),Ub=x('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-fg-0"> </td><td class="px-2 py-1 text-right text-accent"> </td><td class="px-2 py-1 text-fg-3"> </td></tr>'),Gb=x('<div class="flex-1 overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1 z-10"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">metric</th><th class="px-2 py-1.5 text-right font-normal">value</th><th class="px-2 py-1.5 text-left font-normal">unit</th></tr></thead><tbody></tbody></table></div>'),Yb=x('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> kpis</button> <button type="button"><!> gauges</button> <button type="button"><!> table</button></div> <div class="ml-auto text-fg-3"> <!></div></div> <!>',1),Xb=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function Zb(t,e){ot(e,!0);let r=_e("kpi");const a=y(()=>Qc(e.result)),o=y(()=>Math.max(1,...n(a).map(p=>Math.abs(p.value))));function s(p){return p>=0&&p<=100?p:Math.min(100,Math.abs(p)/n(o)*100)}var i=Xb(),c=d(i);{var f=p=>{var b=Fb();v(p,b)},g=p=>{var b=Yb(),h=ue(b),w=d(h),M=d(w),P=d(M);Ev(P,{class:"size-3"}),Ce(),l(M);var V=u(M,2),O=d(V);Lc(O,{class:"size-3"}),Ce(),l(V);var k=u(V,2),F=d(k);rf(F,{class:"size-3"}),Ce(),l(k),l(w);var U=u(w,2),Q=d(U),se=u(Q);{var xe=C=>{var N=qb(),_=u(ue(N)),z=d(_,!0);l(_),L(()=>S(z,e.collection)),v(C,N)};B(se,C=>{e.collection&&C(xe)})}l(U),l(h);var le=u(h,2);{var te=C=>{var N=jb(),_=d(N);Qe(_,23,()=>n(a),(z,I)=>`${z.key}-${I}`,(z,I)=>{var D=Kb(),T=d(D),$=d(T,!0);l(T);var X=u(T,2),H=d(X,!0);l(X),l(D),L(W=>{S($,n(I).label),S(H,W)},[()=>wl(n(I).value,n(I).unit)]),v(z,D)}),l(_),l(N),v(C,N)},be=C=>{var N=Wb(),_=d(N);Qe(_,23,()=>n(a),(z,I)=>`${z.key}-${I}`,(z,I)=>{const D=y(()=>s(n(I).value));var T=Bb(),$=d(T),X=u(d($)),H=u(X),W=d(H,!0);l(H),l($);var Y=u($,2),ae=d(Y,!0);l(Y),l(T),L(ge=>{Pe($,"aria-label",`${n(I).label??""} gauge`),Pe(X,"stroke-dasharray",`${n(D)} 100`),S(W,ge),S(ae,n(I).label)},[()=>wl(n(I).value,n(I).unit)]),v(z,T)}),l(_),l(N),v(C,N)},K=C=>{var N=Gb(),_=d(N),z=u(d(_));Qe(z,23,()=>n(a),(I,D)=>`${I.key}-${D}`,(I,D)=>{var T=Ub(),$=d(T),X=d($,!0);l($);var H=u($),W=d(H,!0);l(H);var Y=u(H),ae=d(Y,!0);l(Y),l(T),L(ge=>{S(X,n(D).label),S(W,ge),S(ae,n(D).unit||"-")},[()=>n(D).value.toLocaleString()]),v(I,T)}),l(z),l(_),l(N),v(C,N)};B(le,C=>{n(r)==="kpi"?C(te):n(r)==="gauge"?C(be,1):C(K,-1)})}L((C,N,_,z)=>{Ve(M,1,C),Pe(M,"aria-pressed",n(r)==="kpi"),Ve(V,1,N),Pe(V,"aria-pressed",n(r)==="gauge"),Ve(k,1,_),Pe(k,"aria-pressed",n(r)==="table"),S(Q,`${z??""} metrics `)},[()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(r)==="kpi"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="gauge"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="table"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>n(a).length.toLocaleString()]),we("click",M,()=>m(r,"kpi")),we("click",V,()=>m(r,"gauge")),we("click",k,()=>m(r,"table")),v(p,b)};B(c,p=>{n(a).length===0?p(f):p(g,-1)})}l(i),v(t,i),it()}tn(["click"]);const Qb={capability:"stats",renders:t=>Hb(t),component:Zb},Jc=["change","change_type","operation","op"],Jb=["target_collection","collection_name","diff_collection"],ex=["entity_id","row_id","rid","id"],ed=["before_state","before_row","before"],td=["after_state","after_row","after"],tx=["note","summary","message"];function Jr(t,e){for(const r of e)if(r in t)return[r,t[r]];return Object.entries(t).find(([r])=>e.includes(r.toLowerCase()))??null}function kl(t){if(typeof t!="string")return t;const e=t.trim();if(!e||!/^[{[]/.test(e))return t;try{return JSON.parse(e)}catch{return t}}function nx(t){return t.result.records.map((e,r)=>{const a=e.values??{},o=Jr(a,Jc),s=Jr(a,Jb),i=Jr(a,ex),c=Jr(a,ed),f=Jr(a,td),g=Jr(a,tx);return{index:r,id:String(a.id??a.diff_id??(i==null?void 0:i[1])??r+1),change:String((o==null?void 0:o[1])??"modified"),collection:(s==null?void 0:s[1])===void 0||(s==null?void 0:s[1])===null?null:String(s[1]),entityId:(i==null?void 0:i[1])===void 0||(i==null?void 0:i[1])===null?null:String(i[1]),before:kl((c==null?void 0:c[1])??null),after:kl((f==null?void 0:f[1])??null),note:(g==null?void 0:g[1])===void 0||(g==null?void 0:g[1])===null?null:String(g[1]),values:a}})}function rx(t){return t.capability==="diff"?!0:t.result.records.some(e=>{const r=Object.keys(e.values??{}).map(a=>a.toLowerCase());return Jc.some(a=>r.includes(a))&&(ed.some(a=>r.includes(a))||td.some(a=>r.includes(a)))})}function ax(t){const e=new Map;for(const r of t)e.set(r.change,(e.get(r.change)??0)+1);return[...e.entries()].sort(([r],[a])=>r.localeCompare(a))}function ns(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}function Sl(t){return t===void 0?"__red_ui_undefined__":ns(t)?JSON.stringify(Object.fromEntries(Object.entries(t).sort(([e],[r])=>e.localeCompare(r)))):JSON.stringify(t)}function ox(t){const e=ns(t.before)?t.before:{},r=ns(t.after)?t.after:{};return[...new Set([...Object.keys(e),...Object.keys(r)])].sort((o,s)=>o.localeCompare(s)).map(o=>{const s=Object.prototype.hasOwnProperty.call(e,o),i=Object.prototype.hasOwnProperty.call(r,o),c=e[o],f=r[o],g=!s&&i?"added":s&&!i?"removed":Sl(c)===Sl(f)?"unchanged":"modified";return{field:o,before:c,after:f,status:g}})}function ea(t){return t==null||t===""?"-":typeof t=="object"?JSON.stringify(t,null,2):String(t)}var ix=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No diff shape in this result.</div>'),sx=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear diff filter"><!></button>'),lx=x('<span><span class="text-fg-2"> </span> </span>'),cx=x('<span class="text-fg-2"> </span>'),dx=x('<div class="flex-1 overflow-auto p-3 text-[12px] font-mono"><pre class="whitespace-pre-wrap text-fg-1"> </pre></div>'),ux=x('<span class="ml-auto text-fg-3"> </span>'),fx=x('<div class="mt-1 truncate text-fg-1"> </div>'),vx=x('<button type="button"><div class="flex items-center gap-2"><span class="text-accent"> </span> <span class="text-fg-3 truncate"> </span> <!></div> <!></button>'),gx=x('<span class="text-fg-3">note</span><span class="text-fg-1"> </span>',1),px=x('<div class="px-2 py-2 text-fg-3">No changed fields in this row.</div>'),hx=x('<tr class="border-b border-line-1/60 last:border-b-0"><td> </td><td class="px-2 py-1 align-top text-fg-0"> </td><td class="max-w-[260px] px-2 py-1 align-top text-fg-2"><pre class="whitespace-pre-wrap break-words"> </pre></td><td class="max-w-[260px] px-2 py-1 align-top text-fg-2"><pre class="whitespace-pre-wrap break-words"> </pre></td></tr>'),bx=x('<table class="w-full border-collapse"><thead class="bg-bg-0 text-fg-3"><tr class="border-b border-line-1"><th class="w-[110px] px-2 py-1 text-left font-normal">status</th><th class="w-[150px] px-2 py-1 text-left font-normal">field</th><th class="px-2 py-1 text-left font-normal">before</th><th class="px-2 py-1 text-left font-normal">after</th></tr></thead><tbody></tbody></table>'),xx=x('<div class="mb-3 border border-line-1"><div class="flex items-center gap-2 border-b border-line-1 bg-bg-1 px-2 py-1.5"><span class="text-fg-0">field diff</span> <span class="text-fg-3"> </span> <label class="ml-auto inline-flex items-center gap-1 text-fg-3"><input type="checkbox" class="size-3 accent-current"/> unchanged</label></div> <!></div>'),mx=x('<div class="mb-3 grid grid-cols-[100px_1fr] gap-x-3 gap-y-1"><span class="text-fg-3">change</span><span class="text-accent"> </span> <span class="text-fg-3">entity</span><span class="text-fg-0"> </span> <span class="text-fg-3">collection</span><span class="text-fg-0"> </span> <!></div> <!> <div class="grid grid-cols-2 gap-3"><section class="min-w-0"><div class="type-label mb-1">full before</div> <pre class="min-h-[160px] whitespace-pre-wrap break-words rounded border border-line-1 bg-bg-1 p-2 text-fg-1"> </pre></section> <section class="min-w-0"><div class="type-label mb-1">full after</div> <pre class="min-h-[160px] whitespace-pre-wrap break-words rounded border border-line-1 bg-bg-1 p-2 text-fg-1"> </pre></section></div>',1),_x=x('<div class="text-fg-3">No diff entry selected.</div>'),yx=x('<div class="flex-1 min-h-0 grid grid-cols-[minmax(320px,0.9fr)_1.1fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"></div> <div class="overflow-auto p-3 text-[12px] font-mono"><!></div></div>'),wx=x('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> diff</button> <button type="button"><!> raw</button></div> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="change, id, value…" class="bg-transparent text-fg-1 outline-none w-[190px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto flex items-center gap-3 text-fg-3"><!> <!></div></div> <!>',1),kx=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function nd(t,e){ot(e,!0);let r=_e("summary"),a=_e(""),o=_e(null),s=_e(!1);const i=y(()=>nx(e.result)),c=y(()=>ax(n(i))),f=y(()=>{const O=n(a).trim().toLowerCase();return O?n(i).filter(k=>k.id.toLowerCase().includes(O)||k.change.toLowerCase().includes(O)||(k.collection??"").toLowerCase().includes(O)||(k.entityId??"").toLowerCase().includes(O)||ea(k.before).toLowerCase().includes(O)||ea(k.after).toLowerCase().includes(O)):n(i)}),g=y(()=>n(o)??n(f)[0]??null),p=y(()=>n(g)?ox(n(g)):[]),b=y(()=>n(s)?n(p):n(p).filter(O=>O.status!=="unchanged"));function h(O){return O==="added"?"text-ok":O==="removed"?"text-danger":O==="modified"?"text-accent":"text-fg-3"}var w=kx(),M=d(w);{var P=O=>{var k=ix();v(O,k)},V=O=>{var k=wx(),F=ue(k),U=d(F),Q=d(U),se=d(Q);Gi(se,{class:"size-3"}),Ce(),l(Q);var xe=u(Q,2),le=d(xe);va(le,{class:"size-3"}),Ce(),l(xe),l(U);var te=u(U,2),be=d(te);Xn(be,{class:"size-3 text-fg-3"});var K=u(be,2);en(K);var C=u(K,2);{var N=H=>{var W=sx(),Y=d(W);Rn(Y,{class:"size-3"}),l(W),we("click",W,()=>m(a,"")),v(H,W)};B(C,H=>{n(a)&&H(N)})}l(te);var _=u(te,2),z=d(_);Qe(z,17,()=>n(c),([H,W])=>H,(H,W)=>{var Y=y(()=>er(n(W),2));let ae=()=>n(Y)[0],ge=()=>n(Y)[1];var ie=lx(),ee=d(ie),q=d(ee,!0);l(ee);var G=u(ee);l(ie),L(()=>{S(q,ae()),S(G,` ${ge()??""}`)}),v(H,ie)});var I=u(z,2);{var D=H=>{var W=cx(),Y=d(W,!0);l(W),L(()=>S(Y,e.collection)),v(H,W)};B(I,H=>{e.collection&&H(D)})}l(_),l(F);var T=u(F,2);{var $=H=>{var W=dx(),Y=d(W),ae=d(Y,!0);l(Y),l(W),L(ge=>S(ae,ge),[()=>JSON.stringify(n(f).map(ge=>ge.values),null,2)]),v(H,W)},X=H=>{var W=yx(),Y=d(W);Qe(Y,21,()=>n(f),q=>q.id,(q,G)=>{var E=vx(),j=d(E),R=d(j),A=d(R,!0);l(R);var Z=u(R,2),J=d(Z,!0);l(Z);var oe=u(Z,2);{var me=Se=>{var ve=ux(),ce=d(ve,!0);l(ve),L(()=>S(ce,n(G).collection)),v(Se,ve)};B(oe,Se=>{n(G).collection&&Se(me)})}l(j);var pe=u(j,2);{var Ee=Se=>{var ve=fx(),ce=d(ve,!0);l(ve),L(()=>S(ce,n(G).note)),v(Se,ve)};B(pe,Se=>{n(G).note&&Se(Ee)})}l(E),L(Se=>{Ve(E,1,Se),S(A,n(G).change),S(J,n(G).entityId??n(G).id)},[()=>Ke(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",n(g)===n(G)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),we("click",E,()=>m(o,n(G),!0)),v(q,E)}),l(Y);var ae=u(Y,2),ge=d(ae);{var ie=q=>{var G=mx(),E=ue(G),j=u(d(E)),R=d(j,!0);l(j);var A=u(j,3),Z=d(A,!0);l(A);var J=u(A,3),oe=d(J,!0);l(J);var me=u(J,2);{var pe=Ae=>{var ke=gx(),Te=u(ue(ke)),ze=d(Te,!0);l(Te),L(()=>S(ze,n(g).note)),v(Ae,ke)};B(me,Ae=>{n(g).note&&Ae(pe)})}l(E);var Ee=u(E,2);{var Se=Ae=>{var ke=xx(),Te=d(ke),ze=u(d(Te),2),Ne=d(ze);l(ze);var Me=u(ze,2),Xe=d(Me);en(Xe),Ce(),l(Me),l(Te);var Re=u(Te,2);{var Je=ft=>{var qe=px();v(ft,qe)},dt=ft=>{var qe=bx(),$e=u(d(qe));Qe($e,21,()=>n(b),je=>je.field,(je,at)=>{var ne=hx(),nt=d(ne),Ze=d(nt,!0);l(nt);var Be=u(nt),ut=d(Be,!0);l(Be);var Nt=u(Be),Pt=d(Nt),Mt=d(Pt,!0);l(Pt),l(Nt);var Et=u(Nt),mt=d(Et),yt=d(mt,!0);l(mt),l(Et),l(ne),L((kt,It,Xt)=>{Ve(nt,1,kt),S(Ze,n(at).status),S(ut,n(at).field),S(Mt,It),S(yt,Xt)},[()=>Ke(["px-2 py-1 align-top",h(n(at).status)].join(" ")),()=>ea(n(at).before),()=>ea(n(at).after)]),v(je,ne)}),l($e),l(qe),v(ft,qe)};B(Re,ft=>{n(b).length===0?ft(Je):ft(dt,-1)})}l(ke),L(()=>S(Ne,`${n(b).length??""}/${n(p).length??""} fields`)),Xu(Xe,()=>n(s),ft=>m(s,ft)),v(Ae,ke)};B(Ee,Ae=>{n(p).length>0&&Ae(Se)})}var ve=u(Ee,2),ce=d(ve),Oe=u(d(ce),2),re=d(Oe,!0);l(Oe),l(ce);var de=u(ce,2),he=u(d(de),2),Ie=d(he,!0);l(he),l(de),l(ve),L((Ae,ke)=>{S(R,n(g).change),S(Z,n(g).entityId??n(g).id),S(oe,n(g).collection??"-"),S(re,Ae),S(Ie,ke)},[()=>ea(n(g).before),()=>ea(n(g).after)]),v(q,G)},ee=q=>{var G=_x();v(q,G)};B(ge,q=>{n(g)?q(ie):q(ee,-1)})}l(ae),l(W),v(H,W)};B(T,H=>{n(r)==="raw"?H($):H(X,-1)})}L((H,W)=>{Ve(Q,1,H),Pe(Q,"aria-pressed",n(r)==="summary"),Ve(xe,1,W),Pe(xe,"aria-pressed",n(r)==="raw")},[()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(r)==="summary"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="raw"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),we("click",Q,()=>m(r,"summary")),we("click",xe,()=>m(r,"raw")),Tn(K,()=>n(a),H=>m(a,H)),v(O,k)};B(M,O=>{n(i).length===0?O(P):O(V,-1)})}l(w),v(t,w),it()}tn(["click"]);const Sx={capability:"diff",renders:rx,component:nd},Cx=new Set(["rid","collection","kind","tenant","created_at","updated_at","body"]);function Ex(t,e,r){const a=e&&typeof e=="object"&&!Array.isArray(e)?e:{};for(const s of["title","name","slug","id","event_type","type"]){const i=t[s]??a[s];if(typeof i=="string"&&i.trim())return i;if(typeof i=="number")return String(i)}const o=t.rid;return typeof o=="string"||typeof o=="number"?`document ${o}`:`document ${r+1}`}function Nx(t,e){const r=e&&typeof e=="object"&&!Array.isArray(e)?e:{},a=[];for(const s of["category","source","status","collection"]){const i=t[s]??r[s];typeof i=="string"&&i.trim()&&a.push(i)}const o=t.updated_at??t.created_at;return(typeof o=="string"||typeof o=="number")&&a.push(String(o)),a.join(" · ")}function rd(t){const e=[];for(const[r,a]of t.result.records.entries()){const o=a.values??{},s=o.body;if(o.kind!=="document"&&(s===null||typeof s!="object"))continue;const i={};for(const[c,f]of Object.entries(o))Cx.has(c.toLowerCase())||(i[c]=f);e.push({rid:String(o.rid??r+1),title:Ex(o,s,r),subtitle:Nx(o,s),body:s,fields:i,values:o})}return e}function Mx(t){return t.capability==="document"?!0:rd(t).length>0}var zx=x('<div class="flex-1 grid place-items-center text-fg-3 text-[12px] font-mono p-6">No document shape in this result.</div>'),Tx=x('<button type="button" class="text-fg-3 hover:text-fg-1 cursor-pointer" aria-label="Clear document filter"><!></button>'),Px=x('· <span class="text-fg-2"> </span>',1),Ax=x('<div class="mt-1 truncate text-fg-3"> </div>'),Lx=x('<button type="button"><div class="flex items-center gap-2"><span class="text-accent truncate"> </span> <span class="ml-auto text-fg-3"> </span></div> <!></button>'),Ix=x('<pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre>'),Ox=x('<tr class="border-b border-line-1/60"><td class="w-[180px] px-2 py-1 text-fg-3 align-top"> </td><td class="px-2 py-1 text-fg-1 align-top"><pre class="m-0 whitespace-pre-wrap"> </pre></td></tr>'),Rx=x('<table class="w-full border-collapse"><tbody></tbody></table>'),Dx=x('<pre class="m-0 whitespace-pre-wrap text-fg-1"> </pre>'),$x=x('<div class="text-fg-3">No documents match the current filter.</div>'),Vx=x('<div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 text-[11px] font-mono bg-bg-1/40"><div class="inline-flex border border-line-2 rounded overflow-hidden"><button type="button"><!> body</button> <button type="button"><!> fields</button> <button type="button"><!> raw</button></div> <div class="inline-flex items-center gap-1.5 border border-line-1 rounded px-2 py-1 bg-bg-0"><!> <input type="text" placeholder="document search…" class="bg-transparent text-fg-1 outline-none w-[200px] placeholder:text-fg-3"/> <!></div> <div class="ml-auto text-fg-3"> <!> documents <!></div></div> <div class="flex-1 min-h-0 grid grid-cols-[minmax(280px,0.75fr)_1.25fr]"><div class="overflow-auto border-r border-line-1 text-[12px] font-mono"></div> <div class="min-h-0 overflow-auto p-3 text-[12px] font-mono"><!></div></div> <div class="border-t border-line-1 px-3 py-1.5 text-[10px] font-mono text-fg-3"> </div>',1),Hx=x('<div class="flex h-full flex-col text-fg-1"><!></div>');function Fx(t,e){ot(e,!0);let r=_e("body"),a=_e(""),o=_e(null);const s=y(()=>rd(e.result)),i=y(()=>{const w=n(a).trim().toLowerCase();return w?n(s).filter(M=>M.title.toLowerCase().includes(w)||M.subtitle.toLowerCase().includes(w)||JSON.stringify(M.body).toLowerCase().includes(w)):n(s)}),c=y(()=>n(o)&&n(i).includes(n(o))?n(o):n(i)[0]??null);function f(w){return JSON.stringify(w??null,null,2)}var g=Hx(),p=d(g);{var b=w=>{var M=zx();v(w,M)},h=w=>{var M=Vx(),P=ue(M),V=d(P),O=d(V),k=d(O);va(k,{class:"size-3"}),Ce(),l(O);var F=u(O,2),U=d(F);_v(U,{class:"size-3"}),Ce(),l(F);var Q=u(F,2),se=d(Q);va(se,{class:"size-3"}),Ce(),l(Q),l(V);var xe=u(V,2),le=d(xe);Xn(le,{class:"size-3 text-fg-3"});var te=u(le,2);en(te);var be=u(te,2);{var K=ie=>{var ee=Tx(),q=d(ee);Rn(q,{class:"size-3"}),l(ee),we("click",ee,()=>m(a,"")),v(ie,ee)};B(be,ie=>{n(a)&&ie(K)})}l(xe);var C=u(xe,2),N=d(C,!0),_=u(N);{var z=ie=>{var ee=_t();L(q=>S(ee,`of ${q??""}`),[()=>n(s).length.toLocaleString()]),v(ie,ee)};B(_,ie=>{n(a)&&ie(z)})}var I=u(_,2);{var D=ie=>{var ee=Px(),q=u(ue(ee)),G=d(q,!0);l(q),L(()=>S(G,e.collection)),v(ie,ee)};B(I,ie=>{e.collection&&ie(D)})}l(C),l(P);var T=u(P,2),$=d(T);Qe($,21,()=>n(i),ie=>ie.rid,(ie,ee)=>{var q=Lx(),G=d(q),E=d(G),j=d(E,!0);l(E);var R=u(E,2),A=d(R);l(R),l(G);var Z=u(G,2);{var J=oe=>{var me=Ax(),pe=d(me,!0);l(me),L(()=>S(pe,n(ee).subtitle)),v(oe,me)};B(Z,oe=>{n(ee).subtitle&&oe(J)})}l(q),L(oe=>{Ve(q,1,oe),S(j,n(ee).title),S(A,`#${n(ee).rid??""}`)},[()=>Ke(["w-full text-left px-3 py-2 border-b border-line-1/60 hover:bg-bg-1/50 cursor-pointer",n(c)===n(ee)?"bg-bg-1 text-fg-0":"text-fg-2"].join(" "))]),we("click",q,()=>m(o,n(ee),!0)),v(ie,q)}),l($);var X=u($,2),H=d(X);{var W=ie=>{var ee=De(),q=ue(ee);{var G=R=>{var A=Ix(),Z=d(A,!0);l(A),L(J=>S(Z,J),[()=>f(n(c).body)]),v(R,A)},E=R=>{var A=Rx(),Z=d(A);Qe(Z,21,()=>Object.entries(n(c).fields),([J,oe])=>J,(J,oe)=>{var me=y(()=>er(n(oe),2));let pe=()=>n(me)[0],Ee=()=>n(me)[1];var Se=Ox(),ve=d(Se),ce=d(ve,!0);l(ve);var Oe=u(ve),re=d(Oe),de=d(re,!0);l(re),l(Oe),l(Se),L(he=>{S(ce,pe()),S(de,he)},[()=>f(Ee())]),v(J,Se)}),l(Z),l(A),v(R,A)},j=R=>{var A=Dx(),Z=d(A,!0);l(A),L(J=>S(Z,J),[()=>f(n(c).values)]),v(R,A)};B(q,R=>{n(r)==="body"?R(G):n(r)==="fields"?R(E,1):R(j,-1)})}v(ie,ee)},Y=ie=>{var ee=$x();v(ie,ee)};B(H,ie=>{n(c)?ie(W):ie(Y,-1)})}l(X),l(T);var ae=u(T,2),ge=d(ae);l(ae),L((ie,ee,q,G)=>{Ve(O,1,ie),Pe(O,"aria-pressed",n(r)==="body"),Ve(F,1,ee),Pe(F,"aria-pressed",n(r)==="fields"),Ve(Q,1,q),Pe(Q,"aria-pressed",n(r)==="raw"),S(N,G),S(ge,`${n(s).length??""} documents${e.collection?" · ":""}${e.collection??""??""}`)},[()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors",n(r)==="body"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="fields"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex items-center gap-1 px-2 py-1 cursor-pointer transition-colors border-l border-line-2",n(r)==="raw"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>n(i).length.toLocaleString()]),we("click",O,()=>m(r,"body")),we("click",F,()=>m(r,"fields")),we("click",Q,()=>m(r,"raw")),Tn(te,()=>n(a),ie=>m(a,ie)),v(w,M)};B(p,w=>{n(s).length===0?w(b):w(h,-1)})}l(g),v(t,g),it()}tn(["click"]);const qx={capability:"document",renders:Mx,component:Fx};tr.register(_h);tr.register(yh);tr.register(qh);tr.register(d1);tr.register(ab);tr.register(Rb);tr.register(Qb);tr.register(Sx);tr.register(qx);tr.register(h1);var Kx=x("<!> resume",1),jx=x("<!> pause",1),Bx=x('<label class="inline-flex items-center gap-1 cursor-pointer"><input type="checkbox" class="accent-accent size-3"/> <span> </span></label>'),Wx=x('<button type="button" class="inline-flex items-center gap-1 px-2 py-1 text-[11px] font-mono rounded border border-line-1 hover:bg-bg-2 text-fg-3" title="Clear buffer"><!> clear</button>'),Ux=x('<div class="p-6 text-[12px] font-mono text-fg-3"><span class="text-accent">error:</span> </div>'),Gx=x('<div class="p-6 text-[12px] font-mono text-fg-3">Not connected. Use the topbar Connect button to open a stream.</div>'),Yx=x('<div class="p-6 text-[12px] font-mono text-fg-3"> </div>'),Xx=x('<span class="text-fg-3 ml-auto"> </span>'),Zx=x('<li class="px-3 py-1.5 flex items-center gap-3 hover:bg-bg-1"><span class="text-fg-3 w-16 shrink-0"> </span> <span class="text-fg-3 w-16 shrink-0"> </span> <span> </span> <span class="text-fg-2 truncate"> </span> <span class="text-fg-3">·</span> <span class="text-fg-3 truncate"> </span> <!></li>'),Qx=x('<ul class="divide-y divide-line-1 font-mono text-[12px]"></ul>'),Jx=x('<div class="h-full flex flex-col bg-bg-0"><header class="px-3 py-2 border-b border-line-1 flex items-center gap-3 text-fg-3"><!> <span class="type-label">Live changes</span> <span class="text-[11px] font-mono text-fg-3"> </span> <div class="ml-auto flex items-center gap-1"><button type="button" class="inline-flex items-center gap-1 px-2 py-1 text-[11px] font-mono rounded border border-line-1 hover:bg-bg-2 text-fg-2"><!></button> <div class="inline-flex items-center gap-1 px-2 py-1 text-[11px] font-mono rounded border border-line-1 text-fg-3"><!> <!></div> <!></div></header> <div class="flex-1 overflow-auto"><!></div></div>');function ad(t,e){ot(e,!0);const r=["insert","update","delete"];let a=_e(Bt([])),o=_e(!1),s=_e(Bt({insert:!0,update:!0,delete:!0})),i=_e(null),c=null,f=null;const g=500;function p(){h(),m(i,null),m(a,[],!0);const W=Ue.client;if(!W){m(i,"No active connection.");return}c=new iv({client:W,sseFactory:null}).subscribe({collection:e.collection}),f=c.events.getReader(),b()}async function b(){if(f)try{for(;;){const{value:W,done:Y}=await f.read();if(Y)return;n(o)||W&&m(a,[W,...n(a)].slice(0,g),!0)}}catch(W){m(i,W.message,!0)}}function h(){if(f){try{f.cancel()}catch{}f=null}c&&(c.close(),c=null)}an(()=>{Ue.connected,e.collection,Ue.connected?p():h()}),Qo(h);function w(W){const Y=Date.now()-W;return Y<1e3?"now":Y<6e4?`${Math.floor(Y/1e3)}s ago`:Y<36e5?`${Math.floor(Y/6e4)}m ago`:`${Math.floor(Y/36e5)}h ago`}function M(W){return new Date(W).toISOString().replace("T"," ").replace("Z","")}const P=y(()=>n(a).filter(W=>n(s)[W.operation]??!0)),V=y(()=>e.collection?`collection: ${e.collection}`:"global");var O=Jx(),k=d(O),F=d(k);Ha(F,{class:"size-3.5"});var U=u(F,4),Q=d(U);l(U);var se=u(U,2),xe=d(se),le=d(xe);{var te=W=>{var Y=Kx(),ae=ue(Y);ti(ae,{class:"size-3"}),Ce(),v(W,Y)},be=W=>{var Y=jx(),ae=ue(Y);Mv(ae,{class:"size-3"}),Ce(),v(W,Y)};B(le,W=>{n(o)?W(te):W(be,-1)})}l(xe);var K=u(xe,2),C=d(K);Ac(C,{class:"size-3"});var N=u(C,2);Qe(N,16,()=>r,W=>W,(W,Y)=>{var ae=Bx(),ge=d(ae);en(ge);var ie=u(ge,2),ee=d(ie,!0);l(ie),l(ae),L(()=>{Ta(ge,n(s)[Y]),Ve(ie,1,Ke(n(s)[Y]?"text-fg-1":"text-fg-3")),S(ee,Y)}),we("change",ge,q=>m(s,{...n(s),[Y]:q.currentTarget.checked},!0)),v(W,ae)}),l(K);var _=u(K,2);{var z=W=>{var Y=Wx(),ae=d(Y);Rn(ae,{class:"size-3"}),Ce(),l(Y),we("click",Y,()=>m(a,[],!0)),v(W,Y)};B(_,W=>{n(a).length>0&&W(z)})}l(se),l(k);var I=u(k,2),D=d(I);{var T=W=>{var Y=Ux(),ae=u(d(Y));l(Y),L(()=>S(ae,` ${n(i)??""}`)),v(W,Y)},$=W=>{var Y=Gx();v(W,Y)},X=W=>{var Y=Yx(),ae=d(Y,!0);l(Y),L(()=>S(ae,n(o)?"Paused — no events captured.":"Listening for changes…")),v(W,Y)},H=W=>{var Y=Qx();Qe(Y,21,()=>n(P),ae=>ae.lsn,(ae,ge)=>{var ie=Zx(),ee=d(ie),q=d(ee,!0);l(ee);var G=u(ee,2),E=d(G);l(G);var j=u(G,2),R=d(j,!0);l(j);var A=u(j,2),Z=d(A,!0);l(A);var J=u(A,4),oe=d(J,!0);l(J);var me=u(J,2);{var pe=Ee=>{var Se=Xx(),ve=d(Se);l(Se),L(()=>S(ve,`rid ${n(ge).rid??""}`)),v(Ee,Se)};B(me,Ee=>{n(ge).rid!==void 0&&Ee(pe)})}l(ie),L((Ee,Se,ve)=>{Pe(ee,"title",Ee),S(q,Se),S(E,`lsn ${n(ge).lsn??""}`),Ve(j,1,ve),S(R,n(ge).operation),S(Z,n(ge).collection),S(oe,n(ge).kind)},[()=>M(n(ge).timestamp),()=>w(n(ge).timestamp),()=>Ke(["inline-block w-14 text-center text-[10px] uppercase rounded px-1 py-0.5 shrink-0 border",n(ge).operation==="insert"&&"border-ok/40 text-ok",n(ge).operation==="update"&&"border-warn/40 text-warn",n(ge).operation==="delete"&&"border-accent/40 text-accent"].filter(Boolean).join(" "))]),v(ae,ie)}),l(Y),v(W,Y)};B(D,W=>{n(i)?W(T):Ue.connected?n(P).length===0?W(X,2):W(H,-1):W($,1)})}l(I),l(O),L(()=>{S(Q,`· ${n(V)??""}`),Pe(xe,"title",n(o)?"Resume stream":"Pause stream")}),we("click",xe,()=>m(o,!n(o))),v(t,O),it()}tn(["click","change"]);var em=x('<div class="border-b border-line-1 px-3 py-1.5 font-mono text-[11px] text-warn"> </div>'),tm=x('<div class="p-4 font-mono text-[12px] text-fg-3">No active RedDB connection.</div>'),nm=x('<div class="p-4 font-mono text-[12px] text-fg-3">Loading version history…</div>'),rm=x('<div class="p-4 font-mono text-[12px] text-fg-3"><div class="mb-2 text-fg-1">This collection is a normal collection with versioning disabled.</div> <button type="button" class="inline-flex h-7 items-center gap-1 rounded border border-accent/40 bg-accent px-2 text-white hover:bg-accent/90"><!> enable versioning</button></div>'),am=x('<div class="flex-1 min-h-0"><!></div>'),om=x("<option> </option>"),im=x("<option> </option>"),sm=x('<span class="ml-auto text-fg-3"> </span>'),lm=x('<div class="p-4 font-mono text-[12px] text-fg-3">Choose two commits to compare this collection.</div>'),cm=x('<div class="border-b border-line-1 px-3 py-1.5 flex flex-wrap items-center gap-2 font-mono text-[11px]"><label class="inline-flex items-center gap-1 text-fg-3"><span>from</span> <select class="h-7 rounded border border-line-1 bg-bg-0 px-2 text-fg-1"><option>select commit</option><!></select></label> <label class="inline-flex items-center gap-1 text-fg-3"><span>to</span> <select class="h-7 rounded border border-line-1 bg-bg-0 px-2 text-fg-1"><option>select commit</option><!></select></label> <button type="button" class="inline-flex h-7 items-center gap-1 rounded border border-line-1 px-2 text-fg-2 hover:bg-bg-2 disabled:text-fg-3"><!> run diff</button> <!></div> <div class="flex-1 min-h-0"><!></div>',1),dm=x('<div class="p-4 font-mono text-[12px] text-fg-3">No commits yet.</div>'),um=x('<tr class="border-b border-line-1/60 hover:bg-bg-1/50"><td class="px-3 py-1.5 text-accent"> </td><td class="px-3 py-1.5 text-fg-1"> </td><td class="px-3 py-1.5 text-fg-3"> </td><td class="px-3 py-1.5 text-fg-3"> </td></tr>'),fm=x('<table class="w-full border-collapse font-mono text-[12px]"><thead class="sticky top-0 bg-bg-0 text-fg-3"><tr class="border-b border-line-1"><th class="px-3 py-1.5 text-left font-normal">commit</th><th class="px-3 py-1.5 text-left font-normal">message</th><th class="px-3 py-1.5 text-left font-normal">author</th><th class="px-3 py-1.5 text-left font-normal">time</th></tr></thead><tbody></tbody></table>'),vm=x('<div class="flex-1 overflow-auto"><!></div>'),gm=x('<div class="h-full min-h-0 flex flex-col bg-bg-0"><div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 font-mono text-[11px]"><div class="inline-flex overflow-hidden rounded border border-line-2"><button type="button"><!> commits</button> <button type="button"><!> diff</button> <button type="button"><!> live</button></div> <span> </span> <span class="text-fg-3"> </span> <button type="button" class="ml-auto inline-flex h-7 items-center gap-1 rounded border border-line-1 px-2 text-fg-3 hover:bg-bg-2 hover:text-fg-1"><!> refresh</button></div> <!> <!></div>');function pm(t,e){ot(e,!0);let r=_e("commits"),a=_e(null),o=_e(Bt([])),s=_e(""),i=_e(""),c=_e(null),f=_e(!1),g=_e(!1),p=_e(null),b="";const h=y(()=>n(s).length>0&&n(i).length>0&&n(s)!==n(i));function w(G){return G.slice(0,10)}function M(G){return G?new Date(G).toISOString().replace("T"," ").replace("Z",""):"-"}function P(G){return{ok:!0,query:`/repo/commits/${G.from}/diff/${G.to}?collection=${e.collection}`,capability:"diff",record_count:G.entries.length,result:{columns:["collection","entity_id","change","before","after"],records:G.entries.map((E,j)=>({values:{id:`${E.collection}:${E.entity_id}:${j}`,collection:E.collection,entity_id:E.entity_id,change:E.change,before:E.before??null,after:E.after??null}}))}}}async function V(){if(e.client){m(f,!0),m(p,null),m(c,null);try{const[G,E]=await Promise.all([e.client.collectionVcs(e.collection),e.client.commits({limit:40})]);m(a,G,!0),m(o,E,!0),E.length>=2?(m(i,E[0].hash,!0),m(s,E[1].hash,!0)):E.length===1?(m(i,E[0].hash,!0),m(s,"")):(m(i,""),m(s,""))}catch(G){m(p,G.message,!0)}finally{m(f,!1)}}}async function O(){if(e.client){m(f,!0),m(p,null);try{m(a,await e.client.setCollectionVcs(e.collection,!0),!0),m(o,await e.client.commits({limit:40}),!0)}catch(G){m(p,G.message,!0)}finally{m(f,!1)}}}async function k(){if(!(!e.client||!n(h))){m(g,!0),m(p,null);try{m(c,await e.client.commitDiff(n(s),n(i),{collection:e.collection}),!0),m(r,"diff")}catch(G){m(p,G.message,!0)}finally{m(g,!1)}}}an(()=>{var E;const G=`${((E=e.client)==null?void 0:E.baseUrl)??"none"}:${e.collection}`;G!==b&&(b=G,V())});var F=gm(),U=d(F),Q=d(U),se=d(Q),xe=d(se);wv(xe,{class:"size-3"}),Ce(),l(se);var le=u(se,2),te=d(le);Gi(te,{class:"size-3"}),Ce(),l(le);var be=u(le,2),K=d(be);zv(K,{class:"size-3"}),Ce(),l(be),l(Q);var C=u(Q,2),N=d(C,!0);l(C);var _=u(C,2),z=d(_,!0);l(_);var I=u(_,2),D=d(I);{var T=G=>{lr(G,{class:"size-3 animate-spin"})},$=G=>{Cs(G,{class:"size-3"})};B(D,G=>{n(f)?G(T):G($,-1)})}Ce(),l(I),l(U);var X=u(U,2);{var H=G=>{var E=em(),j=d(E,!0);l(E),L(()=>S(j,n(p))),v(G,E)};B(X,G=>{n(p)&&G(H)})}var W=u(X,2);{var Y=G=>{var E=tm();v(G,E)},ae=G=>{var E=nm();v(G,E)},ge=G=>{var E=rm(),j=u(d(E),2),R=d(j);Iv(R,{class:"size-3"}),Ce(),l(j),l(E),we("click",j,()=>void O()),v(G,E)},ie=G=>{var E=am(),j=d(E);ad(j,{get collection(){return e.collection}}),l(E),v(G,E)},ee=G=>{var E=cm(),j=ue(E),R=d(j),A=u(d(R),2),Z=d(A);Z.value=Z.__value="";var J=u(Z);Qe(J,17,()=>n(o),Te=>Te.hash,(Te,ze)=>{var Ne=om(),Me=d(Ne);l(Ne);var Xe={};L(Re=>{S(Me,`${Re??""} · ${n(ze).message??""}`),Xe!==(Xe=n(ze).hash)&&(Ne.value=(Ne.__value=n(ze).hash)??"")},[()=>w(n(ze).hash)]),v(Te,Ne)}),l(A),l(R);var oe=u(R,2),me=u(d(oe),2),pe=d(me);pe.value=pe.__value="";var Ee=u(pe);Qe(Ee,17,()=>n(o),Te=>Te.hash,(Te,ze)=>{var Ne=im(),Me=d(Ne);l(Ne);var Xe={};L(Re=>{S(Me,`${Re??""} · ${n(ze).message??""}`),Xe!==(Xe=n(ze).hash)&&(Ne.value=(Ne.__value=n(ze).hash)??"")},[()=>w(n(ze).hash)]),v(Te,Ne)}),l(me),l(oe);var Se=u(oe,2),ve=d(Se);{var ce=Te=>{lr(Te,{class:"size-3 animate-spin"})},Oe=Te=>{Gi(Te,{class:"size-3"})};B(ve,Te=>{n(g)?Te(ce):Te(Oe,-1)})}Ce(),l(Se);var re=u(Se,2);{var de=Te=>{var ze=sm(),Ne=d(ze);l(ze),L(()=>S(Ne,`+${n(c).added??""} -${n(c).removed??""} ~${n(c).modified??""}`)),v(Te,ze)};B(re,Te=>{n(c)&&Te(de)})}l(j);var he=u(j,2),Ie=d(he);{var Ae=Te=>{{let ze=y(()=>P(n(c)));nd(Te,{get result(){return n(ze)},get collection(){return e.collection}})}},ke=Te=>{var ze=lm();v(Te,ze)};B(Ie,Te=>{n(c)?Te(Ae):Te(ke,-1)})}l(he),L(()=>Se.disabled=!n(h)||n(g)),ji(A,()=>n(s),Te=>m(s,Te)),ji(me,()=>n(i),Te=>m(i,Te)),we("click",Se,()=>void k()),v(G,E)},q=G=>{var E=vm(),j=d(E);{var R=Z=>{var J=dm();v(Z,J)},A=Z=>{var J=fm(),oe=u(d(J));Qe(oe,21,()=>n(o),me=>me.hash,(me,pe)=>{var Ee=um(),Se=d(Ee),ve=d(Se,!0);l(Se);var ce=u(Se),Oe=d(ce,!0);l(ce);var re=u(ce),de=d(re,!0);l(re);var he=u(re),Ie=d(he,!0);l(he),l(Ee),L((Ae,ke)=>{var Te;S(ve,Ae),S(Oe,n(pe).message),S(de,((Te=n(pe).author)==null?void 0:Te.name)??"-"),S(Ie,ke)},[()=>w(n(pe).hash),()=>M(n(pe).timestamp_ms)]),v(me,Ee)}),l(oe),l(J),v(Z,J)};B(j,Z=>{n(o).length===0?Z(R):Z(A,-1)})}l(E),v(G,E)};B(W,G=>{e.client?n(f)&&!n(a)?G(ae,1):n(a)&&!n(a).versioned?G(ge,2):n(r)==="live"?G(ie,3):n(r)==="diff"?G(ee,4):G(q,-1):G(Y)})}l(F),L((G,E,j)=>{var R,A;Ve(se,1,G),Ve(le,1,E),Ve(be,1,j),Ve(C,1,Ke((R=n(a))!=null&&R.versioned?"text-ok":"text-fg-3")),S(N,(A=n(a))!=null&&A.versioned?"versioned":"not versioned"),S(z,e.collection),I.disabled=n(f)},[()=>Ke(["inline-flex h-7 items-center gap-1 px-2",n(r)==="commits"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2",n(r)==="diff"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" ")),()=>Ke(["inline-flex h-7 items-center gap-1 border-l border-line-2 px-2",n(r)==="live"?"bg-accent text-white":"bg-bg-1 text-fg-2 hover:text-fg-0"].join(" "))]),we("click",se,()=>m(r,"commits")),we("click",le,()=>m(r,"diff")),we("click",be,()=>m(r,"live")),we("click",I,()=>void V()),v(t,F),it()}tn(["click"]);var hm=x('<span class="text-fg-3">·</span> <span class="text-fg-2 font-mono text-[11px] truncate max-w-[280px]"> </span>',1),bm=x('<span class="text-warn font-mono text-[11px]">disconnected</span>'),xm=x("<!> <span>Running…</span>",1),mm=x("<!> <span>Run</span>",1),_m=x('<div class="h-full grid place-items-center p-6" aria-live="polite" aria-busy="true"><div class="w-full max-w-md rounded border border-line-1 bg-bg-1 p-4 font-mono"><div class="flex items-start justify-between gap-4"><div class="min-w-0"><div class="flex items-center gap-2 text-fg-1 text-[13px]"><!> <span>Running query</span></div> <div class="mt-2 text-[11px] text-fg-3">elapsed <span class="tabular-nums text-fg-2"> </span></div></div> <button type="button" class="inline-flex h-7 items-center gap-1 rounded border border-line-2 px-2 text-[11px] text-fg-2 hover:border-danger/50 hover:text-danger cursor-pointer" aria-label="Cancel running query"><!> <span>Cancel</span></button></div> <div class="mt-3 max-h-24 overflow-hidden rounded bg-bg-0 px-2 py-1.5 text-[11px] text-fg-3"><pre class="m-0 whitespace-pre-wrap break-words"> </pre></div></div></div>'),ym=x('<div class="p-4 text-[12px] font-mono text-warn"><div class="font-semibold mb-1">Query failed</div> <pre class="whitespace-pre-wrap"> </pre></div>'),wm=x('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Run a query to see results here.</div>'),km=x('<div class="px-3 py-1.5 border-b border-line-1 bg-bg-1 text-[11px] font-mono text-fg-3"> <span class="text-fg-2">LIMIT</span> to narrow.</div>'),Sm=x("<!> <!>",1),Cm=x('<div class="flex h-full flex-col"><div class="flex flex-col border-b border-line-1 bg-bg-0" style="height: 40%;"><div class="flex items-center justify-between px-3 py-1.5 border-b border-line-1"><div class="flex items-center gap-2 text-fg-3 type-label"><span>SQL</span> <!></div> <div class="flex items-center gap-2"><span class="text-fg-3 font-mono text-[11px] hidden sm:inline">Run with <!><!></span> <button type="button" class="inline-flex items-center gap-1 rounded border border-accent/60 bg-accent/10 px-2 py-1 text-[12px] font-mono text-accent hover:bg-accent/20 disabled:opacity-50 disabled:cursor-not-allowed" aria-label="Run query"><!></button></div></div> <textarea class="flex-1 resize-none bg-bg-0 px-3 py-2 font-mono text-[13px] text-fg-1 outline-none placeholder:text-fg-3" spellcheck="false" autocapitalize="off"></textarea></div> <div class="flex-1 overflow-hidden bg-bg-0"><!></div></div>');function Em(t,e){ot(e,!0),an(()=>{Gn.ensure(e.tabId)});const r=y(()=>Gn.states[e.tabId]),a=y(()=>Gt.tabs.find(T=>T.id===e.tabId));let o=_e(void 0),s=_e(Bt(Date.now()));const i=y(()=>{var T;return(T=n(r))!=null&&T.runningStartedAt?Tp(Math.max(0,n(s)-n(r).runningStartedAt)):"0ms"});an(()=>{var $;if(!(($=n(r))!=null&&$.running))return;m(s,Date.now(),!0);const T=setInterval(()=>{m(s,Date.now(),!0)},100);return()=>clearInterval(T)});function c(T){Gn.setSql(e.tabId,T);const $=Ap(T,e.fallbackLabel),X=Gt.tabs.find(H=>H.id===e.tabId);X&&X.label!==$&&Gt.rename(e.tabId,$)}async function f(){await Gn.run(e.tabId)}function g(){Gn.cancel(e.tabId)}function p(T){(T.metaKey||T.ctrlKey)&&T.key==="Enter"&&(T.preventDefault(),f())}function b(){var T,$;return(T=n(r))!=null&&T.result?tr.pick(n(r).result.capability,n(r).result,($=n(a))==null?void 0:$.overrideCapability):null}var h=Cm(),w=d(h),M=d(w),P=d(M),V=u(d(P),2);{var O=T=>{var $=hm(),X=u(ue($),2),H=d(X,!0);l(X),L(()=>S(H,Ue.active.url)),v(T,$)},k=T=>{var $=bm();v(T,$)};B(V,T=>{Ue.connected?T(O):T(k,-1)})}l(P);var F=u(P,2),U=d(F),Q=u(d(U));Un(Q,{children:(T,$)=>{Ce();var X=_t("⌘");v(T,X)}});var se=u(Q);Un(se,{children:(T,$)=>{Ce();var X=_t("↵");v(T,X)}}),l(U);var xe=u(U,2),le=d(xe);{var te=T=>{var $=xm(),X=ue($);lr(X,{class:"size-3.5 animate-spin"}),Ce(2),v(T,$)},be=T=>{var $=mm(),X=ue($);ti(X,{class:"size-3.5"}),Ce(2),v(T,$)};B(le,T=>{var $;($=n(r))!=null&&$.running?T(te):T(be,-1)})}l(xe),l(F),l(M);var K=u(M,2);Va(K),Pe(K,"placeholder","SELECT * FROM users LIMIT 100"),sr(K,T=>m(o,T),()=>n(o)),l(w);var C=u(w,2),N=d(C);{var _=T=>{var $=_m(),X=d($),H=d(X),W=d(H),Y=d(W),ae=d(Y);lr(ae,{class:"size-4 animate-spin text-accent"}),Ce(2),l(Y);var ge=u(Y,2),ie=u(d(ge)),ee=d(ie,!0);l(ie),l(ge),l(W);var q=u(W,2),G=d(q);Rn(G,{class:"size-3.5"}),Ce(2),l(q),l(H);var E=u(H,2),j=d(E),R=d(j,!0);l(j),l(E),l(X),l($),L(A=>{S(ee,n(i)),S(R,A)},[()=>n(r).sql.trim()]),we("click",q,g),v(T,$)},z=T=>{var $=ym(),X=u(d($),2),H=d(X,!0);l(X),l($),L(()=>S(H,n(r).error)),v(T,$)},I=T=>{var $=wm();v(T,$)},D=T=>{const $=y(b);var X=Sm(),H=ue(X);{var W=ge=>{var ie=km(),ee=d(ie);Ce(2),l(ie),L(q=>S(ee,`Streamed first ${q??""} rows — more remain on the server. Add a `),[()=>n(r).result.record_count.toLocaleString()]),v(ge,ie)};B(H,ge=>{n(r).result.truncated&&ge(W)})}var Y=u(H,2);{var ae=ge=>{const ie=y(()=>n($).component);var ee=De(),q=ue(ee);{let G=y(()=>{var E;return((E=n(a))==null?void 0:E.showSystemColumns)??!1});Wr(q,()=>n(ie),(E,j)=>{j(E,{get result(){return n(r).result},get showSystem(){return n(G)}})})}v(ge,ee)};B(Y,ge=>{n($)&&ge(ae)})}v(T,X)};B(N,T=>{var $,X,H;($=n(r))!=null&&$.running?T(_):(X=n(r))!=null&&X.error?T(z,1):(H=n(r))!=null&&H.result?T(D,-1):T(I,2)})}l(C),l(h),L(()=>{var T,$;xe.disabled=((T=n(r))==null?void 0:T.running)||!Ue.connected,Jn(K,(($=n(r))==null?void 0:$.sql)??"")}),we("click",xe,f),we("input",K,T=>c(T.currentTarget.value)),we("keydown",K,p),v(t,h),it()}tn(["click","input","keydown"]);var Nm=x('<div class="px-3 py-2 flex items-center gap-2 text-fg-3"><!> <span class="type-label">Results</span></div>'),Mm=x('<a><span class="truncate max-w-[180px]"> </span> <span class="opacity-60 group-hover:opacity-100 hover:bg-bg-2 rounded p-0.5" role="button" tabindex="-1" aria-label="Close tab"><!></span></a>'),zm=x('<button type="button"><span class="truncate max-w-[180px]"> </span> <span class="opacity-60 group-hover:opacity-100 hover:bg-bg-2 rounded p-0.5" role="button" tabindex="-1" aria-label="Close tab"><!></span></button>'),Tm=x('<div class="flex items-stretch overflow-x-auto"></div>'),Pm=x('<button type="button"><!> <span>history</span></button>'),Am=x('<button type="button"><!> <span>meta</span></button> <!>',1),Lm=x("<option> </option>"),Im=x('<div class="ml-auto flex items-center gap-2 px-2 text-[11px] font-mono text-fg-3"><!> <button type="button"><!> <span>sys</span></button> <span> </span> <span class="text-fg-3">· override:</span> <select class="bg-bg-1 text-fg-1 border border-line-1 rounded px-1 py-0.5" aria-label="Renderer override"></select></div>'),Om=x('<div role="menu" class="absolute right-0 top-full mt-1 z-10 min-w-[220px] rounded border border-line-1 bg-bg-1 shadow-lg p-1 text-[12px] font-mono"><button type="button" class="w-full text-left px-2 py-1 rounded hover:bg-bg-2 text-fg-1 flex items-center gap-2"><!> <span class="flex-1">New query</span> <span class="text-fg-3 text-[10px]">⌘T</span></button> <button type="button" class="w-full text-left px-2 py-1 rounded hover:bg-bg-2 text-fg-1">Live changes (global)</button></div>'),Rm=x('<div class="text-center text-fg-3 text-[12px] font-mono">Connected to <span class="text-fg-1"> </span>. <br/> Pick a collection from the left to open a tab.</div>'),Dm=x(`<div class="text-center max-w-md"><!> <h2 class="type-h2 m-0 mb-2">Workspace</h2> <p class="text-fg-2 text-[13px] m-0">Connect to a reddb instance from the topbar to start browsing
|
|
1106
|
-
collections and running queries.</p></div>`),$m=x('<div class="h-full grid place-items-center p-6"><!></div>'),Vm=x('<div class="h-full grid place-items-center text-fg-3 text-[12px] font-mono">Workspace</div>'),Hm=x('<div class="p-4 text-[12px] font-mono text-warn"><div class="font-semibold mb-1">Query failed</div> <pre class="whitespace-pre-wrap"> </pre></div>'),Fm=x('<div class="px-2 py-2"><div class="h-3 rounded bg-bg-2 motion-safe:animate-pulse"></div></div>'),qm=x('<div class="px-2 py-2"><div class="h-3 rounded bg-bg-2 motion-safe:animate-pulse"></div></div>'),Km=x('<div class="grid h-[29px] grid-cols-[40px_repeat(6,minmax(96px,1fr))] border-b border-line-1/60"><div class="px-2 py-2"><div class="ml-auto h-3 w-4 rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <!></div>'),jm=x('<div class="h-full flex flex-col" aria-busy="true"><div class="border-b border-line-1 bg-bg-1/35 px-3 py-2"><div class="flex flex-wrap items-center gap-x-4 gap-y-2"><div class="min-w-[180px] flex-1"><div class="flex items-center gap-2"><div class="h-[21px] w-[78px] rounded border border-line-1 bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-4 w-44 max-w-[45vw] rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <div class="mt-1 flex flex-wrap gap-1"><div class="h-[21px] w-24 rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[21px] w-32 rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[21px] w-20 rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div></div></div> <div class="flex flex-wrap items-center gap-2"><div class="h-[30px] w-[94px] rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[30px] w-[92px] rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[30px] w-[92px] rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[30px] w-[78px] rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div> <div class="h-[30px] w-[78px] rounded border border-line-1 bg-bg-0/70 motion-safe:animate-pulse"></div></div></div></div> <div class="border-b border-line-1 px-3 py-1.5 flex items-center gap-2 bg-bg-1/40"><div class="h-6 w-[70px] rounded border border-line-1 bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-6 w-[54px] rounded border border-line-1 bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-4 w-px bg-line-1"></div> <div class="h-6 w-[76px] rounded border border-line-1 bg-bg-2 motion-safe:animate-pulse"></div> <div class="ml-auto h-3 w-[58px] rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <div class="flex-1 overflow-hidden"><div class="min-w-[760px]"><div class="grid h-8 grid-cols-[40px_repeat(6,minmax(96px,1fr))] border-b border-line-1 bg-bg-1"><div class="px-2 py-2"><div class="ml-auto h-3 w-4 rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <!></div> <!></div></div> <div class="border-t border-line-1 px-3 py-1.5 flex items-center gap-3"><div class="h-3 w-28 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-3 w-44 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-3 w-20 rounded bg-bg-2 motion-safe:animate-pulse"></div></div></div>'),Bm=x('<div class="flex items-center gap-2 text-[11px] font-mono text-fg-3"><!> <span>Catalog metadata unavailable.</span> <span class="truncate"> </span></div>'),Wm=x('<div class="flex items-center gap-2 text-[11px] font-mono text-fg-3"><!> <span>Loading collection catalog…</span></div>'),Um=x('<span class="rounded border border-line-1 bg-bg-0/70 px-1.5 py-0.5 font-mono text-[10px] text-fg-2"> </span>'),Gm=x('<span class="font-mono text-[10px] text-fg-3">No type-specific catalog fields.</span>'),Ym=x('<div class="flex flex-wrap items-center gap-x-4 gap-y-2"><div class="min-w-[180px] flex-1"><div class="flex items-center gap-2"><span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-[0.08em] text-accent"> </span> <span class="truncate font-mono text-[12px] text-fg-0"> </span></div> <div class="mt-1 flex flex-wrap gap-1"><!> <!></div></div> <div class="flex flex-wrap items-center gap-2 font-mono text-[11px]"><div class="inline-flex min-w-[94px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">entities</span></div> <div class="inline-flex min-w-[92px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">disk</span></div> <div class="inline-flex min-w-[92px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">mem</span></div> <div class="inline-flex min-w-[78px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">seg</span></div> <div class="inline-flex min-w-[78px] items-center gap-1.5 rounded border border-line-1 bg-bg-0/70 px-2 py-1"><!> <span class="text-fg-0"> </span> <span class="text-fg-3">idx</span></div></div></div>'),Xm=x('<div class="flex items-start gap-2 text-fg-3"><!> <div><div class="text-warn">Collection metadata unavailable.</div> <div class="mt-0.5 break-words"> </div></div></div>'),Zm=x('<div class="text-fg-3">Loading metadata…</div>'),Qm=x('<span class="rounded border border-accent/30 bg-accent/10 px-1.5 py-0.5 text-accent"> </span>'),Jm=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2"> </span>'),e_=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2"> </span>'),t_=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-fg-2">retention</span>'),n_=x("<span> </span>"),r_=x('<div class="mt-1 flex flex-wrap gap-1"></div>'),a_=x('<div class="mt-1 text-fg-3">Action grants not exposed.</div>'),o_=x('<div class="grid grid-cols-[minmax(160px,0.8fr)_1.2fr] gap-3"><div class="grid grid-cols-[78px_1fr] gap-x-2 gap-y-1"><span class="text-fg-3">name</span> <span class="text-fg-0 truncate"> </span> <span class="text-fg-3">kind</span> <span class="text-accent"> </span> <span class="text-fg-3">tenant</span> <span class="text-fg-1"> </span> <span class="text-fg-3">indexes</span> <span class="text-fg-1"> </span></div> <div class="grid gap-1"><div class="flex flex-wrap gap-1"><!> <!> <!> <!></div> <!></div></div>'),i_=x('<div class="border-b border-line-1 bg-bg-1/30 px-3 py-2 text-[11px] font-mono"><!></div>'),s_=x('<div class="h-[320px] min-h-[240px] border-b border-line-1"><!></div>'),l_=x('<div class="h-full flex flex-col"><div class="border-b border-line-1 bg-bg-1/35 px-3 py-2"><!></div> <!> <!> <div class="flex-1 min-h-0"><!></div></div>'),c_=x('<div class="h-full flex flex-col"><div class="border-b border-line-1 flex items-stretch min-h-[36px] bg-bg-0"><!> <!> <div><button type="button" class="px-2 inline-flex items-center text-fg-3 hover:text-fg-1" aria-label="Open tab menu"><!></button> <!></div></div> <div class="flex-1 overflow-hidden bg-bg-0"><!></div></div>');function d_(t,e){ot(e,!0);const r=ya(),a=[{value:"",label:"Auto"},{value:"table",label:"Table"},{value:"graph",label:"Graph"},{value:"hypertable",label:"Chart"},{value:"kv",label:"KV"},{value:"vector",label:"Vector"},{value:"queue",label:"Queue"},{value:"stats",label:"Stats"},{value:"diff",label:"Diff"},{value:"document",label:"Document"},{value:"json",label:"JSON"}],o=Array.from({length:14},(R,A)=>A),s=Array.from({length:6},(R,A)=>A);let i=Bt({}),c=Bt({}),f=Bt({}),g=Bt({}),p=Bt({}),b=Bt({}),h=Bt({}),w=_e(Bt({})),M=_e(null),P=null,V=_e(!1),O=_e(!1);an(()=>{const R=Gt.activeId;R!==P&&(m(M,P,!0),P=R)});async function k(R,A){const[pe,Ee]=await Promise.all([Ct.track(`${A} · edges (LIMIT 50000)`,()=>R.query(`SELECT * FROM ${A} WHERE from_rid IS NOT NULL LIMIT 50000`)),Ct.track(`${A} · centrality (LIMIT 100)`,()=>R.query("GRAPH CENTRALITY LIMIT 100")).catch(()=>null)]),Se=new Map;Ee!=null&&Ee.ok&&Ee.result.records.forEach((ke,Te)=>{const ze=ke.values.node_id??ke.values.rid??ke.values.id,Ne=ke.values.score??ke.values.centrality_score??ke.values.centrality,Me=typeof ze=="number"?ze:typeof ze=="string"?Number(ze):NaN,Xe=typeof Ne=="number"?Ne:typeof Ne=="string"?Number(Ne):NaN;!Number.isFinite(Me)||!Number.isFinite(Xe)||Se.set(Me,{score:Xe,rank:Te+1,label:typeof ke.values.label=="string"?ke.values.label:void 0})});const ve=new Set;for(const ke of pe.result.records){const Te=ke.values.from_rid,ze=ke.values.to_rid;typeof Te=="number"&&ve.add(Te),typeof ze=="number"&&ve.add(ze)}for(const ke of Se.keys())ve.add(ke);const ce=[...ve],Oe=Math.ceil(ce.length/5),re=[];for(let ke=0;ke<ce.length;ke+=5)re.push({idx:Math.floor(ke/5)+1,ids:ce.slice(ke,ke+5).join(",")});const de=[];let he=pe,Ie=0;async function Ae(){for(;Ie<re.length;){const ke=re[Ie++],Te=await Ct.track(`${A} · nodes ${ke.idx}/${Oe}`,()=>R.query(`SELECT * FROM ${A} WHERE rid IN (${ke.ids})`));de.push(...Te.result.records.map(ze=>{const Ne=ze.values.rid,Me=typeof Ne=="number"?Se.get(Ne):void 0;return Me?{...ze,values:{...ze.values,centrality_score:Me.score,centrality_rank:Me.rank,centrality_label:Me.label}}:ze})),he=Te}}return await Promise.all(Array.from({length:8},Ae)),{...he,record_count:de.length+pe.result.records.length,result:{...he.result,records:[...de,...pe.result.records]}}}function F(R){return`'${R.replace(/'/g,"''")}'`}async function U(R,A){const Z=await R.query(Ip(A)),J=Rp(Z.result.records[0]);if(!J)throw new Error(`${A} was not found in red.collections`);return J}async function Q(R,A){var Z;try{const oe=(Z=(await R.query(`SELECT model FROM red.collections WHERE name = ${F(A)} LIMIT 1`)).result.records[0])==null?void 0:Z.values.model;return typeof oe=="string"?oe:null}catch{return null}}async function se(R,A){const Z=Zi(A),J=await Q(R,A);if(J==="hll")return R.query(`HLL INFO ${Z}`);if(J==="sketch")return R.query(`SKETCH INFO ${Z}`);if(J==="filter")return R.query(`FILTER INFO ${Z}`);if(J==="mixed")for(const oe of[`HLL INFO ${Z}`,`SKETCH INFO ${Z}`,`FILTER INFO ${Z}`])try{return await R.query(oe)}catch{}try{return await R.query(`SELECT * FROM ${Z} LIMIT 200`)}catch{for(const oe of[`HLL INFO ${Z}`,`SKETCH INFO ${Z}`,`FILTER INFO ${Z}`])try{return await R.query(oe)}catch{}throw new Error(`No stats read form worked for ${A}`)}}async function xe(R,A){const Z=Zi(A),J=await R.query(`SELECT * FROM ${Z} LIMIT 200`);return{...J,capability:J.capability??"vector"}}an(()=>{if(_n.locked)return;const R=Ue.client;if(R)for(const A of Gt.tabs){if(A.kind!=="collection")continue;const Z=A.subpage??Pa(A.capability),J=Z==="graph"||Z==="svg",oe=Z==="queue"||A.capability==="queue",me=Z==="vector"||A.capability==="vector",pe=Z==="stats"||A.capability==="stats",Ee=Z==="kv"||A.capability==="kv",Se=J?"graph-subgraph":oe?"queue-peek":me?"vector-inspector":pe?"stats-info":Ee?"kv-list":A.capability??"unknown",ve=`${A.key}:${Z}:${Se}`;if(f[A.id]&&f[A.id]!==ve&&(delete i[A.id],delete c[A.id]),i[A.id]!==void 0||c[A.id])continue;i[A.id]=null,f[A.id]=ve;const ce=A.key;(J?k(R,ce):oe?Ct.track(`${ce} · QUEUE PEEK (LIMIT 200)`,()=>R.query(`QUEUE PEEK ${ce} 200`)):me?Ct.track(`${ce} · vector inspector seed`,()=>xe(R,ce)):pe?Ct.track(`${ce} · stats preview`,()=>se(R,ce)):Ee?Ct.track(`${ce} · LIST KV (LIMIT 200)`,()=>R.query(fl(ce,"kv"))):Ct.track(`${ce} · SELECT * (LIMIT 200)`,()=>R.query(fl(ce,A.capability)))).then(re=>{i[A.id]=re}).catch(re=>{c[A.id]=re.message})}}),an(()=>{if(_n.locked)return;const R=Ue.client;if(R)for(const A of Gt.tabs)A.kind==="collection"&&(g[A.id]!==void 0||p[A.id]||(g[A.id]=null,Ct.track(`catalog · ${A.key}`,()=>U(R,A.key)).then(Z=>{g[A.id]=Z}).catch(Z=>{p[A.id]=Z.message})))}),an(()=>{if(!n(O)||_n.locked)return;const R=Ue.client;if(R)for(const A of Gt.tabs)A.kind==="collection"&&(b[A.id]!==void 0||h[A.id]||(b[A.id]=null,Ct.track(`metadata · ${A.key}`,()=>R.collection(A.key)).then(Z=>{b[A.id]=Z}).catch(Z=>{h[A.id]=Z.message})))});function le(R,A){R.stopPropagation();const Z=Gt.tabs.find(oe=>oe.id===A);if((Z==null?void 0:Z.kind)==="query"&&Gn.isDirty(A)&&!(typeof window<"u"?window.confirm("Discard unsaved query in this tab?"):!0))return;const J=(Z==null?void 0:Z.kind)==="collection"&&Z.key===r.collection;if(Gt.close(A,n(M)),Gn.remove(A),delete i[A],delete c[A],delete f[A],delete g[A],delete p[A],delete b[A],delete h[A],delete n(w)[A],J){const oe=Gt.tabs.find(me=>me.kind==="collection");r.go(oe?{view:"collection",collection:oe.key,subpage:oe.subpage??Pa(oe.capability)}:{view:"collections"},void 0,!0)}}function te(){const R=Gn.nextLabel(),A=Gt.open({kind:"query",label:R,key:R},!0);Gn.ensure(A.id),m(V,!1)}Fr(()=>{const R=()=>te();return window.addEventListener("red:new-query",R),()=>window.removeEventListener("red:new-query",R)});function be(R,A){const Z=af(R.subpage,R.capability??A.capability);return tr.pick(Z,A,R.overrideCapability)}function K(){Gt.open({kind:"live-changes",label:"live · global",key:"global"}),m(V,!1)}function C(R,A){const Z=A.currentTarget.value;Gt.setOverride(R.id,Z===""?void 0:Z)}function N(R,A){return R.subpage?R.subpage:R.capability?R.capability:A!=null&&A.capability?A.capability:"auto"}function _(R){return typeof R=="boolean"?{allowed:R}:{allowed:R.allowed,reason:R.reason}}function z(R){return R&&typeof R=="object"&&!Array.isArray(R)?Object.keys(R):[]}var I=c_(),D=d(I),T=d(D);{var $=R=>{var A=Nm(),Z=d(A);Ha(Z,{class:"size-3.5"}),Ce(2),l(A),v(R,A)},X=R=>{var A=Tm();Qe(A,21,()=>Gt.tabs,Z=>Z.id,(Z,J)=>{const oe=y(()=>n(J).id===Gt.activeId),me=y(()=>["group flex items-center gap-2 px-3 py-1.5 text-[12px] font-mono border-r border-line-1 whitespace-nowrap no-underline",n(oe)?"bg-bg-1 text-fg-1 border-b-2 border-b-accent -mb-px":"text-fg-3 hover:text-fg-1 hover:bg-bg-1/40"].join(" "));var pe=De(),Ee=ue(pe);{var Se=ce=>{const Oe=y(()=>({view:"collection",collection:n(J).key,subpage:n(J).subpage??Pa(n(J).capability)}));var re=Mm(),de=d(re),he=d(de,!0);l(de);var Ie=u(de,2),Ae=d(Ie);Rn(Ae,{class:"size-3"}),l(Ie),l(re),L(ke=>{Pe(re,"href",ke),Ve(re,1,Ke(n(me))),Pe(re,"title",n(J).label),S(he,n(J).label)},[()=>r.href(n(Oe))]),we("click",re,ke=>r.go(n(Oe),ke)),we("click",Ie,ke=>le(ke,n(J).id)),we("keydown",Ie,ke=>{ke.key==="Enter"&&le(ke,n(J).id)}),v(ce,re)},ve=ce=>{var Oe=zm(),re=d(Oe),de=d(re,!0);l(re);var he=u(re,2),Ie=d(he);Rn(Ie,{class:"size-3"}),l(he),l(Oe),L(()=>{Ve(Oe,1,Ke(n(me))),Pe(Oe,"title",n(J).label),S(de,n(J).label)}),we("click",Oe,()=>Gt.focus(n(J).id)),we("click",he,Ae=>le(Ae,n(J).id)),we("keydown",he,Ae=>{Ae.key==="Enter"&&le(Ae,n(J).id)}),v(ce,Oe)};B(Ee,ce=>{n(J).kind==="collection"?ce(Se):ce(ve,-1)})}v(Z,pe)}),l(A),v(R,A)};B(T,R=>{Gt.tabs.length===0?R($):R(X,-1)})}var H=u(T,2);{var W=R=>{const A=y(()=>Gt.active),Z=y(()=>i[n(A).id]);var J=Im(),oe=d(J);{var me=he=>{var Ie=Am(),Ae=ue(Ie),ke=d(Ae);hi(ke,{class:"size-3"}),Ce(2),l(Ae);var Te=u(Ae,2);{var ze=Ne=>{var Me=Pm(),Xe=d(Me);yv(Xe,{class:"size-3"}),Ce(2),l(Me),L(Re=>{Pe(Me,"title",n(w)[n(A).id]?"Hide version history":"Show version history and diffs"),Pe(Me,"aria-pressed",n(w)[n(A).id]??!1),Ve(Me,1,Re)},[()=>Ke(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",n(w)[n(A).id]?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),we("click",Me,()=>m(w,{...n(w),[n(A).id]:!(n(w)[n(A).id]??!1)},!0)),v(Ne,Me)};B(Te,Ne=>{Ue.capabilities.vcs&&Ne(ze)})}L(Ne=>{Pe(Ae,"title",n(O)?"Hide collection metadata":"Show collection metadata"),Pe(Ae,"aria-pressed",n(O)),Ve(Ae,1,Ne)},[()=>Ke(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",n(O)?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" "))]),we("click",Ae,()=>m(O,!n(O))),v(he,Ie)};B(oe,he=>{n(A).kind==="collection"&&he(me)})}var pe=u(oe,2),Ee=d(pe);{var Se=he=>{Tc(he,{class:"size-3"})},ve=he=>{zc(he,{class:"size-3"})};B(Ee,he=>{n(A).showSystemColumns?he(Se):he(ve,-1)})}Ce(2),l(pe);var ce=u(pe,2),Oe=d(ce,!0);l(ce);var re=u(ce,4);Qe(re,21,()=>a,he=>he.value,(he,Ie)=>{var Ae=Lm(),ke=d(Ae,!0);l(Ae);var Te={};L(()=>{S(ke,n(Ie).label),Te!==(Te=n(Ie).value)&&(Ae.value=(Ae.__value=n(Ie).value)??"")}),v(he,Ae)}),l(re);var de;aa(re),l(J),L((he,Ie)=>{Pe(pe,"title",n(A).showSystemColumns?"Hide reddb system columns (rid, collection, kind, tenant, created_at, updated_at)":"Show reddb system columns"),Pe(pe,"aria-pressed",n(A).showSystemColumns??!1),Ve(pe,1,he),S(Oe,Ie),de!==(de=n(A).overrideCapability??"")&&(re.value=(re.__value=n(A).overrideCapability??"")??"",oa(re,n(A).overrideCapability??""))},[()=>Ke(["inline-flex items-center gap-1 h-6 px-1.5 rounded border transition-colors cursor-pointer",n(A).showSystemColumns?"border-accent/40 bg-accent/10 text-accent":"border-line-1 text-fg-3 hover:text-fg-1 hover:border-line-2"].join(" ")),()=>N(n(A),n(Z))]),we("click",pe,()=>Gt.setShowSystem(n(A).id,!n(A).showSystemColumns)),we("change",re,he=>C(n(A),he)),v(R,J)};B(H,R=>{Gt.active&&(Gt.active.kind==="collection"||Gt.active.kind==="query")&&R(W)})}var Y=u(H,2),ae=d(Y),ge=d(ae);Aa(ge,{class:"size-3.5"}),l(ae);var ie=u(ae,2);{var ee=R=>{var A=Om(),Z=d(A),J=d(Z);Pc(J,{class:"size-3.5 text-fg-3"}),Ce(4),l(Z);var oe=u(Z,2);l(A),we("click",Z,te),we("click",oe,K),v(R,A)};B(ie,R=>{n(V)&&R(ee)})}l(Y),l(D);var q=u(D,2),G=d(q);{var E=R=>{var A=$m(),Z=d(A);{var J=me=>{var pe=Rm(),Ee=u(d(pe)),Se=d(Ee,!0);l(Ee),Ce(3),l(pe),L(()=>S(Se,Ue.active.url)),v(me,pe)},oe=me=>{var pe=Dm(),Ee=d(pe);Oo(Ee,{class:"size-8 text-fg-3 mx-auto mb-3",strokeWidth:1.4}),Ce(4),l(pe),v(me,pe)};B(Z,me=>{Ue.connected?me(J):me(oe,-1)})}l(A),v(R,A)},j=R=>{const A=y(()=>Gt.active);var Z=De(),J=ue(Z);{var oe=Se=>{ad(Se,{collection:void 0})},me=Se=>{Em(Se,{get tabId(){return n(A).id},get fallbackLabel(){return n(A).key}})},pe=Se=>{var ve=Vm();v(Se,ve)},Ee=Se=>{const ve=y(()=>i[n(A).id]),ce=y(()=>c[n(A).id]);var Oe=De(),re=ue(Oe);{var de=Ae=>{var ke=Hm(),Te=u(d(ke),2),ze=d(Te,!0);l(Te),l(ke),L(()=>S(ze,n(ce))),v(Ae,ke)},he=Ae=>{var ke=jm(),Te=u(d(ke),4),ze=d(Te),Ne=d(ze),Me=u(d(Ne),2);Qe(Me,16,()=>s,Re=>Re,(Re,Je)=>{var dt=Fm(),ft=d(dt);l(dt),L(()=>kn(ft,`width: ${Je%3===0?72:Je%3===1?104:56}px`)),v(Re,dt)}),l(Ne);var Xe=u(Ne,2);Qe(Xe,16,()=>o,Re=>Re,(Re,Je)=>{var dt=Km(),ft=u(d(dt),2);Qe(ft,16,()=>s,qe=>qe,(qe,$e)=>{var je=qm(),at=d(je);l(je),L(()=>kn(at,`width: ${$e===0?48:64+(Je+$e)%4*18}px`)),v(qe,je)}),l(dt),v(Re,dt)}),l(ze),l(Te),Ce(2),l(ke),L(()=>Pe(ke,"aria-label",`Loading ${n(A).label} results`)),v(Ae,ke)},Ie=Ae=>{const ke=y(()=>be(n(A),n(ve))),Te=y(()=>n(ke).component),ze=y(()=>g[n(A).id]),Ne=y(()=>p[n(A).id]);var Me=l_(),Xe=d(Me),Re=d(Xe);{var Je=Ze=>{var Be=Bm(),ut=d(Be);hi(ut,{class:"size-3.5 text-warn"});var Nt=u(ut,4),Pt=d(Nt,!0);l(Nt),l(Be),L(()=>S(Pt,n(Ne))),v(Ze,Be)},dt=Ze=>{var Be=Wm(),ut=d(Be);Oo(ut,{class:"size-3.5"}),Ce(2),l(Be),v(Ze,Be)},ft=Ze=>{var Be=Ym(),ut=d(Be),Nt=d(ut),Pt=d(Nt),Mt=d(Pt,!0);l(Pt);var Et=u(Pt,2),mt=d(Et,!0);l(Et),l(Nt);var yt=u(Nt,2),kt=d(yt);Qe(kt,17,()=>gl(n(ze)),bn,(We,wt)=>{var st=Um(),vt=d(st,!0);l(st),L(()=>S(vt,n(wt))),v(We,st)});var It=u(kt,2);{var Xt=We=>{var wt=Gm();v(We,wt)},hn=y(()=>gl(n(ze)).length===0);B(It,We=>{n(hn)&&We(Xt)})}l(yt),l(ut);var xn=u(ut,2),rt=d(xn),ct=d(rt);Yi(ct,{class:"size-3.5 text-fg-3"});var Lt=u(ct,2),Ft=d(Lt,!0);l(Lt),Ce(2),l(rt);var on=u(rt,2),sn=d(on);kv(sn,{class:"size-3.5 text-fg-3"});var ln=u(sn,2),Sn=d(ln,!0);l(ln),Ce(2),l(on);var cn=u(on,2),yn=d(cn);Ha(yn,{class:"size-3.5 text-fg-3"});var Nn=u(yn,2),Pn=d(Nn,!0);l(Nn),Ce(2),l(cn);var Cn=u(cn,2),An=d(Cn);of(An,{class:"size-3.5 text-fg-3"});var ye=u(An,2),Le=d(ye,!0);l(ye),Ce(2),l(Cn);var He=u(Cn,2),Ge=d(He);Pv(Ge,{class:"size-3.5 text-fg-3"});var et=u(Ge,2),tt=d(et,!0);l(et),Ce(2),l(He),l(xn),l(Be),L((We,wt,st,vt,At)=>{S(Mt,n(ze).model??"collection"),S(mt,n(ze).name),S(Ft,We),S(Sn,wt),S(Pn,st),S(Le,vt),S(tt,At)},[()=>No(n(ze).entities),()=>vl(n(ze).onDiskBytes),()=>vl(n(ze).inMemoryBytes),()=>No(n(ze).segments),()=>No(n(ze).indices)]),v(Ze,Be)};B(Re,Ze=>{n(Ne)?Ze(Je):n(ze)?Ze(ft,-1):Ze(dt,1)})}l(Xe);var qe=u(Xe,2);{var $e=Ze=>{const Be=y(()=>b[n(A).id]),ut=y(()=>h[n(A).id]);var Nt=i_(),Pt=d(Nt);{var Mt=yt=>{var kt=Xm(),It=d(kt);hi(It,{class:"mt-0.5 size-3.5 text-warn"});var Xt=u(It,2),hn=u(d(Xt),2),xn=d(hn,!0);l(hn),l(Xt),l(kt),L(()=>S(xn,n(ut))),v(yt,kt)},Et=yt=>{var kt=Zm();v(yt,kt)},mt=yt=>{var kt=o_(),It=d(kt),Xt=u(d(It),2),hn=d(Xt,!0);l(Xt);var xn=u(Xt,4),rt=d(xn,!0);l(xn);var ct=u(xn,4),Lt=d(ct,!0);l(ct);var Ft=u(ct,4),on=d(Ft,!0);l(Ft),l(It);var sn=u(It,2),ln=d(sn),Sn=d(ln);{var cn=We=>{var wt=Qm(),st=d(wt,!0);l(wt),L(()=>S(st,n(Be).capability)),v(We,wt)};B(Sn,We=>{n(Be).capability&&We(cn)})}var yn=u(Sn,2);Qe(yn,17,()=>n(Be).capabilities??[],bn,(We,wt)=>{var st=Jm(),vt=d(st,!0);l(st),L(()=>S(vt,n(wt))),v(We,st)});var Nn=u(yn,2);{var Pn=We=>{var wt=e_(),st=d(wt);l(wt),L(vt=>S(st,`schema ${vt??""}`),[()=>z(n(Be).schema).length]),v(We,wt)},Cn=y(()=>z(n(Be).schema).length>0);B(Nn,We=>{n(Cn)&&We(Pn)})}var An=u(Nn,2);{var ye=We=>{var wt=t_();v(We,wt)},Le=y(()=>z(n(Be).retention).length>0);B(An,We=>{n(Le)&&We(ye)})}l(ln);var He=u(ln,2);{var Ge=We=>{var wt=r_();Qe(wt,21,()=>Object.entries(n(Be).actions),bn,(st,vt)=>{var At=y(()=>er(n(vt),2));let Ot=()=>n(At)[0],Jt=()=>n(At)[1];const fn=y(()=>_(Jt()));var $t=n_(),Rt=d($t);l($t),L(Wt=>{Ve($t,1,Wt),Pe($t,"title",n(fn).reason),S(Rt,`${Ot()??""}: ${n(fn).allowed?"allow":"deny"}`)},[()=>Ke(["rounded border px-1.5 py-0.5",n(fn).allowed?"border-ok/30 bg-ok/10 text-ok":"border-danger/30 bg-danger/10 text-danger"].join(" "))]),v(st,$t)}),l(wt),v(We,wt)},et=y(()=>n(Be).actions&&z(n(Be).actions).length>0),tt=We=>{var wt=a_();v(We,wt)};B(He,We=>{n(et)?We(Ge):We(tt,-1)})}l(sn),l(kt),L(()=>{var We;S(hn,n(Be).name??n(A).key),S(rt,n(Be).kind??n(Be).capability??n(A).capability??"unknown"),S(Lt,n(Be).tenant??"not exposed"),S(on,((We=n(Be).indexes)==null?void 0:We.length)??0)}),v(yt,kt)};B(Pt,yt=>{n(ut)?yt(Mt):n(Be)?yt(mt,-1):yt(Et,1)})}l(Nt),v(Ze,Nt)};B(qe,Ze=>{n(O)&&Ze($e)})}var je=u(qe,2);{var at=Ze=>{var Be=s_(),ut=d(Be);{let Nt=y(()=>Ue.client??void 0);pm(ut,{get client(){return n(Nt)},get collection(){return n(A).key}})}l(Be),v(Ze,Be)};B(je,Ze=>{n(w)[n(A).id]&&Ze(at)})}var ne=u(je,2),nt=d(ne);{let Ze=y(()=>n(A).kind==="collection"?n(A).key:void 0),Be=y(()=>Ue.client??void 0),ut=y(()=>n(A).kind==="collection"?n(A).subpage:void 0),Nt=y(()=>n(A).showSystemColumns??!1);Wr(nt,()=>n(Te),(Pt,Mt)=>{Mt(Pt,{get result(){return n(ve)},get collection(){return n(Ze)},get client(){return n(Be)},get subpage(){return n(ut)},get showSystem(){return n(Nt)}})})}l(ne),l(Me),v(Ae,Me)};B(re,Ae=>{n(ce)?Ae(de):n(ve)?Ae(Ie,-1):Ae(he,1)})}v(Se,Oe)};B(J,Se=>{n(A).kind==="live-changes"?Se(oe):n(A).kind==="query"?Se(me,1):n(A).kind==="welcome"?Se(pe,2):Se(Ee,-1)})}v(R,Z)};B(G,R=>{Gt.active?R(j,-1):R(E)})}l(q),l(I),L(()=>Ve(Y,1,`relative ${Gt.active&&(Gt.active.kind==="collection"||Gt.active.kind==="query")?"":"ml-auto"} flex items-stretch`)),we("click",ae,()=>m(V,!n(V))),v(t,I),it()}tn(["click","keydown","change"]);var u_=x('<div class="h-full grid grid-cols-[260px_1fr] bg-bg-0 text-fg-1"><aside class="row-start-1 col-start-1 border-r border-line-1 bg-bg-0 overflow-y-auto"><!></aside> <section class="row-start-1 col-start-2 bg-bg-0 overflow-hidden"><!></section></div>');function f_(t){var e=u_(),r=d(e),a=d(r);Sp(a,{}),l(r);var o=u(r,2),s=d(o);d_(s,{}),l(o),l(e),v(t,e)}var v_={value:()=>{}};function ni(){for(var t=0,e=arguments.length,r={},a;t<e;++t){if(!(a=arguments[t]+"")||a in r||/[\s.]/.test(a))throw new Error("illegal type: "+a);r[a]=[]}return new zo(r)}function zo(t){this._=t}function g_(t,e){return t.trim().split(/^|\s+/).map(function(r){var a="",o=r.indexOf(".");if(o>=0&&(a=r.slice(o+1),r=r.slice(0,o)),r&&!e.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:a}})}zo.prototype=ni.prototype={constructor:zo,on:function(t,e){var r=this._,a=g_(t+"",r),o,s=-1,i=a.length;if(arguments.length<2){for(;++s<i;)if((o=(t=a[s]).type)&&(o=p_(r[o],t.name)))return o;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<i;)if(o=(t=a[s]).type)r[o]=Cl(r[o],t.name,e);else if(e==null)for(o in r)r[o]=Cl(r[o],t.name,null);return this},copy:function(){var t={},e=this._;for(var r in e)t[r]=e[r].slice();return new zo(t)},call:function(t,e){if((o=arguments.length-2)>0)for(var r=new Array(o),a=0,o,s;a<o;++a)r[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],a=0,o=s.length;a<o;++a)s[a].value.apply(e,r)},apply:function(t,e,r){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],o=0,s=a.length;o<s;++o)a[o].value.apply(e,r)}};function p_(t,e){for(var r=0,a=t.length,o;r<a;++r)if((o=t[r]).name===e)return o.value}function Cl(t,e,r){for(var a=0,o=t.length;a<o;++a)if(t[a].name===e){t[a]=v_,t=t.slice(0,a).concat(t.slice(a+1));break}return r!=null&&t.push({name:e,value:r}),t}var rs="http://www.w3.org/1999/xhtml";const El={svg:"http://www.w3.org/2000/svg",xhtml:rs,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ri(t){var e=t+="",r=e.indexOf(":");return r>=0&&(e=t.slice(0,r))!=="xmlns"&&(t=t.slice(r+1)),El.hasOwnProperty(e)?{space:El[e],local:t}:t}function h_(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===rs&&e.documentElement.namespaceURI===rs?e.createElement(t):e.createElementNS(r,t)}}function b_(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function od(t){var e=ri(t);return(e.local?b_:h_)(e)}function x_(){}function Ns(t){return t==null?x_:function(){return this.querySelector(t)}}function m_(t){typeof t!="function"&&(t=Ns(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var s=e[o],i=s.length,c=a[o]=new Array(i),f,g,p=0;p<i;++p)(f=s[p])&&(g=t.call(f,f.__data__,p,s))&&("__data__"in f&&(g.__data__=f.__data__),c[p]=g);return new Zn(a,this._parents)}function __(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function y_(){return[]}function id(t){return t==null?y_:function(){return this.querySelectorAll(t)}}function w_(t){return function(){return __(t.apply(this,arguments))}}function k_(t){typeof t=="function"?t=w_(t):t=id(t);for(var e=this._groups,r=e.length,a=[],o=[],s=0;s<r;++s)for(var i=e[s],c=i.length,f,g=0;g<c;++g)(f=i[g])&&(a.push(t.call(f,f.__data__,g,i)),o.push(f));return new Zn(a,o)}function sd(t){return function(){return this.matches(t)}}function ld(t){return function(e){return e.matches(t)}}var S_=Array.prototype.find;function C_(t){return function(){return S_.call(this.children,t)}}function E_(){return this.firstElementChild}function N_(t){return this.select(t==null?E_:C_(typeof t=="function"?t:ld(t)))}var M_=Array.prototype.filter;function z_(){return Array.from(this.children)}function T_(t){return function(){return M_.call(this.children,t)}}function P_(t){return this.selectAll(t==null?z_:T_(typeof t=="function"?t:ld(t)))}function A_(t){typeof t!="function"&&(t=sd(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var s=e[o],i=s.length,c=a[o]=[],f,g=0;g<i;++g)(f=s[g])&&t.call(f,f.__data__,g,s)&&c.push(f);return new Zn(a,this._parents)}function cd(t){return new Array(t.length)}function L_(){return new Zn(this._enter||this._groups.map(cd),this._parents)}function Do(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Do.prototype={constructor:Do,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function I_(t){return function(){return t}}function O_(t,e,r,a,o,s){for(var i=0,c,f=e.length,g=s.length;i<g;++i)(c=e[i])?(c.__data__=s[i],a[i]=c):r[i]=new Do(t,s[i]);for(;i<f;++i)(c=e[i])&&(o[i]=c)}function R_(t,e,r,a,o,s,i){var c,f,g=new Map,p=e.length,b=s.length,h=new Array(p),w;for(c=0;c<p;++c)(f=e[c])&&(h[c]=w=i.call(f,f.__data__,c,e)+"",g.has(w)?o[c]=f:g.set(w,f));for(c=0;c<b;++c)w=i.call(t,s[c],c,s)+"",(f=g.get(w))?(a[c]=f,f.__data__=s[c],g.delete(w)):r[c]=new Do(t,s[c]);for(c=0;c<p;++c)(f=e[c])&&g.get(h[c])===f&&(o[c]=f)}function D_(t){return t.__data__}function $_(t,e){if(!arguments.length)return Array.from(this,D_);var r=e?R_:O_,a=this._parents,o=this._groups;typeof t!="function"&&(t=I_(t));for(var s=o.length,i=new Array(s),c=new Array(s),f=new Array(s),g=0;g<s;++g){var p=a[g],b=o[g],h=b.length,w=V_(t.call(p,p&&p.__data__,g,a)),M=w.length,P=c[g]=new Array(M),V=i[g]=new Array(M),O=f[g]=new Array(h);r(p,b,P,V,O,w,e);for(var k=0,F=0,U,Q;k<M;++k)if(U=P[k]){for(k>=F&&(F=k+1);!(Q=V[F])&&++F<M;);U._next=Q||null}}return i=new Zn(i,a),i._enter=c,i._exit=f,i}function V_(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function H_(){return new Zn(this._exit||this._groups.map(cd),this._parents)}function F_(t,e,r){var a=this.enter(),o=this,s=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),e!=null&&(o=e(o),o&&(o=o.selection())),r==null?s.remove():r(s),a&&o?a.merge(o).order():o}function q_(t){for(var e=t.selection?t.selection():t,r=this._groups,a=e._groups,o=r.length,s=a.length,i=Math.min(o,s),c=new Array(o),f=0;f<i;++f)for(var g=r[f],p=a[f],b=g.length,h=c[f]=new Array(b),w,M=0;M<b;++M)(w=g[M]||p[M])&&(h[M]=w);for(;f<o;++f)c[f]=r[f];return new Zn(c,this._parents)}function K_(){for(var t=this._groups,e=-1,r=t.length;++e<r;)for(var a=t[e],o=a.length-1,s=a[o],i;--o>=0;)(i=a[o])&&(s&&i.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(i,s),s=i);return this}function j_(t){t||(t=B_);function e(b,h){return b&&h?t(b.__data__,h.__data__):!b-!h}for(var r=this._groups,a=r.length,o=new Array(a),s=0;s<a;++s){for(var i=r[s],c=i.length,f=o[s]=new Array(c),g,p=0;p<c;++p)(g=i[p])&&(f[p]=g);f.sort(e)}return new Zn(o,this._parents).order()}function B_(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function W_(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function U_(){return Array.from(this)}function G_(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var a=t[e],o=0,s=a.length;o<s;++o){var i=a[o];if(i)return i}return null}function Y_(){let t=0;for(const e of this)++t;return t}function X_(){return!this.node()}function Z_(t){for(var e=this._groups,r=0,a=e.length;r<a;++r)for(var o=e[r],s=0,i=o.length,c;s<i;++s)(c=o[s])&&t.call(c,c.__data__,s,o);return this}function Q_(t){return function(){this.removeAttribute(t)}}function J_(t){return function(){this.removeAttributeNS(t.space,t.local)}}function e0(t,e){return function(){this.setAttribute(t,e)}}function t0(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function n0(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttribute(t):this.setAttribute(t,r)}}function r0(t,e){return function(){var r=e.apply(this,arguments);r==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,r)}}function a0(t,e){var r=ri(t);if(arguments.length<2){var a=this.node();return r.local?a.getAttributeNS(r.space,r.local):a.getAttribute(r)}return this.each((e==null?r.local?J_:Q_:typeof e=="function"?r.local?r0:n0:r.local?t0:e0)(r,e))}function dd(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function o0(t){return function(){this.style.removeProperty(t)}}function i0(t,e,r){return function(){this.style.setProperty(t,e,r)}}function s0(t,e,r){return function(){var a=e.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,r)}}function l0(t,e,r){return arguments.length>1?this.each((e==null?o0:typeof e=="function"?s0:i0)(t,e,r??"")):ga(this.node(),t)}function ga(t,e){return t.style.getPropertyValue(e)||dd(t).getComputedStyle(t,null).getPropertyValue(e)}function c0(t){return function(){delete this[t]}}function d0(t,e){return function(){this[t]=e}}function u0(t,e){return function(){var r=e.apply(this,arguments);r==null?delete this[t]:this[t]=r}}function f0(t,e){return arguments.length>1?this.each((e==null?c0:typeof e=="function"?u0:d0)(t,e)):this.node()[t]}function ud(t){return t.trim().split(/^|\s+/)}function Ms(t){return t.classList||new fd(t)}function fd(t){this._node=t,this._names=ud(t.getAttribute("class")||"")}fd.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function vd(t,e){for(var r=Ms(t),a=-1,o=e.length;++a<o;)r.add(e[a])}function gd(t,e){for(var r=Ms(t),a=-1,o=e.length;++a<o;)r.remove(e[a])}function v0(t){return function(){vd(this,t)}}function g0(t){return function(){gd(this,t)}}function p0(t,e){return function(){(e.apply(this,arguments)?vd:gd)(this,t)}}function h0(t,e){var r=ud(t+"");if(arguments.length<2){for(var a=Ms(this.node()),o=-1,s=r.length;++o<s;)if(!a.contains(r[o]))return!1;return!0}return this.each((typeof e=="function"?p0:e?v0:g0)(r,e))}function b0(){this.textContent=""}function x0(t){return function(){this.textContent=t}}function m0(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function _0(t){return arguments.length?this.each(t==null?b0:(typeof t=="function"?m0:x0)(t)):this.node().textContent}function y0(){this.innerHTML=""}function w0(t){return function(){this.innerHTML=t}}function k0(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function S0(t){return arguments.length?this.each(t==null?y0:(typeof t=="function"?k0:w0)(t)):this.node().innerHTML}function C0(){this.nextSibling&&this.parentNode.appendChild(this)}function E0(){return this.each(C0)}function N0(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function M0(){return this.each(N0)}function z0(t){var e=typeof t=="function"?t:od(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function T0(){return null}function P0(t,e){var r=typeof t=="function"?t:od(t),a=e==null?T0:typeof e=="function"?e:Ns(e);return this.select(function(){return this.insertBefore(r.apply(this,arguments),a.apply(this,arguments)||null)})}function A0(){var t=this.parentNode;t&&t.removeChild(this)}function L0(){return this.each(A0)}function I0(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function O0(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function R0(t){return this.select(t?O0:I0)}function D0(t){return arguments.length?this.property("__data__",t):this.node().__data__}function $0(t){return function(e){t.call(this,e,this.__data__)}}function V0(t){return t.trim().split(/^|\s+/).map(function(e){var r="",a=e.indexOf(".");return a>=0&&(r=e.slice(a+1),e=e.slice(0,a)),{type:e,name:r}})}function H0(t){return function(){var e=this.__on;if(e){for(var r=0,a=-1,o=e.length,s;r<o;++r)s=e[r],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++a]=s;++a?e.length=a:delete this.__on}}}function F0(t,e,r){return function(){var a=this.__on,o,s=$0(e);if(a){for(var i=0,c=a.length;i<c;++i)if((o=a[i]).type===t.type&&o.name===t.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=r),o.value=e;return}}this.addEventListener(t.type,s,r),o={type:t.type,name:t.name,value:e,listener:s,options:r},a?a.push(o):this.__on=[o]}}function q0(t,e,r){var a=V0(t+""),o,s=a.length,i;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,g=c.length,p;f<g;++f)for(o=0,p=c[f];o<s;++o)if((i=a[o]).type===p.type&&i.name===p.name)return p.value}return}for(c=e?F0:H0,o=0;o<s;++o)this.each(c(a[o],e,r));return this}function pd(t,e,r){var a=dd(t),o=a.CustomEvent;typeof o=="function"?o=new o(e,r):(o=a.document.createEvent("Event"),r?(o.initEvent(e,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(e,!1,!1)),t.dispatchEvent(o)}function K0(t,e){return function(){return pd(this,t,e)}}function j0(t,e){return function(){return pd(this,t,e.apply(this,arguments))}}function B0(t,e){return this.each((typeof e=="function"?j0:K0)(t,e))}function*W0(){for(var t=this._groups,e=0,r=t.length;e<r;++e)for(var a=t[e],o=0,s=a.length,i;o<s;++o)(i=a[o])&&(yield i)}var hd=[null];function Zn(t,e){this._groups=t,this._parents=e}function oo(){return new Zn([[document.documentElement]],hd)}function U0(){return this}Zn.prototype=oo.prototype={constructor:Zn,select:m_,selectAll:k_,selectChild:N_,selectChildren:P_,filter:A_,data:$_,enter:L_,exit:H_,join:F_,merge:q_,selection:U0,order:K_,sort:j_,call:W_,nodes:U_,node:G_,size:Y_,empty:X_,each:Z_,attr:a0,style:l0,property:f0,classed:h0,text:_0,html:S0,raise:E0,lower:M0,append:z0,insert:P0,remove:L0,clone:R0,datum:D0,on:q0,dispatch:B0,[Symbol.iterator]:W0};function ar(t){return typeof t=="string"?new Zn([[document.querySelector(t)]],[document.documentElement]):new Zn([[t]],hd)}function G0(t){let e;for(;e=t.sourceEvent;)t=e;return t}function dr(t,e){if(t=G0(t),e===void 0&&(e=t.currentTarget),e){var r=e.ownerSVGElement||e;if(r.createSVGPoint){var a=r.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(e.getScreenCTM().inverse()),[a.x,a.y]}if(e.getBoundingClientRect){var o=e.getBoundingClientRect();return[t.clientX-o.left-e.clientLeft,t.clientY-o.top-e.clientTop]}}return[t.pageX,t.pageY]}const Y0={passive:!1},Fa={capture:!0,passive:!1};function Ei(t){t.stopImmediatePropagation()}function la(t){t.preventDefault(),t.stopImmediatePropagation()}function bd(t){var e=t.document.documentElement,r=ar(t).on("dragstart.drag",la,Fa);"onselectstart"in e?r.on("selectstart.drag",la,Fa):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function xd(t,e){var r=t.document.documentElement,a=ar(t).on("dragstart.drag",null);e&&(a.on("click.drag",la,Fa),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in r?a.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const po=t=>()=>t;function as(t,{sourceEvent:e,subject:r,target:a,identifier:o,active:s,x:i,y:c,dx:f,dy:g,dispatch:p}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:p}})}as.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function X0(t){return!t.ctrlKey&&!t.button}function Z0(){return this.parentNode}function Q0(t,e){return e??{x:t.x,y:t.y}}function J0(){return navigator.maxTouchPoints||"ontouchstart"in this}function ey(){var t=X0,e=Z0,r=Q0,a=J0,o={},s=ni("start","drag","end"),i=0,c,f,g,p,b=0;function h(U){U.on("mousedown.drag",w).filter(a).on("touchstart.drag",V).on("touchmove.drag",O,Y0).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(U,Q){if(!(p||!t.call(this,U,Q))){var se=F(this,e.call(this,U,Q),U,Q,"mouse");se&&(ar(U.view).on("mousemove.drag",M,Fa).on("mouseup.drag",P,Fa),bd(U.view),Ei(U),g=!1,c=U.clientX,f=U.clientY,se("start",U))}}function M(U){if(la(U),!g){var Q=U.clientX-c,se=U.clientY-f;g=Q*Q+se*se>b}o.mouse("drag",U)}function P(U){ar(U.view).on("mousemove.drag mouseup.drag",null),xd(U.view,g),la(U),o.mouse("end",U)}function V(U,Q){if(t.call(this,U,Q)){var se=U.changedTouches,xe=e.call(this,U,Q),le=se.length,te,be;for(te=0;te<le;++te)(be=F(this,xe,U,Q,se[te].identifier,se[te]))&&(Ei(U),be("start",U,se[te]))}}function O(U){var Q=U.changedTouches,se=Q.length,xe,le;for(xe=0;xe<se;++xe)(le=o[Q[xe].identifier])&&(la(U),le("drag",U,Q[xe]))}function k(U){var Q=U.changedTouches,se=Q.length,xe,le;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),xe=0;xe<se;++xe)(le=o[Q[xe].identifier])&&(Ei(U),le("end",U,Q[xe]))}function F(U,Q,se,xe,le,te){var be=s.copy(),K=dr(te||se,Q),C,N,_;if((_=r.call(U,new as("beforestart",{sourceEvent:se,target:h,identifier:le,active:i,x:K[0],y:K[1],dx:0,dy:0,dispatch:be}),xe))!=null)return C=_.x-K[0]||0,N=_.y-K[1]||0,function z(I,D,T){var $=K,X;switch(I){case"start":o[le]=z,X=i++;break;case"end":delete o[le],--i;case"drag":K=dr(T||D,Q),X=i;break}be.call(I,U,new as(I,{sourceEvent:D,subject:_,target:h,identifier:le,active:X,x:K[0]+C,y:K[1]+N,dx:K[0]-$[0],dy:K[1]-$[1],dispatch:be}),xe)}}return h.filter=function(U){return arguments.length?(t=typeof U=="function"?U:po(!!U),h):t},h.container=function(U){return arguments.length?(e=typeof U=="function"?U:po(U),h):e},h.subject=function(U){return arguments.length?(r=typeof U=="function"?U:po(U),h):r},h.touchable=function(U){return arguments.length?(a=typeof U=="function"?U:po(!!U),h):a},h.on=function(){var U=s.on.apply(s,arguments);return U===s?h:U},h.clickDistance=function(U){return arguments.length?(b=(U=+U)*U,h):Math.sqrt(b)},h}function zs(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function md(t,e){var r=Object.create(t.prototype);for(var a in e)r[a]=e[a];return r}function io(){}var qa=.7,$o=1/qa,ca="\\s*([+-]?\\d+)\\s*",Ka="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ty=/^#([0-9a-f]{3,8})$/,ny=new RegExp(`^rgb\\(${ca},${ca},${ca}\\)$`),ry=new RegExp(`^rgb\\(${fr},${fr},${fr}\\)$`),ay=new RegExp(`^rgba\\(${ca},${ca},${ca},${Ka}\\)$`),oy=new RegExp(`^rgba\\(${fr},${fr},${fr},${Ka}\\)$`),iy=new RegExp(`^hsl\\(${Ka},${fr},${fr}\\)$`),sy=new RegExp(`^hsla\\(${Ka},${fr},${fr},${Ka}\\)$`),Nl={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};zs(io,qr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ml,formatHex:Ml,formatHex8:ly,formatHsl:cy,formatRgb:zl,toString:zl});function Ml(){return this.rgb().formatHex()}function ly(){return this.rgb().formatHex8()}function cy(){return _d(this).formatHsl()}function zl(){return this.rgb().formatRgb()}function qr(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=ty.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?Tl(e):r===3?new qn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?ho(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?ho(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=ny.exec(t))?new qn(e[1],e[2],e[3],1):(e=ry.exec(t))?new qn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ay.exec(t))?ho(e[1],e[2],e[3],e[4]):(e=oy.exec(t))?ho(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=iy.exec(t))?Ll(e[1],e[2]/100,e[3]/100,1):(e=sy.exec(t))?Ll(e[1],e[2]/100,e[3]/100,e[4]):Nl.hasOwnProperty(t)?Tl(Nl[t]):t==="transparent"?new qn(NaN,NaN,NaN,0):null}function Tl(t){return new qn(t>>16&255,t>>8&255,t&255,1)}function ho(t,e,r,a){return a<=0&&(t=e=r=NaN),new qn(t,e,r,a)}function dy(t){return t instanceof io||(t=qr(t)),t?(t=t.rgb(),new qn(t.r,t.g,t.b,t.opacity)):new qn}function os(t,e,r,a){return arguments.length===1?dy(t):new qn(t,e,r,a??1)}function qn(t,e,r,a){this.r=+t,this.g=+e,this.b=+r,this.opacity=+a}zs(qn,os,md(io,{brighter(t){return t=t==null?$o:Math.pow($o,t),new qn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?qa:Math.pow(qa,t),new qn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new qn(Hr(this.r),Hr(this.g),Hr(this.b),Vo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pl,formatHex:Pl,formatHex8:uy,formatRgb:Al,toString:Al}));function Pl(){return`#${$r(this.r)}${$r(this.g)}${$r(this.b)}`}function uy(){return`#${$r(this.r)}${$r(this.g)}${$r(this.b)}${$r((isNaN(this.opacity)?1:this.opacity)*255)}`}function Al(){const t=Vo(this.opacity);return`${t===1?"rgb(":"rgba("}${Hr(this.r)}, ${Hr(this.g)}, ${Hr(this.b)}${t===1?")":`, ${t})`}`}function Vo(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Hr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function $r(t){return t=Hr(t),(t<16?"0":"")+t.toString(16)}function Ll(t,e,r,a){return a<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new or(t,e,r,a)}function _d(t){if(t instanceof or)return new or(t.h,t.s,t.l,t.opacity);if(t instanceof io||(t=qr(t)),!t)return new or;if(t instanceof or)return t;t=t.rgb();var e=t.r/255,r=t.g/255,a=t.b/255,o=Math.min(e,r,a),s=Math.max(e,r,a),i=NaN,c=s-o,f=(s+o)/2;return c?(e===s?i=(r-a)/c+(r<a)*6:r===s?i=(a-e)/c+2:i=(e-r)/c+4,c/=f<.5?s+o:2-s-o,i*=60):c=f>0&&f<1?0:i,new or(i,c,f,t.opacity)}function fy(t,e,r,a){return arguments.length===1?_d(t):new or(t,e,r,a??1)}function or(t,e,r,a){this.h=+t,this.s=+e,this.l=+r,this.opacity=+a}zs(or,fy,md(io,{brighter(t){return t=t==null?$o:Math.pow($o,t),new or(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?qa:Math.pow(qa,t),new or(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*e,o=2*r-a;return new qn(Ni(t>=240?t-240:t+120,o,a),Ni(t,o,a),Ni(t<120?t+240:t-120,o,a),this.opacity)},clamp(){return new or(Il(this.h),bo(this.s),bo(this.l),Vo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Vo(this.opacity);return`${t===1?"hsl(":"hsla("}${Il(this.h)}, ${bo(this.s)*100}%, ${bo(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Il(t){return t=(t||0)%360,t<0?t+360:t}function bo(t){return Math.max(0,Math.min(1,t||0))}function Ni(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const Ts=t=>()=>t;function vy(t,e){return function(r){return t+r*e}}function gy(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(a){return Math.pow(t+a*e,r)}}function py(t){return(t=+t)==1?yd:function(e,r){return r-e?gy(e,r,t):Ts(isNaN(e)?r:e)}}function yd(t,e){var r=e-t;return r?vy(t,r):Ts(isNaN(t)?e:t)}const Ho=(function t(e){var r=py(e);function a(o,s){var i=r((o=os(o)).r,(s=os(s)).r),c=r(o.g,s.g),f=r(o.b,s.b),g=yd(o.opacity,s.opacity);return function(p){return o.r=i(p),o.g=c(p),o.b=f(p),o.opacity=g(p),o+""}}return a.gamma=t,a})(1);function hy(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,a=e.slice(),o;return function(s){for(o=0;o<r;++o)a[o]=t[o]*(1-s)+e[o]*s;return a}}function by(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function xy(t,e){var r=e?e.length:0,a=t?Math.min(r,t.length):0,o=new Array(a),s=new Array(r),i;for(i=0;i<a;++i)o[i]=Ia(t[i],e[i]);for(;i<r;++i)s[i]=e[i];return function(c){for(i=0;i<a;++i)s[i]=o[i](c);return s}}function my(t,e){var r=new Date;return t=+t,e=+e,function(a){return r.setTime(t*(1-a)+e*a),r}}function ur(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function _y(t,e){var r={},a={},o;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(o in e)o in t?r[o]=Ia(t[o],e[o]):a[o]=e[o];return function(s){for(o in r)a[o]=r[o](s);return a}}var is=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mi=new RegExp(is.source,"g");function yy(t){return function(){return t}}function wy(t){return function(e){return t(e)+""}}function wd(t,e){var r=is.lastIndex=Mi.lastIndex=0,a,o,s,i=-1,c=[],f=[];for(t=t+"",e=e+"";(a=is.exec(t))&&(o=Mi.exec(e));)(s=o.index)>r&&(s=e.slice(r,s),c[i]?c[i]+=s:c[++i]=s),(a=a[0])===(o=o[0])?c[i]?c[i]+=o:c[++i]=o:(c[++i]=null,f.push({i,x:ur(a,o)})),r=Mi.lastIndex;return r<e.length&&(s=e.slice(r),c[i]?c[i]+=s:c[++i]=s),c.length<2?f[0]?wy(f[0].x):yy(e):(e=f.length,function(g){for(var p=0,b;p<e;++p)c[(b=f[p]).i]=b.x(g);return c.join("")})}function Ia(t,e){var r=typeof e,a;return e==null||r==="boolean"?Ts(e):(r==="number"?ur:r==="string"?(a=qr(e))?(e=a,Ho):wd:e instanceof qr?Ho:e instanceof Date?my:by(e)?hy:Array.isArray(e)?xy:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?_y:ur)(t,e)}var Ol=180/Math.PI,ss={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kd(t,e,r,a,o,s){var i,c,f;return(i=Math.sqrt(t*t+e*e))&&(t/=i,e/=i),(f=t*r+e*a)&&(r-=t*f,a-=e*f),(c=Math.sqrt(r*r+a*a))&&(r/=c,a/=c,f/=c),t*a<e*r&&(t=-t,e=-e,f=-f,i=-i),{translateX:o,translateY:s,rotate:Math.atan2(e,t)*Ol,skewX:Math.atan(f)*Ol,scaleX:i,scaleY:c}}var xo;function ky(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ss:kd(e.a,e.b,e.c,e.d,e.e,e.f)}function Sy(t){return t==null||(xo||(xo=document.createElementNS("http://www.w3.org/2000/svg","g")),xo.setAttribute("transform",t),!(t=xo.transform.baseVal.consolidate()))?ss:(t=t.matrix,kd(t.a,t.b,t.c,t.d,t.e,t.f))}function Sd(t,e,r,a){function o(g){return g.length?g.pop()+" ":""}function s(g,p,b,h,w,M){if(g!==b||p!==h){var P=w.push("translate(",null,e,null,r);M.push({i:P-4,x:ur(g,b)},{i:P-2,x:ur(p,h)})}else(b||h)&&w.push("translate("+b+e+h+r)}function i(g,p,b,h){g!==p?(g-p>180?p+=360:p-g>180&&(g+=360),h.push({i:b.push(o(b)+"rotate(",null,a)-2,x:ur(g,p)})):p&&b.push(o(b)+"rotate("+p+a)}function c(g,p,b,h){g!==p?h.push({i:b.push(o(b)+"skewX(",null,a)-2,x:ur(g,p)}):p&&b.push(o(b)+"skewX("+p+a)}function f(g,p,b,h,w,M){if(g!==b||p!==h){var P=w.push(o(w)+"scale(",null,",",null,")");M.push({i:P-4,x:ur(g,b)},{i:P-2,x:ur(p,h)})}else(b!==1||h!==1)&&w.push(o(w)+"scale("+b+","+h+")")}return function(g,p){var b=[],h=[];return g=t(g),p=t(p),s(g.translateX,g.translateY,p.translateX,p.translateY,b,h),i(g.rotate,p.rotate,b,h),c(g.skewX,p.skewX,b,h),f(g.scaleX,g.scaleY,p.scaleX,p.scaleY,b,h),g=p=null,function(w){for(var M=-1,P=h.length,V;++M<P;)b[(V=h[M]).i]=V.x(w);return b.join("")}}}var Cy=Sd(ky,"px, ","px)","deg)"),Ey=Sd(Sy,", ",")",")"),Ny=1e-12;function Rl(t){return((t=Math.exp(t))+1/t)/2}function My(t){return((t=Math.exp(t))-1/t)/2}function zy(t){return((t=Math.exp(2*t))-1)/(t+1)}const To=(function t(e,r,a){function o(s,i){var c=s[0],f=s[1],g=s[2],p=i[0],b=i[1],h=i[2],w=p-c,M=b-f,P=w*w+M*M,V,O;if(P<Ny)O=Math.log(h/g)/e,V=function(xe){return[c+xe*w,f+xe*M,g*Math.exp(e*xe*O)]};else{var k=Math.sqrt(P),F=(h*h-g*g+a*P)/(2*g*r*k),U=(h*h-g*g-a*P)/(2*h*r*k),Q=Math.log(Math.sqrt(F*F+1)-F),se=Math.log(Math.sqrt(U*U+1)-U);O=(se-Q)/e,V=function(xe){var le=xe*O,te=Rl(Q),be=g/(r*k)*(te*zy(e*le+Q)-My(Q));return[c+be*w,f+be*M,g*te/Rl(e*le+Q)]}}return V.duration=O*1e3*e/Math.SQRT2,V}return o.rho=function(s){var i=Math.max(.001,+s),c=i*i,f=c*c;return t(i,c,f)},o})(Math.SQRT2,2,4);var pa=0,Ma=0,Ca=0,Cd=1e3,Fo,za,qo=0,Kr=0,ai=0,ja=typeof performance=="object"&&performance.now?performance:Date,Ed=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ps(){return Kr||(Ed(Ty),Kr=ja.now()+ai)}function Ty(){Kr=0}function Ko(){this._call=this._time=this._next=null}Ko.prototype=Nd.prototype={constructor:Ko,restart:function(t,e,r){if(typeof t!="function")throw new TypeError("callback is not a function");r=(r==null?Ps():+r)+(e==null?0:+e),!this._next&&za!==this&&(za?za._next=this:Fo=this,za=this),this._call=t,this._time=r,ls()},stop:function(){this._call&&(this._call=null,this._time=1/0,ls())}};function Nd(t,e,r){var a=new Ko;return a.restart(t,e,r),a}function Py(){Ps(),++pa;for(var t=Fo,e;t;)(e=Kr-t._time)>=0&&t._call.call(void 0,e),t=t._next;--pa}function Dl(){Kr=(qo=ja.now())+ai,pa=Ma=0;try{Py()}finally{pa=0,Ly(),Kr=0}}function Ay(){var t=ja.now(),e=t-qo;e>Cd&&(ai-=e,qo=t)}function Ly(){for(var t,e=Fo,r,a=1/0;e;)e._call?(a>e._time&&(a=e._time),t=e,e=e._next):(r=e._next,e._next=null,e=t?t._next=r:Fo=r);za=t,ls(a)}function ls(t){if(!pa){Ma&&(Ma=clearTimeout(Ma));var e=t-Kr;e>24?(t<1/0&&(Ma=setTimeout(Dl,t-ja.now()-ai)),Ca&&(Ca=clearInterval(Ca))):(Ca||(qo=ja.now(),Ca=setInterval(Ay,Cd)),pa=1,Ed(Dl))}}function $l(t,e,r){var a=new Ko;return e=e==null?0:+e,a.restart(o=>{a.stop(),t(o+e)},e,r),a}var Iy=ni("start","end","cancel","interrupt"),Oy=[],Md=0,Vl=1,cs=2,Po=3,Hl=4,ds=5,Ao=6;function oi(t,e,r,a,o,s){var i=t.__transition;if(!i)t.__transition={};else if(r in i)return;Ry(t,r,{name:e,index:a,group:o,on:Iy,tween:Oy,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Md})}function As(t,e){var r=cr(t,e);if(r.state>Md)throw new Error("too late; already scheduled");return r}function gr(t,e){var r=cr(t,e);if(r.state>Po)throw new Error("too late; already running");return r}function cr(t,e){var r=t.__transition;if(!r||!(r=r[e]))throw new Error("transition not found");return r}function Ry(t,e,r){var a=t.__transition,o;a[e]=r,r.timer=Nd(s,0,r.time);function s(g){r.state=Vl,r.timer.restart(i,r.delay,r.time),r.delay<=g&&i(g-r.delay)}function i(g){var p,b,h,w;if(r.state!==Vl)return f();for(p in a)if(w=a[p],w.name===r.name){if(w.state===Po)return $l(i);w.state===Hl?(w.state=Ao,w.timer.stop(),w.on.call("interrupt",t,t.__data__,w.index,w.group),delete a[p]):+p<e&&(w.state=Ao,w.timer.stop(),w.on.call("cancel",t,t.__data__,w.index,w.group),delete a[p])}if($l(function(){r.state===Po&&(r.state=Hl,r.timer.restart(c,r.delay,r.time),c(g))}),r.state=cs,r.on.call("start",t,t.__data__,r.index,r.group),r.state===cs){for(r.state=Po,o=new Array(h=r.tween.length),p=0,b=-1;p<h;++p)(w=r.tween[p].value.call(t,t.__data__,r.index,r.group))&&(o[++b]=w);o.length=b+1}}function c(g){for(var p=g<r.duration?r.ease.call(null,g/r.duration):(r.timer.restart(f),r.state=ds,1),b=-1,h=o.length;++b<h;)o[b].call(t,p);r.state===ds&&(r.on.call("end",t,t.__data__,r.index,r.group),f())}function f(){r.state=Ao,r.timer.stop(),delete a[e];for(var g in a)return;delete t.__transition}}function Lo(t,e){var r=t.__transition,a,o,s=!0,i;if(r){e=e==null?null:e+"";for(i in r){if((a=r[i]).name!==e){s=!1;continue}o=a.state>cs&&a.state<ds,a.state=Ao,a.timer.stop(),a.on.call(o?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete r[i]}s&&delete t.__transition}}function Dy(t){return this.each(function(){Lo(this,t)})}function $y(t,e){var r,a;return function(){var o=gr(this,t),s=o.tween;if(s!==r){a=r=s;for(var i=0,c=a.length;i<c;++i)if(a[i].name===e){a=a.slice(),a.splice(i,1);break}}o.tween=a}}function Vy(t,e,r){var a,o;if(typeof r!="function")throw new Error;return function(){var s=gr(this,t),i=s.tween;if(i!==a){o=(a=i).slice();for(var c={name:e,value:r},f=0,g=o.length;f<g;++f)if(o[f].name===e){o[f]=c;break}f===g&&o.push(c)}s.tween=o}}function Hy(t,e){var r=this._id;if(t+="",arguments.length<2){for(var a=cr(this.node(),r).tween,o=0,s=a.length,i;o<s;++o)if((i=a[o]).name===t)return i.value;return null}return this.each((e==null?$y:Vy)(r,t,e))}function Ls(t,e,r){var a=t._id;return t.each(function(){var o=gr(this,a);(o.value||(o.value={}))[e]=r.apply(this,arguments)}),function(o){return cr(o,a).value[e]}}function zd(t,e){var r;return(typeof e=="number"?ur:e instanceof qr?Ho:(r=qr(e))?(e=r,Ho):wd)(t,e)}function Fy(t){return function(){this.removeAttribute(t)}}function qy(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ky(t,e,r){var a,o=r+"",s;return function(){var i=this.getAttribute(t);return i===o?null:i===a?s:s=e(a=i,r)}}function jy(t,e,r){var a,o=r+"",s;return function(){var i=this.getAttributeNS(t.space,t.local);return i===o?null:i===a?s:s=e(a=i,r)}}function By(t,e,r){var a,o,s;return function(){var i,c=r(this),f;return c==null?void this.removeAttribute(t):(i=this.getAttribute(t),f=c+"",i===f?null:i===a&&f===o?s:(o=f,s=e(a=i,c)))}}function Wy(t,e,r){var a,o,s;return function(){var i,c=r(this),f;return c==null?void this.removeAttributeNS(t.space,t.local):(i=this.getAttributeNS(t.space,t.local),f=c+"",i===f?null:i===a&&f===o?s:(o=f,s=e(a=i,c)))}}function Uy(t,e){var r=ri(t),a=r==="transform"?Ey:zd;return this.attrTween(t,typeof e=="function"?(r.local?Wy:By)(r,a,Ls(this,"attr."+t,e)):e==null?(r.local?qy:Fy)(r):(r.local?jy:Ky)(r,a,e))}function Gy(t,e){return function(r){this.setAttribute(t,e.call(this,r))}}function Yy(t,e){return function(r){this.setAttributeNS(t.space,t.local,e.call(this,r))}}function Xy(t,e){var r,a;function o(){var s=e.apply(this,arguments);return s!==a&&(r=(a=s)&&Yy(t,s)),r}return o._value=e,o}function Zy(t,e){var r,a;function o(){var s=e.apply(this,arguments);return s!==a&&(r=(a=s)&&Gy(t,s)),r}return o._value=e,o}function Qy(t,e){var r="attr."+t;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;var a=ri(t);return this.tween(r,(a.local?Xy:Zy)(a,e))}function Jy(t,e){return function(){As(this,t).delay=+e.apply(this,arguments)}}function e2(t,e){return e=+e,function(){As(this,t).delay=e}}function t2(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Jy:e2)(e,t)):cr(this.node(),e).delay}function n2(t,e){return function(){gr(this,t).duration=+e.apply(this,arguments)}}function r2(t,e){return e=+e,function(){gr(this,t).duration=e}}function a2(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?n2:r2)(e,t)):cr(this.node(),e).duration}function o2(t,e){if(typeof e!="function")throw new Error;return function(){gr(this,t).ease=e}}function i2(t){var e=this._id;return arguments.length?this.each(o2(e,t)):cr(this.node(),e).ease}function s2(t,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;gr(this,t).ease=r}}function l2(t){if(typeof t!="function")throw new Error;return this.each(s2(this._id,t))}function c2(t){typeof t!="function"&&(t=sd(t));for(var e=this._groups,r=e.length,a=new Array(r),o=0;o<r;++o)for(var s=e[o],i=s.length,c=a[o]=[],f,g=0;g<i;++g)(f=s[g])&&t.call(f,f.__data__,g,s)&&c.push(f);return new Sr(a,this._parents,this._name,this._id)}function d2(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,r=t._groups,a=e.length,o=r.length,s=Math.min(a,o),i=new Array(a),c=0;c<s;++c)for(var f=e[c],g=r[c],p=f.length,b=i[c]=new Array(p),h,w=0;w<p;++w)(h=f[w]||g[w])&&(b[w]=h);for(;c<a;++c)i[c]=e[c];return new Sr(i,this._parents,this._name,this._id)}function u2(t){return(t+"").trim().split(/^|\s+/).every(function(e){var r=e.indexOf(".");return r>=0&&(e=e.slice(0,r)),!e||e==="start"})}function f2(t,e,r){var a,o,s=u2(e)?As:gr;return function(){var i=s(this,t),c=i.on;c!==a&&(o=(a=c).copy()).on(e,r),i.on=o}}function v2(t,e){var r=this._id;return arguments.length<2?cr(this.node(),r).on.on(t):this.each(f2(r,t,e))}function g2(t){return function(){var e=this.parentNode;for(var r in this.__transition)if(+r!==t)return;e&&e.removeChild(this)}}function p2(){return this.on("end.remove",g2(this._id))}function h2(t){var e=this._name,r=this._id;typeof t!="function"&&(t=Ns(t));for(var a=this._groups,o=a.length,s=new Array(o),i=0;i<o;++i)for(var c=a[i],f=c.length,g=s[i]=new Array(f),p,b,h=0;h<f;++h)(p=c[h])&&(b=t.call(p,p.__data__,h,c))&&("__data__"in p&&(b.__data__=p.__data__),g[h]=b,oi(g[h],e,r,h,g,cr(p,r)));return new Sr(s,this._parents,e,r)}function b2(t){var e=this._name,r=this._id;typeof t!="function"&&(t=id(t));for(var a=this._groups,o=a.length,s=[],i=[],c=0;c<o;++c)for(var f=a[c],g=f.length,p,b=0;b<g;++b)if(p=f[b]){for(var h=t.call(p,p.__data__,b,f),w,M=cr(p,r),P=0,V=h.length;P<V;++P)(w=h[P])&&oi(w,e,r,P,h,M);s.push(h),i.push(p)}return new Sr(s,i,e,r)}var x2=oo.prototype.constructor;function m2(){return new x2(this._groups,this._parents)}function _2(t,e){var r,a,o;return function(){var s=ga(this,t),i=(this.style.removeProperty(t),ga(this,t));return s===i?null:s===r&&i===a?o:o=e(r=s,a=i)}}function Td(t){return function(){this.style.removeProperty(t)}}function y2(t,e,r){var a,o=r+"",s;return function(){var i=ga(this,t);return i===o?null:i===a?s:s=e(a=i,r)}}function w2(t,e,r){var a,o,s;return function(){var i=ga(this,t),c=r(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(t),ga(this,t))),i===f?null:i===a&&f===o?s:(o=f,s=e(a=i,c))}}function k2(t,e){var r,a,o,s="style."+e,i="end."+s,c;return function(){var f=gr(this,t),g=f.on,p=f.value[s]==null?c||(c=Td(e)):void 0;(g!==r||o!==p)&&(a=(r=g).copy()).on(i,o=p),f.on=a}}function S2(t,e,r){var a=(t+="")=="transform"?Cy:zd;return e==null?this.styleTween(t,_2(t,a)).on("end.style."+t,Td(t)):typeof e=="function"?this.styleTween(t,w2(t,a,Ls(this,"style."+t,e))).each(k2(this._id,t)):this.styleTween(t,y2(t,a,e),r).on("end.style."+t,null)}function C2(t,e,r){return function(a){this.style.setProperty(t,e.call(this,a),r)}}function E2(t,e,r){var a,o;function s(){var i=e.apply(this,arguments);return i!==o&&(a=(o=i)&&C2(t,i,r)),a}return s._value=e,s}function N2(t,e,r){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(e==null)return this.tween(a,null);if(typeof e!="function")throw new Error;return this.tween(a,E2(t,e,r??""))}function M2(t){return function(){this.textContent=t}}function z2(t){return function(){var e=t(this);this.textContent=e??""}}function T2(t){return this.tween("text",typeof t=="function"?z2(Ls(this,"text",t)):M2(t==null?"":t+""))}function P2(t){return function(e){this.textContent=t.call(this,e)}}function A2(t){var e,r;function a(){var o=t.apply(this,arguments);return o!==r&&(e=(r=o)&&P2(o)),e}return a._value=t,a}function L2(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,A2(t))}function I2(){for(var t=this._name,e=this._id,r=Pd(),a=this._groups,o=a.length,s=0;s<o;++s)for(var i=a[s],c=i.length,f,g=0;g<c;++g)if(f=i[g]){var p=cr(f,e);oi(f,t,r,g,i,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Sr(a,this._parents,t,r)}function O2(){var t,e,r=this,a=r._id,o=r.size();return new Promise(function(s,i){var c={value:i},f={value:function(){--o===0&&s()}};r.each(function(){var g=gr(this,a),p=g.on;p!==t&&(e=(t=p).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(f)),g.on=e}),o===0&&s()})}var R2=0;function Sr(t,e,r,a){this._groups=t,this._parents=e,this._name=r,this._id=a}function Pd(){return++R2}var hr=oo.prototype;Sr.prototype={constructor:Sr,select:h2,selectAll:b2,selectChild:hr.selectChild,selectChildren:hr.selectChildren,filter:c2,merge:d2,selection:m2,transition:I2,call:hr.call,nodes:hr.nodes,node:hr.node,size:hr.size,empty:hr.empty,each:hr.each,on:v2,attr:Uy,attrTween:Qy,style:S2,styleTween:N2,text:T2,textTween:L2,remove:p2,tween:Hy,delay:t2,duration:a2,ease:i2,easeVarying:l2,end:O2,[Symbol.iterator]:hr[Symbol.iterator]};function D2(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var $2={time:null,delay:0,duration:250,ease:D2};function V2(t,e){for(var r;!(r=t.__transition)||!(r=r[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return r}function H2(t){var e,r;t instanceof Sr?(e=t._id,t=t._name):(e=Pd(),(r=$2).time=Ps(),t=t==null?null:t+"");for(var a=this._groups,o=a.length,s=0;s<o;++s)for(var i=a[s],c=i.length,f,g=0;g<c;++g)(f=i[g])&&oi(f,t,e,g,i,r||V2(f,e));return new Sr(a,this._parents,t,e)}oo.prototype.interrupt=Dy;oo.prototype.transition=H2;const mo=t=>()=>t;function F2(t,{sourceEvent:e,target:r,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function _r(t,e,r){this.k=t,this.x=e,this.y=r}_r.prototype={constructor:_r,scale:function(t){return t===1?this:new _r(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new _r(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ii=new _r(1,0,0);Ad.prototype=_r.prototype;function Ad(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ii;return t.__zoom}function zi(t){t.stopImmediatePropagation()}function Ea(t){t.preventDefault(),t.stopImmediatePropagation()}function q2(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function K2(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Fl(){return this.__zoom||ii}function j2(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function B2(){return navigator.maxTouchPoints||"ontouchstart"in this}function W2(t,e,r){var a=t.invertX(e[0][0])-r[0][0],o=t.invertX(e[1][0])-r[1][0],s=t.invertY(e[0][1])-r[0][1],i=t.invertY(e[1][1])-r[1][1];return t.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}function U2(){var t=q2,e=K2,r=W2,a=j2,o=B2,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],c=250,f=To,g=ni("start","zoom","end"),p,b,h,w=500,M=150,P=0,V=10;function O(_){_.property("__zoom",Fl).on("wheel.zoom",le,{passive:!1}).on("mousedown.zoom",te).on("dblclick.zoom",be).filter(o).on("touchstart.zoom",K).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}O.transform=function(_,z,I,D){var T=_.selection?_.selection():_;T.property("__zoom",Fl),_!==T?Q(_,z,I,D):T.interrupt().each(function(){se(this,arguments).event(D).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},O.scaleBy=function(_,z,I,D){O.scaleTo(_,function(){var T=this.__zoom.k,$=typeof z=="function"?z.apply(this,arguments):z;return T*$},I,D)},O.scaleTo=function(_,z,I,D){O.transform(_,function(){var T=e.apply(this,arguments),$=this.__zoom,X=I==null?U(T):typeof I=="function"?I.apply(this,arguments):I,H=$.invert(X),W=typeof z=="function"?z.apply(this,arguments):z;return r(F(k($,W),X,H),T,i)},I,D)},O.translateBy=function(_,z,I,D){O.transform(_,function(){return r(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof I=="function"?I.apply(this,arguments):I),e.apply(this,arguments),i)},null,D)},O.translateTo=function(_,z,I,D,T){O.transform(_,function(){var $=e.apply(this,arguments),X=this.__zoom,H=D==null?U($):typeof D=="function"?D.apply(this,arguments):D;return r(ii.translate(H[0],H[1]).scale(X.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof I=="function"?-I.apply(this,arguments):-I),$,i)},D,T)};function k(_,z){return z=Math.max(s[0],Math.min(s[1],z)),z===_.k?_:new _r(z,_.x,_.y)}function F(_,z,I){var D=z[0]-I[0]*_.k,T=z[1]-I[1]*_.k;return D===_.x&&T===_.y?_:new _r(_.k,D,T)}function U(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function Q(_,z,I,D){_.on("start.zoom",function(){se(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){se(this,arguments).event(D).end()}).tween("zoom",function(){var T=this,$=arguments,X=se(T,$).event(D),H=e.apply(T,$),W=I==null?U(H):typeof I=="function"?I.apply(T,$):I,Y=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),ae=T.__zoom,ge=typeof z=="function"?z.apply(T,$):z,ie=f(ae.invert(W).concat(Y/ae.k),ge.invert(W).concat(Y/ge.k));return function(ee){if(ee===1)ee=ge;else{var q=ie(ee),G=Y/q[2];ee=new _r(G,W[0]-q[0]*G,W[1]-q[1]*G)}X.zoom(null,ee)}})}function se(_,z,I){return!I&&_.__zooming||new xe(_,z)}function xe(_,z){this.that=_,this.args=z,this.active=0,this.sourceEvent=null,this.extent=e.apply(_,z),this.taps=0}xe.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,z){return this.mouse&&_!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var z=ar(this.that).datum();g.call(_,this.that,new F2(_,{sourceEvent:this.sourceEvent,target:O,transform:this.that.__zoom,dispatch:g}),z)}};function le(_,...z){if(!t.apply(this,arguments))return;var I=se(this,z).event(_),D=this.__zoom,T=Math.max(s[0],Math.min(s[1],D.k*Math.pow(2,a.apply(this,arguments)))),$=dr(_);if(I.wheel)(I.mouse[0][0]!==$[0]||I.mouse[0][1]!==$[1])&&(I.mouse[1]=D.invert(I.mouse[0]=$)),clearTimeout(I.wheel);else{if(D.k===T)return;I.mouse=[$,D.invert($)],Lo(this),I.start()}Ea(_),I.wheel=setTimeout(X,M),I.zoom("mouse",r(F(k(D,T),I.mouse[0],I.mouse[1]),I.extent,i));function X(){I.wheel=null,I.end()}}function te(_,...z){if(h||!t.apply(this,arguments))return;var I=_.currentTarget,D=se(this,z,!0).event(_),T=ar(_.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",Y,!0),$=dr(_,I),X=_.clientX,H=_.clientY;bd(_.view),zi(_),D.mouse=[$,this.__zoom.invert($)],Lo(this),D.start();function W(ae){if(Ea(ae),!D.moved){var ge=ae.clientX-X,ie=ae.clientY-H;D.moved=ge*ge+ie*ie>P}D.event(ae).zoom("mouse",r(F(D.that.__zoom,D.mouse[0]=dr(ae,I),D.mouse[1]),D.extent,i))}function Y(ae){T.on("mousemove.zoom mouseup.zoom",null),xd(ae.view,D.moved),Ea(ae),D.event(ae).end()}}function be(_,...z){if(t.apply(this,arguments)){var I=this.__zoom,D=dr(_.changedTouches?_.changedTouches[0]:_,this),T=I.invert(D),$=I.k*(_.shiftKey?.5:2),X=r(F(k(I,$),D,T),e.apply(this,z),i);Ea(_),c>0?ar(this).transition().duration(c).call(Q,X,D,_):ar(this).call(O.transform,X,D,_)}}function K(_,...z){if(t.apply(this,arguments)){var I=_.touches,D=I.length,T=se(this,z,_.changedTouches.length===D).event(_),$,X,H,W;for(zi(_),X=0;X<D;++X)H=I[X],W=dr(H,this),W=[W,this.__zoom.invert(W),H.identifier],T.touch0?!T.touch1&&T.touch0[2]!==W[2]&&(T.touch1=W,T.taps=0):(T.touch0=W,$=!0,T.taps=1+!!p);p&&(p=clearTimeout(p)),$&&(T.taps<2&&(b=W[0],p=setTimeout(function(){p=null},w)),Lo(this),T.start())}}function C(_,...z){if(this.__zooming){var I=se(this,z).event(_),D=_.changedTouches,T=D.length,$,X,H,W;for(Ea(_),$=0;$<T;++$)X=D[$],H=dr(X,this),I.touch0&&I.touch0[2]===X.identifier?I.touch0[0]=H:I.touch1&&I.touch1[2]===X.identifier&&(I.touch1[0]=H);if(X=I.that.__zoom,I.touch1){var Y=I.touch0[0],ae=I.touch0[1],ge=I.touch1[0],ie=I.touch1[1],ee=(ee=ge[0]-Y[0])*ee+(ee=ge[1]-Y[1])*ee,q=(q=ie[0]-ae[0])*q+(q=ie[1]-ae[1])*q;X=k(X,Math.sqrt(ee/q)),H=[(Y[0]+ge[0])/2,(Y[1]+ge[1])/2],W=[(ae[0]+ie[0])/2,(ae[1]+ie[1])/2]}else if(I.touch0)H=I.touch0[0],W=I.touch0[1];else return;I.zoom("touch",r(F(X,H,W),I.extent,i))}}function N(_,...z){if(this.__zooming){var I=se(this,z).event(_),D=_.changedTouches,T=D.length,$,X;for(zi(_),h&&clearTimeout(h),h=setTimeout(function(){h=null},w),$=0;$<T;++$)X=D[$],I.touch0&&I.touch0[2]===X.identifier?delete I.touch0:I.touch1&&I.touch1[2]===X.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(X=dr(X,this),Math.hypot(b[0]-X[0],b[1]-X[1])<V)){var H=ar(this).on("dblclick.zoom");H&&H.apply(this,arguments)}}}return O.wheelDelta=function(_){return arguments.length?(a=typeof _=="function"?_:mo(+_),O):a},O.filter=function(_){return arguments.length?(t=typeof _=="function"?_:mo(!!_),O):t},O.touchable=function(_){return arguments.length?(o=typeof _=="function"?_:mo(!!_),O):o},O.extent=function(_){return arguments.length?(e=typeof _=="function"?_:mo([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),O):e},O.scaleExtent=function(_){return arguments.length?(s[0]=+_[0],s[1]=+_[1],O):[s[0],s[1]]},O.translateExtent=function(_){return arguments.length?(i[0][0]=+_[0][0],i[1][0]=+_[1][0],i[0][1]=+_[0][1],i[1][1]=+_[1][1],O):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},O.constrain=function(_){return arguments.length?(r=_,O):r},O.duration=function(_){return arguments.length?(c=+_,O):c},O.interpolate=function(_){return arguments.length?(f=_,O):f},O.on=function(){var _=g.on.apply(g,arguments);return _===g?O:_},O.clickDistance=function(_){return arguments.length?(P=(_=+_)*_,O):Math.sqrt(P)},O.tapDistance=function(_){return arguments.length?(V=+_,O):V},O}const Ba={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:r,targetHandle:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?r:a}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},us=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ld=["Enter"," ","Escape"],G2={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:r})=>`Moved selected node ${t}. New position, x: ${e}, y: ${r}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ha;(function(t){t.Strict="strict",t.Loose="loose"})(ha||(ha={}));var da;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(da||(da={}));var jo;(function(t){t.Partial="partial",t.Full="full"})(jo||(jo={}));const fs={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Er;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Er||(Er={}));var Bo;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(Bo||(Bo={}));var Tt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Tt||(Tt={}));const ql={[Tt.Left]:Tt.Right,[Tt.Right]:Tt.Left,[Tt.Top]:Tt.Bottom,[Tt.Bottom]:Tt.Top};function Y2(t,e){if(!t&&!e)return!0;if(!t||!e||t.size!==e.size)return!1;if(!t.size&&!e.size)return!0;for(const r of t.keys())if(!e.has(r))return!1;return!0}function Kl(t,e,r){if(!r)return;const a=[];t.forEach((o,s)=>{e!=null&&e.has(s)||a.push(o)}),a.length&&r(a)}function X2(t){return t===null?null:t?"valid":"invalid"}const Id=t=>"id"in t&&"source"in t&&"target"in t,Z2=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Is=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),so=(t,e=[0,0])=>{const{width:r,height:a}=Yr(t),o=t.origin??e,s=r*o[0],i=a*o[1];return{x:t.position.x-s,y:t.position.y-i}},Q2=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const r=t.reduce((a,o)=>{const s=typeof o=="string";let i=!e.nodeLookup&&!s?o:void 0;e.nodeLookup&&(i=s?e.nodeLookup.get(o):Is(o)?o:e.nodeLookup.get(o.id));const c=i?Wo(i,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return li(a,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ci(r)},si=(t,e={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return t.forEach(o=>{(e.filter===void 0||e.filter(o))&&(r=li(r,Wo(o)),a=!0)}),a?ci(r):{x:0,y:0,width:0,height:0}},Os=(t,e,[r,a,o]=[0,0,1],s=!1,i=!1)=>{const c={...co(e,[r,a,o]),width:e.width/o,height:e.height/o},f=[];for(const g of t.values()){const{measured:p,selectable:b=!0,hidden:h=!1}=g;if(i&&!b||h)continue;const w=p.width??g.width??g.initialWidth??null,M=p.height??g.height??g.initialHeight??null,P=Wa(c,xa(g)),V=(w??0)*(M??0),O=s&&P>0;(!g.internals.handleBounds||O||P>=V||g.dragging)&&f.push(g)}return f},J2=(t,e)=>{const r=new Set;return t.forEach(a=>{r.add(a.id)}),e.filter(a=>r.has(a.source)||r.has(a.target))};function ew(t,e){const r=new Map,a=e!=null&&e.nodes?new Set(e.nodes.map(o=>o.id)):null;return t.forEach(o=>{o.measured.width&&o.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!o.hidden)&&(!a||a.has(o.id))&&r.set(o.id,o)}),r}async function tw({nodes:t,width:e,height:r,panZoom:a,minZoom:o,maxZoom:s},i){if(t.size===0)return Promise.resolve(!0);const c=ew(t,i),f=si(c),g=Rs(f,e,r,(i==null?void 0:i.minZoom)??o,(i==null?void 0:i.maxZoom)??s,(i==null?void 0:i.padding)??.1);return await a.setViewport(g,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)}function Od({nodeId:t,nextPosition:e,nodeLookup:r,nodeOrigin:a=[0,0],nodeExtent:o,onError:s}){const i=r.get(t),c=i.parentId?r.get(i.parentId):void 0,{x:f,y:g}=c?c.internals.positionAbsolute:{x:0,y:0},p=i.origin??a;let b=i.extent||o;if(i.extent==="parent"&&!i.expandParent)if(!c)s==null||s("005",Ba.error005());else{const w=c.measured.width,M=c.measured.height;w&&M&&(b=[[f,g],[f+w,g+M]])}else c&&ma(i.extent)&&(b=[[i.extent[0][0]+f,i.extent[0][1]+g],[i.extent[1][0]+f,i.extent[1][1]+g]]);const h=ma(b)?jr(e,b,i.measured):e;return(i.measured.width===void 0||i.measured.height===void 0)&&(s==null||s("015",Ba.error015())),{position:{x:h.x-f+(i.measured.width??0)*p[0],y:h.y-g+(i.measured.height??0)*p[1]},positionAbsolute:h}}async function nw({nodesToRemove:t=[],edgesToRemove:e=[],nodes:r,edges:a,onBeforeDelete:o}){const s=new Set(t.map(h=>h.id)),i=[];for(const h of r){if(h.deletable===!1)continue;const w=s.has(h.id),M=!w&&h.parentId&&i.find(P=>P.id===h.parentId);(w||M)&&i.push(h)}const c=new Set(e.map(h=>h.id)),f=a.filter(h=>h.deletable!==!1),p=J2(i,f);for(const h of f)c.has(h.id)&&!p.find(M=>M.id===h.id)&&p.push(h);if(!o)return{edges:p,nodes:i};const b=await o({nodes:i,edges:p});return typeof b=="boolean"?b?{edges:p,nodes:i}:{edges:[],nodes:[]}:b}const ba=(t,e=0,r=1)=>Math.min(Math.max(t,e),r),jr=(t={x:0,y:0},e,r)=>({x:ba(t.x,e[0][0],e[1][0]-((r==null?void 0:r.width)??0)),y:ba(t.y,e[0][1],e[1][1]-((r==null?void 0:r.height)??0))});function Rd(t,e,r){const{width:a,height:o}=Yr(r),{x:s,y:i}=r.internals.positionAbsolute;return jr(t,[[s,i],[s+a,i+o]],e)}const jl=(t,e,r)=>t<e?ba(Math.abs(t-e),1,e)/e:t>r?-ba(Math.abs(t-r),1,e)/e:0,Dd=(t,e,r=15,a=40)=>{const o=jl(t.x,a,e.width-a)*r,s=jl(t.y,a,e.height-a)*r;return[o,s]},li=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),vs=({x:t,y:e,width:r,height:a})=>({x:t,y:e,x2:t+r,y2:e+a}),ci=({x:t,y:e,x2:r,y2:a})=>({x:t,y:e,width:r-t,height:a-e}),xa=(t,e=[0,0])=>{var o,s;const{x:r,y:a}=Is(t)?t.internals.positionAbsolute:so(t,e);return{x:r,y:a,width:((o=t.measured)==null?void 0:o.width)??t.width??t.initialWidth??0,height:((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0}},Wo=(t,e=[0,0])=>{var o,s;const{x:r,y:a}=Is(t)?t.internals.positionAbsolute:so(t,e);return{x:r,y:a,x2:r+(((o=t.measured)==null?void 0:o.width)??t.width??t.initialWidth??0),y2:a+(((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0)}},rw=(t,e)=>ci(li(vs(t),vs(e))),Wa=(t,e)=>{const r=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),a=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(r*a)},Bl=t=>yr(t.width)&&yr(t.height)&&yr(t.x)&&yr(t.y),yr=t=>!isNaN(t)&&isFinite(t),aw=(t,e)=>{},lo=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),co=({x:t,y:e},[r,a,o],s=!1,i=[1,1])=>{const c={x:(t-r)/o,y:(e-a)/o};return s?lo(c,i):c},Uo=({x:t,y:e},[r,a,o])=>({x:t*o+r,y:e*o+a});function ta(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const r=parseFloat(t);if(!Number.isNaN(r))return Math.floor(r)}if(typeof t=="string"&&t.endsWith("%")){const r=parseFloat(t);if(!Number.isNaN(r))return Math.floor(e*r*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ow(t,e,r){if(typeof t=="string"||typeof t=="number"){const a=ta(t,r),o=ta(t,e);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof t=="object"){const a=ta(t.top??t.y??0,r),o=ta(t.bottom??t.y??0,r),s=ta(t.left??t.x??0,e),i=ta(t.right??t.x??0,e);return{top:a,right:i,bottom:o,left:s,x:s+i,y:a+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function iw(t,e,r,a,o,s){const{x:i,y:c}=Uo(t,[e,r,a]),{x:f,y:g}=Uo({x:t.x+t.width,y:t.y+t.height},[e,r,a]),p=o-f,b=s-g;return{left:Math.floor(i),top:Math.floor(c),right:Math.floor(p),bottom:Math.floor(b)}}const Rs=(t,e,r,a,o,s)=>{const i=ow(s,e,r),c=(e-i.x)/t.width,f=(r-i.y)/t.height,g=Math.min(c,f),p=ba(g,a,o),b=t.x+t.width/2,h=t.y+t.height/2,w=e/2-b*p,M=r/2-h*p,P=iw(t,w,M,p,e,r),V={left:Math.min(P.left-i.left,0),top:Math.min(P.top-i.top,0),right:Math.min(P.right-i.right,0),bottom:Math.min(P.bottom-i.bottom,0)};return{x:w-V.left+V.right,y:M-V.top+V.bottom,zoom:p}},Go=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function ma(t){return t!=null&&t!=="parent"}function Yr(t){var e,r;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((r=t.measured)==null?void 0:r.height)??t.height??t.initialHeight??0}}function sw(t){var e,r;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((r=t.measured)==null?void 0:r.height)??t.height??t.initialHeight)!==void 0}function lw(t,e={width:0,height:0},r,a,o){const s={...t},i=a.get(r);if(i){const c=i.origin||o;s.x+=i.internals.positionAbsolute.x-(e.width??0)*c[0],s.y+=i.internals.positionAbsolute.y-(e.height??0)*c[1]}return s}function cw(t){return{...G2,...t||{}}}function Ti(t,{snapGrid:e=[0,0],snapToGrid:r=!1,transform:a,containerBounds:o}){const{x:s,y:i}=ir(t),c=co({x:s-((o==null?void 0:o.left)??0),y:i-((o==null?void 0:o.top)??0)},a),{x:f,y:g}=r?lo(c,e):c;return{xSnapped:f,ySnapped:g,...c}}const $d=t=>({width:t.offsetWidth,height:t.offsetHeight}),Vd=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},dw=["INPUT","SELECT","TEXTAREA"];function Hd(t){var a,o;const e=((o=(a=t.composedPath)==null?void 0:a.call(t))==null?void 0:o[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:dw.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const Fd=t=>"clientX"in t,ir=(t,e)=>{var s,i;const r=Fd(t),a=r?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,o=r?t.clientY:(i=t.touches)==null?void 0:i[0].clientY;return{x:a-((e==null?void 0:e.left)??0),y:o-((e==null?void 0:e.top)??0)}},Wl=(t,e,r,a,o)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(i=>{const c=i.getBoundingClientRect();return{id:i.getAttribute("data-handleid"),type:t,nodeId:o,position:i.getAttribute("data-handlepos"),x:(c.left-r.left)/a,y:(c.top-r.top)/a,...$d(i)}})};function uw({sourceX:t,sourceY:e,targetX:r,targetY:a,sourceControlX:o,sourceControlY:s,targetControlX:i,targetControlY:c}){const f=t*.125+o*.375+i*.375+r*.125,g=e*.125+s*.375+c*.375+a*.125,p=Math.abs(f-t),b=Math.abs(g-e);return[f,g,p,b]}function _o(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function Ul({pos:t,x1:e,y1:r,x2:a,y2:o,c:s}){switch(t){case Tt.Left:return[e-_o(e-a,s),r];case Tt.Right:return[e+_o(a-e,s),r];case Tt.Top:return[e,r-_o(r-o,s)];case Tt.Bottom:return[e,r+_o(o-r,s)]}}function qd({sourceX:t,sourceY:e,sourcePosition:r=Tt.Bottom,targetX:a,targetY:o,targetPosition:s=Tt.Top,curvature:i=.25}){const[c,f]=Ul({pos:r,x1:t,y1:e,x2:a,y2:o,c:i}),[g,p]=Ul({pos:s,x1:a,y1:o,x2:t,y2:e,c:i}),[b,h,w,M]=uw({sourceX:t,sourceY:e,targetX:a,targetY:o,sourceControlX:c,sourceControlY:f,targetControlX:g,targetControlY:p});return[`M${t},${e} C${c},${f} ${g},${p} ${a},${o}`,b,h,w,M]}function Kd({sourceX:t,sourceY:e,targetX:r,targetY:a}){const o=Math.abs(r-t)/2,s=r<t?r+o:r-o,i=Math.abs(a-e)/2,c=a<e?a+i:a-i;return[s,c,o,i]}function fw({sourceNode:t,targetNode:e,selected:r=!1,zIndex:a=0,elevateOnSelect:o=!1,zIndexMode:s="basic"}){if(s==="manual")return a;const i=o&&r?a+1e3:a,c=Math.max(t.parentId||o&&t.selected?t.internals.z:0,e.parentId||o&&e.selected?e.internals.z:0);return i+c}function vw({sourceNode:t,targetNode:e,width:r,height:a,transform:o}){const s=li(Wo(t),Wo(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const i={x:-o[0]/o[2],y:-o[1]/o[2],width:r/o[2],height:a/o[2]};return Wa(i,ci(s))>0}const gw=({source:t,sourceHandle:e,target:r,targetHandle:a})=>`xy-edge__${t}${e||""}-${r}${a||""}`,pw=(t,e)=>e.some(r=>r.source===t.source&&r.target===t.target&&(r.sourceHandle===t.sourceHandle||!r.sourceHandle&&!t.sourceHandle)&&(r.targetHandle===t.targetHandle||!r.targetHandle&&!t.targetHandle)),hw=(t,e,r={})=>{if(!t.source||!t.target)return e;const a=r.getEdgeId||gw;let o;return Id(t)?o={...t}:o={...t,id:a(t)},pw(o,e)?e:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,e.concat(o))};function jd({sourceX:t,sourceY:e,targetX:r,targetY:a}){const[o,s,i,c]=Kd({sourceX:t,sourceY:e,targetX:r,targetY:a});return[`M ${t},${e}L ${r},${a}`,o,s,i,c]}const Gl={[Tt.Left]:{x:-1,y:0},[Tt.Right]:{x:1,y:0},[Tt.Top]:{x:0,y:-1},[Tt.Bottom]:{x:0,y:1}},bw=({source:t,sourcePosition:e=Tt.Bottom,target:r})=>e===Tt.Left||e===Tt.Right?t.x<r.x?{x:1,y:0}:{x:-1,y:0}:t.y<r.y?{x:0,y:1}:{x:0,y:-1},Yl=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function xw({source:t,sourcePosition:e=Tt.Bottom,target:r,targetPosition:a=Tt.Top,center:o,offset:s,stepPosition:i}){const c=Gl[e],f=Gl[a],g={x:t.x+c.x*s,y:t.y+c.y*s},p={x:r.x+f.x*s,y:r.y+f.y*s},b=bw({source:g,sourcePosition:e,target:p}),h=b.x!==0?"x":"y",w=b[h];let M=[],P,V;const O={x:0,y:0},k={x:0,y:0},[,,F,U]=Kd({sourceX:t.x,sourceY:t.y,targetX:r.x,targetY:r.y});if(c[h]*f[h]===-1){h==="x"?(P=o.x??g.x+(p.x-g.x)*i,V=o.y??(g.y+p.y)/2):(P=o.x??(g.x+p.x)/2,V=o.y??g.y+(p.y-g.y)*i);const le=[{x:P,y:g.y},{x:P,y:p.y}],te=[{x:g.x,y:V},{x:p.x,y:V}];c[h]===w?M=h==="x"?le:te:M=h==="x"?te:le}else{const le=[{x:g.x,y:p.y}],te=[{x:p.x,y:g.y}];if(h==="x"?M=c.x===w?te:le:M=c.y===w?le:te,e===a){const _=Math.abs(t[h]-r[h]);if(_<=s){const z=Math.min(s-1,s-_);c[h]===w?O[h]=(g[h]>t[h]?-1:1)*z:k[h]=(p[h]>r[h]?-1:1)*z}}if(e!==a){const _=h==="x"?"y":"x",z=c[h]===f[_],I=g[_]>p[_],D=g[_]<p[_];(c[h]===1&&(!z&&I||z&&D)||c[h]!==1&&(!z&&D||z&&I))&&(M=h==="x"?le:te)}const be={x:g.x+O.x,y:g.y+O.y},K={x:p.x+k.x,y:p.y+k.y},C=Math.max(Math.abs(be.x-M[0].x),Math.abs(K.x-M[0].x)),N=Math.max(Math.abs(be.y-M[0].y),Math.abs(K.y-M[0].y));C>=N?(P=(be.x+K.x)/2,V=M[0].y):(P=M[0].x,V=(be.y+K.y)/2)}const Q={x:g.x+O.x,y:g.y+O.y},se={x:p.x+k.x,y:p.y+k.y};return[[t,...Q.x!==M[0].x||Q.y!==M[0].y?[Q]:[],...M,...se.x!==M[M.length-1].x||se.y!==M[M.length-1].y?[se]:[],r],P,V,F,U]}function mw(t,e,r,a){const o=Math.min(Yl(t,e)/2,Yl(e,r)/2,a),{x:s,y:i}=e;if(t.x===s&&s===r.x||t.y===i&&i===r.y)return`L${s} ${i}`;if(t.y===i){const g=t.x<r.x?-1:1,p=t.y<r.y?1:-1;return`L ${s+o*g},${i}Q ${s},${i} ${s},${i+o*p}`}const c=t.x<r.x?1:-1,f=t.y<r.y?-1:1;return`L ${s},${i+o*f}Q ${s},${i} ${s+o*c},${i}`}function Ds({sourceX:t,sourceY:e,sourcePosition:r=Tt.Bottom,targetX:a,targetY:o,targetPosition:s=Tt.Top,borderRadius:i=5,centerX:c,centerY:f,offset:g=20,stepPosition:p=.5}){const[b,h,w,M,P]=xw({source:{x:t,y:e},sourcePosition:r,target:{x:a,y:o},targetPosition:s,center:{x:c,y:f},offset:g,stepPosition:p});let V=`M${b[0].x} ${b[0].y}`;for(let O=1;O<b.length-1;O++)V+=mw(b[O-1],b[O],b[O+1],i);return V+=`L${b[b.length-1].x} ${b[b.length-1].y}`,[V,h,w,M,P]}function Xl(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function _w(t){var b;const{sourceNode:e,targetNode:r}=t;if(!Xl(e)||!Xl(r))return null;const a=e.internals.handleBounds||Zl(e.handles),o=r.internals.handleBounds||Zl(r.handles),s=Ql((a==null?void 0:a.source)??[],t.sourceHandle),i=Ql(t.connectionMode===ha.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),t.targetHandle);if(!s||!i)return(b=t.onError)==null||b.call(t,"008",Ba.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const c=(s==null?void 0:s.position)||Tt.Bottom,f=(i==null?void 0:i.position)||Tt.Top,g=Br(e,s,c),p=Br(r,i,f);return{sourceX:g.x,sourceY:g.y,targetX:p.x,targetY:p.y,sourcePosition:c,targetPosition:f}}function Zl(t){if(!t)return null;const e=[],r=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?e.push(a):a.type==="target"&&r.push(a);return{source:e,target:r}}function Br(t,e,r=Tt.Left,a=!1){const o=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,s=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:i,height:c}=e??Yr(t);if(a)return{x:o+i/2,y:s+c/2};switch((e==null?void 0:e.position)??r){case Tt.Top:return{x:o+i/2,y:s};case Tt.Right:return{x:o+i,y:s+c/2};case Tt.Bottom:return{x:o+i/2,y:s+c};case Tt.Left:return{x:o,y:s+c/2}}}function Ql(t,e){return t&&(e?t.find(r=>r.id===e):t[0])||null}function gs(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function yw(t,{id:e,defaultColor:r,defaultMarkerStart:a,defaultMarkerEnd:o}){const s=new Set;return t.reduce((i,c)=>([c.markerStart||a,c.markerEnd||o].forEach(f=>{if(f&&typeof f=="object"){const g=gs(f,e);s.has(g)||(i.push({id:g,color:f.color||r,...f}),s.add(g))}}),i),[]).sort((i,c)=>i.id.localeCompare(c.id))}const Bd=1e3,ww=10,$s={nodeOrigin:[0,0],nodeExtent:us,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},kw={...$s,checkEquality:!0};function Vs(t,e){const r={...t};for(const a in e)e[a]!==void 0&&(r[a]=e[a]);return r}function Sw(t,e,r){const a=Vs($s,r);for(const o of t.values())if(o.parentId)Fs(o,t,e,a);else{const s=so(o,a.nodeOrigin),i=ma(o.extent)?o.extent:a.nodeExtent,c=jr(s,i,Yr(o));o.internals.positionAbsolute=c}}function Cw(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const r=[],a=[];for(const o of t.handles){const s={id:o.id,width:o.width??1,height:o.height??1,nodeId:t.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?r.push(s):o.type==="target"&&a.push(s)}return{source:r,target:a}}function Hs(t){return t==="manual"}function Ew(t,e,r,a={}){var p,b;const o=Vs(kw,a),s={i:0},i=new Map(e),c=o!=null&&o.elevateNodesOnSelect&&!Hs(o.zIndexMode)?Bd:0;let f=t.length>0,g=!1;e.clear(),r.clear();for(const h of t){let w=i.get(h.id);if(o.checkEquality&&h===(w==null?void 0:w.internals.userNode))e.set(h.id,w);else{const M=so(h,o.nodeOrigin),P=ma(h.extent)?h.extent:o.nodeExtent,V=jr(M,P,Yr(h));w={...o.defaults,...h,measured:{width:(p=h.measured)==null?void 0:p.width,height:(b=h.measured)==null?void 0:b.height},internals:{positionAbsolute:V,handleBounds:Cw(h,w),z:Wd(h,c,o.zIndexMode),userNode:h}},e.set(h.id,w)}(w.measured===void 0||w.measured.width===void 0||w.measured.height===void 0)&&!w.hidden&&(f=!1),h.parentId&&Fs(w,e,r,a,s),g||(g=h.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:g}}function Nw(t,e){if(!t.parentId)return;const r=e.get(t.parentId);r?r.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function Fs(t,e,r,a,o){const{elevateNodesOnSelect:s,nodeOrigin:i,nodeExtent:c,zIndexMode:f}=Vs($s,a),g=t.parentId,p=e.get(g);if(!p){console.warn(`Parent node ${g} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Nw(t,r),o&&!p.parentId&&p.internals.rootParentIndex===void 0&&f==="auto"&&(p.internals.rootParentIndex=++o.i,p.internals.z=p.internals.z+o.i*ww),o&&p.internals.rootParentIndex!==void 0&&(o.i=p.internals.rootParentIndex);const b=s&&!Hs(f)?Bd:0,{x:h,y:w,z:M}=Mw(t,p,i,c,b,f),{positionAbsolute:P}=t.internals,V=h!==P.x||w!==P.y;(V||M!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:V?{x:h,y:w}:P,z:M}})}function Wd(t,e,r){const a=yr(t.zIndex)?t.zIndex:0;return Hs(r)?a:a+(t.selected?e:0)}function Mw(t,e,r,a,o,s){const{x:i,y:c}=e.internals.positionAbsolute,f=Yr(t),g=so(t,r),p=ma(t.extent)?jr(g,t.extent,f):g;let b=jr({x:i+p.x,y:c+p.y},a,f);t.extent==="parent"&&(b=Rd(b,f,e));const h=Wd(t,o,s),w=e.internals.z??0;return{x:b.x,y:b.y,z:w>=h?w+1:h}}function zw(t,e,r,a=[0,0]){var i;const o=[],s=new Map;for(const c of t){const f=e.get(c.parentId);if(!f)continue;const g=((i=s.get(c.parentId))==null?void 0:i.expandedRect)??xa(f),p=rw(g,c.rect);s.set(c.parentId,{expandedRect:p,parent:f})}return s.size>0&&s.forEach(({expandedRect:c,parent:f},g)=>{var F;const p=f.internals.positionAbsolute,b=Yr(f),h=f.origin??a,w=c.x<p.x?Math.round(Math.abs(p.x-c.x)):0,M=c.y<p.y?Math.round(Math.abs(p.y-c.y)):0,P=Math.max(b.width,Math.round(c.width)),V=Math.max(b.height,Math.round(c.height)),O=(P-b.width)*h[0],k=(V-b.height)*h[1];(w>0||M>0||O||k)&&(o.push({id:g,type:"position",position:{x:f.position.x-w+O,y:f.position.y-M+k}}),(F=r.get(g))==null||F.forEach(U=>{t.some(Q=>Q.id===U.id)||o.push({id:U.id,type:"position",position:{x:U.position.x+w,y:U.position.y+M}})})),(b.width<c.width||b.height<c.height||w||M)&&o.push({id:g,type:"dimensions",setAttributes:!0,dimensions:{width:P+(w?h[0]*w-O:0),height:V+(M?h[1]*M-k:0)}})}),o}function Tw(t,e,r,a,o,s,i){const c=a==null?void 0:a.querySelector(".xyflow__viewport");let f=!1;if(!c)return{changes:[],updatedInternals:f};const g=[],p=window.getComputedStyle(c),{m22:b}=new window.DOMMatrixReadOnly(p.transform),h=[];for(const w of t.values()){const M=e.get(w.id);if(!M)continue;if(M.hidden){e.set(M.id,{...M,internals:{...M.internals,handleBounds:void 0}}),f=!0;continue}const P=$d(w.nodeElement),V=M.measured.width!==P.width||M.measured.height!==P.height;if(!!(P.width&&P.height&&(V||!M.internals.handleBounds||w.force))){const k=w.nodeElement.getBoundingClientRect(),F=ma(M.extent)?M.extent:s;let{positionAbsolute:U}=M.internals;M.parentId&&M.extent==="parent"?U=Rd(U,P,e.get(M.parentId)):F&&(U=jr(U,F,P));const Q={...M,measured:P,internals:{...M.internals,positionAbsolute:U,handleBounds:{source:Wl("source",w.nodeElement,k,b,M.id),target:Wl("target",w.nodeElement,k,b,M.id)}}};e.set(M.id,Q),M.parentId&&Fs(Q,e,r,{nodeOrigin:o,zIndexMode:i}),f=!0,V&&(g.push({id:M.id,type:"dimensions",dimensions:P}),M.expandParent&&M.parentId&&h.push({id:M.id,parentId:M.parentId,rect:xa(Q,o)}))}}if(h.length>0){const w=zw(h,e,r,o);g.push(...w)}return{changes:g,updatedInternals:f}}async function Pw({delta:t,panZoom:e,transform:r,translateExtent:a,width:o,height:s}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const i=await e.setViewportConstrained({x:r[0]+t.x,y:r[1]+t.y,zoom:r[2]},[[0,0],[o,s]],a),c=!!i&&(i.x!==r[0]||i.y!==r[1]||i.k!==r[2]);return Promise.resolve(c)}function Jl(t,e,r,a,o,s){let i=o;const c=a.get(i)||new Map;a.set(i,c.set(r,e)),i=`${o}-${t}`;const f=a.get(i)||new Map;if(a.set(i,f.set(r,e)),s){i=`${o}-${t}-${s}`;const g=a.get(i)||new Map;a.set(i,g.set(r,e))}}function Aw(t,e,r){t.clear(),e.clear();for(const a of r){const{source:o,target:s,sourceHandle:i=null,targetHandle:c=null}=a,f={edgeId:a.id,source:o,target:s,sourceHandle:i,targetHandle:c},g=`${o}-${i}--${s}-${c}`,p=`${s}-${c}--${o}-${i}`;Jl("source",f,p,t,o,i),Jl("target",f,g,t,s,c),e.set(a.id,a)}}function Ud(t,e){if(!t.parentId)return!1;const r=e.get(t.parentId);return r?r.selected?!0:Ud(r,e):!1}function ec(t,e,r){var o;let a=t;do{if((o=a==null?void 0:a.matches)!=null&&o.call(a,e))return!0;if(a===r)return!1;a=a==null?void 0:a.parentElement}while(a);return!1}function Lw(t,e,r,a){const o=new Map;for(const[s,i]of t)if((i.selected||i.id===a)&&(!i.parentId||!Ud(i,t))&&(i.draggable||e&&typeof i.draggable>"u")){const c=t.get(s);c&&o.set(s,{id:s,position:c.position||{x:0,y:0},distance:{x:r.x-c.internals.positionAbsolute.x,y:r.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return o}function Pi({nodeId:t,dragItems:e,nodeLookup:r,dragging:a=!0}){var i,c,f;const o=[];for(const[g,p]of e){const b=(i=r.get(g))==null?void 0:i.internals.userNode;b&&o.push({...b,position:p.position,dragging:a})}if(!t)return[o[0],o];const s=(c=r.get(t))==null?void 0:c.internals.userNode;return[s?{...s,position:((f=e.get(t))==null?void 0:f.position)||s.position,dragging:a}:o[0],o]}function Iw({dragItems:t,snapGrid:e,x:r,y:a}){const o=t.values().next().value;if(!o)return null;const s={x:r-o.distance.x,y:a-o.distance.y},i=lo(s,e);return{x:i.x-s.x,y:i.y-s.y}}function Ow({onNodeMouseDown:t,getStoreItems:e,onDragStart:r,onDrag:a,onDragStop:o}){let s={x:null,y:null},i=0,c=new Map,f=!1,g={x:0,y:0},p=null,b=!1,h=null,w=!1,M=!1,P=null;function V({noDragClassName:k,handleSelector:F,domNode:U,isSelectable:Q,nodeId:se,nodeClickDistance:xe=0}){h=ar(U);function le({x:C,y:N}){const{nodeLookup:_,nodeExtent:z,snapGrid:I,snapToGrid:D,nodeOrigin:T,onNodeDrag:$,onSelectionDrag:X,onError:H,updateNodePositions:W}=e();s={x:C,y:N};let Y=!1;const ae=c.size>1,ge=ae&&z?vs(si(c)):null,ie=ae&&D?Iw({dragItems:c,snapGrid:I,x:C,y:N}):null;for(const[ee,q]of c){if(!_.has(ee))continue;let G={x:C-q.distance.x,y:N-q.distance.y};D&&(G=ie?{x:Math.round(G.x+ie.x),y:Math.round(G.y+ie.y)}:lo(G,I));let E=null;if(ae&&z&&!q.extent&&ge){const{positionAbsolute:A}=q.internals,Z=A.x-ge.x+z[0][0],J=A.x+q.measured.width-ge.x2+z[1][0],oe=A.y-ge.y+z[0][1],me=A.y+q.measured.height-ge.y2+z[1][1];E=[[Z,oe],[J,me]]}const{position:j,positionAbsolute:R}=Od({nodeId:ee,nextPosition:G,nodeLookup:_,nodeExtent:E||z,nodeOrigin:T,onError:H});Y=Y||q.position.x!==j.x||q.position.y!==j.y,q.position=j,q.internals.positionAbsolute=R}if(M=M||Y,!!Y&&(W(c,!0),P&&(a||$||!se&&X))){const[ee,q]=Pi({nodeId:se,dragItems:c,nodeLookup:_});a==null||a(P,c,ee,q),$==null||$(P,ee,q),se||X==null||X(P,q)}}async function te(){if(!p)return;const{transform:C,panBy:N,autoPanSpeed:_,autoPanOnNodeDrag:z}=e();if(!z){f=!1,cancelAnimationFrame(i);return}const[I,D]=Dd(g,p,_);(I!==0||D!==0)&&(s.x=(s.x??0)-I/C[2],s.y=(s.y??0)-D/C[2],await N({x:I,y:D})&&le(s)),i=requestAnimationFrame(te)}function be(C){var ae;const{nodeLookup:N,multiSelectionActive:_,nodesDraggable:z,transform:I,snapGrid:D,snapToGrid:T,selectNodesOnDrag:$,onNodeDragStart:X,onSelectionDragStart:H,unselectNodesAndEdges:W}=e();b=!0,(!$||!Q)&&!_&&se&&((ae=N.get(se))!=null&&ae.selected||W()),Q&&$&&se&&(t==null||t(se));const Y=Ti(C.sourceEvent,{transform:I,snapGrid:D,snapToGrid:T,containerBounds:p});if(s=Y,c=Lw(N,z,Y,se),c.size>0&&(r||X||!se&&H)){const[ge,ie]=Pi({nodeId:se,dragItems:c,nodeLookup:N});r==null||r(C.sourceEvent,c,ge,ie),X==null||X(C.sourceEvent,ge,ie),se||H==null||H(C.sourceEvent,ie)}}const K=ey().clickDistance(xe).on("start",C=>{const{domNode:N,nodeDragThreshold:_,transform:z,snapGrid:I,snapToGrid:D}=e();p=(N==null?void 0:N.getBoundingClientRect())||null,w=!1,M=!1,P=C.sourceEvent,_===0&&be(C),s=Ti(C.sourceEvent,{transform:z,snapGrid:I,snapToGrid:D,containerBounds:p}),g=ir(C.sourceEvent,p)}).on("drag",C=>{const{autoPanOnNodeDrag:N,transform:_,snapGrid:z,snapToGrid:I,nodeDragThreshold:D,nodeLookup:T}=e(),$=Ti(C.sourceEvent,{transform:_,snapGrid:z,snapToGrid:I,containerBounds:p});if(P=C.sourceEvent,(C.sourceEvent.type==="touchmove"&&C.sourceEvent.touches.length>1||se&&!T.has(se))&&(w=!0),!w){if(!f&&N&&b&&(f=!0,te()),!b){const X=ir(C.sourceEvent,p),H=X.x-g.x,W=X.y-g.y;Math.sqrt(H*H+W*W)>D&&be(C)}(s.x!==$.xSnapped||s.y!==$.ySnapped)&&c&&b&&(g=ir(C.sourceEvent,p),le($))}}).on("end",C=>{if(!(!b||w)&&(f=!1,b=!1,cancelAnimationFrame(i),c.size>0)){const{nodeLookup:N,updateNodePositions:_,onNodeDragStop:z,onSelectionDragStop:I}=e();if(M&&(_(c,!1),M=!1),o||z||!se&&I){const[D,T]=Pi({nodeId:se,dragItems:c,nodeLookup:N,dragging:!1});o==null||o(C.sourceEvent,c,D,T),z==null||z(C.sourceEvent,D,T),se||I==null||I(C.sourceEvent,T)}}}).filter(C=>{const N=C.target;return!C.button&&(!k||!ec(N,`.${k}`,U))&&(!F||ec(N,F,U))});h.call(K)}function O(){h==null||h.on(".drag",null)}return{update:V,destroy:O}}function Rw(t,e,r){const a=[],o={x:t.x-r,y:t.y-r,width:r*2,height:r*2};for(const s of e.values())Wa(o,xa(s))>0&&a.push(s);return a}const Dw=250;function $w(t,e,r,a){var c,f;let o=[],s=1/0;const i=Rw(t,r,e+Dw);for(const g of i){const p=[...((c=g.internals.handleBounds)==null?void 0:c.source)??[],...((f=g.internals.handleBounds)==null?void 0:f.target)??[]];for(const b of p){if(a.nodeId===b.nodeId&&a.type===b.type&&a.id===b.id)continue;const{x:h,y:w}=Br(g,b,b.position,!0),M=Math.sqrt(Math.pow(h-t.x,2)+Math.pow(w-t.y,2));M>e||(M<s?(o=[{...b,x:h,y:w}],s=M):M===s&&o.push({...b,x:h,y:w}))}}if(!o.length)return null;if(o.length>1){const g=a.type==="source"?"target":"source";return o.find(p=>p.type===g)??o[0]}return o[0]}function Gd(t,e,r,a,o,s=!1){var g,p,b;const i=a.get(t);if(!i)return null;const c=o==="strict"?(g=i.internals.handleBounds)==null?void 0:g[e]:[...((p=i.internals.handleBounds)==null?void 0:p.source)??[],...((b=i.internals.handleBounds)==null?void 0:b.target)??[]],f=(r?c==null?void 0:c.find(h=>h.id===r):c==null?void 0:c[0])??null;return f&&s?{...f,...Br(i,f,f.position,!0)}:f}function Yd(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function Vw(t,e){let r=null;return e?r=!0:t&&!e&&(r=!1),r}const Xd=()=>!0;function Hw(t,{connectionMode:e,connectionRadius:r,handleId:a,nodeId:o,edgeUpdaterType:s,isTarget:i,domNode:c,nodeLookup:f,lib:g,autoPanOnConnect:p,flowId:b,panBy:h,cancelConnection:w,onConnectStart:M,onConnect:P,onConnectEnd:V,isValidConnection:O=Xd,onReconnectEnd:k,updateConnection:F,getTransform:U,getFromHandle:Q,autoPanSpeed:se,dragThreshold:xe=1,handleDomNode:le}){const te=Vd(t.target);let be=0,K;const{x:C,y:N}=ir(t),_=Yd(s,le),z=c==null?void 0:c.getBoundingClientRect();let I=!1;if(!z||!_)return;const D=Gd(o,_,a,f,e);if(!D)return;let T=ir(t,z),$=!1,X=null,H=!1,W=null;function Y(){if(!p||!z)return;const[j,R]=Dd(T,z,se);h({x:j,y:R}),be=requestAnimationFrame(Y)}const ae={...D,nodeId:o,type:_,position:D.position},ge=f.get(o);let ee={inProgress:!0,isValid:null,from:Br(ge,ae,Tt.Left,!0),fromHandle:ae,fromPosition:ae.position,fromNode:ge,to:T,toHandle:null,toPosition:ql[ae.position],toNode:null,pointer:T};function q(){I=!0,F(ee),M==null||M(t,{nodeId:o,handleId:a,handleType:_})}xe===0&&q();function G(j){if(!I){const{x:me,y:pe}=ir(j),Ee=me-C,Se=pe-N;if(!(Ee*Ee+Se*Se>xe*xe))return;q()}if(!Q()||!ae){E(j);return}const R=U();T=ir(j,z),K=$w(co(T,R,!1,[1,1]),r,f,ae),$||(Y(),$=!0);const A=Zd(j,{handle:K,connectionMode:e,fromNodeId:o,fromHandleId:a,fromType:i?"target":"source",isValidConnection:O,doc:te,lib:g,flowId:b,nodeLookup:f});W=A.handleDomNode,X=A.connection,H=Vw(!!K,A.isValid);const Z=f.get(o),J=Z?Br(Z,ae,Tt.Left,!0):ee.from,oe={...ee,from:J,isValid:H,to:A.toHandle&&H?Uo({x:A.toHandle.x,y:A.toHandle.y},R):T,toHandle:A.toHandle,toPosition:H&&A.toHandle?A.toHandle.position:ql[ae.position],toNode:A.toHandle?f.get(A.toHandle.nodeId):null,pointer:T};F(oe),ee=oe}function E(j){if(!("touches"in j&&j.touches.length>0)){if(I){(K||W)&&X&&H&&(P==null||P(X));const{inProgress:R,...A}=ee,Z={...A,toPosition:ee.toHandle?ee.toPosition:null};V==null||V(j,Z),s&&(k==null||k(j,Z))}w(),cancelAnimationFrame(be),$=!1,H=!1,X=null,W=null,te.removeEventListener("mousemove",G),te.removeEventListener("mouseup",E),te.removeEventListener("touchmove",G),te.removeEventListener("touchend",E)}}te.addEventListener("mousemove",G),te.addEventListener("mouseup",E),te.addEventListener("touchmove",G),te.addEventListener("touchend",E)}function Zd(t,{handle:e,connectionMode:r,fromNodeId:a,fromHandleId:o,fromType:s,doc:i,lib:c,flowId:f,isValidConnection:g=Xd,nodeLookup:p}){const b=s==="target",h=e?i.querySelector(`.${c}-flow__handle[data-id="${f}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:w,y:M}=ir(t),P=i.elementFromPoint(w,M),V=P!=null&&P.classList.contains(`${c}-flow__handle`)?P:h,O={handleDomNode:V,isValid:!1,connection:null,toHandle:null};if(V){const k=Yd(void 0,V),F=V.getAttribute("data-nodeid"),U=V.getAttribute("data-handleid"),Q=V.classList.contains("connectable"),se=V.classList.contains("connectableend");if(!F||!k)return O;const xe={source:b?F:a,sourceHandle:b?U:o,target:b?a:F,targetHandle:b?o:U};O.connection=xe;const te=Q&&se&&(r===ha.Strict?b&&k==="source"||!b&&k==="target":F!==a||U!==o);O.isValid=te&&g(xe),O.toHandle=Gd(F,k,U,p,r,!0)}return O}const tc={onPointerDown:Hw,isValid:Zd},di=t=>({x:t.x,y:t.y,zoom:t.k}),Ai=({x:t,y:e,zoom:r})=>ii.translate(t,e).scale(r),ra=(t,e)=>t.target.closest(`.${e}`),Qd=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),Fw=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Li=(t,e=0,r=Fw,a=()=>{})=>{const o=typeof e=="number"&&e>0;return o||a(),o?t.transition().duration(e).ease(r).on("end",a):t},Jd=t=>{const e=t.ctrlKey&&Go()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function qw({zoomPanValues:t,noWheelClassName:e,d3Selection:r,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:s,zoomOnPinch:i,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:g}){return p=>{if(ra(p,e))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const b=r.property("__zoom").k||1;if(p.ctrlKey&&i){const V=dr(p),O=Jd(p),k=b*Math.pow(2,O);a.scaleTo(r,k,V,p);return}const h=p.deltaMode===1?20:1;let w=o===da.Vertical?0:p.deltaX*h,M=o===da.Horizontal?0:p.deltaY*h;!Go()&&p.shiftKey&&o!==da.Vertical&&(w=p.deltaY*h,M=0),a.translateBy(r,-(w/b)*s,-(M/b)*s,{internal:!0});const P=di(r.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(f==null||f(p,P),t.panScrollTimeout=setTimeout(()=>{g==null||g(p,P),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,c==null||c(p,P))}}function Kw({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:r}){return function(a,o){const s=a.type==="wheel",i=!e&&s&&!a.ctrlKey,c=ra(a,t);if(a.ctrlKey&&s&&c&&a.preventDefault(),i||c)return null;a.preventDefault(),r.call(this,a,o)}}function jw({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:r}){return a=>{var s,i,c;if((s=a.sourceEvent)!=null&&s.internal)return;const o=di(a.transform);t.mouseButton=((i=a.sourceEvent)==null?void 0:i.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=o,((c=a.sourceEvent)==null?void 0:c.type)==="mousedown"&&e(!0),r&&(r==null||r(a.sourceEvent,o))}}function Bw({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:r,onTransformChange:a,onPanZoom:o}){return s=>{var i,c;t.usedRightMouseButton=!!(r&&Qd(e,t.mouseButton??0)),(i=s.sourceEvent)!=null&&i.sync||a([s.transform.x,s.transform.y,s.transform.k]),o&&!((c=s.sourceEvent)!=null&&c.internal)&&(o==null||o(s.sourceEvent,di(s.transform)))}}function Ww({zoomPanValues:t,panOnDrag:e,panOnScroll:r,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:s}){return i=>{var c;if(!((c=i.sourceEvent)!=null&&c.internal)&&(t.isZoomingOrPanning=!1,s&&Qd(e,t.mouseButton??0)&&!t.usedRightMouseButton&&i.sourceEvent&&s(i.sourceEvent),t.usedRightMouseButton=!1,a(!1),o)){const f=di(i.transform);t.prevViewport=f,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{o==null||o(i.sourceEvent,f)},r?150:0)}}}function Uw({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:r,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:s,userSelectionActive:i,noWheelClassName:c,noPanClassName:f,lib:g,connectionInProgress:p}){return b=>{var V;const h=t||e,w=r&&b.ctrlKey,M=b.type==="wheel";if(b.button===1&&b.type==="mousedown"&&(ra(b,`${g}-flow__node`)||ra(b,`${g}-flow__edge`)))return!0;if(!a&&!h&&!o&&!s&&!r||i||p&&!M||ra(b,c)&&M||ra(b,f)&&(!M||o&&M&&!t)||!r&&b.ctrlKey&&M)return!1;if(!r&&b.type==="touchstart"&&((V=b.touches)==null?void 0:V.length)>1)return b.preventDefault(),!1;if(!h&&!o&&!w&&M||!a&&(b.type==="mousedown"||b.type==="touchstart")||Array.isArray(a)&&!a.includes(b.button)&&b.type==="mousedown")return!1;const P=Array.isArray(a)&&a.includes(b.button)||!b.button||b.button<=1;return(!b.ctrlKey||M)&&P}}function Gw({domNode:t,minZoom:e,maxZoom:r,translateExtent:a,viewport:o,onPanZoom:s,onPanZoomStart:i,onPanZoomEnd:c,onDraggingChange:f}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=t.getBoundingClientRect(),b=U2().scaleExtent([e,r]).translateExtent(a),h=ar(t).call(b);k({x:o.x,y:o.y,zoom:ba(o.zoom,e,r)},[[0,0],[p.width,p.height]],a);const w=h.on("wheel.zoom"),M=h.on("dblclick.zoom");b.wheelDelta(Jd);function P(K,C){return h?new Promise(N=>{b==null||b.interpolate((C==null?void 0:C.interpolate)==="linear"?Ia:To).transform(Li(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),K)}):Promise.resolve(!1)}function V({noWheelClassName:K,noPanClassName:C,onPaneContextMenu:N,userSelectionActive:_,panOnScroll:z,panOnDrag:I,panOnScrollMode:D,panOnScrollSpeed:T,preventScrolling:$,zoomOnPinch:X,zoomOnScroll:H,zoomOnDoubleClick:W,zoomActivationKeyPressed:Y,lib:ae,onTransformChange:ge,connectionInProgress:ie,paneClickDistance:ee,selectionOnDrag:q}){_&&!g.isZoomingOrPanning&&O();const G=z&&!Y&&!_;b.clickDistance(q?1/0:!yr(ee)||ee<0?0:ee);const E=G?qw({zoomPanValues:g,noWheelClassName:K,d3Selection:h,d3Zoom:b,panOnScrollMode:D,panOnScrollSpeed:T,zoomOnPinch:X,onPanZoomStart:i,onPanZoom:s,onPanZoomEnd:c}):Kw({noWheelClassName:K,preventScrolling:$,d3ZoomHandler:w});if(h.on("wheel.zoom",E,{passive:!1}),!_){const R=jw({zoomPanValues:g,onDraggingChange:f,onPanZoomStart:i});b.on("start",R);const A=Bw({zoomPanValues:g,panOnDrag:I,onPaneContextMenu:!!N,onPanZoom:s,onTransformChange:ge});b.on("zoom",A);const Z=Ww({zoomPanValues:g,panOnDrag:I,panOnScroll:z,onPaneContextMenu:N,onPanZoomEnd:c,onDraggingChange:f});b.on("end",Z)}const j=Uw({zoomActivationKeyPressed:Y,panOnDrag:I,zoomOnScroll:H,panOnScroll:z,zoomOnDoubleClick:W,zoomOnPinch:X,userSelectionActive:_,noPanClassName:C,noWheelClassName:K,lib:ae,connectionInProgress:ie});b.filter(j),W?h.on("dblclick.zoom",M):h.on("dblclick.zoom",null)}function O(){b.on("zoom",null)}async function k(K,C,N){const _=Ai(K),z=b==null?void 0:b.constrain()(_,C,N);return z&&await P(z),new Promise(I=>I(z))}async function F(K,C){const N=Ai(K);return await P(N,C),new Promise(_=>_(N))}function U(K){if(h){const C=Ai(K),N=h.property("__zoom");(N.k!==K.zoom||N.x!==K.x||N.y!==K.y)&&(b==null||b.transform(h,C,null,{sync:!0}))}}function Q(){const K=h?Ad(h.node()):{x:0,y:0,k:1};return{x:K.x,y:K.y,zoom:K.k}}function se(K,C){return h?new Promise(N=>{b==null||b.interpolate((C==null?void 0:C.interpolate)==="linear"?Ia:To).scaleTo(Li(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),K)}):Promise.resolve(!1)}function xe(K,C){return h?new Promise(N=>{b==null||b.interpolate((C==null?void 0:C.interpolate)==="linear"?Ia:To).scaleBy(Li(h,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>N(!0)),K)}):Promise.resolve(!1)}function le(K){b==null||b.scaleExtent(K)}function te(K){b==null||b.translateExtent(K)}function be(K){const C=!yr(K)||K<0?0:K;b==null||b.clickDistance(C)}return{update:V,destroy:O,setViewport:F,setViewportConstrained:k,getViewport:Q,scaleTo:se,scaleBy:xe,setScaleExtent:le,setTranslateExtent:te,syncViewport:U,setClickDistance:be}}var nc;(function(t){t.Line="line",t.Handle="handle"})(nc||(nc={}));function qs(){const t={};return[e=>{if(e&&!Bu(t))throw new Error(e);return Jo(t)},e=>_s(t,e)]}const[Yw,Xw]=qs(),[Zw,Qw]=qs(),[Jw,e3]=qs();var t3=x("<div><!></div>");function _a(t,e){ot(e,!0);let r=Ye(e,"id",3,null),a=Ye(e,"type",3,"source"),o=Ye(e,"position",19,()=>Tt.Top),s=Ye(e,"isConnectableStart",3,!0),i=Ye(e,"isConnectableEnd",3,!0),c=Ur(e,["$$slots","$$events","$$legacy","id","type","position","style","class","isConnectable","isConnectableStart","isConnectableEnd","isValidConnection","onconnect","ondisconnect","children"]);const f=Yw("Handle must be used within a Custom Node component"),g=Zw("Handle must be used within a Custom Node component");let p=y(()=>a()==="target"),b=y(()=>e.isConnectable!==void 0?e.isConnectable:g.value),h=Xr(),w=y(()=>h.ariaLabelConfig),M=null;Wu(()=>{if(e.onconnect||e.ondisconnect){h.edges;let C=h.connectionLookup.get(`${f}-${a()}${r()?`-${r()}`:""}`);if(M&&!Y2(C,M)){const N=C??new Map;Kl(M,N,e.ondisconnect),Kl(N,M,e.onconnect)}M=new Map(C)}});let P=y(()=>{if(!h.connection.inProgress)return[!1,!1,!1,!1,null];const{fromHandle:C,toHandle:N,isValid:_}=h.connection,z=C&&C.nodeId===f&&C.type===a()&&C.id===r(),I=N&&N.nodeId===f&&N.type===a()&&N.id===r(),D=h.connectionMode===ha.Strict?(C==null?void 0:C.type)!==a():f!==(C==null?void 0:C.nodeId)||r()!==(C==null?void 0:C.id);return[!0,z,I,D,I&&_]}),V=y(()=>er(n(P),5)),O=y(()=>n(V)[0]),k=y(()=>n(V)[1]),F=y(()=>n(V)[2]),U=y(()=>n(V)[3]),Q=y(()=>n(V)[4]);function se(C){var _;const N=h.onbeforeconnect?h.onbeforeconnect(C):C;N&&(h.addEdge(N),(_=h.onconnect)==null||_.call(h,C))}function xe(C){const N=Fd(C);C.currentTarget&&(N&&C.button===0||!N)&&tc.onPointerDown(C,{handleId:r(),nodeId:f,isTarget:n(p),connectionRadius:h.connectionRadius,domNode:h.domNode,nodeLookup:h.nodeLookup,connectionMode:h.connectionMode,lib:"svelte",autoPanOnConnect:h.autoPanOnConnect,autoPanSpeed:h.autoPanSpeed,flowId:h.flowId,isValidConnection:e.isValidConnection||((..._)=>{var z;return((z=h.isValidConnection)==null?void 0:z.call(h,..._))??!0}),updateConnection:h.updateConnection,cancelConnection:h.cancelConnection,panBy:h.panBy,onConnect:se,onConnectStart:h.onconnectstart,onConnectEnd:(..._)=>{var z;return(z=h.onconnectend)==null?void 0:z.call(h,..._)},getTransform:()=>[h.viewport.x,h.viewport.y,h.viewport.zoom],getFromHandle:()=>h.connection.fromHandle,dragThreshold:h.connectionDragThreshold,handleDomNode:C.currentTarget})}function le(C){var W,Y;if(!f||!h.clickConnectStartHandle&&!s())return;if(!h.clickConnectStartHandle){(W=h.onclickconnectstart)==null||W.call(h,C,{nodeId:f,handleId:r(),handleType:a()}),h.clickConnectStartHandle={nodeId:f,type:a(),id:r()};return}const N=Vd(C.target),_=e.isValidConnection??h.isValidConnection,{connectionMode:z,clickConnectStartHandle:I,flowId:D,nodeLookup:T}=h,{connection:$,isValid:X}=tc.isValid(C,{handle:{nodeId:f,id:r(),type:a()},connectionMode:z,fromNodeId:I.nodeId,fromHandleId:I.id??null,fromType:I.type,isValidConnection:_,flowId:D,doc:N,lib:"svelte",nodeLookup:T});X&&$&&se($);const H=structuredClone(wc(h.connection));delete H.inProgress,H.toPosition=H.toHandle?H.toHandle.position:null,(Y=h.onclickconnectend)==null||Y.call(h,C,H),h.clickConnectStartHandle=null}var te=t3(),be=()=>{};zr(te,()=>({"data-handleid":r(),"data-nodeid":f,"data-handlepos":o(),"data-id":`${h.flowId??""}-${f??""}-${r()??"null"??""}-${a()??""}`,class:["svelte-flow__handle",`svelte-flow__handle-${o()}`,h.noDragClass,h.noPanClass,o(),e.class],onmousedown:xe,ontouchstart:xe,onclick:h.clickConnect?le:void 0,onkeypress:be,style:e.style,role:"button","aria-label":n(w)["handle.ariaLabel"],tabindex:"-1",...c,[ys]:{valid:n(Q),connectingto:n(F),connectingfrom:n(k),source:!n(p),target:n(p),connectablestart:s(),connectableend:i(),connectable:n(b),connectionindicator:n(b)&&(!n(O)||n(U))&&(n(O)||h.clickConnectStartHandle?i():s())}}));var K=d(te);pn(K,()=>e.children??Kn),l(te),v(t,te),it()}var n3=x("<!> <!>",1);function eu(t,e){ot(e,!0);let r=Ye(e,"targetPosition",19,()=>Tt.Top),a=Ye(e,"sourcePosition",19,()=>Tt.Bottom);var o=n3(),s=ue(o);_a(s,{type:"target",get position(){return r()}});var i=u(s),c=u(i);_a(c,{type:"source",get position(){return a()}}),L(()=>{var f;return S(i,` ${((f=e.data)==null?void 0:f.label)??""} `)}),v(t,o),it()}var r3=x(" <!>",1);function a3(t,e){ot(e,!0);let r=Ye(e,"data",19,()=>({label:"Node"})),a=Ye(e,"sourcePosition",19,()=>Tt.Bottom);Ce();var o=r3(),s=ue(o),i=u(s);_a(i,{type:"source",get position(){return a()}}),L(()=>{var c;return S(s,`${((c=r())==null?void 0:c.label)??""} `)}),v(t,o),it()}var o3=x(" <!>",1);function i3(t,e){ot(e,!0);let r=Ye(e,"data",19,()=>({label:"Node"})),a=Ye(e,"targetPosition",19,()=>Tt.Top);Ce();var o=o3(),s=ue(o),i=u(s);_a(i,{type:"target",get position(){return a()}}),L(()=>{var c;return S(s,`${((c=r())==null?void 0:c.label)??""} `)}),v(t,o),it()}function s3(t,e){}function Ii(t,e,r){if(!r||!e)return;const a=r==="root"?e:e.querySelector(`.svelte-flow__${r}`);a&&a.appendChild(t)}function Oi(t,e){const r=y(Xr),a=y(()=>n(r).domNode);let o;return n(a)?Ii(t,n(a),e):o=mc(()=>{an(()=>{Ii(t,n(a),e),o==null||o()})}),{async update(s){Ii(t,n(a),s)},destroy(){t.parentNode&&t.parentNode.removeChild(t),o==null||o()}}}function l3(){let t=_e(typeof window>"u");if(n(t)){const e=mc(()=>{an(()=>{m(t,!1),e==null||e()})})}return{get value(){return n(t)}}}const rc=t=>Z2(t),c3=t=>Id(t);function vr(t){return t===void 0?void 0:`${t}px`}const Yo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var d3=x("<div><!></div>");function u3(t,e){ot(e,!0);let r=Ye(e,"x",3,0),a=Ye(e,"y",3,0),o=Ye(e,"selectEdgeOnClick",3,!1),s=Ye(e,"transparent",3,!1),i=Ur(e,["$$slots","$$events","$$legacy","x","y","width","height","selectEdgeOnClick","transparent","class","children"]);const c=Xr(),f=Jw("EdgeLabel must be used within a Custom Edge component");let g=y(()=>{var w;return(w=c.visible.edges.get(f))==null?void 0:w.zIndex});var p=d3(),b=()=>{o()&&f&&c.handleEdgeSelection(f)};zr(p,w=>({class:["svelte-flow__edge-label",{transparent:s()},e.class],tabindex:"-1",onclick:b,...i,[ei]:w}),[()=>({display:l3().value?"none":void 0,cursor:o()?"pointer":void 0,transform:`translate(-50%, -50%) translate(${r()??""}px,${a()??""}px)`,"pointer-events":"all",width:vr(e.width),height:vr(e.height),"z-index":n(g)})],void 0,void 0,"svelte-168dld1");var h=d(p);pn(h,()=>e.children??Kn),l(p),Hn(p,(w,M)=>Oi==null?void 0:Oi(w,M),()=>"edge-labels"),v(t,p),it()}var f3=En("<path></path>"),v3=En('<path fill="none"></path><!><!>',1);function ui(t,e){let r=Ye(e,"interactionWidth",3,20),a=Ur(e,["$$slots","$$events","$$legacy","id","path","label","labelX","labelY","labelStyle","markerStart","markerEnd","style","interactionWidth","class"]);var o=v3(),s=ue(o),i=u(s);{var c=p=>{var b=f3();zr(b,()=>({d:e.path,"stroke-opacity":0,"stroke-width":r(),fill:"none",class:"svelte-flow__edge-interaction",...a})),v(p,b)};B(i,p=>{r()>0&&p(c)})}var f=u(i);{var g=p=>{u3(p,{get x(){return e.labelX},get y(){return e.labelY},get style(){return e.labelStyle},selectEdgeOnClick:!0,children:(b,h)=>{Ce();var w=_t();L(()=>S(w,e.label)),v(b,w)},$$slots:{default:!0}})};B(f,p=>{e.label&&p(g)})}L(()=>{Pe(s,"id",e.id),Pe(s,"d",e.path),Ve(s,0,Ke(["svelte-flow__edge-path",e.class])),Pe(s,"marker-start",e.markerStart),Pe(s,"marker-end",e.markerEnd),kn(s,e.style)}),v(t,o)}function tu(t,e){ot(e,!0);let r=y(()=>{var c;return qd({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition,curvature:(c=e.pathOptions)==null?void 0:c.curvature})}),a=y(()=>er(n(r),3)),o=y(()=>n(a)[0]),s=y(()=>n(a)[1]),i=y(()=>n(a)[2]);ui(t,{get id(){return e.id},get path(){return n(o)},get labelX(){return n(s)},get labelY(){return n(i)},get label(){return e.label},get labelStyle(){return e.labelStyle},get markerStart(){return e.markerStart},get markerEnd(){return e.markerEnd},get interactionWidth(){return e.interactionWidth},get style(){return e.style}}),it()}function g3(t,e){ot(e,!0);let r=y(()=>Ds({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition})),a=y(()=>er(n(r),3)),o=y(()=>n(a)[0]),s=y(()=>n(a)[1]),i=y(()=>n(a)[2]);ui(t,{get path(){return n(o)},get labelX(){return n(s)},get labelY(){return n(i)},get label(){return e.label},get labelStyle(){return e.labelStyle},get markerStart(){return e.markerStart},get markerEnd(){return e.markerEnd},get interactionWidth(){return e.interactionWidth},get style(){return e.style}}),it()}function p3(t,e){ot(e,!0);let r=y(()=>jd({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY})),a=y(()=>er(n(r),3)),o=y(()=>n(a)[0]),s=y(()=>n(a)[1]),i=y(()=>n(a)[2]);ui(t,{get path(){return n(o)},get labelX(){return n(s)},get labelY(){return n(i)},get label(){return e.label},get labelStyle(){return e.labelStyle},get markerStart(){return e.markerStart},get markerEnd(){return e.markerEnd},get interactionWidth(){return e.interactionWidth},get style(){return e.style}}),it()}function h3(t,e){ot(e,!0);let r=y(()=>Ds({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition,borderRadius:0})),a=y(()=>er(n(r),3)),o=y(()=>n(a)[0]),s=y(()=>n(a)[1]),i=y(()=>n(a)[2]);ui(t,{get path(){return n(o)},get labelX(){return n(s)},get labelY(){return n(i)},get label(){return e.label},get labelStyle(){return e.labelStyle},get markerStart(){return e.markerStart},get markerEnd(){return e.markerEnd},get interactionWidth(){return e.interactionWidth},get style(){return e.style}}),it()}var to,no;class b3{constructor(e,r){Fe(this,to);Fe(this,no);Qr(this,to,e),Qr(this,no,Gu(r))}get current(){return fe(this,no).call(this),fe(this,to).call(this)}}to=new WeakMap,no=new WeakMap;const x3=/\(.+\)/,m3=new Set(["all","print","screen","and","or","not","only"]);class _3 extends b3{constructor(e,r){let a=x3.test(e)||e.split(/[\s,]+/).some(s=>m3.has(s.trim()))?e:`(${e})`;const o=window.matchMedia(a);super(()=>o.matches,s=>Ki(o,"change",s))}}function y3(t,e,r,a){const o=new Map;return Os(t,{x:0,y:0,width:r,height:a},e,!0).forEach(s=>{o.set(s.id,s)}),o}function ac(t){const{edges:e,defaultEdgeOptions:r,nodeLookup:a,previousEdges:o,connectionMode:s,onerror:i,onlyRenderVisible:c,elevateEdgesOnSelect:f,zIndexMode:g}=t,p=new Map;for(const b of e){const h=a.get(b.source),w=a.get(b.target);if(!h||!w)continue;if(c){const{visibleNodes:V,transform:O,width:k,height:F}=t;if(vw({sourceNode:h,targetNode:w,width:k,height:F,transform:O}))V.set(h.id,h),V.set(w.id,w);else continue}const M=o.get(b.id);if(M&&b===M.edge&&h==M.sourceNode&&w==M.targetNode){p.set(b.id,M);continue}const P=_w({id:b.id,sourceNode:h,targetNode:w,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:s,onError:i});P&&p.set(b.id,{...r,...b,...P,zIndex:fw({selected:b.selected,zIndex:b.zIndex??r.zIndex,sourceNode:h,targetNode:w,elevateOnSelect:f,zIndexMode:g}),sourceNode:h,targetNode:w,edge:b})}return p}const nu={input:a3,output:i3,default:eu,group:s3},ru={straight:p3,smoothstep:g3,default:tu,step:h3};function w3(t,e,r,a,o,s){if(e&&!r&&a&&o){const i=si(s,{filter:c=>!!((c.width||c.initialWidth)&&(c.height||c.initialHeight))});return Rs(i,a,o,.5,2,.1)}else return r??{x:0,y:0,zoom:1}}function k3(t){var r,a,o,s,i,c,f,g,p,b,h,w,M,P,V,O,k,F,U,Q,se,xe,le,te,be,K,C,N,_,z,I,D,T,$,X,H,W,Y,ae,ge,ie,ee,q,G,E,j,R,A,Z,J,oe,me,pe,Ee,Se,ve,ce,Oe,re,de,he,Ie,Ae,ke,Te,ze,Ne,Me,Xe,Re,Je,dt,ft,qe,$e,je;class e{constructor(){Fe(this,r,y(()=>t.props.id??"1"));Fe(this,a,_e(null));Fe(this,o,_e(null));Fe(this,s,_e(t.width??0));Fe(this,i,_e(t.height??0));Fe(this,c,_e(t.props.zIndexMode??"basic"));Fe(this,f,y(()=>{var nt;const{nodesInitialized:ne}=Ew(t.nodes,this.nodeLookup,this.parentLookup,{nodeExtent:this.nodeExtent,nodeOrigin:this.nodeOrigin,elevateNodesOnSelect:t.props.elevateNodesOnSelect??!0,checkEquality:!0,zIndexMode:this.zIndexMode});return this.fitViewQueued&&ne&&((nt=this.fitViewOptions)!=null&&nt.duration?this.resolveFitView():queueMicrotask(()=>{this.resolveFitView()})),ne}));Fe(this,g,y(()=>this.panZoom!==null));Fe(this,p,y(()=>(Aw(this.connectionLookup,this.edgeLookup,t.edges),t.edges)));jt(this,"_prevSelectedNodes",[]);jt(this,"_prevSelectedNodeIds",new Set);Fe(this,b,y(()=>{const ne=this._prevSelectedNodeIds.size,nt=new Set,Ze=this.nodes.filter(Be=>(Be.selected&&(nt.add(Be.id),this._prevSelectedNodeIds.delete(Be.id)),Be.selected));return(ne!==nt.size||this._prevSelectedNodeIds.size>0)&&(this._prevSelectedNodes=Ze),this._prevSelectedNodeIds=nt,this._prevSelectedNodes}));jt(this,"_prevSelectedEdges",[]);jt(this,"_prevSelectedEdgeIds",new Set);Fe(this,h,y(()=>{const ne=this._prevSelectedEdgeIds.size,nt=new Set,Ze=this.edges.filter(Be=>(Be.selected&&(nt.add(Be.id),this._prevSelectedEdgeIds.delete(Be.id)),Be.selected));return(ne!==nt.size||this._prevSelectedEdgeIds.size>0)&&(this._prevSelectedEdges=Ze),this._prevSelectedEdgeIds=nt,this._prevSelectedEdges}));jt(this,"selectionChangeHandlers",new Map);jt(this,"nodeLookup",new Map);jt(this,"parentLookup",new Map);jt(this,"connectionLookup",new Map);jt(this,"edgeLookup",new Map);jt(this,"_prevVisibleEdges",new Map);Fe(this,w,y(()=>{const{nodes:ne,_edges:nt,_prevVisibleEdges:Ze,nodeLookup:Be,connectionMode:ut,onerror:Nt,onlyRenderVisibleElements:Pt,defaultEdgeOptions:Mt,zIndexMode:Et}=this;let mt,yt;const kt={edges:nt,defaultEdgeOptions:Mt,previousEdges:Ze,nodeLookup:Be,connectionMode:ut,elevateEdgesOnSelect:t.props.elevateEdgesOnSelect??!0,zIndexMode:Et,onerror:Nt};if(Pt){const{viewport:It,width:Xt,height:hn}=this,xn=[It.x,It.y,It.zoom];mt=y3(Be,xn,Xt,hn),yt=ac({...kt,onlyRenderVisible:!0,visibleNodes:mt,transform:xn,width:Xt,height:hn})}else mt=this.nodeLookup,yt=ac(kt);return{nodes:mt,edges:yt}}));Fe(this,M,y(()=>t.props.nodesDraggable??!0));Fe(this,P,y(()=>t.props.nodesConnectable??!0));Fe(this,V,y(()=>t.props.elementsSelectable??!0));Fe(this,O,y(()=>t.props.nodesFocusable??!0));Fe(this,k,y(()=>t.props.edgesFocusable??!0));Fe(this,F,y(()=>t.props.disableKeyboardA11y??!1));Fe(this,U,y(()=>t.props.minZoom??.5));Fe(this,Q,y(()=>t.props.maxZoom??2));Fe(this,se,y(()=>t.props.nodeOrigin??[0,0]));Fe(this,xe,y(()=>t.props.nodeExtent??us));Fe(this,le,y(()=>t.props.translateExtent??us));Fe(this,te,y(()=>t.props.defaultEdgeOptions??{}));Fe(this,be,y(()=>t.props.nodeDragThreshold??1));Fe(this,K,y(()=>t.props.autoPanOnNodeDrag??!0));Fe(this,C,y(()=>t.props.autoPanOnConnect??!0));Fe(this,N,y(()=>t.props.autoPanOnNodeFocus??!0));Fe(this,_,y(()=>t.props.autoPanSpeed??15));Fe(this,z,y(()=>t.props.connectionDragThreshold??1));jt(this,"fitViewQueued",t.props.fitView??!1);jt(this,"fitViewOptions",t.props.fitViewOptions);jt(this,"fitViewResolver",null);Fe(this,I,y(()=>t.props.snapGrid??null));Fe(this,D,_e(!1));Fe(this,T,_e(null));Fe(this,$,_e(!1));Fe(this,X,_e(!1));Fe(this,H,_e(!1));Fe(this,W,_e(!1));Fe(this,Y,_e(!1));Fe(this,ae,_e(null));Fe(this,ge,_e(""));Fe(this,ie,y(()=>t.props.selectionMode??jo.Partial));Fe(this,ee,y(()=>({...nu,...t.props.nodeTypes})));Fe(this,q,y(()=>({...ru,...t.props.edgeTypes})));Fe(this,G,y(()=>t.props.noPanClass??"nopan"));Fe(this,E,y(()=>t.props.noDragClass??"nodrag"));Fe(this,j,y(()=>t.props.noWheelClass??"nowheel"));Fe(this,R,y(()=>cw(t.props.ariaLabelConfig)));Fe(this,A,_e(w3(this.nodesInitialized,t.props.fitView,t.props.initialViewport,this.width,this.height,this.nodeLookup)));Fe(this,Z,_e(fs));Fe(this,J,y(()=>this._connection.inProgress?{...this._connection,to:co(this._connection.to,[this.viewport.x,this.viewport.y,this.viewport.zoom])}:this._connection));Fe(this,oe,y(()=>t.props.connectionMode??ha.Strict));Fe(this,me,y(()=>t.props.connectionRadius??20));Fe(this,pe,y(()=>t.props.isValidConnection??(()=>!0)));Fe(this,Ee,y(()=>t.props.selectNodesOnDrag??!0));Fe(this,Se,y(()=>t.props.defaultMarkerColor===void 0?"#b1b1b7":t.props.defaultMarkerColor));Fe(this,ve,y(()=>yw(t.edges,{defaultColor:this.defaultMarkerColor,id:this.flowId,defaultMarkerStart:this.defaultEdgeOptions.markerStart,defaultMarkerEnd:this.defaultEdgeOptions.markerEnd})));Fe(this,ce,y(()=>t.props.onlyRenderVisibleElements??!1));Fe(this,Oe,y(()=>t.props.onflowerror??aw));Fe(this,re,y(()=>t.props.ondelete));Fe(this,de,y(()=>t.props.onbeforedelete));Fe(this,he,y(()=>t.props.onbeforeconnect));Fe(this,Ie,y(()=>t.props.onconnect));Fe(this,Ae,y(()=>t.props.onconnectstart));Fe(this,ke,y(()=>t.props.onconnectend));Fe(this,Te,y(()=>t.props.onbeforereconnect));Fe(this,ze,y(()=>t.props.onreconnect));Fe(this,Ne,y(()=>t.props.onreconnectstart));Fe(this,Me,y(()=>t.props.onreconnectend));Fe(this,Xe,y(()=>t.props.clickConnect??!0));Fe(this,Re,y(()=>t.props.onclickconnectstart));Fe(this,Je,y(()=>t.props.onclickconnectend));Fe(this,dt,_e(null));Fe(this,ft,y(()=>t.props.onselectiondrag));Fe(this,qe,y(()=>t.props.onselectiondragstart));Fe(this,$e,y(()=>t.props.onselectiondragstop));jt(this,"resolveFitView",async()=>{var ne;this.panZoom&&(await tw({nodes:this.nodeLookup,width:this.width,height:this.height,panZoom:this.panZoom,minZoom:this.minZoom,maxZoom:this.maxZoom},this.fitViewOptions),(ne=this.fitViewResolver)==null||ne.resolve(!0),this.fitViewQueued=!1,this.fitViewOptions=void 0,this.fitViewResolver=null)});jt(this,"_prefersDark",new _3("(prefers-color-scheme: dark)",t.props.colorModeSSR==="dark"));Fe(this,je,y(()=>t.props.colorMode==="system"?this._prefersDark.current?"dark":"light":t.props.colorMode??"light"))}get flowId(){return n(fe(this,r))}set flowId(ne){m(fe(this,r),ne)}get domNode(){return n(fe(this,a))}set domNode(ne){m(fe(this,a),ne)}get panZoom(){return n(fe(this,o))}set panZoom(ne){m(fe(this,o),ne)}get width(){return n(fe(this,s))}set width(ne){m(fe(this,s),ne)}get height(){return n(fe(this,i))}set height(ne){m(fe(this,i),ne)}get zIndexMode(){return n(fe(this,c))}set zIndexMode(ne){m(fe(this,c),ne)}get nodesInitialized(){return n(fe(this,f))}set nodesInitialized(ne){m(fe(this,f),ne)}get viewportInitialized(){return n(fe(this,g))}set viewportInitialized(ne){m(fe(this,g),ne)}get _edges(){return n(fe(this,p))}set _edges(ne){m(fe(this,p),ne)}get nodes(){return this.nodesInitialized,t.nodes}set nodes(ne){t.nodes=ne}get edges(){return this._edges}set edges(ne){t.edges=ne}get selectedNodes(){return n(fe(this,b))}set selectedNodes(ne){m(fe(this,b),ne)}get selectedEdges(){return n(fe(this,h))}set selectedEdges(ne){m(fe(this,h),ne)}get visible(){return n(fe(this,w))}set visible(ne){m(fe(this,w),ne)}get nodesDraggable(){return n(fe(this,M))}set nodesDraggable(ne){m(fe(this,M),ne)}get nodesConnectable(){return n(fe(this,P))}set nodesConnectable(ne){m(fe(this,P),ne)}get elementsSelectable(){return n(fe(this,V))}set elementsSelectable(ne){m(fe(this,V),ne)}get nodesFocusable(){return n(fe(this,O))}set nodesFocusable(ne){m(fe(this,O),ne)}get edgesFocusable(){return n(fe(this,k))}set edgesFocusable(ne){m(fe(this,k),ne)}get disableKeyboardA11y(){return n(fe(this,F))}set disableKeyboardA11y(ne){m(fe(this,F),ne)}get minZoom(){return n(fe(this,U))}set minZoom(ne){m(fe(this,U),ne)}get maxZoom(){return n(fe(this,Q))}set maxZoom(ne){m(fe(this,Q),ne)}get nodeOrigin(){return n(fe(this,se))}set nodeOrigin(ne){m(fe(this,se),ne)}get nodeExtent(){return n(fe(this,xe))}set nodeExtent(ne){m(fe(this,xe),ne)}get translateExtent(){return n(fe(this,le))}set translateExtent(ne){m(fe(this,le),ne)}get defaultEdgeOptions(){return n(fe(this,te))}set defaultEdgeOptions(ne){m(fe(this,te),ne)}get nodeDragThreshold(){return n(fe(this,be))}set nodeDragThreshold(ne){m(fe(this,be),ne)}get autoPanOnNodeDrag(){return n(fe(this,K))}set autoPanOnNodeDrag(ne){m(fe(this,K),ne)}get autoPanOnConnect(){return n(fe(this,C))}set autoPanOnConnect(ne){m(fe(this,C),ne)}get autoPanOnNodeFocus(){return n(fe(this,N))}set autoPanOnNodeFocus(ne){m(fe(this,N),ne)}get autoPanSpeed(){return n(fe(this,_))}set autoPanSpeed(ne){m(fe(this,_),ne)}get connectionDragThreshold(){return n(fe(this,z))}set connectionDragThreshold(ne){m(fe(this,z),ne)}get snapGrid(){return n(fe(this,I))}set snapGrid(ne){m(fe(this,I),ne)}get dragging(){return n(fe(this,D))}set dragging(ne){m(fe(this,D),ne)}get selectionRect(){return n(fe(this,T))}set selectionRect(ne){m(fe(this,T),ne)}get selectionKeyPressed(){return n(fe(this,$))}set selectionKeyPressed(ne){m(fe(this,$),ne)}get multiselectionKeyPressed(){return n(fe(this,X))}set multiselectionKeyPressed(ne){m(fe(this,X),ne)}get deleteKeyPressed(){return n(fe(this,H))}set deleteKeyPressed(ne){m(fe(this,H),ne)}get panActivationKeyPressed(){return n(fe(this,W))}set panActivationKeyPressed(ne){m(fe(this,W),ne)}get zoomActivationKeyPressed(){return n(fe(this,Y))}set zoomActivationKeyPressed(ne){m(fe(this,Y),ne)}get selectionRectMode(){return n(fe(this,ae))}set selectionRectMode(ne){m(fe(this,ae),ne)}get ariaLiveMessage(){return n(fe(this,ge))}set ariaLiveMessage(ne){m(fe(this,ge),ne)}get selectionMode(){return n(fe(this,ie))}set selectionMode(ne){m(fe(this,ie),ne)}get nodeTypes(){return n(fe(this,ee))}set nodeTypes(ne){m(fe(this,ee),ne)}get edgeTypes(){return n(fe(this,q))}set edgeTypes(ne){m(fe(this,q),ne)}get noPanClass(){return n(fe(this,G))}set noPanClass(ne){m(fe(this,G),ne)}get noDragClass(){return n(fe(this,E))}set noDragClass(ne){m(fe(this,E),ne)}get noWheelClass(){return n(fe(this,j))}set noWheelClass(ne){m(fe(this,j),ne)}get ariaLabelConfig(){return n(fe(this,R))}set ariaLabelConfig(ne){m(fe(this,R),ne)}get _viewport(){return n(fe(this,A))}set _viewport(ne){m(fe(this,A),ne)}get viewport(){return t.viewport??this._viewport}set viewport(ne){t.viewport&&(t.viewport=ne),this._viewport=ne}get _connection(){return n(fe(this,Z))}set _connection(ne){m(fe(this,Z),ne)}get connection(){return n(fe(this,J))}set connection(ne){m(fe(this,J),ne)}get connectionMode(){return n(fe(this,oe))}set connectionMode(ne){m(fe(this,oe),ne)}get connectionRadius(){return n(fe(this,me))}set connectionRadius(ne){m(fe(this,me),ne)}get isValidConnection(){return n(fe(this,pe))}set isValidConnection(ne){m(fe(this,pe),ne)}get selectNodesOnDrag(){return n(fe(this,Ee))}set selectNodesOnDrag(ne){m(fe(this,Ee),ne)}get defaultMarkerColor(){return n(fe(this,Se))}set defaultMarkerColor(ne){m(fe(this,Se),ne)}get markers(){return n(fe(this,ve))}set markers(ne){m(fe(this,ve),ne)}get onlyRenderVisibleElements(){return n(fe(this,ce))}set onlyRenderVisibleElements(ne){m(fe(this,ce),ne)}get onerror(){return n(fe(this,Oe))}set onerror(ne){m(fe(this,Oe),ne)}get ondelete(){return n(fe(this,re))}set ondelete(ne){m(fe(this,re),ne)}get onbeforedelete(){return n(fe(this,de))}set onbeforedelete(ne){m(fe(this,de),ne)}get onbeforeconnect(){return n(fe(this,he))}set onbeforeconnect(ne){m(fe(this,he),ne)}get onconnect(){return n(fe(this,Ie))}set onconnect(ne){m(fe(this,Ie),ne)}get onconnectstart(){return n(fe(this,Ae))}set onconnectstart(ne){m(fe(this,Ae),ne)}get onconnectend(){return n(fe(this,ke))}set onconnectend(ne){m(fe(this,ke),ne)}get onbeforereconnect(){return n(fe(this,Te))}set onbeforereconnect(ne){m(fe(this,Te),ne)}get onreconnect(){return n(fe(this,ze))}set onreconnect(ne){m(fe(this,ze),ne)}get onreconnectstart(){return n(fe(this,Ne))}set onreconnectstart(ne){m(fe(this,Ne),ne)}get onreconnectend(){return n(fe(this,Me))}set onreconnectend(ne){m(fe(this,Me),ne)}get clickConnect(){return n(fe(this,Xe))}set clickConnect(ne){m(fe(this,Xe),ne)}get onclickconnectstart(){return n(fe(this,Re))}set onclickconnectstart(ne){m(fe(this,Re),ne)}get onclickconnectend(){return n(fe(this,Je))}set onclickconnectend(ne){m(fe(this,Je),ne)}get clickConnectStartHandle(){return n(fe(this,dt))}set clickConnectStartHandle(ne){m(fe(this,dt),ne)}get onselectiondrag(){return n(fe(this,ft))}set onselectiondrag(ne){m(fe(this,ft),ne)}get onselectiondragstart(){return n(fe(this,qe))}set onselectiondragstart(ne){m(fe(this,qe),ne)}get onselectiondragstop(){return n(fe(this,$e))}set onselectiondragstop(ne){m(fe(this,$e),ne)}get colorMode(){return n(fe(this,je))}set colorMode(ne){m(fe(this,je),ne)}resetStoreValues(){this.dragging=!1,this.selectionRect=null,this.selectionRectMode=null,this.selectionKeyPressed=!1,this.multiselectionKeyPressed=!1,this.deleteKeyPressed=!1,this.panActivationKeyPressed=!1,this.zoomActivationKeyPressed=!1,this._connection=fs,this.clickConnectStartHandle=null,this.viewport=t.props.initialViewport??{x:0,y:0,zoom:1},this.ariaLiveMessage=""}}return r=new WeakMap,a=new WeakMap,o=new WeakMap,s=new WeakMap,i=new WeakMap,c=new WeakMap,f=new WeakMap,g=new WeakMap,p=new WeakMap,b=new WeakMap,h=new WeakMap,w=new WeakMap,M=new WeakMap,P=new WeakMap,V=new WeakMap,O=new WeakMap,k=new WeakMap,F=new WeakMap,U=new WeakMap,Q=new WeakMap,se=new WeakMap,xe=new WeakMap,le=new WeakMap,te=new WeakMap,be=new WeakMap,K=new WeakMap,C=new WeakMap,N=new WeakMap,_=new WeakMap,z=new WeakMap,I=new WeakMap,D=new WeakMap,T=new WeakMap,$=new WeakMap,X=new WeakMap,H=new WeakMap,W=new WeakMap,Y=new WeakMap,ae=new WeakMap,ge=new WeakMap,ie=new WeakMap,ee=new WeakMap,q=new WeakMap,G=new WeakMap,E=new WeakMap,j=new WeakMap,R=new WeakMap,A=new WeakMap,Z=new WeakMap,J=new WeakMap,oe=new WeakMap,me=new WeakMap,pe=new WeakMap,Ee=new WeakMap,Se=new WeakMap,ve=new WeakMap,ce=new WeakMap,Oe=new WeakMap,re=new WeakMap,de=new WeakMap,he=new WeakMap,Ie=new WeakMap,Ae=new WeakMap,ke=new WeakMap,Te=new WeakMap,ze=new WeakMap,Ne=new WeakMap,Me=new WeakMap,Xe=new WeakMap,Re=new WeakMap,Je=new WeakMap,dt=new WeakMap,ft=new WeakMap,qe=new WeakMap,$e=new WeakMap,je=new WeakMap,new e}function Xr(){const t=Jo(ps);if(!t)throw new Error("To call useStore outside of <SvelteFlow /> you need to wrap your component in a <SvelteFlowProvider />");return t.getStore()}const ps=Symbol();function S3(t){const e=k3(t);function r(K){e.nodeTypes={...nu,...K}}function a(K){e.edgeTypes={...ru,...K}}function o(K){e.edges=hw(K,e.edges)}const s=(K,C=!1)=>{e.nodes=e.nodes.map(N=>{if(e.connection.inProgress&&e.connection.fromNode.id===N.id){const z=e.nodeLookup.get(N.id);z&&(e.connection={...e.connection,from:Br(z,e.connection.fromHandle,Tt.Left,!0)})}const _=K.get(N.id);return _?{...N,position:_.position,dragging:C}:N})};function i(K){var z,I,D;const{changes:C,updatedInternals:N}=Tw(K,e.nodeLookup,e.parentLookup,e.domNode,e.nodeOrigin,e.nodeExtent,e.zIndexMode);if(!N)return;Sw(e.nodeLookup,e.parentLookup,{nodeOrigin:e.nodeOrigin,nodeExtent:e.nodeExtent,zIndexMode:e.zIndexMode}),e.fitViewQueued&&e.resolveFitView();const _=new Map;for(const T of C){const $=(z=e.nodeLookup.get(T.id))==null?void 0:z.internals.userNode;if(!$)continue;const X={...$};switch(T.type){case"dimensions":{const H={...X.measured,...T.dimensions};T.setAttributes&&(X.width=((I=T.dimensions)==null?void 0:I.width)??X.width,X.height=((D=T.dimensions)==null?void 0:D.height)??X.height),X.measured=H;break}case"position":X.position=T.position??X.position;break}_.set(T.id,X)}e.nodes=e.nodes.map(T=>_.get(T.id)??T)}function c(K){const C=e.fitViewResolver??Promise.withResolvers();return e.fitViewQueued=!0,e.fitViewOptions=K,e.fitViewResolver=C,e.nodes=[...e.nodes],C.promise}async function f(K,C,N){const _=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:e.maxZoom,z=e.panZoom;return z?(await z.setViewport({x:e.width/2-K*_,y:e.height/2-C*_,zoom:_},{duration:N==null?void 0:N.duration,ease:N==null?void 0:N.ease,interpolate:N==null?void 0:N.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)}function g(K,C){const N=e.panZoom;return N?N.scaleBy(K,C):Promise.resolve(!1)}function p(K){return g(1.2,K)}function b(K){return g(1/1.2,K)}function h(K){const C=e.panZoom;C&&(C.setScaleExtent([K,e.maxZoom]),e.minZoom=K)}function w(K){const C=e.panZoom;C&&(C.setScaleExtent([e.minZoom,K]),e.maxZoom=K)}function M(K){const C=e.panZoom;C&&(C.setTranslateExtent(K),e.translateExtent=K)}function P(K,C=null){let N=!1;const _=K.map(z=>(C?C.has(z.id):!0)&&z.selected?(N=!0,{...z,selected:!1}):z);return[N,_]}function V(K){const C=K!=null&&K.nodes?new Set(K.nodes.map(T=>T.id)):null,[N,_]=P(e.nodes,C);N&&(e.nodes=_);const z=K!=null&&K.edges?new Set(K.edges.map(T=>T.id)):null,[I,D]=P(e.edges,z);I&&(e.edges=D)}function O(K){const C=e.multiselectionKeyPressed;e.nodes=e.nodes.map(N=>{const _=K.includes(N.id),z=C&&N.selected||_;return!!N.selected!==z?{...N,selected:z}:N}),C||V({nodes:[]})}function k(K){const C=e.multiselectionKeyPressed;e.edges=e.edges.map(N=>{const _=K.includes(N.id),z=C&&N.selected||_;return!!N.selected!==z?{...N,selected:z}:N}),C||V({edges:[]})}function F(K,C,N){const _=e.nodeLookup.get(K);if(!_){console.warn("012",Ba.error012(K));return}e.selectionRect=null,e.selectionRectMode=null,_.selected?(C||_.selected&&e.multiselectionKeyPressed)&&(V({nodes:[_],edges:[]}),requestAnimationFrame(()=>N==null?void 0:N.blur())):O([K])}function U(K){const C=e.edgeLookup.get(K);if(!C){console.warn("012",Ba.error012(K));return}(C.selectable||e.elementsSelectable&&typeof C.selectable>"u")&&(e.selectionRect=null,e.selectionRectMode=null,C.selected?C.selected&&e.multiselectionKeyPressed&&V({nodes:[],edges:[C]}):k([K]))}function Q(K,C){const{nodeExtent:N,snapGrid:_,nodeOrigin:z,nodeLookup:I,nodesDraggable:D,onerror:T}=e,$=new Map,X=(_==null?void 0:_[0])??5,H=(_==null?void 0:_[1])??5,W=K.x*X*C,Y=K.y*H*C;for(const ae of I.values()){if(!(ae.selected&&(ae.draggable||D&&typeof ae.draggable>"u")))continue;let ie={x:ae.internals.positionAbsolute.x+W,y:ae.internals.positionAbsolute.y+Y};_&&(ie=lo(ie,_));const{position:ee,positionAbsolute:q}=Od({nodeId:ae.id,nextPosition:ie,nodeLookup:I,nodeExtent:N,nodeOrigin:z,onError:T});ae.position=ee,ae.internals.positionAbsolute=q,$.set(ae.id,ae)}s($)}function se(K){return Pw({delta:K,panZoom:e.panZoom,transform:[e.viewport.x,e.viewport.y,e.viewport.zoom],translateExtent:e.translateExtent,width:e.width,height:e.height})}const xe=K=>{e._connection={...K}};function le(){e._connection=fs}function te(){e.resetStoreValues(),V()}return Object.assign(e,{setNodeTypes:r,setEdgeTypes:a,addEdge:o,updateNodePositions:s,updateNodeInternals:i,zoomIn:p,zoomOut:b,fitView:c,setCenter:f,setMinZoom:h,setMaxZoom:w,setTranslateExtent:M,unselectNodesAndEdges:V,addSelectedNodes:O,addSelectedEdges:k,handleNodeSelection:F,handleEdgeSelection:U,moveSelectedNodes:Q,panBy:se,updateConnection:xe,cancelConnection:le,reset:te})}function Ri(t,e){const{minZoom:r,maxZoom:a,initialViewport:o,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:c,translateExtent:f,setPanZoomInstance:g,onDraggingChange:p,onTransformChange:b}=e,h=Gw({domNode:t,minZoom:r,maxZoom:a,translateExtent:f,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:c,onDraggingChange:p}),w=h.getViewport();return(o.x!==w.x||o.y!==w.y||o.zoom!==w.zoom)&&b([w.x,w.y,w.zoom]),g(h),h.update(e),{update(M){h.update(M)}}}var C3=x('<div class="svelte-flow__zoom svelte-flow__container"><!></div>');function E3(t,e){ot(e,!0);let r=Ye(e,"store",15),a=y(()=>r().panActivationKeyPressed||e.panOnDrag),o=y(()=>r().panActivationKeyPressed||e.panOnScroll);const{viewport:s}=r();let i=!1;an(()=>{var g;!i&&r().viewportInitialized&&((g=e.oninit)==null||g.call(e),i=!0)});var c=C3(),f=d(c);pn(f,()=>e.children),l(c),Hn(c,(g,p)=>Ri==null?void 0:Ri(g,p),()=>({viewport:r().viewport,minZoom:r().minZoom,maxZoom:r().maxZoom,initialViewport:s,onDraggingChange:g=>{r(r().dragging=g,!0)},setPanZoomInstance:g=>{r(r().panZoom=g,!0)},onPanZoomStart:e.onmovestart,onPanZoom:e.onmove,onPanZoomEnd:e.onmoveend,zoomOnScroll:e.zoomOnScroll,zoomOnDoubleClick:e.zoomOnDoubleClick,zoomOnPinch:e.zoomOnPinch,panOnScroll:n(o),panOnDrag:n(a),panOnScrollSpeed:e.panOnScrollSpeed,panOnScrollMode:e.panOnScrollMode,zoomActivationKeyPressed:r().zoomActivationKeyPressed,preventScrolling:typeof e.preventScrolling=="boolean"?e.preventScrolling:!0,noPanClassName:r().noPanClass,noWheelClassName:r().noWheelClass,userSelectionActive:!!r().selectionRect,translateExtent:r().translateExtent,lib:"svelte",paneClickDistance:e.paneClickDistance,selectionOnDrag:e.selectionOnDrag,onTransformChange:g=>{r(r().viewport={x:g[0],y:g[1],zoom:g[2]},!0)},connectionInProgress:r().connection.inProgress})),v(t,c),it()}function oc(t,e){return r=>{r.target===e&&(t==null||t(r))}}function ic(t){return e=>{const r=t.has(e.id);return!!e.selected!==r?{...e,selected:r}:e}}function sc(t,e){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}var N3=x("<div><!></div>");function M3(t,e){ot(e,!0);let r=Ye(e,"store",15),a=Ye(e,"panOnDrag",3,!0),o=Ye(e,"paneClickDistance",3,1),s,i=null,c=new Set,f=new Set,g=y(()=>r().panActivationKeyPressed||a()),p=y(()=>r().selectionKeyPressed||!!r().selectionRect||e.selectionOnDrag&&n(g)!==!0),b=y(()=>r().elementsSelectable&&(n(p)||r().selectionRectMode==="user")),h=!1;function w(le){var _,z;if(i=s==null?void 0:s.getBoundingClientRect(),!i)return;const te=le.target===s,be=!te&&!!le.target.closest(".nokey"),K=e.selectionOnDrag&&te||r().selectionKeyPressed;if(be||!n(p)||!K||le.button!==0||!le.isPrimary)return;(z=(_=le.target)==null?void 0:_.setPointerCapture)==null||z.call(_,le.pointerId),h=!1;const{x:C,y:N}=ir(le,i);r(r().selectionRect={width:0,height:0,startX:C,startY:N,x:C,y:N},!0),te||(le.stopPropagation(),le.preventDefault())}function M(le){var I;if(!n(p)||!i||!r().selectionRect)return;const te=ir(le,i),{startX:be=0,startY:K=0}=r().selectionRect;if(!h){const D=r().selectionKeyPressed?0:o();if(Math.hypot(te.x-be,te.y-K)<=D)return;r().unselectNodesAndEdges(),(I=e.onselectionstart)==null||I.call(e,le)}h=!0;const C={...r().selectionRect,x:te.x<be?te.x:be,y:te.y<K?te.y:K,width:Math.abs(te.x-be),height:Math.abs(te.y-K)},N=c,_=f;c=new Set(Os(r().nodeLookup,C,[r().viewport.x,r().viewport.y,r().viewport.zoom],r().selectionMode===jo.Partial,!0).map(D=>D.id));const z=r().defaultEdgeOptions.selectable??!0;f=new Set;for(const D of c){const T=r().connectionLookup.get(D);if(T)for(const{edgeId:$}of T.values()){const X=r().edgeLookup.get($);X&&(X.selectable??z)&&f.add($)}}sc(N,c)||r(r().nodes=r().nodes.map(ic(c)),!0),sc(_,f)||r(r().edges=r().edges.map(ic(f)),!0),r(r().selectionRectMode="user",!0),r(r().selectionRect=C,!0)}function P(le){var te,be,K;le.button===0&&((be=(te=le.target)==null?void 0:te.releasePointerCapture)==null||be.call(te,le.pointerId),!h&&le.target===s&&(k==null||k(le)),r(r().selectionRect=null,!0),h&&r(r().selectionRectMode=c.size>0?"nodes":null,!0),h&&((K=e.onselectionend)==null||K.call(e,le)))}const V=le=>{var te;if(Array.isArray(n(g))&&n(g).includes(2)){le.preventDefault();return}(te=e.onpanecontextmenu)==null||te.call(e,{event:le})},O=le=>{h&&(le.stopPropagation(),h=!1)};function k(le){var te;if(h||r().connection.inProgress){h=!1;return}(te=e.onpaneclick)==null||te.call(e,{event:le}),r().unselectNodesAndEdges(),r(r().selectionRectMode=null,!0),r(r().selectionRect=null,!0)}var F=N3();let U;var Q=y(()=>n(b)?void 0:oc(k,s)),se=y(()=>oc(V,s)),xe=d(F);pn(xe,()=>e.children),l(F),sr(F,le=>s=le,()=>s),L(le=>U=Ve(F,1,"svelte-flow__pane svelte-flow__container",null,U,le),[()=>({draggable:a()===!0||Array.isArray(a())&&a().includes(0),dragging:r().dragging,selection:n(p)})]),we("click",F,function(...le){var te;(te=n(Q))==null||te.apply(this,le)}),kr("pointerdown",F,function(...le){var te;(te=n(b)?w:void 0)==null||te.apply(this,le)},!0),we("pointermove",F,function(...le){var te;(te=n(b)?M:void 0)==null||te.apply(this,le)}),we("pointerup",F,function(...le){var te;(te=n(b)?P:void 0)==null||te.apply(this,le)}),we("contextmenu",F,function(...le){var te;(te=n(se))==null||te.apply(this,le)}),kr("click",F,function(...le){var te;(te=n(b)?O:void 0)==null||te.apply(this,le)},!0),v(t,F),it()}tn(["click","pointermove","pointerup","contextmenu"]);var z3=x('<div class="svelte-flow__viewport xyflow__viewport svelte-flow__container"><!></div>');function T3(t,e){ot(e,!0);var r=z3();let a;var o=d(r);pn(o,()=>e.children),l(r),L(()=>a=kn(r,"",a,{transform:`translate(${e.store.viewport.x??""}px, ${e.store.viewport.y??""}px) scale(${e.store.viewport.zoom??""})`})),v(t,r),it()}function ua(t,e){const{store:r,onDrag:a,onDragStart:o,onDragStop:s,onNodeMouseDown:i}=e,c=Ow({onDrag:a,onDragStart:o,onDragStop:s,onNodeMouseDown:i,getStoreItems:()=>{const{snapGrid:g,viewport:p}=r;return{nodes:r.nodes,nodeLookup:r.nodeLookup,edges:r.edges,nodeExtent:r.nodeExtent,snapGrid:g||[0,0],snapToGrid:!!g,nodeOrigin:r.nodeOrigin,multiSelectionActive:r.multiselectionKeyPressed,domNode:r.domNode,transform:[p.x,p.y,p.zoom],autoPanOnNodeDrag:r.autoPanOnNodeDrag,nodesDraggable:r.nodesDraggable,selectNodesOnDrag:r.selectNodesOnDrag,nodeDragThreshold:r.nodeDragThreshold,unselectNodesAndEdges:r.unselectNodesAndEdges,updateNodePositions:r.updateNodePositions,onSelectionDrag:r.onselectiondrag,onSelectionDragStart:r.onselectiondragstart,onSelectionDragStop:r.onselectiondragstop,panBy:r.panBy}}});function f(g,p){if(p.disabled){c.destroy();return}c.update({domNode:g,noDragClassName:p.noDragClass,handleSelector:p.handleSelector,nodeId:p.nodeId,isSelectable:p.isSelectable,nodeClickDistance:p.nodeClickDistance})}return f(t,e),{update(g){f(t,g)},destroy(){c.destroy()}}}var P3=x('<div aria-live="assertive" aria-atomic="true" class="a11y-live-msg svelte-1r7ybe1"> </div>'),A3=x('<div class="a11y-hidden svelte-1r7ybe1"> </div> <div class="a11y-hidden svelte-1r7ybe1"> </div> <!>',1);function L3(t,e){ot(e,!0);var r=A3(),a=ue(r),o=d(a,!0);l(a);var s=u(a,2),i=d(s,!0);l(s);var c=u(s,2);{var f=g=>{var p=P3(),b=d(p,!0);l(p),L(()=>{Pe(p,"id",`${I3}-${e.store.flowId}`),S(b,e.store.ariaLiveMessage)}),v(g,p)};B(c,g=>{e.store.disableKeyboardA11y||g(f)})}L(()=>{Pe(a,"id",`${au}-${e.store.flowId}`),S(o,e.store.disableKeyboardA11y?e.store.ariaLabelConfig["node.a11yDescription.default"]:e.store.ariaLabelConfig["node.a11yDescription.keyboardDisabled"]),Pe(s,"id",`${ou}-${e.store.flowId}`),S(i,e.store.ariaLabelConfig["edge.a11yDescription.default"])}),v(t,r),it()}const au="svelte-flow__node-desc",ou="svelte-flow__edge-desc",I3="svelte-flow__aria-live";var O3=x("<div><!></div>");function R3(t,e){ot(e,!0);let r=Ye(e,"store",15),a=y(()=>Vn(e.node.data,()=>({}),!0)),o=y(()=>Vn(e.node.selected,!1)),s=y(()=>e.node.draggable),i=y(()=>e.node.selectable),c=y(()=>Vn(e.node.deletable,!0)),f=y(()=>e.node.connectable),g=y(()=>e.node.focusable),p=y(()=>Vn(e.node.hidden,!1)),b=y(()=>Vn(e.node.dragging,!1)),h=y(()=>Vn(e.node.style,"")),w=y(()=>e.node.class),M=y(()=>Vn(e.node.type,"default")),P=y(()=>e.node.parentId),V=y(()=>e.node.sourcePosition),O=y(()=>e.node.targetPosition),k=y(()=>Vn(e.node.measured,()=>({width:0,height:0}),!0).width),F=y(()=>Vn(e.node.measured,()=>({width:0,height:0}),!0).height),U=y(()=>e.node.initialWidth),Q=y(()=>e.node.initialHeight),se=y(()=>e.node.width),xe=y(()=>e.node.height),le=y(()=>e.node.dragHandle),te=y(()=>Vn(e.node.internals.z,0)),be=y(()=>e.node.internals.positionAbsolute.x),K=y(()=>e.node.internals.positionAbsolute.y),C=y(()=>e.node.internals.userNode),{id:N}=e.node,_=y(()=>n(s)??r().nodesDraggable),z=y(()=>n(i)??r().elementsSelectable),I=y(()=>n(f)??r().nodesConnectable),D=y(()=>sw(e.node)),T=y(()=>!!e.node.internals.handleBounds),$=y(()=>n(D)&&n(T)),X=y(()=>n(g)??r().nodesFocusable);function H(pe){return r().parentLookup.has(pe)}let W=y(()=>H(N)),Y=_e(null),ae=null,ge=n(M),ie=n(V),ee=n(O),q=y(()=>r().nodeTypes[n(M)]??eu),G=y(()=>r().ariaLabelConfig),E={get value(){return n(I)}};Xw(N),Qw(E);let j=y(()=>{const pe=n(k)===void 0?n(se)??n(U):n(se),Ee=n(F)===void 0?n(xe)??n(Q):n(xe);if(!(pe===void 0&&Ee===void 0&&n(h)===void 0))return`${n(h)};${pe?`width:${vr(pe)};`:""}${Ee?`height:${vr(Ee)};`:""}`});an(()=>{(n(M)!==ge||n(V)!==ie||n(O)!==ee)&&n(Y)!==null&&requestAnimationFrame(()=>{n(Y)!==null&&r().updateNodeInternals(new Map([[N,{id:N,nodeElement:n(Y),force:!0}]]))}),ge=n(M),ie=n(V),ee=n(O)}),an(()=>{e.resizeObserver&&(!n($)||n(Y)!==ae)&&(ae&&e.resizeObserver.unobserve(ae),n(Y)&&e.resizeObserver.observe(n(Y)),ae=n(Y))}),Qo(()=>{var pe;ae&&((pe=e.resizeObserver)==null||pe.unobserve(ae))});function R(pe){var Ee;n(z)&&(!r().selectNodesOnDrag||!n(_)||r().nodeDragThreshold>0)&&r().handleNodeSelection(N),(Ee=e.onnodeclick)==null||Ee.call(e,{node:n(C),event:pe})}function A(pe){if(!(Hd(pe)||r().disableKeyboardA11y))if(Ld.includes(pe.key)&&n(z)){const Ee=pe.key==="Escape";r().handleNodeSelection(N,Ee,n(Y))}else n(_)&&e.node.selected&&Object.prototype.hasOwnProperty.call(Yo,pe.key)&&(pe.preventDefault(),r(r().ariaLiveMessage=n(G)["node.a11yDescription.ariaLiveMessage"]({direction:pe.key.replace("Arrow","").toLowerCase(),x:~~e.node.internals.positionAbsolute.x,y:~~e.node.internals.positionAbsolute.y}),!0),r().moveSelectedNodes(Yo[pe.key],pe.shiftKey?4:1))}const Z=()=>{var ce;if(r().disableKeyboardA11y||!r().autoPanOnNodeFocus||!((ce=n(Y))!=null&&ce.matches(":focus-visible")))return;const{width:pe,height:Ee,viewport:Se}=r();Os(new Map([[N,e.node]]),{x:0,y:0,width:pe,height:Ee},[Se.x,Se.y,Se.zoom],!0).length>0||r().setCenter(e.node.position.x+(e.node.measured.width??0)/2,e.node.position.y+(e.node.measured.height??0)/2,{zoom:Se.zoom})};var J=De(),oe=ue(J);{var me=pe=>{var Ee=O3();zr(Ee,()=>({"data-id":N,class:["svelte-flow__node",`svelte-flow__node-${n(M)}`,n(w)],style:n(j),onclick:R,onpointerenter:e.onnodepointerenter?ve=>e.onnodepointerenter({node:n(C),event:ve}):void 0,onpointerleave:e.onnodepointerleave?ve=>e.onnodepointerleave({node:n(C),event:ve}):void 0,onpointermove:e.onnodepointermove?ve=>e.onnodepointermove({node:n(C),event:ve}):void 0,oncontextmenu:e.onnodecontextmenu?ve=>e.onnodecontextmenu({node:n(C),event:ve}):void 0,onkeydown:n(X)?A:void 0,onfocus:n(X)?Z:void 0,tabIndex:n(X)?0:void 0,role:e.node.ariaRole??(n(X)?"group":void 0),"aria-roledescription":"node","aria-describedby":r().disableKeyboardA11y?void 0:`${au}-${r().flowId}`,...e.node.domAttributes,[ys]:{dragging:n(b),selected:n(o),draggable:n(_),connectable:n(I),selectable:n(z),nopan:n(_),parent:n(W)},[ei]:{"z-index":n(te),transform:`translate(${n(be)??""}px, ${n(K)??""}px)`,visibility:n(D)?"visible":"hidden"}}));var Se=d(Ee);Wr(Se,()=>n(q),(ve,ce)=>{ce(ve,{get data(){return n(a)},get id(){return N},get selected(){return n(o)},get selectable(){return n(z)},get deletable(){return n(c)},get sourcePosition(){return n(V)},get targetPosition(){return n(O)},get zIndex(){return n(te)},get dragging(){return n(b)},get draggable(){return n(_)},get dragHandle(){return n(le)},get parentId(){return n(P)},get type(){return n(M)},get isConnectable(){return n(I)},get positionAbsoluteX(){return n(be)},get positionAbsoluteY(){return n(K)},get width(){return n(se)},get height(){return n(xe)}})}),l(Ee),Hn(Ee,(ve,ce)=>ua==null?void 0:ua(ve,ce),()=>({nodeId:N,isSelectable:n(z),disabled:!n(_),handleSelector:n(le),noDragClass:r().noDragClass,nodeClickDistance:e.nodeClickDistance,onNodeMouseDown:r().handleNodeSelection,onDrag:(ve,ce,Oe,re)=>{var de;(de=e.onnodedrag)==null||de.call(e,{event:ve,targetNode:Oe,nodes:re})},onDragStart:(ve,ce,Oe,re)=>{var de;(de=e.onnodedragstart)==null||de.call(e,{event:ve,targetNode:Oe,nodes:re})},onDragStop:(ve,ce,Oe,re)=>{var de;(de=e.onnodedragstop)==null||de.call(e,{event:ve,targetNode:Oe,nodes:re})},store:r()})),sr(Ee,ve=>m(Y,ve),()=>n(Y)),v(pe,Ee)};B(oe,pe=>{n(p)||pe(me)})}v(t,J),it()}var D3=x('<div class="svelte-flow__nodes"></div>');function $3(t,e){ot(e,!0);let r=Ye(e,"store",15);const a=typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const i=new Map;s.forEach(c=>{const f=c.target.getAttribute("data-id");i.set(f,{id:f,nodeElement:c.target,force:!0})}),r().updateNodeInternals(i)});Qo(()=>{a==null||a.disconnect()});var o=D3();Qe(o,21,()=>r().visible.nodes.values(),s=>s.id,(s,i)=>{R3(s,{get node(){return n(i)},get resizeObserver(){return a},get nodeClickDistance(){return e.nodeClickDistance},get onnodeclick(){return e.onnodeclick},get onnodepointerenter(){return e.onnodepointerenter},get onnodepointermove(){return e.onnodepointermove},get onnodepointerleave(){return e.onnodepointerleave},get onnodedrag(){return e.onnodedrag},get onnodedragstart(){return e.onnodedragstart},get onnodedragstop(){return e.onnodedragstop},get onnodecontextmenu(){return e.onnodecontextmenu},get store(){return r()},set store(c){r(c)}})}),l(o),v(t,o),it()}var V3=En('<svg class="svelte-flow__edge-wrapper"><g><!></g></svg>');function H3(t,e){ot(e,!0);let r=y(()=>e.edge.id),a=y(()=>e.edge.source),o=y(()=>e.edge.target),s=y(()=>e.edge.sourceX),i=y(()=>e.edge.sourceY),c=y(()=>e.edge.targetX),f=y(()=>e.edge.targetY),g=y(()=>e.edge.sourcePosition),p=y(()=>e.edge.targetPosition),b=y(()=>Vn(e.edge.animated,!1)),h=y(()=>Vn(e.edge.selected,!1)),w=y(()=>e.edge.label),M=y(()=>e.edge.labelStyle),P=y(()=>Vn(e.edge.data,()=>({}),!0)),V=y(()=>e.edge.style),O=y(()=>e.edge.interactionWidth),k=y(()=>Vn(e.edge.type,"default")),F=y(()=>e.edge.sourceHandle),U=y(()=>e.edge.targetHandle),Q=y(()=>e.edge.markerStart),se=y(()=>e.edge.markerEnd),xe=y(()=>e.edge.selectable),le=y(()=>e.edge.focusable),te=y(()=>Vn(e.edge.deletable,!0)),be=y(()=>e.edge.hidden),K=y(()=>e.edge.zIndex),C=y(()=>e.edge.class),N=y(()=>e.edge.ariaLabel);e3(n(r));let _=null,z=y(()=>n(xe)??e.store.elementsSelectable),I=y(()=>n(le)??e.store.edgesFocusable),D=y(()=>e.store.edgeTypes[n(k)]??tu),T=y(()=>n(Q)?`url('#${gs(n(Q),e.store.flowId)}')`:void 0),$=y(()=>n(se)?`url('#${gs(n(se),e.store.flowId)}')`:void 0);function X(ie){var q;const ee=e.store.edgeLookup.get(n(r));ee&&(n(z)&&e.store.handleEdgeSelection(n(r)),(q=e.onedgeclick)==null||q.call(e,{event:ie,edge:ee}))}function H(ie,ee){const q=e.store.edgeLookup.get(n(r));q&&ee({event:ie,edge:q})}function W(ie){if(!e.store.disableKeyboardA11y&&Ld.includes(ie.key)&&n(z)){const{unselectNodesAndEdges:ee,addSelectedEdges:q}=e.store;ie.key==="Escape"?(_==null||_.blur(),ee({edges:[e.edge]})):q([n(r)])}}var Y=De(),ae=ue(Y);{var ge=ie=>{var ee=V3();let q;var G=d(ee);zr(G,()=>({class:["svelte-flow__edge",n(C)],"data-id":n(r),onclick:X,oncontextmenu:e.onedgecontextmenu?j=>{H(j,e.onedgecontextmenu)}:void 0,onpointerenter:e.onedgepointerenter?j=>{H(j,e.onedgepointerenter)}:void 0,onpointerleave:e.onedgepointerleave?j=>{H(j,e.onedgepointerleave)}:void 0,"aria-label":n(N)===null?void 0:n(N)?n(N):`Edge from ${n(a)} to ${n(o)}`,"aria-describedby":n(I)?`${ou}-${e.store.flowId}`:void 0,role:e.edge.ariaRole??(n(I)?"group":"img"),"aria-roledescription":"edge",onkeydown:n(I)?W:void 0,tabindex:n(I)?0:void 0,...e.edge.domAttributes,[ys]:{animated:n(b),selected:n(h),selectable:n(z)}}));var E=d(G);Wr(E,()=>n(D),(j,R)=>{R(j,{get id(){return n(r)},get source(){return n(a)},get target(){return n(o)},get sourceX(){return n(s)},get sourceY(){return n(i)},get targetX(){return n(c)},get targetY(){return n(f)},get sourcePosition(){return n(g)},get targetPosition(){return n(p)},get animated(){return n(b)},get selected(){return n(h)},get label(){return n(w)},get labelStyle(){return n(M)},get data(){return n(P)},get style(){return n(V)},get interactionWidth(){return n(O)},get selectable(){return n(z)},get deletable(){return n(te)},get type(){return n(k)},get sourceHandleId(){return n(F)},get targetHandleId(){return n(U)},get markerStart(){return n(T)},get markerEnd(){return n($)}})}),l(G),sr(G,j=>_=j,()=>_),l(ee),L(()=>q=kn(ee,"",q,{"z-index":n(K)})),v(ie,ee)};B(ae,ie=>{n(be)||ie(ge)})}v(t,Y),it()}var F3=En("<defs></defs>");function q3(t,e){ot(e,!1);const r=Xr();_c();var a=F3();Qe(a,5,()=>r.markers,o=>o.id,(o,s)=>{W3(o,lt(()=>n(s)))}),l(a),v(t,a),it()}var K3=En('<polyline class="arrow" fill="none" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4"></polyline>'),j3=En('<polyline class="arrowclosed" stroke-linecap="round" stroke-linejoin="round" points="-5,-4 0,0 -5,4 -5,-4"></polyline>'),B3=En('<marker class="svelte-flow__arrowhead" viewBox="-10 -10 20 20" refX="0" refY="0"><!></marker>');function W3(t,e){ot(e,!0);let r=Ye(e,"width",3,12.5),a=Ye(e,"height",3,12.5),o=Ye(e,"markerUnits",3,"strokeWidth"),s=Ye(e,"orient",3,"auto-start-reverse"),i=Ye(e,"color",3,"none");var c=B3(),f=d(c);{var g=b=>{var h=K3();let w;L(()=>{Pe(h,"stroke-width",e.strokeWidth),w=kn(h,"",w,{stroke:i()})}),v(b,h)},p=b=>{var h=j3();let w;L(()=>{Pe(h,"stroke-width",e.strokeWidth),w=kn(h,"",w,{stroke:i(),fill:i()})}),v(b,h)};B(f,b=>{e.type===Bo.Arrow?b(g):e.type===Bo.ArrowClosed&&b(p,1)})}l(c),L(()=>{Pe(c,"id",e.id),Pe(c,"markerWidth",`${r()}`),Pe(c,"markerHeight",`${a()}`),Pe(c,"markerUnits",o()),Pe(c,"orient",s())}),v(t,c),it()}var U3=x('<div class="svelte-flow__edges"><svg class="svelte-flow__marker"><!></svg> <!></div>');function G3(t,e){ot(e,!0);let r=Ye(e,"store",15);var a=U3(),o=d(a),s=d(o);q3(s,{}),l(o);var i=u(o,2);Qe(i,17,()=>r().visible.edges.values(),c=>c.id,(c,f)=>{H3(c,{get edge(){return n(f)},get onedgeclick(){return e.onedgeclick},get onedgecontextmenu(){return e.onedgecontextmenu},get onedgepointerenter(){return e.onedgepointerenter},get onedgepointerleave(){return e.onedgepointerleave},get store(){return r()},set store(g){r(g)}})}),l(a),v(t,a),it()}var Y3=x('<div class="svelte-flow__selection svelte-3lfgml"></div>');function iu(t,e){ot(e,!0);let r=Ye(e,"x",3,0),a=Ye(e,"y",3,0),o=Ye(e,"width",3,0),s=Ye(e,"height",3,0),i=Ye(e,"isVisible",3,!0);var c=De(),f=ue(c);{var g=p=>{var b=Y3();let h;L(w=>h=kn(b,"",h,w),[()=>({width:typeof o()=="string"?o():vr(o()),height:typeof s()=="string"?s():vr(s()),transform:`translate(${r()}px, ${a()}px)`})]),v(p,b)};B(f,p=>{i()&&p(g)})}v(t,c),it()}var X3=x("<div><!></div>");function Z3(t,e){ot(e,!0);let r=_e(void 0);an(()=>{var b;e.store.disableKeyboardA11y||(b=n(r))==null||b.focus({preventScroll:!0})});let a=y(()=>{if(e.store.selectionRectMode==="nodes"){e.store.nodes;const b=si(e.store.nodeLookup,{filter:h=>!!h.selected});if(b.width>0&&b.height>0)return b}return null});function o(b){var w;const h=e.store.nodes.filter(M=>M.selected);(w=e.onselectioncontextmenu)==null||w.call(e,{nodes:h,event:b})}function s(b){var w;const h=e.store.nodes.filter(M=>M.selected);(w=e.onselectionclick)==null||w.call(e,{nodes:h,event:b})}function i(b){Object.prototype.hasOwnProperty.call(Yo,b.key)&&(b.preventDefault(),e.store.moveSelectedNodes(Yo[b.key],b.shiftKey?4:1))}var c=De(),f=ue(c);{var g=b=>{var h=X3();let w;var M=d(h);iu(M,{width:"100%",height:"100%",x:0,y:0}),l(h),Hn(h,(P,V)=>ua==null?void 0:ua(P,V),()=>({disabled:!1,store:e.store,onDrag:(P,V,O,k)=>{var F;(F=e.onnodedrag)==null||F.call(e,{event:P,targetNode:null,nodes:k})},onDragStart:(P,V,O,k)=>{var F;(F=e.onnodedragstart)==null||F.call(e,{event:P,targetNode:null,nodes:k})},onDragStop:(P,V,O,k)=>{var F;(F=e.onnodedragstop)==null||F.call(e,{event:P,targetNode:null,nodes:k})}})),sr(h,P=>m(r,P),()=>n(r)),L(P=>{Ve(h,1,Ke(["svelte-flow__selection-wrapper",e.store.noPanClass]),"svelte-148ck9l"),Pe(h,"role",e.store.disableKeyboardA11y?void 0:"button"),Pe(h,"tabindex",e.store.disableKeyboardA11y?void 0:-1),w=kn(h,"",w,P)},[()=>({width:vr(n(a).width),height:vr(n(a).height),transform:`translate(${n(a).x??""}px, ${n(a).y??""}px)`})]),we("contextmenu",h,o),we("click",h,s),we("keydown",h,function(...P){var V;(V=e.store.disableKeyboardA11y?void 0:i)==null||V.apply(this,P)}),v(b,h)},p=y(()=>e.store.selectionRectMode==="nodes"&&n(a)&&yr(n(a).x)&&yr(n(a).y));B(f,b=>{n(p)&&b(g)})}v(t,c),it()}tn(["contextmenu","click","keydown"]);function Q3(t){switch(t){case"ctrl":return 8;case"shift":return 4;case"alt":return 2;case"meta":return 1}}function nn(t,e){let{enabled:r=!0,trigger:a,type:o="keydown"}=e;function s(c){var p;const f=Array.isArray(a)?a:[a],g=[c.metaKey,c.altKey,c.shiftKey,c.ctrlKey].reduce((b,h,w)=>h?b|1<<w:b,0);for(const b of f){const h={preventDefault:!1,enabled:!0,...b},{modifier:w,key:M,callback:P,preventDefault:V,enabled:O}=h;if(O){if(c.key!==M)continue;if(w===null||w===!1){if(g!==0)continue}else if(w!==void 0&&((p=w==null?void 0:w[0])==null?void 0:p.length)>0){const F=Array.isArray(w)?w:[w];let U=!1;for(const Q of F)if((Array.isArray(Q)?Q:[Q]).reduce((xe,le)=>xe|Q3(le),0)===g){U=!0;break}if(!U)continue}V&&c.preventDefault();const k={node:t,trigger:h,originalEvent:c};t.dispatchEvent(new CustomEvent("shortcut",{detail:k})),P==null||P(k)}}}let i;return r&&(i=Ki(t,o,s)),{update:c=>{const{enabled:f=!0,type:g="keydown"}=c;r&&(!f||o!==g)?i==null||i():!r&&f&&(i=Ki(t,g,s)),r=f,o=g,a=c.trigger},destroy:()=>{i==null||i()}}}function J3(){const t=y(Xr),e=s=>{var g,p;const i=rc(s)?s:n(t).nodeLookup.get(s.id),c=i.parentId?lw(i.position,i.measured,i.parentId,n(t).nodeLookup,n(t).nodeOrigin):i.position,f={...i,position:c,width:((g=i.measured)==null?void 0:g.width)??i.width,height:((p=i.measured)==null?void 0:p.height)??i.height};return xa(f)};function r(s,i,c={replace:!1}){n(t).nodes=mr(()=>n(t).nodes).map(f=>{if(f.id===s){const g=typeof i=="function"?i(f):i;return c!=null&&c.replace&&rc(g)?g:{...f,...g}}return f})}function a(s,i,c={replace:!1}){n(t).edges=mr(()=>n(t).edges).map(f=>{if(f.id===s){const g=typeof i=="function"?i(f):i;return c.replace&&c3(g)?g:{...f,...g}}return f})}const o=s=>n(t).nodeLookup.get(s);return{zoomIn:n(t).zoomIn,zoomOut:n(t).zoomOut,getInternalNode:o,getNode:s=>{var i;return(i=o(s))==null?void 0:i.internals.userNode},getNodes:s=>s===void 0?n(t).nodes:lc(n(t).nodeLookup,s),getEdge:s=>n(t).edgeLookup.get(s),getEdges:s=>s===void 0?n(t).edges:lc(n(t).edgeLookup,s),setZoom:(s,i)=>{const c=n(t).panZoom;return c?c.scaleTo(s,i):Promise.resolve(!1)},getZoom:()=>n(t).viewport.zoom,setViewport:async(s,i)=>{const c=n(t).viewport;return n(t).panZoom?(await n(t).panZoom.setViewport({x:s.x??c.x,y:s.y??c.y,zoom:s.zoom??c.zoom},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>wc(n(t).viewport),setCenter:async(s,i,c)=>n(t).setCenter(s,i,c),fitView:s=>n(t).fitView(s),fitBounds:async(s,i)=>{if(!n(t).panZoom)return Promise.resolve(!1);const c=Rs(s,n(t).width,n(t).height,n(t).minZoom,n(t).maxZoom,(i==null?void 0:i.padding)??.1);return await n(t).panZoom.setViewport(c,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)},getIntersectingNodes:(s,i=!0,c)=>{const f=Bl(s),g=f?s:e(s);return g?(c||n(t).nodes).filter(p=>{const b=n(t).nodeLookup.get(p.id);if(!b||!f&&p.id===s.id)return!1;const h=xa(b),w=Wa(h,g);return i&&w>0||w>=h.width*h.height||w>=g.width*g.height}):[]},isNodeIntersecting:(s,i,c=!0)=>{const g=Bl(s)?s:e(s);if(!g)return!1;const p=Wa(g,i);return c&&p>0||p>=i.width*i.height||p>=g.width*g.height},deleteElements:async({nodes:s=[],edges:i=[]})=>{var g,p;const{nodes:c,edges:f}=await nw({nodesToRemove:s,edgesToRemove:i,nodes:n(t).nodes,edges:n(t).edges,onBeforeDelete:n(t).onbeforedelete});return c&&(n(t).nodes=mr(()=>n(t).nodes).filter(b=>!c.some(({id:h})=>h===b.id))),f&&(n(t).edges=mr(()=>n(t).edges).filter(b=>!f.some(({id:h})=>h===b.id))),(c.length>0||f.length>0)&&((p=(g=n(t)).ondelete)==null||p.call(g,{nodes:c,edges:f})),{deletedNodes:c,deletedEdges:f}},screenToFlowPosition:(s,i={snapToGrid:!0})=>{if(!n(t).domNode)return s;const c=i.snapToGrid?n(t).snapGrid:!1,{x:f,y:g,zoom:p}=n(t).viewport,{x:b,y:h}=n(t).domNode.getBoundingClientRect(),w={x:s.x-b,y:s.y-h};return co(w,[f,g,p],c!==null,c||[1,1])},flowToScreenPosition:s=>{if(!n(t).domNode)return s;const{x:i,y:c,zoom:f}=n(t).viewport,{x:g,y:p}=n(t).domNode.getBoundingClientRect(),b=Uo(s,[i,c,f]);return{x:b.x+g,y:b.y+p}},toObject:()=>structuredClone({nodes:[...n(t).nodes],edges:[...n(t).edges],viewport:{...n(t).viewport}}),updateNode:r,updateNodeData:(s,i,c)=>{var p;const f=(p=n(t).nodeLookup.get(s))==null?void 0:p.internals.userNode;if(!f)return;const g=typeof i=="function"?i(f):i;r(s,b=>({...b,data:c!=null&&c.replace?g:{...b.data,...g}}))},updateEdge:a,getNodesBounds:s=>Q2(s,{nodeLookup:n(t).nodeLookup,nodeOrigin:n(t).nodeOrigin}),getHandleConnections:({type:s,id:i,nodeId:c})=>{var f;return Array.from(((f=n(t).connectionLookup.get(`${c}-${s}-${i??null}`))==null?void 0:f.values())??[])}}}function lc(t,e){var a;const r=[];for(const o of e){const s=t.get(o);if(s){const i="internals"in s?(a=s.internals)==null?void 0:a.userNode:s;r.push(i)}}return r}function ek(t,e){ot(e,!0);let r=Ye(e,"store",15),a=Ye(e,"selectionKey",3,"Shift"),o=Ye(e,"multiSelectionKey",19,()=>Go()?"Meta":"Control"),s=Ye(e,"deleteKey",3,"Backspace"),i=Ye(e,"panActivationKey",3," "),c=Ye(e,"zoomActivationKey",19,()=>Go()?"Meta":"Control"),{deleteElements:f}=J3();function g(P){return P!==null&&typeof P=="object"}function p(P){return g(P)?P.modifier||[]:[]}function b(P){return P==null?"":g(P)?P.key:P}function h(P,V){return(Array.isArray(P)?P:[P]).map(k=>{const F=b(k);return{key:F,modifier:p(k),enabled:F!==null,callback:V}})}function w(){r(r().selectionRect=null,!0),r(r().selectionKeyPressed=!1,!0),r(r().multiselectionKeyPressed=!1,!0),r(r().deleteKeyPressed=!1,!0),r(r().panActivationKeyPressed=!1,!0),r(r().zoomActivationKeyPressed=!1,!0)}function M(){const P=r().nodes.filter(O=>O.selected),V=r().edges.filter(O=>O.selected);f({nodes:P,edges:V})}kr("blur",jn,w),kr("contextmenu",jn,w),Hn(jn,(P,V)=>nn==null?void 0:nn(P,V),()=>({trigger:h(a(),()=>r(r().selectionKeyPressed=!0,!0)),type:"keydown"})),Hn(jn,(P,V)=>nn==null?void 0:nn(P,V),()=>({trigger:h(a(),()=>r(r().selectionKeyPressed=!1,!0)),type:"keyup"})),Hn(jn,(P,V)=>nn==null?void 0:nn(P,V),()=>({trigger:h(o(),()=>{r(r().multiselectionKeyPressed=!0,!0)}),type:"keydown"})),Hn(jn,(P,V)=>nn==null?void 0:nn(P,V),()=>({trigger:h(o(),()=>r(r().multiselectionKeyPressed=!1,!0)),type:"keyup"})),Hn(jn,(P,V)=>nn==null?void 0:nn(P,V),()=>({trigger:h(s(),P=>{!(P.originalEvent.ctrlKey||P.originalEvent.metaKey||P.originalEvent.shiftKey)&&!Hd(P.originalEvent)&&(r(r().deleteKeyPressed=!0,!0),M())}),type:"keydown"})),Hn(jn,(P,V)=>nn==null?void 0:nn(P,V),()=>({trigger:h(s(),()=>r(r().deleteKeyPressed=!1,!0)),type:"keyup"})),Hn(jn,(P,V)=>nn==null?void 0:nn(P,V),()=>({trigger:h(i(),()=>r(r().panActivationKeyPressed=!0,!0)),type:"keydown"})),Hn(jn,(P,V)=>nn==null?void 0:nn(P,V),()=>({trigger:h(i(),()=>r(r().panActivationKeyPressed=!1,!0)),type:"keyup"})),Hn(jn,(P,V)=>nn==null?void 0:nn(P,V),()=>({trigger:h(c(),()=>r(r().zoomActivationKeyPressed=!0,!0)),type:"keydown"})),Hn(jn,(P,V)=>nn==null?void 0:nn(P,V),()=>({trigger:h(c(),()=>r(r().zoomActivationKeyPressed=!1,!0)),type:"keyup"})),it()}var tk=En('<path fill="none" class="svelte-flow__connection-path"></path>'),nk=En('<svg class="svelte-flow__connectionline"><g><!></g></svg>');function rk(t,e){ot(e,!0);let r=y(()=>{if(!e.store.connection.inProgress)return"";const i={sourceX:e.store.connection.from.x,sourceY:e.store.connection.from.y,sourcePosition:e.store.connection.fromPosition,targetX:e.store.connection.to.x,targetY:e.store.connection.to.y,targetPosition:e.store.connection.toPosition};switch(e.type){case Er.Bezier:{const[c]=qd(i);return c}case Er.Straight:{const[c]=jd(i);return c}case Er.Step:case Er.SmoothStep:{const[c]=Ds({...i,borderRadius:e.type===Er.Step?0:void 0});return c}}});var a=De(),o=ue(a);{var s=i=>{var c=nk(),f=d(c),g=d(f);{var p=h=>{var w=De(),M=ue(w);Wr(M,()=>e.LineComponent,(P,V)=>{V(P,{})}),v(h,w)},b=h=>{var w=tk();L(()=>{Pe(w,"d",n(r)),kn(w,e.style)}),v(h,w)};B(g,h=>{e.LineComponent?h(p):h(b,-1)})}l(f),l(c),L(h=>{Pe(c,"width",e.store.width),Pe(c,"height",e.store.height),kn(c,e.containerStyle),Ve(f,0,h)},[()=>Ke(["svelte-flow__connection",X2(e.store.connection.isValid)])]),v(i,c)};B(o,i=>{e.store.connection.inProgress&&i(s)})}v(t,a),it()}var ak=x("<div><!></div>");function su(t,e){ot(e,!0);let r=Ye(e,"position",3,"top-right"),a=Ur(e,["$$slots","$$events","$$legacy","position","style","class","children"]),o=y(()=>`${r()}`.split("-"));var s=ak();zr(s,c=>({class:c,style:e.style,...a}),[()=>["svelte-flow__panel",e.class,...n(o)]]);var i=d(s);pn(i,()=>e.children??Kn),l(s),v(t,s),it()}var ok=x('<a href="https://svelteflow.dev" target="_blank" rel="noopener noreferrer" aria-label="Svelte Flow attribution">Svelte Flow</a>');function ik(t,e){ot(e,!0);let r=Ye(e,"position",3,"bottom-right");var a=De(),o=ue(a);{var s=i=>{su(i,{get position(){return r()},class:"svelte-flow__attribution","data-message":"Feel free to remove the attribution or check out how you could support us: https://svelteflow.dev/support-us",children:(c,f)=>{var g=ok();v(c,g)},$$slots:{default:!0}})};B(o,i=>{var c;(c=e.proOptions)!=null&&c.hideAttribution||i(s)})}v(t,a),it()}var sk=x("<div><!></div>");function lk(t,e){ot(e,!0);let r=Ye(e,"domNode",15),a=Ye(e,"clientWidth",15),o=Ye(e,"clientHeight",15),s=y(()=>e.rest.class),i=y(()=>Uu(e.rest,["id","class","nodeTypes","edgeTypes","colorMode","isValidConnection","onmove","onmovestart","onmoveend","onflowerror","ondelete","onbeforedelete","onbeforeconnect","onconnect","onconnectstart","onconnectend","onbeforereconnect","onreconnect","onreconnectstart","onreconnectend","onclickconnectstart","onclickconnectend","oninit","onselectionchange","onselectiondragstart","onselectiondrag","onselectiondragstop","onselectionstart","onselectionend","clickConnect","fitView","fitViewOptions","nodeOrigin","nodeDragThreshold","connectionDragThreshold","minZoom","maxZoom","initialViewport","connectionRadius","connectionMode","selectionMode","selectNodesOnDrag","snapGrid","defaultMarkerColor","translateExtent","nodeExtent","onlyRenderVisibleElements","autoPanOnConnect","autoPanOnNodeDrag","colorModeSSR","defaultEdgeOptions","elevateNodesOnSelect","elevateEdgesOnSelect","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","elementsSelectable","nodesFocusable","edgesFocusable","disableKeyboardA11y","noDragClass","noPanClass","noWheelClass","ariaLabelConfig","autoPanSpeed","panOnScrollSpeed","zIndexMode"]));function c(p){p.currentTarget.scrollTo({top:0,left:0,behavior:"auto"}),e.rest.onscroll&&e.rest.onscroll(p)}var f=sk();zr(f,p=>({class:["svelte-flow","svelte-flow__container",n(s),e.colorMode],"data-testid":"svelte-flow__wrapper",role:"application",onscroll:c,...n(i),[ei]:p}),[()=>({width:vr(e.width),height:vr(e.height)})],void 0,void 0,"svelte-1ywk9tc");var g=d(f);pn(g,()=>e.children??Kn),l(f),sr(f,p=>r(p),()=>r()),el(f,"clientHeight",o),el(f,"clientWidth",a),v(t,f),it()}var ck=x('<div class="svelte-flow__viewport-back svelte-flow__container"></div> <!> <div class="svelte-flow__edge-labels svelte-flow__container"></div> <!> <!> <!> <div class="svelte-flow__viewport-front svelte-flow__container"></div>',1),dk=x("<!> <!>",1),uk=x("<!> <!> <!> <!> <!>",1);function fk(t,e){ot(e,!0);let r=Ye(e,"paneClickDistance",3,1),a=Ye(e,"nodeClickDistance",3,1),o=Ye(e,"panOnScrollMode",19,()=>da.Free),s=Ye(e,"preventScrolling",3,!0),i=Ye(e,"zoomOnScroll",3,!0),c=Ye(e,"zoomOnDoubleClick",3,!0),f=Ye(e,"zoomOnPinch",3,!0),g=Ye(e,"panOnScroll",3,!1),p=Ye(e,"panOnScrollSpeed",3,.5),b=Ye(e,"panOnDrag",3,!0),h=Ye(e,"selectionOnDrag",3,!1),w=Ye(e,"connectionLineType",19,()=>Er.Bezier),M=Ye(e,"nodes",31,()=>Bt([])),P=Ye(e,"edges",31,()=>Bt([])),V=Ye(e,"viewport",15,void 0),O=Ur(e,["$$slots","$$events","$$legacy","width","height","proOptions","selectionKey","deleteKey","panActivationKey","multiSelectionKey","zoomActivationKey","paneClickDistance","nodeClickDistance","onmovestart","onmoveend","onmove","oninit","onnodeclick","onnodecontextmenu","onnodedrag","onnodedragstart","onnodedragstop","onnodepointerenter","onnodepointermove","onnodepointerleave","onselectionclick","onselectioncontextmenu","onselectionstart","onselectionend","onedgeclick","onedgecontextmenu","onedgepointerenter","onedgepointerleave","onpaneclick","onpanecontextmenu","panOnScrollMode","preventScrolling","zoomOnScroll","zoomOnDoubleClick","zoomOnPinch","panOnScroll","panOnScrollSpeed","panOnDrag","selectionOnDrag","connectionLineComponent","connectionLineStyle","connectionLineContainerStyle","connectionLineType","attributionPosition","children","nodes","edges","viewport"]),k=S3({props:O,width:e.width,height:e.height,get nodes(){return M()},set nodes(U){M(U)},get edges(){return P()},set edges(U){P(U)},get viewport(){return V()},set viewport(U){V(U)}});const F=Jo(ps);F&&F.setStore&&F.setStore(k),_s(ps,{provider:!1,getStore(){return k}}),an(()=>{var Q;const U={nodes:k.selectedNodes,edges:k.selectedEdges};(Q=mr(()=>e.onselectionchange))==null||Q(U);for(const se of k.selectionChangeHandlers.values())se(U)}),Qo(()=>{k.reset()}),lk(t,{get colorMode(){return k.colorMode},get width(){return e.width},get height(){return e.height},get rest(){return O},get domNode(){return k.domNode},set domNode(U){k.domNode=U},get clientWidth(){return k.width},set clientWidth(U){k.width=U},get clientHeight(){return k.height},set clientHeight(U){k.height=U},children:(U,Q)=>{var se=uk(),xe=ue(se);ek(xe,{get selectionKey(){return e.selectionKey},get deleteKey(){return e.deleteKey},get panActivationKey(){return e.panActivationKey},get multiSelectionKey(){return e.multiSelectionKey},get zoomActivationKey(){return e.zoomActivationKey},get store(){return k},set store(C){k=C}});var le=u(xe,2);E3(le,{get panOnScrollMode(){return o()},get preventScrolling(){return s()},get zoomOnScroll(){return i()},get zoomOnDoubleClick(){return c()},get zoomOnPinch(){return f()},get panOnScroll(){return g()},get panOnScrollSpeed(){return p()},get panOnDrag(){return b()},get paneClickDistance(){return r()},get selectionOnDrag(){return h()},get onmovestart(){return e.onmovestart},get onmove(){return e.onmove},get onmoveend(){return e.onmoveend},get oninit(){return e.oninit},get store(){return k},set store(C){k=C},children:(C,N)=>{M3(C,{get onpaneclick(){return e.onpaneclick},get onpanecontextmenu(){return e.onpanecontextmenu},get onselectionstart(){return e.onselectionstart},get onselectionend(){return e.onselectionend},get panOnDrag(){return b()},get paneClickDistance(){return r()},get selectionOnDrag(){return h()},get store(){return k},set store(_){k=_},children:(_,z)=>{var I=dk(),D=ue(I);T3(D,{get store(){return k},set store($){k=$},children:($,X)=>{var H=ck(),W=u(ue(H),2);G3(W,{get onedgeclick(){return e.onedgeclick},get onedgecontextmenu(){return e.onedgecontextmenu},get onedgepointerenter(){return e.onedgepointerenter},get onedgepointerleave(){return e.onedgepointerleave},get store(){return k},set store(ie){k=ie}});var Y=u(W,4);rk(Y,{get type(){return w()},get LineComponent(){return e.connectionLineComponent},get containerStyle(){return e.connectionLineContainerStyle},get style(){return e.connectionLineStyle},get store(){return k},set store(ie){k=ie}});var ae=u(Y,2);$3(ae,{get nodeClickDistance(){return a()},get onnodeclick(){return e.onnodeclick},get onnodecontextmenu(){return e.onnodecontextmenu},get onnodepointerenter(){return e.onnodepointerenter},get onnodepointermove(){return e.onnodepointermove},get onnodepointerleave(){return e.onnodepointerleave},get onnodedrag(){return e.onnodedrag},get onnodedragstart(){return e.onnodedragstart},get onnodedragstop(){return e.onnodedragstop},get store(){return k},set store(ie){k=ie}});var ge=u(ae,2);Z3(ge,{get onselectionclick(){return e.onselectionclick},get onselectioncontextmenu(){return e.onselectioncontextmenu},get onnodedrag(){return e.onnodedrag},get onnodedragstart(){return e.onnodedragstart},get onnodedragstop(){return e.onnodedragstop},get store(){return k},set store(ie){k=ie}}),Ce(2),v($,H)},$$slots:{default:!0}});var T=u(D,2);{let $=y(()=>!!(k.selectionRect&&k.selectionRectMode==="user")),X=y(()=>{var ae;return(ae=k.selectionRect)==null?void 0:ae.width}),H=y(()=>{var ae;return(ae=k.selectionRect)==null?void 0:ae.height}),W=y(()=>{var ae;return(ae=k.selectionRect)==null?void 0:ae.x}),Y=y(()=>{var ae;return(ae=k.selectionRect)==null?void 0:ae.y});iu(T,{get isVisible(){return n($)},get width(){return n(X)},get height(){return n(H)},get x(){return n(W)},get y(){return n(Y)}})}v(_,I)},$$slots:{default:!0}})},$$slots:{default:!0}});var te=u(le,2);ik(te,{get proOptions(){return e.proOptions},get position(){return e.attributionPosition}});var be=u(te,2);L3(be,{get store(){return k}});var K=u(be,2);pn(K,()=>e.children??Kn),v(U,se)},$$slots:{default:!0}}),it()}var vk=x("<button><!></button>");function yo(t,e){let r=Ur(e,["$$slots","$$events","$$legacy","class","bgColor","bgColorHover","color","colorHover","borderColor","onclick","children"]);var a=vk();zr(a,()=>({type:"button",onclick:e.onclick,class:["svelte-flow__controls-button",e.class],...r,[ei]:{"--xy-controls-button-background-color-props":e.bgColor,"--xy-controls-button-background-color-hover-props":e.bgColorHover,"--xy-controls-button-color-props":e.color,"--xy-controls-button-color-hover-props":e.colorHover,"--xy-controls-button-border-color-props":e.borderColor}}));var o=d(a);pn(o,()=>e.children??Kn),l(a),v(t,a)}var gk=En('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"></path></svg>');function pk(t){var e=gk();v(t,e)}var hk=En('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 5"><path d="M0 0h32v4.2H0z"></path></svg>');function bk(t){var e=hk();v(t,e)}var xk=En('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 30"><path d="M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"></path></svg>');function mk(t){var e=xk();v(t,e)}var _k=En('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"></path></svg>');function yk(t){var e=_k();v(t,e)}var wk=En('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 32"><path d="M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"></path></svg>');function kk(t){var e=wk();v(t,e)}var Sk=x("<!> <!>",1),Ck=x("<!> <!> <!> <!> <!> <!>",1);function Ek(t,e){ot(e,!0);let r=Ye(e,"position",3,"bottom-left"),a=Ye(e,"orientation",3,"vertical"),o=Ye(e,"showZoom",3,!0),s=Ye(e,"showFitView",3,!0),i=Ye(e,"showLock",3,!0),c=Ur(e,["$$slots","$$events","$$legacy","position","orientation","showZoom","showFitView","showLock","style","class","buttonBgColor","buttonBgColorHover","buttonColor","buttonColorHover","buttonBorderColor","fitViewOptions","children","before","after"]),f=y(Xr);const g={bgColor:e.buttonBgColor,bgColorHover:e.buttonBgColorHover,color:e.buttonColor,colorHover:e.buttonColorHover,borderColor:e.buttonBorderColor};let p=y(()=>n(f).nodesDraggable||n(f).nodesConnectable||n(f).elementsSelectable),b=y(()=>n(f).viewport.zoom<=n(f).minZoom),h=y(()=>n(f).viewport.zoom>=n(f).maxZoom),w=y(()=>n(f).ariaLabelConfig),M=y(()=>a()==="horizontal"?"horizontal":"vertical");const P=()=>{n(f).zoomIn()},V=()=>{n(f).zoomOut()},O=()=>{n(f).fitView(e.fitViewOptions)},k=()=>{let F=!n(p);n(f).nodesDraggable=F,n(f).nodesConnectable=F,n(f).elementsSelectable=F};{let F=y(()=>["svelte-flow__controls",n(M),e.class]);su(t,lt({get class(){return n(F)},get position(){return r()},"data-testid":"svelte-flow__controls",get"aria-label"(){return n(w)["controls.ariaLabel"]},get style(){return e.style}},()=>c,{children:(U,Q)=>{var se=Ck(),xe=ue(se);{var le=$=>{var X=De(),H=ue(X);pn(H,()=>e.before),v($,X)};B(xe,$=>{e.before&&$(le)})}var te=u(xe,2);{var be=$=>{var X=Sk(),H=ue(X);yo(H,lt({onclick:P,class:"svelte-flow__controls-zoomin",get title(){return n(w)["controls.zoomIn.ariaLabel"]},get"aria-label"(){return n(w)["controls.zoomIn.ariaLabel"]},get disabled(){return n(h)}},()=>g,{children:(Y,ae)=>{pk(Y)},$$slots:{default:!0}}));var W=u(H,2);yo(W,lt({onclick:V,class:"svelte-flow__controls-zoomout",get title(){return n(w)["controls.zoomOut.ariaLabel"]},get"aria-label"(){return n(w)["controls.zoomOut.ariaLabel"]},get disabled(){return n(b)}},()=>g,{children:(Y,ae)=>{bk(Y)},$$slots:{default:!0}})),v($,X)};B(te,$=>{o()&&$(be)})}var K=u(te,2);{var C=$=>{yo($,lt({class:"svelte-flow__controls-fitview",onclick:O,get title(){return n(w)["controls.fitView.ariaLabel"]},get"aria-label"(){return n(w)["controls.fitView.ariaLabel"]}},()=>g,{children:(X,H)=>{mk(X)},$$slots:{default:!0}}))};B(K,$=>{s()&&$(C)})}var N=u(K,2);{var _=$=>{yo($,lt({class:"svelte-flow__controls-interactive",onclick:k,get title(){return n(w)["controls.interactive.ariaLabel"]},get"aria-label"(){return n(w)["controls.interactive.ariaLabel"]}},()=>g,{children:(X,H)=>{var W=De(),Y=ue(W);{var ae=ie=>{kk(ie)},ge=ie=>{yk(ie)};B(Y,ie=>{n(p)?ie(ae):ie(ge,-1)})}v(X,W)},$$slots:{default:!0}}))};B(N,$=>{i()&&$(_)})}var z=u(N,2);{var I=$=>{var X=De(),H=ue(X);pn(H,()=>e.children),v($,X)};B(z,$=>{e.children&&$(I)})}var D=u(z,2);{var T=$=>{var X=De(),H=ue(X);pn(H,()=>e.after),v($,X)};B(D,$=>{e.after&&$(T)})}v(U,se)},$$slots:{default:!0}}))}it()}var wr;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(wr||(wr={}));var Nk=En("<circle></circle>");function Mk(t,e){var r=Nk();L(()=>{Pe(r,"cx",e.radius),Pe(r,"cy",e.radius),Pe(r,"r",e.radius),Ve(r,0,Ke(["svelte-flow__background-pattern","dots",e.class]))}),v(t,r)}var zk=En("<path></path>");function Tk(t,e){ot(e,!0);var r=zk();L(()=>{Pe(r,"stroke-width",e.lineWidth),Pe(r,"d",`M${e.dimensions[0]/2} 0 V${e.dimensions[1]} M0 ${e.dimensions[1]/2} H${e.dimensions[0]}`),Ve(r,0,Ke(["svelte-flow__background-pattern",e.variant,e.class]))}),v(t,r),it()}const Pk={[wr.Dots]:1,[wr.Lines]:1,[wr.Cross]:6};var Ak=En('<svg data-testid="svelte-flow__background"><pattern patternUnits="userSpaceOnUse"><!></pattern><rect x="0" y="0" width="100%" height="100%"></rect></svg>');function Lk(t,e){ot(e,!0);let r=Ye(e,"variant",19,()=>wr.Dots),a=Ye(e,"gap",3,20),o=Ye(e,"lineWidth",3,1),s=y(Xr),i=y(()=>r()===wr.Dots),c=y(()=>r()===wr.Cross),f=y(()=>Array.isArray(a())?a():[a(),a()]),g=y(()=>`background-pattern-${n(s).flowId}-${e.id??""}`),p=y(()=>[n(f)[0]*n(s).viewport.zoom||1,n(f)[1]*n(s).viewport.zoom||1]),b=y(()=>(e.size??Pk[r()])*n(s).viewport.zoom),h=y(()=>n(c)?[n(b),n(b)]:n(p)),w=y(()=>n(i)?[n(b)/2,n(b)/2]:[n(h)[0]/2,n(h)[1]/2]);var M=Ak();let P;var V=d(M),O=d(V);{var k=Q=>{{let se=y(()=>n(b)/2);Mk(Q,{get radius(){return n(se)},get class(){return e.patternClass}})}},F=Q=>{Tk(Q,{get dimensions(){return n(h)},get variant(){return r()},get lineWidth(){return o()},get class(){return e.patternClass}})};B(O,Q=>{n(i)?Q(k):Q(F,-1)})}l(V);var U=u(V);l(M),L(()=>{Ve(M,0,Ke(["svelte-flow__background","svelte-flow__container",e.class])),P=kn(M,"",P,{"--xy-background-color-props":e.bgColor,"--xy-background-pattern-color-props":e.patternColor}),Pe(V,"id",n(g)),Pe(V,"x",n(s).viewport.x%n(p)[0]),Pe(V,"y",n(s).viewport.y%n(p)[1]),Pe(V,"width",n(p)[0]),Pe(V,"height",n(p)[1]),Pe(V,"patternTransform",`translate(-${n(w)[0]},-${n(w)[1]})`),Pe(U,"fill",`url(#${n(g)})`)}),v(t,M),it()}var Ik=x('<!> <!> <div><div class="stripe svelte-hw5n61"></div> <div class="body svelte-hw5n61"><div class="head svelte-hw5n61"><span class="role svelte-hw5n61"> </span> <span class="dot svelte-hw5n61"></span></div> <div class="label svelte-hw5n61"> </div> <div class="meta svelte-hw5n61"><span class="metric svelte-hw5n61"><span class="n svelte-hw5n61"> </span><span class="u svelte-hw5n61">colls</span></span> <span class="sep svelte-hw5n61">·</span> <span class="metric svelte-hw5n61"><span class="n svelte-hw5n61"> </span><span class="u svelte-hw5n61">entities</span></span></div></div></div>',1);function Ok(t,e){ot(e,!0);const r=y(()=>e.data.role==="primary"?"role-primary":e.data.role==="replica"?"role-replica":"role-embedded");var a=Ik(),o=ue(a);_a(o,{type:"target",get position(){return Tt.Left},style:"opacity:0;pointer-events:none"});var s=u(o,2);_a(s,{type:"source",get position(){return Tt.Right},style:"opacity:0;pointer-events:none"});var i=u(s,2);let c;var f=u(d(i),2),g=d(f),p=d(g),b=d(p,!0);l(p),Ce(2),l(g);var h=u(g,2),w=d(h,!0);l(h);var M=u(h,2),P=d(M),V=d(P),O=d(V,!0);l(V),Ce(),l(P);var k=u(P,4),F=d(k),U=d(F,!0);l(F),Ce(),l(k),l(M),l(f),l(i),L(Q=>{c=Ve(i,1,`card ${n(r)??""}`,"svelte-hw5n61",c,{selected:e.selected}),S(b,e.data.role),S(w,e.data.label),S(O,e.data.collections),S(U,Q)},[()=>e.data.entities.toLocaleString()]),v(t,a),it()}const Oa={action:"policy:read",resource:{kind:"policy",name:"*"}};function Or(t){return[t.action,t.resource.kind,t.resource.name,t.resource.tenant??"",t.current_tenant??""].join("")}function Rk(t){const e=`${t.kind}:${t.name}`;return t.tenant?`${e} @ ${t.tenant}`:e}function lu(t,e){const r=t==null?void 0:t.trim();if(!r||r==="*")return{kind:"resource",name:"*",tenant:e};const a=r.includes(":")?":":r.includes("/")?"/":null;if(!a)return{kind:"resource",name:r,tenant:e};const[o,...s]=r.split(a),i=s.join(a)||"*";return{kind:o||"resource",name:i,tenant:e}}function cu(t){var a;const e=[Oa],r=new Set(e.map(Or));for(const o of t){const s={action:((a=o.action)==null?void 0:a.trim())||"*",resource:lu(o.resource,o.tenant)},i=Or(s);r.has(i)||(r.add(i),e.push(s))}return e}function Dk(t,e){const r=cu(t),a=new Map(e.map(o=>[Or(o),o]));return r.map(o=>{const s=a.get(Or(o)),i=t.filter(c=>{var g;const f={action:((g=c.action)==null?void 0:g.trim())||"*",resource:lu(c.resource,c.tenant)};return Or(f)===Or(o)});return{id:Or(o),action:o.action,resource:o.resource,resourceLabel:Rk(o.resource),allowed:(s==null?void 0:s.allowed)===!0,reason:s==null?void 0:s.reason,effects:[...new Set(i.map(c=>c.effect).filter(c=>!!c))],principals:[...new Set(i.map(c=>c.principal).filter(c=>!!c))],policies:[...new Set(i.map((c,f)=>c.name??c.id??`policy ${f+1}`).filter(c=>!!c))]}})}var $k=x('<div class="absolute w-[220px] rounded border border-line-2 bg-bg-1 p-3 shadow-md motion-safe:animate-pulse"><div class="mb-3 flex items-center gap-2"><div></div> <div class="h-3 rounded bg-bg-3"></div></div> <div class="grid grid-cols-2 gap-2"><div class="h-9 rounded border border-line-1 bg-bg-2"></div> <div class="h-9 rounded border border-line-1 bg-bg-2"></div></div></div>'),Vk=x('<div class="flex h-[30px] items-center gap-2.5 rounded px-2"><div class="h-1.5 w-1.5 rounded-full bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-3 flex-1 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-3 rounded bg-bg-2 motion-safe:animate-pulse"></div></div>'),Hk=x('<div class="absolute inset-0 overflow-hidden bg-bg-0" aria-busy="true" aria-label="Loading cluster topology"><div class="absolute inset-0 cluster-skeleton-grid svelte-gcvueu"></div> <svg class="absolute inset-0 h-full w-full" aria-hidden="true"><line x1="50%" y1="38%" x2="32%" y2="54%" class="cluster-skeleton-edge motion-safe:animate-pulse svelte-gcvueu"></line><line x1="50%" y1="38%" x2="68%" y2="54%" class="cluster-skeleton-edge motion-safe:animate-pulse svelte-gcvueu"></line></svg> <!> <div class="absolute top-4 left-4 z-10 w-64 rounded border border-line-2 bg-bg-1 p-3 shadow-md"><div class="mb-3 h-3 w-16 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="mb-3 grid grid-cols-2 gap-3 border-b border-line-1 pb-3"><div><div class="mb-2 h-3 w-16 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-6 w-12 rounded bg-bg-2 motion-safe:animate-pulse"></div></div> <div><div class="mb-2 h-3 w-14 rounded bg-bg-2 motion-safe:animate-pulse"></div> <div class="h-6 w-20 rounded bg-bg-2 motion-safe:animate-pulse"></div></div></div> <div class="grid gap-1"></div></div></div>'),Fk=x('<div class="p-6"><!></div>'),qk=x('<div class="p-6"><!></div>'),Kk=x("<!> <!>",1),jk=x('<button><span></span> <span class="font-mono text-[11px] text-fg-1 flex-1 truncate"> </span> <span class="font-mono text-[10px] text-fg-3"> </span></button>'),Bk=x('<div class="grid grid-cols-2 gap-3 mb-3 pb-3 border-b border-line-1"><div><div class="type-label">reachable</div> <div class="font-mono text-fg-0 text-[18px] font-semibold mt-0.5"> <span class="text-fg-3 text-[11px] font-normal ml-1"> </span></div></div> <div><div class="type-label">entities</div> <div class="font-mono text-accent text-[18px] font-semibold mt-0.5"> </div></div></div> <div class="grid gap-1"></div>',1),Wk=x('<div class="text-[10px] text-fg-3 mt-1"> </div>'),Uk=x('<div class="mb-1 rounded border border-line-1 bg-bg-2 p-3"><div class="type-label"> </div> <div> </div> <!></div>'),Gk=x('<span class="text-fg-3"> </span>'),Yk=x('<span class="text-fg-3">· usage not exposed</span>'),Xk=x(' <span class="text-fg-3"> </span>',1),Zk=x('<span class="text-fg-3">not sampled</span>'),Qk=x('<div class="pt-2 mt-1 border-t border-line-1"></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">host</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">process</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">connections</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">collections</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">entities</span> <span class="text-accent"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">cross refs</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">store memory</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">storage</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">ram</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">cpu</span> <span class="text-fg-0"> <!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">throughput</span> <span class="text-fg-0"><!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">avg response</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">uptime</span> <span class="text-fg-0"> </span></div>',1),Jk=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">commit mark</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div>'),e5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">resyncs</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div>'),t5=x('<span class="text-amber-400">↻</span>'),n5=x('<div class="flex items-center gap-2 text-[10px]"><span></span> <span class="text-fg-1 flex-1 truncate"> <!></span> <span class="text-fg-3"> </span> <span> </span></div>'),r5=x('<div class="grid gap-1 pl-1"></div>'),a5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">wal lsn</span> <span class="text-fg-0"> </span></div> <!> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">archive lag</span> <span class="text-fg-0"> <span class="text-fg-3">records</span></span></div> <!> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">replicas</span> <span class="text-fg-0"> </span></div> <!>',1),o5=x('<span class="text-fg-3 ml-1"> </span>'),i5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">lag</span> <span><!> <!></span></div>'),s5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">last error</span> <span class="text-accent break-all"> </span></div>'),l5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">primary</span> <span class="text-fg-0 break-all"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">applied</span> <span class="text-fg-0"> <span class="text-fg-3"> </span></span></div> <!> <!>',1),c5=x('<div class="pt-2 mt-1 border-t border-line-1"></div> <!>',1),d5=x('you are <span class="text-accent"> </span> <span class="text-fg-3"> </span>',1),u5=x('<span class="text-fg-3"> </span>'),f5=x('<span class="text-fg-3">…</span>'),v5=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-1"> </span>'),g5=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-1"> </span>'),p5=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-1"> </span>'),h5=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-3" title="reddb did not grant policy:read to this principal">policies · no grant</span>'),b5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">metalanguage</span> <span class="text-fg-0"><!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-start"><span class="text-fg-3"></span> <span class="flex flex-wrap items-center gap-1.5"><!> <!> <!> <button type="button" class="rounded border border-line-2 bg-bg-2 px-1.5 py-0.5 text-[10px] text-fg-1 hover:border-line-3 hover:text-fg-0">Security →</button></span></div>',1),x5=x('<div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">metalanguage</span> <span class="text-fg-3">connect to this node to inspect users · tenants · policies</span></div>'),m5=x('<span class="rounded border border-line-1 px-1.5 py-0.5 text-[10px] text-fg-3"> </span>'),_5=x('<div class="pt-2 mt-1 border-t border-line-1"></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-start"><span class="text-fg-3">not exposed</span> <span class="flex flex-wrap gap-1"></span></div>',1),y5=x('<div class="grid gap-2 font-mono text-[11px]"><!> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">topology</span> <span><!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">label</span> <span class="text-fg-0"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">url</span> <code class="text-fg-0 break-all"> </code></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">deployment</span> <span><!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">evidence</span> <span class="text-fg-1"> </span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">role</span> <span><!></span></div> <div class="grid grid-cols-[120px_1fr] gap-3 items-baseline"><span class="text-fg-3">replicas</span> <span class="text-fg-0"><!></span></div> <!> <!> <div class="pt-2 mt-1 border-t border-line-1"></div> <!> <!></div>'),w5=x('<div class="absolute top-4 right-4 z-10 w-[420px] max-h-[calc(100vh-96px)] overflow-auto"><!></div>'),k5=x('<div class="absolute inset-0"><!></div> <div class="absolute top-4 left-4 z-10 w-64"><!></div> <!>',1);function S5(t,e){ot(e,!0);function r(E){return Jf(E.cluster,E.replication,E.preset.role)}const a={embedded:"embedded · standalone",serverless:"serverless",replicated:"primary / replica",server:"server · standalone",unknown:"unknown"};let o=_e(Bt([])),s=_e(!0),i=_e(null);const c=[{id:"primary",x:"50%",y:"38%",role:"primary",label:92},{id:"replica",x:"68%",y:"54%",role:"replica",label:112},{id:"embedded",x:"32%",y:"54%",role:"embedded",label:104}],f=Array.from({length:3},(E,j)=>j),g=new Map,p=new Map,b=6e4,h={cluster:Ok},w=y(()=>{const E=Dr.current==="dark";return{ok:E?"#4ade80":"#16a34a",warn:E?"#fbbf24":"#b45309",pattern:E?"#1c2027":"#d4d4d8",labelBg:E?"#0d0f13":"#fafafa",labelStroke:E?"#2a2e36":"#d4d4d8"}});async function M(){const E=Date.now(),j=await Promise.all(sf.map(async R=>{const A=g.get(R.id)??0,Z=p.get(R.id)??0;if(A>=2&&E-Z<b)return n(o).find(oe=>oe.id===R.id)??{id:R.id,preset:R,reachable:!1,role:"standalone"};p.set(R.id,E);const J=new lf(R.url);try{const[oe,me,pe]=await Promise.all([Ct.track(`cluster · ${R.label} stats`,()=>J.stats()),Ct.track(`cluster · ${R.label} replication`,()=>J.replication()).catch(()=>{}),Ct.track(`cluster · ${R.label} status`,()=>J.clusterStatus()).catch(()=>{})]);return g.set(R.id,0),{id:R.id,preset:R,reachable:!0,role:(me==null?void 0:me.role)??"standalone",stats:oe,replication:me,cluster:pe}}catch{return g.set(R.id,A+1),{id:R.id,preset:R,reachable:!1,role:"standalone"}}}));m(o,j,!0),m(s,!1)}an(()=>{if(_n.locked){m(s,!1);return}m(s,!0),M();const E=setInterval(M,5e3);return()=>clearInterval(E)});const P=y(()=>n(o).filter(E=>E.reachable)),V=y(()=>n(P).map(E=>{var R,A;const j=E.role==="primary"?0:E.role==="replica"?1:-1;return{id:E.id,type:"cluster",position:{x:320+j*320,y:200},data:{label:E.preset.label,role:E.role,collections:((R=E.stats)==null?void 0:R.store.collection_count)??0,entities:((A=E.stats)==null?void 0:A.store.total_entities)??0,url:E.preset.url}}})),O=y(()=>n(P).filter(E=>E.role==="replica").map(E=>{var J,oe;const j=n(P).find(me=>me.role==="primary");if(!j)return null;const R=((J=E.replication)==null?void 0:J.last_applied_lsn)!==void 0&&((oe=E.replication)==null?void 0:oe.last_seen_primary_lsn)!==void 0?E.replication.last_seen_primary_lsn-E.replication.last_applied_lsn:null,A=R===0,Z=A?n(w).ok:n(w).warn;return{id:`${j.id}-${E.id}`,source:j.id,target:E.id,type:"smoothstep",animated:!0,style:`stroke:${Z};stroke-width:1.5;opacity:0.7`,label:R===null?"":A?"✓ in sync":`lag ${R}`,labelStyle:`fill:${Z};font-family:JetBrains Mono Variable;font-size:10px;font-weight:500`,labelBgStyle:`fill:${n(w).labelBg};stroke:${n(w).labelStroke};stroke-width:1`,labelBgPadding:[6,4],labelBgBorderRadius:4}}).filter(E=>E!==null)),k=y(()=>n(o).find(E=>E.id===n(i))),F=y(()=>n(k)?I(n(k)):null),U=y(()=>n(k)?r(n(k)):"unknown"),Q=y(()=>n(k)?Y(n(k)):[]),se=y(()=>n(P).reduce((E,j)=>{var R;return E+(((R=j.stats)==null?void 0:R.store.total_entities)??0)},0)),xe=ya(),le=y(()=>{var E;return!!n(k)&&Ue.connected&&!_n.locked&&((E=Ue.active)==null?void 0:E.url)===n(k).preset.url});let te=_e(null);an(()=>{const E=n(k);if(n(i),!E||!n(le)){m(te,null);return}const j=Ue.client;if(!j){m(te,null);return}let R=!1;return(async()=>{const A={};try{const Z=await Ct.track("cluster · whoami",()=>j.whoami());A.username=Z.username,A.role=Z.role}catch(Z){A.error=Z.message}try{A.users=(await Ct.track("cluster · users",()=>j.users())).length}catch{}try{A.tenants=(await Ct.track("cluster · tenants",()=>j.tenants())).length}catch{}try{const[Z]=await Ct.track("cluster · auth.can policy read",()=>j.authCan([Oa]));if(A.policyAllowed=(Z==null?void 0:Z.allowed)===!0,A.policyAllowed)try{A.policies=(await Ct.track("cluster · policies",()=>j.policies())).length}catch{}}catch{A.policyAllowed=!1}R||m(te,A,!0)})(),()=>{R=!0}});function be(E){var R,A;const j=Bn((A=(R=E.cluster)==null?void 0:R.deployment)==null?void 0:A.shape);return j||(E.preset.id==="embedded"?"embedded":E.preset.id.startsWith("docker-")?"server · docker preset":"server")}function K(E){var A,Z,J,oe,me;const j=(J=(Z=(A=E.cluster)==null?void 0:A.transports)==null?void 0:Z.active)==null?void 0:J[0];if(j)return`${j.transport} · ${j.bind_addr}`;const R=(me=(oe=E.cluster)==null?void 0:oe.storage)==null?void 0:me.remote_backend;return R?`remote backend · ${R}`:E.preset.description}function C(E){switch(r(E)){case"replicated":return"accent";case"embedded":return"ok";case"serverless":return"info";default:return"neutral"}}function N(E){return E==null||!Number.isFinite(E)?"not exposed":E<1e3?`${Math.round(E)} ms`:E<6e4?`${(E/1e3).toFixed(E<1e4?2:1)} s`:`${Math.floor(E/6e4)}m ${Math.round(E%6e4/1e3)}s`}function _(E){return E==null||!Number.isFinite(E)?"not exposed":E<1?`${Math.round(E*1e3)} ms`:E<60?`${E.toFixed(1)}s`:`${Math.floor(E/60)}m ${Math.round(E%60)}s`}function z(E){const j=E.replication;return(j==null?void 0:j.last_applied_lsn)===void 0||j.last_seen_primary_lsn===void 0?null:j.last_seen_primary_lsn-j.last_applied_lsn}function I(E){var A,Z,J,oe,me,pe,Ee,Se,ve;const j=r(E);if(j==="replicated"){if(E.role==="primary"){const Oe=((A=E.replication)==null?void 0:A.replicas)??[],re=tv(E.replication);return Oe.length===0?{label:"replication lag",value:"no replicas",tone:"neutral"}:re===null?{label:"replication lag",value:"not exposed",tone:"neutral"}:{label:"replication lag",value:re===0?"✓ in sync":_(re),tone:re===0?"ok":re<5?"warn":"danger",sub:`${Oe.length} replica${Oe.length===1?"":"s"} · worst case`}}const ce=z(E);return{label:"replica lag",value:ce===null?"not exposed":ce===0?"✓ in sync":`${ce.toLocaleString()} lsn`,tone:ce===null?"neutral":ce===0?"ok":"warn",sub:(Z=E.replication)==null?void 0:Z.state}}if(j==="serverless"){const ce=ev(E.cluster);return{label:"boot time",value:N(ce),tone:ce===null?"neutral":ce<1e3?"ok":ce<5e3?"info":"warn",sub:(J=E.cluster)!=null&&J.phase?`phase · ${E.cluster.phase}`:void 0}}if(j==="embedded"){const ce=Bn((me=(oe=E.cluster)==null?void 0:oe.storage)==null?void 0:me.db_size_bytes);return{label:"on-disk size",value:ce===void 0?"not exposed":D(ce),tone:ce===void 0?"neutral":"ok",sub:`${(((pe=E.stats)==null?void 0:pe.store.total_entities)??0).toLocaleString()} entities`}}const R=Bn((Se=(Ee=E.cluster)==null?void 0:Ee.storage)==null?void 0:Se.db_size_bytes);return{label:"entities",value:(((ve=E.stats)==null?void 0:ve.store.total_entities)??0).toLocaleString(),tone:"accent",sub:R===void 0?void 0:`${D(R)} on disk`}}function D(E){return E===void 0||!Number.isFinite(E)?"not exposed":E>=1024**3?`${(E/1024**3).toFixed(1)} GiB`:E>=1024**2?`${(E/1024**2).toFixed(1)} MiB`:E>=1024?`${(E/1024).toFixed(1)} KiB`:`${E} B`}function T(E,j){return j<=0?"n/a":`${Math.round(E/j*100)}%`}function $(E){const j=Math.max(0,Math.round((Date.now()-E)/1e3));return j>=86400?`${Math.floor(j/86400)}d ${Math.floor(j%86400/3600)}h`:j>=3600?`${Math.floor(j/3600)}h ${Math.floor(j%3600/60)}m`:j>=60?`${Math.floor(j/60)}m ${j%60}s`:`${j}s`}function X(E){return E===void 0||!Number.isFinite(E)?"not exposed":`${E.toLocaleString(void 0,{maximumFractionDigits:1})}/s`}function H(E){return E===void 0||!Number.isFinite(E)?"not exposed":`${E.toLocaleString(void 0,{maximumFractionDigits:1})} ms`}function W(E){var Z,J,oe,me,pe,Ee;const j=Bn((J=(Z=E.cluster)==null?void 0:Z.storage)==null?void 0:J.db_size_bytes),R=(me=(oe=E.cluster)==null?void 0:oe.storage)==null?void 0:me.remote_backend;if(j!==void 0)return R?`${D(j)} · ${R}`:D(j);if(R)return`remote · ${R}`;const A=Qf((Ee=(pe=E.cluster)==null?void 0:pe.storage)==null?void 0:Ee.db_size_bytes);return A?`not exposed (${A})`:"not exposed"}function Y(E){return nv(E.cluster).map(j=>j.path.replace(/_/g," "))}var ae=De(),ge=ue(ae);{var ie=E=>{var j=Hk(),R=u(d(j),4);Qe(R,17,()=>c,J=>J.id,(J,oe)=>{var me=$k(),pe=d(me),Ee=d(pe),Se=u(Ee,2);l(pe),Ce(2),l(me),L(ve=>{kn(me,`left: ${n(oe).x}; top: ${n(oe).y}; transform: translate(-50%, -50%);`),Ve(Ee,1,ve,"svelte-gcvueu"),kn(Se,`width: ${n(oe).label}px`)},[()=>Ke(["h-2 w-2 rounded-full",n(oe).role==="primary"?"bg-role-primary":n(oe).role==="replica"?"bg-role-replica":"bg-role-embedded"].join(" "))]),v(J,me)});var A=u(R,2),Z=u(d(A),4);Qe(Z,20,()=>f,J=>J,(J,oe)=>{var me=Vk(),pe=u(d(me),4);l(me),L(()=>kn(pe,`width: ${oe===0?36:24}px`)),v(J,me)}),l(Z),l(A),l(j),v(E,j)},ee=E=>{var j=Fk(),R=d(j);Fn(R,{get icon(){return Gr},title:"Locked",message:"Unlock the secure store to probe configured nodes. Automatic probes are paused until you authenticate this session."}),l(j),v(E,j)},q=E=>{var j=qk(),R=d(j);Fn(R,{get icon(){return Lv},title:"No reachable nodes",message:"None of the configured reddb endpoints responded. Start one and the topology will populate automatically.",hint:"docker compose -f docker/compose.yml up -d"}),l(j),v(E,j)},G=E=>{var j=k5(),R=ue(j),A=d(R);fk(A,{get nodes(){return n(V)},get edges(){return n(O)},get nodeTypes(){return h},fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,onnodeclick:pe=>m(i,pe.node.id,!0),children:(pe,Ee)=>{var Se=Kk(),ve=ue(Se);Lk(ve,{get variant(){return wr.Dots},bgColor:"transparent",get patternColor(){return n(w).pattern},gap:32,size:1});var ce=u(ve,2);Ek(ce,{position:"bottom-right"}),v(pe,Se)},$$slots:{default:!0}}),l(R);var Z=u(R,2),J=d(Z);Cr(J,{title:"cluster",children:(pe,Ee)=>{var Se=Bk(),ve=ue(Se),ce=d(ve),Oe=u(d(ce),2),re=d(Oe,!0),de=u(re),he=d(de);l(de),l(Oe),l(ce);var Ie=u(ce,2),Ae=u(d(Ie),2),ke=d(Ae,!0);l(Ae),l(Ie),l(ve);var Te=u(ve,2);Qe(Te,21,()=>n(P),bn,(ze,Ne)=>{var Me=jk(),Xe=d(Me),Re=u(Xe,2),Je=d(Re,!0);l(Re);var dt=u(Re,2),ft=d(dt,!0);l(dt),l(Me),L((qe,$e,je)=>{Ve(Me,1,qe,"svelte-gcvueu"),Ve(Xe,1,$e,"svelte-gcvueu"),S(Je,n(Ne).preset.label),S(ft,je)},[()=>Ke(["flex items-center gap-2.5 px-2 py-1.5 rounded text-left bg-transparent border-0 cursor-pointer transition-colors",n(i)===n(Ne).id?"bg-bg-2":"hover:bg-bg-2"].join(" ")),()=>Ke(["w-1.5 h-1.5 rounded-full shrink-0",n(Ne).role==="primary"?"bg-role-primary":n(Ne).role==="replica"?"bg-role-replica":"bg-role-embedded"].join(" ")),()=>{var qe;return((qe=n(Ne).stats)==null?void 0:qe.store.total_entities.toLocaleString())??0}]),we("click",Me,()=>m(i,n(Ne).id,!0)),v(ze,Me)}),l(Te),L(ze=>{S(re,n(P).length),S(he,`of ${n(o).length??""}`),S(ke,ze)},[()=>n(se).toLocaleString()]),v(pe,Se)},$$slots:{default:!0}}),l(Z);var oe=u(Z,2);{var me=pe=>{var Ee=w5(),Se=d(Ee);Cr(Se,{get title(){return`node · ${n(k).id??""}`},floating:!0,children:(ve,ce)=>{var Oe=y5(),re=d(Oe);{var de=rt=>{var ct=Uk(),Lt=d(ct),Ft=d(Lt,!0);l(Lt);var on=u(Lt,2),sn=d(on,!0);l(on);var ln=u(on,2);{var Sn=cn=>{var yn=Wk(),Nn=d(yn,!0);l(yn),L(()=>S(Nn,n(F).sub)),v(cn,yn)};B(ln,cn=>{n(F).sub&&cn(Sn)})}l(ct),L(cn=>{S(Ft,n(F).label),Ve(on,1,cn,"svelte-gcvueu"),S(sn,n(F).value)},[()=>Ke(["font-mono text-[22px] font-semibold mt-0.5 leading-none",n(F).tone==="ok"?"text-role-replica":n(F).tone==="warn"?"text-amber-400":n(F).tone==="danger"||n(F).tone==="accent"?"text-accent":"text-fg-0"].join(" "))]),v(rt,ct)};B(re,rt=>{n(F)&&rt(de)})}var he=u(re,2),Ie=u(d(he),2),Ae=d(Ie);{let rt=y(()=>C(n(k)));Wn(Ae,{get tone(){return n(rt)},children:(ct,Lt)=>{Ce();var Ft=_t();L(()=>S(Ft,a[n(U)])),v(ct,Ft)},$$slots:{default:!0}})}l(Ie),l(he);var ke=u(he,2),Te=u(d(ke),2),ze=d(Te,!0);l(Te),l(ke);var Ne=u(ke,2),Me=u(d(Ne),2),Xe=d(Me,!0);l(Me),l(Ne);var Re=u(Ne,2),Je=u(d(Re),2),dt=d(Je);{let rt=y(()=>C(n(k)));Wn(dt,{get tone(){return n(rt)},children:(ct,Lt)=>{Ce();var Ft=_t();L(on=>S(Ft,on),[()=>be(n(k))]),v(ct,Ft)},$$slots:{default:!0}})}l(Je),l(Re);var ft=u(Re,2),qe=u(d(ft),2),$e=d(qe,!0);l(qe),l(ft);var je=u(ft,2),at=u(d(je),2),ne=d(at);{let rt=y(()=>n(k).role==="primary"?"primary":n(k).role==="replica"?"replica":"embedded");Lf(ne,{get role(){return n(rt)},get label(){return n(k).role}})}l(at),l(je);var nt=u(je,2),Ze=u(d(nt),2),Be=d(Ze);{var ut=rt=>{var ct=_t();L(()=>S(ct,n(k).replication.replica_count??0)),v(rt,ct)},Nt=rt=>{var ct=_t();L(()=>S(ct,`connected to ${n(k).replication.primary_addr??"primary"??""}`)),v(rt,ct)},Pt=rt=>{var ct=_t("none exposed");v(rt,ct)};B(Be,rt=>{var ct,Lt;((ct=n(k).replication)==null?void 0:ct.role)==="primary"?rt(ut):((Lt=n(k).replication)==null?void 0:Lt.role)==="replica"?rt(Nt,1):rt(Pt,-1)})}l(Ze),l(nt);var Mt=u(nt,2);{var Et=rt=>{const ct=y(()=>{var Ht,zt;return Bn((zt=(Ht=n(k).cluster)==null?void 0:Ht.system)==null?void 0:zt.total_memory_bytes)??n(k).stats.system.total_memory_bytes}),Lt=y(()=>{var Ht,zt;return Bn((zt=(Ht=n(k).cluster)==null?void 0:Ht.system)==null?void 0:zt.available_memory_bytes)??n(k).stats.system.available_memory_bytes}),Ft=y(()=>{var Ht;return Bn((Ht=n(k).cluster)==null?void 0:Ht.throughput)});var on=Qk(),sn=u(ue(on),2),ln=u(d(sn),2),Sn=d(ln);l(ln),l(sn);var cn=u(sn,2),yn=u(d(cn),2),Nn=d(yn);l(yn),l(cn);var Pn=u(cn,2),Cn=u(d(Pn),2),An=d(Cn),ye=u(An),Le=d(ye);l(ye),l(Cn),l(Pn);var He=u(Pn,2),Ge=u(d(He),2),et=d(Ge,!0);l(Ge),l(He);var tt=u(He,2),We=u(d(tt),2),wt=d(We,!0);l(We),l(tt);var st=u(tt,2),vt=u(d(st),2),At=d(vt,!0);l(vt),l(st);var Ot=u(st,2),Jt=u(d(Ot),2),fn=d(Jt,!0);l(Jt),l(Ot);var $t=u(Ot,2),Rt=u(d($t),2),Wt=d(Rt,!0);l(Rt),l($t);var qt=u($t,2),rn=u(d(qt),2),vn=d(rn),gn=u(vn),Ut=d(gn);l(gn),l(rn),l(qt);var St=u(qt,2),Vt=u(d(St),2),Kt=d(Vt),dn=u(Kt);{var Zt=Ht=>{var zt=Gk(),Yt=d(zt);l(zt),L(wn=>S(Yt,`· ${wn??""}%`),[()=>{var wn,rr;return Bn((rr=(wn=n(k).cluster)==null?void 0:wn.system)==null?void 0:rr.cpu_usage)}]),v(Ht,zt)},Mn=y(()=>{var Ht,zt;return Bn((zt=(Ht=n(k).cluster)==null?void 0:Ht.system)==null?void 0:zt.cpu_usage)!==void 0}),Dt=Ht=>{var zt=Yk();v(Ht,zt)};B(dn,Ht=>{n(Mn)?Ht(Zt):Ht(Dt,-1)})}l(Vt),l(St);var gt=u(St,2),xt=u(d(gt),2),un=d(xt);{var zn=Ht=>{var zt=Xk(),Yt=ue(zt),wn=u(Yt),rr=d(wn);l(wn),L((Tr,wa,fi)=>{S(Yt,`${Tr??""} `),S(rr,`· r ${wa??""} / w ${fi??""}`)},[()=>X(n(Ft).requests_per_second),()=>X(n(Ft).reads_per_second),()=>X(n(Ft).writes_per_second)]),v(Ht,zt)},Ln=Ht=>{var zt=Zk();v(Ht,zt)};B(un,Ht=>{n(Ft)?Ht(zn):Ht(Ln,-1)})}l(xt),l(gt);var Dn=u(gt,2),Qt=u(d(Dn),2),mn=d(Qt,!0);l(Qt),l(Dn);var In=u(Dn,2),Qn=u(d(In),2),nr=d(Qn,!0);l(Qn),l(In),L((Ht,zt,Yt,wn,rr,Tr,wa,fi,hu)=>{S(Sn,`${n(k).stats.system.hostname??""} · ${n(k).stats.system.os??""}/${n(k).stats.system.arch??""}`),S(Nn,`pid ${n(k).stats.system.pid??""}`),S(An,`${n(k).stats.active_connections??""} active `),S(Le,`/ ${n(k).stats.idle_connections??""} idle`),S(et,n(k).stats.store.collection_count),S(wt,Ht),S(At,zt),S(fn,Yt),S(Wt,wn),S(vn,`${rr??""} used `),S(Ut,`/ ${Tr??""} (${wa??""})`),S(Kt,`${n(k).stats.system.cpu_cores??""} cores `),S(mn,fi),S(nr,hu)},[()=>n(k).stats.store.total_entities.toLocaleString(),()=>n(k).stats.store.cross_ref_count.toLocaleString(),()=>D(n(k).stats.store.total_memory_bytes),()=>W(n(k)),()=>D(n(ct)-n(Lt)),()=>D(n(ct)),()=>T(n(ct)-n(Lt),n(ct)),()=>{var Ht,zt;return H((zt=Bn((Ht=n(k).cluster)==null?void 0:Ht.latency))==null?void 0:zt.avg_response_ms)},()=>{var Ht;return((Ht=n(k).cluster)==null?void 0:Ht.uptime_secs)!==void 0?$(Date.now()-n(k).cluster.uptime_secs*1e3):$(n(k).stats.started_at_unix_ms)}]),v(rt,on)};B(Mt,rt=>{n(k).stats&&rt(Et)})}var mt=u(Mt,2);{var yt=rt=>{var ct=c5(),Lt=u(ue(ct),2);{var Ft=sn=>{var ln=a5(),Sn=ue(ln),cn=u(d(Sn),2),yn=d(cn,!0);l(cn),l(Sn);var Nn=u(Sn,2);{var Pn=st=>{var vt=Jk(),At=u(d(vt),2),Ot=d(At),Jt=u(Ot),fn=d(Jt);l(Jt),l(At),l(vt),L(()=>{var $t,Rt;S(Ot,`${n(k).replication.commit_watermark??""} `),S(fn,`· ${((Rt=($t=n(k).cluster)==null?void 0:$t.replication)==null?void 0:Rt.commit_policy)??""??""}`)}),v(st,vt)};B(Nn,st=>{n(k).replication.commit_watermark!==void 0&&st(Pn)})}var Cn=u(Nn,2),An=u(d(Cn),2),ye=d(An);Ce(),l(An),l(Cn);var Le=u(Cn,2);{var He=st=>{var vt=e5(),At=u(d(vt),2),Ot=d(At),Jt=u(Ot),fn=d(Jt);l(Jt),l(At),l(vt),L(()=>{S(Ot,`${n(k).replication.full_resync_count??0??""} full `),S(fn,`/ ${n(k).replication.partial_resync_count??0??""} partial`)}),v(st,vt)};B(Le,st=>{((n(k).replication.full_resync_count??0)>0||(n(k).replication.partial_resync_count??0)>0)&&st(He)})}var Ge=u(Le,2),et=u(d(Ge),2),tt=d(et,!0);l(et),l(Ge);var We=u(Ge,2);{var wt=st=>{var vt=r5();Qe(vt,21,()=>n(k).replication.replicas,At=>At.id,(At,Ot)=>{var Jt=n5(),fn=d(Jt),$t=u(fn,2),Rt=d($t,!0),Wt=u(Rt);{var qt=St=>{var Vt=t5();v(St,Vt)};B(Wt,St=>{n(Ot).rebootstrapping&&St(qt)})}l($t);var rn=u($t,2),vn=d(rn);l(rn);var gn=u(rn,2),Ut=d(gn,!0);l(gn),l(Jt),L((St,Vt)=>{Ve(fn,1,St,"svelte-gcvueu"),S(Rt,n(Ot).id),S(vn,`${n(Ot).lag_lsn??""} lsn`),Ve(gn,1,Ke(n(Ot).lag_seconds===0?"text-role-replica":"text-fg-0")),S(Ut,Vt)},[()=>Ke(["w-1.5 h-1.5 rounded-full shrink-0",n(Ot).lag_seconds===0?"bg-role-replica":n(Ot).lag_seconds<5?"bg-amber-400":"bg-accent"].join(" ")),()=>n(Ot).lag_seconds===0?"✓ sync":_(n(Ot).lag_seconds)]),v(At,Jt)}),l(vt),v(st,vt)};B(We,st=>{var vt;(vt=n(k).replication.replicas)!=null&&vt.length&&st(wt)})}L(()=>{var st,vt,At,Ot,Jt,fn;S(yn,((vt=(st=n(k).cluster)==null?void 0:st.wal)==null?void 0:vt.current_lsn)??n(k).replication.wal_lsn??"not exposed"),S(ye,`${((Ot=(At=n(k).cluster)==null?void 0:At.wal)==null?void 0:Ot.archive_lag_records)??"not exposed"??""} `),S(tt,n(k).replication.replica_count??((fn=(Jt=n(k).cluster)==null?void 0:Jt.replication)==null?void 0:fn.replica_count)??0)}),v(sn,ln)},on=sn=>{const ln=y(()=>z(n(k)));var Sn=l5(),cn=ue(Sn),yn=u(d(cn),2),Nn=d(yn,!0);l(yn),l(cn);var Pn=u(cn,2),Cn=u(d(Pn),2),An=d(Cn),ye=u(An),Le=d(ye);l(ye),l(Cn),l(Pn);var He=u(Pn,2);{var Ge=We=>{var wt=i5(),st=u(d(wt),2),vt=d(st);{var At=$t=>{Wn($t,{tone:"ok",children:(Rt,Wt)=>{Ce();var qt=_t("in sync");v(Rt,qt)},$$slots:{default:!0}})},Ot=$t=>{Wn($t,{tone:"warn",children:(Rt,Wt)=>{Ce();var qt=_t();L(rn=>S(qt,`${rn??""} lsn`),[()=>n(ln).toLocaleString()]),v(Rt,qt)},$$slots:{default:!0}})};B(vt,$t=>{n(ln)===0?$t(At):$t(Ot,-1)})}var Jt=u(vt,2);{var fn=$t=>{var Rt=o5(),Wt=d(Rt,!0);l(Rt),L(()=>S(Wt,n(k).replication.state)),v($t,Rt)};B(Jt,$t=>{n(k).replication.state&&$t(fn)})}l(st),l(wt),v(We,wt)};B(He,We=>{n(ln)!==null&&We(Ge)})}var et=u(He,2);{var tt=We=>{var wt=s5(),st=u(d(wt),2),vt=d(st,!0);l(st),l(wt),L(()=>S(vt,n(k).replication.last_error)),v(We,wt)};B(et,We=>{n(k).replication.last_error&&We(tt)})}L(()=>{S(Nn,n(k).replication.primary_addr??n(k).replication.leader??"unknown"),S(An,`${n(k).replication.last_applied_lsn??""} `),S(Le,`/ ${n(k).replication.last_seen_primary_lsn??""}`)}),v(sn,Sn)};B(Lt,sn=>{n(k).replication.role==="primary"?sn(Ft):n(k).replication.role==="replica"&&sn(on,1)})}v(rt,ct)};B(mt,rt=>{n(k).replication&&rt(yt)})}var kt=u(mt,4);{var It=rt=>{var ct=b5(),Lt=ue(ct),Ft=u(d(Lt),2),on=d(Ft);{var sn=et=>{var tt=d5(),We=u(ue(tt)),wt=d(We,!0);l(We);var st=u(We,2),vt=d(st);l(st),L(()=>{S(wt,n(te).username),S(vt,`· ${n(te).role??""}`)}),v(et,tt)},ln=et=>{var tt=u5(),We=d(tt,!0);l(tt),L(()=>S(We,n(te).error)),v(et,tt)},Sn=et=>{var tt=f5();v(et,tt)};B(on,et=>{var tt,We;(tt=n(te))!=null&&tt.username?et(sn):(We=n(te))!=null&&We.error?et(ln,1):et(Sn,-1)})}l(Ft),l(Lt);var cn=u(Lt,2),yn=u(d(cn),2),Nn=d(yn);{var Pn=et=>{var tt=v5(),We=d(tt);l(tt),L(()=>S(We,`${n(te).users??""} users`)),v(et,tt)};B(Nn,et=>{var tt;((tt=n(te))==null?void 0:tt.users)!==void 0&&et(Pn)})}var Cn=u(Nn,2);{var An=et=>{var tt=g5(),We=d(tt);l(tt),L(()=>S(We,`${n(te).tenants??""} tenants`)),v(et,tt)};B(Cn,et=>{var tt;((tt=n(te))==null?void 0:tt.tenants)!==void 0&&et(An)})}var ye=u(Cn,2);{var Le=et=>{var tt=p5(),We=d(tt);l(tt),L(()=>S(We,`${n(te).policies??""} policies`)),v(et,tt)},He=et=>{var tt=h5();v(et,tt)};B(ye,et=>{var tt,We;(tt=n(te))!=null&&tt.policyAllowed&&((We=n(te))==null?void 0:We.policies)!==void 0?et(Le):n(te)&&n(te).policyAllowed===!1&&et(He,1)})}var Ge=u(ye,2);l(yn),l(cn),we("click",Ge,et=>xe.go({view:"security"},et)),v(rt,ct)},Xt=rt=>{var ct=x5();v(rt,ct)};B(kt,rt=>{n(le)?rt(It):rt(Xt,-1)})}var hn=u(kt,2);{var xn=rt=>{var ct=_5(),Lt=u(ue(ct),2),Ft=u(d(Lt),2);Qe(Ft,21,()=>n(Q),bn,(on,sn)=>{var ln=m5(),Sn=d(ln,!0);l(ln),L(()=>S(Sn,n(sn))),v(on,ln)}),l(Ft),l(Lt),v(rt,ct)};B(hn,rt=>{n(Q).length&&rt(xn)})}l(Oe),L(rt=>{S(ze,n(k).preset.label),S(Xe,n(k).preset.url),S($e,rt)},[()=>K(n(k))]),v(ve,Oe)},$$slots:{default:!0}}),l(Ee),v(pe,Ee)};B(oe,pe=>{n(k)&&pe(me)})}v(E,j)};B(ge,E=>{n(s)?E(ie):_n.locked?E(ee,1):n(P).length===0?E(q,2):E(G,-1)})}v(t,ae),it()}tn(["click"]);var C5=x('<button type="button" class="rounded-full border border-line-2 bg-bg-1 px-3 py-1.5 text-[11px] text-fg-2 hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"> </button>'),E5=x('<div class="flex flex-col items-center gap-4 py-16 text-center"><div class="flex size-12 items-center justify-center rounded-full border border-line-2 bg-bg-1"><!></div> <div><div class="font-mono text-[15px] text-fg-0">Ask your database</div> <div class="mt-1 text-[12px] text-fg-3">Grounded answers with citations to the rows, docs, and vectors behind them.</div></div> <div class="flex flex-wrap justify-center gap-1.5"></div></div>'),N5=x('<div class="flex justify-end"><div class="max-w-[85%] rounded-lg rounded-br-sm border border-line-2 bg-bg-2 px-3 py-2 font-mono text-[12px] text-fg-0"> </div></div>'),M5=x('<div class="flex items-center gap-2 text-[12px] text-fg-3"><!> thinking…</div>'),z5=x('<div class="flex items-start gap-2 rounded-lg border border-accent/30 bg-accent/5 px-3 py-2 text-[12px] text-fg-1"><!> <span> </span></div>'),T5=x('<button type="button" class="mx-0.5 inline-flex h-4 min-w-4 items-center justify-center rounded bg-accent/15 px-1 align-super text-[9px] font-semibold text-accent hover:bg-accent/25"> </button>'),P5=x('<button type="button" class="rounded border border-line-1 px-1.5 py-0.5 hover:border-line-3 hover:text-fg-1"> </button>'),A5=x('<span class="font-mono"> </span>'),L5=x("<span>cached</span>"),I5=x('<span class="font-mono"> </span>'),O5=x('<div class="text-[13px] leading-relaxed text-fg-1"></div> <div class="flex flex-wrap items-center gap-1.5 text-[10px] text-fg-3"><!> <!> <!> <!> <!></div>',1),R5=x('<div class="flex flex-col gap-1.5"><!></div>'),D5=x('<div class="flex h-full flex-col"><div class="flex-1 overflow-auto"><div><!> <!></div></div> <div class="border-t border-line-1 bg-bg-0/80 p-3 backdrop-blur"><div><textarea rows="1" class="max-h-32 min-h-9 flex-1 resize-none rounded-lg border border-line-2 bg-bg-1 px-3 py-2 font-mono text-[12px] text-fg-0 placeholder:text-fg-3 focus:border-line-3 focus:outline-none disabled:opacity-50"></textarea> <button type="button" class="inline-flex h-9 items-center gap-1.5 rounded-lg bg-accent px-3 text-[12px] font-medium text-white hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-40"><!> Ask</button></div></div></div>'),$5=x('<span class="font-mono text-[10px] text-fg-2"> <span class="text-fg-3"> </span></span>'),V5=x('<span class="ml-auto font-mono text-[10px] text-fg-3"> </span>'),H5=x('<div><div class="mb-1.5 flex items-center gap-2"><span class="inline-flex size-4 items-center justify-center rounded bg-accent/15 text-[9px] font-semibold text-accent"> </span> <!> <!> <!></div> <pre class="max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[10px] leading-relaxed text-fg-1"> </pre></div>'),F5=x('<div class="flex items-center justify-between border-b border-line-1 px-4 py-2.5"><span class="type-label"> </span> <span class="font-mono text-[10px] text-fg-3"> </span></div> <div class="flex-1 overflow-auto p-3"><div class="grid gap-2"></div></div>',1),q5=x('<div class="flex h-full items-center justify-center font-mono text-[12px] text-fg-3">no grounding to show</div>'),K5=x('<div class="flex h-full flex-col overflow-hidden bg-bg-1"><!></div>'),j5=x('<div class="p-6"><!></div>'),B5=x('<div class="p-6"><!></div>'),W5=x('<div class="grid h-full grid-cols-[minmax(340px,42%)_1fr] overflow-hidden"><div class="min-h-0 border-r border-line-1"><!></div> <div class="min-h-0"><!></div></div>'),U5=x('<div class="h-full overflow-hidden bg-bg-0 text-fg-1"><!></div>');function G5(t,e){ot(e,!0);const r=(C,N=Kn)=>{var _=D5(),z=d(_),I=d(z),D=d(I);{var T=ge=>{var ie=E5(),ee=d(ie),q=d(ee);Co(q,{class:"size-5 text-accent"}),l(ee);var G=u(ee,4);Qe(G,21,()=>P,bn,(E,j)=>{var R=C5(),A=d(R,!0);l(R),L(()=>{R.disabled=!n(p)||n(b),S(A,n(j))}),we("click",R,()=>{m(s,n(j),!0),n(h)&&V()}),v(E,R)}),l(G),l(ie),v(ge,ie)};B(D,ge=>{n(o).length===0&&ge(T)})}var $=u(D,2);Qe($,19,()=>n(o),ge=>ge.id,(ge,ie,ee)=>{var q=De(),G=ue(q);{var E=R=>{var A=N5(),Z=d(A),J=d(Z,!0);l(Z),l(A),L(()=>S(J,n(ie).text)),v(R,A)},j=R=>{var A=R5(),Z=d(A);{var J=pe=>{var Ee=M5(),Se=d(Ee);Co(Se,{class:"size-3.5 animate-pulse text-accent"}),Ce(),l(Ee),v(pe,Ee)},oe=pe=>{var Ee=z5(),Se=d(Ee);yc(Se,{class:"mt-0.5 size-3.5 shrink-0 text-accent"});var ve=u(Se,2),ce=d(ve,!0);l(ve),l(Ee),L(Oe=>S(ce,Oe),[()=>n(ie).error.includes("404")||n(ie).error.includes("route not found")?"This reddb has no AI endpoint (/ai/ask). Configure a provider to enable Ask.":n(ie).error]),v(pe,Ee)},me=pe=>{var Ee=O5(),Se=ue(Ee);Qe(Se,21,()=>rv(n(ie).response.answer),bn,(Ne,Me)=>{var Xe=De(),Re=ue(Xe);{var Je=ft=>{var qe=_t();L(()=>S(qe,n(Me).value)),v(ft,qe)},dt=ft=>{var qe=T5(),$e=d(qe,!0);l(qe),L(()=>{Pe(qe,"title",`Jump to source ${n(Me).marker??""}`),S($e,n(Me).marker)}),we("click",qe,()=>k(n(ee),n(Me).marker)),v(ft,qe)};B(Re,ft=>{n(Me).type==="text"?ft(Je):ft(dt,-1)})}v(Ne,Xe)}),l(Se);var ve=u(Se,2),ce=d(ve);{var Oe=Ne=>{Wn(Ne,{tone:"warn",children:(Me,Xe)=>{Ce();var Re=_t("unverified citations");v(Me,Re)},$$slots:{default:!0}})};B(ce,Ne=>{n(ie).response.validation&&!n(ie).response.validation.ok&&Ne(Oe)})}var re=u(ce,2);{var de=Ne=>{var Me=P5(),Xe=d(Me);l(Me),L(()=>S(Xe,`${n(ie).response.sources_flat.length??""} source${n(ie).response.sources_flat.length===1?"":"s"}`)),we("click",Me,()=>{m(c,n(ee),!0),m(f,null)}),v(Ne,Me)};B(re,Ne=>{var Me;(Me=n(ie).response.sources_flat)!=null&&Me.length&&Ne(de)})}var he=u(re,2);{var Ie=Ne=>{var Me=A5(),Xe=d(Me);l(Me),L(()=>S(Xe,`${n(ie).response.provider??""}${n(ie).response.model?`·${n(ie).response.model}`:""}`)),v(Ne,Me)};B(he,Ne=>{n(ie).response.provider&&Ne(Ie)})}var Ae=u(he,2);{var ke=Ne=>{var Me=L5();v(Ne,Me)};B(Ae,Ne=>{n(ie).response.cache_hit&&Ne(ke)})}var Te=u(Ae,2);{var ze=Ne=>{var Me=I5(),Xe=d(Me,!0);l(Me),L(Re=>S(Xe,Re),[()=>U(n(ie).response.cost_usd)]),v(Ne,Me)};B(Te,Ne=>{n(ie).response.cost_usd!==void 0&&Ne(ze)})}l(ve),v(pe,Ee)};B(Z,pe=>{n(ie).pending?pe(J):n(ie).error?pe(oe,1):n(ie).response&&pe(me,2)})}l(A),v(R,A)};B(G,R=>{n(ie).role==="user"?R(E):R(j,-1)})}v(ge,q)}),l(I),l(z);var X=u(z,2),H=d(X),W=d(H);Va(W);var Y=u(W,2),ae=d(Y);bv(ae,{class:"size-3.5"}),Ce(),l(Y),l(H),l(X),l(_),L((ge,ie)=>{Ve(I,1,ge),Ve(H,1,ie),Pe(W,"placeholder",n(p)?"Ask anything about this database…":"Connect to ask"),W.disabled=!n(p)||n(b),Y.disabled=!n(h)},[()=>Ke(["mx-auto flex flex-col gap-4 p-4",N()?"max-w-none":"max-w-2xl"].join(" ")),()=>Ke(["mx-auto flex items-end gap-2",N()?"max-w-none":"max-w-2xl"].join(" "))]),we("keydown",W,O),Tn(W,()=>n(s),ge=>m(s,ge)),we("click",Y,V),v(C,_)},a=C=>{var N=K5(),_=d(N);{var z=D=>{const T=y(()=>n(M).response);var $=F5(),X=ue($),H=d(X),W=d(H);l(H);var Y=u(H,2),ae=d(Y);l(Y),l(X);var ge=u(X,2),ie=d(ge);Qe(ie,23,()=>n(T).sources_flat,(ee,q)=>ee.urn+q,(ee,q,G)=>{const E=y(()=>av(n(q).urn));var j=H5(),R=d(j),A=d(R),Z=d(A,!0);l(A);var J=u(A,2);{let ce=y(()=>Q[n(q).kind]??"neutral");Wn(J,{get tone(){return n(ce)},children:(Oe,re)=>{Ce();var de=_t();L(()=>S(de,n(q).kind)),v(Oe,de)},$$slots:{default:!0}})}var oe=u(J,2);{var me=ce=>{var Oe=$5(),re=d(Oe,!0),de=u(re),he=d(de);l(de),l(Oe),L(()=>{S(re,n(E).collection),S(he,`/${n(E).id??""}`)}),v(ce,Oe)};B(oe,ce=>{n(E)&&ce(me)})}var pe=u(oe,2);{var Ee=ce=>{var Oe=V5(),re=d(Oe);l(Oe),L(de=>S(re,`score ${de??""}`),[()=>n(q).score.toFixed(2)]),v(ce,Oe)};B(pe,ce=>{n(q).score!==void 0&&ce(Ee)})}l(R);var Se=u(R,2),ve=d(Se,!0);l(Se),l(j),L((ce,Oe)=>{Ve(j,1,ce),S(Z,n(G)+1),S(ve,Oe)},[()=>Ke(["rounded border bg-bg-0 p-2.5 transition-colors",n(f)===n(G)+1?"border-accent":"border-line-1"].join(" ")),()=>F(n(q).content)]),v(ee,j)}),l(ie),l(ge),L(()=>{S(W,`grounding · ${n(T).sources_flat.length??""} source${n(T).sources_flat.length===1?"":"s"}`),S(ae,`${n(T).provider??""??""}${n(T).model?` · ${n(T).model}`:""}`)}),v(D,$)},I=D=>{var T=q5();v(D,T)};B(_,D=>{var T;(T=n(M))!=null&&T.response?D(z):D(I,-1)})}l(N),v(C,N)};let o=_e(Bt([])),s=_e(""),i=_e(!1),c=_e(null),f=_e(null),g=0;const p=y(()=>Ue.connected),b=y(()=>_n.locked),h=y(()=>n(p)&&!n(b)&&!n(i)&&n(s).trim().length>0),w=y(()=>n(o).some(C=>{var N,_;return C.role==="assistant"&&(((_=(N=C.response)==null?void 0:N.sources_flat)==null?void 0:_.length)??0)>0})),M=y(()=>n(c)!==null?n(o)[n(c)]:[...n(o)].reverse().find(C=>{var N,_;return(((_=(N=C.response)==null?void 0:N.sources_flat)==null?void 0:_.length)??0)>0})),P=["What changed in the last hour?","Which collections hold the most rows?","Summarize the most recent errors."];async function V(){var I;const C=n(s).trim(),N=Ue.client;if(!C||!N||n(i))return;m(s,"");const _={id:g++,role:"user",text:C},z={id:g++,role:"assistant",text:"",pending:!0};m(o,[...n(o),_,z],!0),m(i,!0);try{const D=await Ct.track("ask",()=>N.ask(C)),T=n(o).findIndex($=>$.id===z.id);T!==-1&&(n(o)[T]={...z,pending:!1,text:D.answer,response:D},(((I=D.sources_flat)==null?void 0:I.length)??0)>0&&m(c,T,!0))}catch(D){const T=n(o).findIndex($=>$.id===z.id);T!==-1&&(n(o)[T]={...z,pending:!1,error:D.message})}finally{m(i,!1)}}function O(C){C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),n(h)&&V())}function k(C,N){m(c,C,!0),m(f,N,!0)}function F(C){try{return JSON.stringify(JSON.parse(C),null,2)}catch{return C}}function U(C){return C===void 0?"":C<.01?`$${C.toFixed(4)}`:`$${C.toFixed(2)}`}const Q={table:"info",document:"ok",vector:"accent",graph_node:"warn",graph_edge:"warn",kv:"neutral"};var se=U5(),xe=d(se);{var le=C=>{var N=j5(),_=d(N);Fn(_,{get icon(){return Gr},title:"Locked",message:"Unlock the secure store to ask."}),l(N),v(C,N)},te=C=>{var N=B5(),_=d(N);Fn(_,{get icon(){return Co},title:"Not connected",message:"Connect to a reddb instance to ask grounded questions."}),l(N),v(C,N)},be=C=>{var N=W5(),_=d(N),z=d(_);r(z,()=>!0),l(_);var I=u(_,2),D=d(I);a(D),l(I),l(N),v(C,N)},K=C=>{r(C,()=>!1)};B(xe,C=>{n(b)?C(le):n(p)?n(w)?C(be,2):C(K,-1):C(te,1)})}l(se),v(t,se),it()}tn(["click","keydown"]);var Y5=x('<div class="type-label mb-1.5"> </div>'),X5=x('<p class="type-caption m-0 mt-1.5"> </p>'),Z5=x('<div class="flex items-center gap-2 shrink-0"><!></div>'),Q5=x('<header class="flex items-end justify-between gap-4 pb-4 mb-4 border-b border-line-1"><div class="min-w-0"><!> <div class="flex items-baseline gap-3 flex-wrap"><h1 class="type-h1 m-0"> </h1> <!></div> <!></div> <!></header>');function Ra(t,e){var r=Q5(),a=d(r),o=d(a);{var s=M=>{var P=Y5(),V=d(P,!0);l(P),L(()=>S(V,e.eyebrow)),v(M,P)};B(o,M=>{e.eyebrow&&M(s)})}var i=u(o,2),c=d(i),f=d(c,!0);l(c);var g=u(c,2);pn(g,()=>e.children??Kn),l(i);var p=u(i,2);{var b=M=>{var P=X5(),V=d(P,!0);l(P),L(()=>S(V,e.subtitle)),v(M,P)};B(p,M=>{e.subtitle&&M(b)})}l(a);var h=u(a,2);{var w=M=>{var P=Z5(),V=d(P);pn(V,()=>e.actions),l(P),v(M,P)};B(h,M=>{e.actions&&M(w)})}l(r),L(()=>S(f,e.title)),v(t,r)}var J5=x('<button type="button" class="inline-flex h-7 items-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> refresh</button>'),e4=x('<div class="text-[12px] font-mono text-warn break-words"> </div>'),t4=x('<span class="text-fg-3">note</span> <span class="text-fg-1"> </span>',1),n4=x('<div class="grid grid-cols-[110px_1fr] gap-x-3 gap-y-2 text-[12px] font-mono"><span class="text-fg-3">authenticated</span> <span><!></span> <span class="text-fg-3">username</span> <span class="text-fg-0"> </span> <span class="text-fg-3">role</span> <span class="text-accent"> </span> <!></div>'),r4=x('<div class="text-[12px] font-mono text-fg-3">Loading session…</div>'),a4=x('<div class="mb-2 inline-flex items-center gap-1.5 rounded border border-warn/40 bg-bg-0 px-2 py-1 text-[11px] font-mono text-warn"><!> tenants endpoint denied or unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),o4=x('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No tenants returned for this principal.</span></div>'),i4=x('<div class="rounded border border-line-1 bg-bg-0 px-2 py-1.5"><div class="flex items-center gap-2"><span class="text-fg-0"> </span> <!></div> <div class="mt-1 text-fg-3"> <!></div></div>'),s4=x('<div class="grid gap-1 text-[12px] font-mono"></div>'),l4=x('<div class="mb-2 inline-flex items-center gap-1.5 rounded border border-warn/40 bg-bg-0 px-2 py-1 text-[11px] font-mono text-warn"><!> policies endpoint denied or unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),c4=x('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No policies returned for this principal.</span></div>'),d4=x('<div class="rounded border border-line-1 bg-bg-0 px-2 py-1.5"><div class="flex items-center gap-2"><span class="text-fg-0"> </span> <!></div> <div class="mt-1 text-fg-3"> <!></div></div>'),u4=x('<div class="text-[11px] text-fg-3"> </div>'),f4=x('<div class="grid gap-1 text-[12px] font-mono"><!> <!></div>'),v4=x('<div class="mb-3 inline-flex items-center gap-1.5 rounded border border-warn/40 bg-bg-0 px-2 py-1 text-[11px] font-mono text-warn"><!> users endpoint denied or unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),g4=x('<div class="flex items-center gap-2 text-[12px] font-mono text-fg-3"><!> <span>No users returned for this principal.</span></div>'),p4=x('<span class="text-fg-3">-</span>'),h4=x('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1 text-fg-0"> </td><td class="px-2 py-1 text-accent"> </td><td class="px-2 py-1"><!></td><td class="px-2 py-1 text-fg-2"> </td><td class="px-2 py-1 text-fg-2"> </td></tr>'),b4=x('<div class="overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">user</th><th class="px-2 py-1.5 text-left font-normal">role</th><th class="px-2 py-1.5 text-left font-normal">mfa</th><th class="px-2 py-1.5 text-left font-normal">created</th><th class="px-2 py-1.5 text-left font-normal">last active</th></tr></thead><tbody></tbody></table></div>'),x4=x('<div class="text-[12px] font-mono text-fg-3">Policy table unavailable for this principal.</div>'),m4=x('<div class="text-[12px] font-mono text-fg-3">No policies to tabulate.</div>'),_4=x('<span class="text-fg-3">-</span>'),y4=x('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1"><!></td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1 text-accent"> </td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1 text-fg-2"> </td></tr>'),w4=x('<div class="overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">effect</th><th class="px-2 py-1.5 text-left font-normal">principal</th><th class="px-2 py-1.5 text-left font-normal">action</th><th class="px-2 py-1.5 text-left font-normal">resource</th><th class="px-2 py-1.5 text-left font-normal">tenant</th></tr></thead><tbody></tbody></table></div>'),k4=x('<div class="mb-2 inline-flex items-center gap-1.5 rounded border border-warn/40 bg-bg-0 px-2 py-1 text-[11px] font-mono text-warn"><!> capability matrix unavailable</div> <pre class="whitespace-pre-wrap break-words text-[12px] font-mono text-fg-3"> </pre>',1),S4=x('<div class="text-[12px] font-mono text-fg-3">No capability checks returned.</div>'),C4=x('<span class="inline-flex items-center gap-1 text-ok"><!> yes</span>'),E4=x('<span class="inline-flex items-center gap-1 text-danger"><!> no</span>'),N4=x('<span class="text-fg-3">-</span>'),M4=x('<span class="inline-flex flex-wrap gap-1"></span>'),z4=x('<tr class="border-b border-line-1/60 hover:bg-bg-1/40"><td class="px-2 py-1"><!></td><td class="px-2 py-1 text-accent"> </td><td class="px-2 py-1 text-fg-1"> </td><td class="px-2 py-1"><!></td><td class="max-w-[320px] px-2 py-1 text-fg-3"> </td></tr>'),T4=x('<div class="overflow-auto"><table class="w-full border-collapse text-[12px] font-mono"><thead class="sticky top-0 bg-bg-1"><tr class="border-b border-line-1 text-fg-3"><th class="px-2 py-1.5 text-left font-normal">can</th><th class="px-2 py-1.5 text-left font-normal">action</th><th class="px-2 py-1.5 text-left font-normal">resource</th><th class="px-2 py-1.5 text-left font-normal">policy effect</th><th class="px-2 py-1.5 text-left font-normal">reason</th></tr></thead><tbody></tbody></table></div>'),P4=x("<!> <!>",1),A4=x('<div class="grid grid-cols-[minmax(280px,0.75fr)_1.25fr] gap-3"><div class="grid gap-3 content-start"><!> <!> <!></div> <div class="grid gap-3 content-start"><!> <!></div></div>'),L4=x('<div class="h-full overflow-auto bg-bg-0 p-6 text-fg-1"><!> <!></div>');function I4(t,e){ot(e,!0);let r=_e(null),a=_e(Bt([])),o=_e(Bt([])),s=_e(Bt([])),i=_e(null),c=_e(Bt([])),f=_e(!1),g=_e(null),p=_e(null),b=_e(null),h=_e(null),w=_e(null);const M=y(()=>Ue.active.url),P=y(()=>Ue.connected),V=y(()=>{var te;return((te=n(i))==null?void 0:te.allowed)===!0});function O(te){if(!te)return"-";const be=te>1e10?te:te*1e3;return new Date(be).toISOString().replace("T"," ").slice(0,19)}async function k(){const te=Ue.client;if(!te||_n.locked||!n(P)){m(r,null),m(a,[],!0),m(o,[],!0),m(s,[],!0),m(i,null),m(c,[],!0);return}m(f,!0),m(g,null),m(p,null),m(b,null),m(h,null),m(w,null),m(i,null),m(c,[],!0);try{m(r,await Ct.track("security · whoami",()=>te.whoami()),!0)}catch(be){m(g,be.message,!0),m(r,null)}try{m(a,await Ct.track("security · tenants",()=>te.tenants()),!0)}catch(be){m(p,be.message,!0),m(a,[],!0)}try{m(o,await Ct.track("security · users",()=>te.users()),!0)}catch(be){m(b,be.message,!0),m(o,[],!0)}try{const[be]=await Ct.track("security · auth.can policy read",()=>te.authCan([Oa]));m(i,be??{...Oa,allowed:!1,reason:"auth.can omitted policy-read decision"},!0)}catch(be){m(i,{...Oa,allowed:!1,reason:be.message||"auth.can failed"},!0)}if(n(i).allowed){try{m(s,await Ct.track("security · policies",()=>te.policies()),!0)}catch(be){m(h,be.message,!0),m(s,[],!0)}try{const be=cu(n(s)),K=await Ct.track("security · auth.can capability matrix",()=>te.authCan(be));m(c,Dk(n(s),K),!0)}catch(be){m(w,be.message,!0),m(c,[],!0)}}else m(s,[],!0),m(c,[],!0);m(f,!1)}an(()=>{_n.locked||(n(M),n(P),k())});var F=L4(),U=d(F);Ra(U,{eyebrow:"Admin",title:"Security",subtitle:"Tenants, users, and policy surfaces are permission-aware. Controls only appear when reddb exposes the grant.",actions:be=>{var K=J5(),C=d(K);{let N=y(()=>n(f)?"size-3.5 animate-spin":"size-3.5");Cs(C,{get class(){return n(N)}})}Ce(),l(K),L(()=>K.disabled=n(f)||_n.locked||!n(P)),we("click",K,k),v(be,K)}});var Q=u(U,2);{var se=te=>{Fn(te,{get icon(){return Gr},title:"Security locked",message:"Enter the master password before red-ui loads auth data."})},xe=te=>{Fn(te,{get icon(){return Sa},title:"No active connection",message:"Connect to a reddb instance to inspect security posture."})},le=te=>{var be=A4(),K=d(be),C=d(K);Cr(C,{title:"session",children:(X,H)=>{var W=De(),Y=ue(W);{var ae=ee=>{var q=e4(),G=d(q,!0);l(q),L(()=>S(G,n(g))),v(ee,q)},ge=ee=>{var q=n4(),G=u(d(q),2),E=d(G);{var j=Ee=>{Wn(Ee,{tone:"ok",children:(Se,ve)=>{Ce();var ce=_t("yes");v(Se,ce)},$$slots:{default:!0}})},R=Ee=>{Wn(Ee,{tone:"warn",children:(Se,ve)=>{Ce();var ce=_t("no");v(Se,ce)},$$slots:{default:!0}})};B(E,Ee=>{n(r).authenticated?Ee(j):Ee(R,-1)})}l(G);var A=u(G,4),Z=d(A,!0);l(A);var J=u(A,4),oe=d(J,!0);l(J);var me=u(J,2);{var pe=Ee=>{var Se=t4(),ve=u(ue(Se),2),ce=d(ve,!0);l(ve),L(()=>S(ce,n(r).note)),v(Ee,Se)};B(me,Ee=>{n(r).note&&Ee(pe)})}l(q),L(()=>{S(Z,n(r).username),S(oe,n(r).role)}),v(ee,q)},ie=ee=>{var q=r4();v(ee,q)};B(Y,ee=>{n(g)?ee(ae):n(r)?ee(ge,1):ee(ie,-1)})}v(X,W)},$$slots:{default:!0}});var N=u(C,2);Cr(N,{title:"tenants",children:(X,H)=>{var W=De(),Y=ue(W);{var ae=ee=>{var q=a4(),G=ue(q),E=d(G);Sa(E,{class:"size-3.5"}),Ce(),l(G);var j=u(G,2),R=d(j,!0);l(j),L(()=>S(R,n(p))),v(ee,q)},ge=ee=>{var q=o4(),G=d(q);cv(G,{class:"size-4"}),Ce(2),l(q),v(ee,q)},ie=ee=>{var q=s4();Qe(q,23,()=>n(a),(G,E)=>`${G.id??G.slug??G.name??E}`,(G,E)=>{var j=i4(),R=d(j),A=d(R),Z=d(A,!0);l(A);var J=u(A,2);{var oe=ve=>{Wn(ve,{tone:"accent",children:(ce,Oe)=>{Ce();var re=_t();L(()=>S(re,n(E).role)),v(ce,re)},$$slots:{default:!0}})};B(J,ve=>{n(E).role&&ve(oe)})}l(R);var me=u(R,2),pe=d(me),Ee=u(pe);{var Se=ve=>{var ce=_t();L(Oe=>S(ce,`· ${Oe??""}`),[()=>n(E).grants.join(", ")]),v(ve,ce)};B(Ee,ve=>{var ce;(ce=n(E).grants)!=null&&ce.length&&ve(Se)})}l(me),l(j),L(()=>{S(Z,n(E).name??n(E).slug??n(E).id??"tenant"),S(pe,`${n(E).id??n(E).slug??"-"??""} `)}),v(G,j)}),l(q),v(ee,q)};B(Y,ee=>{n(p)?ee(ae):n(a).length===0?ee(ge,1):ee(ie,-1)})}v(X,W)},$$slots:{default:!0}});var _=u(N,2);{var z=X=>{Cr(X,{title:"policies",children:(H,W)=>{var Y=De(),ae=ue(Y);{var ge=q=>{var G=l4(),E=ue(G),j=d(E);Sa(j,{class:"size-3.5"}),Ce(),l(E);var R=u(E,2),A=d(R,!0);l(R),L(()=>S(A,n(h))),v(q,G)},ie=q=>{var G=c4(),E=d(G);Av(E,{class:"size-4"}),Ce(2),l(G),v(q,G)},ee=q=>{var G=f4(),E=d(G);Qe(E,19,()=>n(s).slice(0,6),(A,Z)=>`${A.id??A.name??Z}`,(A,Z)=>{var J=d4(),oe=d(J),me=d(oe),pe=d(me,!0);l(me);var Ee=u(me,2);{var Se=de=>{{let he=y(()=>n(Z).effect==="deny"?"danger":"ok");Wn(de,{get tone(){return n(he)},children:(Ie,Ae)=>{Ce();var ke=_t();L(()=>S(ke,n(Z).effect)),v(Ie,ke)},$$slots:{default:!0}})}};B(Ee,de=>{n(Z).effect&&de(Se)})}l(oe);var ve=u(oe,2),ce=d(ve),Oe=u(ce);{var re=de=>{var he=_t();L(()=>S(he,`· tenant ${n(Z).tenant??""}`)),v(de,he)};B(Oe,de=>{n(Z).tenant&&de(re)})}l(ve),l(J),L(()=>{S(pe,n(Z).name??n(Z).id??"policy"),S(ce,`${n(Z).action??"*"??""} · ${n(Z).resource??"*"??""} `)}),v(A,J)});var j=u(E,2);{var R=A=>{var Z=u4(),J=d(Z);l(Z),L(()=>S(J,`${n(s).length-6} more policies in the table.`)),v(A,Z)};B(j,A=>{n(s).length>6&&A(R)})}l(G),v(q,G)};B(ae,q=>{n(h)?q(ge):n(s).length===0?q(ie,1):q(ee,-1)})}v(H,Y)},$$slots:{default:!0}})};B(_,X=>{n(V)&&X(z)})}l(K);var I=u(K,2),D=d(I);Cr(D,{title:"users",children:(X,H)=>{var W=De(),Y=ue(W);{var ae=ee=>{var q=v4(),G=ue(q),E=d(G);Sa(E,{class:"size-3.5"}),Ce(),l(G);var j=u(G,2),R=d(j,!0);l(j),L(()=>S(R,n(b))),v(ee,q)},ge=ee=>{var q=g4(),G=d(q);$v(G,{class:"size-4"}),Ce(2),l(q),v(ee,q)},ie=ee=>{var q=b4(),G=d(q),E=u(d(G));Qe(E,21,()=>n(o),j=>j.username,(j,R)=>{var A=h4(),Z=d(A),J=d(Z,!0);l(Z);var oe=u(Z),me=d(oe,!0);l(oe);var pe=u(oe),Ee=d(pe);{var Se=he=>{Wn(he,{tone:"ok",children:(Ie,Ae)=>{Ce();var ke=_t("on");v(Ie,ke)},$$slots:{default:!0}})},ve=he=>{var Ie=p4();v(he,Ie)};B(Ee,he=>{n(R).mfa?he(Se):he(ve,-1)})}l(pe);var ce=u(pe),Oe=d(ce,!0);l(ce);var re=u(ce),de=d(re,!0);l(re),l(A),L((he,Ie)=>{S(J,n(R).username),S(me,n(R).role??"-"),S(Oe,he),S(de,Ie)},[()=>O(n(R).created_at),()=>O(n(R).last_active)]),v(j,A)}),l(E),l(G),l(q),v(ee,q)};B(Y,ee=>{n(b)?ee(ae):n(o).length===0?ee(ge,1):ee(ie,-1)})}v(X,W)},$$slots:{default:!0}});var T=u(D,2);{var $=X=>{var H=P4(),W=ue(H);Cr(W,{title:"policy table",children:(ae,ge)=>{var ie=De(),ee=ue(ie);{var q=j=>{var R=x4();v(j,R)},G=j=>{var R=m4();v(j,R)},E=j=>{var R=w4(),A=d(R),Z=u(d(A));Qe(Z,23,()=>n(s),(J,oe)=>`${J.id??J.name??oe}`,(J,oe)=>{var me=y4(),pe=d(me),Ee=d(pe);{var Se=Te=>{{let ze=y(()=>n(oe).effect==="deny"?"danger":"ok");Wn(Te,{get tone(){return n(ze)},children:(Ne,Me)=>{Ce();var Xe=_t();L(()=>S(Xe,n(oe).effect)),v(Ne,Xe)},$$slots:{default:!0}})}},ve=Te=>{var ze=_4();v(Te,ze)};B(Ee,Te=>{n(oe).effect?Te(Se):Te(ve,-1)})}l(pe);var ce=u(pe),Oe=d(ce,!0);l(ce);var re=u(ce),de=d(re,!0);l(re);var he=u(re),Ie=d(he,!0);l(he);var Ae=u(he),ke=d(Ae,!0);l(Ae),l(me),L(()=>{S(Oe,n(oe).principal??"-"),S(de,n(oe).action??"*"),S(Ie,n(oe).resource??"*"),S(ke,n(oe).tenant??"-")}),v(J,me)}),l(Z),l(A),l(R),v(j,R)};B(ee,j=>{n(h)?j(q):n(s).length===0?j(G,1):j(E,-1)})}v(ae,ie)},$$slots:{default:!0}});var Y=u(W,2);Cr(Y,{title:"my capabilities",children:(ae,ge)=>{var ie=De(),ee=ue(ie);{var q=j=>{var R=k4(),A=ue(R),Z=d(A);Sa(Z,{class:"size-3.5"}),Ce(),l(A);var J=u(A,2),oe=d(J,!0);l(J),L(()=>S(oe,n(w))),v(j,R)},G=j=>{var R=S4();v(j,R)},E=j=>{var R=T4(),A=d(R),Z=u(d(A));Qe(Z,21,()=>n(c),J=>J.id,(J,oe)=>{var me=z4(),pe=d(me),Ee=d(pe);{var Se=Ne=>{var Me=C4(),Xe=d(Me);Ss(Xe,{class:"size-3.5"}),Ce(),l(Me),v(Ne,Me)},ve=Ne=>{var Me=E4(),Xe=d(Me);vv(Xe,{class:"size-3.5"}),Ce(),l(Me),v(Ne,Me)};B(Ee,Ne=>{n(oe).allowed?Ne(Se):Ne(ve,-1)})}l(pe);var ce=u(pe),Oe=d(ce,!0);l(ce);var re=u(ce),de=d(re,!0);l(re);var he=u(re),Ie=d(he);{var Ae=Ne=>{var Me=N4();v(Ne,Me)},ke=Ne=>{var Me=M4();Qe(Me,21,()=>n(oe).effects,bn,(Xe,Re)=>{{let Je=y(()=>n(Re)==="deny"?"danger":"ok");Wn(Xe,{get tone(){return n(Je)},children:(dt,ft)=>{Ce();var qe=_t();L(()=>S(qe,n(Re))),v(dt,qe)},$$slots:{default:!0}})}}),l(Me),v(Ne,Me)};B(Ie,Ne=>{n(oe).effects.length===0?Ne(Ae):Ne(ke,-1)})}l(he);var Te=u(he),ze=d(Te,!0);l(Te),l(me),L(()=>{S(Oe,n(oe).action),S(de,n(oe).resourceLabel),S(ze,n(oe).reason??"-")}),v(J,me)}),l(Z),l(A),l(R),v(j,R)};B(ee,j=>{n(w)?j(q):n(c).length===0?j(G,1):j(E,-1)})}v(ae,ie)},$$slots:{default:!0}}),v(X,H)};B(T,X=>{n(V)&&X($)})}l(I),l(be),v(te,be)};B(Q,te=>{_n.locked?te(se):n(P)?te(le,-1):te(xe,1)})}l(F),v(t,F),it()}tn(["click"]);function br(t){const e=t.resource.tenant??"",r=t.current_tenant??"";return[t.action,t.resource.kind,t.resource.name,e,r].join("")}function wo(t,e){return{...t,allowed:!1,reason:e}}var ro,Mr,Vr;class O4{constructor(e){Fe(this,ro);Fe(this,Mr,new Map);Fe(this,Vr,new Map);Qr(this,ro,e)}cachedDecision(e){return fe(this,Mr).get(br(e))??null}cachedCan(e){var r;return((r=this.cachedDecision(e))==null?void 0:r.allowed)===!0}async decision(e){return await this.preload([e]),this.cachedDecision(e)??wo(e,"auth.can did not return a decision")}async can(e){return(await this.decision(e)).allowed}async preload(e){const r=e.filter(o=>!fe(this,Mr).has(br(o)));if(r.length===0)return;const a=new Map;for(const o of r){const s=br(o);fe(this,Vr).has(s)||a.set(s,o)}if(a.size>0){const o=[...a.values()],s=fe(this,ro).authCan(o).then(i=>{const c=new Map(i.map(f=>[br(f),f]));for(const f of o){const g=br(f);fe(this,Mr).set(g,c.get(g)??wo(f,"auth.can omitted this check"))}}).catch(i=>{const c=i.message||"auth.can failed";for(const f of o)fe(this,Mr).set(br(f),wo(f,c))}).finally(()=>{for(const i of o)fe(this,Vr).delete(br(i))});for(const i of o){const c=br(i);fe(this,Vr).set(c,s.then(()=>fe(this,Mr).get(c)??wo(i,"auth.can did not return a decision")))}}await Promise.all(r.map(o=>fe(this,Vr).get(br(o))))}}ro=new WeakMap,Mr=new WeakMap,Vr=new WeakMap;function Yn(t){return typeof t=="string"&&t.trim()?t:void 0}function Da(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function R4(t){const e=Yn(t.value_type)??Yn(t.valueType)??Yn(t["value-type"]);return e==null?void 0:e.toLowerCase()}function D4(t){return Da(t.schema_version)??Da(t.schemaVersion)??Da(t["schema-version"])}function $4(t){if(typeof t=="string"){const i=t.trim();return i==="&***"?{type:"secret_ref",key:"***",masked:!0}:/^&[A-Za-z0-9_.-]+$/.test(i)?{type:"secret_ref",key:i.slice(1)}:void 0}if(!t||typeof t!="object"||Array.isArray(t))return;const e=t;if(e.type!=="secret_ref")return;const r=Yn(e.key)??Yn(e.path)??Yn(e.name);if(!r)return;const a={type:"secret_ref",key:r},o=Yn(e.store),s=Yn(e.collection);return o&&(a.store=o),s&&(a.collection=s),r==="***"&&(a.masked=!0),a}function cc(t){const e=t==null?void 0:t.trim();if(e)return Zr(e,"SHOW CONFIG prefix")}function Zr(t,e){const r=t.trim();if(!/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/.test(r))throw new Error(`${e} must be a dotted identifier path`);return r}function du(t){return`'${t.replace(/'/g,"''")}'`}function V4(t){if(t===null)return"NULL";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"){if(!Number.isFinite(t))throw new Error("Config number value must be finite");return String(t)}return typeof t=="string"?du(t):JSON.stringify(t)}function H4(t,e){return`SET CONFIG ${Zr(t,"SET CONFIG key")} = ${V4(e)}`}function F4(t){const e=Zr(t,"DELETE CONFIG key"),r=e.lastIndexOf(".");if(r<=0||r===e.length-1)throw new Error("DELETE CONFIG key must include a collection and key");return`DELETE CONFIG ${e.slice(0,r)} ${e.slice(r+1)}`}function q4(t,e){return`SET SECRET ${Zr(t,"SET SECRET key")} = ${du(e)}`}function K4(t){return`DELETE SECRET ${Zr(t,"DELETE SECRET key")}`}function j4(t){return`UNSEAL VAULT ${Zr(t,"UNSEAL VAULT key")}`}function dc(t,e){if(!t.ok)throw new Error(t.error??`${e} failed`);return t}function uc(t,e){if(!t.ok)throw new Error(t.error??`${e} failed`);return{...t,query:e,record_count:0,result:{columns:[],records:[]}}}function B4(t,e){if(!t.ok)throw new Error(t.error??"UNSEAL VAULT failed");for(const r of t.result.records){const a=r.values,o=Yn(a.key);if(o&&o!==e)continue;const s=a.value??a.plaintext??a.secret;if(typeof s=="string")return{key:e,value:s}}throw new Error("UNSEAL VAULT returned no plaintext value")}function W4(t){if(!t.ok)throw new Error(t.error??"SHOW CONFIG failed");const e=[];for(const r of t.result.records){const a=r.values,o=Yn(a.key);if(!o||a.tombstone===!0)continue;const s={key:o,value:$4(a.value)??a.value},i=Yn(a.collection),c=Da(a.version),f=R4(a),g=D4(a);i&&(s.collection=i),c!==void 0&&(s.version=c),f&&(s.valueType=f),g!==void 0&&(s.schemaVersion=g),"tags"in a&&(s.tags=a.tags),e.push(s)}return e.sort((r,a)=>r.key.localeCompare(a.key))}function U4(t){if(!t.ok)throw new Error(t.error??"SHOW SECRETS failed");const e=[];for(const r of t.result.records){const a=r.values,o=Yn(a.key);if(!o)continue;if(a.value!=="***")throw new Error("SHOW SECRETS returned an unmasked secret value");const i={key:o,value:"***"},c=Yn(a.status),f=Da(a.version);c&&(i.status=c),f!==void 0&&(i.version=f),e.push(i)}return e.sort((r,a)=>r.key.localeCompare(a.key))}class Ir{constructor(e){this.transport=e}async showConfig(e){const r=cc(e),a=await this.transport.query(r?`SHOW CONFIG ${r}`:"SHOW CONFIG");return W4(a)}async showSecrets(e){const r=cc(e),a=await this.transport.query(r?`SHOW SECRETS ${r}`:"SHOW SECRETS");return U4(a)}async setConfig(e,r){const a=await this.transport.query(H4(e,r));return dc(a,"SET CONFIG")}async unsetConfig(e){const r=await this.transport.query(F4(e));return dc(r,"DELETE CONFIG")}async setSecret(e,r){const a=await this.transport.query(q4(e,r));return uc(a,"SET SECRET")}async deleteSecret(e){const r=await this.transport.query(K4(e));return uc(r,"DELETE SECRET")}async revealSecret(e){const r=Zr(e,"UNSEAL VAULT key"),a=await this.transport.query(j4(r));return B4(a,r)}}const $a=[{id:"config",label:"Config",blurb:"Live non-secret configuration from SHOW CONFIG.",icon:"settings",readGrant:{action:"config:read",resource:{kind:"config",name:"*"}},writeGrant:{action:"config:write",resource:{kind:"config",name:"*"}}},{id:"secrets",label:"Secrets",blurb:"Vault inventory from SHOW SECRETS with values masked.",icon:"key",readGrant:{action:"vault:read_metadata",resource:{kind:"vault",name:"*"}},writeGrant:{action:"vault:write",resource:{kind:"vault",name:"*"}},revealGrant:{action:"vault:read",resource:{kind:"vault",name:"*"}}}],G4={"durability.mode":"Durability mode","concurrency.locking.enabled":"Locking","cache.blob.l1_bytes_max":"Blob L1 cache","cache.blob.l2_bytes_max":"Blob L2 cache","red.auth.enabled":"Authentication","red.auth.require_auth":"Require authentication","red.auth.session_ttl_secs":"Session TTL","red.backup.backend":"Backup backend","red.backup.enabled":"Backups","red.backup.interval_secs":"Backup interval","red.cdc.enabled":"Change data capture","red.config.secret.auto_decrypt":"Auto-decrypt config secrets","red.config.secret.auto_encrypt":"Auto-encrypt config secrets","red.server.max_body_size":"Max request body","red.server.max_scan_limit":"Max scan limit","red.server.read_timeout_ms":"Read timeout","red.server.write_timeout_ms":"Write timeout","red.storage.page_size":"Page size","red.storage.page_cache_capacity":"Page cache capacity","red.storage.verify_checksums":"Verify checksums","red.system.os":"Operating system","red.system.arch":"Architecture","red.system.hostname":"Hostname","red.system.cpu_cores":"CPU cores","red.system.total_memory_bytes":"System memory","red.vcs.default_branch":"Default branch","red.vcs.protected_branches":"Protected branches","runtime.result_cache.backend":"Result cache backend","runtime.result_cache.enabled":"Result cache","storage.bgwriter.delay_ms":"Background writer delay","storage.btree.lehman_yao":"Lehman-Yao B-tree","storage.wal.max_interval_ms":"WAL max interval","system.bootstrap.completed":"Bootstrap completed","system.bootstrap.preset":"Bootstrap preset"},Y4={"durability.mode":"Write durability policy currently reported by reddb.","red.auth.enabled":"Whether reddb authentication is enabled for this instance.","red.auth.require_auth":"Whether unauthenticated requests are rejected.","red.backup.backend":"The selected backup storage backend.","red.backup.enabled":"Whether scheduled backups are enabled.","red.cdc.enabled":"Whether the change stream subsystem is enabled.","red.server.max_body_size":"Maximum accepted HTTP request body size, in bytes.","red.server.max_scan_limit":"Default cap for scan-heavy API paths.","red.storage.page_size":"On-disk page size used by the storage engine.","red.storage.verify_checksums":"Whether page checksums are verified on read.","red.vcs.default_branch":"Branch name used when VCS features need a default.","red.vcs.protected_branches":"Branches protected from destructive operations.","runtime.result_cache.enabled":"Whether query result caching is enabled.","system.bootstrap.preset":"The bootstrap profile that initialized defaults."},X4={"durability.mode":["sync","async","none"],"red.backup.backend":["local","s3","gcs"],"runtime.result_cache.backend":["legacy","blob_cache"]};function uu(t){const r=(t.split(".").pop()??t).replace(/[_-]+/g," ").trim();return r?r.charAt(0).toUpperCase()+r.slice(1):t}function Z4(t){switch(t){case"bool":case"boolean":return"boolean";case"int":case"integer":case"float":case"number":case"count":return"number";case"array":case"list":return"list";case"object":case"string":case"text":case"url":return"text";default:return null}}function Q4(t){return typeof t=="boolean"?"boolean":typeof t=="number"?"number":Array.isArray(t)?"list":"text"}function fu(t){return!!t&&typeof t=="object"&&!Array.isArray(t)&&t.type==="secret_ref"&&typeof t.key=="string"}function hs(t){const e=X4[t.key],r=fu(t.value)?t.value:void 0,a=r?"secret-reference":e?"enum":Z4(t.valueType)??Q4(t.value),o={key:t.key,label:G4[t.key]??uu(t.key),kind:a},s=Y4[t.key];return s&&(o.description=s),e&&(o.options=e),t.valueType&&(o.valueType=t.valueType),t.schemaVersion!==void 0&&(o.schemaVersion=t.schemaVersion),r&&(o.secretReference=r),o}function bs(t){return{key:t.key,label:uu(t.key),kind:"text",masked:!0}}function J4(t,e=$a){return e.find(r=>r.id===t)??e[0]??$a[0]}function eS(t,e){return t.filter(r=>e.cachedCan(r.readGrant))}function tS(t,e){const r=e.trim().toLowerCase();return r?t.filter(a=>a.key.toLowerCase().includes(r)||hs(a).label.toLowerCase().includes(r)||fu(a.value)&&a.value.key.toLowerCase().includes(r)):[...t]}function nS(t,e){const r=e.trim().toLowerCase();return r?t.filter(a=>{var o;return a.key.toLowerCase().includes(r)||bs(a).label.toLowerCase().includes(r)||((o=a.status)==null?void 0:o.toLowerCase().includes(r))}):[...t]}function rS(t){return Array.isArray(t.value)||t.value&&typeof t.value=="object"?JSON.stringify(t.value,null,2):t.value===null||t.value===void 0?"":String(t.value)}function fc(t,e){var a;const r=e.trim();switch(t.kind){case"boolean":return r==="true"?{ok:!0,value:!0}:r==="false"?{ok:!0,value:!1}:{ok:!1,error:"Boolean config values must be true or false."};case"number":{if(!r)return{ok:!1,error:"Number config values cannot be empty."};const o=Number(r);return Number.isFinite(o)?{ok:!0,value:o}:{ok:!1,error:"Number config values must be finite."}}case"enum":return(a=t.options)!=null&&a.includes(e)?{ok:!0,value:e}:{ok:!1,error:"Choose one of the allowed config values."};case"list":try{const o=JSON.parse(e);return Array.isArray(o)?{ok:!0,value:o}:{ok:!1,error:"List config values must be a JSON array."}}catch{return{ok:!1,error:"List config values must be valid JSON."}}case"secret-reference":return{ok:!1,error:"Secret references can be unset, but not edited as plaintext config."};case"text":default:return{ok:!0,value:e}}}var aS=x('<span class="font-mono text-fg-2"> </span> live rows',1),oS=x('<div class="h-12 rounded-md bg-bg-2 motion-safe:animate-pulse"></div>'),iS=x('<div class="grid gap-1 p-2"></div>'),sS=x('<div class="h-12 rounded-md bg-bg-2 motion-safe:animate-pulse"></div>'),lS=x('<div class="grid gap-1 p-2"></div>'),cS=x('<div><button type="button" class="min-w-0 text-left"><span class="block truncate text-[13px]"> </span> <span class="block truncate font-mono text-[11px] text-fg-3"> </span></button> <div class="inline-flex h-6 items-center gap-1.5 rounded border border-line-2 bg-bg-2 px-1.5 font-mono text-[11px] text-fg-2"><!> </div></div>'),dS=x('<div class="grid gap-1 p-2"></div>'),uS=x('<label class="inline-flex h-6 items-center gap-1.5 rounded border border-line-2 bg-bg-2 px-1.5 font-mono text-[11px] text-fg-2"><input type="checkbox" disabled="" tabindex="-1" class="size-3 accent-current"/> </label>'),fS=x("<option> </option>"),vS=x("<option> </option>"),gS=x('<select disabled="" tabindex="-1" class="h-6 w-28 rounded border border-line-2 bg-bg-2 px-1.5 font-mono text-[11px] text-accent disabled:opacity-100"><!><!></select>'),pS=x('<input readonly="" tabindex="-1" class="h-6 w-28 rounded border border-line-2 bg-bg-2 px-1.5 font-mono text-[11px] text-fg-2 outline-none"/>'),hS=x('<div><button type="button" class="min-w-0 text-left"><span class="block truncate text-[13px]"> </span> <span class="block truncate font-mono text-[11px] text-fg-3"> </span></button> <!></div>'),bS=x('<div class="grid gap-1 p-2"></div>'),xS=x('<button type="button" class="inline-flex h-7 items-center justify-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 transition-colors hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> export config</button>'),mS=x('Live from <span class="font-mono text-fg-2"> </span>.',1),_S=x("<!> <!>",1),yS=x("<!> <!>",1),wS=x('<button type="button" class="inline-flex h-7 items-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> refresh</button>'),kS=x('<input readonly="" class="h-8 w-full rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none"/>'),SS=x('<span class="font-mono text-[12px] text-fg-1"> </span>'),CS=x('<div class="flex flex-wrap justify-end gap-1.5"><!> <!></div>'),ES=x('<button type="button" class="inline-flex h-8 items-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 hover:border-line-3 hover:text-fg-0"><!> hide</button>'),NS=x('<button type="button" class="inline-flex h-8 items-center gap-1.5 rounded-md border border-warn/40 bg-warn/5 px-2.5 text-[11px] font-mono text-warn hover:border-warn/70 disabled:cursor-not-allowed disabled:opacity-40"><!> reveal</button>'),MS=x('<button type="button" class="inline-flex h-8 items-center gap-1.5 rounded-md border border-danger/30 bg-danger/5 px-2.5 text-[11px] font-mono text-danger hover:border-danger/60 disabled:cursor-not-allowed disabled:opacity-40"><!> delete</button>'),zS=x('<section><!> <div class="divide-y divide-line-1 overflow-hidden rounded-lg border border-line-1 bg-bg-1"><!> <!> <!> <!> <!></div></section>'),TS=x('<div role="status"><!> <span class="truncate"> </span></div>'),PS=x('<div role="status"><!> <span class="truncate"> </span></div>'),AS=x('<!> <section><!> <div class="grid gap-2 rounded-lg border border-line-1 bg-bg-1 p-3"><input type="text" placeholder="mycompany.payments.key" aria-label="Secret key" class="h-8 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none placeholder:text-fg-3 disabled:cursor-not-allowed disabled:opacity-50"/> <input type="password" placeholder="New secret value" autocomplete="new-password" aria-label="New secret value" class="h-8 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none placeholder:text-fg-3 disabled:cursor-not-allowed disabled:opacity-50"/> <div class="flex justify-end"><button type="button" class="inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> set</button></div></div></section>',1),LS=x('<section class="grid gap-4"><!> <!> <!></section>'),IS=x('<label class="inline-flex h-8 items-center gap-2 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1"><input type="checkbox" class="size-3 accent-current"/> </label>'),OS=x("<option> </option>"),RS=x("<option> </option>"),DS=x('<select class="h-8 min-w-[12rem] rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 disabled:opacity-100"><!><!></select>'),$S=x('<textarea rows="5" class="min-h-24 w-full resize-y rounded-md border border-line-2 bg-bg-2 px-2.5 py-2 font-mono text-[12px] text-fg-1 outline-none"></textarea>'),VS=x('<input readonly="" type="text" class="h-8 w-full rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none"/>'),HS=x('<input class="h-8 w-full rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none"/>'),FS=x('<span class="font-mono text-[12px] text-fg-1"> </span>'),qS=x('<div class="flex flex-wrap justify-end gap-1.5"><!> <!></div>'),KS=x('<div class="flex flex-wrap justify-end gap-2"><button type="button" class="inline-flex h-8 items-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> save</button> <button type="button" class="inline-flex h-8 items-center gap-1.5 rounded-md border border-danger/30 bg-danger/5 px-2.5 text-[11px] font-mono text-danger hover:border-danger/60 disabled:cursor-not-allowed disabled:opacity-40"><!> unset</button></div>'),jS=x('<div role="status"><!> <span class="truncate"> </span></div>'),BS=x('<label class="inline-flex h-8 w-fit items-center gap-2 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1"><input type="checkbox" class="size-3 accent-current"/> </label>'),WS=x('<textarea rows="4" placeholder="["main", "release"]" aria-label="New config value" class="min-h-20 resize-y rounded-md border border-line-2 bg-bg-2 px-2.5 py-2 font-mono text-[12px] text-fg-1 outline-none placeholder:text-fg-3 disabled:cursor-not-allowed disabled:opacity-50"></textarea>'),US=x('<input type="text" aria-label="New config value" class="h-8 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none placeholder:text-fg-3 disabled:cursor-not-allowed disabled:opacity-50"/>'),GS=x('<!> <section class="mt-4 border-t border-line-1 pt-4"><!> <div class="grid gap-2 rounded-lg border border-line-1 bg-bg-1 p-3"><div class="grid gap-2 @min-[42rem]:grid-cols-[minmax(0,1fr)_8rem]"><input type="text" placeholder="red.example.key" aria-label="New config key" class="h-8 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none placeholder:text-fg-3 disabled:cursor-not-allowed disabled:opacity-50"/> <select aria-label="New config value type" class="h-8 rounded-md border border-line-2 bg-bg-2 px-2.5 font-mono text-[12px] text-fg-1 outline-none disabled:cursor-not-allowed disabled:opacity-50"><option>text</option><option>number</option><option>boolean</option><option>list</option></select></div> <!> <div class="flex justify-end"><button type="button" class="inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-line-2 bg-bg-2 px-2.5 text-[11px] font-mono text-fg-1 hover:border-line-3 hover:text-fg-0 disabled:cursor-not-allowed disabled:opacity-40"><!> set</button></div></div></section>',1),YS=x('<section><!> <div class="divide-y divide-line-1 overflow-hidden rounded-lg border border-line-1 bg-bg-1"><!> <!> <!> <!></div> <!></section>'),XS=x("<!> <!>",1),ZS=x('<div class="@container h-full min-h-0 bg-bg-0"><div class="grid h-full min-h-0 grid-cols-1 @min-[62rem]:grid-cols-[13rem_minmax(18rem,24rem)_minmax(0,1fr)]"><aside class="flex min-h-0 flex-col border-b border-line-1 bg-bg-1 @min-[62rem]:border-b-0 @min-[62rem]:border-r"><div class="border-b border-line-1 px-3 py-3"><div class="type-label">Settings</div> <div class="mt-1 text-[13px] text-fg-1">Governance surface</div></div> <nav class="grid gap-0.5 p-2"></nav> <div class="mt-auto border-t border-line-1 px-3 py-2.5 text-[11px] text-fg-3"><!></div></aside> <section class="flex min-h-0 flex-col border-b border-line-1 bg-bg-1 @min-[62rem]:border-b-0 @min-[62rem]:border-r"><div class="border-b border-line-1 p-2"><div class="relative"><!> <input type="text" class="h-7 w-full rounded-md border border-line-2 bg-bg-2 pl-8 pr-2.5 text-xs text-fg-1 placeholder:text-fg-3 outline-none transition-colors focus:border-line-3 disabled:cursor-not-allowed disabled:opacity-50"/></div></div> <div class="min-h-0 flex-1 overflow-y-auto"><!></div> <div class="grid gap-2 border-t border-line-1 px-3 py-2.5"><!> <div class="truncate text-[11px] text-fg-3"><!></div></div></section> <main class="min-h-0 min-w-0 overflow-auto bg-bg-0"><div class="p-6"><!></div></main></div></div>');function QS(t,e){ot(e,!0);const r={key:Na,settings:Xi};let a=_e(Bt($a[0].id)),o=_e(Bt([])),s=_e(null),i=_e(!1),c=_e(null),f=0;const g=y(()=>n(o).length>0),p=y(()=>J4(n(a),n(o)));let b=_e(Bt({})),h=_e(null);const w=y(()=>n(g)?n(b)[n(p).id]??"":"");let M=_e(Bt([])),P=_e(Bt([])),V=_e(null),O=_e(null),k=_e(!1),F=_e(null),U=_e(null),Q=_e(!1),se=_e(null),xe=_e(null),le=_e(""),te=_e(""),be=_e("text"),K=_e(""),C=_e(null),N=_e(""),_=_e(""),z=_e(!1),I=_e(null),D=_e(null),T=null;const $=y(()=>Ue.connected),X=y(()=>Ue.active.url),H=y(()=>n(p).id==="secrets"?n(U):n(F)),W=y(()=>!n($)||n(H)!==null),Y=y(()=>tS(n(M),n(w))),ae=y(()=>nS(n(P),n(w))),ge=y(()=>n(p).id==="secrets"?n(ae).length:n(Y).length),ie=y(()=>n(p).id==="secrets"?n(P).length:n(M).length),ee=y(()=>n(Y).find(ye=>ye.key===n(V))??n(Y)[0]??null),q=y(()=>n(ae).find(ye=>ye.key===n(O))??n(ae)[0]??null),G=y(()=>n(ee)?hs(n(ee)):null),E=y(()=>n(q)?bs(n(q)):null),j=y(()=>{var ye;return n(p).id==="config"&&!!n(p).writeGrant&&((ye=n(s))==null?void 0:ye.cachedCan(n(p).writeGrant))===!0}),R=y(()=>{var ye;return n(p).id==="secrets"&&!!n(p).writeGrant&&((ye=n(s))==null?void 0:ye.cachedCan(n(p).writeGrant))===!0}),A=y(()=>{var ye;return n(p).id==="secrets"&&!!n(p).revealGrant&&((ye=n(s))==null?void 0:ye.cachedCan(n(p).revealGrant))===!0}),Z=y(()=>{var ye;return n(q)&&((ye=n(D))==null?void 0:ye.key)===n(q).key?n(D).value:null});function J(ye){n(g)&&m(b,{...n(b),[n(p).id]:ye},!0)}function oe(ye,Le,He){m(se,{paneId:ye,tone:Le,message:He},!0)}function me(){T&&(clearTimeout(T),T=null),m(D,null)}function pe(ye,Le){me(),m(D,{key:ye,value:Le},!0),T=setTimeout(()=>{m(D,null),T=null},3e4)}function Ee(ye){n(O)!==ye&&me(),m(O,ye,!0)}function Se(ye){var Le,He;(ye.metaKey||ye.ctrlKey)&&ye.key.toLowerCase()==="k"&&(ye.preventDefault(),(Le=n(h))==null||Le.focus(),(He=n(h))==null||He.select())}async function ve(){const ye=Ue.client,Le=++f;if(m(s,null),m(o,[],!0),m(c,null),m(M,[],!0),m(P,[],!0),m(V,null),m(O,null),m(se,null),m(xe,null),m(C,null),m(N,""),m(_,""),m(I,null),me(),!ye||!n($)){m(i,!1);return}m(i,!0);const He=new O4(ye);try{if(await Ct.track("settings · auth.can panes",()=>He.preload($a.flatMap(et=>[et.readGrant,et.writeGrant,et.revealGrant].filter(tt=>!!tt)))),Le!==f)return;m(s,He,!0);const Ge=eS($a,He);m(o,Ge,!0),Ge.length>0&&!Ge.some(et=>et.id===n(a))&&m(a,Ge[0].id,!0)}catch(Ge){if(Le!==f)return;m(o,[],!0),m(s,null),m(c,Ge.message,!0)}finally{Le===f&&m(i,!1)}}async function ce(){var He,Ge;const ye=Ue.client,Le=n(s);if(!ye||!n($)||!Le||!n(g)||!Le.cachedCan(n(p).readGrant)){m(M,[],!0),m(P,[],!0),m(V,null),m(O,null),m(F,null),m(U,null);return}m(k,!0),n(p).id==="secrets"?(m(U,null),m(I,null),me()):m(F,null);try{const et=new Ir(ye);if(n(p).id==="secrets"){const tt=await Ct.track("settings · show secrets",()=>et.showSecrets());m(P,tt,!0),(!n(O)||!tt.some(We=>We.key===n(O)))&&m(O,((He=tt[0])==null?void 0:He.key)??null,!0)}else{const tt=await Ct.track("settings · show config",()=>et.showConfig());m(M,tt,!0),(!n(V)||!tt.some(We=>We.key===n(V)))&&m(V,((Ge=tt[0])==null?void 0:Ge.key)??null,!0)}}catch(et){n(p).id==="secrets"?(m(P,[],!0),m(O,null),m(U,et.message,!0)):(m(M,[],!0),m(V,null),m(F,et.message,!0))}finally{m(k,!1)}}function Oe(){return fc({key:n(te),label:n(te),kind:n(be)},n(be)==="boolean"&&!n(K).trim()?"false":n(K))}async function re(){const ye=Ue.client;if(!ye||!n(ee)||!n(G)||!n(j)||n(Q))return;const Le=fc(n(G),n(le));if(!Le.ok){oe("config","error",Le.error??"Invalid config value.");return}m(Q,!0),m(se,null);try{const He=new Ir(ye);await Ct.track("settings · set config",()=>He.setConfig(n(ee).key,Le.value??null)),m(V,n(ee).key,!0),oe("config","ok",`${n(ee).key} saved.`),await ce()}catch(He){oe("config","error",He.message)}finally{m(Q,!1)}}async function de(){const ye=Ue.client;if(!ye||!n(ee)||!n(j)||n(Q)||!window.confirm(`Unset ${n(ee).key}?`))return;const Le=n(ee).key;m(Q,!0),m(se,null);try{const He=new Ir(ye);await Ct.track("settings · delete config",()=>He.unsetConfig(Le)),m(V,Le,!0),oe("config","ok",`${Le} unset.`),await ce()}catch(He){oe("config","error",He.message)}finally{m(Q,!1)}}async function he(){const ye=Ue.client;if(!ye||!n(j)||n(Q))return;const Le=Oe();if(!Le.ok){oe("config","error",Le.error??"Invalid config value.");return}const He=n(te).trim();m(Q,!0),m(se,null);try{const Ge=new Ir(ye);await Ct.track("settings · set config",()=>Ge.setConfig(He,Le.value??null)),m(V,He,!0),m(te,""),m(K,""),oe("config","ok",`${He} set.`),await ce()}catch(Ge){oe("config","error",Ge.message)}finally{m(Q,!1)}}async function Ie(){const ye=Ue.client;if(!ye||!n(R)||n(Q))return;const Le=n(N).trim(),He=n(_);if(!Le){oe("secrets","error","Secret key is required.");return}if(!He){oe("secrets","error","Secret value is required.");return}m(Q,!0),m(se,null);try{const Ge=new Ir(ye);await Ct.track("settings · set secret",()=>Ge.setSecret(Le,He)),m(O,Le,!0),m(_,""),oe("secrets","ok",`${Le} set.`),await ce()}catch(Ge){m(_,""),oe("secrets","error",Ge.message)}finally{m(Q,!1)}}async function Ae(){const ye=Ue.client;if(!ye||!n(q)||!n(R)||n(Q)||!window.confirm(`Delete secret ${n(q).key}?`))return;const Le=n(q).key;m(Q,!0),m(se,null);try{const He=new Ir(ye);await Ct.track("settings · delete secret",()=>He.deleteSecret(Le)),m(_,""),m(O,Le,!0),oe("secrets","ok",`${Le} deleted.`),await ce()}catch(He){m(_,""),oe("secrets","error",He.message)}finally{m(Q,!1)}}async function ke(){const ye=Ue.client;if(!ye||!n(q)||!n(A)||n(z))return;const Le=n(q).key;m(z,!0),m(I,null),me();try{const He=new Ir(ye),Ge=await Ct.track("settings · reveal secret",()=>He.revealSecret(Le));pe(Ge.key,Ge.value),m(I,{tone:"ok",key:Le,message:"Plaintext revealed temporarily."},!0)}catch(He){m(I,{tone:"error",key:Le,message:He.message},!0)}finally{m(z,!1)}}an(()=>{n(X),n($),ve()}),an(()=>{n(X),n($),n(a),n(s),n(o),ce()}),an(()=>{if(!n(ee)){m(xe,null),m(le,"");return}n(xe)!==n(ee).key&&(m(xe,n(ee).key,!0),m(le,rS(n(ee)),!0),m(se,null))}),an(()=>{n(p).id!=="secrets"||!n(q)||n(C)!==n(q).key&&(!n(N).trim()||n(N)===n(C))&&(m(N,n(q).key,!0),m(C,n(q).key,!0),m(se,null))});function Te(ye){if(!Number.isFinite(ye))return String(ye);const Le=["B","KB","MB","GB","TB"];let He=ye,Ge=0;for(;He>=1024&&Ge<Le.length-1;)He/=1024,Ge++;return`${Ge===0?He:He.toFixed(1)} ${Le[Ge]}`}function ze(ye){return ye.masked?"&***":`&${ye.collection?`${ye.collection}.`:""}${ye.key}`}function Ne(ye){return!!ye&&typeof ye=="object"&&!Array.isArray(ye)&&"type"in ye&&ye.type==="secret_ref"}function Me(ye){const Le=ye.value;return Ne(Le)?ze(Le):typeof Le=="number"&&ye.key.endsWith("_bytes")?Te(Le):Array.isArray(Le)?`${Le.length} item${Le.length===1?"":"s"}`:Le&&typeof Le=="object"?JSON.stringify(Le):Le==null?"null":String(Le)}function Xe(ye){return Array.isArray(ye)||ye&&typeof ye=="object"?JSON.stringify(ye,null,2):ye==null?"null":String(ye)}function Re(){const ye={url:n(X),exportedAt:new Date().toISOString(),projection:"SHOW CONFIG",config:n(M).map(et=>({key:et.key,value:et.value,value_type:et.valueType??null,schema_version:et.schemaVersion??null}))},Le=new Blob([JSON.stringify(ye,null,2)],{type:"application/json"}),He=URL.createObjectURL(Le),Ge=document.createElement("a");Ge.href=He,Ge.download=`reddb-config-${new Date().toISOString().slice(0,10)}.json`,Ge.click(),URL.revokeObjectURL(He)}function Je(ye){return ye.id==="secrets"?n(P).length:n(M).length}var dt=ZS();kr("keydown",jn,Se);var ft=d(dt),qe=d(ft),$e=u(d(qe),2);Qe($e,21,()=>n(o),ye=>ye.id,(ye,Le)=>{const He=y(()=>r[n(Le).icon]??Xi);{const Ge=We=>{var wt=De(),st=ue(wt);Wr(st,()=>n(He),(vt,At)=>{At(vt,{class:"size-3.5"})}),v(We,wt)},et=We=>{Pr(We,{children:(wt,st)=>{Ce();var vt=_t();L(At=>S(vt,At),[()=>Je(n(Le))]),v(wt,vt)},$$slots:{default:!0}})};let tt=y(()=>n(Le).id===n(p).id);Zf(ye,{get label(){return n(Le).label},get active(){return n(tt)},onclick:()=>m(a,n(Le).id,!0),icon:Ge,trailing:et,$$slots:{icon:!0,trailing:!0}})}}),l($e);var je=u($e,2),at=d(je);{var ne=ye=>{var Le=_t("checking grants");v(ye,Le)},nt=ye=>{var Le=aS(),He=ue(Le),Ge=d(He,!0);l(He),Ce(),L(()=>S(Ge,n(ie))),v(ye,Le)},Ze=ye=>{var Le=_t("no readable panes");v(ye,Le)};B(at,ye=>{n(i)?ye(ne):n(g)?ye(nt,1):ye(Ze,-1)})}l(je),l(qe);var Be=u(qe,2),ut=d(Be),Nt=d(ut),Pt=d(Nt);Xn(Pt,{class:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-fg-3"});var Mt=u(Pt,2);en(Mt),sr(Mt,ye=>m(h,ye),()=>n(h)),l(Nt),l(ut);var Et=u(ut,2),mt=d(Et);{var yt=ye=>{var Le=iS();Qe(Le,20,()=>Array(4),bn,(He,Ge)=>{var et=oS();v(He,et)}),l(Le),v(ye,Le)},kt=ye=>{{let Le=y(()=>n($)?"No readable settings panes":"No active connection"),He=y(()=>n($)?"The current principal has no Settings read grant.":"Connect to a reddb instance to inspect its live configuration."),Ge=y(()=>n(c)??(n($)?"auth.can denied settings reads":"red serve"));Fn(ye,{get icon(){return xi},get title(){return n(Le)},get message(){return n(He)},get hint(){return n(Ge)}})}},It=ye=>{{let Le=y(()=>n($)?`${n(p).label} is unreachable`:"No active connection"),He=y(()=>n($)?`red-ui could not read ${n(p).id==="secrets"?"SHOW SECRETS":"SHOW CONFIG"} from the active target.`:"Connect to a reddb instance to inspect its live configuration."),Ge=y(()=>n($)?n(H)??n(X):"red serve");Fn(ye,{get icon(){return sl},get title(){return n(Le)},get message(){return n(He)},get hint(){return n(Ge)}})}},Xt=ye=>{var Le=lS();Qe(Le,20,()=>Array(8),bn,(He,Ge)=>{var et=sS();v(He,et)}),l(Le),v(ye,Le)},hn=ye=>{{let Le=y(()=>n(w)?`No ${n(p).label.toLowerCase()} match`:`No ${n(p).label.toLowerCase()} reported`),He=y(()=>n(w)?`Search checks the ${n(p).label.toLowerCase()} key and metadata.`:`${n(p).id==="secrets"?"SHOW SECRETS":"SHOW CONFIG"} returned no rows for this connection.`);Fn(ye,{get icon(){return Xn},get title(){return n(Le)},get message(){return n(He)}})}},xn=ye=>{var Le=dS();Qe(Le,21,()=>n(ae),He=>He.key,(He,Ge)=>{const et=y(()=>bs(n(Ge)));var tt=cS(),We=d(tt),wt=d(We),st=d(wt,!0);l(wt);var vt=u(wt,2),At=d(vt,!0);l(vt),l(We);var Ot=u(We,2),Jt=d(Ot);Na(Jt,{class:"size-3"});var fn=u(Jt);l(Ot),l(tt),L($t=>{var Rt;Ve(tt,1,$t),Pe(We,"aria-current",((Rt=n(q))==null?void 0:Rt.key)===n(Ge).key?"page":void 0),S(st,n(et).label),S(At,n(Ge).key),S(fn,` ${n(Ge).value??""}`)},[()=>{var $t;return Ke(["grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 rounded-md px-2.5 py-2 transition-colors",(($t=n(q))==null?void 0:$t.key)===n(Ge).key?"bg-bg-3 text-fg-0":"text-fg-1 hover:bg-bg-2"].join(" "))}]),we("click",We,()=>Ee(n(Ge).key)),v(He,tt)}),l(Le),v(ye,Le)},rt=ye=>{var Le=bS();Qe(Le,21,()=>n(Y),He=>He.key,(He,Ge)=>{const et=y(()=>hs(n(Ge)));var tt=hS(),We=d(tt),wt=d(We),st=d(wt,!0);l(wt);var vt=u(wt,2),At=d(vt,!0);l(vt),l(We);var Ot=u(We,2);{var Jt=Rt=>{var Wt=uS(),qt=d(Wt);en(qt);var rn=u(qt);l(Wt),L(()=>{Ta(qt,n(Ge).value===!0),S(rn,` ${n(Ge).value?"true":"false"}`)}),v(Rt,Wt)},fn=Rt=>{var Wt=gS(),qt=d(Wt);{var rn=St=>{var Vt=fS(),Kt=d(Vt,!0);l(Vt);var dn={};L((Zt,Mn)=>{S(Kt,Zt),dn!==(dn=Mn)&&(Vt.value=(Vt.__value=Mn)??"")},[()=>Me(n(Ge)),()=>String(n(Ge).value)]),v(St,Vt)},vn=y(()=>{var St;return!((St=n(et).options)!=null&&St.includes(String(n(Ge).value)))});B(qt,St=>{n(vn)&&St(rn)})}var gn=u(qt);Qe(gn,17,()=>n(et).options??[],bn,(St,Vt)=>{var Kt=vS(),dn=d(Kt,!0);l(Kt);var Zt={};L(()=>{S(dn,n(Vt)),Zt!==(Zt=n(Vt))&&(Kt.value=(Kt.__value=n(Vt))??"")}),v(St,Kt)}),l(Wt);var Ut;aa(Wt),L(St=>{Pe(Wt,"aria-label",n(et).label),Ut!==(Ut=St)&&(Wt.value=(Wt.__value=St)??"",oa(Wt,St))},[()=>String(n(Ge).value)]),v(Rt,Wt)},$t=Rt=>{var Wt=pS();en(Wt),L(qt=>{Pe(Wt,"aria-label",n(et).label),Jn(Wt,qt)},[()=>Me(n(Ge))]),v(Rt,Wt)};B(Ot,Rt=>{n(et).kind==="boolean"?Rt(Jt):n(et).kind==="enum"?Rt(fn,1):Rt($t,-1)})}l(tt),L(Rt=>{var Wt;Ve(tt,1,Rt),Pe(We,"aria-current",((Wt=n(ee))==null?void 0:Wt.key)===n(Ge).key?"page":void 0),S(st,n(et).label),S(At,n(Ge).key)},[()=>{var Rt;return Ke(["grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 rounded-md px-2.5 py-2 transition-colors",((Rt=n(ee))==null?void 0:Rt.key)===n(Ge).key?"bg-bg-3 text-fg-0":"text-fg-1 hover:bg-bg-2"].join(" "))}]),we("click",We,()=>m(V,n(Ge).key,!0)),v(He,tt)}),l(Le),v(ye,Le)};B(mt,ye=>{n(i)?ye(yt):n(g)?n(W)?ye(It,2):n(k)&&n(ge)===0?ye(Xt,3):n(ge)===0?ye(hn,4):n(p).id==="secrets"?ye(xn,5):ye(rt,-1):ye(kt,1)})}l(Et);var ct=u(Et,2),Lt=d(ct);{var Ft=ye=>{var Le=xS(),He=d(Le);xv(He,{class:"size-3.5"}),Ce(),l(Le),L(()=>Le.disabled=n(i)||!n(g)||n(k)||n(M).length===0),we("click",Le,Re),v(ye,Le)};B(Lt,ye=>{n(p).id==="config"&&ye(Ft)})}var on=u(Lt,2),sn=d(on);{var ln=ye=>{var Le=mS(),He=u(ue(Le)),Ge=d(He,!0);l(He),Ce(),L(()=>S(Ge,n(X))),v(ye,Le)},Sn=ye=>{var Le=_t("Requires a Settings read grant.");v(ye,Le)};B(sn,ye=>{n(g)?ye(ln):ye(Sn,-1)})}l(on),l(ct),l(Be);var cn=u(Be,2),yn=d(cn),Nn=d(yn);{var Pn=ye=>{var Le=_S(),He=ue(Le);Ra(He,{eyebrow:"Settings",title:"Settings",subtitle:"Checking Settings grants."});var Ge=u(He,2);Fn(Ge,{get icon(){return xi},title:"Checking settings grants",message:"red-ui is asking reddb which Settings panes this principal can read.",hint:"POST /auth/can"}),v(ye,Le)},Cn=ye=>{var Le=yS(),He=ue(Le);Ra(He,{eyebrow:"Settings",title:"Settings",subtitle:"No readable governance surface."});var Ge=u(He,2);{let et=y(()=>n($)?"No readable settings panes":"No active connection"),tt=y(()=>n($)?"Missing Settings read grant for this principal.":"Start or select a reddb target, then return here to inspect live config."),We=y(()=>n(c)??(n($)?"missing Settings read grant":"docker compose -f docker/compose.yml up -d"));Fn(Ge,{get icon(){return xi},get title(){return n(et)},get message(){return n(tt)},get hint(){return n(We)}})}v(ye,Le)},An=ye=>{var Le=XS(),He=ue(Le);Ra(He,{eyebrow:"Settings",get title(){return n(p).label},get subtitle(){return n(p).blurb},actions:vt=>{var At=wS(),Ot=d(At);{let Jt=y(()=>n(k)?"size-3.5 animate-spin":"size-3.5");Cs(Ot,{get class(){return n(Jt)}})}Ce(),l(At),L(()=>At.disabled=n(k)||!n($)),we("click",At,ce),v(vt,At)}});var Ge=u(He,2);{var et=st=>{{let vt=y(()=>n($)?`Unable to read ${n(p).label.toLowerCase()}`:"No active connection"),At=y(()=>n($)?`The ${n(p).label} pane is intentionally empty because ${n(p).id==="secrets"?"SHOW SECRETS":"SHOW CONFIG"} did not complete.`:"Start or select a reddb target, then return here to inspect live config."),Ot=y(()=>n($)?n(H)??n(X):"docker compose -f docker/compose.yml up -d");Fn(st,{get icon(){return sl},get title(){return n(vt)},get message(){return n(At)},get hint(){return n(Ot)}})}},tt=st=>{var vt=LS(),At=d(vt);{var Ot=qt=>{Fn(qt,{get icon(){return Na},title:"No secret selected",message:"Select a live SHOW SECRETS row to inspect its masked metadata."})},Jt=qt=>{var rn=zS(),vn=d(rn);fo(vn,{get title(){return n(E).label},class:"mb-2",icon:xt=>{Na(xt,{class:"size-3.5"})},meta:xt=>{Pr(xt,{children:(un,zn)=>{Ce();var Ln=_t("masked");v(un,Ln)},$$slots:{default:!0}})},$$slots:{icon:!0,meta:!0}});var gn=u(vn,2),Ut=d(gn);pr(Ut,{get title(){return n(E).label},description:"Vault metadata row; plaintext is masked unless break-glass reveal is granted.",get hint(){return n(q).key},wide:!0,action:gt=>{var xt=kS();en(xt),L(()=>{Jn(xt,n(Z)??n(q).value),Pe(xt,"aria-label",n(E).label)}),v(gt,xt)},$$slots:{action:!0}});var St=u(Ut,2);pr(St,{title:"Key",get hint(){return n(q).key},action:gt=>{var xt=SS(),un=d(xt,!0);l(xt),L(()=>S(un,n(q).key)),v(gt,xt)},$$slots:{action:!0}});var Vt=u(St,2);pr(Vt,{title:"Metadata",action:gt=>{var xt=CS(),un=d(xt);Pr(un,{children:(Ln,Dn)=>{Ce();var Qt=_t();L(()=>S(Qt,n(q).status??"status unknown")),v(Ln,Qt)},$$slots:{default:!0}});var zn=u(un,2);Pr(zn,{children:(Ln,Dn)=>{Ce();var Qt=_t();L(()=>S(Qt,`version ${(n(q).version===void 0?"unknown":n(q).version)??""}`)),v(Ln,Qt)},$$slots:{default:!0}}),l(xt),v(gt,xt)},$$slots:{action:!0}});var Kt=u(Vt,2);{var dn=Dt=>{pr(Dt,{title:"Break-glass reveal",description:"Calls reddb's audited UNSEAL VAULT path and clears plaintext after 30 seconds.",action:xt=>{var un=De(),zn=ue(un);{var Ln=Qt=>{var mn=ES(),In=d(mn);zc(In,{class:"size-3.5"}),Ce(),l(mn),we("click",mn,me),v(Qt,mn)},Dn=Qt=>{var mn=NS(),In=d(mn);{let Qn=y(()=>n(z)?"size-3.5 animate-pulse":"size-3.5");Tc(In,{get class(){return n(Qn)}})}Ce(),l(mn),L(()=>mn.disabled=n(z)),we("click",mn,ke),v(Qt,mn)};B(zn,Qt=>{n(Z)!==null?Qt(Ln):Qt(Dn,-1)})}v(xt,un)},$$slots:{action:!0}})};B(Kt,Dt=>{n(A)&&Dt(dn)})}var Zt=u(Kt,2);{var Mn=Dt=>{pr(Dt,{title:"Authoring",description:"Delete the selected vault secret through DELETE SECRET.",action:xt=>{var un=MS(),zn=d(un);Ro(zn,{class:"size-3.5"}),Ce(),l(un),L(()=>un.disabled=n(Q)),we("click",un,Ae),v(xt,un)},$$slots:{action:!0}})};B(Zt,Dt=>{n(R)&&Dt(Mn)})}l(gn),l(rn),v(qt,rn)};B(At,qt=>{!n(q)||!n(E)?qt(Ot):qt(Jt,-1)})}var fn=u(At,2);{var $t=qt=>{var rn=TS(),vn=d(rn);ia(vn,{class:"size-3 shrink-0"});var gn=u(vn,2),Ut=d(gn,!0);l(gn),l(rn),L(St=>{Ve(rn,1,St),S(Ut,n(I).message)},[()=>Ke(["inline-flex max-w-full items-center gap-1.5 rounded-md border px-2.5 py-1.5 font-mono text-[11px]",n(I).tone==="ok"?"border-ok/30 bg-ok/5 text-ok":"border-danger/30 bg-danger/5 text-danger"].join(" "))]),v(qt,rn)};B(fn,qt=>{var rn;n(I)&&n(I).key===((rn=n(q))==null?void 0:rn.key)&&qt($t)})}var Rt=u(fn,2);{var Wt=qt=>{var rn=AS(),vn=ue(rn);{var gn=gt=>{var xt=PS(),un=d(xt);ia(un,{class:"size-3 shrink-0"});var zn=u(un,2),Ln=d(zn,!0);l(zn),l(xt),L(Dn=>{Ve(xt,1,Dn),S(Ln,n(se).message)},[()=>Ke(["inline-flex max-w-full items-center gap-1.5 rounded-md border px-2.5 py-1.5 font-mono text-[11px]",n(se).tone==="ok"?"border-ok/30 bg-ok/5 text-ok":"border-danger/30 bg-danger/5 text-danger"].join(" "))]),v(gt,xt)};B(vn,gt=>{var xt;((xt=n(se))==null?void 0:xt.paneId)==="secrets"&>(gn)})}var Ut=u(vn,2),St=d(Ut);fo(St,{title:"Set secret",class:"mb-2",icon:xt=>{Aa(xt,{class:"size-3.5"})},$$slots:{icon:!0}});var Vt=u(St,2),Kt=d(Vt);en(Kt);var dn=u(Kt,2);en(dn);var Zt=u(dn,2),Mn=d(Zt),Dt=d(Mn);ol(Dt,{class:"size-3.5"}),Ce(),l(Mn),l(Zt),l(Vt),l(Ut),L(gt=>{Jn(Kt,n(N)),Kt.disabled=n(Q),Jn(dn,n(_)),dn.disabled=n(Q),Mn.disabled=gt},[()=>n(Q)||!n(N).trim()||!n(_)]),we("input",Kt,gt=>m(N,gt.currentTarget.value,!0)),we("input",dn,gt=>m(_,gt.currentTarget.value,!0)),we("click",Mn,Ie),v(qt,rn)};B(Rt,qt=>{n(R)&&qt(Wt)})}l(vt),v(st,vt)},We=st=>{Fn(st,{get icon(){return cf},title:"No config entry selected",message:"Select a live SHOW CONFIG row to inspect its read-only control."})},wt=st=>{var vt=YS(),At=d(vt);fo(At,{get title(){return n(G).label},class:"mb-2",icon:Ut=>{var St=De(),Vt=ue(St);{var Kt=Zt=>{df(Zt,{class:"size-3.5"})},dn=Zt=>{Rv(Zt,{class:"size-3.5"})};B(Vt,Zt=>{n(G).kind==="secret-reference"?Zt(Kt):Zt(dn,-1)})}v(Ut,St)},meta:Ut=>{Pr(Ut,{children:(St,Vt)=>{Ce();var Kt=_t();L(()=>S(Kt,n(G).kind)),v(St,Kt)},$$slots:{default:!0}})},$$slots:{icon:!0,meta:!0}});var Ot=u(At,2),Jt=d(Ot);pr(Jt,{get title(){return n(G).label},get description(){return n(G).description},get hint(){return n(ee).key},wide:!0,action:gn=>{var Ut=De(),St=ue(Ut);{var Vt=Dt=>{var gt=IS(),xt=d(gt);en(xt);var un=u(xt);l(gt),L(()=>{Ta(xt,n(j)?n(le)==="true":n(ee).value===!0),xt.disabled=!n(j)||n(Q),S(un,` ${(n(j)?n(le):n(ee).value?"true":"false")??""}`)}),we("change",xt,zn=>m(le,zn.currentTarget.checked?"true":"false",!0)),v(Dt,gt)},Kt=Dt=>{var gt=DS(),xt=d(gt);{var un=Qt=>{var mn=OS(),In=d(mn,!0);l(mn);var Qn={};L((nr,Ht)=>{S(In,nr),Qn!==(Qn=Ht)&&(mn.value=(mn.__value=Ht)??"")},[()=>Me(n(ee)),()=>String(n(ee).value)]),v(Qt,mn)},zn=y(()=>{var Qt;return!((Qt=n(G).options)!=null&&Qt.includes(String(n(ee).value)))});B(xt,Qt=>{n(zn)&&Qt(un)})}var Ln=u(xt);Qe(Ln,17,()=>n(G).options??[],bn,(Qt,mn)=>{var In=RS(),Qn=d(In,!0);l(In);var nr={};L(()=>{S(Qn,n(mn)),nr!==(nr=n(mn))&&(In.value=(In.__value=n(mn))??"")}),v(Qt,In)}),l(gt);var Dn;aa(gt),L(Qt=>{gt.disabled=!n(j)||n(Q),Dn!==(Dn=Qt)&&(gt.value=(gt.__value=Qt)??"",oa(gt,Qt))},[()=>n(j)?n(le):String(n(ee).value)]),we("change",gt,Qt=>m(le,Qt.currentTarget.value,!0)),v(Dt,gt)},dn=Dt=>{var gt=$S();Va(gt),L(xt=>{gt.readOnly=!n(j),gt.disabled=n(Q),Jn(gt,xt)},[()=>n(j)?n(le):Xe(n(ee).value)]),we("input",gt,xt=>m(le,xt.currentTarget.value,!0)),v(Dt,gt)},Zt=Dt=>{var gt=VS();en(gt),L(xt=>Jn(gt,xt),[()=>Me(n(ee))]),v(Dt,gt)},Mn=Dt=>{var gt=HS();en(gt),L(xt=>{gt.readOnly=!n(j),gt.disabled=n(Q),Pe(gt,"type",(n(G).kind==="number","text")),Jn(gt,xt)},[()=>n(j)?n(le):Me(n(ee))]),we("input",gt,xt=>m(le,xt.currentTarget.value,!0)),v(Dt,gt)};B(St,Dt=>{n(G).kind==="boolean"?Dt(Vt):n(G).kind==="enum"?Dt(Kt,1):n(G).kind==="list"?Dt(dn,2):n(G).kind==="secret-reference"?Dt(Zt,3):Dt(Mn,-1)})}v(gn,Ut)},$$slots:{action:!0}});var fn=u(Jt,2);pr(fn,{title:"Key",get hint(){return n(ee).key},action:gn=>{var Ut=FS(),St=d(Ut,!0);l(Ut),L(()=>S(St,n(ee).key)),v(gn,Ut)},$$slots:{action:!0}});var $t=u(fn,2);pr($t,{title:"Schema",action:gn=>{var Ut=qS(),St=d(Ut);Pr(St,{children:(Kt,dn)=>{Ce();var Zt=_t();L(()=>S(Zt,n(G).valueType??"runtime type")),v(Kt,Zt)},$$slots:{default:!0}});var Vt=u(St,2);Pr(Vt,{children:(Kt,dn)=>{Ce();var Zt=_t();L(()=>S(Zt,`schema ${(n(G).schemaVersion===void 0?"unknown":n(G).schemaVersion)??""}`)),v(Kt,Zt)},$$slots:{default:!0}}),l(Ut),v(gn,Ut)},$$slots:{action:!0}});var Rt=u($t,2);{var Wt=vn=>{pr(vn,{title:"Authoring",description:"Submit changes through SET CONFIG or unset through DELETE CONFIG.",action:Ut=>{var St=KS(),Vt=d(St),Kt=d(Vt);ol(Kt,{class:"size-3.5"}),Ce(),l(Vt);var dn=u(Vt,2),Zt=d(dn);Ro(Zt,{class:"size-3.5"}),Ce(),l(dn),l(St),L(()=>{Vt.disabled=n(Q)||n(G).kind==="secret-reference",Pe(Vt,"title",n(G).kind==="secret-reference"?"Secret references can be unset, but not edited as plaintext config.":"Save config value"),dn.disabled=n(Q)}),we("click",Vt,re),we("click",dn,de),v(Ut,St)},$$slots:{action:!0}})};B(Rt,vn=>{n(j)&&vn(Wt)})}l(Ot);var qt=u(Ot,2);{var rn=vn=>{var gn=GS(),Ut=ue(gn);{var St=zt=>{var Yt=jS(),wn=d(Yt);ia(wn,{class:"size-3 shrink-0"});var rr=u(wn,2),Tr=d(rr,!0);l(rr),l(Yt),L(wa=>{Ve(Yt,1,wa),S(Tr,n(se).message)},[()=>Ke(["mt-3 inline-flex max-w-full items-center gap-1.5 rounded-md border px-2.5 py-1.5 font-mono text-[11px]",n(se).tone==="ok"?"border-ok/30 bg-ok/5 text-ok":"border-danger/30 bg-danger/5 text-danger"].join(" "))]),v(zt,Yt)};B(Ut,zt=>{var Yt;((Yt=n(se))==null?void 0:Yt.paneId)==="config"&&zt(St)})}var Vt=u(Ut,2),Kt=d(Vt);fo(Kt,{title:"Set config key",class:"mb-2",icon:Yt=>{Aa(Yt,{class:"size-3.5"})},$$slots:{icon:!0}});var dn=u(Kt,2),Zt=d(dn),Mn=d(Zt);en(Mn);var Dt=u(Mn,2),gt=d(Dt);gt.value=gt.__value="text";var xt=u(gt);xt.value=xt.__value="number";var un=u(xt);un.value=un.__value="boolean";var zn=u(un);zn.value=zn.__value="list",l(Dt);var Ln;aa(Dt),l(Zt);var Dn=u(Zt,2);{var Qt=zt=>{var Yt=BS(),wn=d(Yt);en(wn);var rr=u(wn);l(Yt),L(()=>{Ta(wn,n(K)==="true"),wn.disabled=n(Q),S(rr,` ${n(K)==="true"?"true":"false"}`)}),we("change",wn,Tr=>m(K,Tr.currentTarget.checked?"true":"false",!0)),v(zt,Yt)},mn=zt=>{var Yt=WS();Va(Yt),L(()=>{Jn(Yt,n(K)),Yt.disabled=n(Q)}),we("input",Yt,wn=>m(K,wn.currentTarget.value,!0)),v(zt,Yt)},In=zt=>{var Yt=US();en(Yt),L(()=>{Jn(Yt,n(K)),Pe(Yt,"placeholder",n(be)==="number"?"1000":"value"),Yt.disabled=n(Q)}),we("input",Yt,wn=>m(K,wn.currentTarget.value,!0)),v(zt,Yt)};B(Dn,zt=>{n(be)==="boolean"?zt(Qt):n(be)==="list"?zt(mn,1):zt(In,-1)})}var Qn=u(Dn,2),nr=d(Qn),Ht=d(nr);Aa(Ht,{class:"size-3.5"}),Ce(),l(nr),l(Qn),l(dn),l(Vt),L(zt=>{Jn(Mn,n(te)),Mn.disabled=n(Q),Dt.disabled=n(Q),Ln!==(Ln=n(be))&&(Dt.value=(Dt.__value=n(be))??"",oa(Dt,n(be))),nr.disabled=zt},[()=>n(Q)||!n(te).trim()]),we("input",Mn,zt=>m(te,zt.currentTarget.value,!0)),we("change",Dt,zt=>m(be,zt.currentTarget.value,!0)),we("click",nr,he),v(vn,gn)};B(qt,vn=>{n(j)&&vn(rn)})}l(vt),v(st,vt)};B(Ge,st=>{n(W)?st(et):n(p).id==="secrets"?st(tt,1):!n(ee)||!n(G)?st(We,2):st(wt,-1)})}v(ye,Le)};B(Nn,ye=>{n(i)?ye(Pn):n(g)?ye(An,-1):ye(Cn,1)})}l(yn),l(cn),l(ft),l(dt),L(ye=>{Pe(Be,"aria-label",`${n(p).label} entries`),Pe(Mt,"placeholder",ye),Jn(Mt,n(w)),Mt.disabled=n(i)||!n(g)||n(W)},[()=>`Search ${n(p).label.toLowerCase()} ⌘K`]),we("input",Mt,ye=>J(ye.currentTarget.value)),we("keydown",Mt,ye=>{ye.key==="Escape"&&(J(""),ye.currentTarget.blur())}),v(t,dt),it()}tn(["input","keydown","click","change"]);const vc="'Inter Variable', 'Inter', system-ui, -apple-system, sans-serif",gc="'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, 'SF Mono', 'Menlo', monospace",Ks=[{name:"reddb",label:"Reddb",description:"The signature near-black with a surgical rose accent.",colors:{bg:"#050607",accent:"#ff2056",fg:"#f7f8fa"},typography:{sans:vc,mono:gc}},{name:"nocturne",label:"Nocturne",description:"Indigo-tinted midnight with a violet accent.",colors:{bg:"#0a0b14",accent:"#7c5cff",fg:"#f5f6fb"},typography:{sans:vc,mono:gc}}],vu=Ks[0],gu="red-ui-skin";function pc(t){return Ks.find(e=>e.name===t)??vu}function xr(t,e,r){return`color-mix(in srgb, ${t} ${e}%, ${r})`}function Di(t,e){return`color-mix(in srgb, ${t} ${e}%, transparent)`}const $i=[0,4,9,15],Vi=[6,13,22],Hi=[100,78,58,45];function pu(t){const{bg:e,accent:r,fg:a}=t.colors,o="#ffffff";return{"--color-bg-0":e,"--color-bg-1":xr(o,$i[1],e),"--color-bg-2":xr(o,$i[2],e),"--color-bg-3":xr(o,$i[3],e),"--color-fg-0":a,"--color-fg-1":xr(a,Hi[1],e),"--color-fg-2":xr(a,Hi[2],e),"--color-fg-3":xr(a,Hi[3],e),"--color-line-1":xr(o,Vi[0],e),"--color-line-2":xr(o,Vi[1],e),"--color-line-3":xr(o,Vi[2],e),"--color-accent":r,"--color-accent-soft":Di(r,12),"--color-accent-glow":Di(r,45),"--color-ambient-glow":Di(r,6),"--color-role-primary":r,"--color-role-replica":"#60a5fa","--color-role-embedded":"#4ade80","--color-ok":"#4ade80","--color-warn":"#fbbf24","--color-danger":"#ff5470","--color-info":"#60a5fa","--font-sans":t.typography.sans,"--font-mono":t.typography.mono}}function hc(t,e){const r=pu(t);for(const[a,o]of Object.entries(r))e.style.setProperty(a,o);e.dataset.theme="dark"}function JS(){return typeof localStorage>"u"?null:localStorage.getItem(gu)}function eC(t){typeof localStorage>"u"||localStorage.setItem(gu,t)}function bc(t){return t??(typeof document<"u"?document.documentElement:null)}var ao;class tC{constructor(){Fe(this,ao,_e(Bt(vu)));jt(this,"target",null)}get current(){return n(fe(this,ao))}set current(e){m(fe(this,ao),e,!0)}init(e){this.target=bc(e);const r=JS();r&&(this.current=pc(r),this.target&&hc(this.current,this.target))}select(e){const r=pc(e);this.current=r;const a=bc(this.target);a&&(this.target=a,hc(r,a)),eC(r.name)}}ao=new WeakMap;const xs=new tC;var nC=x('<span class="inline-flex items-center gap-1 rounded-full bg-accent-soft px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-accent"><!> Active</span>'),rC=x('<button type="button"><div class="rounded-md overflow-hidden border border-line-1"><div class="bg-bg-0 p-3"><div class="flex items-center gap-1.5 mb-2.5"><span class="size-2 rounded-full" style="background: var(--color-accent)"></span> <span class="h-1.5 w-12 rounded-full bg-bg-3"></span> <span class="ml-auto h-1.5 w-6 rounded-full bg-bg-2"></span></div> <div class="rounded-md bg-bg-1 border border-line-2 p-2.5"><div class="h-1.5 w-2/3 rounded-full bg-fg-2 mb-2"></div> <div class="h-1.5 w-full rounded-full bg-bg-3 mb-1.5"></div> <div class="h-1.5 w-4/5 rounded-full bg-bg-3 mb-2.5"></div> <div class="flex items-center gap-1.5"><span class="h-4 w-12 rounded" style="background: var(--color-accent)"></span> <span class="h-4 w-8 rounded bg-bg-2 border border-line-2"></span></div></div></div> <div class="flex h-2.5"><span class="flex-1 bg-bg-0"></span> <span class="flex-1 bg-bg-1"></span> <span class="flex-1 bg-bg-2"></span> <span class="flex-1 bg-bg-3"></span></div></div> <div class="flex items-center gap-2 mt-3"><span class="type-h2 text-fg-0"> </span> <!></div> <p class="type-caption m-0 mt-1"> </p></button>'),aC=x('<div class="h-full overflow-auto bg-bg-0 p-6 text-fg-1"><!> <div class="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4 max-w-4xl"></div></div>');function oC(t,e){ot(e,!0);function r(c){return Object.entries(pu(c)).map(([f,g])=>`${f}: ${g}`).join("; ")}const a=y(()=>xs.current.name);var o=aC(),s=d(o);Ra(s,{eyebrow:"Settings",title:"Appearance",subtitle:"Pick a skin. Surfaces are derived from a single seed; the accent stays surgical. Dark only."});var i=u(s,2);Qe(i,21,()=>Ks,c=>c.name,(c,f)=>{const g=y(()=>n(f).name===n(a));var p=rC(),b=d(p),h=u(b,2),w=d(h),M=d(w,!0);l(w);var P=u(w,2);{var V=F=>{var U=nC(),Q=d(U);uv(Q,{class:"size-3"}),Ce(),l(U),v(F,U)};B(P,F=>{n(g)&&F(V)})}l(h);var O=u(h,2),k=d(O,!0);l(O),l(p),L(F=>{Pe(p,"aria-pressed",n(g)),Ve(p,1,`group text-left rounded-lg border bg-bg-1 p-3 transition-colors ${n(g)?"border-accent":"border-line-2 hover:border-line-3"}`),kn(b,F),S(M,n(f).label),S(k,n(f).description)},[()=>r(n(f))]),we("click",p,()=>xs.select(n(f).name)),v(c,p)}),l(i),l(o),v(t,o),it()}tn(["click"]);var iC=x('<div class="flex h-full items-center justify-center font-mono text-[12px] text-fg-3">loading analytics…</div>'),sC=x('<div class="app relative grid grid-rows-[44px_32px_1fr] h-screen"><!> <!> <!> <main class="relative overflow-hidden z-[1]"><!></main> <!> <!> <!> <!></div>');function xC(t,e){ot(e,!0);let r=Ye(e,"showConnect",3,!0),a=Ye(e,"persistTheme",3,!0);const o=dg(e.router??Rc());e.connectionProvider&&uf(e.connectionProvider);function s(O){const k=O;if(k==="query"||k==="collections"||k==="cluster"||k==="security"||k==="settings"||k==="appearance"){o.go({view:k},void 0,!0);return}const F=cg(O.startsWith("/")?O:`/${O}`);F.collection?o.go({view:"collection",collection:F.collection,subpage:F.subpage??"table"},void 0,!0):o.go({view:F.view},void 0,!0)}Fr(()=>{e.connectionProvider?Ue.adoptInjected().then(()=>{e.initialRoute&&s(e.initialRoute)}):Ue.bootstrap().then(O=>{O&&s(O)})});let i=_e(!1),c=_e(!1);Fr(()=>{const O=()=>m(c,!0);return window.addEventListener("red:open-pending-changes",O),()=>window.removeEventListener("red:open-pending-changes",O)}),an(()=>{const O=Ue.client;if(!O){On.setExecutor(null),Gn.setExecutor(null);return}Gn.setExecutor((k,F)=>ff(O,k,F)),On.setExecutor(async k=>Promise.all(k.map(async F=>{try{const U=await O.query(Es(F));return U.ok?{id:F.id,ok:!0}:{id:F.id,ok:!1,error:U.error??"query failed"}}catch(U){return{id:F.id,ok:!1,error:U.message}}})))});const f=5e3;Dr.init({target:e.themeTarget??null,persist:a(),initial:e.initialTheme}),xs.init(e.themeTarget??null),an(()=>{if(_n.locked||!Ue.targetResolved)return;Ue.refresh();const O=setInterval(()=>Ue.refresh(),f);return()=>clearInterval(O)}),an(()=>{_n.store&&Ue.hydrateUrls()});function g(){const O=Gn.nextLabel(),k=Gt.open({kind:"query",label:O,key:O},!0);Gn.ensure(k.id)}async function p(O,k){const F=Gt.tabs.find(Q=>Q.kind==="collection"&&Q.key===O);F?Gt.open({kind:"collection",label:O,key:O,capability:F.capability,overrideCapability:F.overrideCapability,showSystemColumns:F.showSystemColumns,subpage:k??F.subpage}):Gt.open({kind:"collection",label:O,key:O,capability:"table",subpage:k??void 0});const U=Ue.client;if(!U){k||o.go({view:"collection",collection:O,subpage:"table"},void 0,!0);return}try{const Q=await Hc(U,O),se=Gt.tabs.find(le=>le.kind==="collection"&&le.key===O),xe=k??Pa(Q);se&&(Gt.tabs=Gt.tabs.map(le=>le===se?{...le,capability:Q,subpage:xe}:le)),k||o.go({view:"collection",collection:O,subpage:xe},void 0,!0)}catch{k||o.go({view:"collection",collection:O,subpage:"table"},void 0,!0)}}let b=null,h=null;an(()=>{const O=o.view,k=o.collection,F=o.subpage;if(O==="collections"&&k){const U=`${k}::${F??""}`;U!==h&&(h=U,mr(()=>void p(k,F)))}else h=null;O==="query"&&b!=="query"&&mr(()=>g()),b=O});var w=De(),M=ue(w);{var P=O=>{mf(O,{onDone:()=>m(i,!0)})},V=O=>{var k=sC(),F=d(k);yf(F,{});var U=u(F,2);gg(U,{get showConnect(){return r()}});var Q=u(U,2);Mg(Q,{});var se=u(Q,2),xe=d(se);{var le=$=>{G5($,{})},te=$=>{S5($,{})},be=$=>{I4($,{})},K=$=>{var X=De(),H=ue(X);pf(H,()=>xc(()=>import("./CJFJ501n.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),W=>{var Y=iC();v(W,Y)},(W,Y)=>{var ae=y(()=>{var{default:q}=n(Y);return{AnalyticsView:q}}),ge=y(()=>n(ae).AnalyticsView),ie=De(),ee=ue(ie);Wr(ee,()=>n(ge),(q,G)=>{G(q,{})}),v(W,ie)}),v($,X)},C=$=>{QS($,{})},N=$=>{oC($,{})},_=$=>{f_($)};B(xe,$=>{o.view==="ask"?$(le):o.view==="cluster"?$(te,1):o.view==="security"?$(be,2):o.view==="analytics"?$(K,3):o.view==="settings"?$(C,4):o.view==="appearance"?$(N,5):$(_,-1)})}l(se);var z=u(se,2);Ig(z,{});var I=u(z,2);Hg(I,{});var D=u(I,2);Ug(D,{});var T=u(D,2);tp(T,{get open(){return n(c)},onClose:()=>m(c,!1)}),l(k),v(O,k)};B(M,O=>{n(i)?O(V,-1):O(P)})}v(t,w),it()}export{Wn as B,Mc as C,Gr as L,Ra as P,Cs as R,xC as W,ur as a,el as b,Ia as i,cg as p,os as r,cl as t};
|