`);function C(s,c){p(c,!0);let C=f(c,`open`,3,!1),w=f(c,`label`,3,``),T=f(c,`alert`,3,!1),E=f(c,`size`,3,`sm`),D=f(c,`onclose`,3,()=>{}),O=f(c,`onkeydown`,3,()=>{}),k=b(null);i(()=>{if(!C())return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null;return l(k)?.focus(),()=>e?.focus()});function A(e){e.key===`Escape`?D()():O()(e)}var j=o(),M=u(j),N=e=>{var i=S(),o=d(i),s=d(o);n(s,()=>c.children??v),h(o),_(o,e=>m(k,e),()=>l(k)),h(i),r(()=>{t(o,1,`modal size-${E()??``}`,`svelte-ta60gp`),g(o,`role`,T()?`alertdialog`:`dialog`),g(o,`aria-label`,w())}),x(`click`,i,function(...e){D()?.apply(this,e)}),x(`keydown`,o,A),x(`click`,o,e=>e.stopPropagation()),a(e,i)};e(M,e=>{C()&&e(N)}),a(s,j),y()}c([`click`,`keydown`]);export{C as t};
\ No newline at end of file
+import{A as e,C as t,E as n,G as r,K as i,M as a,N as o,P as s,R as c,V as l,X as u,Y as d,a as f,ct as p,et as m,ft as h,g,l as _,pt as v,st as y,tt as b,z as x}from"./BChu7Pos.js";import"./xihTtKlq.js";var S=s(`
`);function C(s,c){p(c,!0);let C=f(c,`open`,3,!1),w=f(c,`label`,3,``),T=f(c,`alert`,3,!1),E=f(c,`size`,3,`sm`),D=f(c,`onclose`,3,()=>{}),O=f(c,`onkeydown`,3,()=>{}),k=b(null);i(()=>{if(!C())return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null;return l(k)?.focus(),()=>e?.focus()});function A(e){e.key===`Escape`?D()():O()(e)}var j=o(),M=u(j),N=e=>{var i=S(),o=d(i),s=d(o);n(s,()=>c.children??v),h(o),_(o,e=>m(k,e),()=>l(k)),h(i),r(()=>{t(o,1,`modal size-${E()??``}`,`svelte-ta60gp`),g(o,`role`,T()?`alertdialog`:`dialog`),g(o,`aria-label`,w())}),x(`click`,i,function(...e){D()?.apply(this,e)}),x(`keydown`,o,A),x(`click`,o,e=>e.stopPropagation()),a(e,i)};e(M,e=>{C()&&e(N)}),a(s,j),y()}c([`click`,`keydown`]);export{C as t};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/DKVRJME0.js b/app/smartbrain_3000/web/_app/immutable/chunks/Di_L0eC6.js
similarity index 84%
rename from app/smartbrain_3000/web/_app/immutable/chunks/DKVRJME0.js
rename to app/smartbrain_3000/web/_app/immutable/chunks/Di_L0eC6.js
index 7230b605..c9a63932 100644
--- a/app/smartbrain_3000/web/_app/immutable/chunks/DKVRJME0.js
+++ b/app/smartbrain_3000/web/_app/immutable/chunks/Di_L0eC6.js
@@ -1 +1 @@
-import{t as e}from"./CoHYJ8BJ.js";function t(t){if(!(t instanceof e))return`Couldn't reach SmartBrain — check your connection and try again.`;let n=t.status;return n===423||t.code===`no_session`?``:n===502||n===503||n===504?`I couldn't reach the model just now — try again in a moment.`:n>=500?`Something went wrong on my end — please try again.`:t.message||`That didn't work — please try again.`}export{t};
\ No newline at end of file
+import{t as e}from"./BkiVJrb-.js";function t(t){if(!(t instanceof e))return`Couldn't reach SmartBrain — check your connection and try again.`;let n=t.status;return n===423||t.code===`no_session`?``:n===502||n===503||n===504?`I couldn't reach the model just now — try again in a moment.`:n>=500?`Something went wrong on my end — please try again.`:t.message||`That didn't work — please try again.`}export{t};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/y2R953fa.js b/app/smartbrain_3000/web/_app/immutable/chunks/DpD1lG2E.js
similarity index 80%
rename from app/smartbrain_3000/web/_app/immutable/chunks/y2R953fa.js
rename to app/smartbrain_3000/web/_app/immutable/chunks/DpD1lG2E.js
index fc6f9bbf..0a876c97 100644
--- a/app/smartbrain_3000/web/_app/immutable/chunks/y2R953fa.js
+++ b/app/smartbrain_3000/web/_app/immutable/chunks/DpD1lG2E.js
@@ -1 +1 @@
-import{V as e,et as t,tt as n}from"./BJLLtWYH.js";import{a as r,i,n as a,t as o}from"./CoHYJ8BJ.js";var s=new class{#e=n(null);get status(){return e(this.#e)}set status(e){t(this.#e,e,!0)}#t=n(!1);get loading(){return e(this.#t)}set loading(e){t(this.#t,e,!0)}#n=n(``);get error(){return e(this.#n)}set error(e){t(this.#n,e,!0)}#r=null;load(){return this.#r||=this.#i(),this.#r}async#i(){this.loading=!0,this.error=``;try{this.status=await a.accountStatus()}catch(e){this.error=e instanceof o?e.message:`Cannot reach the backend.`}finally{this.loading=!1,this.#r=null}}};i(()=>{s.status&&(s.status.unlocked=!1)}),r(()=>{s.status&&(s.status.session=!1)});export{s as t};
\ No newline at end of file
+import{V as e,et as t,tt as n}from"./BChu7Pos.js";import{a as r,i,n as a,t as o}from"./BkiVJrb-.js";var s=new class{#e=n(null);get status(){return e(this.#e)}set status(e){t(this.#e,e,!0)}#t=n(!1);get loading(){return e(this.#t)}set loading(e){t(this.#t,e,!0)}#n=n(``);get error(){return e(this.#n)}set error(e){t(this.#n,e,!0)}#r=null;load(){return this.#r||=this.#i(),this.#r}async#i(){this.loading=!0,this.error=``;try{this.status=await a.accountStatus()}catch(e){this.error=e instanceof o?e.message:`Cannot reach the backend.`}finally{this.loading=!1,this.#r=null}}};i(()=>{s.status&&(s.status.unlocked=!1)}),r(()=>{s.status&&(s.status.session=!1)});export{s as t};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/kqW19h2g.js b/app/smartbrain_3000/web/_app/immutable/chunks/UDuC8ICI.js
similarity index 93%
rename from app/smartbrain_3000/web/_app/immutable/chunks/kqW19h2g.js
rename to app/smartbrain_3000/web/_app/immutable/chunks/UDuC8ICI.js
index 25d6cfdc..c8ce657e 100644
--- a/app/smartbrain_3000/web/_app/immutable/chunks/kqW19h2g.js
+++ b/app/smartbrain_3000/web/_app/immutable/chunks/UDuC8ICI.js
@@ -1 +1 @@
-import{A as e,C as t,E as n,G as r,M as i,N as a,P as o,Q as s,R as c,X as l,Y as u,a as d,ft as f,g as p,pt as m,z as h}from"./BJLLtWYH.js";import"./xihTtKlq.js";import{t as g}from"./CEPrmzat.js";var _=o(``),v=o(``);function y(o,c){let y=d(c,`icon`,3,``),b=d(c,`kind`,3,``),x=d(c,`mono`,3,!1),S=d(c,`onclick`,3,void 0),C=d(c,`title`,3,``);var w=a(),T=l(w),E=a=>{var o=_();let l;var d=u(o),v=e=>{g(e,{get name(){return y()},size:13})};e(d,e=>{y()&&e(v)});var w=s(d,2);n(w,()=>c.children??m),f(o),r(()=>{l=t(o,1,`chip ${b()??``}`,`svelte-ogjsci`,l,{mono:x(),clicky:!0}),p(o,`title`,C())}),h(`click`,o,function(...e){S()?.apply(this,e)}),i(a,o)},D=a=>{var o=v();let l;var d=u(o),h=e=>{g(e,{get name(){return y()},size:13})};e(d,e=>{y()&&e(h)});var _=s(d,2);n(_,()=>c.children??m),f(o),r(()=>{l=t(o,1,`chip ${b()??``}`,`svelte-ogjsci`,l,{mono:x()}),p(o,`title`,C())}),i(a,o)};e(T,e=>{S()?e(E):e(D,-1)}),i(o,w)}c([`click`]);export{y as t};
\ No newline at end of file
+import{A as e,C as t,E as n,G as r,M as i,N as a,P as o,Q as s,R as c,X as l,Y as u,a as d,ft as f,g as p,pt as m,z as h}from"./BChu7Pos.js";import"./xihTtKlq.js";import{t as g}from"./Be3BkmPa.js";var _=o(``),v=o(``);function y(o,c){let y=d(c,`icon`,3,``),b=d(c,`kind`,3,``),x=d(c,`mono`,3,!1),S=d(c,`onclick`,3,void 0),C=d(c,`title`,3,``);var w=a(),T=l(w),E=a=>{var o=_();let l;var d=u(o),v=e=>{g(e,{get name(){return y()},size:13})};e(d,e=>{y()&&e(v)});var w=s(d,2);n(w,()=>c.children??m),f(o),r(()=>{l=t(o,1,`chip ${b()??``}`,`svelte-ogjsci`,l,{mono:x(),clicky:!0}),p(o,`title`,C())}),h(`click`,o,function(...e){S()?.apply(this,e)}),i(a,o)},D=a=>{var o=v();let l;var d=u(o),h=e=>{g(e,{get name(){return y()},size:13})};e(d,e=>{y()&&e(h)});var _=s(d,2);n(_,()=>c.children??m),f(o),r(()=>{l=t(o,1,`chip ${b()??``}`,`svelte-ogjsci`,l,{mono:x()}),p(o,`title`,C())}),i(a,o)};e(T,e=>{S()?e(E):e(D,-1)}),i(o,w)}c([`click`]);export{y as t};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/CwtHPkdz.js b/app/smartbrain_3000/web/_app/immutable/chunks/aIySO2My.js
similarity index 79%
rename from app/smartbrain_3000/web/_app/immutable/chunks/CwtHPkdz.js
rename to app/smartbrain_3000/web/_app/immutable/chunks/aIySO2My.js
index e8780db5..715cfd2e 100644
--- a/app/smartbrain_3000/web/_app/immutable/chunks/CwtHPkdz.js
+++ b/app/smartbrain_3000/web/_app/immutable/chunks/aIySO2My.js
@@ -1 +1 @@
-import{$ as e}from"./BJLLtWYH.js";var t=e({current:null});function n(e){return new Promise(n=>{t.current={title:e.title??`Please confirm`,body:e.body,confirmLabel:e.confirmLabel??`Confirm`,danger:e.danger??!0,resolve:n}})}function r(e){let n=t.current;t.current=null,n&&n.resolve(e)}export{t as n,r,n as t};
\ No newline at end of file
+import{$ as e}from"./BChu7Pos.js";var t=e({current:null});function n(e){return new Promise(n=>{t.current={title:e.title??`Please confirm`,body:e.body,confirmLabel:e.confirmLabel??`Confirm`,danger:e.danger??!0,resolve:n}})}function r(e){let n=t.current;t.current=null,n&&n.resolve(e)}export{t as n,r,n as t};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/iVEGnMVT.js b/app/smartbrain_3000/web/_app/immutable/chunks/iVEGnMVT.js
deleted file mode 100644
index 5c556ea5..00000000
--- a/app/smartbrain_3000/web/_app/immutable/chunks/iVEGnMVT.js
+++ /dev/null
@@ -1 +0,0 @@
-import{ut as e}from"./BJLLtWYH.js";e();
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/DV4tMnTy.js b/app/smartbrain_3000/web/_app/immutable/chunks/itGxqfLQ.js
similarity index 82%
rename from app/smartbrain_3000/web/_app/immutable/chunks/DV4tMnTy.js
rename to app/smartbrain_3000/web/_app/immutable/chunks/itGxqfLQ.js
index a257495b..8a840e39 100644
--- a/app/smartbrain_3000/web/_app/immutable/chunks/DV4tMnTy.js
+++ b/app/smartbrain_3000/web/_app/immutable/chunks/itGxqfLQ.js
@@ -1 +1 @@
-import{A as e,E as t,G as n,M as r,P as i,Q as a,Y as o,Z as s,a as c,ft as l,j as u}from"./BJLLtWYH.js";import"./xihTtKlq.js";import{t as d}from"./CEPrmzat.js";var f=i(`
`),p=i(``),m=i(`
`);function h(i,h){let g=c(h,`body`,3,``);var _=m(),v=o(_),y=o(v);d(y,{get name(){return h.icon},size:24}),l(v);var b=a(v,2),x=s(b,!0),S=a(b,2),C=e=>{var t=f(),i=s(t,!0);n(()=>u(i,g())),r(e,t)};e(S,e=>{g()&&e(C)});var w=a(S,2),T=e=>{var n=p(),i=o(n);t(i,()=>h.children),l(n),r(e,n)};e(w,e=>{h.children&&e(T)}),l(_),n(()=>u(x,h.title)),r(i,_)}export{h as t};
\ No newline at end of file
+import{A as e,E as t,G as n,M as r,P as i,Q as a,Y as o,Z as s,a as c,ft as l,j as u}from"./BChu7Pos.js";import"./xihTtKlq.js";import{t as d}from"./Be3BkmPa.js";var f=i(`
`),p=i(``),m=i(`
`);function h(i,h){let g=c(h,`body`,3,``);var _=m(),v=o(_),y=o(v);d(y,{get name(){return h.icon},size:24}),l(v);var b=a(v,2),x=s(b,!0),S=a(b,2),C=e=>{var t=f(),i=s(t,!0);n(()=>u(i,g())),r(e,t)};e(S,e=>{g()&&e(C)});var w=a(S,2),T=e=>{var n=p(),i=o(n);t(i,()=>h.children),l(n),r(e,n)};e(w,e=>{h.children&&e(T)}),l(_),n(()=>u(x,h.title)),r(i,_)}export{h as t};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/DNdCTZZL.js b/app/smartbrain_3000/web/_app/immutable/chunks/x-QSRA-u.js
similarity index 96%
rename from app/smartbrain_3000/web/_app/immutable/chunks/DNdCTZZL.js
rename to app/smartbrain_3000/web/_app/immutable/chunks/x-QSRA-u.js
index 07fc79e8..4fd95374 100644
--- a/app/smartbrain_3000/web/_app/immutable/chunks/DNdCTZZL.js
+++ b/app/smartbrain_3000/web/_app/immutable/chunks/x-QSRA-u.js
@@ -1,2 +1,2 @@
-import{A as e,C as t,E as n,G as r,M as i,N as a,P as o,Q as s,V as c,X as l,Y as u,Z as d,a as f,dt as p,ft as m,it as h,j as g,pt as _}from"./BJLLtWYH.js";import"./xihTtKlq.js";import{t as v}from"./CEPrmzat.js";var y=o(`
`),b=o(`
`),x=o(` Irreversible`),S=o(` Reversible`),C=o(`
`);function w(o,w){let T=f(w,`icon`,3,`pencil`),E=f(w,`tier`,3,`reviewed`),D=f(w,`promoted`,3,``),O=f(w,`scope`,3,``),k=f(w,`badge`,3,!0);var A=C();let j;var M=u(A),N=u(M);{let e=h(()=>E()===`irreversible`?`warn`:T());v(N,{get name(){return c(e)},size:16})}var P=s(N);m(M);var F=s(M,2),I=e=>{var t=y(),n=d(t,!0);r(()=>g(n,D())),i(e,t)};e(F,e=>{D()&&e(I)});var L=s(F,2),R=e=>{var t=b(),n=d(t,!0);r(()=>g(n,O())),i(e,t)};e(L,e=>{O()&&e(R)});var z=s(L,2),B=u(z),V=t=>{var n=a(),r=l(n),o=e=>{var t=x(),n=u(t);v(n,{name:`warn`,size:12}),p(),m(t),i(e,t)},s=e=>{var t=S(),n=u(t);v(n,{name:`refresh`,size:12}),p(),m(t),i(e,t)};e(r,e=>{E()===`irreversible`?e(o):e(s,-1)}),i(t,n)};e(B,e=>{k()&&e(V)});var H=s(B,4);n(H,()=>w.actions??_),m(z),m(A),r(()=>{j=t(A,1,`actioncard svelte-1v1vnro`,null,j,{irreversible:E()===`irreversible`}),g(P,` ${w.title??``}`)}),i(o,A)}function T(e){let t=e.toLowerCase();return t.includes(`ni_item`)?`monitor`:t.includes(`mail`)||t.includes(`email`)?`mail`:t.includes(`task`)?`tasks`:t.includes(`schedule`)?`clock`:t.includes(`kb`)||t.includes(`knowledge`)||t.includes(`note`)||t.includes(`doc`)?`book`:t.includes(`web`)||t.includes(`fetch`)||t.includes(`search`)?`search`:t.includes(`vault`)?`vault`:`pencil`}function E(e,t,n,r){console.assert(typeof e==`string`,`promotedLine: tool is string`),console.assert(t!==void 0,`promotedLine: args defined`);let i=e.toLowerCase();if(i===`remap_ni_item`)return`Re-maps this card against its already-approved source`;if(i===`start_ni_flow`||i===`resume_ni_flow`){let e=D(t);return e?`Fetches: ${e}`:`Builds a card from a source you pick — no fetch until you pick one`}if(i!==`create_ni_item`&&i!==`update_ni_item`)return null;let a=t;if(typeof t==`string`){if(!t.trim())return null;try{a=JSON.parse(t)}catch{return null}}if(!a||typeof a!=`object`||Array.isArray(a))return null;let o=a.source;if(!o||typeof o!=`object`||Array.isArray(o))return null;let s=o,c=s.url;if(typeof c==`string`&&c.length>0)return`Fetches: ${c}`;if(s.type===`internal.ni`)return`Combines: ${r&&r.length>0?r.join(`, `):`other cards`}`;let l=s.server_id,u=s.tool;return typeof l==`string`&&l.length>0&&typeof u==`string`&&u.length>0?`MCP: ${n??`your configured server`} → ${u}`:null}function D(e){console.assert(e!==void 0,`readSourceUrl: args defined`),console.assert(typeof e!=`function`,`readSourceUrl: args not a function`);let t=e;if(typeof e==`string`){if(!e.trim())return``;try{t=JSON.parse(e)}catch{return``}}if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t.source_url;return typeof n==`string`&&n.length>0?n:``}function O(e){let t=e;if(typeof e==`string`){if(!e.trim())return``;try{t=JSON.parse(e)}catch{return e}}return t&&typeof t==`object`&&!Array.isArray(t)?Object.entries(t).map(([e,t])=>`${e}: ${typeof t==`string`?t:JSON.stringify(t)}`).join(`
+import{A as e,C as t,E as n,G as r,M as i,N as a,P as o,Q as s,V as c,X as l,Y as u,Z as d,a as f,dt as p,ft as m,it as h,j as g,pt as _}from"./BChu7Pos.js";import"./xihTtKlq.js";import{t as v}from"./Be3BkmPa.js";var y=o(`
`),b=o(`
`),x=o(` Irreversible`),S=o(` Reversible`),C=o(`
`);function w(o,w){let T=f(w,`icon`,3,`pencil`),E=f(w,`tier`,3,`reviewed`),D=f(w,`promoted`,3,``),O=f(w,`scope`,3,``),k=f(w,`badge`,3,!0);var A=C();let j;var M=u(A),N=u(M);{let e=h(()=>E()===`irreversible`?`warn`:T());v(N,{get name(){return c(e)},size:16})}var P=s(N);m(M);var F=s(M,2),I=e=>{var t=y(),n=d(t,!0);r(()=>g(n,D())),i(e,t)};e(F,e=>{D()&&e(I)});var L=s(F,2),R=e=>{var t=b(),n=d(t,!0);r(()=>g(n,O())),i(e,t)};e(L,e=>{O()&&e(R)});var z=s(L,2),B=u(z),V=t=>{var n=a(),r=l(n),o=e=>{var t=x(),n=u(t);v(n,{name:`warn`,size:12}),p(),m(t),i(e,t)},s=e=>{var t=S(),n=u(t);v(n,{name:`refresh`,size:12}),p(),m(t),i(e,t)};e(r,e=>{E()===`irreversible`?e(o):e(s,-1)}),i(t,n)};e(B,e=>{k()&&e(V)});var H=s(B,4);n(H,()=>w.actions??_),m(z),m(A),r(()=>{j=t(A,1,`actioncard svelte-1v1vnro`,null,j,{irreversible:E()===`irreversible`}),g(P,` ${w.title??``}`)}),i(o,A)}function T(e){let t=e.toLowerCase();return t.includes(`ni_item`)?`monitor`:t.includes(`mail`)||t.includes(`email`)?`mail`:t.includes(`task`)?`tasks`:t.includes(`schedule`)?`clock`:t.includes(`kb`)||t.includes(`knowledge`)||t.includes(`note`)||t.includes(`doc`)?`book`:t.includes(`web`)||t.includes(`fetch`)||t.includes(`search`)?`search`:t.includes(`vault`)?`vault`:`pencil`}function E(e,t,n,r){console.assert(typeof e==`string`,`promotedLine: tool is string`),console.assert(t!==void 0,`promotedLine: args defined`);let i=e.toLowerCase();if(i===`remap_ni_item`)return`Re-maps this card against its already-approved source`;if(i===`start_ni_flow`||i===`resume_ni_flow`){let e=D(t);return e?`Fetches: ${e}`:`Builds a card from a source you pick — no fetch until you pick one`}if(i!==`create_ni_item`&&i!==`update_ni_item`)return null;let a=t;if(typeof t==`string`){if(!t.trim())return null;try{a=JSON.parse(t)}catch{return null}}if(!a||typeof a!=`object`||Array.isArray(a))return null;let o=a.source;if(!o||typeof o!=`object`||Array.isArray(o))return null;let s=o,c=s.url;if(typeof c==`string`&&c.length>0)return`Fetches: ${c}`;if(s.type===`internal.ni`)return`Combines: ${r&&r.length>0?r.join(`, `):`other cards`}`;let l=s.server_id,u=s.tool;return typeof l==`string`&&l.length>0&&typeof u==`string`&&u.length>0?`MCP: ${n??`your configured server`} → ${u}`:null}function D(e){console.assert(e!==void 0,`readSourceUrl: args defined`),console.assert(typeof e!=`function`,`readSourceUrl: args not a function`);let t=e;if(typeof e==`string`){if(!e.trim())return``;try{t=JSON.parse(e)}catch{return``}}if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t.source_url;return typeof n==`string`&&n.length>0?n:``}function O(e){let t=e;if(typeof e==`string`){if(!e.trim())return``;try{t=JSON.parse(e)}catch{return e}}return t&&typeof t==`object`&&!Array.isArray(t)?Object.entries(t).map(([e,t])=>`${e}: ${typeof t==`string`?t:JSON.stringify(t)}`).join(`
`):typeof e==`string`?e:JSON.stringify(e)}export{w as i,T as n,E as r,O as t};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/entry/app.C6nqrMm7.js b/app/smartbrain_3000/web/_app/immutable/entry/app.C6nqrMm7.js
new file mode 100644
index 00000000..4b93c77d
--- /dev/null
+++ b/app/smartbrain_3000/web/_app/immutable/entry/app.C6nqrMm7.js
@@ -0,0 +1,2 @@
+const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.CAue6YlT.js","../chunks/BChu7Pos.js","../chunks/Czex3Sq4.js","../chunks/xihTtKlq.js","../chunks/DETRq8nR.js","../chunks/CJLE_wpt.js","../chunks/CQMDLFxa.js","../chunks/BkiVJrb-.js","../chunks/DpD1lG2E.js","../chunks/ChxMyhtI.js","../chunks/CwN7cGO4.js","../chunks/Be3BkmPa.js","../chunks/nF02aZGo.js","../chunks/CDAAYzUu.js","../chunks/aIySO2My.js","../chunks/DQSrham4.js","../assets/Modal.BsseWW9a.css","../chunks/CcVP_dcS.js","../chunks/UDuC8ICI.js","../assets/Chip.GYL4hQJn.css","../assets/0.B-xUN8PJ.css","../nodes/1.C7xJmJkE.js","../nodes/2.CBI0cuH1.js","../chunks/CeaAcbO3.js","../assets/Tabs.C-bXfTKf.css","../chunks/Bmlx8Ynu.js","../assets/Spinner.sZVMC3-s.css","../nodes/3.hrXXucw2.js","../nodes/4.DwKXVaGA.js","../chunks/Di_L0eC6.js","../chunks/x-QSRA-u.js","../assets/pendingCards.bTkY8p7D.css","../chunks/itGxqfLQ.js","../assets/EmptyState.BPkuzyS8.css","../assets/4.hNlXlqzt.css","../nodes/5.Cyfd-xHo.js","../chunks/jV_dy7U_.js","../chunks/Ce4TvoH5.js","../assets/5.D4p1wr8Z.css","../nodes/6.CqMhcdx_.js","../assets/6.5V9gTAey.css","../nodes/7.rC1CBLEA.js","../assets/7.CfVVSiDA.css","../nodes/8.DlXaiCiv.js","../assets/8.G9r3aFQF.css","../nodes/9.CAioKP6J.js","../chunks/DVFSua2J.js","../assets/9.Q4U0lmP1.css","../nodes/10.BoqtT515.js","../assets/10.XHcxur0F.css","../nodes/11.SjX2dPtJ.js","../assets/11.BvDUnXGQ.css","../nodes/12.Cyl0pmDa.js","../nodes/13.Dk_SvHe1.js","../assets/13.B-o8L9be.css","../nodes/14.Dyt9LzQr.js","../nodes/15.CjnZ9tWk.js","../nodes/16.DuGhVinj.js","../nodes/17.7MLgDNjt.js","../nodes/18.CZM1LVRi.js","../assets/18.DXKM_sCu.css","../nodes/19.Dn0rUkG4.js","../nodes/20.DaQdc7Ir.js","../assets/20.DcpVa2mn.css","../nodes/21.CJha6Vtp.js","../nodes/22.DueoGgfK.js","../nodes/23.BWQAnoZQ.js","../assets/23.BzfJDnUp.css","../nodes/24.5tRnvpAR.js","../assets/24.CpyRSDLr.css","../nodes/25.a4i0kQk5.js","../nodes/26.Cws4L5Up.js","../assets/26.MD5KWOLB.css","../nodes/27.dnMaooFk.js","../nodes/28.7m_3q5mX.js","../assets/28.CiTAHA42.css"])))=>i.map(i=>d[i]);
+import{A as e,G as t,K as n,L as r,M as i,N as a,P as o,Q as s,T as c,U as l,V as u,X as d,Y as f,a as p,ct as m,et as h,ft as g,i as _,it as v,j as y,l as b,q as x,r as S,st as C,tt as w}from"../chunks/BChu7Pos.js";import"../chunks/xihTtKlq.js";var T=`modulepreload`,E=function(e,t){return new URL(e,t).href},D={},O=function(e){return e.pathname.endsWith(`.css`)},k=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},A=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=E(t,n);let r=s(t),i=O(r);return k(D,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:T,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},j={},M=o(``),N=o(` `,1);function P(o,_){m(_,!0);let T=p(_,`components`,23,()=>[]),E=p(_,`data_0`,3,null),D=p(_,`data_1`,3,null),O=p(_,`data_2`,3,null);x(()=>_.stores.page.set(_.page)),n(()=>{_.stores,_.page,_.constructors,T(),_.form,E(),D(),O(),_.stores.page.notify()});let k=w(!1),A=w(!1),j=w(null);S(()=>{let e=_.stores.page.subscribe(()=>{u(k)&&(h(A,!0),l().then(()=>{h(j,document.title||`untitled page`,!0)}))});return h(k,!0),e});let P=v(()=>_.constructors[2]);var F=N(),I=d(F),L=t=>{let n=v(()=>_.constructors[0]);var r=a(),o=d(r);c(o,()=>u(n),(t,n)=>{b(n(t,{get data(){return E()},get form(){return _.form},get params(){return _.page.params},children:(t,n)=>{var r=a(),o=d(r),s=e=>{let t=v(()=>_.constructors[1]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return D()},get form(){return _.form},get params(){return _.page.params},children:(e,t)=>{var n=a(),r=d(n);c(r,()=>u(P),(e,t)=>{b(t(e,{get data(){return O()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[2]=e,()=>T()?.[2])}),i(e,n)},$$slots:{default:!0}}),e=>T()[1]=e,()=>T()?.[1])}),i(e,n)},l=e=>{let t=v(()=>_.constructors[1]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return D()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),i(e,n)};e(o,e=>{_.constructors[2]?e(s):e(l,-1)}),i(t,r)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),i(t,r)},R=e=>{let t=v(()=>_.constructors[0]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return E()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),i(e,n)};e(I,e=>{_.constructors[1]?e(L):e(R,-1)});var z=s(I,2),B=n=>{var a=M(),o=f(a),s=e=>{var n=r();t(()=>y(n,u(j))),i(e,n)};e(o,e=>{u(A)&&e(s)}),g(a),i(n,a)};e(z,e=>{u(k)&&e(B)}),i(o,F),C()}var F=_(P),I=[()=>A(()=>import(`../nodes/0.CAue6YlT.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url),()=>A(()=>import(`../nodes/1.C7xJmJkE.js`),__vite__mapDeps([21,1,3,5,2]),import.meta.url),()=>A(()=>import(`../nodes/2.CBI0cuH1.js`),__vite__mapDeps([22,1,2,3,4,5,7,6,8,23,24,25,26]),import.meta.url),()=>A(()=>import(`../nodes/3.hrXXucw2.js`),__vite__mapDeps([27,1,2,3,4,7,6,8,13,25,26]),import.meta.url),()=>A(()=>import(`../nodes/4.DwKXVaGA.js`),__vite__mapDeps([28,1,2,3,4,7,6,8,9,11,14,18,19,25,26,29,30,31,32,33,34]),import.meta.url),()=>A(()=>import(`../nodes/5.Cyfd-xHo.js`),__vite__mapDeps([35,1,2,3,4,7,6,8,9,10,11,14,18,19,25,26,29,30,31,32,33,36,37,38]),import.meta.url),()=>A(()=>import(`../nodes/6.CqMhcdx_.js`),__vite__mapDeps([39,1,2,3,4,7,6,8,14,15,16,25,26,29,40]),import.meta.url),()=>A(()=>import(`../nodes/7.rC1CBLEA.js`),__vite__mapDeps([41,1,3,5,2,42]),import.meta.url),()=>A(()=>import(`../nodes/8.DlXaiCiv.js`),__vite__mapDeps([43,1,2,3,4,7,6,8,23,24,25,26,29,32,11,33,36,44]),import.meta.url),()=>A(()=>import(`../nodes/9.CAioKP6J.js`),__vite__mapDeps([45,1,2,3,4,7,6,8,11,14,15,16,18,19,25,26,29,32,33,36,46,47]),import.meta.url),()=>A(()=>import(`../nodes/10.BoqtT515.js`),__vite__mapDeps([48,1,2,3,4,7,6,8,11,14,15,16,17,18,19,25,26,29,32,33,36,49]),import.meta.url),()=>A(()=>import(`../nodes/11.SjX2dPtJ.js`),__vite__mapDeps([50,1,2,3,4,7,6,8,11,14,15,16,17,18,19,25,26,29,32,33,51]),import.meta.url),()=>A(()=>import(`../nodes/12.Cyl0pmDa.js`),__vite__mapDeps([52,1,3,6,12]),import.meta.url),()=>A(()=>import(`../nodes/13.Dk_SvHe1.js`),__vite__mapDeps([53,1,2,3,4,7,6,8,11,14,25,26,29,32,33,46,54]),import.meta.url),()=>A(()=>import(`../nodes/14.Dyt9LzQr.js`),__vite__mapDeps([55,1,2,3,4,7,6,8,11,14,23,24,25,26,29,36]),import.meta.url),()=>A(()=>import(`../nodes/15.CjnZ9tWk.js`),__vite__mapDeps([56,1,2,3,4,13,25,26]),import.meta.url),()=>A(()=>import(`../nodes/16.DuGhVinj.js`),__vite__mapDeps([57,1,3,7,2,4,6,14,29,36]),import.meta.url),()=>A(()=>import(`../nodes/17.7MLgDNjt.js`),__vite__mapDeps([58,1,3,7,2,4,6,14,29,36]),import.meta.url),()=>A(()=>import(`../nodes/18.CZM1LVRi.js`),__vite__mapDeps([59,1,3,7,2,4,6,14,29,60]),import.meta.url),()=>A(()=>import(`../nodes/19.Dn0rUkG4.js`),__vite__mapDeps([61,1,3,7,2,4,6,29]),import.meta.url),()=>A(()=>import(`../nodes/20.DaQdc7Ir.js`),__vite__mapDeps([62,1,3,7,2,4,6,18,11,19,29,63]),import.meta.url),()=>A(()=>import(`../nodes/21.CJha6Vtp.js`),__vite__mapDeps([64,1,3,7,2,4,6,29]),import.meta.url),()=>A(()=>import(`../nodes/22.DueoGgfK.js`),__vite__mapDeps([65,1,3,7,2,4,6,29]),import.meta.url),()=>A(()=>import(`../nodes/23.BWQAnoZQ.js`),__vite__mapDeps([66,1,3,7,2,4,6,25,26,29,67]),import.meta.url),()=>A(()=>import(`../nodes/24.5tRnvpAR.js`),__vite__mapDeps([68,1,3,7,2,4,6,8,18,11,19,25,26,29,36,37,69]),import.meta.url),()=>A(()=>import(`../nodes/25.a4i0kQk5.js`),__vite__mapDeps([70,1,3,7,2,4,6,18,11,19,25,26,29]),import.meta.url),()=>A(()=>import(`../nodes/26.Cws4L5Up.js`),__vite__mapDeps([71,1,2,3,4,7,6,8,25,26,72]),import.meta.url),()=>A(()=>import(`../nodes/27.dnMaooFk.js`),__vite__mapDeps([73,1,2,3,4,7,6,8]),import.meta.url),()=>A(()=>import(`../nodes/28.7m_3q5mX.js`),__vite__mapDeps([74,1,2,3,4,7,6,8,25,26,29,75]),import.meta.url)],L=[],R={"/":[3],"/activity":[4],"/chat":[5],"/email":[6],"/help":[7],"/info":[8],"/knowledge":[9],"/ni":[10],"/ni/library":[11],"/pair":[12],"/planner":[13],"/schedules":[14],"/settings":[15,[2]],"/settings/account":[16,[2]],"/settings/devices":[17,[2]],"/settings/mcp":[18,[2]],"/settings/memory":[19,[2]],"/settings/models":[20,[2]],"/settings/providers":[21,[2]],"/settings/router":[22,[2]],"/settings/selfimprove":[23,[2]],"/settings/status":[24,[2]],"/settings/web":[25,[2]],"/setup":[26],"/unlock":[27],"/usage":[28]},z={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},B=Object.fromEntries(Object.entries(z.transport).map(([e,t])=>[e,t.decode])),V=Object.fromEntries(Object.entries(z.transport).map(([e,t])=>[e,t.encode])),H=!1,U=(e,t)=>B[e](t),W=()=>A(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{U as decode,B as decoders,R as dictionary,V as encoders,W as get_error_template,H as hash,z as hooks,j as matchers,I as nodes,F as root,L as server_loads};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/entry/app.DIDA9xot.js b/app/smartbrain_3000/web/_app/immutable/entry/app.DIDA9xot.js
deleted file mode 100644
index d0cb5d43..00000000
--- a/app/smartbrain_3000/web/_app/immutable/entry/app.DIDA9xot.js
+++ /dev/null
@@ -1,2 +0,0 @@
-const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BC5_jvAz.js","../chunks/BJLLtWYH.js","../chunks/BxvjB08B.js","../chunks/xihTtKlq.js","../chunks/Cmegxfzj.js","../chunks/CLNxzSSl.js","../chunks/CQMDLFxa.js","../chunks/CoHYJ8BJ.js","../chunks/y2R953fa.js","../chunks/BtjCS6Y-.js","../chunks/eN4Uq1pt.js","../chunks/CEPrmzat.js","../chunks/nF02aZGo.js","../chunks/iVEGnMVT.js","../chunks/CwtHPkdz.js","../chunks/BqUz5g-m.js","../assets/Modal.BsseWW9a.css","../chunks/uFPkKLC1.js","../chunks/kqW19h2g.js","../assets/Chip.GYL4hQJn.css","../assets/0.B-xUN8PJ.css","../nodes/1.CS-bGd13.js","../nodes/2.CiKgDIBB.js","../chunks/tlN4Hcij.js","../assets/Tabs.C-bXfTKf.css","../chunks/1gl_kuJz.js","../assets/Spinner.sZVMC3-s.css","../nodes/3.4LzSyiDB.js","../nodes/4.BTxIooNG.js","../chunks/DKVRJME0.js","../chunks/DNdCTZZL.js","../assets/pendingCards.bTkY8p7D.css","../chunks/DV4tMnTy.js","../assets/EmptyState.BPkuzyS8.css","../assets/4.hNlXlqzt.css","../nodes/5.aXnt5v4U.js","../chunks/jV_dy7U_.js","../chunks/Ce4TvoH5.js","../assets/5.D4p1wr8Z.css","../nodes/6.C0SuaYab.js","../assets/6.5V9gTAey.css","../nodes/7.Dd3hmGbD.js","../assets/7.CfVVSiDA.css","../nodes/8.CE6Gc_e3.js","../assets/8.G9r3aFQF.css","../nodes/9.BeNo-nGH.js","../chunks/DVFSua2J.js","../assets/9.Q4U0lmP1.css","../nodes/10.D2sVRYwK.js","../assets/10.XHcxur0F.css","../nodes/11.BQRO1JQZ.js","../assets/11.BvDUnXGQ.css","../nodes/12.Dbly5ARM.js","../nodes/13.wu6k-MKp.js","../assets/13.B-o8L9be.css","../nodes/14.eFvvfdPp.js","../nodes/15.BPdwRx9u.js","../nodes/16.Djk9HcUS.js","../nodes/17.CgukqYQt.js","../nodes/18.COwa8j3Q.js","../assets/18.DXKM_sCu.css","../nodes/19.qPht_xNT.js","../nodes/20.CcKNEGJ_.js","../assets/20.DcpVa2mn.css","../nodes/21.DHbFPEDf.js","../nodes/22.BfzGGdQN.js","../nodes/23.BiQaWPwb.js","../assets/23.BzfJDnUp.css","../nodes/24.Denbgw47.js","../assets/24.CpyRSDLr.css","../nodes/25.wN3Z1f3V.js","../nodes/26.BQ1Crg-Z.js","../assets/26.MD5KWOLB.css","../nodes/27.CsA0vwdY.js","../nodes/28.DEhKyuoz.js","../assets/28.CiTAHA42.css"])))=>i.map(i=>d[i]);
-import{A as e,G as t,K as n,L as r,M as i,N as a,P as o,Q as s,T as c,U as l,V as u,X as d,Y as f,a as p,ct as m,et as h,ft as g,i as _,it as v,j as y,l as b,q as x,r as S,st as C,tt as w}from"../chunks/BJLLtWYH.js";import"../chunks/xihTtKlq.js";var T=`modulepreload`,E=function(e,t){return new URL(e,t).href},D={},O=function(e){return e.pathname.endsWith(`.css`)},k=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=E(t,n);let r=s(t);if(r.href in D)return;D[r.href]=!0;let i=O(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:T,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},A={},j=o(``),M=o(` `,1);function N(o,_){m(_,!0);let T=p(_,`components`,23,()=>[]),E=p(_,`data_0`,3,null),D=p(_,`data_1`,3,null),O=p(_,`data_2`,3,null);x(()=>_.stores.page.set(_.page)),n(()=>{_.stores,_.page,_.constructors,T(),_.form,E(),D(),O(),_.stores.page.notify()});let k=w(!1),A=w(!1),N=w(null);S(()=>{let e=_.stores.page.subscribe(()=>{u(k)&&(h(A,!0),l().then(()=>{h(N,document.title||`untitled page`,!0)}))});return h(k,!0),e});let P=v(()=>_.constructors[2]);var F=M(),I=d(F),L=t=>{let n=v(()=>_.constructors[0]);var r=a(),o=d(r);c(o,()=>u(n),(t,n)=>{b(n(t,{get data(){return E()},get form(){return _.form},get params(){return _.page.params},children:(t,n)=>{var r=a(),o=d(r),s=e=>{let t=v(()=>_.constructors[1]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return D()},get form(){return _.form},get params(){return _.page.params},children:(e,t)=>{var n=a(),r=d(n);c(r,()=>u(P),(e,t)=>{b(t(e,{get data(){return O()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[2]=e,()=>T()?.[2])}),i(e,n)},$$slots:{default:!0}}),e=>T()[1]=e,()=>T()?.[1])}),i(e,n)},l=e=>{let t=v(()=>_.constructors[1]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return D()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),i(e,n)};e(o,e=>{_.constructors[2]?e(s):e(l,-1)}),i(t,r)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),i(t,r)},R=e=>{let t=v(()=>_.constructors[0]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return E()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),i(e,n)};e(I,e=>{_.constructors[1]?e(L):e(R,-1)});var z=s(I,2),B=n=>{var a=j(),o=f(a),s=e=>{var n=r();t(()=>y(n,u(N))),i(e,n)};e(o,e=>{u(A)&&e(s)}),g(a),i(n,a)};e(z,e=>{u(k)&&e(B)}),i(o,F),C()}var P=_(N),F=[()=>k(()=>import(`../nodes/0.BC5_jvAz.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url),()=>k(()=>import(`../nodes/1.CS-bGd13.js`),__vite__mapDeps([21,1,3,5,2]),import.meta.url),()=>k(()=>import(`../nodes/2.CiKgDIBB.js`),__vite__mapDeps([22,1,2,3,4,5,7,6,8,23,24,25,26]),import.meta.url),()=>k(()=>import(`../nodes/3.4LzSyiDB.js`),__vite__mapDeps([27,1,2,3,4,7,6,8,13,25,26]),import.meta.url),()=>k(()=>import(`../nodes/4.BTxIooNG.js`),__vite__mapDeps([28,1,2,3,4,7,6,8,9,11,14,18,19,25,26,29,30,31,32,33,34]),import.meta.url),()=>k(()=>import(`../nodes/5.aXnt5v4U.js`),__vite__mapDeps([35,1,2,3,4,7,6,8,9,10,11,14,18,19,25,26,29,30,31,32,33,36,37,38]),import.meta.url),()=>k(()=>import(`../nodes/6.C0SuaYab.js`),__vite__mapDeps([39,1,2,3,4,7,6,8,14,15,16,25,26,29,40]),import.meta.url),()=>k(()=>import(`../nodes/7.Dd3hmGbD.js`),__vite__mapDeps([41,1,3,5,2,42]),import.meta.url),()=>k(()=>import(`../nodes/8.CE6Gc_e3.js`),__vite__mapDeps([43,1,2,3,4,7,6,8,23,24,25,26,29,32,11,33,36,44]),import.meta.url),()=>k(()=>import(`../nodes/9.BeNo-nGH.js`),__vite__mapDeps([45,1,2,3,4,7,6,8,11,14,15,16,18,19,25,26,29,32,33,36,46,47]),import.meta.url),()=>k(()=>import(`../nodes/10.D2sVRYwK.js`),__vite__mapDeps([48,1,2,3,4,7,6,8,11,14,15,16,17,18,19,25,26,29,32,33,36,49]),import.meta.url),()=>k(()=>import(`../nodes/11.BQRO1JQZ.js`),__vite__mapDeps([50,1,2,3,4,7,6,8,11,14,15,16,17,18,19,25,26,29,32,33,51]),import.meta.url),()=>k(()=>import(`../nodes/12.Dbly5ARM.js`),__vite__mapDeps([52,1,3,6,12]),import.meta.url),()=>k(()=>import(`../nodes/13.wu6k-MKp.js`),__vite__mapDeps([53,1,2,3,4,7,6,8,11,14,25,26,29,32,33,46,54]),import.meta.url),()=>k(()=>import(`../nodes/14.eFvvfdPp.js`),__vite__mapDeps([55,1,2,3,4,7,6,8,11,14,23,24,25,26,29,36]),import.meta.url),()=>k(()=>import(`../nodes/15.BPdwRx9u.js`),__vite__mapDeps([56,1,2,3,4,13,25,26]),import.meta.url),()=>k(()=>import(`../nodes/16.Djk9HcUS.js`),__vite__mapDeps([57,1,3,7,2,4,6,14,29,36]),import.meta.url),()=>k(()=>import(`../nodes/17.CgukqYQt.js`),__vite__mapDeps([58,1,3,7,2,4,6,14,29,36]),import.meta.url),()=>k(()=>import(`../nodes/18.COwa8j3Q.js`),__vite__mapDeps([59,1,3,7,2,4,6,14,29,60]),import.meta.url),()=>k(()=>import(`../nodes/19.qPht_xNT.js`),__vite__mapDeps([61,1,3,7,2,4,6,29]),import.meta.url),()=>k(()=>import(`../nodes/20.CcKNEGJ_.js`),__vite__mapDeps([62,1,3,7,2,4,6,18,11,19,29,63]),import.meta.url),()=>k(()=>import(`../nodes/21.DHbFPEDf.js`),__vite__mapDeps([64,1,3,7,2,4,6,29]),import.meta.url),()=>k(()=>import(`../nodes/22.BfzGGdQN.js`),__vite__mapDeps([65,1,3,7,2,4,6,29]),import.meta.url),()=>k(()=>import(`../nodes/23.BiQaWPwb.js`),__vite__mapDeps([66,1,3,7,2,4,6,25,26,29,67]),import.meta.url),()=>k(()=>import(`../nodes/24.Denbgw47.js`),__vite__mapDeps([68,1,3,7,2,4,6,8,18,11,19,25,26,29,36,37,69]),import.meta.url),()=>k(()=>import(`../nodes/25.wN3Z1f3V.js`),__vite__mapDeps([70,1,3,7,2,4,6,18,11,19,25,26,29]),import.meta.url),()=>k(()=>import(`../nodes/26.BQ1Crg-Z.js`),__vite__mapDeps([71,1,2,3,4,7,6,8,25,26,72]),import.meta.url),()=>k(()=>import(`../nodes/27.CsA0vwdY.js`),__vite__mapDeps([73,1,2,3,4,7,6,8]),import.meta.url),()=>k(()=>import(`../nodes/28.DEhKyuoz.js`),__vite__mapDeps([74,1,2,3,4,7,6,8,25,26,29,75]),import.meta.url)],I=[],L={"/":[3],"/activity":[4],"/chat":[5],"/email":[6],"/help":[7],"/info":[8],"/knowledge":[9],"/ni":[10],"/ni/library":[11],"/pair":[12],"/planner":[13],"/schedules":[14],"/settings":[15,[2]],"/settings/account":[16,[2]],"/settings/devices":[17,[2]],"/settings/mcp":[18,[2]],"/settings/memory":[19,[2]],"/settings/models":[20,[2]],"/settings/providers":[21,[2]],"/settings/router":[22,[2]],"/settings/selfimprove":[23,[2]],"/settings/status":[24,[2]],"/settings/web":[25,[2]],"/setup":[26],"/unlock":[27],"/usage":[28]},R={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},z=Object.fromEntries(Object.entries(R.transport).map(([e,t])=>[e,t.decode])),B=Object.fromEntries(Object.entries(R.transport).map(([e,t])=>[e,t.encode])),V=!1,H=(e,t)=>z[e](t),U=()=>k(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{H as decode,z as decoders,L as dictionary,B as encoders,U as get_error_template,V as hash,R as hooks,A as matchers,F as nodes,P as root,I as server_loads};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/entry/start.BbFbPWF3.js b/app/smartbrain_3000/web/_app/immutable/entry/start.BbFbPWF3.js
deleted file mode 100644
index 78f8ec29..00000000
--- a/app/smartbrain_3000/web/_app/immutable/entry/start.BbFbPWF3.js
+++ /dev/null
@@ -1 +0,0 @@
-import{a as e,n as t}from"../chunks/BxvjB08B.js";export{e as load_css,t as start};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/entry/start.TSJdo2Gi.js b/app/smartbrain_3000/web/_app/immutable/entry/start.TSJdo2Gi.js
new file mode 100644
index 00000000..744a931c
--- /dev/null
+++ b/app/smartbrain_3000/web/_app/immutable/entry/start.TSJdo2Gi.js
@@ -0,0 +1 @@
+export{a as load_css,n as start}from"../chunks/Czex3Sq4.js";
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/0.BC5_jvAz.js b/app/smartbrain_3000/web/_app/immutable/nodes/0.CAue6YlT.js
similarity index 81%
rename from app/smartbrain_3000/web/_app/immutable/nodes/0.BC5_jvAz.js
rename to app/smartbrain_3000/web/_app/immutable/nodes/0.CAue6YlT.js
index 9d598126..d3f9cbe5 100644
--- a/app/smartbrain_3000/web/_app/immutable/nodes/0.BC5_jvAz.js
+++ b/app/smartbrain_3000/web/_app/immutable/nodes/0.CAue6YlT.js
@@ -1,7 +1,7 @@
-import{$ as e,A as t,B as n,C as r,E as i,G as a,J as o,K as s,L as c,M as l,N as u,O as d,P as f,Q as p,R as m,V as h,X as g,Y as _,Z as v,ct as y,dt as b,et as x,ft as S,g as C,h as ee,ht as w,it as T,j as E,m as te,n as ne,r as re,rt as D,s as O,st as k,tt as A,z as j}from"../chunks/BJLLtWYH.js";import{t as ie}from"../chunks/BxvjB08B.js";import"../chunks/xihTtKlq.js";import"../chunks/Cmegxfzj.js";import{t as M}from"../chunks/CLNxzSSl.js";import{_ as N,h as ae}from"../chunks/CQMDLFxa.js";import{c as P,n as F,o as oe,r as I,s as se}from"../chunks/CoHYJ8BJ.js";import{t as L}from"../chunks/y2R953fa.js";import{n as ce,t as le}from"../chunks/BtjCS6Y-.js";import{n as ue,t as de}from"../chunks/eN4Uq1pt.js";import{t as R}from"../chunks/CEPrmzat.js";import{t as fe}from"../chunks/nF02aZGo.js";import"../chunks/iVEGnMVT.js";import{n as z,r as B,t as pe}from"../chunks/CwtHPkdz.js";import{t as V}from"../chunks/BqUz5g-m.js";import{r as me,t as he}from"../chunks/uFPkKLC1.js";import{t as ge}from"../chunks/kqW19h2g.js";var _e=w({prerender:()=>!1,ssr:()=>!1});function ve(e,t,n){return!e||!t||e===t?`none`:n?`banner`:`reload`}function H(e){return e?`v${e}`:``}var U=e({mode:`system`});function W(){try{let e=localStorage.getItem(`theme`);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function ye(e){let t=document.documentElement;e===`system`?t.removeAttribute(`data-theme`):t.dataset.theme=e}function be(){U.mode=W()}function xe(){U.mode=U.mode===`system`?`light`:U.mode===`light`?`dark`:`system`;try{U.mode===`system`?localStorage.removeItem(`theme`):localStorage.setItem(`theme`,U.mode)}catch{}ye(U.mode)}function G(e,t){return console.assert(typeof e==`string`&&e.length>0,`chipState requires a RemoteStatus`),console.assert(t===null||typeof t==`boolean`,`unlocked must be boolean | null`),(e===`connected`||e===`connected-direct`||e===`connected-relay`)&&t===!1?`locked`:e}var Se=f(``),K=f(``);function Ce(e,n){y(n,!0);let i=T(()=>G(P.status,L.status?.unlocked??null)),o={connecting:`Remote · connecting…`,verifying:`Remote · verifying Desktop…`,connected:`Remote · connected`,"connected-direct":`Remote · direct (P2P)`,"connected-relay":`Remote · relayed`,reconnecting:`Remote · reconnecting…`,untrusted:`Remote · BLOCKED`,offline:`Remote · unreachable`,locked:`Desktop locked`},s=T(()=>h(i)===`connected-direct`?`ok`:h(i)===`connected-relay`||h(i)===`locked`?`warn`:h(i)===`untrusted`?`bad`:`muted`),c=T(()=>h(i)===`connected-relay`?`Direct wasn't possible, so traffic goes through an encrypted relay that can't read it.`:h(i)===`untrusted`?`Couldn't verify your Desktop's identity — connection blocked. Re-pair if you reinstalled.`:h(i)===`locked`?`Your Desktop is locked. Tap to unlock — the bridge is up, but nothing here works until it's unlocked.`:P.detail);var d=u(),f=g(d),m=e=>{var n=u(),d=g(n),f=e=>{var t=Se(),n=_(t);R(n,{name:`lock`});var u=p(n);S(t),a(()=>{r(t,1,`remote-chip ${h(s)??``}`,`svelte-8oyh7k`),C(t,`title`,h(c)),E(u,` ${o[h(i)]??``}`)}),l(e,t)},m=e=>{var t=K(),n=v(t,!0);a(()=>{r(t,1,`remote-chip ${h(s)??``}`,`svelte-8oyh7k`),C(t,`title`,h(c)),E(n,o[h(i)]??h(i))}),l(e,t)};t(d,e=>{h(i)===`locked`?e(f):e(m,-1)}),l(e,n)};t(f,e=>{h(i)!==`idle`&&h(i)!==`untrusted`&&e(m)}),l(e,d),k()}function q(){return typeof window>`u`?!1:(window.matchMedia?.(`(display-mode: standalone)`)?.matches??!1)||window.navigator.standalone===!0}function J(){return typeof navigator>`u`?!1:/iphone|ipad|ipod|android/i.test(navigator.userAgent)}var we=f(`
`),Te=f(`
Pair this device
On your Desktop: Settings → Remote access → Pair a new phone, then enter the
+import{$ as e,A as t,B as n,C as r,E as i,G as a,J as o,K as s,L as c,M as l,N as u,O as d,P as f,Q as p,R as m,V as h,X as g,Y as _,Z as v,ct as y,dt as b,et as x,ft as S,g as C,h as ee,ht as w,it as T,j as E,m as te,n as ne,r as re,rt as D,s as O,st as k,tt as A,z as j}from"../chunks/BChu7Pos.js";import{t as ie}from"../chunks/Czex3Sq4.js";import"../chunks/xihTtKlq.js";import"../chunks/DETRq8nR.js";import{t as M}from"../chunks/CJLE_wpt.js";import{_ as N,h as ae}from"../chunks/CQMDLFxa.js";import{c as P,n as F,o as oe,r as I,s as se}from"../chunks/BkiVJrb-.js";import{t as L}from"../chunks/DpD1lG2E.js";import{n as ce,t as le}from"../chunks/ChxMyhtI.js";import{n as ue,t as de}from"../chunks/CwN7cGO4.js";import{t as R}from"../chunks/Be3BkmPa.js";import{t as fe}from"../chunks/nF02aZGo.js";import"../chunks/CDAAYzUu.js";import{n as z,r as B,t as pe}from"../chunks/aIySO2My.js";import{t as V}from"../chunks/DQSrham4.js";import{r as me,t as he}from"../chunks/CcVP_dcS.js";import{t as ge}from"../chunks/UDuC8ICI.js";var _e=w({prerender:()=>!1,ssr:()=>!1});function ve(e,t,n){return!e||!t||e===t?`none`:n?`banner`:`reload`}function H(e){return e?`v${e}`:``}var U=e({mode:`system`});function W(){try{let e=localStorage.getItem(`theme`);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function ye(e){let t=document.documentElement;e===`system`?t.removeAttribute(`data-theme`):t.dataset.theme=e}function be(){U.mode=W()}function xe(){U.mode=U.mode===`system`?`light`:U.mode===`light`?`dark`:`system`;try{U.mode===`system`?localStorage.removeItem(`theme`):localStorage.setItem(`theme`,U.mode)}catch{}ye(U.mode)}function G(e,t){return console.assert(typeof e==`string`&&e.length>0,`chipState requires a RemoteStatus`),console.assert(t===null||typeof t==`boolean`,`unlocked must be boolean | null`),(e===`connected`||e===`connected-direct`||e===`connected-relay`)&&t===!1?`locked`:e}var Se=f(``),K=f(``);function Ce(e,n){y(n,!0);let i=T(()=>G(P.status,L.status?.unlocked??null)),o={connecting:`Remote · connecting…`,verifying:`Remote · verifying Desktop…`,connected:`Remote · connected`,"connected-direct":`Remote · direct (P2P)`,"connected-relay":`Remote · relayed`,reconnecting:`Remote · reconnecting…`,untrusted:`Remote · BLOCKED`,offline:`Remote · unreachable`,locked:`Desktop locked`},s=T(()=>h(i)===`connected-direct`?`ok`:h(i)===`connected-relay`||h(i)===`locked`?`warn`:h(i)===`untrusted`?`bad`:`muted`),c=T(()=>h(i)===`connected-relay`?`Direct wasn't possible, so traffic goes through an encrypted relay that can't read it.`:h(i)===`untrusted`?`Couldn't verify your Desktop's identity — connection blocked. Re-pair if you reinstalled.`:h(i)===`locked`?`Your Desktop is locked. Tap to unlock — the bridge is up, but nothing here works until it's unlocked.`:P.detail);var d=u(),f=g(d),m=e=>{var n=u(),d=g(n),f=e=>{var t=Se(),n=_(t);R(n,{name:`lock`});var u=p(n);S(t),a(()=>{r(t,1,`remote-chip ${h(s)??``}`,`svelte-8oyh7k`),C(t,`title`,h(c)),E(u,` ${o[h(i)]??``}`)}),l(e,t)},m=e=>{var t=K(),n=v(t,!0);a(()=>{r(t,1,`remote-chip ${h(s)??``}`,`svelte-8oyh7k`),C(t,`title`,h(c)),E(n,o[h(i)]??h(i))}),l(e,t)};t(d,e=>{h(i)===`locked`?e(f):e(m,-1)}),l(e,n)};t(f,e=>{h(i)!==`idle`&&h(i)!==`untrusted`&&e(m)}),l(e,d),k()}function q(){return typeof window>`u`?!1:(window.matchMedia?.(`(display-mode: standalone)`)?.matches??!1)||window.navigator.standalone===!0}function J(){return typeof navigator>`u`?!1:/iphone|ipad|ipod|android/i.test(navigator.userAgent)}var we=f(`
`),Te=f(`
Pair this device
On your Desktop: Settings → Remote access → Pair a new phone, then enter the
6-character code here.
`,1),Ee=f(`
Set up SmartBrain on your phone
For a reliable, one-tap app that works from anywhere, add SmartBrain to your Home Screen first:
iOS: tap the Share button → Add to Home Screen.
Android: tap the ⋮ menu → Install app (or Add to Home screen).
`,1),De=f(`
Almost there
Open the SmartBrain icon from your Home Screen to finish setting up — you’ll enter a code there.
Remote connection BLOCKED — couldn't verify your Desktop's identity. Re-pair if you reinstalled.
`),Le=f(``),Re=f(``),ze=f(``),Be=f(` Help`),Ve=f(``),He=f(`Couldn’t reach the desktop app to start the install. Open the SmartBrain
icon in your menu bar and choose Install update now. `,1),Ue=f(`SmartBrain is ready to install.
Installing restarts it — under a minute, and you’ll unlock again afterwards. `,1),We=f(``),Ge=f(`
SmartBrain updated to while this page was
open — reload to use the new version.
`),Ke=f(`
Your SmartBrain desktop app needs a one-time update to keep
- updating itself automatically.Download the new appor run brew upgrade --cask smartbrain / scoop update smartbrain
`,1);function $(e,f){y(f,!0);let m=e=>{var n=Me(),r=p(_(n),2),i=p(_(r),2),o=e=>{var t=je(),n=v(t,!0);a(()=>E(n,h(te))),l(e,t)};t(i,e=>{h(te)&&e(o)}),S(r),S(n),l(e,n)},ee=e=>{var n=Fe(),r=g(n),i=_(r);R(i,{name:`help`}),b(),S(r);var o=p(r,2),s=_(o);R(s,{get name(){return Se[U.mode]}}),b(),S(o);var c=p(o,2),u=e=>{var t=Ne(),n=_(t);R(n,{name:`link`}),b(),S(t),j(`click`,t,at),l(e,t)};t(c,e=>{h(B)&&e(u)});var d=p(c,2),f=e=>{var t=Pe(),n=_(t);R(n,{name:`lock`});var r=p(n);S(t),a(()=>{t.disabled=h(w),E(r,` ${h(w)?`Locking…`:`Lock`}`)}),j(`click`,t,ot),l(e,t)},m=T(()=>I(L.status));t(d,e=>{h(m)&&e(f)}),a(()=>{C(o,`title`,`Theme: ${U.mode}`),C(o,`aria-label`,`Theme: ${U.mode}. Click to change.`)}),j(`click`,o,function(...e){xe?.apply(this,e)}),l(e,n)},w=A(!1),te=A(``),D=A(``),O=A(!1),N=A(!1),fe=T(()=>[`/chat`,`/help`,`/ni`].some(e=>M.url.pathname.startsWith(e))),z=[{href:`/chat`,label:`Chat`,icon:`chat`,remote:!0},{href:`/ni`,label:`Neural`,icon:`monitor`,remote:!0},{href:`/knowledge`,label:`Knowledge`,icon:`book`,remote:!0},{href:`/planner`,label:`Planner`,icon:`tasks`,remote:!0},{href:`/schedules`,label:`Schedules`,icon:`clock`,remote:!0},{href:`/email`,label:`Email`,icon:`mail`,remote:!0},{href:`/info`,label:`Info`,icon:`info`,remote:!0},{href:`/activity`,label:`Activity`,icon:`activity`,remote:!0},{href:`/usage`,label:`Usage`,icon:`chart`,remote:!0},{href:`/settings`,label:`Settings`,icon:`sliders`,remote:!1}],B=T(()=>P.status!==`idle`),V=T(()=>h(B)?z.filter(e=>e.remote):z),me=[`/chat`,`/ni`,`/knowledge`,`/info`],he=T(()=>h(V).filter(e=>me.includes(e.href))),_e=T(()=>h(V).filter(e=>!me.includes(e.href))),W=e=>M.url.pathname===e||M.url.pathname.startsWith(e+`/`),ye=typeof localStorage<`u`&&localStorage.getItem(`sbNav`)===`1`,G=T(()=>L.status?I(L.status):ye);s(()=>{L.status&&localStorage.setItem(`sbNav`,I(L.status)?`1`:`0`)});let Se={system:`sun-moon`,light:`sun`,dark:`moon`},K=e=>e===`/activity`&&le.count>0?le.count:e===`/chat`&&ue.count>0?ue.count:0,q=e=>e===`/activity`?`${le.count} awaiting approval`:`${ue.count} new scheduled updates`,J=T(()=>h(_e).reduce((e,t)=>e+K(t.href),0)),we=T(()=>[`/help`,`/pair`].some(e=>M.url.pathname.startsWith(e))),Te=T(()=>!!L.error&&L.status===null&&!h(we)),Ee=T(()=>P.needsPairing&&!h(we)),De=T(()=>P.status===`offline`&&!h(we)&&!h(Ee)),Y=null,X=A(``),Z=A(!1),Q=A(!1);ne(()=>{Y&&clearInterval(Y)}),re(async()=>{be(),se(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&it()}),window.addEventListener(`pageshow`,()=>void it()),await oe(),L.load();try{let e=await F.health();x(te,H(e.version),!0),$=e.version,et(e.update_ready),rt(),x(O,!!e.launcher_update_needed&&sessionStorage.getItem(`launcher-nudge-dismissed`)!==`1`,!0)}catch(e){console.warn(`startup health check failed:`,e)}});let $=``;function et(e){e?localStorage.getItem(`update-dismissed`)!==e&&x(X,e,!0):x(X,``)}async function tt(){x(Z,!0),x(Q,!1);try{await F.installUpdate(),nt()}catch{x(Z,!1),x(Q,!0)}}function nt(){Y&&clearInterval(Y);let e=Date.now()+6e5;Y=setInterval(async()=>{if(Date.now()>e)Y&&clearInterval(Y),Y=null,x(Z,!1),x(Q,!0),rt();else try{let e=await F.health();$&&e.version&&e.version!==$&&location.reload()}catch{}},2e3)}function rt(){Y=setInterval(async()=>{try{let e=await F.health();et(e.update_ready),$&&e.version&&e.version!==$&&(x(D,H(e.version),!0),Y&&clearInterval(Y))}catch{}},6e4)}async function it(e=0){try{let e=await F.health();et(e.update_ready);let t=ve($,e.version??``,!!L.status?.unlocked);t===`reload`?location.reload():t===`banner`&&(x(D,H(e.version),!0),Y&&clearInterval(Y))}catch{e<2&&setTimeout(()=>void it(e+1),4e3)}}s(()=>{let e=M.url.pathname;x(N,!1),I(L.status)&&(ce(),e.startsWith(`/chat`)||de())});async function at(){console.assert(typeof ae==`function`,`clearPairing import missing`),console.assert(typeof pe==`function`,`confirmDialog import missing`),await pe({title:`Unpair device`,body:`You'll need to pair again with a code to use SmartBrain here.`,confirmLabel:`Unpair`,danger:!0})&&(await ae(),window.location.assign(`/`))}async function ot(){x(w,!0);try{await F.lock()}catch{}finally{await L.load(),x(w,!1),ie(`/unlock`)}}var st=$e();n(`keydown`,o,e=>{e.key===`Escape`&&x(N,!1)}),n(`click`,o,e=>{h(N)&&!e.target.closest(`.more-sheet, .tab-more`)&&x(N,!1)});var ct=g(st),lt=e=>{var t=Ie();l(e,t)};t(ct,e=>{P.status===`untrusted`&&e(lt)});var ut=p(ct,2);let dt;var ft=_(ut),pt=e=>{var n=ze(),i=_(n);m(i);var o=p(i,2);d(o,21,()=>h(V),e=>e.href,(e,n)=>{var i=Re();let o;var s=_(i);R(s,{get name(){return h(n).icon}});var c=p(s),u=p(c),d=e=>{var t=Le(),r=v(t,!0);a((e,n)=>{C(t,`title`,e),E(r,n)},[()=>q(h(n).href),()=>K(h(n).href)]),l(e,t)},f=T(()=>K(h(n).href)>0);t(u,e=>{h(f)&&e(d)}),S(i),a((e,t)=>{o=r(i,1,`navitem`,null,o,{active:e}),C(i,`href`,h(n).href),C(i,`aria-current`,t),E(c,` ${h(n).label??``} `)},[()=>W(h(n).href),()=>W(h(n).href)?`page`:void 0]),l(e,i)}),S(o);var s=p(o,2),c=_(s);ee(c),S(s),S(n),l(e,n)};t(ft,e=>{h(G)&&e(pt)});var mt=p(ft,2),ht=_(mt);let gt;var _t=_(ht);m(_t);var vt=p(_t,4),yt=e=>{ge(e,{icon:`shield`,kind:`ok`,title:`Your data is encrypted at rest and never leaves this machine`,children:(e,t)=>{b();var n=c(`Encrypted · On-device`);l(e,n)},$$slots:{default:!0}})};t(vt,e=>{h(G)&&!h(B)&&e(yt)});var bt=p(vt,2);Ce(bt,{});var xt=p(bt,2),St=e=>{var t=Be(),n=_(t);R(n,{name:`help`}),b(),S(t),l(e,t)};t(xt,e=>{h(G)||e(St)}),S(ht);var Ct=p(ht,2);let wt;var Tt=_(Ct),Et=e=>{var n=We(),r=_(n),i=e=>{var t=Ve(),n=v(t);a(e=>E(n,`Installing SmartBrain ${e??``}. It restarts in a moment
and this page will come back on its own.`),[()=>H(h(X))]),l(e,t)},o=e=>{var t=He(),n=p(g(t),2);j(`click`,n,()=>{x(Q,!1),x(X,``)}),l(e,t)},s=e=>{var t=Ue(),n=g(t),r=p(_(n)),i=v(r,!0);b(),S(n);var o=p(n,2),s=p(o,2);a(e=>E(i,e),[()=>H(h(X))]),j(`click`,o,tt),j(`click`,s,()=>{localStorage.setItem(`update-dismissed`,h(X)),x(X,``)}),l(e,t)};t(r,e=>{h(Z)?e(i):h(Q)?e(o,1):e(s,-1)}),S(n),l(e,n)};t(Tt,e=>{h(X)&&!h(D)&&e(Et)});var Dt=p(Tt,2),Ot=e=>{var t=Ge(),n=_(t),r=p(_(n)),i=v(r,!0);b(),S(n);var o=p(n,2),s=p(o,2);S(t),a(()=>E(i,h(D))),j(`click`,o,()=>location.reload()),j(`click`,s,()=>{x(D,``)}),l(e,t)};t(Dt,e=>{h(D)&&e(Ot)});var kt=p(Dt,2),At=e=>{var t=Ke(),n=p(_(t),6);S(t),j(`click`,n,()=>{x(O,!1),sessionStorage.setItem(`launcher-nudge-dismissed`,`1`)}),l(e,t)};t(kt,e=>{h(O)&&e(At)});var jt=p(kt,2),Mt=e=>{Oe(e,{})},Nt=e=>{var t=qe(),n=p(_(t),2),r=v(n,!0),i=p(n,2),o=v(i);b(2),S(t),a(()=>E(r,P.detail||`The remote connection couldn't be established.`)),j(`click`,o,()=>window.location.reload()),l(e,t)},Pt=e=>{var t=Je(),n=p(_(t),2),r=v(n,!0),i=p(n,2),o=v(i);b(2),S(t),a(()=>E(r,L.error)),j(`click`,o,()=>L.load()),l(e,t)},Ft=e=>{var t=u(),n=g(t);i(n,()=>f.children),l(e,t)};t(jt,e=>{h(Ee)?e(Mt):h(De)?e(Nt,1):h(Te)?e(Pt,2):e(Ft,-1)}),S(Ct),S(mt),S(ut);var It=p(ut,2),Lt=e=>{var n=Qe(),i=g(n),o=_(i);d(o,17,()=>h(he),e=>e.href,(e,n)=>{var i=Xe();let o;var s=_(i),c=e=>{var t=Ye(),r=v(t,!0);a((e,n)=>{C(t,`title`,e),E(r,n)},[()=>q(h(n).href),()=>K(h(n).href)]),l(e,t)},u=T(()=>K(h(n).href)>0);t(s,e=>{h(u)&&e(c)});var d=p(s,2);R(d,{get name(){return h(n).icon},size:20});var f=p(d);S(i),a((e,t)=>{o=r(i,1,`tab`,null,o,{active:e}),C(i,`href`,h(n).href),C(i,`aria-current`,t),E(f,` ${h(n).label??``}`)},[()=>W(h(n).href),()=>W(h(n).href)?`page`:void 0]),l(e,i)});var s=p(o,2),c=_(s),u=e=>{var t=Ye(),n=v(t,!0);a(()=>{C(t,`title`,`${h(J)} waiting`),E(n,h(J))}),l(e,t)};t(c,e=>{h(J)>0&&e(u)});var f=p(c,2);R(f,{name:`more-horizontal`,size:20}),b(),S(s),S(i);var m=p(i,2),y=e=>{var n=Ze(),i=_(n);d(i,17,()=>h(_e),e=>e.href,(e,n)=>{var i=Re();let o;var s=_(i);R(s,{get name(){return h(n).icon}});var c=p(s),u=p(c),d=e=>{var t=Le(),r=v(t,!0);a((e,n)=>{C(t,`title`,e),E(r,n)},[()=>q(h(n).href),()=>K(h(n).href)]),l(e,t)},f=T(()=>K(h(n).href)>0);t(u,e=>{h(f)&&e(d)}),S(i),a(e=>{o=r(i,1,`navitem`,null,o,{active:e}),C(i,`href`,h(n).href),E(c,` ${h(n).label??``} `)},[()=>W(h(n).href)]),l(e,i)});var o=p(i,4);ee(o),S(n),l(e,n)};t(m,e=>{h(N)&&e(y)}),a(()=>C(s,`aria-expanded`,h(N))),j(`click`,s,()=>x(N,!h(N))),l(e,n)};t(It,e=>{h(G)&&e(Lt)});var Rt=p(It,2);ke(Rt,{}),Ae(p(Rt,2),{}),a(()=>{dt=r(ut,1,`shell`,null,dt,{"with-side":h(G)}),gt=r(ht,1,`topstrip`,null,gt,{"no-side":!h(G)}),wt=r(Ct,1,``,null,wt,{wrap:!h(fe),"wrap-wide":h(fe)})}),l(e,st),k()}m([`click`]);export{$ as component,_e as universal};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/1.CS-bGd13.js b/app/smartbrain_3000/web/_app/immutable/nodes/1.C7xJmJkE.js
similarity index 63%
rename from app/smartbrain_3000/web/_app/immutable/nodes/1.CS-bGd13.js
rename to app/smartbrain_3000/web/_app/immutable/nodes/1.C7xJmJkE.js
index 65135225..a53ad862 100644
--- a/app/smartbrain_3000/web/_app/immutable/nodes/1.CS-bGd13.js
+++ b/app/smartbrain_3000/web/_app/immutable/nodes/1.C7xJmJkE.js
@@ -1 +1 @@
-import{G as e,M as t,P as n,Q as r,X as i,Z as a,ct as o,j as s,st as c}from"../chunks/BJLLtWYH.js";import"../chunks/xihTtKlq.js";import{t as l}from"../chunks/CLNxzSSl.js";var u=n(`
`,1);function d(n,d){o(d,!0);var f=u(),p=i(f),m=a(p,!0),h=r(p,2),g=a(h,!0);e(()=>{s(m,l.status),s(g,l.error?.message)}),t(n,f),c()}export{d as component};
\ No newline at end of file
+import{G as e,M as t,P as n,Q as r,X as i,Z as a,ct as o,j as s,st as c}from"../chunks/BChu7Pos.js";import"../chunks/xihTtKlq.js";import{t as l}from"../chunks/CJLE_wpt.js";var u=n(`
`,1);function d(n,d){o(d,!0);var f=u(),p=i(f),m=a(p,!0),h=r(p,2),g=a(h,!0);e(()=>{s(m,l.status),s(g,l.error?.message)}),t(n,f),c()}export{d as component};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/10.BoqtT515.js b/app/smartbrain_3000/web/_app/immutable/nodes/10.BoqtT515.js
new file mode 100644
index 00000000..3c65fda9
--- /dev/null
+++ b/app/smartbrain_3000/web/_app/immutable/nodes/10.BoqtT515.js
@@ -0,0 +1,17 @@
+import{$ as e,A as t,B as n,C as r,E as i,F as a,G as o,I as s,J as c,K as l,L as u,M as d,N as f,O as p,P as m,Q as h,R as g,S as _,V as v,X as y,Y as b,Z as x,a as S,at as C,b as w,ct as T,d as E,dt as D,et as O,ft as k,g as A,h as j,it as M,j as N,k as P,l as ee,m as F,n as te,pt as I,r as L,st as ne,tt as R,u as re,w as z,y as ie,z as B}from"../chunks/BChu7Pos.js";import{t as ae}from"../chunks/Czex3Sq4.js";import"../chunks/xihTtKlq.js";import"../chunks/DETRq8nR.js";import{n as V}from"../chunks/BkiVJrb-.js";import{t as H}from"../chunks/DpD1lG2E.js";import{n as oe,t as se}from"../chunks/Be3BkmPa.js";import{t as ce}from"../chunks/aIySO2My.js";import{t as le}from"../chunks/DQSrham4.js";import{n as U}from"../chunks/CcVP_dcS.js";import{t as ue}from"../chunks/UDuC8ICI.js";import{t as de}from"../chunks/Bmlx8Ynu.js";import{t as W}from"../chunks/Di_L0eC6.js";import{t as fe}from"../chunks/itGxqfLQ.js";import{i as pe,r as me}from"../chunks/jV_dy7U_.js";var he=6e4,ge=60*he,G=24*ge;function _e(e,t=new Date){console.assert(e===null||typeof e==`string`,`relTime: ts is string|null`),console.assert(t instanceof Date,`relTime: now must be a Date`);let n=me(e);if(!n)return`—`;let r=t.getTime()-n.getTime();return r<0||r<45e3?`just now`:r2*i}function ye(e){if(console.assert(typeof e.state==`string`,`cardState: state is string`),console.assert(typeof e.enabled==`boolean`,`cardState: enabled is boolean`),e.flow||e.state===`draft`)return`designing`;if(!e.enabled||e.state===`paused`)return`paused`;if(e.state===`broken`)return`broken`;if(e.state===`commissioning`){let t=e.awaiting_yes!=null||e.payload_slot!==`preview`;return e.payload!==null&&t?`verifying`:`empty`}return e.payload===null?`empty`:e.state===`failing`||e.state===`degraded`?`failing`:ve(e.payload_at,e.interval_minutes)?`stale`:`fresh`}function be(e){console.assert(typeof e.interval_minutes==`number`,`footerText: interval is number`),console.assert(e.payload_at===null||typeof e.payload_at==`string`,`footerText: payload_at shape`);let t=me(e.payload_at);return[t?`as of ${new Intl.DateTimeFormat(void 0,{timeStyle:`short`}).format(t)}`:`as of —`,e.awaiting_yes?.host??``,`every ${Math.max(1,e.interval_minutes)}m`].filter(e=>e.length>0).join(` · `)}function xe(e){console.assert(typeof e.id==`string`,`interpretationOf: a board row`);let t=e.interpretation,n=typeof t==`string`&&t.trim().length>0?t:``;return console.assert(n===``||n===t,`interpretationOf: verbatim or empty`),n}function Se(e,t){console.assert(e===void 0||typeof e==`string`,`cardSpan: size is a string or undefined`),console.assert(t==null||typeof t==`object`,`cardSpan: clir is an object or null`);let n=t&&typeof t==`object`?t.span:void 0,r=typeof n==`string`?/^[dp]([1-4])x([1-3])$/.exec(n):null;if(r)return{cols:Number(r[1])>=2?2:1,rows:Number(r[2])};switch(e){case`wide`:return{cols:2,rows:1};case`large`:return{cols:2,rows:2};case`tall`:return{cols:1,rows:2};default:return{cols:1,rows:1}}}function Ce(e,t){return console.assert(typeof e.state==`string`,`bodyShowsPanel: state is string`),console.assert(typeof t==`boolean`,`bodyShowsPanel: hasForm is boolean`),!t||e.flow||e.awaiting_yes&&e.payload||e.state!==`commissioning`||e.c2_ok?!1:e.payload!==null&&e.payload_slot!==`preview`}function we(e,t,n=``){return console.assert(typeof t==`boolean`,`formBoxChrome: hasForm is boolean`),console.assert(typeof e==`string`,`formBoxChrome: state is string`),t&&n===``&&(e===`fresh`||e===`stale`||e===`paused`)}var Te=m(``),Ee=m(``),De=m(``),K=m(``),Oe=m(`
Pages that may help — SmartBrain can't keep a live card from these yet:
`,1),ma=m(`
`),ha=m(`
`),ga=m(`Get one here,
+ then paste it below.`,1),_a=m(`
`,1),va=m(`
`,1),ya=m(`
`),ba=m(``),xa=m(`
First run failed —
`),Sa=m(`
Waiting for the first run…
`),Ca=m(` `,1),wa=m(``),Ta=m(`
`),Ea=m(`
Refine…
Say what should change — units, a filter, an update schedule, or
+ "different source". The card rebuilds from your note.
`,1),Da=m(`
Something’s wrong
Say what looked off — the card rebuilds from your note (units, filters, fields), or returns to draft if it can’t.
`,1),Oa=m(`
Apply library update?
The library fixed or changed this card’s template. Applying resets to a draft for your review and re-activation.
+ Your parameter values and credentials carry over.
`,1),ka=m(`
Couldn’t load this proposal.
`),Aa=m(`
Current mapping
extract
transform
Proposed mapping
extract
transform
`),ja=m(`
A proposed fix from Claude
Your card kept failing, so (with your per-card permission) Claude proposed new
+ data mappings. Nothing has been applied. Applying runs it as a trial — kept only
+ if the next refresh passes this card’s validated contract, automatically reverted
+ otherwise.
`,1),Ma=m(`
`),Na=m(`
When a card keeps failing, SmartBrain can try to fix it. Local repair only
+ touches your own machine. Frontier repair sends this card’s goal, data
+ mappings, and failure details to Anthropic under your Claude sign-in — only
+ after local repair fails, and fixes are always proposed for your review,
+ never applied.
`,1),Pa=m(`
`,1),Fa=m(` `,1),Ia=m(`
Keys are stored on this computer only and used exactly for this card’s source
+ (host-bound). If you type them elsewhere, they won’t work.
`,1),La=m(`
This card needs a value before it can run. It becomes part of the card’s
+ source and shows up in its address.
`,1),Ra=m(`
`,1),za=m(`
No runs recorded yet.
`),Ba=m(``),Va=m(`
`),Ha=m(`
`),Ua=m(`
`,1),Wa=m(`
The library publisher’s key changed — updates are blocked.
Pinned (trusted)
Offered (new)
This is either the publisher rotating their key — or someone impersonating them. Verify
+ the offered fingerprint with the publisher out-of-band before trusting it.
`),Ga=m(`
Templates the SmartBrain project curates — one connect, then install any of them as a
+ draft card. The publisher key is pinned on first fetch (TOFU).
`,1),Ka=m(`
`),qa=m(`
— credential — you’ll add it on the card after install.
`),Ja=m(``),Ya=m(`
Fill in:
`,1),Xa=m(`
This card will fetch:
Preview
`,1),Za=m(``),Qa=m(`
`),$a=m(`
The library host has been unreachable for a while — checks are paused. Check now to retry.
`),eo=m(``),to=m(``),no=m(`
No templates match that search.
`),ro=m(`
`),io=m(`
Fetches from:
`),ao=m(`
`),oo=m(`
`,1),so=m(`
Global Library
`,1),co=m(`
Neural Interface
Live data you asked for, on one board. Type it below — “show me AAPL every 5 minutes”.
`,1);function lo(i,a){T(a,!0);let s=R(e([])),m=R(!1),g=R(``),_=R(null),S=R(!1),I=null,re=0,oe=R(null),me=R(``),he=`https://smartbrain.securecloudgroup.com/ni/library.json`,ge=R(!1),G=R(null),Te=R(!1),Ee=R(``),De=R(he),K=R(!1),Oe=R(``),ke=R(``),Ae=R(null),je=R(e({})),Me=R(!1),Ne=R(``),Pe=R(``),Fe=R(``),Le=R(!1),Re=R(``),ze=R(null),Ve=R(!1),He=R(null),Ue=R(null),We=R(!1),Ge=R(!1),Ke=M(()=>v(Ue)?ji(v(Ue).spec):{extract:null,transform:null}),qe=M(()=>qt(v(Ue))),Je=R(null),Ye=R(null),Xe=R(!1),Ze=R(!1),Qe=R(``),$e=R(!0),et=R(!1),q=R(null),J=R(``),tt=R(``),Y=R(``),X=R(``),nt=R(!1),Z=R(!1),rt=R(``),it=R(``),at=R(``),ot=R(``),st=R(null),ct=R(``),lt=R(``),ut=R(!1),dt=R(``),ft=R(null),pt=R(``),mt=R(!1);function ht(e){console.assert(v(ft)===null,`openRefine: one at a time`),O(ft,e,!0),O(pt,``)}async function gt(){if(!v(ft)||v(mt))return;let e=v(ft),t=v(pt).trim();if(!(t.length<3)){O(mt,!0);try{let n=await V.niRefine(e.id,t);O(ft,null),O(pt,``),U(n.kind===`cadence`?`Update schedule changed.`:n.kind===`source_change`?`Okay — pick a new source on the card.`:`Rebuilding the card from your note.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(mt,!1)}}}let Q=R(e({})),_t=R(``);async function vt(e,t){console.assert(e.flow?.state===`source`,`pickSource: pause required`);let n=(t??v(it)).trim();if(!(n.length<8)){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let r=await V.niFlowPickSource(e.id,n,t===void 0);O(it,``),U(r.needs&&r.needs.length>0?`This source needs one more thing — see the card.`:r.started===!1?`Source set — it starts as soon as a build slot frees up.`:`Source set — sampling it now.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t work — check the URL.`},!0)}finally{O(_,null)}}}async function yt(e){console.assert(e.flow?.state===`awaiting_access`,`giveAccess: pause required`);let t=e.flow?.access;if(!t)return;let n=v(at).trim(),r=v(ot).trim();if(!(t.key&&!n||t.contact&&!r)){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let i=await V.niFlowAccess(e.id,t.key?n:void 0,t.contact?r:void 0);O(at,``),O(ot,``),U(i.started?`Thanks — building the card now.`:`Saved.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t work — try again.`},!0)}finally{O(_,null)}}}async function bt(e){console.assert(typeof e.id==`string`,`answerDate: id required`);let t=v(_t).trim();if(t){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowAnswer(e.id,`supply_date`,t),O(_t,``),U(`Date set — building the card.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That date didn’t work — use YYYY-MM-DD.`},!0)}finally{O(_,null)}}}async function xt(e,t){console.assert(typeof e.id==`string`,`answerConsent: id required`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowAnswer(e.id,`model_consent`,t),U(t===`allow`?`Building the card.`:`Building the card on your local model.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function St(e){console.assert(typeof e.id==`string`,`reopenPick: id required`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowReopen(e.id),U(`Okay — pick a source below.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`Couldn’t reopen the pick.`},!0)}finally{O(_,null)}}function Ct(e){let t=e.target;for(let e of document.querySelectorAll(`details.ni-more[open]`))(!t||!e.contains(t)||t.closest(`.ni-more-menu`))&&(e.open=!1)}async function wt(e){O(_,e.id,!0);try{await V.niFlowFix(e.id),U(`Fixing — re-reading the card's source.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}function Tt(e){console.assert(v(st)===null,`openEdit: no other edit open`),O(st,e,!0),O(ct,e.title,!0),O(lt,String(e.interval_minutes),!0),O(dt,``)}function Et(){console.assert(v(ut)===!1,`closeEdit: not while saving`),O(st,null),O(ct,``),O(lt,``),O(dt,``)}async function Dt(){console.assert(v(st)!==null,`submitEdit: target required`);let e=v(st);if(!e||v(ut))return;let t=v(ct).trim(),n=parseInt(v(lt),10);if(!t||!Number.isFinite(n)||n<1)O(dt,`A name and a cadence of at least 1 minute are required.`);else{O(ut,!0),O(dt,``);try{await V.niPatch(e.id,{title:t,interval_minutes:n}),Et(),U(`Card updated.`),await $()}catch(e){O(dt,W(e),!0)}finally{O(ut,!1)}}}let Ot=R(``),kt=R(!1),At=R(``),jt=R(void 0);async function Mt(){console.assert(v(kt)===!1,`submitComposer: no concurrent submit`);let e=v(Ot).trim();if(!(e.length<3||v(kt))){O(kt,!0),O(At,``);try{let t=await V.niIntake(e);O(Ot,``),U(t.started===!1?`Card created — it starts as soon as a build slot frees up.`:`Card started — watch it build below.`),await $()}catch(e){O(At,W(e),!0)}finally{O(kt,!1)}}}async function Nt(e){console.assert(typeof e.id==`string`,`retryFlow: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let t=await V.niFlowRetry(e.id);U(t.started===!1?`Retry queued — it starts as soon as a build slot frees up.`:`Retrying the card build.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}let Pt=R(null),Ft=R(``),It=R(``),Lt=R(``),Rt=R(!1),zt=R(``),Bt=R(null),Vt=R(null),Ht=R(!1),Ut=R(``),Wt=M(()=>v(G)?.templates?Ti(v(G).templates,v(Oe),v(ke)):[]),Gt=M(()=>v(G)?.templates?Ei(v(G).templates):[]),Kt=M(()=>v(Ae)?Di(v(Ae).params,v(je)):null);function qt(e){if(console.assert(e===null||typeof e==`object`,`readProposedStages: detail is object|null`),console.assert(e===null||e.spec!==void 0,`readProposedStages: spec present when detail present`),!e)return{extract:null,transform:null};let t=e.spec._l2_proposal;if(!t||typeof t!=`object`||Array.isArray(t))return{extract:null,transform:null};let n=t.stages;if(!n||typeof n!=`object`||Array.isArray(n))return{extract:null,transform:null};let r=n;return{extract:r.extract&&typeof r.extract==`object`&&!Array.isArray(r.extract)?r.extract:null,transform:Array.isArray(r.transform)?r.transform:null}}async function Jt(){if(console.assert(typeof V.niLibrary==`function`,`openLibrary: niLibrary present`),console.assert(v(ge)===!1||v(ge)===!0,`openLibrary: libraryOpen boolean`),O(ge,!0),O(Ee,``),v(G)===null){O(Te,!0);try{O(G,await V.niLibrary(),!0),v(G).url&&O(De,v(G).url,!0)}catch(e){O(Ee,W(e),!0)}finally{O(Te,!1)}}}function Yt(){console.assert(v(K)===!1,`closeLibrary: never close while a request is in flight`),console.assert(v(Me)===!1,`closeLibrary: never close mid-install`),O(ge,!1),O(Oe,``),O(ke,``),O(Ae,null),O(je,{},!0),O(Ne,``),O(Pe,``),O(Fe,``),O(Re,``),O(Ee,``)}async function Xt(){console.assert(typeof v(De)==`string`,`connectLibrary: url is string`),console.assert(v(K)===!1,`connectLibrary: no concurrent request`);let e=v(De).trim();if(e&&!v(K)){O(K,!0),O(Ee,``);try{O(G,await V.niLibraryConnect(e),!0)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function Zt(){if(console.assert(v(G)?.connected===!0,`checkLibraryNow: only when connected`),console.assert(v(K)===!1,`checkLibraryNow: no concurrent request`),!v(K)){O(K,!0),O(Ee,``);try{O(G,await V.niLibraryCheck(),!0)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function Qt(){if(console.assert(v(G)?.connected===!0,`disconnectLibrary: only when connected`),console.assert(v(K)===!1,`disconnectLibrary: no concurrent request`),await ce({title:`Disconnect from this library?`,body:`Templates you already installed as items stay on your board. You can reconnect any time.`,confirmLabel:`Disconnect`,danger:!0})){O(K,!0),O(Ee,``);try{await V.niLibraryDisconnect(),O(G,{connected:!1},!0),O(Oe,``),O(ke,``)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function $t(){console.assert(!!v(G)?.blocked,`trustLibraryKey: only while blocked`),console.assert(typeof v(Fe)==`string`,`trustLibraryKey: passphrase is string`);let e=v(G)?.blocked?.offered_fingerprint;if(e&&v(Fe)&&!v(Le)){O(Le,!0),O(Re,``);try{O(G,await V.niLibraryTrustKey(e,v(Fe)),!0),O(Fe,``)}catch(e){O(Re,W(e),!0)}finally{O(Le,!1)}}}function en(e){console.assert(typeof e.id==`string`,`startInstall: template id is string`),console.assert(Array.isArray(e.params),`startInstall: params is array`),O(Ae,e,!0),O(je,{},!0),O(Ne,``),O(Pe,``)}function tn(){console.assert(v(Me)===!1,`cancelInstall: not while installing`),console.assert(typeof v(Ne)==`string`,`cancelInstall: installError is string`),O(Ae,null),O(je,{},!0),O(Ne,``)}async function nn(){console.assert(v(Ae)!==null,`submitInstall: template picked`),console.assert(v(Me)===!1,`submitInstall: no concurrent install`);let e=v(Ae);if(!e||v(Me))return;let t=Di(e.params,v(je));if(t)O(Ne,t.message,!0);else{O(Me,!0),O(Ne,``);try{let t=Oi(e.params,v(je)),n=(await V.niLibraryInstall(e.id,t)).needs_credentials?.length?` (credentials still needed)`:``;O(Pe,`Added as a draft — open its card to add credentials and Activate.${n}`),O(Ae,null),O(je,{},!0),await $()}catch(e){O(Ne,W(e),!0)}finally{O(Me,!1)}}}function rn(e){console.assert(e.template_update===!0,`openTemplateUpdate: chip must be present`),console.assert(v(ze)===null,`openTemplateUpdate: no other update prompt open`),O(ze,e,!0)}async function an(){console.assert(v(ze)!==null,`applyTemplateUpdate: target must be set`),console.assert(v(Ve)===!1,`applyTemplateUpdate: no concurrent apply`);let e=v(ze);if(e&&!v(Ve)){O(Ve,!0),O(_,e.id,!0);try{await V.niApplyTemplateUpdate(e.id),O(ze,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ve,!1),O(_,null)}}}function on(e){console.assert(e===null||typeof e==`object`,`readRepairPolicy: detail is object|null`),console.assert(e===null||e.spec!==void 0,`readRepairPolicy: spec present when detail present`);let t={l1:!0,l2_frontier:!1};if(!e)return t;let n=e.spec.repair_policy;if(!n||typeof n!=`object`||Array.isArray(n))return t;let r=n;return{l1:typeof r.l1==`boolean`?r.l1:t.l1,l2_frontier:typeof r.l2_frontier==`boolean`?r.l2_frontier:t.l2_frontier}}async function sn(e){console.assert(typeof e.id==`string`,`openRepair: id is string`),console.assert(v(Je)===null,`openRepair: no other repair modal open`),O(Je,e,!0),O(Ye,null),O(Qe,``),O(Xe,!0);try{O(Ye,await V.niItem(e.id),!0);let t=on(v(Ye));O($e,t.l1,!0),O(et,t.l2_frontier,!0)}catch(e){O(Qe,W(e),!0)}finally{O(Xe,!1)}}function cn(){console.assert(v(Ze)===!1,`closeRepair: not while save in flight`),console.assert(typeof v(Xe)==`boolean`,`closeRepair: repairLoading is boolean`),O(Je,null),O(Ye,null),O(Qe,``)}async function ln(){console.assert(v(Je)!==null,`saveRepair: a target must be set`),console.assert(v(Ze)===!1,`saveRepair: no concurrent save`);let e=v(Je);if(e&&!v(Ze)){O(Ze,!0),O(Qe,``);try{await V.niRepairPolicy(e.id,{l1:v($e),l2_frontier:v(et)}),O(Je,null),O(Ye,null)}catch(e){O(Qe,W(e),!0)}finally{O(Ze,!1)}}}async function un(e){console.assert(e.l2_proposal===!0,`openProposal: chip must be present`),console.assert(v(He)===null,`openProposal: no other proposal open`),O(He,e,!0),O(Ue,null),O(We,!0);try{O(Ue,await V.niItem(e.id),!0)}catch(e){let t=W(e);t&&O(g,t,!0),O(He,null)}finally{O(We,!1)}}function dn(){console.assert(v(Ge)===!1,`closeProposal: not while apply/dismiss in flight`),console.assert(typeof v(We)==`boolean`,`closeProposal: proposalLoading is boolean`),O(He,null),O(Ue,null)}async function fn(){console.assert(v(He)!==null,`applyProposal: a target must be set`),console.assert(v(Ge)===!1,`applyProposal: no concurrent apply`);let e=v(He);if(e&&!v(Ge)){O(Ge,!0),O(_,e.id,!0);try{await V.niL2Apply(e.id),O(He,null),O(Ue,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ge,!1),O(_,null)}}}async function pn(){console.assert(v(He)!==null,`dismissProposal: a target must be set`),console.assert(v(Ge)===!1,`dismissProposal: no concurrent dismiss`);let e=v(He);if(e&&!v(Ge)&&await ce({title:`Dismiss proposed fix?`,body:`Dismiss this proposed fix? It won't be offered again for this breakage.`,confirmLabel:`Dismiss`,danger:!0})){O(Ge,!0),O(_,e.id,!0);try{await V.niL2Dismiss(e.id),O(He,null),O(Ue,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ge,!1),O(_,null)}}}function mn(e){if(console.assert(e===null||typeof e==`object`,`hostFromSpec: detail is object|null`),console.assert(e===null||typeof e.spec==`object`,`hostFromSpec: spec present when detail present`),!e)return``;let t=e.spec.source;if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t.url;if(typeof n!=`string`||n.length===0)return``;try{return new URL(n).hostname}catch{return``}}function hn(e){if(console.assert(typeof e.state==`string`,`firstRunFailure: state is string`),console.assert(typeof e.consecutive_failures==`number`,`firstRunFailure: failures is number`),e.state!==`commissioning`&&e.state!==`live`&&e.state!==`degraded`&&e.state!==`failing`||e.payload!==null||e.consecutive_failures<=0)return{show:!1,friendly:``,raw:``,attempts:0,tried:``};let t=typeof e.last_status==`string`?e.last_status:``;return{show:!0,friendly:yi(t),raw:t,attempts:e.consecutive_failures,tried:_e(e.last_checked)}}async function gn(e,t){console.assert(typeof t.name==`string`,`openCredential: name is string`),console.assert(v(q)===null,`openCredential: no other credential modal open`),O(q,e,!0),O(J,t.name,!0),O(tt,t.label,!0),O(Y,``),O(X,``),O(rt,``),O(nt,!0);try{let t=await V.niItem(e.id);O(X,mn(t),!0)}catch(e){O(rt,W(e),!0)}finally{O(nt,!1)}}function _n(){console.assert(v(Z)===!1,`closeCredential: not while save in flight`),console.assert(typeof v(Y)==`string`,`closeCredential: value is string`),O(q,null),O(J,``),O(tt,``),O(Y,``),O(X,``),O(rt,``)}async function vn(){console.assert(v(q)!==null,`submitCredential: a target must be set`),console.assert(v(Z)===!1,`submitCredential: no concurrent save`);let e=v(q),t=v(Y),n=v(X).trim();if(e&&t&&n&&!v(Z)){O(Z,!0),O(rt,``);try{await V.niPutCredential(e.id,v(J),t,n);let r=v(tt);_n(),U(`Saved the ${r} key.`),await $()}catch(e){O(rt,W(e),!0)}finally{O(Z,!1)}}}function yn(e,t){console.assert(typeof t.name==`string`,`openParam: name is string`),console.assert(v(Pt)===null,`openParam: no other param modal open`),O(Pt,e,!0),O(Ft,t.name,!0),O(It,t.label,!0),O(Lt,``),O(zt,``)}function bn(){console.assert(v(Rt)===!1,`closeParam: not while save in flight`),O(Pt,null),O(Ft,``),O(It,``),O(Lt,``),O(zt,``)}async function xn(){console.assert(v(Pt)!==null,`submitParam: a target must be set`),console.assert(v(Rt)===!1,`submitParam: no concurrent save`);let e=v(Pt),t=v(Lt).trim();if(e&&t&&!v(Rt)){O(Rt,!0),O(zt,``);try{await V.niPutParam(e.id,v(Ft),t);let n=v(It);bn(),U(`Saved ${n}.`),await $()}catch(e){O(zt,W(e),!0)}finally{O(Rt,!1)}}}async function Cn(e){console.assert(typeof e.id==`string`,`openHistory: id is string`),console.assert(v(Bt)===null,`openHistory: no other history modal open`),O(Bt,e,!0),O(Vt,null),O(Ut,``),O(Ht,!0);try{O(Vt,await V.niItem(e.id),!0)}catch(e){O(Ut,W(e),!0)}finally{O(Ht,!1)}}function wn(){console.assert(typeof v(Ht)==`boolean`,`closeHistory: loading is boolean`),console.assert(v(Bt)===null||v(Bt)!==void 0,`closeHistory: target shape`),O(Bt,null),O(Vt,null),O(Ut,``)}async function $(){if(console.assert(typeof V.niBoard==`function`,`load: niBoard method present`),console.assert(Array.isArray(v(s)),`load: items array`),!H.status?.unlocked)return;let e=++re;try{let t=await V.niBoard();if(e!==re)return;O(s,[...t.items].sort((e,t)=>e.position-t.position),!0),O(g,``)}catch(t){if(e!==re)return;let n=W(t);n&&O(g,n,!0)}finally{e===re&&O(m,!0)}}function Tn(){console.assert(typeof document<`u`,`onVisible: DOM available`),console.assert(document.visibilityState!==void 0,`onVisible: visibilityState present`),document.visibilityState===`visible`&&$()}L(async()=>{H.status===null&&await H.load();let e=H.status;if(e&&!e.initialized)return ae(`/setup`);if(e&&!e.unlocked)return ae(`/unlock`);$(),I=setInterval(()=>{document.visibilityState===`visible`&&$()},1e4),document.addEventListener(`visibilitychange`,Tn),typeof location<`u`&&location.hash===`#templates`&&(history.replaceState(null,``,location.pathname+location.search),Jt())}),te(()=>{I&&clearInterval(I),document.removeEventListener(`visibilitychange`,Tn)}),l(()=>{console.assert(H.status?.unlocked!==void 0||H.status===null,`$effect: unlocked accessed`),console.assert(re>=0,`$effect: gen counter present`),H.status?.unlocked&&$()}),l(()=>{if(console.assert(Array.isArray(v(s)),`$effect fast-poll: items array`),console.assert(typeof xi==`function`,`$effect fast-poll: helper present`),!v(s).some(e=>xi(e.flow??null)))return;let e=setInterval(()=>{document.visibilityState===`visible`&&$()},3e3);return()=>clearInterval(e)});function En(e){console.assert(typeof e.state==`string`,`healthChip: state is string`),console.assert(typeof e.interval_minutes==`number`,`healthChip: interval is number`);let t=e.state;return t===`draft`?{kind:``,label:`Preview`}:t===`commissioning`&&e.awaiting_yes?{kind:`accent`,label:`Needs your OK`}:t===`commissioning`?{kind:`accent`,label:`Commissioning`}:t===`broken`?{kind:`danger`,label:`Broken`}:t===`failing`?{kind:`warn`,label:`Failing`}:t===`degraded`?{kind:`warn`,label:`Degraded`}:t===`paused`?{kind:``,label:`Paused`}:ve(e.payload_at,e.interval_minutes)?{kind:`warn`,label:`Stale`}:{kind:`ok`,label:`Live`}}async function Dn(e){console.assert(typeof e.id==`string`,`runNow: id is string`),console.assert(v(_)===null||v(_)===e.id,`runNow: busy id matches or null`),O(_,e.id,!0);try{let t=await V.niRun(e.id),n=Kr(t);n?U(qr(n)):t.status===`error`&&O(g,t.kind?`Run failed (${t.kind}).`:`Run failed.`,!0),await $()}catch(e){let t=Gr(e);if(t)U(qr(t));else{let t=W(e);t&&O(g,t,!0)}}finally{O(_,null)}}async function On(e){console.assert(typeof e.id==`string`,`togglePause: id is string`),console.assert(typeof e.enabled==`boolean`,`togglePause: enabled is boolean`),O(_,e.id,!0);try{await V.niPatch(e.id,{enabled:!e.enabled}),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function kn(e){if(console.assert(typeof e.id==`string`,`remove: id is string`),console.assert(typeof e.title==`string`,`remove: title is string`),await ce({title:`Delete this item?`,body:`Delete “${e.title}” from your Neural Interface? Its history is removed too.`,confirmLabel:`Delete`,danger:!0})){O(_,e.id,!0);try{await V.niDelete(e.id),O(s,v(s).filter(t=>t.id!==e.id),!0)}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}}async function An(e){console.assert(e.state===`draft`,`activate: only drafts`),console.assert(typeof e.id==`string`,`activate: id is string`),O(_,e.id,!0);try{await V.niCommission(e.id),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function jn(e){console.assert(e.draft?.reason===`render_sites`,`activateSites: a draft waiting for its sites`),console.assert(typeof e.id==`string`,`activateSites: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niActivate(e.id),U(`Activated — check the card's reading.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function Mn(e,t){console.assert(Hr(e).some(e=>e.url===t),`switchFeed: one of the card's feeds`),console.assert(typeof e.id==`string`,`switchFeed: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let n=await V.niSwitchFeed(e.id,t);U(n.started===!1?`Switching to the feed — it starts as soon as a build slot frees up.`:`Switching to the feed — rebuilding the card from it.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function Nn(e,t){console.assert(e.state===`commissioning`,`validateLooksRight: only commissioning`),console.assert(typeof e.id==`string`,`validateLooksRight: id is string`),O(_,e.id,!0);try{let n=await V.niValidate(e.id,!0,void 0,t);U(Jr(Kr(n))||(n.state===`live`?`Confirmed — the card is live.`:`Confirmed — verifying with a fresh refresh.`)),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function Pn(e){console.assert(e.state===`commissioning`,`declineReading: only commissioning`),console.assert(!!e.awaiting_yes,`declineReading: only a card awaiting the user's YES`),O(_,e.id,!0);try{let t=await V.niValidate(e.id,!1);U(t.repick===`repick`?`Pick another source — that one won't be offered again.`:`Looking for another source…`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}function Fn(e){console.assert(e.state===`commissioning`,`openWrongNote: only commissioning`),console.assert(v(oe)===null,`openWrongNote: no other note prompt open`),O(oe,e,!0),O(me,``)}async function In(){if(console.assert(v(oe)!==null,`submitWrongNote: a target must be set`),console.assert(typeof v(me)==`string`,`submitWrongNote: note is string`),!v(oe)||v(S))return;let e=v(oe);O(_,e.id,!0),O(S,!0);try{await V.niValidate(e.id,!1,v(me).trim()||void 0),O(oe,null),O(me,``),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null),O(S,!1)}}let Ln=R(!1),Rn=typeof window<`u`?window.matchMedia(`(max-width: 560px)`):null;function zn(){O(Ln,Rn?.matches??!1,!0)}L(()=>(zn(),Rn?.addEventListener(`change`,zn),()=>Rn?.removeEventListener(`change`,zn)));let Bn=(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}})();function Vn(e){if(console.assert(e!==void 0,`pickClir: payload defined`),console.assert(typeof v(Ln)==`boolean`,`pickClir: phoneLayout boolean`),!e||typeof e!=`object`)return null;let t=e;if(t.type!==`form`||!t.clir||typeof t.clir!=`object`)return null;let n=t.clir;return v(Ln)?n.phone??n.desktop??null:n.desktop??n.phone??null}var Hn=f();n(`click`,c,Ct);var Un=y(Hn),Wn=e=>{var i=co(),a=y(i),c=h(b(a),2);k(a);var l=h(a,4),T=b(l);j(T),ee(T,e=>O(jt,e),()=>v(jt));var te=h(T,2),I=x(te,!0);k(l);var L=h(l,2),ne=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(At))),d(e,t)};t(L,e=>{v(At)&&e(ne)});var R=h(L,2),re=e=>{de(e,{block:!0})},V=e=>{fe(e,{icon:`monitor`,title:`Nothing on your Neural Interface yet`,body:`Type what you want to watch in the box above — “show me AAPL every 5 minutes” — then approve the source on the card.`,children:(e,t)=>{var n=Pi();B(`click`,n,()=>v(jt)?.focus()),d(e,n)},$$slots:{default:!0}})},H=e=>{var i=wa();p(i,21,()=>v(s),e=>e.id,(e,i)=>{let a=M(()=>En(v(i))),s=M(()=>v(i).state===`draft`),c=M(()=>Vn(v(i).payload)),l=M(()=>Se(v(i).display?.size,v(c))),m=M(()=>ye(v(i))),g=M(()=>v(m)===`failing`?`${yi(v(i).last_status)} · last tried ${_e(v(i).last_checked)}`:``),S=M(()=>Vr(v(i))),C=M(()=>zr(v(i))),w=M(()=>ni(v(i).fit));{let T=e=>{var n=Fi(),r=y(n),s=e=>{ue(e,{get kind(){return v(a).kind},children:(e,t)=>{D();var n=u();o(()=>N(n,v(a).label)),d(e,n)},$$slots:{default:!0}})};t(r,e=>{v(m)!==`fresh`&&e(s)});var c=h(r,2),l=e=>{ue(e,{kind:``,title:`This card includes a language model's reading of the data, not pure arithmetic.`,children:(e,t)=>{D();var n=u(`Interpreted`);d(e,n)},$$slots:{default:!0}})};t(c,e=>{v(i).interpreted&&e(l)});var f=h(c,2),p=e=>{ue(e,{kind:`accent`,onclick:()=>rn(v(i)),title:`The library updated this card's template — click to review and apply`,children:(e,t)=>{D();var n=u(`Update available`);d(e,n)},$$slots:{default:!0}})};t(f,e=>{v(i).template_update&&e(p)});var g=h(f,2),_=e=>{ue(e,{kind:`accent`,onclick:()=>un(v(i)),title:`A proposed fix from Claude — click to review`,children:(e,t)=>{D();var n=u(`Fix proposed`);d(e,n)},$$slots:{default:!0}})};t(g,e=>{v(i).l2_proposal&&e(_)});var b=h(g,2),x=e=>{ue(e,{kind:``,title:`This card's template is no longer in the library`,children:(e,t)=>{D();var n=u(`No longer in library`);d(e,n)},$$slots:{default:!0}})};t(b,e=>{v(i).template_gone&&e(x)}),d(e,n)},E=e=>{var n=Fi(),r=y(n),a=e=>{var t=Ii(),n=b(t),r=x(n,!0);k(t),o(()=>{n.disabled=v(_)===v(i).id,N(r,v(_)===v(i).id?`Fixing…`:`Fix`)}),B(`click`,n,()=>wt(v(i))),d(e,t)};t(r,e=>{!v(i).shell&&!v(i).flow&&(v(i).state===`failing`||v(i).state===`broken`||v(i).state===`degraded`||v(i).state===`commissioning`&&v(i).consecutive_failures>0)&&e(a)});var l=h(r,2),u=e=>{var t=Ri();p(t,21,()=>v(i).needs_credentials,e=>e.name,(e,t)=>{var n=Li(),r=b(n),a=h(b(r)),s=x(a,!0),c=h(a,1,!0);k(r);var l=h(r,2);k(n),o(e=>{N(s,v(t).label),N(c,e),l.disabled=v(_)===v(i).id||v(q)!==null},[()=>v(t).label.toLowerCase().endsWith(`key`)?``:` key`]),B(`click`,l,()=>gn(v(i),v(t))),d(e,n)}),k(t),d(e,t)};t(l,e=>{v(i).needs_credentials&&v(i).needs_credentials.length>0&&e(u)});var m=h(l,2),g=e=>{var t=Ri();p(t,21,()=>v(i).needs_params,e=>e.name,(e,t)=>{var n=zi(),r=b(n),a=h(b(r)),s=x(a,!0);k(r);var c=h(r,2);k(n),o(()=>{N(s,v(t).label),c.disabled=v(_)===v(i).id||v(Pt)!==null}),B(`click`,c,()=>yn(v(i),v(t))),d(e,n)}),k(t),d(e,t)};t(m,e=>{v(i).needs_params&&v(i).needs_params.length>0&&e(g)});var S=h(m,2),w=e=>{var t=Bi();d(e,t)},T=e=>{{let t=M(()=>v(_)===v(i).id),n=M(()=>v(Q)[v(i).id]??``);Qr(e,{get sites(){return v(C)},get busy(){return v(t)},get error(){return v(n)},onActivate:()=>jn(v(i))})}},E=e=>{var t=Vi(),n=b(t),r=x(n,!0);k(t),o(()=>{n.disabled=v(_)===v(i).id,N(r,v(_)===v(i).id?`Activating…`:`Activate`)}),B(`click`,n,()=>An(v(i))),d(e,t)};t(S,e=>{v(s)&&v(i).shell&&(!v(i).flow||v(i).flow.state===`failed`||v(i).flow.state===`unsupported`)&&v(i).flow?.question?.kind!==`model_consent`?e(w):v(s)&&!v(i).shell&&!v(i).flow&&v(C)?e(T,1):v(s)&&!v(i).shell&&!v(i).flow&&e(E,2)});var D=h(S,2),O=e=>{let n=M(()=>Hr(v(i)));var r=Hi(),a=h(b(r),2),s=x(a,!0),c=h(a,2),l=b(c),u=x(l,!0),f=h(l,2);k(c);var p=h(c,2),m=e=>{{let t=M(()=>v(_)===v(i).id),r=M(()=>v(Q)[v(i).id]??``);Be(e,{get candidates(){return v(n)},get busy(){return v(t)},get error(){return v(r)},onSwitch:e=>Mn(v(i),e)})}};t(p,e=>{v(n).length>0&&e(m)}),k(r),o(e=>{N(s,e),l.disabled=v(_)===v(i).id,N(u,v(_)===v(i).id?`Checking…`:`Yes, that’s it`),f.disabled=v(_)===v(i).id},[()=>Si(v(i).awaiting_yes)]),B(`click`,l,()=>Nn(v(i))),B(`click`,f,()=>Pn(v(i))),d(e,r)},A=e=>{var n=f(),r=y(n),a=e=>{var t=Ui();d(e,t)},s=e=>{{let t=M(()=>v(_)===v(i).id),n=M(()=>xe(v(i))),r=M(()=>v(i).query?.coverage);_i(e,{get payload(){return v(i).payload},get viewerTz(){return Bn},get busy(){return v(t)},get interpretation(){return v(n)},get coverage(){return v(r)},get fit(){return v(i).fit},onUse:e=>Nn(v(i),e),onWrong:()=>Fn(v(i))})}},l=e=>{var t=Wi(),n=h(b(t),2),r=b(n),a=x(r,!0),s=h(r,2);k(n),k(t),o(()=>{r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Checking…`:`Looks right`),s.disabled=v(_)===v(i).id}),B(`click`,r,()=>Nn(v(i))),B(`click`,s,()=>Fn(v(i))),d(e,t)};t(r,e=>{v(i).c2_ok?e(a):v(c)?e(s,1):e(l,-1)}),d(e,n)};t(D,e=>{v(i).awaiting_yes&&v(i).payload&&!v(i).flow?e(O):v(i).state===`commissioning`&&v(i).payload&&v(i).payload_slot!==`preview`&&e(A,1)}),d(e,n)},P=e=>{var n=Ji(),r=b(n),a=e=>{var t=Gi(),n=y(t),r=h(n,2),a=x(r,!0);o(()=>{n.disabled=v(_)===v(i).id||v(Bt)!==null,r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Running…`:`Run now`)}),B(`click`,n,()=>Cn(v(i))),B(`click`,r,()=>Dn(v(i))),d(e,t)},s=M(()=>!we(v(m),!!v(c),v(S)));t(r,e=>{v(s)&&e(a)});var l=h(r,2),u=h(b(l),2),f=b(u),p=e=>{var t=Ki(),n=y(t),r=h(n,2),a=x(r,!0);o(()=>{n.disabled=v(_)===v(i).id||v(Bt)!==null,r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Running…`:`Run now`)}),B(`click`,n,()=>Cn(v(i))),B(`click`,r,()=>Dn(v(i))),d(e,t)},g=M(()=>we(v(m),!!v(c),v(S)));t(f,e=>{v(g)&&e(p)});var C=h(f,2),w=x(C,!0),T=h(C,2),E=h(T,2),D=e=>{var t=qi();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>ht(v(i))),d(e,t)};t(E,e=>{v(i).shell||e(D)});var O=h(E,2),A=h(O,2);k(u),k(l),k(n),o(()=>{C.disabled=v(_)===v(i).id,N(w,v(i).enabled?`Pause`:`Resume`),T.disabled=v(_)===v(i).id,O.disabled=v(_)===v(i).id,A.disabled=v(_)===v(i).id}),B(`click`,C,()=>On(v(i))),B(`click`,T,()=>Tt(v(i))),B(`click`,O,()=>sn(v(i))),B(`click`,A,()=>kn(v(i))),d(e,n)},ee=M(()=>!!v(c)),te=M(()=>v(s)||!!v(i).awaiting_yes),I=M(()=>be(v(i))),L=M(()=>xe(v(i))),ne=M(()=>v(i).rendered===!0);Ie(e,{get title(){return v(i).title},get state(){return v(m)},get hasForm(){return v(ee)},get cols(){return v(l).cols},get rows(){return v(l).rows},get preview(){return v(te)},get footerText(){return v(I)},get interpretation(){return v(L)},get reason(){return v(g)},get rendered(){return v(ne)},get notice(){return v(S)},get fit(){return v(w)},chips:T,below:E,actions:P,children:(e,a)=>{var l=Ca(),m=y(l),g=e=>{var t=Yi(),n=b(t);ue(n,{kind:``,children:(e,t)=>{D();var n=u();o(()=>N(n,v(i).born===`flow`||v(i).born===`recipe`?`Preview — real data, not updating yet`:`Preview — sample data`)),d(e,n)},$$slots:{default:!0}}),k(t),d(e,t)};t(m,e=>{v(s)&&!v(i).flow&&e(g)});var C=h(m,2),w=e=>{var a=f(),s=y(a),c=e=>{let a=M(()=>yi(v(i).flow.error??``)),s=M(()=>v(i).flow.question?.kind===`model_consent`?v(i).flow.question:null);var c=aa(),l=y(c),u=x(l,!0),f=h(l,2),p=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(i).flow.reason??v(a)??`Creation didn’t finish.`)),d(e,t)};t(f,e=>{v(s)||e(p)});var m=h(f,2),g=e=>{var n=Qi(),r=y(n),a=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(s).prompt)),d(e,t)};t(r,e=>{v(s).prompt&&e(a)});var c=h(r,2),l=b(c),u=x(l),f=h(l,2),p=e=>{var t=Zi();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>xt(v(i),`local`)),d(e,t)};t(f,e=>{v(s).local&&e(p)}),k(c),o(()=>{l.disabled=v(_)===v(i).id,N(u,`Build with ${v(s).model??``}`)}),B(`click`,l,()=>xt(v(i),`allow`)),d(e,n)};t(m,e=>{v(s)&&e(g)});var S=h(m,2),C=e=>{var r=$i(),a=y(r),s=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(i).flow.question.prompt)),d(e,t)};t(a,e=>{v(i).flow.question.prompt&&e(s)});var c=h(a,2),l=b(c);j(l);var u=h(l,2);k(c),o(()=>{l.disabled=v(_)===v(i).id,u.disabled=v(_)===v(i).id||!v(_t)}),n(`submit`,c,e=>{e.preventDefault(),bt(v(i))}),F(l,()=>v(_t),e=>O(_t,e)),d(e,r)};t(S,e=>{v(i).flow.question?.kind===`supply_date`&&e(C)});var w=h(S,2),T=e=>{var n=ra(),r=b(n),a=e=>{var t=ea(),n=y(t),r=h(n,2);o(()=>{n.disabled=v(_)===v(i).id,r.disabled=v(_)===v(i).id}),B(`click`,n,()=>wt(v(i))),B(`click`,r,()=>ht(v(i))),d(e,t)};t(r,e=>{v(i).shell||e(a)});var s=h(r,2),c=e=>{var t=ta(),n=x(t,!0);o(()=>{t.disabled=v(_)===v(i).id,N(n,v(_)===v(i).id?`Retrying…`:`Retry`)}),B(`click`,t,()=>Nt(v(i))),d(e,t)},l=M(()=>v(i).shell&&v(i).flow.reopen?.includes(`retry`));t(s,e=>{v(l)&&e(c)});var u=h(s,2),f=e=>{var t=na();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>St(v(i))),d(e,t)},p=M(()=>v(i).shell&&v(i).flow.reopen?.includes(`pick_source`));t(u,e=>{v(p)&&e(f)}),k(n),d(e,n)};t(w,e=>{v(s)||e(T)});var E=h(w,2),D=e=>{var t=ia(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(E,e=>{v(Q)[v(i).id]&&e(D)}),o(()=>{r(l,1,z(v(s)?`ni-note-head`:`ni-status-fail ni-note-head`),`svelte-7uuxge`),N(u,v(s)?`Build with a model outside this computer?`:v(i).flow.state===`unsupported`?`Can’t build this card yet`:`Setup failed`)}),d(e,c)},l=e=>{var t=oa();d(e,t)},m=e=>{let r=M(()=>Ci(v(i).flow.suggestions)),a=M(()=>Rr(v(i).flow));var s=ha(),c=b(s),l=x(c,!0),u=h(c,2),f=e=>{var n=da();p(n,21,()=>v(r).sources,e=>e.url,(e,n)=>{var r=ua(),a=b(r),s=x(a,!0),c=h(a,2),l=e=>{var t=sa(),r=x(t,!0);o(e=>N(r,e),[()=>v(n).evidence.join(` — `)]),d(e,t)};t(c,e=>{v(n).evidence&&v(n).evidence.length>0&&e(l)});var u=h(c,2),f=e=>{var t=ca();d(e,t)},p=M(()=>v(n).needs?.includes(`key`));t(u,e=>{v(p)&&e(f)});var m=h(u,2),g=e=>{var t=la();d(e,t)},y=M(()=>v(n).needs?.includes(`contact`));t(m,e=>{v(y)&&e(g)}),k(r),o(()=>{a.disabled=v(_)===v(i).id,A(a,`title`,v(n).url),N(s,v(n).title)}),B(`click`,a,()=>vt(v(i),v(n).url)),d(e,r)}),k(n),d(e,n)};t(u,e=>{v(r).sources.length>0&&e(f)});var m=h(u,2),g=e=>{var t=pa(),n=h(y(t),2);p(n,21,()=>v(r).links,e=>e.url,(e,t)=>{var n=fa(),r=b(n),i=b(r);se(i,{name:`link`,size:14});var a=h(i);k(r);var s=h(r,2),c=x(s,!0);k(n),o(e=>{A(r,`href`,v(t).url),N(a,` ${(v(t).title||v(t).host)??``}`),N(c,e)},[()=>wi(v(t))]),d(e,n)}),k(n),d(e,t)};t(m,e=>{v(r).links.length>0&&e(g)});var S=h(m,2),C=b(S);j(C);var w=h(C,2),T=e=>{var t=ma(),n=x(t,!0);o(()=>N(n,v(a))),d(e,t)};t(w,e=>{v(a)&&e(T)});var E=h(w,2);k(S);var D=h(S,2),P=e=>{var t=ia(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(D,e=>{v(Q)[v(i).id]&&e(P)}),k(s),o(e=>{N(l,v(r).heading),A(C,`placeholder`,v(r).links.length>0?`Found the data? Paste its link (https://…)`:`Or paste any web page or API URL (https://…)`),C.disabled=v(_)===v(i).id,E.disabled=e},[()=>v(_)===v(i).id||v(it).trim().length<8]),n(`submit`,S,e=>{e.preventDefault(),vt(v(i))}),F(C,()=>v(it),e=>O(it,e)),d(e,s)},g=e=>{let r=M(()=>v(i).flow.access);var a=ba(),s=b(a),c=e=>{var n=_a(),a=y(n),s=b(a),c=h(s),l=e=>{var t=ga(),n=y(t);D(),o(()=>A(n,`href`,v(r).key.docs_url)),d(e,t)},f=e=>{var t=u();o(()=>N(t,`Get one from ${(v(r).provider||v(r).host)??``}, then paste it below.`)),d(e,t)};t(c,e=>{v(r).key.docs_url?e(l):e(f,-1)});var p=h(c);k(a);var m=h(a,2);j(m),o(()=>{N(s,`${(v(r).provider||v(r).host)??``} needs your own free key. `),N(p,` SmartBrain sends it only to ${v(r).host??``}, over a secure connection.`),A(m,`placeholder`,`Your ${(v(r).provider||v(r).host)??``} key`),m.disabled=v(_)===v(i).id,A(m,`aria-label`,`Your key for ${v(r).host??``}`)}),F(m,()=>v(at),e=>O(at,e)),d(e,n)};t(s,e=>{v(r).key&&e(c)});var l=h(s,2),f=e=>{var t=va(),n=y(t),a=x(n),s=h(n,2);j(s),o(()=>{N(a,`${(v(r).provider||v(r).host)??``} asks automated requests for a contact
+ email. SmartBrain sends yours only to sources with this rule, and asks once.`),s.disabled=v(_)===v(i).id}),F(s,()=>v(ot),e=>O(ot,e)),d(e,t)};t(l,e=>{v(r).contact&&e(f)});var p=h(l,2),m=x(p,!0),g=h(p,2),S=e=>{var t=ya(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(g,e=>{v(Q)[v(i).id]&&e(S)}),k(a),o(e=>{p.disabled=e,N(m,v(_)===v(i).id?`Saving…`:`Continue`)},[()=>v(_)===v(i).id||!!v(r).key&&v(at).trim().length===0||v(r).contact&&v(ot).trim().length<6]),n(`submit`,a,e=>{e.preventDefault(),yt(v(i))}),d(e,a)},S=e=>{var t=ma(),n=x(t,!0);o(e=>N(n,e),[()=>bi(v(i).flow)]),d(e,t)};t(s,e=>{v(i).flow.state===`failed`||v(i).flow.state===`unsupported`?e(c):v(i).flow.state===`source`&&v(i).flow.suggestions===void 0?e(l,1):v(i).flow.state===`source`?e(m,2):v(i).flow.state===`awaiting_access`&&v(i).flow.access?e(g,3):e(S,-1)}),d(e,a)},T=e=>{var n=f(),r=y(n),a=e=>{},o=M(()=>Ce(v(i),!!v(c))),s=e=>{Sn(e,{get clir(){return v(c)},get viewerTz(){return Bn}})},l=e=>{Ar(e,{get node(){return v(i).payload}})};t(r,e=>{v(o)?e(a):v(c)?e(s,1):e(l,-1)}),d(e,n)},E=e=>{let n=M(()=>hn(v(i)));var r=f(),a=y(r),s=e=>{var t=xa(),r=h(b(t)),i=x(r),a=h(r);k(t),o(()=>{N(i,`${v(n).friendly??``} (${v(n).raw??``})`),N(a,`,
+ ${v(n).attempts??``} attempt${v(n).attempts===1?``:`s`} · last tried ${v(n).tried??``}`)}),d(e,t)},c=e=>{var t=Sa();d(e,t)};t(a,e=>{v(n).show?e(s):v(S)||e(c,1)}),d(e,r)};t(C,e=>{v(i).flow?e(w):v(i).payload?e(T,1):e(E,-1)}),d(e,l)},$$slots:{chips:!0,below:!0,actions:!0,default:!0}})}}),k(i),d(e,i)};t(R,e=>{v(m)?v(s).length===0?e(V,1):e(H,-1):e(re)});var ce=h(R,2),U=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(g))),d(e,t)};t(ce,e=>{v(g)&&e(U)});var W=h(ce,2),ve=e=>{le(e,{open:!0,label:`Refine this card`,onclose:()=>{O(ft,null),O(pt,``)},children:(e,t)=>{var n=Ea(),r=h(y(n),4);C(r);var i=h(r,2),a=b(i),s=h(a,2),c=x(s,!0);k(i),o(e=>{r.disabled=v(mt),s.disabled=e,N(c,v(mt)?`Sending…`:`Rebuild`)},[()=>v(mt)||v(pt).trim().length<3]),F(r,()=>v(pt),e=>O(pt,e)),B(`click`,a,()=>{O(ft,null),O(pt,``)}),B(`click`,s,()=>void gt()),d(e,n)},$$slots:{default:!0}})};t(W,e=>{v(ft)&&e(ve)});var J=h(W,2),Ct=e=>{le(e,{open:!0,label:`What went wrong?`,onclose:()=>{O(oe,null),O(me,``)},children:(e,t)=>{var n=Da(),r=h(y(n),4);C(r);var i=h(r,2),a=b(i),s=h(a,2),c=x(s,!0);k(i),o(()=>{a.disabled=v(S),s.disabled=v(S),N(c,v(S)?`Sending…`:`Send`)}),F(r,()=>v(me),e=>O(me,e)),B(`click`,a,()=>{O(oe,null),O(me,``)}),B(`click`,s,In),d(e,n)},$$slots:{default:!0}})};t(J,e=>{v(oe)&&e(Ct)});var Ft=h(J,2),qt=e=>{le(e,{open:!0,alert:!0,label:`Apply library update?`,onclose:()=>{v(Ve)||O(ze,null)},children:(e,t)=>{var n=Oa(),r=h(y(n),2),i=h(b(r)),a=x(i);D(),k(r);var s=h(r,2),c=b(s),l=h(c,2),u=x(l,!0);k(s),o(()=>{N(a,`“${v(ze).title??``}”`),c.disabled=v(Ve),l.disabled=v(Ve),N(u,v(Ve)?`Applying…`:`Apply update`)}),B(`click`,c,()=>{O(ze,null)}),B(`click`,l,an),d(e,n)},$$slots:{default:!0}})};t(Ft,e=>{v(ze)&&e(qt)});var Jt=h(Ft,2),on=e=>{le(e,{open:!0,size:`md`,label:`A proposed fix from Claude`,onclose:()=>{v(Ge)||dn()},children:(e,n)=>{var r=ja(),i=h(y(r),4),a=e=>{de(e,{block:!0})},s=e=>{var t=ka();d(e,t)},c=e=>{var t=Aa(),n=b(t),r=h(b(n),4),i=x(r,!0),a=h(r,4),s=x(a,!0);k(n);var c=h(n,2),l=h(b(c),4),u=x(l,!0),f=h(l,4),p=x(f,!0);k(c),k(t),o((e,t,n,r)=>{N(i,e),N(s,t),N(u,n),N(p,r)},[()=>Mi(v(Ke).extract),()=>Mi(v(Ke).transform),()=>Mi(v(qe).extract),()=>Mi(v(qe).transform)]),d(e,t)};t(i,e=>{v(We)?e(a):v(Ue)?e(c,-1):e(s,1)});var l=h(i,2),u=b(l),f=h(u,2),p=h(f,2),m=x(p,!0);k(l),o(()=>{u.disabled=v(Ge),f.disabled=v(Ge)||v(We)||!v(Ue),p.disabled=v(Ge)||v(We)||!v(Ue),N(m,v(Ge)?`Applying…`:`Apply`)}),B(`click`,u,dn),B(`click`,f,pn),B(`click`,p,fn),d(e,r)},$$slots:{default:!0}})};t(Jt,e=>{v(He)&&e(on)});var mn=h(Jt,2),$=e=>{le(e,{open:!0,label:`Repair settings`,onclose:()=>{v(Ze)||cn()},children:(e,n)=>{var r=Pa(),i=y(r),a=x(i),s=h(i,2),c=e=>{de(e,{block:!0})},l=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Qe)||`Couldn’t load this card.`)),d(e,t)},u=e=>{var n=Na(),r=h(y(n),2),i=b(r);j(i),D(2),k(r);var a=h(r,2),s=b(a);j(s),D(2),k(a);var c=h(a,2),l=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(Qe))),d(e,t)};t(c,e=>{v(Qe)&&e(l)}),o(()=>{i.disabled=v(Ze),s.disabled=v(Ze)}),E(i,()=>v($e),e=>O($e,e)),E(s,()=>v(et),e=>O(et,e)),d(e,n)};t(s,e=>{v(Xe)?e(c):v(Ye)?e(u,-1):e(l,1)});var f=h(s,2),p=b(f),m=h(p,2),g=x(m,!0);k(f),o(()=>{N(a,`Repair settings — “${v(Je).title??``}”`),p.disabled=v(Ze),m.disabled=v(Ze)||v(Xe)||!v(Ye),N(g,v(Ze)?`Saving…`:`Save`)}),B(`click`,p,cn),B(`click`,m,ln),d(e,r)},$$slots:{default:!0}})};t(mn,e=>{v(Je)&&e($)});var Tn=h(mn,2),Ln=e=>{le(e,{open:!0,label:`Add key`,onclose:()=>{v(Z)||_n()},children:(e,n)=>{var r=Ia(),i=y(r),a=x(i),s=h(i,4),c=e=>{de(e,{block:!0})},l=e=>{var n=Fa(),r=y(n),i=b(r),a=x(i,!0),s=h(i,2);j(s),k(r);var c=h(r,2),l=h(b(c),2);j(l),k(c);var u=h(c,2),f=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(rt))),d(e,t)};t(u,e=>{v(rt)&&e(f)}),o(()=>{N(a,v(tt)),s.disabled=v(Z),l.disabled=v(Z)}),F(s,()=>v(Y),e=>O(Y,e)),F(l,()=>v(X),e=>O(X,e)),d(e,n)};t(s,e=>{v(nt)?e(c):e(l,-1)});var u=h(s,2),f=b(u),p=h(f,2),m=x(p,!0);k(u),o(e=>{N(a,`Add key — ${v(tt)??``}`),f.disabled=v(Z),p.disabled=e,N(m,v(Z)?`Saving…`:`Save`)},[()=>v(Z)||v(nt)||!v(Y)||!v(X).trim()]),B(`click`,f,_n),B(`click`,p,vn),d(e,r)},$$slots:{default:!0}})};t(Tn,e=>{v(q)&&e(Ln)});var Rn=h(Tn,2),zn=e=>{le(e,{open:!0,label:`Fill in`,onclose:()=>{v(Rt)||bn()},children:(e,n)=>{var r=La(),i=y(r),a=x(i),s=h(i,4),c=b(s),l=x(c,!0),u=h(c,2);j(u),k(s);var f=h(s,2),p=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(zt))),d(e,t)};t(f,e=>{v(zt)&&e(p)});var m=h(f,2),g=b(m),_=h(g,2),S=x(_,!0);k(m),o(e=>{N(a,`Fill in — ${v(It)??``}`),N(l,v(It)),u.disabled=v(Rt),g.disabled=v(Rt),_.disabled=e,N(S,v(Rt)?`Saving…`:`Save`)},[()=>v(Rt)||!v(Lt).trim()]),F(u,()=>v(Lt),e=>O(Lt,e)),B(`click`,g,bn),B(`click`,_,xn),d(e,r)},$$slots:{default:!0}})};t(Rn,e=>{v(Pt)&&e(zn)});var Hn=h(Rn,2),Un=e=>{le(e,{open:!0,label:`Edit card`,onclose:()=>{v(ut)||Et()},children:(e,n)=>{var r=Ra(),i=y(r),a=x(i),s=h(i,2),c=h(b(s),2);j(c),k(s);var l=h(s,2),u=h(b(l),2);j(u),k(l);var f=h(l,2),p=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(dt))),d(e,t)};t(f,e=>{v(dt)&&e(p)});var m=h(f,2),g=b(m),_=h(g,2),S=x(_,!0);k(m),o(()=>{N(a,`Edit — ${v(st).title??``}`),c.disabled=v(ut),u.disabled=v(ut),g.disabled=v(ut),_.disabled=v(ut),N(S,v(ut)?`Saving…`:`Save`)}),F(c,()=>v(ct),e=>O(ct,e)),F(u,()=>v(lt),e=>O(lt,e)),B(`click`,g,Et),B(`click`,_,Dt),d(e,r)},$$slots:{default:!0}})};t(Hn,e=>{v(st)&&e(Un)});var Wn=h(Hn,2),Gn=e=>{le(e,{open:!0,label:`Run history`,onclose:wn,children:(e,n)=>{var r=Ua(),i=y(r),a=x(i),s=h(i,2),c=e=>{de(e,{block:!0})},l=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ut))),d(e,t)},u=e=>{var t=za();d(e,t)},f=e=>{var n=Ha();p(n,21,()=>v(Vt).runs,P,(e,n)=>{let r=M(()=>yi(v(n).error));var i=Va(),a=b(i),s=x(a,!0),c=h(a,2),l=x(c,!0),u=h(c,2),f=e=>{var t=Ba(),n=x(t);o(()=>N(n,`— ${v(r)??``}`)),d(e,t)};t(u,e=>{v(r)&&e(f)}),k(i),o((e,t)=>{N(s,e),N(l,t)},[()=>_e(v(n).ts),()=>pe(v(n).status)]),d(e,i)}),k(n),d(e,n)};t(s,e=>{v(Ht)?e(c):v(Ut)&&!v(Vt)?e(l,1):!v(Vt)||v(Vt).runs.length===0?e(u,2):e(f,-1)});var m=h(s,2),g=x(m);o(()=>N(a,`Recent runs — “${v(Bt).title??``}”`)),B(`click`,g,wn),d(e,r)},$$slots:{default:!0}})};t(Wn,e=>{v(Bt)&&e(Gn)});var Kn=h(Wn,2),qn=e=>{le(e,{open:!0,size:`lg`,label:`Global Library`,onclose:()=>{!v(K)&&!v(Me)&&Yt()},children:(e,n)=>{var r=so(),i=h(y(r),2),a=e=>{de(e,{block:!0})},s=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ee)||`Couldn't load the library.`)),d(e,t)},c=e=>{var n=Wa(),r=h(b(n),2),i=b(r),a=h(b(i),2),s=x(a,!0);k(i);var c=h(i,2),l=h(b(c),2),u=x(l,!0);k(c),k(r);var f=h(r,6),p=b(f);j(p);var m=h(p,2),g=x(m,!0);k(f);var _=h(f,2),y=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(Re))),d(e,t)};t(_,e=>{v(Re)&&e(y)}),k(n),o(()=>{N(s,v(G).fingerprint??`(unknown)`),N(u,v(G).blocked.offered_fingerprint),m.disabled=v(Le)||!v(Fe),N(g,v(Le)?`Pinning…`:`Trust new key`)}),B(`keydown`,p,e=>e.key===`Enter`&&v(Fe)&&$t()),F(p,()=>v(Fe),e=>O(Fe,e)),B(`click`,m,$t),d(e,n)},l=e=>{var n=Ga(),r=h(y(n),4),i=b(r);j(i),A(i,`placeholder`,he);var a=h(i,2),s=x(a,!0);k(r);var c=h(r,2),l=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(Ee))),d(e,t)};t(c,e=>{v(Ee)&&e(l)}),o(e=>{a.disabled=e,N(s,v(K)?`Connecting…`:`Connect`)},[()=>v(K)||!v(De).trim()]),B(`keydown`,i,e=>e.key===`Enter`&&!v(K)&&Xt()),F(i,()=>v(De),e=>O(De,e)),B(`click`,a,Xt),d(e,n)},m=e=>{let n=M(()=>v(Ae));var r=Xa(),i=y(r),a=b(i),s=h(a,2),c=x(s,!0);k(i);var l=h(i,2),u=x(l,!0),m=h(l,4);p(m,21,()=>v(n).sources,P,(e,t)=>{var n=Ka(),r=b(n),i=x(r,!0);k(n),o(()=>N(i,v(t).host?`${v(t).host}${v(t).path}`:v(t).type===`internal.kb`?`your knowledge base (no network)`:v(t).type===`model`?`generated by your local model (no fetch)`:v(t).type)),d(e,n)}),k(m);var g=h(m,2),_=e=>{var r=Ya(),i=h(y(r),2);p(i,21,()=>v(n).params,e=>e.name,(e,n)=>{var r=f(),i=y(r),a=e=>{var t=qa(),r=b(t),i=x(r,!0);D(2),k(t),o(()=>N(i,v(n).label)),d(e,t)},s=e=>{var t=Ja(),r=b(t),i=x(r,!0),a=h(r,2);j(a),k(t),o(()=>{N(i,v(n).label),A(a,`type`,v(n).kind===`number`?`number`:`text`),A(a,`placeholder`,v(n).label)}),F(a,()=>v(je)[v(n).name],e=>v(je)[v(n).name]=e),d(e,t)};t(i,e=>{v(n).kind===`secret`?e(a):e(s,-1)}),d(e,r)}),k(i),d(e,r)};t(g,e=>{v(n).params.length>0&&e(_)});var S=h(g,2),C=h(b(S),2),w=e=>{let t=M(()=>Vn(v(n).preview_payload));Sn(e,{get clir(){return v(t)},get viewerTz(){return Bn}})},T=M(()=>Vn(v(n).preview_payload)),E=e=>{Ar(e,{get node(){return v(n).preview_payload}})};t(C,e=>{v(T)?e(w):e(E,-1)}),k(S);var O=h(S,2),ee=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(Ne))),d(e,t)};t(O,e=>{v(Ne)&&e(ee)});var te=h(O,2),I=b(te),L=h(I,2),ne=x(L,!0);k(te),o(()=>{N(c,v(n).title),N(u,v(n).goal),I.disabled=v(Me),L.disabled=v(Me)||!!v(Kt),N(ne,v(Me)?`Installing…`:`Install as draft`)}),B(`click`,a,tn),B(`click`,I,tn),B(`click`,L,nn),d(e,r)},g=e=>{var n=oo(),r=y(n),i=b(r),a=x(i,!0),s=h(i,2),c=e=>{ue(e,{kind:``,children:(e,t)=>{D();var n=u();o(()=>N(n,`v${v(G).seq??``}`)),d(e,n)},$$slots:{default:!0}})};t(s,e=>{v(G).seq!==void 0&&e(c)});var l=h(s,2),f=e=>{var t=Za(),n=x(t);o(e=>N(n,`Last checked ${e??``}`),[()=>_e(v(G).last_checked)]),d(e,t)};t(l,e=>{v(G).last_checked&&e(f)});var m=h(l,4),g=x(m,!0),_=h(m,2);k(r);var S=h(r,2),C=e=>{var t=Qa(),n=x(t,!0);o(()=>N(n,v(Pe))),d(e,t)};t(S,e=>{v(Pe)&&e(C)});var T=h(S,2),E=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ee))),d(e,t)};t(T,e=>{v(Ee)&&e(E)});var ee=h(T,2),te=e=>{var t=Ta(),n=x(t);o(()=>N(n,`Last check failed: ${v(G).last_error??``}`)),d(e,t)},I=e=>{var t=$a();d(e,t)};t(ee,e=>{v(G).last_error?e(te):v(G).unreachable&&e(I,1)});var L=h(ee,2),ne=b(L);j(ne);var R=h(ne,2),re=e=>{var t=to(),n=b(t);n.value=n.__value=``;var r=h(n);p(r,16,()=>v(Gt),e=>e,(e,t)=>{var n=eo(),r=x(n,!0),i={};o(()=>{N(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),d(e,n)}),k(t),w(t),ie(t,()=>v(ke),e=>O(ke,e)),d(e,t)};t(R,e=>{v(Gt).length>0&&e(re)}),k(L);var z=h(L,2),ae=e=>{fe(e,{icon:`monitor`,title:`No templates yet`,body:`The library is connected but empty right now — try Check now.`})},V=e=>{var t=no();d(e,t)},H=e=>{var n=ao();p(n,21,()=>v(Wt),e=>e.id,(e,n)=>{var r=io(),i=b(r),a=b(i),s=x(a,!0),c=h(a,2);ue(c,{kind:``,children:(e,t)=>{D();var r=u();o(()=>N(r,v(n).category)),d(e,r)},$$slots:{default:!0}}),k(i);var l=h(i,2),f=x(l,!0),m=h(l,4);p(m,21,()=>v(n).sources,P,(e,t)=>{var n=Ka(),r=b(n),i=x(r,!0);k(n),o(()=>N(i,v(t).host?`${v(t).host}${v(t).path}`:v(t).type===`internal.kb`?`your knowledge base (no network)`:v(t).type===`model`?`generated by your local model (no fetch)`:v(t).type)),d(e,n)}),k(m);var g=h(m,2),_=e=>{var t=ro(),r=x(t,!0);o(()=>N(r,v(n).notes)),d(e,t)};t(g,e=>{v(n).notes&&e(_)});var y=h(g,2),S=b(y),C=e=>{let t=M(()=>Vn(v(n).preview_payload));Sn(e,{get clir(){return v(t)},get viewerTz(){return Bn}})},w=M(()=>Vn(v(n).preview_payload)),T=e=>{Ar(e,{get node(){return v(n).preview_payload}})};t(S,e=>{v(w)?e(C):e(T,-1)}),k(y);var E=h(y,2),O=x(E);k(r),o(()=>{N(s,v(n).title),N(f,v(n).goal)}),B(`click`,O,()=>en(v(n))),d(e,r)}),k(n),d(e,n)};t(z,e=>{(v(G).templates??[]).length===0?e(ae):v(Wt).length===0?e(V,1):e(H,-1)}),o(e=>{A(i,`title`,v(G).url??``),N(a,e),m.disabled=v(K),N(g,v(K)?`Checking…`:`Check now`),_.disabled=v(K)},[()=>ki(v(G).fingerprint)]),B(`click`,m,Zt),B(`click`,_,Qt),F(ne,()=>v(Oe),e=>O(Oe,e)),d(e,n)};t(i,e=>{v(Te)?e(a):v(G)?v(G).blocked?e(c,2):v(G).connected?v(Ae)?e(m,4):e(g,-1):e(l,3):e(s,1)});var _=h(i,2),S=x(_);o(()=>S.disabled=v(K)||v(Me)),B(`click`,S,Yt),d(e,r)},$$slots:{default:!0}})};t(Kn,e=>{v(ge)&&e(qn)}),o(e=>{T.disabled=v(kt),te.disabled=e,N(I,v(kt)?`Starting…`:`Create card`)},[()=>v(kt)||v(Ot).trim().length<3]),B(`click`,c,()=>ae(`/ni/library`)),n(`submit`,l,e=>{e.preventDefault(),Mt()}),F(T,()=>v(Ot),e=>O(Ot,e)),d(e,i)},Gn=e=>{de(e,{block:!0})};t(Un,e=>{H.status?.unlocked?e(Wn):e(Gn,-1)}),d(i,Hn),ne()}g([`click`,`keydown`]);export{lo as component};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/10.D2sVRYwK.js b/app/smartbrain_3000/web/_app/immutable/nodes/10.D2sVRYwK.js
deleted file mode 100644
index 58a1d1f4..00000000
--- a/app/smartbrain_3000/web/_app/immutable/nodes/10.D2sVRYwK.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import{$ as e,A as t,B as n,C as r,E as i,F as a,G as o,I as s,J as c,K as l,L as u,M as d,N as f,O as p,P as m,Q as h,R as g,S as _,V as v,X as y,Y as b,Z as x,a as S,at as C,b as w,ct as T,d as E,dt as D,et as O,ft as k,g as A,h as j,it as M,j as N,k as P,l as ee,m as F,n as te,pt as I,r as L,st as ne,tt as R,u as re,w as z,y as ie,z as B}from"../chunks/BJLLtWYH.js";import{t as ae}from"../chunks/BxvjB08B.js";import"../chunks/xihTtKlq.js";import"../chunks/Cmegxfzj.js";import{n as V}from"../chunks/CoHYJ8BJ.js";import{t as H}from"../chunks/y2R953fa.js";import{n as oe,t as se}from"../chunks/CEPrmzat.js";import{t as ce}from"../chunks/CwtHPkdz.js";import{t as le}from"../chunks/BqUz5g-m.js";import{n as U}from"../chunks/uFPkKLC1.js";import{t as ue}from"../chunks/kqW19h2g.js";import{t as de}from"../chunks/1gl_kuJz.js";import{t as W}from"../chunks/DKVRJME0.js";import{t as fe}from"../chunks/DV4tMnTy.js";import{i as pe,r as me}from"../chunks/jV_dy7U_.js";var he=6e4,ge=60*he,G=24*ge;function _e(e,t=new Date){console.assert(e===null||typeof e==`string`,`relTime: ts is string|null`),console.assert(t instanceof Date,`relTime: now must be a Date`);let n=me(e);if(!n)return`—`;let r=t.getTime()-n.getTime();return r<0||r<45e3?`just now`:r2*i}function ye(e){if(console.assert(typeof e.state==`string`,`cardState: state is string`),console.assert(typeof e.enabled==`boolean`,`cardState: enabled is boolean`),e.flow||e.state===`draft`)return`designing`;if(!e.enabled||e.state===`paused`)return`paused`;if(e.state===`broken`)return`broken`;if(e.state===`commissioning`){let t=e.awaiting_yes!=null||e.payload_slot!==`preview`;return e.payload!==null&&t?`verifying`:`empty`}return e.payload===null?`empty`:e.state===`failing`||e.state===`degraded`?`failing`:ve(e.payload_at,e.interval_minutes)?`stale`:`fresh`}function be(e){console.assert(typeof e.interval_minutes==`number`,`footerText: interval is number`),console.assert(e.payload_at===null||typeof e.payload_at==`string`,`footerText: payload_at shape`);let t=me(e.payload_at);return[t?`as of ${new Intl.DateTimeFormat(void 0,{timeStyle:`short`}).format(t)}`:`as of —`,e.awaiting_yes?.host??``,`every ${Math.max(1,e.interval_minutes)}m`].filter(e=>e.length>0).join(` · `)}function xe(e){console.assert(typeof e.id==`string`,`interpretationOf: a board row`);let t=e.interpretation,n=typeof t==`string`&&t.trim().length>0?t:``;return console.assert(n===``||n===t,`interpretationOf: verbatim or empty`),n}function Se(e,t){console.assert(e===void 0||typeof e==`string`,`cardSpan: size is a string or undefined`),console.assert(t==null||typeof t==`object`,`cardSpan: clir is an object or null`);let n=t&&typeof t==`object`?t.span:void 0,r=typeof n==`string`?/^[dp]([1-4])x([1-3])$/.exec(n):null;if(r)return{cols:Number(r[1])>=2?2:1,rows:Number(r[2])};switch(e){case`wide`:return{cols:2,rows:1};case`large`:return{cols:2,rows:2};case`tall`:return{cols:1,rows:2};default:return{cols:1,rows:1}}}function Ce(e,t){return console.assert(typeof e.state==`string`,`bodyShowsPanel: state is string`),console.assert(typeof t==`boolean`,`bodyShowsPanel: hasForm is boolean`),!t||e.flow||e.awaiting_yes&&e.payload||e.state!==`commissioning`||e.c2_ok?!1:e.payload!==null&&e.payload_slot!==`preview`}function we(e,t,n=``){return console.assert(typeof t==`boolean`,`formBoxChrome: hasForm is boolean`),console.assert(typeof e==`string`,`formBoxChrome: state is string`),t&&n===``&&(e===`fresh`||e===`stale`||e===`paused`)}var Te=m(``),Ee=m(``),De=m(``),K=m(``),Oe=m(`
Pages that may help — SmartBrain can't keep a live card from these yet:
`,1),ma=m(`
`),ha=m(`
`),ga=m(`Get one here,
- then paste it below.`,1),_a=m(`
`,1),va=m(`
`,1),ya=m(`
`),ba=m(``),xa=m(`
First run failed —
`),Sa=m(`
Waiting for the first run…
`),Ca=m(` `,1),wa=m(``),Ta=m(`
`),Ea=m(`
Refine…
Say what should change — units, a filter, an update schedule, or
- "different source". The card rebuilds from your note.
`,1),Da=m(`
Something’s wrong
Say what looked off — the card rebuilds from your note (units, filters, fields), or returns to draft if it can’t.
`,1),Oa=m(`
Apply library update?
The library fixed or changed this card’s template. Applying resets to a draft for your review and re-activation.
- Your parameter values and credentials carry over.
`,1),ka=m(`
Couldn’t load this proposal.
`),Aa=m(`
Current mapping
extract
transform
Proposed mapping
extract
transform
`),ja=m(`
A proposed fix from Claude
Your card kept failing, so (with your per-card permission) Claude proposed new
- data mappings. Nothing has been applied. Applying runs it as a trial — kept only
- if the next refresh passes this card’s validated contract, automatically reverted
- otherwise.
`,1),Ma=m(`
`),Na=m(`
When a card keeps failing, SmartBrain can try to fix it. Local repair only
- touches your own machine. Frontier repair sends this card’s goal, data
- mappings, and failure details to Anthropic under your Claude sign-in — only
- after local repair fails, and fixes are always proposed for your review,
- never applied.
`,1),Pa=m(`
`,1),Fa=m(` `,1),Ia=m(`
Keys are stored on this computer only and used exactly for this card’s source
- (host-bound). If you type them elsewhere, they won’t work.
`,1),La=m(`
This card needs a value before it can run. It becomes part of the card’s
- source and shows up in its address.
`,1),Ra=m(`
`,1),za=m(`
No runs recorded yet.
`),Ba=m(``),Va=m(`
`),Ha=m(`
`),Ua=m(`
`,1),Wa=m(`
The library publisher’s key changed — updates are blocked.
Pinned (trusted)
Offered (new)
This is either the publisher rotating their key — or someone impersonating them. Verify
- the offered fingerprint with the publisher out-of-band before trusting it.
`),Ga=m(`
Templates the SmartBrain project curates — one connect, then install any of them as a
- draft card. The publisher key is pinned on first fetch (TOFU).
`,1),Ka=m(`
`),qa=m(`
— credential — you’ll add it on the card after install.
`),Ja=m(``),Ya=m(`
Fill in:
`,1),Xa=m(`
This card will fetch:
Preview
`,1),Za=m(``),Qa=m(`
`),$a=m(`
The library host has been unreachable for a while — checks are paused. Check now to retry.
`),eo=m(``),to=m(``),no=m(`
No templates match that search.
`),ro=m(`
`),io=m(`
Fetches from:
`),ao=m(`
`),oo=m(`
`,1),so=m(`
Global Library
`,1),co=m(`
Neural Interface
Live data you asked for, on one board. Type it below — “show me AAPL every 5 minutes”.
`,1);function lo(i,a){T(a,!0);let s=R(e([])),m=R(!1),g=R(``),_=R(null),S=R(!1),I=null,re=0,oe=R(null),me=R(``),he=`https://smartbrain.securecloudgroup.com/ni/library.json`,ge=R(!1),G=R(null),Te=R(!1),Ee=R(``),De=R(he),K=R(!1),Oe=R(``),ke=R(``),Ae=R(null),je=R(e({})),Me=R(!1),Ne=R(``),Pe=R(``),Fe=R(``),Le=R(!1),Re=R(``),ze=R(null),Ve=R(!1),He=R(null),Ue=R(null),We=R(!1),Ge=R(!1),Ke=M(()=>v(Ue)?ji(v(Ue).spec):{extract:null,transform:null}),qe=M(()=>qt(v(Ue))),Je=R(null),Ye=R(null),Xe=R(!1),Ze=R(!1),Qe=R(``),$e=R(!0),et=R(!1),q=R(null),J=R(``),tt=R(``),Y=R(``),X=R(``),nt=R(!1),Z=R(!1),rt=R(``),it=R(``),at=R(``),ot=R(``),st=R(null),ct=R(``),lt=R(``),ut=R(!1),dt=R(``),ft=R(null),pt=R(``),mt=R(!1);function ht(e){console.assert(v(ft)===null,`openRefine: one at a time`),O(ft,e,!0),O(pt,``)}async function gt(){if(!v(ft)||v(mt))return;let e=v(ft),t=v(pt).trim();if(!(t.length<3)){O(mt,!0);try{let n=await V.niRefine(e.id,t);O(ft,null),O(pt,``),U(n.kind===`cadence`?`Update schedule changed.`:n.kind===`source_change`?`Okay — pick a new source on the card.`:`Rebuilding the card from your note.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(mt,!1)}}}let Q=R(e({})),_t=R(``);async function vt(e,t){console.assert(e.flow?.state===`source`,`pickSource: pause required`);let n=(t??v(it)).trim();if(!(n.length<8)){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let r=await V.niFlowPickSource(e.id,n,t===void 0);O(it,``),U(r.needs&&r.needs.length>0?`This source needs one more thing — see the card.`:r.started===!1?`Source set — it starts as soon as a build slot frees up.`:`Source set — sampling it now.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t work — check the URL.`},!0)}finally{O(_,null)}}}async function yt(e){console.assert(e.flow?.state===`awaiting_access`,`giveAccess: pause required`);let t=e.flow?.access;if(!t)return;let n=v(at).trim(),r=v(ot).trim();if(!(t.key&&!n||t.contact&&!r)){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let i=await V.niFlowAccess(e.id,t.key?n:void 0,t.contact?r:void 0);O(at,``),O(ot,``),U(i.started?`Thanks — building the card now.`:`Saved.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t work — try again.`},!0)}finally{O(_,null)}}}async function bt(e){console.assert(typeof e.id==`string`,`answerDate: id required`);let t=v(_t).trim();if(t){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowAnswer(e.id,`supply_date`,t),O(_t,``),U(`Date set — building the card.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That date didn’t work — use YYYY-MM-DD.`},!0)}finally{O(_,null)}}}async function xt(e,t){console.assert(typeof e.id==`string`,`answerConsent: id required`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowAnswer(e.id,`model_consent`,t),U(t===`allow`?`Building the card.`:`Building the card on your local model.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function St(e){console.assert(typeof e.id==`string`,`reopenPick: id required`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowReopen(e.id),U(`Okay — pick a source below.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`Couldn’t reopen the pick.`},!0)}finally{O(_,null)}}function Ct(e){let t=e.target;for(let e of document.querySelectorAll(`details.ni-more[open]`))(!t||!e.contains(t)||t.closest(`.ni-more-menu`))&&(e.open=!1)}async function wt(e){O(_,e.id,!0);try{await V.niFlowFix(e.id),U(`Fixing — re-reading the card's source.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}function Tt(e){console.assert(v(st)===null,`openEdit: no other edit open`),O(st,e,!0),O(ct,e.title,!0),O(lt,String(e.interval_minutes),!0),O(dt,``)}function Et(){console.assert(v(ut)===!1,`closeEdit: not while saving`),O(st,null),O(ct,``),O(lt,``),O(dt,``)}async function Dt(){console.assert(v(st)!==null,`submitEdit: target required`);let e=v(st);if(!e||v(ut))return;let t=v(ct).trim(),n=parseInt(v(lt),10);if(!t||!Number.isFinite(n)||n<1){O(dt,`A name and a cadence of at least 1 minute are required.`);return}O(ut,!0),O(dt,``);try{await V.niPatch(e.id,{title:t,interval_minutes:n}),Et(),U(`Card updated.`),await $()}catch(e){O(dt,W(e),!0)}finally{O(ut,!1)}}let Ot=R(``),kt=R(!1),At=R(``),jt=R(void 0);async function Mt(){console.assert(v(kt)===!1,`submitComposer: no concurrent submit`);let e=v(Ot).trim();if(!(e.length<3||v(kt))){O(kt,!0),O(At,``);try{let t=await V.niIntake(e);O(Ot,``),U(t.started===!1?`Card created — it starts as soon as a build slot frees up.`:`Card started — watch it build below.`),await $()}catch(e){O(At,W(e),!0)}finally{O(kt,!1)}}}async function Nt(e){console.assert(typeof e.id==`string`,`retryFlow: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let t=await V.niFlowRetry(e.id);U(t.started===!1?`Retry queued — it starts as soon as a build slot frees up.`:`Retrying the card build.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}let Pt=R(null),Ft=R(``),It=R(``),Lt=R(``),Rt=R(!1),zt=R(``),Bt=R(null),Vt=R(null),Ht=R(!1),Ut=R(``),Wt=M(()=>v(G)?.templates?Ti(v(G).templates,v(Oe),v(ke)):[]),Gt=M(()=>v(G)?.templates?Ei(v(G).templates):[]),Kt=M(()=>v(Ae)?Di(v(Ae).params,v(je)):null);function qt(e){if(console.assert(e===null||typeof e==`object`,`readProposedStages: detail is object|null`),console.assert(e===null||e.spec!==void 0,`readProposedStages: spec present when detail present`),!e)return{extract:null,transform:null};let t=e.spec._l2_proposal;if(!t||typeof t!=`object`||Array.isArray(t))return{extract:null,transform:null};let n=t.stages;if(!n||typeof n!=`object`||Array.isArray(n))return{extract:null,transform:null};let r=n;return{extract:r.extract&&typeof r.extract==`object`&&!Array.isArray(r.extract)?r.extract:null,transform:Array.isArray(r.transform)?r.transform:null}}async function Jt(){if(console.assert(typeof V.niLibrary==`function`,`openLibrary: niLibrary present`),console.assert(v(ge)===!1||v(ge)===!0,`openLibrary: libraryOpen boolean`),O(ge,!0),O(Ee,``),v(G)===null){O(Te,!0);try{O(G,await V.niLibrary(),!0),v(G).url&&O(De,v(G).url,!0)}catch(e){O(Ee,W(e),!0)}finally{O(Te,!1)}}}function Yt(){console.assert(v(K)===!1,`closeLibrary: never close while a request is in flight`),console.assert(v(Me)===!1,`closeLibrary: never close mid-install`),O(ge,!1),O(Oe,``),O(ke,``),O(Ae,null),O(je,{},!0),O(Ne,``),O(Pe,``),O(Fe,``),O(Re,``),O(Ee,``)}async function Xt(){console.assert(typeof v(De)==`string`,`connectLibrary: url is string`),console.assert(v(K)===!1,`connectLibrary: no concurrent request`);let e=v(De).trim();if(e&&!v(K)){O(K,!0),O(Ee,``);try{O(G,await V.niLibraryConnect(e),!0)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function Zt(){if(console.assert(v(G)?.connected===!0,`checkLibraryNow: only when connected`),console.assert(v(K)===!1,`checkLibraryNow: no concurrent request`),!v(K)){O(K,!0),O(Ee,``);try{O(G,await V.niLibraryCheck(),!0)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function Qt(){if(console.assert(v(G)?.connected===!0,`disconnectLibrary: only when connected`),console.assert(v(K)===!1,`disconnectLibrary: no concurrent request`),await ce({title:`Disconnect from this library?`,body:`Templates you already installed as items stay on your board. You can reconnect any time.`,confirmLabel:`Disconnect`,danger:!0})){O(K,!0),O(Ee,``);try{await V.niLibraryDisconnect(),O(G,{connected:!1},!0),O(Oe,``),O(ke,``)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function $t(){console.assert(!!v(G)?.blocked,`trustLibraryKey: only while blocked`),console.assert(typeof v(Fe)==`string`,`trustLibraryKey: passphrase is string`);let e=v(G)?.blocked?.offered_fingerprint;if(e&&v(Fe)&&!v(Le)){O(Le,!0),O(Re,``);try{O(G,await V.niLibraryTrustKey(e,v(Fe)),!0),O(Fe,``)}catch(e){O(Re,W(e),!0)}finally{O(Le,!1)}}}function en(e){console.assert(typeof e.id==`string`,`startInstall: template id is string`),console.assert(Array.isArray(e.params),`startInstall: params is array`),O(Ae,e,!0),O(je,{},!0),O(Ne,``),O(Pe,``)}function tn(){console.assert(v(Me)===!1,`cancelInstall: not while installing`),console.assert(typeof v(Ne)==`string`,`cancelInstall: installError is string`),O(Ae,null),O(je,{},!0),O(Ne,``)}async function nn(){console.assert(v(Ae)!==null,`submitInstall: template picked`),console.assert(v(Me)===!1,`submitInstall: no concurrent install`);let e=v(Ae);if(!e||v(Me))return;let t=Di(e.params,v(je));if(t){O(Ne,t.message,!0);return}O(Me,!0),O(Ne,``);try{let t=Oi(e.params,v(je)),n=(await V.niLibraryInstall(e.id,t)).needs_credentials?.length?` (credentials still needed)`:``;O(Pe,`Added as a draft — open its card to add credentials and Activate.${n}`),O(Ae,null),O(je,{},!0),await $()}catch(e){O(Ne,W(e),!0)}finally{O(Me,!1)}}function rn(e){console.assert(e.template_update===!0,`openTemplateUpdate: chip must be present`),console.assert(v(ze)===null,`openTemplateUpdate: no other update prompt open`),O(ze,e,!0)}async function an(){console.assert(v(ze)!==null,`applyTemplateUpdate: target must be set`),console.assert(v(Ve)===!1,`applyTemplateUpdate: no concurrent apply`);let e=v(ze);if(e&&!v(Ve)){O(Ve,!0),O(_,e.id,!0);try{await V.niApplyTemplateUpdate(e.id),O(ze,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ve,!1),O(_,null)}}}function on(e){console.assert(e===null||typeof e==`object`,`readRepairPolicy: detail is object|null`),console.assert(e===null||e.spec!==void 0,`readRepairPolicy: spec present when detail present`);let t={l1:!0,l2_frontier:!1};if(!e)return t;let n=e.spec.repair_policy;if(!n||typeof n!=`object`||Array.isArray(n))return t;let r=n;return{l1:typeof r.l1==`boolean`?r.l1:t.l1,l2_frontier:typeof r.l2_frontier==`boolean`?r.l2_frontier:t.l2_frontier}}async function sn(e){console.assert(typeof e.id==`string`,`openRepair: id is string`),console.assert(v(Je)===null,`openRepair: no other repair modal open`),O(Je,e,!0),O(Ye,null),O(Qe,``),O(Xe,!0);try{O(Ye,await V.niItem(e.id),!0);let t=on(v(Ye));O($e,t.l1,!0),O(et,t.l2_frontier,!0)}catch(e){O(Qe,W(e),!0)}finally{O(Xe,!1)}}function cn(){console.assert(v(Ze)===!1,`closeRepair: not while save in flight`),console.assert(typeof v(Xe)==`boolean`,`closeRepair: repairLoading is boolean`),O(Je,null),O(Ye,null),O(Qe,``)}async function ln(){console.assert(v(Je)!==null,`saveRepair: a target must be set`),console.assert(v(Ze)===!1,`saveRepair: no concurrent save`);let e=v(Je);if(e&&!v(Ze)){O(Ze,!0),O(Qe,``);try{await V.niRepairPolicy(e.id,{l1:v($e),l2_frontier:v(et)}),O(Je,null),O(Ye,null)}catch(e){O(Qe,W(e),!0)}finally{O(Ze,!1)}}}async function un(e){console.assert(e.l2_proposal===!0,`openProposal: chip must be present`),console.assert(v(He)===null,`openProposal: no other proposal open`),O(He,e,!0),O(Ue,null),O(We,!0);try{O(Ue,await V.niItem(e.id),!0)}catch(e){let t=W(e);t&&O(g,t,!0),O(He,null)}finally{O(We,!1)}}function dn(){console.assert(v(Ge)===!1,`closeProposal: not while apply/dismiss in flight`),console.assert(typeof v(We)==`boolean`,`closeProposal: proposalLoading is boolean`),O(He,null),O(Ue,null)}async function fn(){console.assert(v(He)!==null,`applyProposal: a target must be set`),console.assert(v(Ge)===!1,`applyProposal: no concurrent apply`);let e=v(He);if(e&&!v(Ge)){O(Ge,!0),O(_,e.id,!0);try{await V.niL2Apply(e.id),O(He,null),O(Ue,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ge,!1),O(_,null)}}}async function pn(){console.assert(v(He)!==null,`dismissProposal: a target must be set`),console.assert(v(Ge)===!1,`dismissProposal: no concurrent dismiss`);let e=v(He);if(e&&!v(Ge)&&await ce({title:`Dismiss proposed fix?`,body:`Dismiss this proposed fix? It won't be offered again for this breakage.`,confirmLabel:`Dismiss`,danger:!0})){O(Ge,!0),O(_,e.id,!0);try{await V.niL2Dismiss(e.id),O(He,null),O(Ue,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ge,!1),O(_,null)}}}function mn(e){if(console.assert(e===null||typeof e==`object`,`hostFromSpec: detail is object|null`),console.assert(e===null||typeof e.spec==`object`,`hostFromSpec: spec present when detail present`),!e)return``;let t=e.spec.source;if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t.url;if(typeof n!=`string`||n.length===0)return``;try{return new URL(n).hostname}catch{return``}}function hn(e){if(console.assert(typeof e.state==`string`,`firstRunFailure: state is string`),console.assert(typeof e.consecutive_failures==`number`,`firstRunFailure: failures is number`),e.state!==`commissioning`&&e.state!==`live`&&e.state!==`degraded`&&e.state!==`failing`||e.payload!==null||e.consecutive_failures<=0)return{show:!1,friendly:``,raw:``,attempts:0,tried:``};let t=typeof e.last_status==`string`?e.last_status:``;return{show:!0,friendly:yi(t),raw:t,attempts:e.consecutive_failures,tried:_e(e.last_checked)}}async function gn(e,t){console.assert(typeof t.name==`string`,`openCredential: name is string`),console.assert(v(q)===null,`openCredential: no other credential modal open`),O(q,e,!0),O(J,t.name,!0),O(tt,t.label,!0),O(Y,``),O(X,``),O(rt,``),O(nt,!0);try{let t=await V.niItem(e.id);O(X,mn(t),!0)}catch(e){O(rt,W(e),!0)}finally{O(nt,!1)}}function _n(){console.assert(v(Z)===!1,`closeCredential: not while save in flight`),console.assert(typeof v(Y)==`string`,`closeCredential: value is string`),O(q,null),O(J,``),O(tt,``),O(Y,``),O(X,``),O(rt,``)}async function vn(){console.assert(v(q)!==null,`submitCredential: a target must be set`),console.assert(v(Z)===!1,`submitCredential: no concurrent save`);let e=v(q),t=v(Y),n=v(X).trim();if(e&&t&&n&&!v(Z)){O(Z,!0),O(rt,``);try{await V.niPutCredential(e.id,v(J),t,n);let r=v(tt);_n(),U(`Saved the ${r} key.`),await $()}catch(e){O(rt,W(e),!0)}finally{O(Z,!1)}}}function yn(e,t){console.assert(typeof t.name==`string`,`openParam: name is string`),console.assert(v(Pt)===null,`openParam: no other param modal open`),O(Pt,e,!0),O(Ft,t.name,!0),O(It,t.label,!0),O(Lt,``),O(zt,``)}function bn(){console.assert(v(Rt)===!1,`closeParam: not while save in flight`),O(Pt,null),O(Ft,``),O(It,``),O(Lt,``),O(zt,``)}async function xn(){console.assert(v(Pt)!==null,`submitParam: a target must be set`),console.assert(v(Rt)===!1,`submitParam: no concurrent save`);let e=v(Pt),t=v(Lt).trim();if(e&&t&&!v(Rt)){O(Rt,!0),O(zt,``);try{await V.niPutParam(e.id,v(Ft),t);let n=v(It);bn(),U(`Saved ${n}.`),await $()}catch(e){O(zt,W(e),!0)}finally{O(Rt,!1)}}}async function Cn(e){console.assert(typeof e.id==`string`,`openHistory: id is string`),console.assert(v(Bt)===null,`openHistory: no other history modal open`),O(Bt,e,!0),O(Vt,null),O(Ut,``),O(Ht,!0);try{O(Vt,await V.niItem(e.id),!0)}catch(e){O(Ut,W(e),!0)}finally{O(Ht,!1)}}function wn(){console.assert(typeof v(Ht)==`boolean`,`closeHistory: loading is boolean`),console.assert(v(Bt)===null||v(Bt)!==void 0,`closeHistory: target shape`),O(Bt,null),O(Vt,null),O(Ut,``)}async function $(){if(console.assert(typeof V.niBoard==`function`,`load: niBoard method present`),console.assert(Array.isArray(v(s)),`load: items array`),!H.status?.unlocked)return;let e=++re;try{let t=await V.niBoard();if(e!==re)return;O(s,[...t.items].sort((e,t)=>e.position-t.position),!0),O(g,``)}catch(t){if(e!==re)return;let n=W(t);n&&O(g,n,!0)}finally{e===re&&O(m,!0)}}function Tn(){console.assert(typeof document<`u`,`onVisible: DOM available`),console.assert(document.visibilityState!==void 0,`onVisible: visibilityState present`),document.visibilityState===`visible`&&$()}L(async()=>{H.status===null&&await H.load();let e=H.status;if(e&&!e.initialized)return ae(`/setup`);if(e&&!e.unlocked)return ae(`/unlock`);$(),I=setInterval(()=>{document.visibilityState===`visible`&&$()},1e4),document.addEventListener(`visibilitychange`,Tn),typeof location<`u`&&location.hash===`#templates`&&(history.replaceState(null,``,location.pathname+location.search),Jt())}),te(()=>{I&&clearInterval(I),document.removeEventListener(`visibilitychange`,Tn)}),l(()=>{console.assert(H.status?.unlocked!==void 0||H.status===null,`$effect: unlocked accessed`),console.assert(re>=0,`$effect: gen counter present`),H.status?.unlocked&&$()}),l(()=>{if(console.assert(Array.isArray(v(s)),`$effect fast-poll: items array`),console.assert(typeof xi==`function`,`$effect fast-poll: helper present`),!v(s).some(e=>xi(e.flow??null)))return;let e=setInterval(()=>{document.visibilityState===`visible`&&$()},3e3);return()=>clearInterval(e)});function En(e){console.assert(typeof e.state==`string`,`healthChip: state is string`),console.assert(typeof e.interval_minutes==`number`,`healthChip: interval is number`);let t=e.state;return t===`draft`?{kind:``,label:`Preview`}:t===`commissioning`&&e.awaiting_yes?{kind:`accent`,label:`Needs your OK`}:t===`commissioning`?{kind:`accent`,label:`Commissioning`}:t===`broken`?{kind:`danger`,label:`Broken`}:t===`failing`?{kind:`warn`,label:`Failing`}:t===`degraded`?{kind:`warn`,label:`Degraded`}:t===`paused`?{kind:``,label:`Paused`}:ve(e.payload_at,e.interval_minutes)?{kind:`warn`,label:`Stale`}:{kind:`ok`,label:`Live`}}async function Dn(e){console.assert(typeof e.id==`string`,`runNow: id is string`),console.assert(v(_)===null||v(_)===e.id,`runNow: busy id matches or null`),O(_,e.id,!0);try{let t=await V.niRun(e.id),n=Kr(t);n?U(qr(n)):t.status===`error`&&O(g,t.kind?`Run failed (${t.kind}).`:`Run failed.`,!0),await $()}catch(e){let t=Gr(e);if(t)U(qr(t));else{let t=W(e);t&&O(g,t,!0)}}finally{O(_,null)}}async function On(e){console.assert(typeof e.id==`string`,`togglePause: id is string`),console.assert(typeof e.enabled==`boolean`,`togglePause: enabled is boolean`),O(_,e.id,!0);try{await V.niPatch(e.id,{enabled:!e.enabled}),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function kn(e){if(console.assert(typeof e.id==`string`,`remove: id is string`),console.assert(typeof e.title==`string`,`remove: title is string`),await ce({title:`Delete this item?`,body:`Delete “${e.title}” from your Neural Interface? Its history is removed too.`,confirmLabel:`Delete`,danger:!0})){O(_,e.id,!0);try{await V.niDelete(e.id),O(s,v(s).filter(t=>t.id!==e.id),!0)}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}}async function An(e){console.assert(e.state===`draft`,`activate: only drafts`),console.assert(typeof e.id==`string`,`activate: id is string`),O(_,e.id,!0);try{await V.niCommission(e.id),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function jn(e){console.assert(e.draft?.reason===`render_sites`,`activateSites: a draft waiting for its sites`),console.assert(typeof e.id==`string`,`activateSites: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niActivate(e.id),U(`Activated — check the card's reading.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function Mn(e,t){console.assert(Hr(e).some(e=>e.url===t),`switchFeed: one of the card's feeds`),console.assert(typeof e.id==`string`,`switchFeed: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let n=await V.niSwitchFeed(e.id,t);U(n.started===!1?`Switching to the feed — it starts as soon as a build slot frees up.`:`Switching to the feed — rebuilding the card from it.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function Nn(e,t){console.assert(e.state===`commissioning`,`validateLooksRight: only commissioning`),console.assert(typeof e.id==`string`,`validateLooksRight: id is string`),O(_,e.id,!0);try{let n=await V.niValidate(e.id,!0,void 0,t);U(Jr(Kr(n))||(n.state===`live`?`Confirmed — the card is live.`:`Confirmed — verifying with a fresh refresh.`)),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function Pn(e){console.assert(e.state===`commissioning`,`declineReading: only commissioning`),console.assert(!!e.awaiting_yes,`declineReading: only a card awaiting the user's YES`),O(_,e.id,!0);try{let t=await V.niValidate(e.id,!1);U(t.repick===`repick`?`Pick another source — that one won't be offered again.`:`Looking for another source…`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}function Fn(e){console.assert(e.state===`commissioning`,`openWrongNote: only commissioning`),console.assert(v(oe)===null,`openWrongNote: no other note prompt open`),O(oe,e,!0),O(me,``)}async function In(){if(console.assert(v(oe)!==null,`submitWrongNote: a target must be set`),console.assert(typeof v(me)==`string`,`submitWrongNote: note is string`),!v(oe)||v(S))return;let e=v(oe);O(_,e.id,!0),O(S,!0);try{await V.niValidate(e.id,!1,v(me).trim()||void 0),O(oe,null),O(me,``),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null),O(S,!1)}}let Ln=R(!1),Rn=typeof window<`u`?window.matchMedia(`(max-width: 560px)`):null;function zn(){O(Ln,Rn?.matches??!1,!0)}L(()=>(zn(),Rn?.addEventListener(`change`,zn),()=>Rn?.removeEventListener(`change`,zn)));let Bn=(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}})();function Vn(e){if(console.assert(e!==void 0,`pickClir: payload defined`),console.assert(typeof v(Ln)==`boolean`,`pickClir: phoneLayout boolean`),!e||typeof e!=`object`)return null;let t=e;if(t.type!==`form`||!t.clir||typeof t.clir!=`object`)return null;let n=t.clir;return v(Ln)?n.phone??n.desktop??null:n.desktop??n.phone??null}var Hn=f();n(`click`,c,Ct);var Un=y(Hn),Wn=e=>{var i=co(),a=y(i),c=h(b(a),2);k(a);var l=h(a,4),T=b(l);j(T),ee(T,e=>O(jt,e),()=>v(jt));var te=h(T,2),I=x(te,!0);k(l);var L=h(l,2),ne=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(At))),d(e,t)};t(L,e=>{v(At)&&e(ne)});var R=h(L,2),re=e=>{de(e,{block:!0})},V=e=>{fe(e,{icon:`monitor`,title:`Nothing on your Neural Interface yet`,body:`Type what you want to watch in the box above — “show me AAPL every 5 minutes” — then approve the source on the card.`,children:(e,t)=>{var n=Pi();B(`click`,n,()=>v(jt)?.focus()),d(e,n)},$$slots:{default:!0}})},H=e=>{var i=wa();p(i,21,()=>v(s),e=>e.id,(e,i)=>{let a=M(()=>En(v(i))),s=M(()=>v(i).state===`draft`),c=M(()=>Vn(v(i).payload)),l=M(()=>Se(v(i).display?.size,v(c))),m=M(()=>ye(v(i))),g=M(()=>v(m)===`failing`?`${yi(v(i).last_status)} · last tried ${_e(v(i).last_checked)}`:``),S=M(()=>Vr(v(i))),C=M(()=>zr(v(i))),w=M(()=>ni(v(i).fit));{let T=e=>{var n=Fi(),r=y(n),s=e=>{ue(e,{get kind(){return v(a).kind},children:(e,t)=>{D();var n=u();o(()=>N(n,v(a).label)),d(e,n)},$$slots:{default:!0}})};t(r,e=>{v(m)!==`fresh`&&e(s)});var c=h(r,2),l=e=>{ue(e,{kind:``,title:`This card includes a language model's reading of the data, not pure arithmetic.`,children:(e,t)=>{D();var n=u(`Interpreted`);d(e,n)},$$slots:{default:!0}})};t(c,e=>{v(i).interpreted&&e(l)});var f=h(c,2),p=e=>{ue(e,{kind:`accent`,onclick:()=>rn(v(i)),title:`The library updated this card's template — click to review and apply`,children:(e,t)=>{D();var n=u(`Update available`);d(e,n)},$$slots:{default:!0}})};t(f,e=>{v(i).template_update&&e(p)});var g=h(f,2),_=e=>{ue(e,{kind:`accent`,onclick:()=>un(v(i)),title:`A proposed fix from Claude — click to review`,children:(e,t)=>{D();var n=u(`Fix proposed`);d(e,n)},$$slots:{default:!0}})};t(g,e=>{v(i).l2_proposal&&e(_)});var b=h(g,2),x=e=>{ue(e,{kind:``,title:`This card's template is no longer in the library`,children:(e,t)=>{D();var n=u(`No longer in library`);d(e,n)},$$slots:{default:!0}})};t(b,e=>{v(i).template_gone&&e(x)}),d(e,n)},E=e=>{var n=Fi(),r=y(n),a=e=>{var t=Ii(),n=b(t),r=x(n,!0);k(t),o(()=>{n.disabled=v(_)===v(i).id,N(r,v(_)===v(i).id?`Fixing…`:`Fix`)}),B(`click`,n,()=>wt(v(i))),d(e,t)};t(r,e=>{!v(i).shell&&!v(i).flow&&(v(i).state===`failing`||v(i).state===`broken`||v(i).state===`degraded`||v(i).state===`commissioning`&&v(i).consecutive_failures>0)&&e(a)});var l=h(r,2),u=e=>{var t=Ri();p(t,21,()=>v(i).needs_credentials,e=>e.name,(e,t)=>{var n=Li(),r=b(n),a=h(b(r)),s=x(a,!0),c=h(a,1,!0);k(r);var l=h(r,2);k(n),o(e=>{N(s,v(t).label),N(c,e),l.disabled=v(_)===v(i).id||v(q)!==null},[()=>v(t).label.toLowerCase().endsWith(`key`)?``:` key`]),B(`click`,l,()=>gn(v(i),v(t))),d(e,n)}),k(t),d(e,t)};t(l,e=>{v(i).needs_credentials&&v(i).needs_credentials.length>0&&e(u)});var m=h(l,2),g=e=>{var t=Ri();p(t,21,()=>v(i).needs_params,e=>e.name,(e,t)=>{var n=zi(),r=b(n),a=h(b(r)),s=x(a,!0);k(r);var c=h(r,2);k(n),o(()=>{N(s,v(t).label),c.disabled=v(_)===v(i).id||v(Pt)!==null}),B(`click`,c,()=>yn(v(i),v(t))),d(e,n)}),k(t),d(e,t)};t(m,e=>{v(i).needs_params&&v(i).needs_params.length>0&&e(g)});var S=h(m,2),w=e=>{var t=Bi();d(e,t)},T=e=>{{let t=M(()=>v(_)===v(i).id),n=M(()=>v(Q)[v(i).id]??``);Qr(e,{get sites(){return v(C)},get busy(){return v(t)},get error(){return v(n)},onActivate:()=>jn(v(i))})}},E=e=>{var t=Vi(),n=b(t),r=x(n,!0);k(t),o(()=>{n.disabled=v(_)===v(i).id,N(r,v(_)===v(i).id?`Activating…`:`Activate`)}),B(`click`,n,()=>An(v(i))),d(e,t)};t(S,e=>{v(s)&&v(i).shell&&(!v(i).flow||v(i).flow.state===`failed`||v(i).flow.state===`unsupported`)&&v(i).flow?.question?.kind!==`model_consent`?e(w):v(s)&&!v(i).shell&&!v(i).flow&&v(C)?e(T,1):v(s)&&!v(i).shell&&!v(i).flow&&e(E,2)});var D=h(S,2),O=e=>{let n=M(()=>Hr(v(i)));var r=Hi(),a=h(b(r),2),s=x(a,!0),c=h(a,2),l=b(c),u=x(l,!0),f=h(l,2);k(c);var p=h(c,2),m=e=>{{let t=M(()=>v(_)===v(i).id),r=M(()=>v(Q)[v(i).id]??``);Be(e,{get candidates(){return v(n)},get busy(){return v(t)},get error(){return v(r)},onSwitch:e=>Mn(v(i),e)})}};t(p,e=>{v(n).length>0&&e(m)}),k(r),o(e=>{N(s,e),l.disabled=v(_)===v(i).id,N(u,v(_)===v(i).id?`Checking…`:`Yes, that’s it`),f.disabled=v(_)===v(i).id},[()=>Si(v(i).awaiting_yes)]),B(`click`,l,()=>Nn(v(i))),B(`click`,f,()=>Pn(v(i))),d(e,r)},A=e=>{var n=f(),r=y(n),a=e=>{var t=Ui();d(e,t)},s=e=>{{let t=M(()=>v(_)===v(i).id),n=M(()=>xe(v(i))),r=M(()=>v(i).query?.coverage);_i(e,{get payload(){return v(i).payload},get viewerTz(){return Bn},get busy(){return v(t)},get interpretation(){return v(n)},get coverage(){return v(r)},get fit(){return v(i).fit},onUse:e=>Nn(v(i),e),onWrong:()=>Fn(v(i))})}},l=e=>{var t=Wi(),n=h(b(t),2),r=b(n),a=x(r,!0),s=h(r,2);k(n),k(t),o(()=>{r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Checking…`:`Looks right`),s.disabled=v(_)===v(i).id}),B(`click`,r,()=>Nn(v(i))),B(`click`,s,()=>Fn(v(i))),d(e,t)};t(r,e=>{v(i).c2_ok?e(a):v(c)?e(s,1):e(l,-1)}),d(e,n)};t(D,e=>{v(i).awaiting_yes&&v(i).payload&&!v(i).flow?e(O):v(i).state===`commissioning`&&v(i).payload&&v(i).payload_slot!==`preview`&&e(A,1)}),d(e,n)},P=e=>{var n=Ji(),r=b(n),a=e=>{var t=Gi(),n=y(t),r=h(n,2),a=x(r,!0);o(()=>{n.disabled=v(_)===v(i).id||v(Bt)!==null,r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Running…`:`Run now`)}),B(`click`,n,()=>Cn(v(i))),B(`click`,r,()=>Dn(v(i))),d(e,t)},s=M(()=>!we(v(m),!!v(c),v(S)));t(r,e=>{v(s)&&e(a)});var l=h(r,2),u=h(b(l),2),f=b(u),p=e=>{var t=Ki(),n=y(t),r=h(n,2),a=x(r,!0);o(()=>{n.disabled=v(_)===v(i).id||v(Bt)!==null,r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Running…`:`Run now`)}),B(`click`,n,()=>Cn(v(i))),B(`click`,r,()=>Dn(v(i))),d(e,t)},g=M(()=>we(v(m),!!v(c),v(S)));t(f,e=>{v(g)&&e(p)});var C=h(f,2),w=x(C,!0),T=h(C,2),E=h(T,2),D=e=>{var t=qi();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>ht(v(i))),d(e,t)};t(E,e=>{v(i).shell||e(D)});var O=h(E,2),A=h(O,2);k(u),k(l),k(n),o(()=>{C.disabled=v(_)===v(i).id,N(w,v(i).enabled?`Pause`:`Resume`),T.disabled=v(_)===v(i).id,O.disabled=v(_)===v(i).id,A.disabled=v(_)===v(i).id}),B(`click`,C,()=>On(v(i))),B(`click`,T,()=>Tt(v(i))),B(`click`,O,()=>sn(v(i))),B(`click`,A,()=>kn(v(i))),d(e,n)},ee=M(()=>!!v(c)),te=M(()=>v(s)||!!v(i).awaiting_yes),I=M(()=>be(v(i))),L=M(()=>xe(v(i))),ne=M(()=>v(i).rendered===!0);Ie(e,{get title(){return v(i).title},get state(){return v(m)},get hasForm(){return v(ee)},get cols(){return v(l).cols},get rows(){return v(l).rows},get preview(){return v(te)},get footerText(){return v(I)},get interpretation(){return v(L)},get reason(){return v(g)},get rendered(){return v(ne)},get notice(){return v(S)},get fit(){return v(w)},chips:T,below:E,actions:P,children:(e,a)=>{var l=Ca(),m=y(l),g=e=>{var t=Yi(),n=b(t);ue(n,{kind:``,children:(e,t)=>{D();var n=u();o(()=>N(n,v(i).born===`flow`||v(i).born===`recipe`?`Preview — real data, not updating yet`:`Preview — sample data`)),d(e,n)},$$slots:{default:!0}}),k(t),d(e,t)};t(m,e=>{v(s)&&!v(i).flow&&e(g)});var C=h(m,2),w=e=>{var a=f(),s=y(a),c=e=>{let a=M(()=>yi(v(i).flow.error??``)),s=M(()=>v(i).flow.question?.kind===`model_consent`?v(i).flow.question:null);var c=aa(),l=y(c),u=x(l,!0),f=h(l,2),p=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(i).flow.reason??v(a)??`Creation didn’t finish.`)),d(e,t)};t(f,e=>{v(s)||e(p)});var m=h(f,2),g=e=>{var n=Qi(),r=y(n),a=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(s).prompt)),d(e,t)};t(r,e=>{v(s).prompt&&e(a)});var c=h(r,2),l=b(c),u=x(l),f=h(l,2),p=e=>{var t=Zi();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>xt(v(i),`local`)),d(e,t)};t(f,e=>{v(s).local&&e(p)}),k(c),o(()=>{l.disabled=v(_)===v(i).id,N(u,`Build with ${v(s).model??``}`)}),B(`click`,l,()=>xt(v(i),`allow`)),d(e,n)};t(m,e=>{v(s)&&e(g)});var S=h(m,2),C=e=>{var r=$i(),a=y(r),s=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(i).flow.question.prompt)),d(e,t)};t(a,e=>{v(i).flow.question.prompt&&e(s)});var c=h(a,2),l=b(c);j(l);var u=h(l,2);k(c),o(()=>{l.disabled=v(_)===v(i).id,u.disabled=v(_)===v(i).id||!v(_t)}),n(`submit`,c,e=>{e.preventDefault(),bt(v(i))}),F(l,()=>v(_t),e=>O(_t,e)),d(e,r)};t(S,e=>{v(i).flow.question?.kind===`supply_date`&&e(C)});var w=h(S,2),T=e=>{var n=ra(),r=b(n),a=e=>{var t=ea(),n=y(t),r=h(n,2);o(()=>{n.disabled=v(_)===v(i).id,r.disabled=v(_)===v(i).id}),B(`click`,n,()=>wt(v(i))),B(`click`,r,()=>ht(v(i))),d(e,t)};t(r,e=>{v(i).shell||e(a)});var s=h(r,2),c=e=>{var t=ta(),n=x(t,!0);o(()=>{t.disabled=v(_)===v(i).id,N(n,v(_)===v(i).id?`Retrying…`:`Retry`)}),B(`click`,t,()=>Nt(v(i))),d(e,t)},l=M(()=>v(i).shell&&v(i).flow.reopen?.includes(`retry`));t(s,e=>{v(l)&&e(c)});var u=h(s,2),f=e=>{var t=na();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>St(v(i))),d(e,t)},p=M(()=>v(i).shell&&v(i).flow.reopen?.includes(`pick_source`));t(u,e=>{v(p)&&e(f)}),k(n),d(e,n)};t(w,e=>{v(s)||e(T)});var E=h(w,2),D=e=>{var t=ia(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(E,e=>{v(Q)[v(i).id]&&e(D)}),o(()=>{r(l,1,z(v(s)?`ni-note-head`:`ni-status-fail ni-note-head`),`svelte-7uuxge`),N(u,v(s)?`Build with a model outside this computer?`:v(i).flow.state===`unsupported`?`Can’t build this card yet`:`Setup failed`)}),d(e,c)},l=e=>{var t=oa();d(e,t)},m=e=>{let r=M(()=>Ci(v(i).flow.suggestions)),a=M(()=>Rr(v(i).flow));var s=ha(),c=b(s),l=x(c,!0),u=h(c,2),f=e=>{var n=da();p(n,21,()=>v(r).sources,e=>e.url,(e,n)=>{var r=ua(),a=b(r),s=x(a,!0),c=h(a,2),l=e=>{var t=sa(),r=x(t,!0);o(e=>N(r,e),[()=>v(n).evidence.join(` — `)]),d(e,t)};t(c,e=>{v(n).evidence&&v(n).evidence.length>0&&e(l)});var u=h(c,2),f=e=>{var t=ca();d(e,t)},p=M(()=>v(n).needs?.includes(`key`));t(u,e=>{v(p)&&e(f)});var m=h(u,2),g=e=>{var t=la();d(e,t)},y=M(()=>v(n).needs?.includes(`contact`));t(m,e=>{v(y)&&e(g)}),k(r),o(()=>{a.disabled=v(_)===v(i).id,A(a,`title`,v(n).url),N(s,v(n).title)}),B(`click`,a,()=>vt(v(i),v(n).url)),d(e,r)}),k(n),d(e,n)};t(u,e=>{v(r).sources.length>0&&e(f)});var m=h(u,2),g=e=>{var t=pa(),n=h(y(t),2);p(n,21,()=>v(r).links,e=>e.url,(e,t)=>{var n=fa(),r=b(n),i=b(r);se(i,{name:`link`,size:14});var a=h(i);k(r);var s=h(r,2),c=x(s,!0);k(n),o(e=>{A(r,`href`,v(t).url),N(a,` ${(v(t).title||v(t).host)??``}`),N(c,e)},[()=>wi(v(t))]),d(e,n)}),k(n),d(e,t)};t(m,e=>{v(r).links.length>0&&e(g)});var S=h(m,2),C=b(S);j(C);var w=h(C,2),T=e=>{var t=ma(),n=x(t,!0);o(()=>N(n,v(a))),d(e,t)};t(w,e=>{v(a)&&e(T)});var E=h(w,2);k(S);var D=h(S,2),P=e=>{var t=ia(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(D,e=>{v(Q)[v(i).id]&&e(P)}),k(s),o(e=>{N(l,v(r).heading),A(C,`placeholder`,v(r).links.length>0?`Found the data? Paste its link (https://…)`:`Or paste any web page or API URL (https://…)`),C.disabled=v(_)===v(i).id,E.disabled=e},[()=>v(_)===v(i).id||v(it).trim().length<8]),n(`submit`,S,e=>{e.preventDefault(),vt(v(i))}),F(C,()=>v(it),e=>O(it,e)),d(e,s)},g=e=>{let r=M(()=>v(i).flow.access);var a=ba(),s=b(a),c=e=>{var n=_a(),a=y(n),s=b(a),c=h(s),l=e=>{var t=ga(),n=y(t);D(),o(()=>A(n,`href`,v(r).key.docs_url)),d(e,t)},f=e=>{var t=u();o(()=>N(t,`Get one from ${(v(r).provider||v(r).host)??``}, then paste it below.`)),d(e,t)};t(c,e=>{v(r).key.docs_url?e(l):e(f,-1)});var p=h(c);k(a);var m=h(a,2);j(m),o(()=>{N(s,`${(v(r).provider||v(r).host)??``} needs your own free key. `),N(p,` SmartBrain sends it only to ${v(r).host??``}, over a secure connection.`),A(m,`placeholder`,`Your ${(v(r).provider||v(r).host)??``} key`),m.disabled=v(_)===v(i).id,A(m,`aria-label`,`Your key for ${v(r).host??``}`)}),F(m,()=>v(at),e=>O(at,e)),d(e,n)};t(s,e=>{v(r).key&&e(c)});var l=h(s,2),f=e=>{var t=va(),n=y(t),a=x(n),s=h(n,2);j(s),o(()=>{N(a,`${(v(r).provider||v(r).host)??``} asks automated requests for a contact
- email. SmartBrain sends yours only to sources with this rule, and asks once.`),s.disabled=v(_)===v(i).id}),F(s,()=>v(ot),e=>O(ot,e)),d(e,t)};t(l,e=>{v(r).contact&&e(f)});var p=h(l,2),m=x(p,!0),g=h(p,2),S=e=>{var t=ya(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(g,e=>{v(Q)[v(i).id]&&e(S)}),k(a),o(e=>{p.disabled=e,N(m,v(_)===v(i).id?`Saving…`:`Continue`)},[()=>v(_)===v(i).id||!!v(r).key&&v(at).trim().length===0||v(r).contact&&v(ot).trim().length<6]),n(`submit`,a,e=>{e.preventDefault(),yt(v(i))}),d(e,a)},S=e=>{var t=ma(),n=x(t,!0);o(e=>N(n,e),[()=>bi(v(i).flow)]),d(e,t)};t(s,e=>{v(i).flow.state===`failed`||v(i).flow.state===`unsupported`?e(c):v(i).flow.state===`source`&&v(i).flow.suggestions===void 0?e(l,1):v(i).flow.state===`source`?e(m,2):v(i).flow.state===`awaiting_access`&&v(i).flow.access?e(g,3):e(S,-1)}),d(e,a)},T=e=>{var n=f(),r=y(n),a=e=>{},o=M(()=>Ce(v(i),!!v(c))),s=e=>{Sn(e,{get clir(){return v(c)},get viewerTz(){return Bn}})},l=e=>{Ar(e,{get node(){return v(i).payload}})};t(r,e=>{v(o)?e(a):v(c)?e(s,1):e(l,-1)}),d(e,n)},E=e=>{let n=M(()=>hn(v(i)));var r=f(),a=y(r),s=e=>{var t=xa(),r=h(b(t)),i=x(r),a=h(r);k(t),o(()=>{N(i,`${v(n).friendly??``} (${v(n).raw??``})`),N(a,`,
- ${v(n).attempts??``} attempt${v(n).attempts===1?``:`s`} · last tried ${v(n).tried??``}`)}),d(e,t)},c=e=>{var t=Sa();d(e,t)};t(a,e=>{v(n).show?e(s):v(S)||e(c,1)}),d(e,r)};t(C,e=>{v(i).flow?e(w):v(i).payload?e(T,1):e(E,-1)}),d(e,l)},$$slots:{chips:!0,below:!0,actions:!0,default:!0}})}}),k(i),d(e,i)};t(R,e=>{v(m)?v(s).length===0?e(V,1):e(H,-1):e(re)});var ce=h(R,2),U=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(g))),d(e,t)};t(ce,e=>{v(g)&&e(U)});var W=h(ce,2),ve=e=>{le(e,{open:!0,label:`Refine this card`,onclose:()=>{O(ft,null),O(pt,``)},children:(e,t)=>{var n=Ea(),r=h(y(n),4);C(r);var i=h(r,2),a=b(i),s=h(a,2),c=x(s,!0);k(i),o(e=>{r.disabled=v(mt),s.disabled=e,N(c,v(mt)?`Sending…`:`Rebuild`)},[()=>v(mt)||v(pt).trim().length<3]),F(r,()=>v(pt),e=>O(pt,e)),B(`click`,a,()=>{O(ft,null),O(pt,``)}),B(`click`,s,()=>void gt()),d(e,n)},$$slots:{default:!0}})};t(W,e=>{v(ft)&&e(ve)});var J=h(W,2),Ct=e=>{le(e,{open:!0,label:`What went wrong?`,onclose:()=>{O(oe,null),O(me,``)},children:(e,t)=>{var n=Da(),r=h(y(n),4);C(r);var i=h(r,2),a=b(i),s=h(a,2),c=x(s,!0);k(i),o(()=>{a.disabled=v(S),s.disabled=v(S),N(c,v(S)?`Sending…`:`Send`)}),F(r,()=>v(me),e=>O(me,e)),B(`click`,a,()=>{O(oe,null),O(me,``)}),B(`click`,s,In),d(e,n)},$$slots:{default:!0}})};t(J,e=>{v(oe)&&e(Ct)});var Ft=h(J,2),qt=e=>{le(e,{open:!0,alert:!0,label:`Apply library update?`,onclose:()=>{v(Ve)||O(ze,null)},children:(e,t)=>{var n=Oa(),r=h(y(n),2),i=h(b(r)),a=x(i);D(),k(r);var s=h(r,2),c=b(s),l=h(c,2),u=x(l,!0);k(s),o(()=>{N(a,`“${v(ze).title??``}”`),c.disabled=v(Ve),l.disabled=v(Ve),N(u,v(Ve)?`Applying…`:`Apply update`)}),B(`click`,c,()=>{O(ze,null)}),B(`click`,l,an),d(e,n)},$$slots:{default:!0}})};t(Ft,e=>{v(ze)&&e(qt)});var Jt=h(Ft,2),on=e=>{le(e,{open:!0,size:`md`,label:`A proposed fix from Claude`,onclose:()=>{v(Ge)||dn()},children:(e,n)=>{var r=ja(),i=h(y(r),4),a=e=>{de(e,{block:!0})},s=e=>{var t=ka();d(e,t)},c=e=>{var t=Aa(),n=b(t),r=h(b(n),4),i=x(r,!0),a=h(r,4),s=x(a,!0);k(n);var c=h(n,2),l=h(b(c),4),u=x(l,!0),f=h(l,4),p=x(f,!0);k(c),k(t),o((e,t,n,r)=>{N(i,e),N(s,t),N(u,n),N(p,r)},[()=>Mi(v(Ke).extract),()=>Mi(v(Ke).transform),()=>Mi(v(qe).extract),()=>Mi(v(qe).transform)]),d(e,t)};t(i,e=>{v(We)?e(a):v(Ue)?e(c,-1):e(s,1)});var l=h(i,2),u=b(l),f=h(u,2),p=h(f,2),m=x(p,!0);k(l),o(()=>{u.disabled=v(Ge),f.disabled=v(Ge)||v(We)||!v(Ue),p.disabled=v(Ge)||v(We)||!v(Ue),N(m,v(Ge)?`Applying…`:`Apply`)}),B(`click`,u,dn),B(`click`,f,pn),B(`click`,p,fn),d(e,r)},$$slots:{default:!0}})};t(Jt,e=>{v(He)&&e(on)});var mn=h(Jt,2),$=e=>{le(e,{open:!0,label:`Repair settings`,onclose:()=>{v(Ze)||cn()},children:(e,n)=>{var r=Pa(),i=y(r),a=x(i),s=h(i,2),c=e=>{de(e,{block:!0})},l=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Qe)||`Couldn’t load this card.`)),d(e,t)},u=e=>{var n=Na(),r=h(y(n),2),i=b(r);j(i),D(2),k(r);var a=h(r,2),s=b(a);j(s),D(2),k(a);var c=h(a,2),l=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(Qe))),d(e,t)};t(c,e=>{v(Qe)&&e(l)}),o(()=>{i.disabled=v(Ze),s.disabled=v(Ze)}),E(i,()=>v($e),e=>O($e,e)),E(s,()=>v(et),e=>O(et,e)),d(e,n)};t(s,e=>{v(Xe)?e(c):v(Ye)?e(u,-1):e(l,1)});var f=h(s,2),p=b(f),m=h(p,2),g=x(m,!0);k(f),o(()=>{N(a,`Repair settings — “${v(Je).title??``}”`),p.disabled=v(Ze),m.disabled=v(Ze)||v(Xe)||!v(Ye),N(g,v(Ze)?`Saving…`:`Save`)}),B(`click`,p,cn),B(`click`,m,ln),d(e,r)},$$slots:{default:!0}})};t(mn,e=>{v(Je)&&e($)});var Tn=h(mn,2),Ln=e=>{le(e,{open:!0,label:`Add key`,onclose:()=>{v(Z)||_n()},children:(e,n)=>{var r=Ia(),i=y(r),a=x(i),s=h(i,4),c=e=>{de(e,{block:!0})},l=e=>{var n=Fa(),r=y(n),i=b(r),a=x(i,!0),s=h(i,2);j(s),k(r);var c=h(r,2),l=h(b(c),2);j(l),k(c);var u=h(c,2),f=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(rt))),d(e,t)};t(u,e=>{v(rt)&&e(f)}),o(()=>{N(a,v(tt)),s.disabled=v(Z),l.disabled=v(Z)}),F(s,()=>v(Y),e=>O(Y,e)),F(l,()=>v(X),e=>O(X,e)),d(e,n)};t(s,e=>{v(nt)?e(c):e(l,-1)});var u=h(s,2),f=b(u),p=h(f,2),m=x(p,!0);k(u),o(e=>{N(a,`Add key — ${v(tt)??``}`),f.disabled=v(Z),p.disabled=e,N(m,v(Z)?`Saving…`:`Save`)},[()=>v(Z)||v(nt)||!v(Y)||!v(X).trim()]),B(`click`,f,_n),B(`click`,p,vn),d(e,r)},$$slots:{default:!0}})};t(Tn,e=>{v(q)&&e(Ln)});var Rn=h(Tn,2),zn=e=>{le(e,{open:!0,label:`Fill in`,onclose:()=>{v(Rt)||bn()},children:(e,n)=>{var r=La(),i=y(r),a=x(i),s=h(i,4),c=b(s),l=x(c,!0),u=h(c,2);j(u),k(s);var f=h(s,2),p=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(zt))),d(e,t)};t(f,e=>{v(zt)&&e(p)});var m=h(f,2),g=b(m),_=h(g,2),S=x(_,!0);k(m),o(e=>{N(a,`Fill in — ${v(It)??``}`),N(l,v(It)),u.disabled=v(Rt),g.disabled=v(Rt),_.disabled=e,N(S,v(Rt)?`Saving…`:`Save`)},[()=>v(Rt)||!v(Lt).trim()]),F(u,()=>v(Lt),e=>O(Lt,e)),B(`click`,g,bn),B(`click`,_,xn),d(e,r)},$$slots:{default:!0}})};t(Rn,e=>{v(Pt)&&e(zn)});var Hn=h(Rn,2),Un=e=>{le(e,{open:!0,label:`Edit card`,onclose:()=>{v(ut)||Et()},children:(e,n)=>{var r=Ra(),i=y(r),a=x(i),s=h(i,2),c=h(b(s),2);j(c),k(s);var l=h(s,2),u=h(b(l),2);j(u),k(l);var f=h(l,2),p=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(dt))),d(e,t)};t(f,e=>{v(dt)&&e(p)});var m=h(f,2),g=b(m),_=h(g,2),S=x(_,!0);k(m),o(()=>{N(a,`Edit — ${v(st).title??``}`),c.disabled=v(ut),u.disabled=v(ut),g.disabled=v(ut),_.disabled=v(ut),N(S,v(ut)?`Saving…`:`Save`)}),F(c,()=>v(ct),e=>O(ct,e)),F(u,()=>v(lt),e=>O(lt,e)),B(`click`,g,Et),B(`click`,_,Dt),d(e,r)},$$slots:{default:!0}})};t(Hn,e=>{v(st)&&e(Un)});var Wn=h(Hn,2),Gn=e=>{le(e,{open:!0,label:`Run history`,onclose:wn,children:(e,n)=>{var r=Ua(),i=y(r),a=x(i),s=h(i,2),c=e=>{de(e,{block:!0})},l=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ut))),d(e,t)},u=e=>{var t=za();d(e,t)},f=e=>{var n=Ha();p(n,21,()=>v(Vt).runs,P,(e,n)=>{let r=M(()=>yi(v(n).error));var i=Va(),a=b(i),s=x(a,!0),c=h(a,2),l=x(c,!0),u=h(c,2),f=e=>{var t=Ba(),n=x(t);o(()=>N(n,`— ${v(r)??``}`)),d(e,t)};t(u,e=>{v(r)&&e(f)}),k(i),o((e,t)=>{N(s,e),N(l,t)},[()=>_e(v(n).ts),()=>pe(v(n).status)]),d(e,i)}),k(n),d(e,n)};t(s,e=>{v(Ht)?e(c):v(Ut)&&!v(Vt)?e(l,1):!v(Vt)||v(Vt).runs.length===0?e(u,2):e(f,-1)});var m=h(s,2),g=x(m);o(()=>N(a,`Recent runs — “${v(Bt).title??``}”`)),B(`click`,g,wn),d(e,r)},$$slots:{default:!0}})};t(Wn,e=>{v(Bt)&&e(Gn)});var Kn=h(Wn,2),qn=e=>{le(e,{open:!0,size:`lg`,label:`Global Library`,onclose:()=>{!v(K)&&!v(Me)&&Yt()},children:(e,n)=>{var r=so(),i=h(y(r),2),a=e=>{de(e,{block:!0})},s=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ee)||`Couldn't load the library.`)),d(e,t)},c=e=>{var n=Wa(),r=h(b(n),2),i=b(r),a=h(b(i),2),s=x(a,!0);k(i);var c=h(i,2),l=h(b(c),2),u=x(l,!0);k(c),k(r);var f=h(r,6),p=b(f);j(p);var m=h(p,2),g=x(m,!0);k(f);var _=h(f,2),y=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(Re))),d(e,t)};t(_,e=>{v(Re)&&e(y)}),k(n),o(()=>{N(s,v(G).fingerprint??`(unknown)`),N(u,v(G).blocked.offered_fingerprint),m.disabled=v(Le)||!v(Fe),N(g,v(Le)?`Pinning…`:`Trust new key`)}),B(`keydown`,p,e=>e.key===`Enter`&&v(Fe)&&$t()),F(p,()=>v(Fe),e=>O(Fe,e)),B(`click`,m,$t),d(e,n)},l=e=>{var n=Ga(),r=h(y(n),4),i=b(r);j(i),A(i,`placeholder`,he);var a=h(i,2),s=x(a,!0);k(r);var c=h(r,2),l=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(Ee))),d(e,t)};t(c,e=>{v(Ee)&&e(l)}),o(e=>{a.disabled=e,N(s,v(K)?`Connecting…`:`Connect`)},[()=>v(K)||!v(De).trim()]),B(`keydown`,i,e=>e.key===`Enter`&&!v(K)&&Xt()),F(i,()=>v(De),e=>O(De,e)),B(`click`,a,Xt),d(e,n)},m=e=>{let n=M(()=>v(Ae));var r=Xa(),i=y(r),a=b(i),s=h(a,2),c=x(s,!0);k(i);var l=h(i,2),u=x(l,!0),m=h(l,4);p(m,21,()=>v(n).sources,P,(e,t)=>{var n=Ka(),r=b(n),i=x(r,!0);k(n),o(()=>N(i,v(t).host?`${v(t).host}${v(t).path}`:v(t).type===`internal.kb`?`your knowledge base (no network)`:v(t).type===`model`?`generated by your local model (no fetch)`:v(t).type)),d(e,n)}),k(m);var g=h(m,2),_=e=>{var r=Ya(),i=h(y(r),2);p(i,21,()=>v(n).params,e=>e.name,(e,n)=>{var r=f(),i=y(r),a=e=>{var t=qa(),r=b(t),i=x(r,!0);D(2),k(t),o(()=>N(i,v(n).label)),d(e,t)},s=e=>{var t=Ja(),r=b(t),i=x(r,!0),a=h(r,2);j(a),k(t),o(()=>{N(i,v(n).label),A(a,`type`,v(n).kind===`number`?`number`:`text`),A(a,`placeholder`,v(n).label)}),F(a,()=>v(je)[v(n).name],e=>v(je)[v(n).name]=e),d(e,t)};t(i,e=>{v(n).kind===`secret`?e(a):e(s,-1)}),d(e,r)}),k(i),d(e,r)};t(g,e=>{v(n).params.length>0&&e(_)});var S=h(g,2),C=h(b(S),2),w=e=>{let t=M(()=>Vn(v(n).preview_payload));Sn(e,{get clir(){return v(t)},get viewerTz(){return Bn}})},T=M(()=>Vn(v(n).preview_payload)),E=e=>{Ar(e,{get node(){return v(n).preview_payload}})};t(C,e=>{v(T)?e(w):e(E,-1)}),k(S);var O=h(S,2),ee=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(Ne))),d(e,t)};t(O,e=>{v(Ne)&&e(ee)});var te=h(O,2),I=b(te),L=h(I,2),ne=x(L,!0);k(te),o(()=>{N(c,v(n).title),N(u,v(n).goal),I.disabled=v(Me),L.disabled=v(Me)||!!v(Kt),N(ne,v(Me)?`Installing…`:`Install as draft`)}),B(`click`,a,tn),B(`click`,I,tn),B(`click`,L,nn),d(e,r)},g=e=>{var n=oo(),r=y(n),i=b(r),a=x(i,!0),s=h(i,2),c=e=>{ue(e,{kind:``,children:(e,t)=>{D();var n=u();o(()=>N(n,`v${v(G).seq??``}`)),d(e,n)},$$slots:{default:!0}})};t(s,e=>{v(G).seq!==void 0&&e(c)});var l=h(s,2),f=e=>{var t=Za(),n=x(t);o(e=>N(n,`Last checked ${e??``}`),[()=>_e(v(G).last_checked)]),d(e,t)};t(l,e=>{v(G).last_checked&&e(f)});var m=h(l,4),g=x(m,!0),_=h(m,2);k(r);var S=h(r,2),C=e=>{var t=Qa(),n=x(t,!0);o(()=>N(n,v(Pe))),d(e,t)};t(S,e=>{v(Pe)&&e(C)});var T=h(S,2),E=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ee))),d(e,t)};t(T,e=>{v(Ee)&&e(E)});var ee=h(T,2),te=e=>{var t=Ta(),n=x(t);o(()=>N(n,`Last check failed: ${v(G).last_error??``}`)),d(e,t)},I=e=>{var t=$a();d(e,t)};t(ee,e=>{v(G).last_error?e(te):v(G).unreachable&&e(I,1)});var L=h(ee,2),ne=b(L);j(ne);var R=h(ne,2),re=e=>{var t=to(),n=b(t);n.value=n.__value=``;var r=h(n);p(r,16,()=>v(Gt),e=>e,(e,t)=>{var n=eo(),r=x(n,!0),i={};o(()=>{N(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),d(e,n)}),k(t),w(t),ie(t,()=>v(ke),e=>O(ke,e)),d(e,t)};t(R,e=>{v(Gt).length>0&&e(re)}),k(L);var z=h(L,2),ae=e=>{fe(e,{icon:`monitor`,title:`No templates yet`,body:`The library is connected but empty right now — try Check now.`})},V=e=>{var t=no();d(e,t)},H=e=>{var n=ao();p(n,21,()=>v(Wt),e=>e.id,(e,n)=>{var r=io(),i=b(r),a=b(i),s=x(a,!0),c=h(a,2);ue(c,{kind:``,children:(e,t)=>{D();var r=u();o(()=>N(r,v(n).category)),d(e,r)},$$slots:{default:!0}}),k(i);var l=h(i,2),f=x(l,!0),m=h(l,4);p(m,21,()=>v(n).sources,P,(e,t)=>{var n=Ka(),r=b(n),i=x(r,!0);k(n),o(()=>N(i,v(t).host?`${v(t).host}${v(t).path}`:v(t).type===`internal.kb`?`your knowledge base (no network)`:v(t).type===`model`?`generated by your local model (no fetch)`:v(t).type)),d(e,n)}),k(m);var g=h(m,2),_=e=>{var t=ro(),r=x(t,!0);o(()=>N(r,v(n).notes)),d(e,t)};t(g,e=>{v(n).notes&&e(_)});var y=h(g,2),S=b(y),C=e=>{let t=M(()=>Vn(v(n).preview_payload));Sn(e,{get clir(){return v(t)},get viewerTz(){return Bn}})},w=M(()=>Vn(v(n).preview_payload)),T=e=>{Ar(e,{get node(){return v(n).preview_payload}})};t(S,e=>{v(w)?e(C):e(T,-1)}),k(y);var E=h(y,2),O=x(E);k(r),o(()=>{N(s,v(n).title),N(f,v(n).goal)}),B(`click`,O,()=>en(v(n))),d(e,r)}),k(n),d(e,n)};t(z,e=>{(v(G).templates??[]).length===0?e(ae):v(Wt).length===0?e(V,1):e(H,-1)}),o(e=>{A(i,`title`,v(G).url??``),N(a,e),m.disabled=v(K),N(g,v(K)?`Checking…`:`Check now`),_.disabled=v(K)},[()=>ki(v(G).fingerprint)]),B(`click`,m,Zt),B(`click`,_,Qt),F(ne,()=>v(Oe),e=>O(Oe,e)),d(e,n)};t(i,e=>{v(Te)?e(a):v(G)?v(G).blocked?e(c,2):v(G).connected?v(Ae)?e(m,4):e(g,-1):e(l,3):e(s,1)});var _=h(i,2),S=x(_);o(()=>S.disabled=v(K)||v(Me)),B(`click`,S,Yt),d(e,r)},$$slots:{default:!0}})};t(Kn,e=>{v(ge)&&e(qn)}),o(e=>{T.disabled=v(kt),te.disabled=e,N(I,v(kt)?`Starting…`:`Create card`)},[()=>v(kt)||v(Ot).trim().length<3]),B(`click`,c,()=>ae(`/ni/library`)),n(`submit`,l,e=>{e.preventDefault(),Mt()}),F(T,()=>v(Ot),e=>O(Ot,e)),d(e,i)},Gn=e=>{de(e,{block:!0})};t(Un,e=>{H.status?.unlocked?e(Wn):e(Gn,-1)}),d(i,Hn),ne()}g([`click`,`keydown`]);export{lo as component};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/11.BQRO1JQZ.js b/app/smartbrain_3000/web/_app/immutable/nodes/11.SjX2dPtJ.js
similarity index 97%
rename from app/smartbrain_3000/web/_app/immutable/nodes/11.BQRO1JQZ.js
rename to app/smartbrain_3000/web/_app/immutable/nodes/11.SjX2dPtJ.js
index a7ced232..57120a92 100644
--- a/app/smartbrain_3000/web/_app/immutable/nodes/11.BQRO1JQZ.js
+++ b/app/smartbrain_3000/web/_app/immutable/nodes/11.SjX2dPtJ.js
@@ -1,4 +1,4 @@
-import{$ as e,A as t,B as n,C as r,E as i,G as a,L as o,M as s,O as c,P as l,Q as u,R as d,V as f,X as p,Y as m,Z as h,a as g,b as _,ct as v,d as y,dt as b,et as x,ft as S,g as C,h as w,it as T,j as E,k as ee,m as D,pt as O,r as k,st as A,tt as j,y as te,z as M}from"../chunks/BJLLtWYH.js";import{t as N}from"../chunks/BxvjB08B.js";import"../chunks/xihTtKlq.js";import"../chunks/Cmegxfzj.js";import{n as P}from"../chunks/CoHYJ8BJ.js";import{t as F}from"../chunks/y2R953fa.js";import{t as ne}from"../chunks/CEPrmzat.js";import{t as re}from"../chunks/CwtHPkdz.js";import{t as ie}from"../chunks/BqUz5g-m.js";import{n as ae}from"../chunks/uFPkKLC1.js";import{t as I}from"../chunks/kqW19h2g.js";import{t as L}from"../chunks/1gl_kuJz.js";import{t as R}from"../chunks/DKVRJME0.js";import{t as oe}from"../chunks/DV4tMnTy.js";var z=l(`
`),B=l(`
`),V=l(`
`);function H(e,n){let r=g(n,`hint`,3,``),o=g(n,`error`,3,``);var c=V(),l=m(c),d=m(l),f=h(d,!0),p=u(d,2);i(p,()=>n.children??O),S(l);var _=u(l,2),v=e=>{var t=z(),n=h(t,!0);a(()=>E(n,o())),s(e,t)},y=e=>{var t=B(),n=h(t,!0);a(()=>E(n,r())),s(e,t)};t(_,e=>{o()?e(v):r()&&e(y,1)}),S(c),a(()=>E(f,n.label)),s(e,c)}var se=[{id:``,label:`All`},{id:`curated`,label:`Curated`},{id:`harvested`,label:`Harvested`},{id:`local`,label:`Mine`}],U={http_json:`JSON`,http_csv:`CSV`,http_xml:`XML`,rss:`RSS feed`,atom:`Atom feed`,gtfs:`Transit schedule (GTFS)`,gtfs_rt:`Transit realtime (GTFS-RT)`,gbfs:`Bike share (GBFS)`,ics:`Calendar (ICS)`,html:`Web page`,image:`Image`,text:`Text`},W={official:`Official`,primary:`Primary`,aggregator:`Aggregator`,community:`Community`},G={curated:`Curated`,provider_trusted:`Provider-trusted`,harvested:`Harvested`,local:`Yours`};function ce(e,t){return console.assert(typeof e==`string`,`statusLabel: status is string`),console.assert(typeof t==`string`,`statusLabel: auth is string`),e===`ok`?`Works`:e===`degraded`?`Degraded`:e===`failed`||e===`refused`?`Not working`:t===`none`?`Unchecked`:`Needs a key`}function le(e,t){return console.assert(typeof e==`string`,`statusChipKind: status is string`),console.assert(typeof t==`string`,`statusChipKind: auth is string`),e===`ok`?`ok`:e===`degraded`?`warn`:e===`failed`||e===`refused`?`danger`:``}function ue(e){return console.assert(typeof e==`string`,`authorityLabel: input is string`),console.assert(e in W,`authorityLabel: known enum`),W[e]??`Unknown`}function de(e){return console.assert(typeof e==`string`,`tierLabel: input is string`),console.assert(e in G,`tierLabel: known enum`),G[e]??e}function fe(e){return console.assert(typeof e==`string`,`accessKindLabel: input is string`),console.assert(e in U,`accessKindLabel: known enum`),U[e]??e}function pe(){console.assert(typeof U==`object`,`accessKindOptions: labels present`);let e=Object.keys(U);return console.assert(e.length>0,`accessKindOptions: at least one kind`),e.map(e=>({id:e,label:U[e]}))}var K={public_domain:`Public domain`,open_license:`Open license`,terms_allow:`Terms allow use`,unverified:`Terms not confirmed`};function me(e){return console.assert(typeof e==`string`,`termsLabel: input is string`),console.assert(!0,`termsLabel: total`),K[e]??e}function he(e,t){console.assert(typeof e==`string`,`labelCategory: id is string`),console.assert(Array.isArray(t),`labelCategory: tax is array`);let[n,r]=e.split(`/`),i=t.find(e=>e.id===n);if(!i)return e;let a=r?i.subcategories.find(e=>e.id===r):null;return r&&a?`${i.label} › ${a.label}`:i.label}function ge(e){console.assert(typeof e==`object`,`buildSearchQuery: opts is object`),console.assert(e.limit>0,`buildSearchQuery: limit is positive`);let t={offset:e.offset,limit:e.limit},n=e.q.trim();return n&&(t.q=n),e.category&&(t.category=e.category),e.subcategory&&(t.subcategory=e.subcategory),e.tier&&(t.tier=e.tier),t}function q(e){return console.assert(e==null||typeof e==`number`,`formatCount: number|null|undefined`),console.assert(!0,`formatCount: total`),typeof e!=`number`||!Number.isFinite(e)||e<0?`0`:Math.floor(e).toLocaleString(`en-US`)}function _e(e){console.assert(typeof e==`object`,`validateLocalForm: input is object`),console.assert(typeof e.name==`string`,`validateLocalForm: name is string`);let t=e.name.trim();if(t.length<2||t.length>120)return{field:`name`,message:`Give the source a name (2–120 characters).`};let n=e.url.trim();if(!n.startsWith(`https://`)||n.length>2e3)return{field:`url`,message:`The address must start with https://`};if(e.description.trim().length>600)return{field:`description`,message:`Keep the description under 600 characters.`};let r=e.category.trim();return!r||!r.includes(`/`)?{field:`category`,message:`Choose a category.`}:null}function ve(e,t){console.assert(typeof e==`object`,`rowCategoryPhrase: row is object`),console.assert(Array.isArray(t),`rowCategoryPhrase: tax is array`);let n=Array.isArray(e.categories)?e.categories:[];return n.length===0?``:n.slice(0,2).map(e=>he(e,t)).join(` · `)}var J={realtime:`Live`,minutes:`Every few minutes`,hourly:`Hourly`,daily:`Daily`,weekly:`Weekly`,monthly:`Monthly`,quarterly:`Every quarter`,annual:`Yearly`,irregular:`Whenever the provider publishes`,static:`Rarely changes`};function ye(e){console.assert(e==null||typeof e==`string`,`cadenceLabel: cadence is a string or empty`);let t=J[(e||`irregular`).trim()]??J.irregular;return console.assert(t.length>0,`cadenceLabel: never empty`),t}function be(e,t){if(console.assert(e==null||typeof e==`string`,`checkedOnLabel: iso is a string`),!e)return``;let n=Date.parse(e);if(Number.isNaN(n))return``;let r=new Intl.DateTimeFormat(t,{month:`short`,day:`numeric`,year:`numeric`}).format(n);return console.assert(r.length>0,`checkedOnLabel: formatted date is non-empty`),r}var xe=l(`
`),Se=l(``),Ce=l(`
`),we=l(``),Te=l(`
Browse the SmartBrain Library
About 18 MB. Takes a few seconds on a normal connection.
`,1);function me(a,s){f(s,!0);let _=w(e([])),x=w(`My phone`),A=w(``),j=w(``),M=w(``),N=w(``),P=w(!1),F=w(`idle`),I=w(0),L;function R(){L&&clearInterval(L),L=void 0}function z(e){return`${Math.floor(e/60)}:${String(e%60).padStart(2,`0`)}`}let B=e=>k(e),V=e=>e.last_seen?`last seen ${k(e.last_seen)}`:`never connected`,H=e=>e.length===8?`${e.slice(0,4)}-${e.slice(4)}`:e;S(R);async function U(){m(A,``);try{m(_,(await E.listDevices()).devices,!0)}catch(e){m(A,O(e),!0)}}C(U);async function W(){m(P,!0),m(A,``),m(N,``),m(j,``),m(M,``),R();try{let e=await E.startPairCode(c(x).trim()||`device`);m(N,e.code,!0),m(F,`waiting`),m(I,e.expires_in,!0);let t=(()=>{try{return new URL(e.signaling_url).host}catch{return window.location.host}})();m(M,t,!0),m(j,await ie.toDataURL(`https://${t}`,{width:240,margin:1}),!0);let n=0;L=setInterval(async()=>{if(m(I,Math.max(0,c(I)-1),!0),c(I)<=0)m(F,`expired`),R();else if(++n%2==0)try{let e=(await E.pairCodeStatus()).state;e===`paired`?(m(F,`paired`),R(),await U()):(e===`expired`||e===`none`)&&(m(F,`expired`),R())}catch{}},1e3),await U()}catch(e){m(A,O(e),!0)}finally{m(P,!1)}}async function G(e){if(await D({title:`Revoke device`,body:`Revoke this device? It will no longer be able to connect.`,confirmLabel:`Revoke`,danger:!0}))try{await E.deleteDevice(e),await U()}catch(e){m(A,O(e),!0)}}var K=pe(),q=o(l(K),4),J=e=>{var t=oe(),a=o(u(t),2);i(a,17,()=>c(_),e=>e.device_id,(e,t)=>{var i=ae(),a=u(i),s=o(u(a)),l=o(s),f=d(l);p(2),h(a);var m=o(a,2);h(i),n((e,n)=>{y(s,` ${c(t).label??``} `),y(f,`(paired ${e??``} · ${n??``})`)},[()=>B(c(t).created_at),()=>V(c(t))]),T(`click`,m,()=>G(c(t).device_id)),r(e,i)}),h(t),r(e,t)};t(q,e=>{c(_).length&&e(J)});var Y=o(q,2),X=o(u(Y),4);v(X);var Z=o(X,2),Q=u(Z),te=d(Q,!0);h(Z);var $=o(Z,2),ne=e=>{var i=de(),a=l(i),s=u(a),f=u(s),m=e=>{var t=se(),i=l(t);p(2),n(()=>g(i,`src`,c(j))),r(e,t)};t(f,e=>{c(j)&&e(m)}),h(s);var _=o(s,2),v=u(_),b=o(u(v)),x=d(b,!0);p(),h(v);var S=o(v,4),C=o(u(S)),ee=d(C,!0),w=o(C,2),T=d(w);h(S),h(_),h(a);var E=o(a,2),D=e=>{var t=ce();r(e,t)},O=e=>{var t=le();r(e,t)},k=e=>{var t=ue();r(e,t)};t(E,e=>{c(F)===`waiting`?e(D):c(F)===`paired`?e(O,1):c(F)===`expired`&&e(k,2)}),n((e,t)=>{y(x,c(M)),y(ee,e),y(T,`expires in ${t??``}`)},[()=>H(c(N)),()=>z(c(I))]),r(e,i)};t($,e=>{c(N)&&e(ne)}),h(Y);var re=o(Y,2),me=e=>{var t=fe(),i=d(t,!0);n(()=>y(i,c(A))),r(e,t)};t(re,e=>{c(A)&&e(me)}),n(()=>{Q.disabled=c(P),y(te,c(P)?`Starting…`:`Pair a new phone`)}),b(X,()=>c(x),e=>m(x,e)),T(`click`,Q,W),r(a,K),ee()}s([`click`]);export{me as component};
\ No newline at end of file
diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/18.COwa8j3Q.js b/app/smartbrain_3000/web/_app/immutable/nodes/18.CZM1LVRi.js
similarity index 97%
rename from app/smartbrain_3000/web/_app/immutable/nodes/18.COwa8j3Q.js
rename to app/smartbrain_3000/web/_app/immutable/nodes/18.CZM1LVRi.js
index f4c8d127..6380a87a 100644
--- a/app/smartbrain_3000/web/_app/immutable/nodes/18.COwa8j3Q.js
+++ b/app/smartbrain_3000/web/_app/immutable/nodes/18.CZM1LVRi.js
@@ -1,4 +1,4 @@
-import{$ as e,A as t,G as n,M as r,O as i,P as a,Q as o,R as s,V as c,X as l,Y as u,Z as d,at as f,b as p,ct as m,dt as h,et as g,ft as _,h as v,it as y,j as b,m as x,r as S,st as C,tt as w,y as T,z as E}from"../chunks/BJLLtWYH.js";import"../chunks/xihTtKlq.js";import{n as D}from"../chunks/CoHYJ8BJ.js";import{t as ee}from"../chunks/CwtHPkdz.js";import{t as O}from"../chunks/DKVRJME0.js";var te=a(`
Configure the client with header Authorization: Bearer <token>.