kaizenai 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ import{c as Te,a as Ve,u as De,b as qe,d as Be,e as He,f as $e,r as c,g as Ge,h as Ke,i as Z,j as Qe,k as l,B as Pe,l as Je,m as We,n as Xe,S as Ye,M as Ze,T as et,C as tt,o as lt,P as Ae,R as st,p as Ie,q as nt}from"./index-SgSBQKg3.js";import{E as it,a as Me}from"./eye-BXpLGEx5.js";/**
2
+ * @license lucide-react v0.562.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const at=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],rt=Te("arrow-left",at);/**
7
+ * @license lucide-react v0.562.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const ot=[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]],ct=Te("layout-panel-left",ot),dt=700,ft=1500;function xt(){const e=Ve.c(140),N=De(),Ne=qe(),Se=Be(),m=He();let ee;e[0]!==Ne||e[1]!==Se||e[2]!==m?(ee={...Ne,...Se,...m},e[0]=Ne,e[1]=Se,e[2]=m,e[3]=ee):ee=e[3];const f=ee,t=f.featureOverviewSnapshot,i=$e("(min-width: 768px)");let te;e[4]===Symbol.for("react.memo_cache_sentinel")?(te=typeof window>"u"?!0:Je(window.location.hostname),e[4]=te):te=e[4];const Fe=te,[a,_e]=c.useState("view"),[r,ye]=c.useState(""),[u,ke]=c.useState(!1),[o,p]=c.useState("idle"),[le,X]=c.useState(null),se=c.useRef(""),ne=c.useRef(0),Re=c.useRef(m.handleUpdateFeatureOverview);t==null||t.featureId;let ie;e[5]!==(t==null?void 0:t.featureId)?(ie=Ge.featureOverviewSave((t==null?void 0:t.featureId)??"feature-overview"),e[5]=t==null?void 0:t.featureId,e[6]=ie):ie=e[6];const w=ie,Ee=Ke(w);let ae,re;e[7]!==m.handleUpdateFeatureOverview?(ae=()=>{Re.current=m.handleUpdateFeatureOverview},re=[m.handleUpdateFeatureOverview],e[7]=m.handleUpdateFeatureOverview,e[8]=ae,e[9]=re):(ae=e[8],re=e[9]),c.useEffect(ae,re);let oe;e[10]!==t?(oe=()=>{t&&(se.current=t.content,ye(t.content),ke(!1),p("idle"),X(null))},e[10]=t,e[11]=oe):oe=e[11];const Le=t==null?void 0:t.featureId;let ce;e[12]!==Le?(ce=[Le],e[12]=Le,e[13]=ce):ce=e[13],c.useEffect(oe,ce);let de,fe;e[14]!==u||e[15]!==t?(de=()=>{t&&(se.current=t.content,ye(s=>u?s:t.content),u||(p("idle"),X(null)))},fe=[u,t],e[14]=u,e[15]=t,e[16]=de,e[17]=fe):(de=e[16],fe=e[17]),c.useEffect(de,fe);let ue;e[18]!==r||e[19]!==u||e[20]!==w||e[21]!==t?(ue=()=>{if(!t||!u)return;const s=ne.current+1;ne.current=s,p("saving"),X(null);const n=window.setTimeout(()=>{We(w,()=>Re.current(t.featureId,r),{statusLabel:"Saving overview...",dedupe:!1}).then(d=>{ne.current!==s||!d||(se.current=d.content,ke(!1),p("saved"))}).catch(d=>{ne.current===s&&(p("error"),X(d instanceof Error?d.message:String(d)))})},dt);return()=>window.clearTimeout(n)},e[18]=r,e[19]=u,e[20]=w,e[21]=t,e[22]=ue):ue=e[22];const Oe=t==null?void 0:t.featureId;let me;e[23]!==r||e[24]!==u||e[25]!==w||e[26]!==Oe?(me=[r,u,w,Oe],e[23]=r,e[24]=u,e[25]=w,e[26]=Oe,e[27]=me):me=e[27],c.useEffect(ue,me);let xe,ve;e[28]!==o?(xe=()=>{if(o!=="saved")return;const s=window.setTimeout(()=>{p("idle")},ft);return()=>window.clearTimeout(s)},ve=[o],e[28]=o,e[29]=xe,e[30]=ve):(xe=e[29],ve=e[30]),c.useEffect(xe,ve);let he,pe;if(e[31]!==i||e[32]!==a?(he=()=>{i||a!=="split"||_e("view")},pe=[i,a],e[31]=i,e[32]=a,e[33]=he,e[34]=pe):(he=e[33],pe=e[34]),c.useEffect(he,pe),!t){const s=f.sidebarReady?"Overview not found.":"Loading overview…";let n;return e[35]!==s?(n=l.jsx("div",{className:"flex flex-1 items-center justify-center",children:l.jsx("div",{className:"text-sm text-muted-foreground",children:s})}),e[35]=s,e[36]=n):n=e[36],n}const Ce=a==="view"||a==="split",S=o==="saving"?"Saving changes…":o==="saved"?"Saved just now":o==="error"?"Autosave failed":u?"Unsaved changes":"All changes saved";let y,k,b,g,j,E,x,L,O,C,v,_,R,z,P;if(e[37]!==r||e[38]!==i||e[39]!==Ee||e[40]!==a||e[41]!==N||e[42]!==S||e[43]!==o||e[44]!==t.title||e[45]!==f.handleOpenLocalLink){j=Z("shrink-0 rounded-full border px-2.5 py-1 text-[11px] md:text-xs",o==="error"?"border-destructive/30 bg-destructive/5 text-destructive":o==="saved"?"border-emerald-500/20 bg-emerald-500/5 text-emerald-600 dark:text-emerald-300":Ee?"border-border bg-muted text-foreground":"border-border/80 bg-muted/40 text-muted-foreground");let s;e[61]===Symbol.for("react.memo_cache_sentinel")?(s=[Xe],e[61]=s):s=e[61];let n;e[62]!==f.handleOpenLocalLink?(n=Qe({onOpenLocalLink:f.handleOpenLocalLink}),e[62]=f.handleOpenLocalLink,e[63]=n):n=e[63];let d;e[64]!==r||e[65]!==n?(d=l.jsx(Ye,{className:"h-full min-h-0",children:l.jsx("div",{className:"mx-auto max-w-4xl px-4 py-5",children:l.jsx("div",{className:"prose prose-slate max-w-none dark:prose-invert",children:l.jsx(Ze,{remarkPlugins:s,components:n,children:r})})})}),e[64]=r,e[65]=n,e[66]=d):d=e[66],g=d;const Y=a==="split"?"bg-muted/15 dark:bg-muted/10":"bg-muted/10 dark:bg-muted/5 md:bg-transparent";let h;e[67]!==Y?(h=Z("flex h-full min-h-0 flex-col",Y),e[67]=Y,e[68]=h):h=e[68];let Q;e[69]!==o?(Q=Ue=>{const ze=Ue.target.value;ye(ze),ke(ze!==se.current),o!=="saving"&&p("idle"),X(null)},e[69]=o,e[70]=Q):Q=e[70];let be;e[71]===Symbol.for("react.memo_cache_sentinel")?(be=Z("h-full min-h-0 w-full resize-none rounded-none border-0 border-transparent bg-transparent px-0 py-0 font-mono text-base leading-7 shadow-none","outline-none focus:outline-none focus-visible:outline-none","ring-0 ring-offset-0 focus-visible:ring-0 focus-visible:ring-offset-0","selection:bg-accent/30 dark:selection:bg-accent/40 md:text-[13px] md:leading-6"),e[71]=be):be=e[71];let J;e[72]!==r||e[73]!==Q?(J=l.jsx("div",{className:"mx-auto flex h-full min-h-0 w-full max-w-4xl px-4 py-5",children:l.jsx(et,{value:r,onChange:Q,spellCheck:!1,className:be})}),e[72]=r,e[73]=Q,e[74]=J):J=e[74];let ge;e[75]!==h||e[76]!==J?(ge=l.jsx("div",{className:h,children:J}),e[75]=h,e[76]=J,e[77]=ge):ge=e[77],b=ge,P="flex flex-1 min-w-0 flex-col",k=tt,z="h-full rounded-none border-0 bg-background",y=lt,R="flex h-full min-h-0 flex-col p-0",_="flex flex-col gap-3 border-b border-border px-4 py-3 md:flex-row md:items-center md:justify-between",C="flex min-w-0 items-start gap-2 md:flex-1";let W;e[78]!==N?(W=()=>{if(window.history.length>1){N(-1);return}N("/")},e[78]=N,e[79]=W):W=e[79];let je;e[80]===Symbol.for("react.memo_cache_sentinel")?(je=l.jsx(rt,{className:"size-4"}),e[80]=je):je=e[80],e[81]!==W?(v=l.jsx(Pe,{variant:"ghost",size:"icon",className:"mt-0.5 h-8 w-8 shrink-0 rounded-full",title:"Back",onClick:W,children:je}),e[81]=W,e[82]=v):v=e[82],O="min-w-0",E="flex items-center gap-2",e[83]!==t.title?(x=l.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:t.title}),e[83]=t.title,e[84]=x):x=e[84],L=i?null:l.jsx("div",{className:Z(j,"text-right"),children:S}),e[37]=r,e[38]=i,e[39]=Ee,e[40]=a,e[41]=N,e[42]=S,e[43]=o,e[44]=t.title,e[45]=f.handleOpenLocalLink,e[46]=y,e[47]=k,e[48]=b,e[49]=g,e[50]=j,e[51]=E,e[52]=x,e[53]=L,e[54]=O,e[55]=C,e[56]=v,e[57]=_,e[58]=R,e[59]=z,e[60]=P}else y=e[46],k=e[47],b=e[48],g=e[49],j=e[50],E=e[51],x=e[52],L=e[53],O=e[54],C=e[55],v=e[56],_=e[57],R=e[58],z=e[59],P=e[60];let A;e[85]!==E||e[86]!==x||e[87]!==L?(A=l.jsxs("div",{className:E,children:[x,L]}),e[85]=E,e[86]=x,e[87]=L,e[88]=A):A=e[88];let I;e[89]!==t.overviewRelativePath?(I=l.jsx("div",{className:"truncate text-xs text-muted-foreground",children:t.overviewRelativePath}),e[89]=t.overviewRelativePath,e[90]=I):I=e[90];let M;e[91]!==O||e[92]!==A||e[93]!==I?(M=l.jsxs("div",{className:O,children:[A,I]}),e[91]=O,e[92]=A,e[93]=I,e[94]=M):M=e[94];let T;e[95]!==C||e[96]!==v||e[97]!==M?(T=l.jsxs("div",{className:C,children:[v,M]}),e[95]=C,e[96]=v,e[97]=M,e[98]=T):T=e[98];let F;e[99]!==i||e[100]!==S||e[101]!==j?(F=i?l.jsx("div",{className:j,children:S}):null,e[99]=i,e[100]=S,e[101]=j,e[102]=F):F=e[102];let U;e[103]!==i?(U=i?[{mode:"view",label:"View",icon:Me},{mode:"edit",label:"Edit",icon:Ae},{mode:"split",label:"Split",icon:ct}]:[{mode:"view",label:"View",icon:Me},{mode:"edit",label:"Edit",icon:Ae}],e[103]=i,e[104]=U):U=e[104];let V;e[105]!==a||e[106]!==U?(V=l.jsx("div",{className:"flex min-w-0 flex-1 items-center rounded-lg border border-border p-1 md:flex-none",children:U.map(s=>{const{mode:n,label:d,icon:Y}=s,h=a===n;return l.jsxs("button",{type:"button",onClick:()=>_e(n),className:Z("inline-flex flex-1 items-center justify-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors md:flex-none",h?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(Y,{className:"size-4"}),l.jsx("span",{children:d})]},n)})}),e[105]=a,e[106]=U,e[107]=V):V=e[107];let D;e[108]!==t.localPath||e[109]!==f?(D=Fe?l.jsxs(Pe,{variant:"outline",size:"sm",className:"shrink-0 px-2.5 md:px-3",title:`Open in ${f.editorLabel}`,onClick:()=>{f.handleOpenExternalPath("open_editor",t.localPath)},children:[l.jsx(it,{className:"size-4"}),l.jsxs("span",{className:"hidden md:inline",children:["Open in ",f.editorLabel]})]}):null,e[108]=t.localPath,e[109]=f,e[110]=D):D=e[110];let q;e[111]!==F||e[112]!==V||e[113]!==D?(q=l.jsxs("div",{className:"flex items-center gap-2 md:shrink-0 md:gap-3",children:[F,V,D]}),e[111]=F,e[112]=V,e[113]=D,e[114]=q):q=e[114];let B;e[115]!==_||e[116]!==T||e[117]!==q?(B=l.jsxs("div",{className:_,children:[T,q]}),e[115]=_,e[116]=T,e[117]=q,e[118]=B):B=e[118];let H;e[119]!==le?(H=le?l.jsxs("div",{className:"border-b border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:[l.jsx("div",{className:"font-medium",children:"Autosave failed"}),l.jsx("div",{className:"mt-1",children:le})]}):null,e[119]=le,e[120]=H):H=e[120];let $;e[121]!==b||e[122]!==i||e[123]!==a||e[124]!==g||e[125]!==Ce?($=l.jsx("div",{className:"flex-1 min-h-0",children:i&&a==="split"?l.jsxs(st,{orientation:"horizontal",className:"h-full",children:[l.jsx(Ie,{defaultSize:"50%",minSize:"25%",className:"min-w-0",children:g}),l.jsx(nt,{orientation:"horizontal",withHandle:!0}),l.jsx(Ie,{defaultSize:"50%",minSize:"25%",className:"min-w-0",children:b})]}):Ce?g:b}),e[121]=b,e[122]=i,e[123]=a,e[124]=g,e[125]=Ce,e[126]=$):$=e[126];let G;e[127]!==y||e[128]!==R||e[129]!==B||e[130]!==H||e[131]!==$?(G=l.jsxs(y,{className:R,children:[B,H,$]}),e[127]=y,e[128]=R,e[129]=B,e[130]=H,e[131]=$,e[132]=G):G=e[132];let K;e[133]!==k||e[134]!==z||e[135]!==G?(K=l.jsx(k,{className:z,children:G}),e[133]=k,e[134]=z,e[135]=G,e[136]=K):K=e[136];let we;return e[137]!==P||e[138]!==K?(we=l.jsx("div",{className:P,children:K}),e[137]=P,e[138]=K,e[139]=we):we=e[139],we}export{xt as FeatureOverviewPage};
@@ -0,0 +1,21 @@
1
+ import{c as M,a as L,i as H,k as t,r as v,s as de,t as ue,v as xe,D as ge,w as be,x as Ne,y as ve,z as we,I as se,B as O,S as ye,L as T,A as Pe,E as me,F as Ce,G as ke,H as S,J as z,K as Se,N as Le,m as W,g as F,O as Ee,Q as $e,h as ne,U as Ie,V as re,W as Ae,X as He,Y as Oe,b as Re,e as Te,Z as Fe,_ as _e}from"./index-SgSBQKg3.js";/**
2
+ * @license lucide-react v0.562.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ze=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],De=M("arrow-left-right",ze);/**
7
+ * @license lucide-react v0.562.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Me=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],le=M("code-xml",Me);/**
12
+ * @license lucide-react v0.562.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Ue=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],he=M("folder",Ue);/**
17
+ * @license lucide-react v0.562.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Be=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],fe=M("monitor",Be);function oe(n){const e=L.c(19),{narrow:s,title:l,subtitle:u,icon:i}=n,r=s===void 0?!1:s,a=i===void 0?fe:i,c=r?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10";let d;e[0]!==c?(d=H("w-full",c),e[0]=c,e[1]=d):d=e[1];const h=r&&"justify-center";let N;e[2]!==h?(N=H("flex items-center gap-1 mb-2",h),e[2]=h,e[3]=N):N=e[3];let x;e[4]!==a?(x=t.jsx("div",{className:"p-2 pl-0 rounded-lg",children:t.jsx(a,{className:"h-6 w-6 text-muted-foreground"})}),e[4]=a,e[5]=x):x=e[5];let f;e[6]!==l?(f=t.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:l}),e[6]=l,e[7]=f):f=e[7];let p;e[8]!==N||e[9]!==x||e[10]!==f?(p=t.jsxs("div",{className:N,children:[x,f]}),e[8]=N,e[9]=x,e[10]=f,e[11]=p):p=e[11];let m;e[12]!==r||e[13]!==u?(m=u&&t.jsx("p",{className:H("text-muted-foreground",r&&"mb-10 text-center"),children:u}),e[12]=r,e[13]=u,e[14]=m):m=e[14];let g;return e[15]!==m||e[16]!==d||e[17]!==p?(g=t.jsxs("div",{className:d,children:[p,m]}),e[15]=m,e[16]=d,e[17]=p,e[18]=g):g=e[18],g}const Ke={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function Ve(n){const e=L.c(16),{value:s,onValueChange:l,options:u,size:i,className:r,optionClassName:a}=n,c=i===void 0?"md":i;let d;e[0]!==r?(d=H("inline-flex items-center rounded-lg border border-border p-[3px] ",r),e[0]=r,e[1]=d):d=e[1];let h;if(e[2]!==l||e[3]!==a||e[4]!==u||e[5]!==c||e[6]!==s){let x;e[8]!==l||e[9]!==a||e[10]!==c||e[11]!==s?(x=f=>{const p=f.value===s,m=f.icon,g=m?v.isValidElement(m)?m:(()=>{const y=m;return t.jsx(y,{className:c==="sm"?"h-3.5 w-3.5":"h-4 w-4"})})():null,w=t.jsxs("button",{type:"button",onClick:()=>l(f.value),disabled:f.disabled,"aria-pressed":p,className:H("rounded-[4px] border transition-colors",m?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",Ke[c],p?"bg-white dark:bg-muted text-slate-900 dark:text-slate-200 border-slate-300 dark:border-white/10 bg-slate-200 ":"border-transparent text-slate-800 hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",f.disabled&&"opacity-50 pointer-events-none",a),children:[g,t.jsx("span",{children:f.label})]},f.value);return f.tooltip?t.jsxs(de,{children:[t.jsx(ue,{asChild:!0,children:w}),t.jsx(xe,{children:f.tooltip})]},f.value):w},e[8]=l,e[9]=a,e[10]=c,e[11]=s,e[12]=x):x=e[12],h=u.map(x),e[2]=l,e[3]=a,e[4]=u,e[5]=c,e[6]=s,e[7]=h}else h=e[7];let N;return e[13]!==d||e[14]!==h?(N=t.jsx("div",{className:d,children:h}),e[13]=d,e[14]=h,e[15]=N):N=e[15],N}function We(n){return n.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Ye(n){const e=n.split("/").filter(Boolean);return e[e.length-1]||n}function qe({open:n,onOpenChange:e,initialDirectory:s,onListDirectories:l,onConfirm:u,isSubmitting:i=!1}){var G;const[r,a]=v.useState("new"),[c,d]=v.useState(""),[h,N]=v.useState([]),[x,f]=v.useState({}),[p,m]=v.useState([]),[g,w]=v.useState(null),[y,C]=v.useState(""),[j,P]=v.useState(null),[k,I]=v.useState(null),[E,A]=v.useState(null),R=v.useRef(null);v.useEffect(()=>{n&&(a("new"),d(""),N(s?s.roots:[]),f(s?{[s.currentPath]:s.entries}:{}),m(s?[s.currentPath]:[]),w((s==null?void 0:s.currentPath)??null),C(""),P(null),I(null),A(null),setTimeout(()=>{var o;return(o=R.current)==null?void 0:o.focus()},0))},[s,n]),v.useEffect(()=>{n&&setTimeout(()=>{var o;r==="new"&&((o=R.current)==null||o.focus())},0)},[r,n]);const U=We(c),B=U?`${we}/${U}`:"",_=y.trim(),J=r==="new"?!!U:!!_,K=async o=>{P(null),A(o??"__root__");try{const b=await l(o);if(!o){N(b.roots),w(b.currentPath),f({[b.currentPath]:b.entries}),m([b.currentPath]);return}h.length===0&&(N([{name:Ye(b.currentPath),localPath:b.currentPath}]),w(b.currentPath)),f($=>({...$,[b.currentPath]:b.entries})),m($=>$.includes(b.currentPath)?$:[...$,b.currentPath])}catch(b){P(b instanceof Error?b.message:String(b))}finally{A(null)}},je=async o=>{if(p.includes(o)){m(b=>b.filter($=>$!==o));return}if(x[o]){m(b=>[...b,o]);return}await K(o)},X=(o,b,$)=>{const V=p.includes(o),pe=y===o,Q=x[o]??[],ee=E===o;return t.jsxs("div",{children:[t.jsxs("div",{className:H("grid grid-cols-[auto_1fr] items-center gap-2 px-3 py-2",pe?"bg-muted":"hover:bg-muted/50"),style:{paddingLeft:`${12+$*16}px`},children:[t.jsx("button",{type:"button",className:"flex h-6 w-6 items-center justify-center rounded hover:bg-background disabled:opacity-50",onClick:()=>void je(o),disabled:ee,children:ee?t.jsx(T,{className:"h-4 w-4 animate-spin text-muted-foreground"}):t.jsx(me,{className:H("h-4 w-4 text-muted-foreground transition-transform",V&&"rotate-90")})}),t.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",onClick:()=>C(o),children:[V?t.jsx(Ce,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):t.jsx(he,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),t.jsx("span",{className:"truncate",children:b})]})]}),V&&Q.length>0?Q.map(te=>X(te.localPath,te.name,$+1)):null]},o)},Z=async()=>{if(J){I(null);try{if(r==="new")await u({mode:"new",localPath:B,title:c.trim()});else{const o=_.split("/").pop()||_;await u({mode:"existing",localPath:_,title:o})}e(!1)}catch(o){I(o instanceof Error?o.message:"Failed to add project.")}}};return t.jsx(ge,{open:n,onOpenChange:o=>!i&&e(o),children:t.jsxs(be,{size:"sm",children:[t.jsxs(Ne,{className:"space-y-4",children:[t.jsx(ve,{children:"Add Project"}),t.jsx(Ve,{value:r,onValueChange:a,options:[{value:"new",label:"New Folder"},{value:"existing",label:"Existing Folder"}],className:"w-full mb-2",optionClassName:"flex-1 justify-center"}),r==="new"?t.jsxs("div",{className:"space-y-2",children:[t.jsx(se,{ref:R,type:"text",value:c,onChange:o=>d(o.target.value),onKeyDown:o=>{o.key==="Enter"&&!o.isComposing&&Z(),o.key==="Escape"&&!o.isComposing&&!i&&e(!1)},disabled:i,placeholder:"Project name"}),B&&t.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:B})]}):t.jsxs("div",{className:"space-y-2",children:[t.jsx(se,{type:"text",value:y,onChange:o=>C(o.target.value),onKeyDown:o=>{o.key==="Enter"&&!o.isComposing&&K(y||void 0)},disabled:i,placeholder:"Enter a server path, for example /home/bettie/Projects/my-app"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Import an existing folder from the connected server machine. You can type a path manually or choose from the root folder list below."}),t.jsx("div",{className:"flex justify-end",children:t.jsx(O,{type:"button",variant:"ghost",size:"sm",onClick:()=>void K("~"),disabled:E!==null||i,children:"Load Root"})}),h.length>0?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Server Folders"}),t.jsxs(ye,{className:"max-h-64 rounded-xl border border-border",children:[h.map(o=>X(o.localPath,o.name,0)),g&&((G=x[g])==null?void 0:G.length)===0?t.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:"No subfolders"}):null]})]}):E?t.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-border px-3 py-2 text-sm text-muted-foreground",children:[t.jsx(T,{className:"h-4 w-4 animate-spin"}),"Loading folders from server machine..."]}):null,j?t.jsx("p",{className:"text-xs text-destructive",children:j}):null]}),k?t.jsx("p",{className:"text-xs text-destructive",children:k}):null]}),t.jsxs(Pe,{children:[t.jsx(O,{type:"button",variant:"ghost",onClick:()=>e(!1),disabled:i,children:"Cancel"}),t.jsxs(O,{type:"button",onClick:()=>void Z(),disabled:!J||i,children:[i?t.jsx(T,{className:"mr-2 h-4 w-4 animate-spin"}):null,i?"Adding...":"Add Project"]})]})]})})}function Je(n){const e=L.c(9),{text:s}=n,[l,u]=v.useState(!1);let i;e[0]!==s?(i=async function(){await navigator.clipboard.writeText(s),u(!0),setTimeout(()=>u(!1),2e3)},e[0]=s,e[1]=i):i=e[1];const r=i;let a;e[2]!==r?(a=()=>void r(),e[2]=r,e[3]=a):a=e[3];let c;e[4]!==l?(c=l?t.jsx(He,{className:"h-4 w-4 text-green-400"}):t.jsx(Oe,{className:"h-4 w-4"}),e[4]=l,e[5]=c):c=e[5];let d;return e[6]!==a||e[7]!==c?(d=t.jsx(O,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:a,children:c}),e[6]=a,e[7]=c,e[8]=d):d=e[8],d}function ae(n){const e=L.c(3),{children:s}=n;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(me,{className:"inline h-4 w-4 opacity-40"}),e[0]=l):l=e[0];let u;return e[1]!==s?(u=t.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center group bg-background border border-border text-foreground rounded-xl p-1.5 pl-3 font-mono text-sm",children:[t.jsxs("pre",{className:"inline-flex items-center gap-2 overflow-x-auto",children:[l,t.jsx("code",{children:s})]}),t.jsx(Je,{text:s})]}),e[1]=s,e[2]=u):u=e[2],u}function D(n){const e=L.c(2),{children:s}=n;let l;return e[0]!==s?(l=t.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:s}),e[0]=s,e[1]=l):l=e[1],l}function Y(n){const e=L.c(2),{children:s}=n;let l;return e[0]!==s?(l=t.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:s}),e[0]=s,e[1]=l):l=e[1],l}function q(n){const e=L.c(11),{icon:s,title:l,subtitle:u,iconClassName:i}=n,r=i||"h-8 w-8 text-muted-foreground";let a;e[0]!==s||e[1]!==r?(a=t.jsx("div",{className:"p-3 mb-2 rounded-xl bg-background border border-border",children:t.jsx(s,{className:r})}),e[0]=s,e[1]=r,e[2]=a):a=e[2];let c;e[3]!==l?(c=t.jsx("span",{className:"text-sm font-medium",children:l}),e[3]=l,e[4]=c):c=e[4];let d;e[5]!==u?(d=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[5]=u,e[6]=d):d=e[6];let h;return e[7]!==a||e[8]!==c||e[9]!==d?(h=t.jsxs("div",{className:"flex flex-col items-center gap-0",children:[a,c,d]}),e[7]=a,e[8]=c,e[9]=d,e[10]=h):h=e[10],h}function ce(){const n=L.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(De,{className:"h-4 w-4 text-muted-foreground"}),n[0]=e):e=n[0],e}function ie(n){const e=L.c(12),{number:s,title:l,children:u}=n;let i;e[0]!==s?(i=t.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center font-medium text-logo",children:[s,"."]}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==l?(r=t.jsx("h3",{className:"font-medium text-foreground mb-2",children:l}),e[2]=l,e[3]=r):r=e[3];let a;e[4]!==i||e[5]!==r?(a=t.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-baseline gap-3",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6];let c;e[7]!==u?(c=t.jsx("div",{className:"text-muted-foreground text-sm space-y-3",children:u}),e[7]=u,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==c?(d=t.jsx("div",{className:"flex gap-4",children:t.jsxs("div",{className:"flex-1 min-w-0",children:[a,c]})}),e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function Xe(n){const e=L.c(37),{localPath:s,iconDataUrl:l,loading:u,onClick:i,onHide:r}=n,a=$e(Ze);let c;e[0]!==s?(c=F.localProjectOpen(s),e[0]=s,e[1]=c):c=e[1];const d=ne(c);let h;e[2]!==s?(h=F.localProjectHide(s),e[2]=s,e[3]=h):h=e[3];const N=ne(h),x=u||d||N,f=x&&"opacity-50 cursor-not-allowed";let p;e[4]!==f?(p=H("border border-border hover:border-primary/30 rounded-lg bg-card px-4 py-3 flex items-center gap-3 w-full text-left hover:bg-muted/50 transition-colors",f),e[4]=f,e[5]=p):p=e[5];let m;e[6]!==l||e[7]!==s||e[8]!==a?(m=a?t.jsx(Ie,{iconDataUrl:l,alt:`${re(s)} icon`,className:"h-5.5 w-5.5",fallback:t.jsx(he,{className:"h-5.5 w-5.5 text-muted-foreground flex-shrink-0"})}):null,e[6]=l,e[7]=s,e[8]=a,e[9]=m):m=e[9];let g;e[10]!==s?(g=re(s),e[10]=s,e[11]=g):g=e[11];let w;e[12]!==g?(w=t.jsx("span",{className:"font-medium text-foreground truncate flex-1 pr-10",children:g}),e[12]=g,e[13]=w):w=e[13];let y;e[14]!==x?(y=x?t.jsx(T,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):null,e[14]=x,e[15]=y):y=e[15];let C;e[16]!==x||e[17]!==i||e[18]!==p||e[19]!==m||e[20]!==w||e[21]!==y?(C=t.jsx(ue,{asChild:!0,children:t.jsxs("button",{className:p,disabled:x,onClick:i,children:[m,w,y]})}),e[16]=x,e[17]=i,e[18]=p,e[19]=m,e[20]=w,e[21]=y,e[22]=C):C=e[22];let j;e[23]!==s?(j=t.jsx(xe,{children:t.jsx("p",{children:s})}),e[23]=s,e[24]=j):j=e[24];let P;e[25]!==j||e[26]!==C?(P=t.jsxs(de,{children:[C,j]}),e[25]=j,e[26]=C,e[27]=P):P=e[27];let k;e[28]!==r?(k=R=>{R.stopPropagation(),r()},e[28]=r,e[29]=k):k=e[29];let I;e[30]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Ae,{className:"h-4 w-4"}),e[30]=I):I=e[30];let E;e[31]!==x||e[32]!==k?(E=t.jsx(O,{variant:"ghost",size:"icon",className:"absolute right-2 top-1/2 h-7 w-7 -translate-y-1/2 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity",disabled:x,onClick:k,children:I}),e[31]=x,e[32]=k,e[33]=E):E=e[33];let A;return e[34]!==P||e[35]!==E?(A=t.jsxs("div",{className:"relative group",children:[P,E]}),e[34]=P,e[35]=E,e[36]=A):A=e[36],A}function Ze(n){return n.showProjectIconsInSidebar}function Ge({connectionStatus:n,ready:e,snapshot:s,startingLocalPath:l,commandError:u,onOpenProject:i,onHideProject:r,onListDirectories:a,onCreateProject:c}){const[d,h]=ke(),[N,x]=v.useState(!1),[f,p]=v.useState(null),m=v.useMemo(()=>(s==null?void 0:s.projects)??[],[s==null?void 0:s.projects]),g=n==="connecting"||!e,w=n==="connected"&&e,y=d.get("newProject")==="1";v.useEffect(()=>{w&&y&&x(!0)},[w,y]);const C=j=>{if(x(j),!j&&y){const P=new URLSearchParams(d);P.delete("newProject"),h(P,{replace:!0})}};return t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[w?t.jsxs(t.Fragment,{children:[t.jsx(oe,{title:(s==null?void 0:s.machine.displayName)??"Local Projects",subtitle:`${S} is connected, choose a project below to get started.`}),t.jsxs("div",{className:"w-full px-6 mb-10",children:[t.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[t.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider",children:"Projects"}),t.jsxs(O,{variant:"default",size:"sm",onClick:()=>x(!0),children:[t.jsx(Le,{className:"h-4 w-4 mr-1.5"}),"Add Project"]})]}),m.length>0?t.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-4 3xl:grid-cols-5 gap-2",children:m.map(j=>t.jsx(Xe,{localPath:j.localPath,iconDataUrl:j.iconDataUrl,loading:l===j.localPath,onClick:()=>{W(F.localProjectOpen(j.localPath),()=>i(j.localPath),{statusLabel:"Opening project..."})},onHide:()=>{W(F.localProjectHide(j.localPath),()=>r(j.localPath),{statusLabel:"Hiding project..."})}},j.localPath))}):t.jsx(D,{children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No local projects discovered yet. Open one with Claude or Codex, or create a new project here."})}),u?t.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3 mt-4",children:u}):null]})]}):t.jsxs(t.Fragment,{children:[t.jsx(oe,{narrow:!0,icon:le,title:g?`Connecting ${S}`:`Connect ${S}`,subtitle:g?`${S} is starting up and loading your local projects.`:`Run ${S} directly on your machine with full access to your local files and agent project history.`}),t.jsxs("div",{className:"max-w-2xl w-full mx-auto pb-12 px-6",children:[t.jsx(Y,{children:"Status"}),t.jsx("div",{className:"mb-8",children:t.jsx(D,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(T,{className:"h-4 w-4 text-muted-foreground animate-spin"}),t.jsx("span",{className:"text-sm text-muted-foreground",children:g?`Connecting to your local ${S} server...`:t.jsxs(t.Fragment,{children:["Not connected. Run ",t.jsx("code",{className:"bg-background border border-border rounded-md mx-0.5 p-1 font-mono text-xs text-foreground",children:z()})," from any terminal on this machine."]})})]})})}),g?null:t.jsxs("div",{className:"mb-10",children:[t.jsx(Y,{children:"How it works"}),t.jsx(D,{children:t.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[t.jsx(q,{icon:Se,title:`${S} CLI`,subtitle:"On Your Machine"}),t.jsx(ce,{}),t.jsx(q,{icon:fe,title:`${S} Server`,subtitle:"Local WebSocket"}),t.jsx(ce,{}),t.jsx(q,{icon:le,title:`${S} UI`,subtitle:"Project Chat"})]})})]}),g?null:t.jsxs("div",{className:"mb-10",children:[t.jsx(Y,{children:"Setup"}),t.jsx(D,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs(ie,{number:1,title:`Start ${S}`,children:[t.jsx("p",{children:"Run this command in your terminal:"}),t.jsx(ae,{children:z()})]}),t.jsxs(ie,{number:2,title:"Open the local UI",children:[t.jsxs("p",{children:[S," serves the app locally and opens the Local Projects page in an app-style browser window."]}),t.jsx(ae,{children:"http://localhost:3210/local"})]}),t.jsxs("div",{className:"mt-8",children:[t.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:"Notes"}),t.jsxs("div",{className:"space-y-3 text-sm",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:z("").trim()}),t.jsx("span",{className:"text-muted-foreground",children:"Start in the current directory"})]}),t.jsxs("div",{className:"flex gap-4",children:[t.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:z("--no-open")}),t.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),t.jsx(qe,{open:N,onOpenChange:C,initialDirectory:(s==null?void 0:s.rootDirectory)??null,onListDirectories:a,isSubmitting:f!==null,onConfirm:async j=>{const P=F.localProjectCreate(j.localPath);p(j.localPath);try{await W(P,()=>c(j),{statusLabel:"Adding project..."})}finally{p(k=>k===j.localPath?null:k)}}}),t.jsx("div",{className:"py-4 text-center",children:t.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",Ee.split("/")[1]]})})]})}function et(){const n=L.c(15),e=Re(),s=Te(),l=Fe(),u=_e();let i;n[0]!==l||n[1]!==e||n[2]!==s||n[3]!==u?(i={...e,...s,...l,...u},n[0]=l,n[1]=e,n[2]=s,n[3]=u,n[4]=i):i=n[4];const r=i;let a;return n[5]!==r.commandError||n[6]!==r.connectionStatus||n[7]!==r.handleCreateProject||n[8]!==r.handleHideLocalProject||n[9]!==r.handleListDirectories||n[10]!==r.handleOpenLocalProject||n[11]!==r.localProjects||n[12]!==r.localProjectsReady||n[13]!==r.startingLocalPath?(a=t.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:t.jsx(Ge,{connectionStatus:r.connectionStatus,ready:r.localProjectsReady,snapshot:r.localProjects,startingLocalPath:r.startingLocalPath,commandError:r.commandError,onOpenProject:r.handleOpenLocalProject,onHideProject:r.handleHideLocalProject,onListDirectories:r.handleListDirectories,onCreateProject:r.handleCreateProject})}),n[5]=r.commandError,n[6]=r.connectionStatus,n[7]=r.handleCreateProject,n[8]=r.handleHideLocalProject,n[9]=r.handleListDirectories,n[10]=r.handleOpenLocalProject,n[11]=r.localProjects,n[12]=r.localProjectsReady,n[13]=r.startingLocalPath,n[14]=a):a=n[14],a}export{et as LocalProjectsPage};
@@ -0,0 +1,51 @@
1
+ import{c as be,a as we,i as xe,$ as sa,k as n,d as na,a0 as aa,a1 as ut,a2 as pt,I as ke,a3 as L,a4 as $,a5 as F,a6 as U,a7 as ys,a8 as lr,B as G,W as or,a9 as N,aa as Qe,ab as dr,N as cr,ac as ze,ad as ur,T as jn,ae as mr,af as cs,ag as us,u as fr,ah as hr,ai as gr,b as pr,e as xr,Z as vr,_ as br,r as _,aj as yr,O as _r,ak as Ne,al as Ce,am as Re,Q as ae,an as Te,ao as wn,ap as kr,aq as jr,ar as W,g as he,h as ge,H as Nn,as as ra,L as oe,at as Cn,m as pe,au as Rn,s as wr,t as Nr,v as Cr,av as as,aw as rs,ax as is,ay as Rr,az as ls,aA as Tn,aB as En,aC as Tr,aD as An,aE as In,aF as Er,aG as mt,aH as ms,aI as Ee,aJ as Ar,aK as Pn,aL as On,aM as Ir,aN as Pr,aO as Or,aP as Sr,aQ as Sn,aR as Mr}from"./index-SgSBQKg3.js";import{E as Dr,a as Mn}from"./eye-BXpLGEx5.js";/**
2
+ * @license lucide-react v0.562.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Lr=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],$r=be("bell",Lr);/**
7
+ * @license lucide-react v0.562.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Ur=[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]],ia=be("cloud-download",Ur);/**
12
+ * @license lucide-react v0.562.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Vr=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],Br=be("command",Vr);/**
17
+ * @license lucide-react v0.562.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const zr=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Dn=be("eye-off",zr);/**
22
+ * @license lucide-react v0.562.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Zr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Fr=be("info",Zr);/**
27
+ * @license lucide-react v0.562.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Kr=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],qr=be("message-square-quote",Kr);/**
32
+ * @license lucide-react v0.562.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const Hr=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Wr=be("palette",Hr);/**
37
+ * @license lucide-react v0.562.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const Gr=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],la=be("rotate-ccw",Gr);/**
42
+ * @license lucide-react v0.562.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const Qr=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Yr=be("settings-2",Qr);/**
47
+ * @license lucide-react v0.562.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const Jr=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Xr=be("shield",Jr),ei="https://kaizenai.codes";function ti(t){return ei}function si(t){return ti()}function ni(t,e){return`${((t==null?void 0:t.trim())||si()).replace(/\/+$/,"")}/dashboard`}function Ae(t){const e=we.c(18);let s,a,r,l,d,o;e[0]!==t?({children:s,className:a,icon:r,type:d,variant:o,...l}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=r,e[4]=l,e[5]=d,e[6]=o):(s=e[1],a=e[2],r=e[3],l=e[4],d=e[5],o=e[6]);const c=d===void 0?"button":d,f=o===void 0?"outline":o;let v;e[7]!==a||e[8]!==f?(v=xe(sa({variant:f,size:"sm"}),"h-auto gap-1.5 px-3 py-1.5",a),e[7]=a,e[8]=f,e[9]=v):v=e[9];let k;e[10]!==s?(k=s?n.jsx("span",{children:s}):null,e[10]=s,e[11]=k):k=e[11];let P;return e[12]!==r||e[13]!==l||e[14]!==v||e[15]!==k||e[16]!==c?(P=n.jsxs("button",{type:c,className:v,...l,children:[r,k]}),e[12]=r,e[13]=l,e[14]=v,e[15]=k,e[16]=c,e[17]=P):P=e[17],P}var A;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function s(r){throw new Error}t.assertNever=s,t.arrayToEnum=r=>{const l={};for(const d of r)l[d]=d;return l},t.getValidEnumValues=r=>{const l=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),d={};for(const o of l)d[o]=r[o];return t.objectValues(d)},t.objectValues=r=>t.objectKeys(r).map(function(l){return r[l]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const l=[];for(const d in r)Object.prototype.hasOwnProperty.call(r,d)&&l.push(d);return l},t.find=(r,l)=>{for(const d of r)if(l(d))return d},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function a(r,l=" | "){return r.map(d=>typeof d=="string"?`'${d}'`:d).join(l)}t.joinValues=a,t.jsonStringifyReplacer=(r,l)=>typeof l=="bigint"?l.toString():l})(A||(A={}));var Ln;(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(Ln||(Ln={}));const x=A.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ie=t=>{switch(typeof t){case"undefined":return x.undefined;case"string":return x.string;case"number":return Number.isNaN(t)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(t)?x.array:t===null?x.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?x.promise:typeof Map<"u"&&t instanceof Map?x.map:typeof Set<"u"&&t instanceof Set?x.set:typeof Date<"u"&&t instanceof Date?x.date:x.object;default:return x.unknown}},m=A.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class je extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}format(e){const s=e||function(l){return l.message},a={_errors:[]},r=l=>{for(const d of l.issues)if(d.code==="invalid_union")d.unionErrors.map(r);else if(d.code==="invalid_return_type")r(d.returnTypeError);else if(d.code==="invalid_arguments")r(d.argumentsError);else if(d.path.length===0)a._errors.push(s(d));else{let o=a,c=0;for(;c<d.path.length;){const f=d.path[c];c===d.path.length-1?(o[f]=o[f]||{_errors:[]},o[f]._errors.push(s(d))):o[f]=o[f]||{_errors:[]},o=o[f],c++}}};return r(this),a}static assert(e){if(!(e instanceof je))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,A.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){const s={},a=[];for(const r of this.issues)if(r.path.length>0){const l=r.path[0];s[l]=s[l]||[],s[l].push(e(r))}else a.push(e(r));return{formErrors:a,fieldErrors:s}}get formErrors(){return this.flatten()}}je.create=t=>new je(t);const fs=(t,e)=>{let s;switch(t.code){case m.invalid_type:t.received===x.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case m.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,A.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:s=`Unrecognized key(s) in object: ${A.joinValues(t.keys,", ")}`;break;case m.invalid_union:s="Invalid input";break;case m.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${A.joinValues(t.options)}`;break;case m.invalid_enum_value:s=`Invalid enum value. Expected ${A.joinValues(t.options)}, received '${t.received}'`;break;case m.invalid_arguments:s="Invalid function arguments";break;case m.invalid_return_type:s="Invalid function return type";break;case m.invalid_date:s="Invalid date";break;case m.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:A.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case m.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case m.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case m.custom:s="Invalid input";break;case m.invalid_intersection_types:s="Intersection results could not be merged";break;case m.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case m.not_finite:s="Number must be finite";break;default:s=e.defaultError,A.assertNever(t)}return{message:s}};let ai=fs;function ri(){return ai}const ii=t=>{const{data:e,path:s,errorMaps:a,issueData:r}=t,l=[...s,...r.path||[]],d={...r,path:l};if(r.message!==void 0)return{...r,path:l,message:r.message};let o="";const c=a.filter(f=>!!f).slice().reverse();for(const f of c)o=f(d,{data:e,defaultError:o}).message;return{...r,path:l,message:o}};function h(t,e){const s=ri(),a=ii({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===fs?void 0:fs].filter(r=>!!r)});t.common.issues.push(a)}class re{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){const a=[];for(const r of s){if(r.status==="aborted")return j;r.status==="dirty"&&e.dirty(),a.push(r.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,s){const a=[];for(const r of s){const l=await r.key,d=await r.value;a.push({key:l,value:d})}return re.mergeObjectSync(e,a)}static mergeObjectSync(e,s){const a={};for(const r of s){const{key:l,value:d}=r;if(l.status==="aborted"||d.status==="aborted")return j;l.status==="dirty"&&e.dirty(),d.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof d.value<"u"||r.alwaysSet)&&(a[l.value]=d.value)}return{status:e.value,value:a}}}const j=Object.freeze({status:"aborted"}),ht=t=>({status:"dirty",value:t}),de=t=>({status:"valid",value:t}),$n=t=>t.status==="aborted",Un=t=>t.status==="dirty",Je=t=>t.status==="valid",St=t=>typeof Promise<"u"&&t instanceof Promise;var b;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));class Se{constructor(e,s,a,r){this._cachedPath=[],this.parent=e,this.data=s,this._path=a,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Vn=(t,e)=>{if(Je(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new je(t.common.issues);return this._error=s,this._error}}};function R(t){if(!t)return{};const{errorMap:e,invalid_type_error:s,required_error:a,description:r}=t;if(e&&(s||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(d,o)=>{const{message:c}=t;return d.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??a??o.defaultError}:d.code!=="invalid_type"?{message:o.defaultError}:{message:c??s??o.defaultError}},description:r}}class E{get description(){return this._def.description}_getType(e){return Ie(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:Ie(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new re,ctx:{common:e.parent.common,data:e.data,parsedType:Ie(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const s=this._parse(e);if(St(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){const s=this._parse(e);return Promise.resolve(s)}parse(e,s){const a=this.safeParse(e,s);if(a.success)return a.data;throw a.error}safeParse(e,s){const a={common:{issues:[],async:(s==null?void 0:s.async)??!1,contextualErrorMap:s==null?void 0:s.errorMap},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ie(e)},r=this._parseSync({data:e,path:a.path,parent:a});return Vn(a,r)}"~validate"(e){var a,r;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ie(e)};if(!this["~standard"].async)try{const l=this._parseSync({data:e,path:[],parent:s});return Je(l)?{value:l.value}:{issues:s.common.issues}}catch(l){(r=(a=l==null?void 0:l.message)==null?void 0:a.toLowerCase())!=null&&r.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(l=>Je(l)?{value:l.value}:{issues:s.common.issues})}async parseAsync(e,s){const a=await this.safeParseAsync(e,s);if(a.success)return a.data;throw a.error}async safeParseAsync(e,s){const a={common:{issues:[],contextualErrorMap:s==null?void 0:s.errorMap,async:!0},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ie(e)},r=this._parse({data:e,path:a.path,parent:a}),l=await(St(r)?r:Promise.resolve(r));return Vn(a,l)}refine(e,s){const a=r=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(r):s;return this._refinement((r,l)=>{const d=e(r),o=()=>l.addIssue({code:m.custom,...a(r)});return typeof Promise<"u"&&d instanceof Promise?d.then(c=>c?!0:(o(),!1)):d?!0:(o(),!1)})}refinement(e,s){return this._refinement((a,r)=>e(a)?!0:(r.addIssue(typeof s=="function"?s(a,r):s),!1))}_refinement(e){return new et({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return Oe.create(this,this._def)}nullable(){return tt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ve.create(this)}promise(){return $t.create(this,this._def)}or(e){return Dt.create([this,e],this._def)}and(e){return Lt.create(this,e,this._def)}transform(e){return new et({...R(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const s=typeof e=="function"?e:()=>e;return new ps({...R(this._def),innerType:this,defaultValue:s,typeName:w.ZodDefault})}brand(){return new Ei({typeName:w.ZodBranded,type:this,...R(this._def)})}catch(e){const s=typeof e=="function"?e:()=>e;return new xs({...R(this._def),innerType:this,catchValue:s,typeName:w.ZodCatch})}describe(e){const s=this.constructor;return new s({...this._def,description:e})}pipe(e){return _s.create(this,e)}readonly(){return vs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const li=/^c[^\s-]{8,}$/i,oi=/^[0-9a-z]+$/,di=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ci=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ui=/^[a-z0-9_-]{21}$/i,mi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,fi=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hi=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let os;const pi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xi=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,vi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,bi=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_i=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,oa="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ki=new RegExp(`^${oa}$`);function da(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const s=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`}function ji(t){return new RegExp(`^${da(t)}$`)}function wi(t){let e=`${oa}T${da(t)}`;const s=[];return s.push(t.local?"Z?":"Z"),t.offset&&s.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}function Ni(t,e){return!!((e==="v4"||!e)&&pi.test(t)||(e==="v6"||!e)&&vi.test(t))}function Ci(t,e){if(!mi.test(t))return!1;try{const[s]=t.split(".");if(!s)return!1;const a=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),r=JSON.parse(atob(a));return!(typeof r!="object"||r===null||"typ"in r&&(r==null?void 0:r.typ)!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function Ri(t,e){return!!((e==="v4"||!e)&&xi.test(t)||(e==="v6"||!e)&&bi.test(t))}class Pe extends E{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){const l=this._getOrReturnCtx(e);return h(l,{code:m.invalid_type,expected:x.string,received:l.parsedType}),j}const a=new re;let r;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(r=this._getOrReturnCtx(e,r),h(r,{code:m.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),a.dirty());else if(l.kind==="max")e.data.length>l.value&&(r=this._getOrReturnCtx(e,r),h(r,{code:m.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),a.dirty());else if(l.kind==="length"){const d=e.data.length>l.value,o=e.data.length<l.value;(d||o)&&(r=this._getOrReturnCtx(e,r),d?h(r,{code:m.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):o&&h(r,{code:m.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),a.dirty())}else if(l.kind==="email")hi.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"email",code:m.invalid_string,message:l.message}),a.dirty());else if(l.kind==="emoji")os||(os=new RegExp(gi,"u")),os.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"emoji",code:m.invalid_string,message:l.message}),a.dirty());else if(l.kind==="uuid")ci.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"uuid",code:m.invalid_string,message:l.message}),a.dirty());else if(l.kind==="nanoid")ui.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"nanoid",code:m.invalid_string,message:l.message}),a.dirty());else if(l.kind==="cuid")li.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"cuid",code:m.invalid_string,message:l.message}),a.dirty());else if(l.kind==="cuid2")oi.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"cuid2",code:m.invalid_string,message:l.message}),a.dirty());else if(l.kind==="ulid")di.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"ulid",code:m.invalid_string,message:l.message}),a.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),h(r,{validation:"url",code:m.invalid_string,message:l.message}),a.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"regex",code:m.invalid_string,message:l.message}),a.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(r=this._getOrReturnCtx(e,r),h(r,{code:m.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),a.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(r=this._getOrReturnCtx(e,r),h(r,{code:m.invalid_string,validation:{startsWith:l.value},message:l.message}),a.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(r=this._getOrReturnCtx(e,r),h(r,{code:m.invalid_string,validation:{endsWith:l.value},message:l.message}),a.dirty()):l.kind==="datetime"?wi(l).test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:m.invalid_string,validation:"datetime",message:l.message}),a.dirty()):l.kind==="date"?ki.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:m.invalid_string,validation:"date",message:l.message}),a.dirty()):l.kind==="time"?ji(l).test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{code:m.invalid_string,validation:"time",message:l.message}),a.dirty()):l.kind==="duration"?fi.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"duration",code:m.invalid_string,message:l.message}),a.dirty()):l.kind==="ip"?Ni(e.data,l.version)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"ip",code:m.invalid_string,message:l.message}),a.dirty()):l.kind==="jwt"?Ci(e.data,l.alg)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"jwt",code:m.invalid_string,message:l.message}),a.dirty()):l.kind==="cidr"?Ri(e.data,l.version)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"cidr",code:m.invalid_string,message:l.message}),a.dirty()):l.kind==="base64"?yi.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"base64",code:m.invalid_string,message:l.message}),a.dirty()):l.kind==="base64url"?_i.test(e.data)||(r=this._getOrReturnCtx(e,r),h(r,{validation:"base64url",code:m.invalid_string,message:l.message}),a.dirty()):A.assertNever(l);return{status:a.value,value:e.data}}_regex(e,s,a){return this.refinement(r=>e.test(r),{validation:s,code:m.invalid_string,...b.errToObj(a)})}_addCheck(e){return new Pe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...b.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...b.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...b.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s==null?void 0:s.position,...b.errToObj(s==null?void 0:s.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...b.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...b.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...b.errToObj(s)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new Pe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Pe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Pe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}Pe.create=t=>new Pe({checks:[],typeName:w.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...R(t)});function Ti(t,e){const s=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,r=s>a?s:a,l=Number.parseInt(t.toFixed(r).replace(".","")),d=Number.parseInt(e.toFixed(r).replace(".",""));return l%d/10**r}class xt extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){const l=this._getOrReturnCtx(e);return h(l,{code:m.invalid_type,expected:x.number,received:l.parsedType}),j}let a;const r=new re;for(const l of this._def.checks)l.kind==="int"?A.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:m.invalid_type,expected:"integer",received:"float",message:l.message}),r.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:m.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),r.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:m.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),r.dirty()):l.kind==="multipleOf"?Ti(e.data,l.value)!==0&&(a=this._getOrReturnCtx(e,a),h(a,{code:m.not_multiple_of,multipleOf:l.value,message:l.message}),r.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:m.not_finite,message:l.message}),r.dirty()):A.assertNever(l);return{status:r.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,b.toString(s))}gt(e,s){return this.setLimit("min",e,!1,b.toString(s))}lte(e,s){return this.setLimit("max",e,!0,b.toString(s))}lt(e,s){return this.setLimit("max",e,!1,b.toString(s))}setLimit(e,s,a,r){return new xt({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:a,message:b.toString(r)}]})}_addCheck(e){return new xt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&A.isInteger(e.value))}get isFinite(){let e=null,s=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(s===null||a.value>s)&&(s=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(s)&&Number.isFinite(e)}}xt.create=t=>new xt({checks:[],typeName:w.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...R(t)});class vt extends E{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==x.bigint)return this._getInvalidInput(e);let a;const r=new re;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:m.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),r.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:m.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),r.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),h(a,{code:m.not_multiple_of,multipleOf:l.value,message:l.message}),r.dirty()):A.assertNever(l);return{status:r.value,value:e.data}}_getInvalidInput(e){const s=this._getOrReturnCtx(e);return h(s,{code:m.invalid_type,expected:x.bigint,received:s.parsedType}),j}gte(e,s){return this.setLimit("min",e,!0,b.toString(s))}gt(e,s){return this.setLimit("min",e,!1,b.toString(s))}lte(e,s){return this.setLimit("max",e,!0,b.toString(s))}lt(e,s){return this.setLimit("max",e,!1,b.toString(s))}setLimit(e,s,a,r){return new vt({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:a,message:b.toString(r)}]})}_addCheck(e){return new vt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(s)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}vt.create=t=>new vt({checks:[],typeName:w.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...R(t)});class hs extends E{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==x.boolean){const a=this._getOrReturnCtx(e);return h(a,{code:m.invalid_type,expected:x.boolean,received:a.parsedType}),j}return de(e.data)}}hs.create=t=>new hs({typeName:w.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...R(t)});class Mt extends E{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){const l=this._getOrReturnCtx(e);return h(l,{code:m.invalid_type,expected:x.date,received:l.parsedType}),j}if(Number.isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return h(l,{code:m.invalid_date}),j}const a=new re;let r;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(r=this._getOrReturnCtx(e,r),h(r,{code:m.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),a.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(r=this._getOrReturnCtx(e,r),h(r,{code:m.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),a.dirty()):A.assertNever(l);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Mt({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(s)})}get minDate(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}}Mt.create=t=>new Mt({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:w.ZodDate,...R(t)});class Bn extends E{_parse(e){if(this._getType(e)!==x.symbol){const a=this._getOrReturnCtx(e);return h(a,{code:m.invalid_type,expected:x.symbol,received:a.parsedType}),j}return de(e.data)}}Bn.create=t=>new Bn({typeName:w.ZodSymbol,...R(t)});class zn extends E{_parse(e){if(this._getType(e)!==x.undefined){const a=this._getOrReturnCtx(e);return h(a,{code:m.invalid_type,expected:x.undefined,received:a.parsedType}),j}return de(e.data)}}zn.create=t=>new zn({typeName:w.ZodUndefined,...R(t)});class Zn extends E{_parse(e){if(this._getType(e)!==x.null){const a=this._getOrReturnCtx(e);return h(a,{code:m.invalid_type,expected:x.null,received:a.parsedType}),j}return de(e.data)}}Zn.create=t=>new Zn({typeName:w.ZodNull,...R(t)});class Fn extends E{constructor(){super(...arguments),this._any=!0}_parse(e){return de(e.data)}}Fn.create=t=>new Fn({typeName:w.ZodAny,...R(t)});class Kn extends E{constructor(){super(...arguments),this._unknown=!0}_parse(e){return de(e.data)}}Kn.create=t=>new Kn({typeName:w.ZodUnknown,...R(t)});class Me extends E{_parse(e){const s=this._getOrReturnCtx(e);return h(s,{code:m.invalid_type,expected:x.never,received:s.parsedType}),j}}Me.create=t=>new Me({typeName:w.ZodNever,...R(t)});class qn extends E{_parse(e){if(this._getType(e)!==x.undefined){const a=this._getOrReturnCtx(e);return h(a,{code:m.invalid_type,expected:x.void,received:a.parsedType}),j}return de(e.data)}}qn.create=t=>new qn({typeName:w.ZodVoid,...R(t)});class ve extends E{_parse(e){const{ctx:s,status:a}=this._processInputParams(e),r=this._def;if(s.parsedType!==x.array)return h(s,{code:m.invalid_type,expected:x.array,received:s.parsedType}),j;if(r.exactLength!==null){const d=s.data.length>r.exactLength.value,o=s.data.length<r.exactLength.value;(d||o)&&(h(s,{code:d?m.too_big:m.too_small,minimum:o?r.exactLength.value:void 0,maximum:d?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),a.dirty())}if(r.minLength!==null&&s.data.length<r.minLength.value&&(h(s,{code:m.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),a.dirty()),r.maxLength!==null&&s.data.length>r.maxLength.value&&(h(s,{code:m.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),a.dirty()),s.common.async)return Promise.all([...s.data].map((d,o)=>r.type._parseAsync(new Se(s,d,s.path,o)))).then(d=>re.mergeArray(a,d));const l=[...s.data].map((d,o)=>r.type._parseSync(new Se(s,d,s.path,o)));return re.mergeArray(a,l)}get element(){return this._def.type}min(e,s){return new ve({...this._def,minLength:{value:e,message:b.toString(s)}})}max(e,s){return new ve({...this._def,maxLength:{value:e,message:b.toString(s)}})}length(e,s){return new ve({...this._def,exactLength:{value:e,message:b.toString(s)}})}nonempty(e){return this.min(1,e)}}ve.create=(t,e)=>new ve({type:t,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...R(e)});function Ye(t){if(t instanceof H){const e={};for(const s in t.shape){const a=t.shape[s];e[s]=Oe.create(Ye(a))}return new H({...t._def,shape:()=>e})}else return t instanceof ve?new ve({...t._def,type:Ye(t.element)}):t instanceof Oe?Oe.create(Ye(t.unwrap())):t instanceof tt?tt.create(Ye(t.unwrap())):t instanceof Fe?Fe.create(t.items.map(e=>Ye(e))):t}class H extends E{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),s=A.objectKeys(e);return this._cached={shape:e,keys:s},this._cached}_parse(e){if(this._getType(e)!==x.object){const f=this._getOrReturnCtx(e);return h(f,{code:m.invalid_type,expected:x.object,received:f.parsedType}),j}const{status:a,ctx:r}=this._processInputParams(e),{shape:l,keys:d}=this._getCached(),o=[];if(!(this._def.catchall instanceof Me&&this._def.unknownKeys==="strip"))for(const f in r.data)d.includes(f)||o.push(f);const c=[];for(const f of d){const v=l[f],k=r.data[f];c.push({key:{status:"valid",value:f},value:v._parse(new Se(r,k,r.path,f)),alwaysSet:f in r.data})}if(this._def.catchall instanceof Me){const f=this._def.unknownKeys;if(f==="passthrough")for(const v of o)c.push({key:{status:"valid",value:v},value:{status:"valid",value:r.data[v]}});else if(f==="strict")o.length>0&&(h(r,{code:m.unrecognized_keys,keys:o}),a.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const v of o){const k=r.data[v];c.push({key:{status:"valid",value:v},value:f._parse(new Se(r,k,r.path,v)),alwaysSet:v in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const f=[];for(const v of c){const k=await v.key,P=await v.value;f.push({key:k,value:P,alwaysSet:v.alwaysSet})}return f}).then(f=>re.mergeObjectSync(a,f)):re.mergeObjectSync(a,c)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new H({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,a)=>{var l,d;const r=((d=(l=this._def).errorMap)==null?void 0:d.call(l,s,a).message)??a.defaultError;return s.code==="unrecognized_keys"?{message:b.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new H({...this._def,unknownKeys:"strip"})}passthrough(){return new H({...this._def,unknownKeys:"passthrough"})}extend(e){return new H({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new H({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new H({...this._def,catchall:e})}pick(e){const s={};for(const a of A.objectKeys(e))e[a]&&this.shape[a]&&(s[a]=this.shape[a]);return new H({...this._def,shape:()=>s})}omit(e){const s={};for(const a of A.objectKeys(this.shape))e[a]||(s[a]=this.shape[a]);return new H({...this._def,shape:()=>s})}deepPartial(){return Ye(this)}partial(e){const s={};for(const a of A.objectKeys(this.shape)){const r=this.shape[a];e&&!e[a]?s[a]=r:s[a]=r.optional()}return new H({...this._def,shape:()=>s})}required(e){const s={};for(const a of A.objectKeys(this.shape))if(e&&!e[a])s[a]=this.shape[a];else{let l=this.shape[a];for(;l instanceof Oe;)l=l._def.innerType;s[a]=l}return new H({...this._def,shape:()=>s})}keyof(){return ca(A.objectKeys(this.shape))}}H.create=(t,e)=>new H({shape:()=>t,unknownKeys:"strip",catchall:Me.create(),typeName:w.ZodObject,...R(e)});H.strictCreate=(t,e)=>new H({shape:()=>t,unknownKeys:"strict",catchall:Me.create(),typeName:w.ZodObject,...R(e)});H.lazycreate=(t,e)=>new H({shape:t,unknownKeys:"strip",catchall:Me.create(),typeName:w.ZodObject,...R(e)});class Dt extends E{_parse(e){const{ctx:s}=this._processInputParams(e),a=this._def.options;function r(l){for(const o of l)if(o.result.status==="valid")return o.result;for(const o of l)if(o.result.status==="dirty")return s.common.issues.push(...o.ctx.common.issues),o.result;const d=l.map(o=>new je(o.ctx.common.issues));return h(s,{code:m.invalid_union,unionErrors:d}),j}if(s.common.async)return Promise.all(a.map(async l=>{const d={...s,common:{...s.common,issues:[]},parent:null};return{result:await l._parseAsync({data:s.data,path:s.path,parent:d}),ctx:d}})).then(r);{let l;const d=[];for(const c of a){const f={...s,common:{...s.common,issues:[]},parent:null},v=c._parseSync({data:s.data,path:s.path,parent:f});if(v.status==="valid")return v;v.status==="dirty"&&!l&&(l={result:v,ctx:f}),f.common.issues.length&&d.push(f.common.issues)}if(l)return s.common.issues.push(...l.ctx.common.issues),l.result;const o=d.map(c=>new je(c));return h(s,{code:m.invalid_union,unionErrors:o}),j}}get options(){return this._def.options}}Dt.create=(t,e)=>new Dt({options:t,typeName:w.ZodUnion,...R(e)});function gs(t,e){const s=Ie(t),a=Ie(e);if(t===e)return{valid:!0,data:t};if(s===x.object&&a===x.object){const r=A.objectKeys(e),l=A.objectKeys(t).filter(o=>r.indexOf(o)!==-1),d={...t,...e};for(const o of l){const c=gs(t[o],e[o]);if(!c.valid)return{valid:!1};d[o]=c.data}return{valid:!0,data:d}}else if(s===x.array&&a===x.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let l=0;l<t.length;l++){const d=t[l],o=e[l],c=gs(d,o);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return s===x.date&&a===x.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Lt extends E{_parse(e){const{status:s,ctx:a}=this._processInputParams(e),r=(l,d)=>{if($n(l)||$n(d))return j;const o=gs(l.value,d.value);return o.valid?((Un(l)||Un(d))&&s.dirty(),{status:s.value,value:o.data}):(h(a,{code:m.invalid_intersection_types}),j)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([l,d])=>r(l,d)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Lt.create=(t,e,s)=>new Lt({left:t,right:e,typeName:w.ZodIntersection,...R(s)});class Fe extends E{_parse(e){const{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.array)return h(a,{code:m.invalid_type,expected:x.array,received:a.parsedType}),j;if(a.data.length<this._def.items.length)return h(a,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&a.data.length>this._def.items.length&&(h(a,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const l=[...a.data].map((d,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new Se(a,d,a.path,o)):null}).filter(d=>!!d);return a.common.async?Promise.all(l).then(d=>re.mergeArray(s,d)):re.mergeArray(s,l)}get items(){return this._def.items}rest(e){return new Fe({...this._def,rest:e})}}Fe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fe({items:t,typeName:w.ZodTuple,rest:null,...R(e)})};class Hn extends E{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.map)return h(a,{code:m.invalid_type,expected:x.map,received:a.parsedType}),j;const r=this._def.keyType,l=this._def.valueType,d=[...a.data.entries()].map(([o,c],f)=>({key:r._parse(new Se(a,o,a.path,[f,"key"])),value:l._parse(new Se(a,c,a.path,[f,"value"]))}));if(a.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of d){const f=await c.key,v=await c.value;if(f.status==="aborted"||v.status==="aborted")return j;(f.status==="dirty"||v.status==="dirty")&&s.dirty(),o.set(f.value,v.value)}return{status:s.value,value:o}})}else{const o=new Map;for(const c of d){const f=c.key,v=c.value;if(f.status==="aborted"||v.status==="aborted")return j;(f.status==="dirty"||v.status==="dirty")&&s.dirty(),o.set(f.value,v.value)}return{status:s.value,value:o}}}}Hn.create=(t,e,s)=>new Hn({valueType:e,keyType:t,typeName:w.ZodMap,...R(s)});class bt extends E{_parse(e){const{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.set)return h(a,{code:m.invalid_type,expected:x.set,received:a.parsedType}),j;const r=this._def;r.minSize!==null&&a.data.size<r.minSize.value&&(h(a,{code:m.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),s.dirty()),r.maxSize!==null&&a.data.size>r.maxSize.value&&(h(a,{code:m.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),s.dirty());const l=this._def.valueType;function d(c){const f=new Set;for(const v of c){if(v.status==="aborted")return j;v.status==="dirty"&&s.dirty(),f.add(v.value)}return{status:s.value,value:f}}const o=[...a.data.values()].map((c,f)=>l._parse(new Se(a,c,a.path,f)));return a.common.async?Promise.all(o).then(c=>d(c)):d(o)}min(e,s){return new bt({...this._def,minSize:{value:e,message:b.toString(s)}})}max(e,s){return new bt({...this._def,maxSize:{value:e,message:b.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}}bt.create=(t,e)=>new bt({valueType:t,minSize:null,maxSize:null,typeName:w.ZodSet,...R(e)});class Wn extends E{get schema(){return this._def.getter()}_parse(e){const{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Wn.create=(t,e)=>new Wn({getter:t,typeName:w.ZodLazy,...R(e)});class Gn extends E{_parse(e){if(e.data!==this._def.value){const s=this._getOrReturnCtx(e);return h(s,{received:s.data,code:m.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}}Gn.create=(t,e)=>new Gn({value:t,typeName:w.ZodLiteral,...R(e)});function ca(t,e){return new Xe({values:t,typeName:w.ZodEnum,...R(e)})}class Xe extends E{_parse(e){if(typeof e.data!="string"){const s=this._getOrReturnCtx(e),a=this._def.values;return h(s,{expected:A.joinValues(a),received:s.parsedType,code:m.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const s=this._getOrReturnCtx(e),a=this._def.values;return h(s,{received:s.data,code:m.invalid_enum_value,options:a}),j}return de(e.data)}get options(){return this._def.values}get enum(){const e={};for(const s of this._def.values)e[s]=s;return e}get Values(){const e={};for(const s of this._def.values)e[s]=s;return e}get Enum(){const e={};for(const s of this._def.values)e[s]=s;return e}extract(e,s=this._def){return Xe.create(e,{...this._def,...s})}exclude(e,s=this._def){return Xe.create(this.options.filter(a=>!e.includes(a)),{...this._def,...s})}}Xe.create=ca;class Qn extends E{_parse(e){const s=A.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==x.string&&a.parsedType!==x.number){const r=A.objectValues(s);return h(a,{expected:A.joinValues(r),received:a.parsedType,code:m.invalid_type}),j}if(this._cache||(this._cache=new Set(A.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=A.objectValues(s);return h(a,{received:a.data,code:m.invalid_enum_value,options:r}),j}return de(e.data)}get enum(){return this._def.values}}Qn.create=(t,e)=>new Qn({values:t,typeName:w.ZodNativeEnum,...R(e)});class $t extends E{unwrap(){return this._def.type}_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==x.promise&&s.common.async===!1)return h(s,{code:m.invalid_type,expected:x.promise,received:s.parsedType}),j;const a=s.parsedType===x.promise?s.data:Promise.resolve(s.data);return de(a.then(r=>this._def.type.parseAsync(r,{path:s.path,errorMap:s.common.contextualErrorMap})))}}$t.create=(t,e)=>new $t({type:t,typeName:w.ZodPromise,...R(e)});class et extends E{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:s,ctx:a}=this._processInputParams(e),r=this._def.effect||null,l={addIssue:d=>{h(a,d),d.fatal?s.abort():s.dirty()},get path(){return a.path}};if(l.addIssue=l.addIssue.bind(l),r.type==="preprocess"){const d=r.transform(a.data,l);if(a.common.async)return Promise.resolve(d).then(async o=>{if(s.value==="aborted")return j;const c=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return c.status==="aborted"?j:c.status==="dirty"||s.value==="dirty"?ht(c.value):c});{if(s.value==="aborted")return j;const o=this._def.schema._parseSync({data:d,path:a.path,parent:a});return o.status==="aborted"?j:o.status==="dirty"||s.value==="dirty"?ht(o.value):o}}if(r.type==="refinement"){const d=o=>{const c=r.refinement(o,l);if(a.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?j:(o.status==="dirty"&&s.dirty(),d(o.value),{status:s.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?j:(o.status==="dirty"&&s.dirty(),d(o.value).then(()=>({status:s.value,value:o.value}))))}if(r.type==="transform")if(a.common.async===!1){const d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Je(d))return j;const o=r.transform(d.value,l);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>Je(d)?Promise.resolve(r.transform(d.value,l)).then(o=>({status:s.value,value:o})):j);A.assertNever(r)}}et.create=(t,e,s)=>new et({schema:t,typeName:w.ZodEffects,effect:e,...R(s)});et.createWithPreprocess=(t,e,s)=>new et({schema:e,effect:{type:"preprocess",transform:t},typeName:w.ZodEffects,...R(s)});class Oe extends E{_parse(e){return this._getType(e)===x.undefined?de(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oe.create=(t,e)=>new Oe({innerType:t,typeName:w.ZodOptional,...R(e)});class tt extends E{_parse(e){return this._getType(e)===x.null?de(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tt.create=(t,e)=>new tt({innerType:t,typeName:w.ZodNullable,...R(e)});class ps extends E{_parse(e){const{ctx:s}=this._processInputParams(e);let a=s.data;return s.parsedType===x.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}ps.create=(t,e)=>new ps({innerType:t,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...R(e)});class xs extends E{_parse(e){const{ctx:s}=this._processInputParams(e),a={...s,common:{...s.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return St(r)?r.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new je(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new je(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}xs.create=(t,e)=>new xs({innerType:t,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...R(e)});class Yn extends E{_parse(e){if(this._getType(e)!==x.nan){const a=this._getOrReturnCtx(e);return h(a,{code:m.invalid_type,expected:x.nan,received:a.parsedType}),j}return{status:"valid",value:e.data}}}Yn.create=t=>new Yn({typeName:w.ZodNaN,...R(t)});class Ei extends E{_parse(e){const{ctx:s}=this._processInputParams(e),a=s.data;return this._def.type._parse({data:a,path:s.path,parent:s})}unwrap(){return this._def.type}}class _s extends E{_parse(e){const{status:s,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return l.status==="aborted"?j:l.status==="dirty"?(s.dirty(),ht(l.value)):this._def.out._parseAsync({data:l.value,path:a.path,parent:a})})();{const r=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return r.status==="aborted"?j:r.status==="dirty"?(s.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:a.path,parent:a})}}static create(e,s){return new _s({in:e,out:s,typeName:w.ZodPipeline})}}class vs extends E{_parse(e){const s=this._def.innerType._parse(e),a=r=>(Je(r)&&(r.value=Object.freeze(r.value)),r);return St(s)?s.then(r=>a(r)):a(s)}unwrap(){return this._def.innerType}}vs.create=(t,e)=>new vs({innerType:t,typeName:w.ZodReadonly,...R(e)});var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));const Ze=Pe.create,ua=hs.create;Me.create;const ma=ve.create,ks=H.create;Dt.create;Lt.create;Fe.create;const Ai=Xe.create;$t.create;Oe.create;tt.create;const Ii=/^\d{4}-\d{2}-\d{2}$/,Pi=ks({title:Ze().min(1),items:ma(Ze().min(1)).min(1)}),Oi=ks({version:Ze().min(1),publishedAt:Ze().regex(Ii,"Expected YYYY-MM-DD"),title:Ze().min(1),sections:ma(Pi).min(1),prerelease:ua().optional()});ks({changeType:Ai(["feature","improvement","fix","internal","docs"]),title:Ze().min(1),summary:Ze().min(1),public:ua()});const Si=[{version:"0.7.1",publishedAt:"2026-04-07",title:"Production-safe remote auth builds",sections:[{title:"Improvements",items:["Remote auth build targets stay production-safe: Development builds can still override the remote auth URL without leaking non-production URLs or env overrides into the shipped production bundle."]}]},{version:"0.7.0",publishedAt:"2026-04-07",title:"Accounts, relay access, and faster chat workflows",sections:[{title:"New Features",items:["Kaizen Connect accounts: Sign the local Kaizen app into your web account and keep account state synced across devices.","Remote relay access and controls: Hosted relay support now includes admin approvals, machine management, an account settings flow, idle shutdown, wake-on-demand, and a dedicated Kaizen Connect landing flow.","Billing and account management: The web app now includes pricing, Polar-backed billing, account dashboards, subscription state, and expanded device management.","Expanded sign-in security: The web app now supports Google and GitHub OAuth, plus TOTP setup for password-based accounts.","Faster handoff and prompting tools: Kaizen now includes saved plan handoff quick chats, reusable quick prompts, and managed custom theme backgrounds.","Native slash commands: The chat composer now supports slash command autocomplete along with built-in PR and workflow commands.","More provider and file support: Kaizen now supports OpenRouter via openCode ACP along with Markdown and PDF chat attachments.","Feature access and privacy controls: Account-gated features now stay visible with locked states, and streamer mode can hide account details, device metadata, and relay URLs.","Broader chat recovery tools: Kaizen can recover more provider-backed chats, including stronger Cursor chat recovery and import support."]},{title:"Improvements",items:["Fix various bugs across chat recovery, waiting prompts, relay/account sync, and dashboard flows.","Fix various performance issues across chat startup, transcript rendering, sidebar updates, websocket sync, local persistence, and asset delivery.","Polish loading states, shared branding, and overall UI consistency across the CLI app and web app."]}]},{version:"0.6.1",publishedAt:"2026-03-30",title:"Background notifications and SEO updates",sections:[{title:"Improvements",items:["Background chat notifications: Kaizen can now alert you with browser notifications, sound, and vibration when background chats need input or finish responding.","SEO enhancements: Updated site metadata, robots.txt rules, and sitemap priorities to improve search engine discoverability."]},{title:"Under the Hood",items:["Added a root `tailscale:reset` script to reset local Tailscale serve configuration during setup and support workflows."]}]},{version:"0.6.0",publishedAt:"2026-03-29",title:"Remote handoff setup and QR launches",sections:[{title:"New Features",items:["Add remote handoff flow for Kaizen: Kaizen can now guide remote Tailscale setup and generate handoff links and QR codes for opening sessions on another device."]}]},{version:"0.5.0",publishedAt:"2026-03-29",title:"Bundled release history and stronger session recovery",sections:[{title:"New Features",items:["Bundled release history and stronger session recovery: Kaizen now ships in-app and web release notes while recovering chat usage and session state more reliably after reloads."]}]},{version:"0.4.0",publishedAt:"2026-03-29",title:"Branding refresh and packaged runtime updates",sections:[{title:"Highlights",items:["Refreshed the Kaizen branding and theme system across the product surface.","Published the built Kaizen runtime and added the web start command needed for the packaged flow.","Renamed the `keizen` app paths to `kaizen`, fixed review follow-ups, and aligned web builds on Node 20."]}]},{version:"0.3.0",publishedAt:"2026-03-29",title:"Feature overview workflow and release workflow baseline",sections:[{title:"Highlights",items:["Added the feature overview workflow and plan attachment support for structured project work.","Added the pull-request skill and the first pass of the npm publish and release workflow guidance."]}]},{version:"0.2.2",publishedAt:"2026-03-28",title:"UI and restart regression fixes",sections:[{title:"Highlights",items:["Fixed Kaizen UI regressions and restart issues that were blocking a stable local runtime."]}]}];function Jn(t){return new Date(`${t}T00:00:00.000Z`).getTime()}function Mi(t,e="en-US"){return new Intl.DateTimeFormat(e,{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${t}T00:00:00.000Z`))}function Di(t){return[...t].sort((e,s)=>{const a=Jn(s.publishedAt)-Jn(e.publishedAt);return a!==0?a:s.version.localeCompare(e.version,void 0,{numeric:!0,sensitivity:"base"})})}const Li=Object.freeze(Di(Si.map(t=>Oi.parse(t))));function $i(t){const e=we.c(5),{entries:s}=t;if(s.length===0){let l;return e[0]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-card/30 px-6 py-10 text-sm text-muted-foreground",children:"No release notes have been published yet."}),e[0]=l):l=e[0],l}let a;e[1]!==s?(a=s.map(Ui),e[1]=s,e[2]=a):a=e[2];let r;return e[3]!==a?(r=n.jsx("div",{className:"space-y-4",children:a}),e[3]=a,e[4]=r):r=e[4],r}function Ui(t){return n.jsxs("article",{className:"rounded-2xl border border-border bg-card/60 p-5",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx("h3",{className:"text-base font-semibold text-foreground",children:t.title}),n.jsxs("span",{className:"rounded-full border border-border bg-muted/60 px-2.5 py-1 text-xs font-medium text-muted-foreground",children:["v",t.version]}),t.prerelease?n.jsx("span",{className:"rounded-full border border-amber-500/30 bg-amber-500/10 px-2.5 py-1 text-xs font-medium text-amber-600 dark:text-amber-300",children:"Prerelease"}):null]}),n.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Published ",Mi(t.publishedAt)]}),n.jsx("div",{className:"mt-4 space-y-4 text-sm text-foreground",children:t.sections.map(Vi)})]},`${t.version}-${t.publishedAt}`)}function Vi(t){return n.jsxs("section",{className:"space-y-2",children:[n.jsx("h4",{className:"text-sm font-semibold text-foreground",children:t.title}),n.jsx("ul",{className:"list-disc space-y-2 pl-5 text-muted-foreground",children:t.items.map(Bi)})]},t.title)}function Bi(t){return n.jsx("li",{children:t},t)}const zi=ys.filter(t=>t.systemActive);function Zi(){const t=we.c(27),{remoteAuth:e}=na();let s;t[0]!==e?(s=aa(e),t[0]=e,t[1]=s):s=t[1];const r=s.features.handoff.enabled,l=ut(Qi),d=ut(Gi),o=ut(Wi),c=ut(Hi),f=ut(qi);let v;t[2]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("div",{className:"max-w-2xl",children:"Hand Off entries are reusable handoff shortcuts for plan mode. The selected provider starts a fresh chat in the same feature and receives the approved plan as its first message."}),t[2]=v):v=t[2];let k;t[3]!==r?(k=r?null:n.jsx(Qe,{level:"account"}),t[3]=r,t[4]=k):k=t[4];const P=!r;let D;t[5]!==d?(D=()=>d(dr()),t[5]=d,t[6]=D):D=t[6];let K;t[7]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(cr,{className:"mr-1.5 h-4 w-4"}),t[7]=K):K=t[7];let V;t[8]!==P||t[9]!==D?(V=n.jsxs(G,{type:"button",size:"sm",variant:"outline",className:"rounded-full",disabled:P,onClick:D,children:[K,"Add Hand Off"]}),t[8]=P,t[9]=D,t[10]=V):V=t[10];const B=!r;let S;t[11]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(la,{className:"mr-1.5 h-4 w-4"}),t[11]=S):S=t[11];let z;t[12]!==f||t[13]!==B?(z=n.jsxs(G,{type:"button",size:"sm",variant:"outline",className:"rounded-full",disabled:B,onClick:f,children:[S,"Reset Defaults"]}),t[12]=f,t[13]=B,t[14]=z):z=t[14];let Y;t[15]!==k||t[16]!==V||t[17]!==z?(Y=n.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl border border-border bg-card/30 px-4 py-4 text-sm text-muted-foreground sm:flex-row sm:items-center sm:justify-between",children:[v,n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[k,V,z]})]}),t[15]=k,t[16]=V,t[17]=z,t[18]=Y):Y=t[18];let ee;t[19]!==l||t[20]!==r||t[21]!==c||t[22]!==o?(ee=l.length===0?n.jsx("div",{className:"py-8 text-sm text-muted-foreground",children:"No Hand Off entries configured."}):l.map((M,fe)=>{const ce=pt(M.provider),ue=ce.models.some(O=>O.id===M.model)?M.model:ce.defaultModel;return n.jsxs("div",{className:`grid gap-4 py-5 md:grid-cols-[minmax(0,1.1fr)_160px_200px_minmax(0,1.2fr)_auto] ${fe===0?"":"border-t border-border"}`,children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Label"}),n.jsx(ke,{value:M.label,disabled:!r,onChange:O=>o(M.id,{label:O.target.value}),placeholder:"Claude Opus"})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Provider"}),n.jsxs(L,{value:M.provider,disabled:!r,onValueChange:O=>{const yt=O,Ke=pt(yt);o(M.id,{provider:yt,model:Ke.defaultModel,modelOptions:Ke.defaultModelOptions})},children:[n.jsx($,{children:n.jsx(F,{})}),n.jsx(U,{children:zi.map(Ki)})]})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Model"}),n.jsxs(L,{value:ue,disabled:!r,onValueChange:O=>o(M.id,{model:O}),children:[n.jsx($,{children:n.jsx(F,{})}),n.jsx(U,{children:ce.models.map(Fi)})]})]}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Base Prompt"}),n.jsx(ke,{value:M.basePrompt,disabled:!r,onChange:O=>o(M.id,{basePrompt:O.target.value}),placeholder:lr})]}),n.jsx("div",{className:"flex items-end",children:n.jsx(G,{type:"button",size:"icon",variant:"outline",className:"rounded-full","aria-label":`Remove ${M.label}`,title:`Remove ${M.label}`,disabled:!r,onClick:()=>c(M.id),children:n.jsx(or,{className:"h-4 w-4"})})})]},M.id)}),t[19]=l,t[20]=r,t[21]=c,t[22]=o,t[23]=ee):ee=t[23];let te;return t[24]!==Y||t[25]!==ee?(te=n.jsxs("div",{className:"border-b border-border",children:[Y,ee]}),t[24]=Y,t[25]=ee,t[26]=te):te=t[26],te}function Fi(t){return n.jsx(N,{value:t.id,children:t.label},t.id)}function Ki(t){return n.jsx(N,{value:t.id,children:t.label},t.id)}function qi(t){return t.resetToDefaults}function Hi(t){return t.removeEntry}function Wi(t){return t.updateEntry}function Gi(t){return t.addEntry}function Qi(t){return t.entries}const Yi=ys.filter(t=>t.systemActive);function Ji(){const t=we.c(32),e=ze(il),s=ze(rl),a=ze(al),r=ze(nl),l=ze(sl),d=ze(tl),o=ze(el);let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"max-w-2xl",children:"Slash commands can run Kaizen-local actions or send saved prompt templates. Pull request commands only appear when the current chat provider is enabled below."}),t[0]=c):c=t[0];let f;t[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(la,{className:"mr-1.5 h-4 w-4"}),t[1]=f):f=t[1];let v;t[2]!==o?(v=n.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl border border-border bg-card/30 px-4 py-4 text-sm text-muted-foreground sm:flex-row sm:items-center sm:justify-between",children:[c,n.jsxs(G,{type:"button",size:"sm",variant:"outline",className:"rounded-full",onClick:o,children:[f,"Reset Defaults"]})]}),t[2]=o,t[3]=v):v=t[3];let k;t[4]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Pull Request Providers"}),t[4]=k):k=t[4];let P;t[5]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsxs("div",{className:"mb-3 text-sm text-muted-foreground",children:["Show PR slash commands only when one of these providers is active in the composer. Default:"," ",ur.map(Xi).join(", "),"."]}),t[5]=P):P=t[5];let D;t[6]!==a||t[7]!==d?(D=Yi.map(g=>{const ue=a.includes(g.id);return n.jsx(G,{type:"button","aria-pressed":ue,variant:ue?"default":"outline",className:xe("rounded-full",!ue&&"text-muted-foreground"),onClick:()=>d(g.id),children:g.label},g.id)}),t[6]=a,t[7]=d,t[8]=D):D=t[8];let K;t[9]!==D?(K=n.jsxs("div",{children:[k,P,n.jsx("div",{className:"flex flex-wrap gap-2",children:D})]}),t[9]=D,t[10]=K):K=t[10];let V,B;t[11]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"`/pr` Base Prompt"}),B=n.jsx("div",{className:"mb-3 text-sm text-muted-foreground",children:"Sent when you run `/pr` with no extra text. If you add text after the command, Kaizen appends it as extra instructions."}),t[11]=V,t[12]=B):(V=t[11],B=t[12]);let S;t[13]!==r?(S=g=>r(g.target.value),t[13]=r,t[14]=S):S=t[14];let z;t[15]!==e||t[16]!==S?(z=n.jsxs("div",{className:"border-t border-border pt-5",children:[V,B,n.jsx(jn,{value:e,onChange:S,rows:5,className:"min-h-28"})]}),t[15]=e,t[16]=S,t[17]=z):z=t[17];let Y,ee;t[18]===Symbol.for("react.memo_cache_sentinel")?(Y=n.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"`/pr-update` Base Prompt"}),ee=n.jsx("div",{className:"mb-3 text-sm text-muted-foreground",children:"Sent when you run `/pr-update` with no extra text. Extra text is appended as additional instructions."}),t[18]=Y,t[19]=ee):(Y=t[18],ee=t[19]);let te;t[20]!==l?(te=g=>l(g.target.value),t[20]=l,t[21]=te):te=t[21];let M;t[22]!==s||t[23]!==te?(M=n.jsxs("div",{className:"border-t border-border pt-5",children:[Y,ee,n.jsx(jn,{value:s,onChange:te,rows:5,className:"min-h-28"})]}),t[22]=s,t[23]=te,t[24]=M):M=t[24];let fe;t[25]!==z||t[26]!==M||t[27]!==K?(fe=n.jsxs("div",{className:"grid gap-5 py-5",children:[K,z,M]}),t[25]=z,t[26]=M,t[27]=K,t[28]=fe):fe=t[28];let ce;return t[29]!==fe||t[30]!==v?(ce=n.jsxs("div",{className:"border-b border-border",children:[v,fe]}),t[29]=fe,t[30]=v,t[31]=ce):ce=t[31],ce}function Xi(t){return pt(t).label}function el(t){return t.resetToDefaults}function tl(t){return t.togglePullRequestProvider}function sl(t){return t.setPullRequestUpdatePrompt}function nl(t){return t.setPullRequestPrompt}function al(t){return t.pullRequestProviders}function rl(t){return t.pullRequestUpdatePrompt}function il(t){return t.pullRequestPrompt}function ll(t){var e;return n.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-foreground",children:((e=t.remoteAuthSnapshot)==null?void 0:e.baseUrl)??""})}const gt=[{id:"account",label:"Account",icon:Xr,subtitle:"Sign in, review account access, and unlock Kaizen features."},{id:"general",label:"General",icon:Yr,subtitle:"Manage appearance, editor behavior, and embedded terminal defaults."},{id:"changelog",label:"Release Notes",icon:ia,subtitle:"Review shipped changes included in the npm release history."},{id:"quick-chats",label:"Hand Off",icon:mr,subtitle:"Configure handoff shortcuts for plan mode."},{id:"slash-commands",label:"/ commands",icon:cs,subtitle:"Configure Kaizen slash command prompts and which providers expose them."},{id:"providers",label:"Providers",icon:qr,subtitle:"Manage the default chat provider and saved model defaults for Claude, Codex, Gemini, Cursor, and OpenRouter."},{id:"keybindings",label:"Keybindings",icon:Br,subtitle:"Edit global app shortcuts stored in the active keybindings file."}],ds=30*6e4,Xn=15e3;function ea(t){return t&&gt.some(e=>e.id===t)?t:null}const ol=[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"windsurf",label:"Windsurf"},{value:"custom",label:"Custom"}],Vt=Object.keys(ms);function dl(t){return`Edit global app shortcuts stored in ${t}.`}function Ot(t){return Object.fromEntries(Vt.map(e=>[e,us(t[e])]))}function Ut(t,e){return Vt.every(s=>(t[s]??"")===(e[s]??""))}function cl(t,e,s){const a={...t};for(const r of Vt)(t[r]??"")===(e[r]??"")&&(a[r]=s[r]??"");return a}function ul(t,e,s){return e&&Ut(s,e)?{changed:!1,nextCurrent:t,nextLoaded:e,nextSaved:e}:{changed:!0,nextCurrent:!e||Ut(t,e)?s:t,nextLoaded:s,nextSaved:s}}function ml(t){const e=(t==null?void 0:t.status)==="checking",s=(t==null?void 0:t.status)==="updating"||(t==null?void 0:t.status)==="restart_pending";return t!=null&&t.updateAvailable?{disabled:s,kind:"update",label:"Update",variant:"default"}:{disabled:e||s,kind:"check",label:"Check for updates",spinning:e,variant:"outline"}}function ft(t,e,s){const a=pt(s,t),r=(e==null?void 0:e.settings[s])??W[s];return a.systemActive?r.active?"Active.":"Inactive.":Or(s,e==null?void 0:e.settings,t)??"Inactive."}function fl(t){return t&&typeof t=="object"&&"idx"in t&&typeof t.idx=="number"&&t.idx>0?"back":"home"}function ta({themePreference:t,nextBackgroundImage:e,backgroundOpacity:s}){const a=typeof e=="string"&&e.trim()!=="";return t!=="custom"||!a||s!==1?{}:{backgroundOpacity:.85,backgroundBlur:6}}function T(t){const e=we.c(19),{title:s,description:a,children:r,badge:l,bordered:d,alignStart:o}=t,c=d===void 0?!0:d,f=o===void 0?!1:o,v=c?"border-t border-border":void 0,k=`flex flex-col sm:flex-row sm:justify-between gap-3 sm:gap-8 py-5 ${f?"sm:items-start":"sm:items-center"}`;let P;e[0]!==s?(P=n.jsx("span",{children:s}),e[0]=s,e[1]=P):P=e[1];let D;e[2]!==l||e[3]!==P?(D=n.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm font-medium text-foreground",children:[P,l]}),e[2]=l,e[3]=P,e[4]=D):D=e[4];let K;e[5]!==a?(K=n.jsx("div",{className:"mt-1 text-[13px] text-muted-foreground",children:a}),e[5]=a,e[6]=K):K=e[6];let V;e[7]!==D||e[8]!==K?(V=n.jsxs("div",{className:"min-w-0 max-w-xl",children:[D,K]}),e[7]=D,e[8]=K,e[9]=V):V=e[9];let B;e[10]!==r?(B=n.jsx("div",{className:"flex w-full items-center sm:w-auto sm:shrink-0",children:r}),e[10]=r,e[11]=B):B=e[11];let S;e[12]!==k||e[13]!==V||e[14]!==B?(S=n.jsxs("div",{className:k,children:[V,B]}),e[12]=k,e[13]=V,e[14]=B,e[15]=S):S=e[15];let z;return e[16]!==S||e[17]!==v?(z=n.jsx("div",{className:v,children:S}),e[16]=S,e[17]=v,e[18]=z):z=e[18],z}function bs(t){if(!t)return"—";const e=Date.parse(t);return Number.isNaN(e)?t:new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}).format(e)}function hl(t){const e=we.c(3),{url:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=ra("/api/qrcode"),e[0]=a):a=e[0];const r=`${a}?value=${encodeURIComponent(s)}`;let l;return e[1]!==r?(l=n.jsx("div",{className:"rounded-2xl border border-border bg-background/80 p-3",children:n.jsx("img",{src:r,alt:"QR code for relay access",className:"h-44 w-44 rounded-lg bg-white p-2"})}),e[1]=r,e[2]=l):l=e[2],l}function gl(t){switch(t){case"signed_in":return"Connected to Kaizen";case"signed_out":return"Not connected";case"pending_sign_in":return"Finish signing in…";case"error":return"Connection error";default:return t}}function pl(t){const e=we.c(10),{access:s}=t,a=s.signedIn?"OpenRouter, Provider Usage, and Hand Off are unlocked.":"Sign in to unlock OpenRouter, Provider Usage, and Hand Off.";let r;e[0]!==a?(r={label:"Account features",body:a},e[0]=a,e[1]=r):r=e[1];const l=s.paid?"Remote relay, browser notifications, install flows, and sync surfaces are unlocked.":"Upgrade to unlock remote relay, browser notifications, install flows, and sync surfaces.";let d;e[2]!==l?(d={label:"Paid features",body:l},e[2]=l,e[3]=d):d=e[3];let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o={label:"Account destination",body:`Locked features send you back to ${Mr}.`},e[4]=o):o=e[4];let c;e[5]!==r||e[6]!==d?(c=[r,d,o],e[5]=r,e[6]=d,e[7]=c):c=e[7];const f=c;let v;return e[8]!==f?(v=n.jsx("dl",{className:"w-full min-w-0 space-y-3.5 text-left sm:max-w-[420px]",children:f.map(xl)}),e[8]=f,e[9]=v):v=e[9],v}function xl(t){return n.jsxs("div",{children:[n.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t.label}),n.jsx("dd",{className:"mt-1 text-sm leading-snug text-foreground",children:t.body})]},t.label)}function vl(t){const e=we.c(9),{access:s}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Account access"}),e[0]=a):a=e[0];const r=s.signedIn?"Unlocked":"Locked";let l;e[1]!==r?(l=n.jsxs("div",{children:[a,n.jsx("dd",{className:"mt-1 tabular-nums text-sm text-foreground",children:r})]}),e[1]=r,e[2]=l):l=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("dt",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Paid access"}),e[3]=d):d=e[3];const o=s.paid?"Unlocked":"Locked";let c;e[4]!==o?(c=n.jsxs("div",{children:[d,n.jsx("dd",{className:"mt-1 tabular-nums text-sm text-foreground",children:o})]}),e[4]=o,e[5]=c):c=e[5];let f;return e[6]!==l||e[7]!==c?(f=n.jsxs("dl",{className:"mt-4 grid gap-3 sm:grid-cols-2 sm:gap-x-6",children:[l,c]}),e[6]=l,e[7]=c,e[8]=f):f=e[8],f}function bl(t){const e=we.c(20),{snapshot:s,redactMachineId:a}=t,r=a===void 0?!1:a;if(!s)return null;let l;if(e[0]!==r||e[1]!==s.connectedAt||e[2]!==s.lastHeartbeatAt||e[3]!==s.machineDisplayName||e[4]!==s.machineId){if(l=[],s.machineDisplayName&&!r){let o;e[6]!==s.machineDisplayName?(o={label:"Machine",value:s.machineDisplayName},e[6]=s.machineDisplayName,e[7]=o):o=e[7],l.push(o)}else if(s.machineId&&!r){let o;e[8]!==s.machineId?(o={label:"Machine ID",value:s.machineId},e[8]=s.machineId,e[9]=o):o=e[9],l.push(o)}if(s.connectedAt){let o;e[10]!==s.connectedAt?(o=bs(s.connectedAt),e[10]=s.connectedAt,e[11]=o):o=e[11];let c;e[12]!==o?(c={label:"Connected",value:o},e[12]=o,e[13]=c):c=e[13],l.push(c)}if(s.lastHeartbeatAt){let o;e[14]!==s.lastHeartbeatAt?(o=bs(s.lastHeartbeatAt),e[14]=s.lastHeartbeatAt,e[15]=o):o=e[15];let c;e[16]!==o?(c={label:"Last heartbeat",value:o},e[16]=o,e[17]=c):c=e[17],l.push(c)}e[0]=r,e[1]=s.connectedAt,e[2]=s.lastHeartbeatAt,e[3]=s.machineDisplayName,e[4]=s.machineId,e[5]=l}else l=e[5];if(l.length===0)return null;let d;return e[18]!==l?(d=n.jsx("dl",{className:"mt-3 space-y-2 text-sm",children:l.map(yl)}),e[18]=l,e[19]=d):d=e[19],d}function yl(t){return n.jsxs("div",{className:"flex flex-col gap-0.5 sm:flex-row sm:justify-between sm:gap-4",children:[n.jsx("dt",{className:"text-muted-foreground",children:t.label}),n.jsx("dd",{className:"min-w-0 break-all text-right tabular-nums text-foreground sm:text-left",children:t.value})]},t.label)}function Nl(){var yn,_n,kn;const t=fr(),e=hr(),{sectionId:s}=gr(),a=pr(),r=na(),l=xr(),d=vr(),o=br(),c=_.useMemo(()=>({...a,...r,...l,...d,...o}),[d,a,r,l,o]),{theme:f,setTheme:v}=yr(),k=ea(s)??"general",P=c.connectionStatus==="connecting",D=((yn=c.localProjects)==null?void 0:yn.machine.displayName)??"Unavailable",K=((_n=c.localProjects)==null?void 0:_n.projects.length)??0,V=_r.split("/")[1]??"unknown",B=Ne(i=>i.scrollbackLines),S=Ne(i=>i.minColumnWidth),z=Ne(i=>i.editorPreset),Y=Ne(i=>i.editorCommandTemplate),ee=Ne(i=>i.setScrollbackLines),te=Ne(i=>i.setMinColumnWidth),M=Ne(i=>i.setEditorPreset),fe=Ne(i=>i.setEditorCommandTemplate),ce=c.keybindings,g=c.providerSettings,ue=Ce(i=>i.defaultProvider),O=Ce(i=>i.providerDefaults),yt=Ce(i=>i.showProviderIconsInSideTray),Ke=Ce(i=>i.setDefaultProvider),st=Ce(i=>i.setProviderDefaultModel),nt=Ce(i=>i.setProviderDefaultModelOptions),at=Ce(i=>i.setProviderDefaultPlanMode),fa=Ce(i=>i.setShowProviderIconsInSideTray),js=Re(i=>i.folderGroupsEnabled),ha=Re(i=>i.showFeatureOverviewInSidebar),ga=Re(i=>i.kanbanStatusesEnabled),pa=Re(i=>i.commitProjectMetadataDirectory),xa=Re(i=>i.setFolderGroupsEnabled),va=Re(i=>i.setShowFeatureOverviewInSidebar),ba=Re(i=>i.setKanbanStatusesEnabled),ya=Re(i=>i.setCommitProjectMetadataDirectory),ws=ae(i=>i.themeId),Ns=ae(i=>i.customAppearance),qe=ae(i=>i.backgroundImage),De=ae(i=>i.backgroundOpacity),rt=ae(i=>i.backgroundBlur),Cs=ae(i=>i.showProjectIconsInSidebar),_a=ae(i=>i.availableThemes),ka=ae(i=>i.setThemeId),ja=ae(i=>i.setCustomAppearance),Bt=ae(i=>i.setBackgroundImage),zt=ae(i=>i.setBackgroundOpacity),Zt=ae(i=>i.setBackgroundBlur),wa=ae(i=>i.setShowProjectIconsInSidebar),Na=Te(i=>i.browserNotificationsEnabled),Rs=Te(i=>i.soundEnabled),Ts=Te(i=>i.vibrationEnabled),Es=Te(i=>i.lastPermissionState),_t=Te(i=>i.setBrowserNotificationsEnabled),Ca=Te(i=>i.setSoundEnabled),Ra=Te(i=>i.setVibrationEnabled),As=Te(i=>i.setLastPermissionState),Le=_.useMemo(()=>wn(ce),[ce]),Is=Le.filePathDisplay||kr(),kt=_.useMemo(()=>Ot(Le.bindings),[Le.bindings]),[Ps,Ft]=_.useState(String(B)),[Os,Kt]=_.useState(String(S)),[qt,Ss]=_.useState(Y),[$e,jt]=_.useState(qe??""),[Ms,Ht]=_.useState(String(De)),[Ds,Wt]=_.useState(String(rt)),[Ue,it]=_.useState(()=>Ot(Le.bindings)),[Gt,Ls]=_.useState(()=>Ot(Le.bindings)),[$s,wt]=_.useState(null),[Nt,Us]=_.useState(!1),Qt=_.useRef(kt),Vs=_.useRef(kt),[Bs,Yt]=_.useState(null),[kl,Ta]=_.useState(""),[lt,ie]=_.useState(null),[ot,Ct]=_.useState(null),[zs,Rt]=_.useState(null),[Zs,Jt]=_.useState(!1),[Ea,Fs]=_.useState(!1),[dt,Ks]=_.useState(!1),qs=_.useRef(null),[He,Hs]=_.useState(null),[Tt,Et]=_.useState(null),X=_.useMemo(()=>ys.map(i=>{var p;return((p=c.providerCatalog)==null?void 0:p.find(I=>I.id===i.id))??i}),[c.providerCatalog]),Aa=_.useMemo(()=>new Map(X.map(i=>[i.id,i])),[X]),At=_.useMemo(()=>jr(X,(g==null?void 0:g.settings)??W),[X,g==null?void 0:g.settings]),Q=i=>Aa.get(i)??pt(i),Ia=ue==="last_used"||At.some(i=>i.id===ue)?ue:"last_used",[Ws,Pa]=_.useState([]),C=c.updateSnapshot,Gs=he.settingsUpdate("check"),Qs=he.settingsUpdate("install"),Oa=he.settingsRemoteAuth("save"),Xt=he.settingsRemoteAuth("sign_in"),We=he.settingsRemoteAuth("refresh"),Ys=he.settingsRemoteAuth("sign_out"),Js=he.settingsRemoteAuth("streamer_mode"),Xs=he.settingsTheme("refresh"),en=he.settingsTheme("open_editor"),tn=he.settingsTheme("open_folder"),sn=ge(Gs),nn=ge(Qs);ge(Oa);const an=ge(Xt),Sa=ge(We),Ma=ge(Ys),rn=ge(Js),ye=lt!==null||rn,Da=ge(Xs),La=ge(en),$a=ge(tn),u=c.remoteAuth,Z=aa(u),es=Ir({browserNotificationsEnabled:Na,signedIn:Z.signedIn}),se=c.themeSettings,ts=Pn(Es),Ua=Ar(),Va=Rr(ts),ln=ts!=="unsupported",on=_.useRef(e.pathname),Ba=typeof navigator<"u"&&typeof navigator.vibrate=="function",Ve=ml({...C,status:nn?"updating":sn?"checking":C==null?void 0:C.status}),za=sn||(C==null?void 0:C.status)==="checking"?"Checking for updates…":nn||(C==null?void 0:C.status)==="updating"?"Installing update…":(C==null?void 0:C.status)==="restart_pending"?`Restarting ${Nn}…`:(C==null?void 0:C.status)==="available"?`Update available${C.latestVersion?`: ${C.latestVersion}`:""}`:(C==null?void 0:C.status)==="up_to_date"?"Up to date":(C==null?void 0:C.status)==="error"?"Update check failed":"Not checked yet";_.useEffect(()=>{fetch(ra("/api/backgrounds")).then(i=>i.json()).then(i=>Pa(i)).catch(i=>console.error("Failed to load system backgrounds",i))},[]),_.useEffect(()=>{on.current=e.pathname},[e.pathname]),_.useEffect(()=>{Ft(String(B))},[B]),_.useEffect(()=>{Kt(String(S))},[S]),_.useEffect(()=>{Ss(Y)},[Y]),_.useEffect(()=>{jt(qe??"")},[qe]),_.useEffect(()=>{Ht(String(De))},[De]),_.useEffect(()=>{Wt(String(rt))},[rt]),_.useEffect(()=>{const i=kt,p=Qt.current,I=ul(Ue,p,i);I.changed&&(Qt.current=I.nextLoaded,Ls(I.nextSaved),it(I.nextCurrent))},[Ue,kt]),_.useEffect(()=>{Vs.current=Ue},[Ue]),_.useEffect(()=>{s&&(ea(s)||t("/settings/general",{replace:!0}))},[t,s]);function dn(){const i=Number(Ps);if(!Number.isFinite(i)){Ft(String(B));return}ee(i)}function cn(){const i=Number(Os);if(!Number.isFinite(i)){Kt(String(S));return}te(i)}function un(){const i=$e.trim()===""?null:$e.trim(),p=ta({themePreference:f,nextBackgroundImage:i,backgroundOpacity:De});Bt(i),p.backgroundOpacity!==void 0&&zt(p.backgroundOpacity),p.backgroundBlur!==void 0&&Zt(p.backgroundBlur),_e({backgroundImage:i,...p})}function mn(){const i=Number(Ms);if(!Number.isFinite(i)||i<0||i>1){Ht(String(De));return}zt(i),_e({backgroundOpacity:i})}function fn(){const i=Number(Ds);if(!Number.isFinite(i)||i<0){Wt(String(rt));return}Zt(i),_e({backgroundBlur:i})}function It(i,p){i.key==="Enter"&&(p(),i.currentTarget.blur())}function hn(i,p){i.key==="Enter"&&(p(),i.currentTarget.blur())}function gn(){fe(qt)}async function Za(i=Vs.current){try{Us(!0),wt(null);const p={...i},I=await c.socket.command({type:"settings.writeKeybindings",bindings:_l(p)}),le=Ot(wn(I).bindings);Qt.current=le,Ls(le),it(me=>cl(me,p,le))}catch(p){wt(p instanceof Error?p.message:"Unable to save keybindings.")}finally{Us(!1)}}async function _e(i){try{await c.socket.command({type:"settings.writeThemeSettings",settings:{themePreference:(i==null?void 0:i.themePreference)??f,themeId:(i==null?void 0:i.themeId)??ws,customAppearance:(i==null?void 0:i.customAppearance)??Ns,backgroundImage:(i==null?void 0:i.backgroundImage)!==void 0?i.backgroundImage:qe,backgroundOpacity:(i==null?void 0:i.backgroundOpacity)??De,backgroundBlur:(i==null?void 0:i.backgroundBlur)??rt,showProjectIconsInSidebar:(i==null?void 0:i.showProjectIconsInSidebar)??Cs}})}catch(p){console.error("Failed to save theme settings:",p)}}async function ss(i,p){Hs(i);try{await pe(i==="refresh"?Xs:i==="open_editor"?en:tn,p,{statusLabel:i==="refresh"?"Refreshing themes...":i==="open_editor"?"Opening theme files...":"Opening theme folder..."})}finally{Hs(I=>I===i?null:I)}}async function pn(){if(Z.features.browserNotifications.enabled){Et("requesting");try{const i=await On();As(i),_t(i==="granted")}finally{Et(i=>i==="requesting"?null:i)}}}async function Fa(){if(Z.features.browserNotifications.enabled){Et("testing");try{let i=Pn(Es);es&&i==="default"&&ln&&(i=await On(),As(i),i!=="granted"&&_t(!1)),await Pr({event:{chatId:c.activeChatId??"settings-test",chatTitle:"Test notification",kind:"needs_input",projectTitle:"Settings"},onBrowserNotificationClick:()=>{t("/settings/general",{replace:on.current.startsWith("/settings")})},preferences:{browserNotificationsEnabled:es&&i==="granted",soundEnabled:Rs,vibrationEnabled:Ts}})}finally{Et(i=>i==="testing"?null:i)}}}async function ct(i){const p=(g==null?void 0:g.settings)??W,I=i.openrouter.active&&!p.openrouter.active&&!Z.features.openrouter.enabled,le=Z.features.openrouter.enabled?i:{...i,openrouter:{...i.openrouter,active:!1}};I&&Yt(Sr("OpenRouter","account"));try{I||Yt(null),await c.socket.command({type:"settings.writeProviderSettings",settings:le})}catch(me){Yt(me instanceof Error?me.message:"Unable to save provider settings.")}}function Ka(i){wt(null),it(p=>({...p,[i]:us(Sn[i])}))}function qa(){wt(null),it(Gt)}async function Ha(i){Ct(i?"enable":"disable");try{Rt(null),await c.socket.command({type:"remoteRelay.setEnabled",enabled:i})}catch(p){Rt(p instanceof Error?p.message:String(p))}finally{Ct(p=>p===(i?"enable":"disable")?null:p)}}async function Wa(){Ct("reconnect");try{Rt(null),await c.socket.command({type:"remoteRelay.setEnabled",enabled:!0})}catch(i){Rt(i instanceof Error?i.message:String(i))}finally{Ct(i=>i==="reconnect"?null:i)}}const Ga=qt.replaceAll("{path}","/Users/jake/Projects/kaizen/src/client/app/App.tsx").replaceAll("{line}","12").replaceAll("{column}","1"),xn=gt.find(i=>i.id===k)??gt[0],Qa=k==="keybindings"?dl(Is):xn.subtitle,Ya=Z.features.openrouter.enabled?At:[...At,...At.some(i=>i.id==="openrouter")?[]:[Q("openrouter")]];_.useEffect(()=>{ue==="openrouter"&&(Z.features.openrouter.enabled||Ke("last_used"))},[Z.features.openrouter.enabled,ue,Ke]);const y=c.remoteRelay,ne=(u==null?void 0:u.status)==="signed_in",Ja=((kn=u==null?void 0:u.entitlements)==null?void 0:kn["remote.relay"])===!0,Xa=(y==null?void 0:y.status)==="unauthorized",ns=ne&&Ja&&!Xa,Ge=(y==null?void 0:y.relayEnabled)??!0,er=(y==null?void 0:y.status)==="idle_disconnected"&&Ge,tr=!Z.features.openrouter.enabled,sr=!Z.features.remoteRelay.enabled,J=!ne||(u==null?void 0:u.streamerModeEnabled)!==!1,Pt=ne&&(u==null?void 0:u.streamerModeEnabled)!==!1,nr=_.useMemo(()=>(u==null?void 0:u.status)==="signed_in"?J?`Kaizen checks account state and relay availability every ${Xn/1e3} seconds, and falls back to a full auth reload every ${ds/6e4} minutes.`:`Account connected as ${u.userId??"your account"}. Kaizen checks account state and relay availability every ${Xn/1e3} seconds, and falls back to a full auth reload every ${ds/6e4} minutes. The current access token is valid until ${bs(u.accessTokenExpiresAt)}.`:(u==null?void 0:u.status)==="pending_sign_in"?"Complete account sign-in in the browser tab that opened. If nothing opened, use the continue link below.":u!=null&&u.error?u.error:"Link this app to your Kaizen account to unlock account-only features.",[u==null?void 0:u.status,u==null?void 0:u.userId,u==null?void 0:u.accessTokenExpiresAt,u==null?void 0:u.error,J]),ar=_.useMemo(()=>ne?ns?Ge?(y==null?void 0:y.status)==="idle_disconnected"?"Hosted relay disconnected after 30 minutes without browser-driven activity. It will reconnect automatically when a wake request arrives.":y!=null&&y.publicUrl&&!J?`Remote access is published at ${y.publicUrl}.`:"Relay state for this machine.":"Hosted relay is manually disabled on this machine. Wake requests are ignored until you turn it back on here.":"Hosted relay access is controlled by your Kaizen account state and refreshed from the web app automatically.":"Sign in from the account page to unlock remote access.",[ne,ns,Ge,y==null?void 0:y.status,y==null?void 0:y.publicUrl,J]);_.useEffect(()=>{J&&(Jt(!1),Fs(!1),Ks(!1))},[J,u==null?void 0:u.status,c.lastRemoteAuthUrl,y==null?void 0:y.publicUrl]);const vn=!P,rr=k==="keybindings"?n.jsxs(n.Fragment,{children:[n.jsx(Ae,{"data-testid":"keybindings-cancel-button",onClick:qa,disabled:Nt||Ut(Ue,Gt),children:"Cancel"}),n.jsx(Ae,{"data-testid":"keybindings-save-button",variant:"default",onClick:()=>{Za()},disabled:Nt||Ut(Ue,Gt),icon:Nt?n.jsx(oe,{className:"h-4 w-4 animate-spin"}):void 0,children:Nt?"Saving...":"Save"}),n.jsxs(Ae,{onClick:()=>{c.handleOpenExternalPath("open_editor",Is)},icon:n.jsx(cs,{className:"h-4 w-4"}),children:["Open in ",c.editorLabel]})]}):k==="general"?n.jsx(Ae,{variant:Ve.variant,onClick:()=>{if(Ve.kind==="update"){pe(Qs,()=>c.handleInstallUpdate(),{statusLabel:"Installing update..."});return}pe(Gs,()=>c.handleCheckForUpdates({force:!0}),{statusLabel:"Checking for updates..."})},disabled:Ve.disabled,icon:Ve.kind==="check"?n.jsx(Cn,{className:xe("size-3.5",Ve.spinning&&"animate-spin")}):Ve.kind==="update"?n.jsx(ia,{className:xe("size-3.5")}):void 0,children:Ve.label}):null;function bn(){if(fl(window.history.state)==="back"){t(-1);return}t("/",{replace:!0})}return _.useEffect(()=>{Ta((u==null?void 0:u.baseUrl)??"")},[u==null?void 0:u.baseUrl]),_.useEffect(()=>{const i=c.handleReloadRemoteAuth,p=k==="account"&&qs.current!=="account";qs.current=k,p&&(ye||(u==null?void 0:u.status)!=="signed_in"&&(u==null?void 0:u.status)!=="error"||(ie("refresh"),pe(We,i,{statusLabel:"Refreshing account state..."}).finally(()=>{ie(I=>I==="refresh"?null:I)})))},[We,ye,u==null?void 0:u.status,k,c.handleReloadRemoteAuth]),_.useEffect(()=>{const i=c.handleReloadRemoteAuth;if(k!=="account"||(u==null?void 0:u.status)!=="signed_in"&&(u==null?void 0:u.status)!=="error")return;const p=()=>{ye||(ie("refresh"),pe(We,i,{statusLabel:"Refreshing account state..."}).finally(()=>{ie(me=>me==="refresh"?null:me)}))},I=()=>{document.visibilityState==="visible"&&p()};window.addEventListener("focus",p),document.addEventListener("visibilitychange",I);const le=window.setInterval(p,ds);return()=>{window.removeEventListener("focus",p),document.removeEventListener("visibilitychange",I),window.clearInterval(le)}},[We,ye,u==null?void 0:u.status,k,c.handleReloadRemoteAuth]),n.jsxs("div",{className:"relative flex h-full flex-1 min-w-0 bg-background",children:[n.jsxs("div",{className:"flex min-w-0 flex-1",children:[n.jsx("aside",{className:`hidden w-[200px] shrink-0 md:block ${vn?"pb-[89px]":""}`,children:n.jsxs("div",{className:"flex flex-col gap-1 px-4 py-6",children:[n.jsx("div",{className:"px-3 pb-5 text-[22px] font-extrabold tracking-[-0.5px] text-foreground",children:"Settings"}),gt.map(i=>n.jsx("button",{type:"button",onClick:()=>t(`/settings/${i.id}`,{replace:!0}),className:`cursor-pointer rounded-lg px-3 py-2 text-sm ${i.id===k?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx(i.icon,{className:"h-4 w-4 shrink-0"}),n.jsx("span",{children:i.label})]})},i.label))]})}),n.jsxs("div",{className:"min-w-0 flex-1 overflow-y-auto",children:[n.jsx("div",{className:"md:hidden sticky top-0 z-10 bg-background border-b border-border px-4 py-2 backdrop-blur-md",children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto scrollbar-hide",children:gt.map(i=>n.jsxs("button",{type:"button",onClick:()=>t(`/settings/${i.id}`,{replace:!0}),className:`flex shrink-0 items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm transition-colors ${i.id===k?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"}`,children:[n.jsx(i.icon,{className:"h-3.5 w-3.5 shrink-0"}),n.jsx("span",{children:i.label})]},i.id))}),n.jsx("button",{type:"button","aria-label":"Close settings",onClick:bn,className:"ml-1 flex shrink-0 items-center justify-center rounded-lg p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",children:n.jsx(Rn,{className:"h-4 w-4"})})]})}),n.jsxs("div",{className:"w-full px-6 pt-8 md:pt-16 pb-32",children:[P?n.jsx("div",{className:"flex min-h-[240px] items-center justify-center rounded-2xl border border-border bg-card/40 px-4 py-6 text-sm text-muted-foreground",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(oe,{className:"h-4 w-4 animate-spin"}),n.jsx("span",{children:"Loading machine settings…"})]})}):n.jsxs("div",{className:"mx-auto max-w-4xl",children:[n.jsxs("div",{className:"pb-6",children:[n.jsxs("div",{className:"flex items-center justify-between gap-4 min-h-[34px]",children:[n.jsx("div",{className:"text-lg font-semibold tracking-[-0.2px] text-foreground",children:xn.label}),n.jsxs("div",{className:"flex items-center gap-2",children:[rr,n.jsx(Ae,{"aria-label":"Close settings",title:"Close settings",onClick:bn,icon:n.jsx(Rn,{className:"h-4 w-4"}),className:"hidden md:flex"})]})]}),n.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:Qa})]}),k==="account"?n.jsxs("div",{className:"border-b border-border",children:[n.jsx(T,{title:"Web dashboard",description:"Opens your Kaizen account dashboard in a new browser tab.",alignStart:!0,bordered:!1,children:n.jsxs("a",{href:ni(u==null?void 0:u.baseUrl),target:"_blank",rel:"noopener noreferrer",className:xe(sa({variant:"outline"}),"inline-flex gap-2 no-underline"),children:[n.jsx(Dr,{className:"h-4 w-4 shrink-0"}),"Open Dashboard"]})}),n.jsx(T,{title:"Streamer mode",description:ne?"Stores on your Kaizen account. When on (default), email, token timing, relay links, and sign-in URLs stay hidden — synced with the web dashboard.":"Sign in to sync privacy mode from your Kaizen account. Until then, sensitive fields stay hidden locally.",alignStart:!0,bordered:!1,children:n.jsxs(G,{type:"button",variant:Pt?"default":"outline","aria-pressed":Pt,className:"min-w-[72px]",disabled:!ne||ye,onClick:()=>{pe(Js,()=>c.handleSetStreamerMode(!Pt),{statusLabel:"Updating privacy setting..."})},children:[rn?n.jsx(oe,{className:"mr-2 h-4 w-4 animate-spin"}):null,Pt?"On":"Off"]})}),n.jsx(T,{title:"Email",description:ne?J?"Hidden while streamer mode is on. Use the eye to reveal on this device.":"Address for your Kaizen account.":"Sign in to link an account and show your email here.",alignStart:!0,children:n.jsxs("div",{className:"flex min-w-0 max-w-full items-center gap-2 sm:max-w-[360px]",children:[n.jsx("div",{className:"min-w-0 flex-1 text-sm text-foreground",children:ne?J&&!dt?n.jsx("span",{className:"text-muted-foreground",children:"—"}):u!=null&&u.email?n.jsx("span",{className:"break-all",children:u.email}):n.jsx("span",{className:"text-muted-foreground",children:"Not synced yet"}):n.jsx("span",{className:"text-muted-foreground",children:"—"})}),ne&&J?n.jsx(G,{type:"button",variant:"outline",size:"sm",className:"h-9 w-9 shrink-0 p-0","aria-pressed":dt,"aria-label":dt?"Hide email":"Show email",title:dt?"Hide email":"Show email",onClick:()=>Ks(i=>!i),children:dt?n.jsx(Dn,{className:"h-4 w-4"}):n.jsx(Mn,{className:"h-4 w-4"})}):null]})}),n.jsx(T,{title:"Kaizen account",badge:ne?null:n.jsx(Qe,{level:"account"}),description:nr,bordered:!1,alignStart:!0,children:n.jsxs("div",{className:"w-full min-w-0 space-y-3 sm:max-w-[360px]",children:[ll({remoteAuthSnapshot:u}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[(u==null?void 0:u.status)==="signed_out"||(u==null?void 0:u.status)==="error"?n.jsxs(n.Fragment,{children:[n.jsxs(G,{type:"button",variant:"outline",disabled:ye,onClick:()=>{ie("sign_in"),pe(Xt,()=>c.handleStartRemoteAuthSignIn("sign_up"),{statusLabel:"Starting sign-up..."}).finally(()=>ie(null))},children:[lt==="sign_in"||an?n.jsx(oe,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Sign up"]}),n.jsxs(G,{type:"button",disabled:ye,onClick:()=>{ie("sign_in"),pe(Xt,()=>c.handleStartRemoteAuthSignIn("sign_in"),{statusLabel:"Starting sign-in..."}).finally(()=>ie(null))},children:[lt==="sign_in"||an?n.jsx(oe,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Sign in"]})]}):null,(u==null?void 0:u.status)!=="signed_out"?n.jsxs(G,{type:"button",variant:"outline",disabled:ye,onClick:()=>{ie("refresh"),pe(We,()=>c.handleReloadRemoteAuth(),{statusLabel:"Refreshing account state..."}).finally(()=>ie(null))},children:[lt==="refresh"||Sa?n.jsx(oe,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Refresh"]}):null,(u==null?void 0:u.status)!=="signed_out"?n.jsxs(G,{type:"button",variant:"outline",disabled:ye,onClick:()=>{ie("sign_out"),pe(Ys,()=>c.handleSignOutRemoteAuth(),{statusLabel:"Signing out..."}).finally(()=>ie(null))},children:[lt==="sign_out"||Ma?n.jsx(oe,{className:"mr-2 h-4 w-4 animate-spin"}):null,(u==null?void 0:u.status)==="pending_sign_in"?"Cancel sign-in":"Sign out"]}):null]}),(u==null?void 0:u.status)==="pending_sign_in"&&c.lastRemoteAuthUrl?n.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:[n.jsx("div",{className:"font-medium text-foreground",children:"Continue sign-in"}),J&&!Ea?n.jsx(G,{type:"button",variant:"outline",className:"mt-2",onClick:()=>Fs(!0),children:"Show sign-in link"}):n.jsx("a",{href:c.lastRemoteAuthUrl,target:"_self",rel:"noreferrer",className:"mt-1 block break-all text-primary underline underline-offset-2",children:c.lastRemoteAuthUrl})]}):null]})}),ne?n.jsxs(n.Fragment,{children:[n.jsx(T,{title:"Unlocked Features",description:"Current account state and what it unlocks in this app.",alignStart:!0,children:n.jsxs("div",{className:"w-full min-w-0 space-y-3 sm:max-w-[420px]",children:[n.jsx(pl,{access:Z}),n.jsx(vl,{access:Z})]})}),n.jsx(T,{title:"Saved sign-in data",description:J?"Sign-in credentials are cached on this machine so you do not have to log in every launch.":`Sign-in is cached on this machine at ${(u==null?void 0:u.filePathDisplay)??"~/.kaizen/remote-auth.json"} so you do not have to log in every launch.`,alignStart:!0,children:n.jsx("div",{className:"text-sm text-foreground",children:gl((u==null?void 0:u.status)??"signed_out")})})]}):null,n.jsx(T,{title:"Remote relay",badge:sr?n.jsx(Qe,{level:"paid"}):null,description:ar,alignStart:!0,children:n.jsx("div",{className:"w-full min-w-0 space-y-3 sm:max-w-[420px]",children:Z.features.remoteRelay.enabled?ns?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[n.jsxs("div",{className:"text-sm text-foreground",children:["Status:"," ",(y==null?void 0:y.status)??"disabled"]}),n.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[y!=null&&y.publicUrl&&J?Zs?n.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>Jt(!1),children:[n.jsx(Dn,{className:"h-4 w-4 shrink-0"}),"Hide"]}):n.jsxs(wr,{children:[n.jsx(Nr,{asChild:!0,children:n.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"gap-1.5",onClick:()=>Jt(!0),children:[n.jsx(Mn,{className:"h-4 w-4 shrink-0"}),"View"]})}),n.jsx(Cr,{side:"bottom",className:"max-w-xs text-left",children:"Relay URL and QR are hidden while streamer mode is on."})]}):null,n.jsx(G,{type:"button",variant:Ge?"outline":"default",disabled:ot!==null,onClick:()=>{Ha(!Ge)},children:ot==="enable"?"Enabling…":ot==="disable"?"Disabling…":Ge?"Disable relay":"Enable relay"})]})]}),(y==null?void 0:y.status)==="manually_disabled"?n.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:"Relay is manually disabled. Kaizen will not keep a tunnel open, will not poll for wake requests, and will ignore wake requests until you re-enable it here."}):null,(y==null?void 0:y.status)==="idle_disconnected"?n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:"Relay is idle-disconnected. The tunnel is down, but Kaizen is polling for wake requests every 15 seconds."}),n.jsx(G,{type:"button",variant:"outline",disabled:ot!==null||!er,onClick:()=>{Wa()},children:ot==="reconnect"?"Reconnecting…":"Reconnect now"})]}):null,y!=null&&y.publicUrl&&(!J||Zs)?n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:"Scan this from a phone to open the relay URL quickly."}),n.jsx(hl,{url:y.publicUrl}),n.jsx("div",{className:"break-all rounded-lg border border-border bg-muted/30 px-3 py-2 font-mono text-xs text-foreground",children:y.publicUrl})]}):null,zs||y!=null&&y.error?n.jsx("div",{className:"text-sm text-red-500",children:zs??(y==null?void 0:y.error)}):null,n.jsx(bl,{snapshot:y,redactMachineId:J})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-sm text-foreground",children:"Status: unauthorized"}),n.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2 text-sm text-muted-foreground",children:"Remote access is not enabled for this account. Refresh account state or ask an admin to review your relay access if you expected it to work."})]}):n.jsx("div",{className:"text-sm text-muted-foreground",children:ne?"Remote relay access is controlled by your Kaizen account state on the web app.":"Sign in from the account page to unlock remote relay."})})})]}):k==="general"?n.jsx(n.Fragment,{children:n.jsxs("div",{className:"border-b border-border",children:[n.jsx(T,{title:"Application Update",description:n.jsxs(n.Fragment,{children:[n.jsxs("span",{children:[za,"."]}),C!=null&&C.lastCheckedAt?n.jsxs("span",{children:[" ","Last checked"," ",new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(C.lastCheckedAt),"."]}):null,C!=null&&C.error?n.jsxs("span",{children:[" ",C.error]}):null]}),bordered:!1,children:n.jsxs("div",{className:"text-right text-sm text-foreground",children:[n.jsxs("div",{children:["Current:"," ",(C==null?void 0:C.currentVersion)??V]}),n.jsxs("div",{className:"text-xs text-muted-foreground",children:["Latest: ",(C==null?void 0:C.latestVersion)??"Unknown"]})]})}),n.jsx(T,{title:"Theme",description:"Choose between light, dark, system, or custom appearance",children:n.jsxs(L,{value:f,onValueChange:i=>{v(i),_e({themePreference:i})},children:[n.jsx($,{className:"w-[150px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"light",children:"Light"}),n.jsx(N,{value:"dark",children:"Dark"}),n.jsx(N,{value:"system",children:"System"}),n.jsx(N,{value:"custom",children:"Custom"})]})]})}),f==="custom"?n.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[n.jsx(T,{title:"Appearance",description:"Choose light, dark, or system mode for your custom theme",bordered:!1,children:n.jsxs(L,{value:Ns,onValueChange:i=>{ja(i),_e({customAppearance:i})},children:[n.jsx($,{className:"w-[150px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"light",children:"Light"}),n.jsx(N,{value:"dark",children:"Dark"}),n.jsx(N,{value:"system",children:"System"})]})]})}),n.jsx(T,{title:"Color Theme",description:`Choose a color palette for the interface. Custom JSON themes live in ${(se==null?void 0:se.themesDirectoryDisplay)??"~/.kaizen/themes"}. Read ${(se==null?void 0:se.themesReadmeFileDisplay)??"~/.kaizen/themes/THEME_README.md"} for authoring guidance.`,alignStart:!0,bordered:!1,children:n.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs(L,{value:ws,onValueChange:i=>{ka(i),_e({themeId:i})},children:[n.jsx($,{className:"min-w-[180px]",children:n.jsx(F,{})}),n.jsx(U,{children:n.jsx(as,{children:_a.map(i=>n.jsx(N,{value:i.id,children:i.label},i.id))})})]}),n.jsx(Ae,{variant:"outline","aria-label":"Refresh themes",title:"Refresh themes",className:"px-2.5",disabled:He!==null,onClick:()=>{ss("refresh",()=>c.handleRefreshThemeSettings())},icon:He==="refresh"||Da?n.jsx(oe,{className:"size-3.5 animate-spin"}):n.jsx(Cn,{className:"size-3.5"})})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs(Ae,{disabled:He!==null,onClick:()=>{ss("open_editor",()=>c.handleOpenCustomThemes())},icon:He==="open_editor"||La?n.jsx(oe,{className:"size-3.5 animate-spin"}):n.jsx(Wr,{className:"size-3.5"}),children:["Open in ",c.editorLabel]}),n.jsx(Ae,{variant:"outline",disabled:He!==null,onClick:()=>{ss("open_folder",()=>c.handleOpenExternalPath("open_finder",(se==null?void 0:se.themesDirectoryDisplay)??"~/.kaizen/themes"))},icon:He==="open_folder"||$a?n.jsx(oe,{className:"size-3.5 animate-spin"}):n.jsx(cs,{className:"size-3.5"}),children:"Open folder"})]}),se!=null&&se.customThemeWarnings.length?n.jsx("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/5 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:se.customThemeWarnings.join(" ")}):null]})}),n.jsx(T,{title:"Background Image",description:"Choose a background or enter a custom URL",alignStart:!0,bordered:!1,children:(()=>{const i=Ws.find(q=>q.url===$e),p=!$e,I=!!$e&&!i,le=p?"__none__":I?"__custom__":$e,me=p?"None":I?"Custom URL":(i==null?void 0:i.name)??"Unknown";return n.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-2 sm:max-w-[320px]",children:[n.jsxs(L,{value:le,onValueChange:q=>{if(q==="__none__")jt(""),Bt(null),_e({backgroundImage:null});else{const Be=ta({themePreference:f,nextBackgroundImage:q,backgroundOpacity:De});jt(q),Bt(q),Be.backgroundOpacity!==void 0&&zt(Be.backgroundOpacity),Be.backgroundBlur!==void 0&&Zt(Be.backgroundBlur),_e({backgroundImage:q,...Be})}},children:[n.jsx($,{className:"w-full",children:n.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[p?null:n.jsx("img",{src:rs(qe??null)??void 0,alt:"",className:"h-5 w-9 shrink-0 rounded object-cover"}),n.jsx("span",{className:"truncate",children:me})]})}),n.jsxs(U,{children:[n.jsx(is,{value:"__none__",children:"None"}),Ws.map(q=>n.jsx(is,{value:q.url,thumbnail:rs(q.url)??q.url,thumbnailAlt:q.name,children:q.name},q.id)),I?n.jsx(is,{value:"__custom__",thumbnail:rs(qe??null)??void 0,thumbnailAlt:"Custom",children:"Custom URL"}):null]})]}),n.jsx(ke,{type:"text",placeholder:"Or enter a custom URL...",value:$e,onChange:q=>jt(q.target.value),onBlur:un,onKeyDown:q=>hn(q,un),className:"w-full"})]})})()}),n.jsx(T,{title:"Background Opacity",description:"Opacity of the interface layered over the background (0 to 1)",bordered:!1,children:n.jsx("div",{className:"flex min-w-0 flex-col items-end gap-2",children:n.jsx(ke,{type:"number",min:0,max:1,step:.05,value:Ms,onChange:i=>Ht(i.target.value),onBlur:mn,onKeyDown:i=>It(i,mn),className:"hide-number-steppers w-28 text-right font-mono"})})}),n.jsx(T,{title:"Background Blur",description:"Blur applied to the background image (in pixels)",bordered:!1,children:n.jsx("div",{className:"flex min-w-0 flex-col items-end gap-2",children:n.jsx(ke,{type:"number",min:0,max:50,step:1,value:Ds,onChange:i=>Wt(i.target.value),onBlur:fn,onKeyDown:i=>It(i,fn),className:"hide-number-steppers w-28 text-right font-mono"})})})]}):null,Ua?n.jsxs(n.Fragment,{children:[n.jsx(T,{title:"Browser Notifications",badge:Z.features.browserNotifications.enabled?null:n.jsx(Qe,{level:"paid"}),description:"Show desktop or PWA notifications when a background chat needs input or completes.",children:n.jsxs(L,{value:es?"enabled":"disabled",onValueChange:i=>{if(i==="enabled"){if(!Z.features.browserNotifications.enabled)return;ts==="granted"?_t(!0):pn();return}_t(!1)},disabled:!Z.features.browserNotifications.enabled,children:[n.jsx($,{className:"w-[100px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"disabled",children:"Off"}),n.jsx(N,{value:"enabled",children:"On"})]})]})}),Z.features.browserNotifications.enabled?n.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[n.jsx(T,{title:"Permission",description:"Permission is only requested when you explicitly enable notifications from here.",bordered:!1,alignStart:!0,children:n.jsxs("div",{className:"flex w-full flex-col items-end gap-2 text-right sm:w-auto",children:[n.jsxs("div",{className:"flex items-center justify-end gap-2 text-sm text-foreground",children:[n.jsx($r,{className:"size-4 text-muted-foreground"}),n.jsx("span",{children:Va})]}),n.jsx("div",{className:"flex w-full flex-wrap justify-end gap-2 sm:w-auto",children:n.jsxs(G,{type:"button",variant:"outline",disabled:!ln||Tt!==null,onClick:()=>{pn()},children:[Tt==="requesting"?n.jsx(oe,{className:"mr-2 size-4 animate-spin"}):null,"Enable notifications"]})})]})}),n.jsx(T,{title:"Notification Sound",description:"Play a local alert cue for background chat notifications.",bordered:!1,children:n.jsxs(L,{value:Rs?"enabled":"disabled",onValueChange:i=>{Ca(i==="enabled")},children:[n.jsx($,{className:"ml-auto w-[100px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"disabled",children:"Off"}),n.jsx(N,{value:"enabled",children:"On"})]})]})}),Ba?n.jsx(T,{title:"Vibration",description:"Use device vibration when supported by the browser.",bordered:!1,children:n.jsxs(L,{value:Ts?"enabled":"disabled",onValueChange:i=>{Ra(i==="enabled")},children:[n.jsx($,{className:"ml-auto w-[100px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"disabled",children:"Off"}),n.jsx(N,{value:"enabled",children:"On"})]})]})}):null,n.jsx(T,{title:"Test Notification",description:"Send a local test notification using your current notification settings.",bordered:!1,children:n.jsx("div",{className:"flex flex-wrap justify-end gap-2",children:n.jsxs(G,{type:"button",variant:"outline",disabled:Tt!==null,onClick:()=>{Fa()},children:[Tt==="testing"?n.jsx(oe,{className:"mr-2 size-4 animate-spin"}):null,"Test notification"]})})})]}):null]}):null,n.jsx(T,{title:"Project Icons",description:"Show detected project icons in the sidebar and open-project list.",children:n.jsxs(L,{value:Cs?"enabled":"disabled",onValueChange:i=>{const p=i==="enabled";wa(p),_e({showProjectIconsInSidebar:p})},children:[n.jsx($,{className:"w-[100px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"disabled",children:"Off"}),n.jsx(N,{value:"enabled",children:"On"})]})]})}),n.jsx(T,{title:"Folder Groups",description:"Show or hide feature folder grouping in the sidebar. Turning this off keeps the existing feature state, but flattens chats into a direct list and hides the new-folder button.",children:n.jsxs(L,{value:js?"enabled":"disabled",onValueChange:i=>xa(i==="enabled"),children:[n.jsx($,{className:"w-[100px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"disabled",children:"Off"}),n.jsx(N,{value:"enabled",children:"On"})]})]})}),js?n.jsxs("div",{className:"mb-2 ml-6 space-y-0 border-l border-border/60 pl-4",children:[n.jsx(T,{title:"Feature Overview",description:"Generate and show an `overview.md` file for feature folders. Turning this off stops creating new overview files and hides existing overview rows from the sidebar.",bordered:!1,children:n.jsxs(L,{value:ha?"enabled":"disabled",onValueChange:i=>va(i==="enabled"),children:[n.jsx($,{className:"w-[100px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"disabled",children:"Off"}),n.jsx(N,{value:"enabled",children:"On"})]})]})}),n.jsx(T,{title:"Kanban Status",description:"Show or hide feature status controls like Idea, Todo, Progress, Testing, and Done.",bordered:!1,children:n.jsxs(L,{value:ga?"enabled":"disabled",onValueChange:i=>ba(i==="enabled"),children:[n.jsx($,{className:"w-[100px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"disabled",children:"Off"}),n.jsx(N,{value:"enabled",children:"On"})]})]})}),n.jsx(T,{title:`${ls} In Git`,description:`Control whether ${Nn} keeps the project ${ls} directory tracked in git or adds it to .gitignore for currently loaded projects and future opens. This is best suited to solo developers working across multiple machines. For team repos, we recommend ignoring \`${ls}\`.`,bordered:!1,children:n.jsxs(L,{value:pa?"commit":"ignore",onValueChange:i=>{const p=i==="commit";ya(p),c.handleSetCommitProjectMetadataDirectory(p)},children:[n.jsx($,{className:"w-[120px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"commit",children:"Commit"}),n.jsx(N,{value:"ignore",children:"Ignore"})]})]})})]}):null,n.jsx(T,{title:"Provider Icons In Side Tray",description:"Show provider badges next to chats in the left sidebar side tray.",children:n.jsxs(L,{value:yt?"enabled":"disabled",onValueChange:i=>fa(i==="enabled"),children:[n.jsx($,{className:"w-[100px]",children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"disabled",children:"Off"}),n.jsx(N,{value:"enabled",children:"On"})]})]})}),n.jsx(T,{title:"Default Editor",description:"Used by the navbar code button and local file links in chat",alignStart:!0,children:n.jsxs(L,{value:z,onValueChange:i=>M(i),children:[n.jsx($,{className:"min-w-[180px]",children:n.jsx(F,{})}),n.jsx(U,{children:n.jsx(as,{children:ol.map(i=>n.jsx(N,{value:i.value,children:i.label},i.value))})})]})}),z==="custom"?n.jsx("div",{className:"border-t border-border",children:n.jsxs("div",{className:"flex justify-between gap-8 py-5 pl-6",children:[n.jsxs("div",{className:"min-w-0 max-w-xl",children:[n.jsx("div",{className:"text-sm font-medium text-foreground",children:"Command Template"}),n.jsxs("div",{className:"mt-1 text-[13px] text-muted-foreground",children:["Include ","{path}"," and optionally ","{line}"," and"," ","{column}"," in your command."]})]}),n.jsxs("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:[n.jsx(ke,{type:"text",value:qt,onChange:i=>Ss(i.target.value),onBlur:gn,onKeyDown:i=>hn(i,gn),className:"font-mono"}),n.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preview:"," ",n.jsx("span",{className:"font-mono",children:Ga})]})]})]})}):null,n.jsx(T,{title:"Terminal Scrollback",description:"Lines retained for embedded terminal history",children:n.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[n.jsx(ke,{type:"number",min:En,max:Tn,step:100,value:Ps,onChange:i=>Ft(i.target.value),onBlur:dn,onKeyDown:i=>It(i,dn),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),n.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[En,"-",Tn," ","lines",B===Tr?" (default)":""]})]})}),n.jsx(T,{title:"Terminal Min Column Width",description:"Minimum width for each terminal pane",children:n.jsxs("div",{className:"flex w-full min-w-0 flex-col items-stretch gap-2 md:w-auto md:items-end",children:[n.jsx(ke,{type:"number",min:In,max:An,step:10,value:Os,onChange:i=>Kt(i.target.value),onBlur:cn,onKeyDown:i=>It(i,cn),className:"hide-number-steppers w-full text-left font-mono md:w-28 md:text-right"}),n.jsxs("div",{className:"text-left text-xs text-muted-foreground md:text-right",children:[In,"-",An," px",S===Er?" (default)":""]})]})})]})}):k==="changelog"?n.jsx($i,{entries:Li}):k==="quick-chats"?n.jsx(Zi,{}):k==="slash-commands"?n.jsx(Ji,{}):k==="providers"?n.jsxs("div",{className:"border-b border-border",children:[n.jsx(T,{title:"Default Provider",badge:tr?n.jsx(Qe,{level:"account"}):null,description:"The default harness used for new chats before a provider is locked by an existing session.",bordered:!1,children:n.jsxs(L,{value:Ia,onValueChange:i=>Ke(i),children:[n.jsx($,{className:"min-w-[180px]",children:n.jsx(F,{})}),n.jsx(U,{children:n.jsxs(as,{children:[n.jsx(N,{value:"last_used",children:"Last Used"}),Ya.map(i=>n.jsx(N,{value:i.id,disabled:i.id==="openrouter"&&!Z.features.openrouter.enabled,children:i.label},i.id))]})})]})}),Bs?n.jsx("div",{className:"border-t border-border px-0 py-3 text-sm text-destructive",children:Bs}):null,n.jsx(T,{title:"Claude Code Defaults",description:`Saved defaults when using Claude Code. ${ft(X,g,"claude")}`,alignStart:!0,children:n.jsxs("div",{className:xe("max-w-[420px]",!Q("claude").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(L,{value:((g==null?void 0:g.settings.claude)??W.claude).active?"active":"inactive",onValueChange:i=>{ct({...(g==null?void 0:g.settings)??W,claude:{...(g==null?void 0:g.settings.claude)??W.claude,active:i==="active"}})},children:[n.jsx($,{className:"min-w-[140px]",disabled:!Q("claude").systemActive,children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"active",children:"Active"}),n.jsx(N,{value:"inactive",children:"Inactive"})]})]})}),n.jsx(mt,{availableProviders:X,selectedProvider:"claude",disabled:!Q("claude").systemActive,showProviderPicker:!1,providerLocked:!0,model:O.claude.model,modelOptions:O.claude.modelOptions,onModelChange:(i,p)=>{st("claude",p)},onClaudeReasoningEffortChange:i=>{nt("claude",{reasoningEffort:i})},onClaudeContextWindowChange:i=>{nt("claude",{contextWindow:i})},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:O.claude.planMode,onPlanModeChange:i=>at("claude",i),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),n.jsx(T,{title:"Codex Defaults",description:`Saved defaults when using Codex. ${ft(X,g,"codex")}`,alignStart:!0,children:n.jsxs("div",{className:xe("max-w-[420px]",!Q("codex").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(L,{value:((g==null?void 0:g.settings.codex)??W.codex).active?"active":"inactive",onValueChange:i=>{ct({...(g==null?void 0:g.settings)??W,codex:{...(g==null?void 0:g.settings.codex)??W.codex,active:i==="active"}})},children:[n.jsx($,{className:"min-w-[140px]",disabled:!Q("codex").systemActive,children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"active",children:"Active"}),n.jsx(N,{value:"inactive",children:"Inactive"})]})]})}),n.jsx(mt,{availableProviders:X,selectedProvider:"codex",disabled:!Q("codex").systemActive,showProviderPicker:!1,providerLocked:!0,model:O.codex.model,modelOptions:O.codex.modelOptions,onModelChange:(i,p)=>{st("codex",p)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:i=>{nt("codex",{reasoningEffort:i})},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:i=>{nt("codex",{fastMode:i})},planMode:O.codex.planMode,onPlanModeChange:i=>at("codex",i),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),n.jsx(T,{title:"Gemini Defaults",description:`Saved defaults when using Gemini. ${ft(X,g,"gemini")}`,alignStart:!0,children:n.jsxs("div",{className:xe("max-w-[420px]",!Q("gemini").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(L,{value:((g==null?void 0:g.settings.gemini)??W.gemini).active?"active":"inactive",onValueChange:i=>{ct({...(g==null?void 0:g.settings)??W,gemini:{...(g==null?void 0:g.settings.gemini)??W.gemini,active:i==="active"}})},children:[n.jsx($,{className:"min-w-[140px]",disabled:!Q("gemini").systemActive,children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"active",children:"Active"}),n.jsx(N,{value:"inactive",children:"Inactive"})]})]})}),n.jsx(mt,{availableProviders:X,selectedProvider:"gemini",disabled:!Q("gemini").systemActive,showProviderPicker:!1,providerLocked:!0,model:O.gemini.model,modelOptions:O.gemini.modelOptions,onModelChange:(i,p)=>{st("gemini",p)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:i=>{nt("gemini",{thinkingMode:i})},onCodexFastModeChange:()=>{},planMode:O.gemini.planMode,onPlanModeChange:i=>at("gemini",i),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),n.jsx(T,{title:"Cursor Defaults",description:`Saved defaults when using Cursor. ${ft(X,g,"cursor")}`,alignStart:!0,children:n.jsxs("div",{className:xe("max-w-[420px]",!Q("cursor").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(L,{value:((g==null?void 0:g.settings.cursor)??W.cursor).active?"active":"inactive",onValueChange:i=>{ct({...(g==null?void 0:g.settings)??W,cursor:{...(g==null?void 0:g.settings.cursor)??W.cursor,active:i==="active"}})},children:[n.jsx($,{className:"min-w-[140px]",disabled:!Q("cursor").systemActive,children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"active",children:"Active"}),n.jsx(N,{value:"inactive",children:"Inactive"})]})]})}),n.jsx(mt,{availableProviders:X,selectedProvider:"cursor",disabled:!Q("cursor").systemActive,showProviderPicker:!1,providerLocked:!0,model:O.cursor.model,modelOptions:O.cursor.modelOptions,onModelChange:(i,p)=>{st("cursor",p)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:O.cursor.planMode,onPlanModeChange:i=>at("cursor",i),includePlanMode:!0,className:"justify-start flex-wrap"})]})}),n.jsx(T,{title:"OpenRouter Defaults",badge:Z.features.openrouter.enabled?null:n.jsx(Qe,{level:"account"}),description:`Saved defaults when using OpenRouter via openCode. ${ft(X,g,"openrouter")}`,alignStart:!0,children:n.jsxs("div",{className:xe("max-w-[420px]",!Q("openrouter").systemActive&&"opacity-50"),children:[n.jsx("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:n.jsxs(L,{value:((g==null?void 0:g.settings.openrouter)??W.openrouter).active?"active":"inactive",onValueChange:i=>{ct({...(g==null?void 0:g.settings)??W,openrouter:{...(g==null?void 0:g.settings.openrouter)??W.openrouter,active:i==="active"}})},children:[n.jsx($,{className:"min-w-[140px]",disabled:!Q("openrouter").systemActive||!Z.features.openrouter.enabled,children:n.jsx(F,{})}),n.jsxs(U,{children:[n.jsx(N,{value:"active",children:"Active"}),n.jsx(N,{value:"inactive",children:"Inactive"})]})]})}),n.jsx(mt,{availableProviders:X,selectedProvider:"openrouter",disabled:!Q("openrouter").systemActive||!Z.features.openrouter.enabled,showProviderPicker:!1,providerLocked:!0,model:O.openrouter.model,modelOptions:O.openrouter.modelOptions,onModelChange:(i,p)=>{st("openrouter",p)},onClaudeReasoningEffortChange:()=>{},onClaudeContextWindowChange:()=>{},onCodexReasoningEffortChange:()=>{},onGeminiThinkingModeChange:()=>{},onCodexFastModeChange:()=>{},planMode:O.openrouter.planMode,onPlanModeChange:i=>at("openrouter",i),includePlanMode:!0,className:"justify-start flex-wrap"})]})})]}):k==="keybindings"?n.jsxs("div",{className:"border-b border-border",children:[$s?n.jsx("div",{className:"mb-4 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:$s}):null,Le.warning?n.jsx("div",{className:"mb-4 rounded-2xl border border-border bg-card/30 px-4 py-3 text-sm text-muted-foreground",children:Le.warning}):null,Vt.map((i,p)=>{const I=us(Sn[i]),le=Ue[i]??"",me=le!==I;return n.jsx(T,{title:ms[i],description:n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"Comma-separated shortcuts."}),me?n.jsxs(n.Fragment,{children:[n.jsx("span",{children:" "}),n.jsxs("button",{type:"button",onClick:()=>{Ka(i)},className:"inline rounded text-foreground hover:text-foreground/80",children:["Restore: ",I]})]}):null]}),bordered:p!==0,children:n.jsx("div",{className:"flex min-w-0 max-w-[420px] flex-1 flex-col items-stretch gap-2",children:n.jsx(ke,{type:"text",value:le,"aria-label":ms[i],onChange:q=>{const Be=q.target.value;it(ir=>({...ir,[i]:Be}))},className:"font-mono"})})},i)})]}):null]}),c.commandError?n.jsxs("div",{className:"mx-auto mt-4 flex max-w-4xl items-start gap-3 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:[n.jsx(Fr,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),n.jsx("span",{children:c.commandError})]}):null]})]})]}),vn?n.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-t border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:n.jsx("div",{className:"px-6 py-[14.25px]",children:n.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-xs text-muted-foreground lg:grid-cols-4 lg:gap-3",children:[n.jsx("div",{className:"min-w-0",children:n.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[n.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Machine"}),n.jsx("div",{className:"truncate text-foreground/80",children:J?"Hidden":D})]})}),n.jsx("div",{className:"min-w-0",children:n.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[n.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Connection"}),n.jsx("div",{className:"truncate text-foreground/80",children:c.connectionStatus})]})}),n.jsx("div",{className:"min-w-0",children:n.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[n.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Projects"}),n.jsx("div",{className:"truncate text-foreground/80",children:K})]})}),n.jsx("div",{className:"min-w-0",children:n.jsxs("div",{className:"flex items-baseline gap-1.5 lg:block",children:[n.jsx("div",{className:"uppercase tracking-wide text-[11px] text-muted-foreground/80 lg:mb-1",children:"Version"}),n.jsx("div",{className:"truncate text-foreground/80",children:V})]})})]})})}):null]})}function _l(t){return{submitChatMessage:Ee(t.submitChatMessage??""),toggleQuickPrompts:Ee(t.toggleQuickPrompts??""),toggleProjectsSidebar:Ee(t.toggleProjectsSidebar??""),toggleEmbeddedTerminal:Ee(t.toggleEmbeddedTerminal??""),toggleRightSidebar:Ee(t.toggleRightSidebar??""),openInFinder:Ee(t.openInFinder??""),openInEditor:Ee(t.openInEditor??""),addSplitTerminal:Ee(t.addSplitTerminal??"")}}export{Nl as SettingsPage,_l as buildKeybindingPayload,Ot as createKeybindingDrafts,ta as getBackgroundSelectionAdjustments,ml as getGeneralHeaderAction,dl as getKeybindingsSubtitle,fl as getSettingsCloseTarget,Ut as keybindingDraftsEqual,cl as mergeSavedKeybindingDrafts,ul as reconcileLoadedKeybindingDrafts,ea as resolveSettingsSectionId};
@@ -0,0 +1,11 @@
1
+ import{c as e}from"./index-SgSBQKg3.js";/**
2
+ * @license lucide-react v0.562.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const a=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],n=e("external-link",a);/**
7
+ * @license lucide-react v0.562.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const c=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],o=e("eye",c);export{n as E,o as a};