@inkeep/open-knowledge 0.37.2 → 0.37.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-ClDt6gNK.mjs → acp-harness-probe-N1sSMZGg.mjs} +2 -2
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +7 -7
- package/dist/constants-CchUdUMd.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/init-AZMgQ3nS.mjs +1 -0
- package/dist/{init-BNYoh7KV.mjs → init-CBfUP8hN.mjs} +3 -3
- package/dist/{launch-json-removal-CtOdn-GL.mjs → launch-json-removal-RCdxWSel.mjs} +2 -2
- package/dist/{loader-krAY0cUj.mjs → loader-DcESlMxI.mjs} +2 -2
- package/dist/loader-EZiQC7cG.mjs +1 -0
- package/dist/{open-browser-B_uMbUW5.mjs → open-browser-DGOoelb3.mjs} +2 -2
- package/dist/{preview-D68n7-B_.mjs → preview-Bt-_RLQB.mjs} +2 -2
- package/dist/preview-DGyDBzMH.mjs +1 -0
- package/dist/public/assets/SettingsDialogBody-DVTTk_BU.js +7 -0
- package/dist/public/assets/{index-CSsXSr5h.js → index-1TeKfA3W.js} +2 -2
- package/dist/public/assets/index-CJ_7DqKn.css +1 -0
- package/dist/public/index.html +2 -2
- package/dist/{repair-launch-json-CPspoDoE.mjs → repair-launch-json-zFpMB98b.mjs} +2 -2
- package/dist/{repair-mcp-configs-B7h34RyI.mjs → repair-mcp-configs-BooTRwN8.mjs} +2 -2
- package/dist/repair-skills-DXhO-R2J.mjs +1 -0
- package/dist/{repair-skills-D1jVj8Pl.mjs → repair-skills-M9d8MZVm.mjs} +2 -2
- package/dist/{src-C3dnLRq0.mjs → src-CDixjEaS.mjs} +315 -315
- package/dist/{src-CCYJZLwU.mjs → src-CL0d0X9t.mjs} +1 -1
- package/dist/{src-C_CS0zOu.mjs → src-DRGXfsmB.mjs} +2 -2
- package/dist/{start-CRVuj6qE.mjs → start-CJDgfxsl.mjs} +2 -2
- package/dist/start-DWQUoMMz.mjs +1 -0
- package/dist/{write-project-skill-BPhp1SGM.mjs → write-project-skill-B7oIs3rt.mjs} +2 -2
- package/package.json +4 -4
- package/dist/constants-zp3SYKm9.mjs +0 -2
- package/dist/init-DrifsVXP.mjs +0 -1
- package/dist/loader-CCTHhh7w.mjs +0 -1
- package/dist/preview-BxYtUpm_.mjs +0 -1
- package/dist/public/assets/SettingsDialogBody-Olkuc1ix.js +0 -7
- package/dist/public/assets/index-DS4HqlZl.css +0 -1
- package/dist/repair-skills-DMbkWuC1.mjs +0 -1
- package/dist/start-Cz9TSEAH.mjs +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{i as e,t}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{C as r,E as i,S as a,T as o,en as s,j as c,st as l,w as u,x as d}from"./DocumentContext-Dog3N-Wc.js";import{t as f}from"./react-JNybMug3.js";import{n as p,r as m}from"./dist-DBENJeML.js";import{t as h}from"./useQuery-NsPxD6kI.js";import{n as g}from"./dist-COAuqNbv.js";import{t as _}from"./compiler-runtime-dQcBxOhn.js";import{a as v,c as y,l as b,s as x}from"./terminal-input-events-CEX9z-EZ.js";import{i as S,n as C,t as w,u as T}from"./createLucideIcon-B5DNg1uu.js";import{i as E,n as D,t as O}from"./tooltip-zRf24xaK.js";import{n as k,r as A,t as j}from"./collapsible-LTmyJCqZ.js";import{a as M,c as N,i as P,n as F,o as I,r as L,s as R,t as z}from"./dialog-DRODJICP.js";import{t as B}from"./checkbox-DQTC9kSm.js";import{m as V,r as H,t as U}from"./dropdown-menu-DRE6Cf6z.js";import{t as W}from"./label-JTxG9Ey8.js";import{a as ee,i as G,n as K,r as te,t as ne}from"./radio-group-DGMMq4Dp.js";import{A as re,C as ie,G as q,H as ae,K as J,Q as oe,R as Y,S as se,T as ce,U as le,V as ue,W as de,X as fe,_ as pe,at as me,b as he,c as ge,ct as _e,d as ve,f as ye,g as be,h as xe,i as Se,j as Ce,k as we,l as Te,m as Ee,n as De,nt as Oe,o as ke,p as Ae,q as je,st as Me,u as Ne,ut as Pe,w as Fe,x as Ie,y as Le,z as Re}from"./auth-state-cache-CEBkZrQO.js";import{n as ze,t as Be}from"./toggle-group-yZ3ty6OO.js";import{O as Ve,T as He,a as Ue,b as We,c as Ge,d as Ke,f as qe,h as Je,l as Ye,n as Xe,o as Ze,r as Qe,s as $e,t as et,u as tt,w as nt,y as rt}from"./agent-visibility-D2Mr5Jzk.js";import{i as it}from"./terminal-telemetry-B-c91nRO.js";import{Ca as at,Da as ot,Ea as st,F as ct,Lt as lt,P as ut,Pt as dt,Rt as ft,Sa as pt,_a as mt,b as ht,ba as gt,ca as _t,ft as vt,gt as yt,ma as bt,qr as xt,ua as St,v as Ct,xa as wt,ya as Tt}from"./dist-zc03OoUp.js";import{a as Et,c as Dt,i as Ot,r as kt,t as At}from"./EnableSyncConfirmDialog-DtYm7V_O.js";import{t as jt}from"./arrow-up-right-DUrnAxeE.js";import{t as Mt}from"./RegisteredAgentIcon-DlQ6ljJ9.js";import{t as Nt}from"./check-CnRZzbNh.js";import{t as Pt}from"./chevron-right-BzFyqeC2.js";import{i as Ft}from"./prop-types-CBBOToAL.js";import{C as It,S as Lt,b as Rt,c as zt,h as Bt,i as Vt,l as Ht,r as Ut,t as Wt,v as Gt,y as Kt}from"./skill-actions-DzaHqGRg.js";import{i as qt,l as Jt,r as Yt,s as Xt}from"./workspace-paths-d9KyFHx6.js";import{c as Zt,n as Qt,t as $t}from"./open-managed-artifact-tab-CRLFq4-B.js";import{t as en}from"./info-jz24-qK8.js";import{t as tn}from"./loader-circle-DZ77ilW4.js";import{t as nn}from"./sliders-horizontal-D06S3vlK.js";import{t as rn}from"./triangle-alert-COtjZrcH.js";import{t as an}from"./x-C4-oii3_.js";import{n as X}from"./dist-pkKXEO3Q.js";import{t as on}from"./input-CKzGvkzv.js";import{a as sn,n as cn,r as ln,s as un,t as dn}from"./keyboard-shortcuts-g08DUgcY.js";import{t as fn}from"./parse-api-error-QYXuYti5.js";import{r as pn}from"./documents-events-BTDcCELc.js";import{t as mn}from"./badge-B-uIQQXR.js";import"./config-provider-pXCSDe7I.js";import{a as hn,c as gn,i as _n,n as vn,o as yn,s as bn}from"./use-apply-config-color-theme-CTTOdBYC.js";import{n as xn,r as Sn}from"./config-context-DOXKMLrN.js";import{t as Cn}from"./external-link-CbUrsN1c.js";import{t as wn}from"./use-workspace-CqL9iZdQ.js";import{t as Tn}from"./skeleton-CeeznyYx.js";import{a as En,d as Dn,f as On,i as kn,l as An,m as jn,o as Mn,p as Nn,s as Pn,t as Fn,u as In}from"./sortable.esm-BxXYH0I3.js";import{t as Ln}from"./textarea-C0WUaoe-.js";import{n as Rn,t as zn}from"./use-terminal-enabled-WZKABQLf.js";var Bn=w(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=_(),Q=e(f(),1),$=n(),Vn=`settings-sharing-title`;function Hn(){let e=(0,Z.c)(1),t=(typeof window<`u`?window.okDesktop:void 0)?.sharing,n;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=t===void 0?(0,$.jsx)(Un,{}):(0,$.jsx)(Wn,{}),e[0]=n):n=e[0],n}function Un(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:Vn,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`cs4mps`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`section`,{"aria-labelledby":Vn,className:`space-y-3`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[t,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`7YRrJ9`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{}),2:(0,$.jsx)(`code`,{})}})})]})}),e[1]=n):n=e[1],n}function Wn(){let e=(0,Z.c)(39),{_:t}=m(),[n,r]=(0,Q.useState)(null),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(null),c;e[0]===t?c=e[1]:(c=async function(){let e=window.okDesktop?.sharing;if(e)try{r(await e.status())}catch(e){let n=e;X.error(n instanceof Error?n.message:t({id:`K0N7zS`})),r(Kn)}},e[0]=t,e[1]=c);let l=c,u;e[2]===l?u=e[3]:(u=()=>{l()},e[2]=l,e[3]=u);let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],e[4]=d):d=e[4],(0,Q.useEffect)(u,d);let f;e[5]!==t||e[6]!==i||e[7]!==l||e[8]!==n?(f=async function(e){let r=window.okDesktop?.sharing;if(!r||n===null||i||n.mode===e)return;a(!0),s(null);let o=null,c=null;try{o=await r.setMode(e)}catch(e){c=e}if(a(!1),c!==null){X.error(c instanceof Error?c.message:t({id:`qZv5ZR`}));return}o!==null&&(o.kind===`refused-tracked`?(s({tracked:o.tracked,remediation:o.remediation}),X.error(t({id:`z2JdQ-`}),{duration:5e3})):o.kind===`no-exclude`?X.warning(o.reason===`no-git`?t({id:`YSFv5w`}):t({id:`8cS0nH`,values:{0:o.reason}})):X.success(t(e===`local-only`?{id:`VvS_k_`}:{id:`k_pade`})),await l())},e[5]=t,e[6]=i,e[7]=l,e[8]=n,e[9]=f):f=e[9];let h=f,g;e[10]!==t||e[11]!==i||e[12]!==l||e[13]!==n?(g=async function(){let e=window.okDesktop?.sharing;if(!e||n===null||i)return;a(!0);let r=null,o=null;try{r=await e.setSkillsShared(!1)}catch(e){o=e}if(a(!1),o!==null){X.error(o instanceof Error?o.message:t({id:`onTlRk`}));return}if(r!==null){if(r.kind===`no-exclude`){let e=r.reason===`no-git`?t({id:`Xwump4`}):r.reason===`inaccessible`?t({id:`PlGC6r`}):t({id:`zcmYx4`});X.warning(t({id:`4h3e0H`,values:{detail:e}}));return}X.success(t({id:`pQf2Ux`})),await l()}},e[10]=t,e[11]=i,e[12]=l,e[13]=n,e[14]=g):g=e[14];let _=g;if(n===null){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":Vn,className:`space-y-3`,children:[(0,$.jsx)(`h3`,{id:Vn,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`cs4mps`})}),(0,$.jsx)(Tn,{className:`h-24`})]}),e[15]=t):t=e[15],t}let v=n.mode===`no-git`,y;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`h3`,{id:Vn,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`cs4mps`})}),(0,$.jsx)(te,{})]}),e[16]=y):y=e[16];let b;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[y,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`N55YNr`})})]}),e[17]=b):b=e[17];let x;e[18]!==i||e[19]!==v||e[20]!==h||e[21]!==n.mode?(x=v?(0,$.jsx)(`p`,{className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,role:`status`,"data-testid":`settings-sharing-no-git`,children:(0,$.jsx)(p,{id:`ju38ms`})}):(0,$.jsxs)(ne,{value:n.mode,onValueChange:e=>void h(e),disabled:i,className:`gap-2`,"aria-labelledby":Vn,"data-testid":`settings-sharing-radiogroup`,children:[(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-shared`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(K,{id:`settings-sharing-shared`,value:`shared`,"data-testid":`settings-sharing-shared`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(p,{id:`0Gd0NU`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`dJw2_7`})})]})]}),(0,$.jsxs)(`label`,{htmlFor:`settings-sharing-local-only`,className:`flex items-start gap-2 text-sm`,children:[(0,$.jsx)(K,{id:`settings-sharing-local-only`,value:`local-only`,"data-testid":`settings-sharing-local-only`,className:`mt-1`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(p,{id:`OgyJSr`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`cZ_8zB`})})]})]})]}),e[18]=i,e[19]=v,e[20]=h,e[21]=n.mode,e[22]=x):x=e[22];let S;e[23]!==i||e[24]!==_||e[25]!==n.mode||e[26]!==n.skillsShared?(S=n.mode===`local-only`&&n.skillsShared?(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-skills-exception`,children:[(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`span`,{className:`font-medium`,children:(0,$.jsx)(p,{id:`Kiytqd`})}),(0,$.jsx)(`span`,{className:`block text-1sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`K0FgsP`})})]}),(0,$.jsx)(C,{variant:`outline`,size:`sm`,disabled:i,onClick:()=>void _(),children:(0,$.jsx)(p,{id:`9uI_rE`})})]}):null,e[23]=i,e[24]=_,e[25]=n.mode,e[26]=n.skillsShared,e[27]=S):S=e[27];let w;e[28]===o?w=e[29]:(w=o===null?null:(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm`,role:`alert`,"data-testid":`settings-sharing-refusal`,children:[(0,$.jsx)(`p`,{className:`font-semibold`,children:(0,$.jsx)(p,{id:`Kgdbkt`})}),(0,$.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs leading-relaxed`,children:o.remediation}),(0,$.jsx)(C,{variant:`outline`,size:`sm`,onClick:()=>s(null),children:(0,$.jsx)(p,{id:`1QfxQT`})})]}),e[28]=o,e[29]=w);let T;e[30]!==o||e[31]!==n.mode||e[32]!==n.trackedUpstream?(T=n.trackedUpstream.length>0&&n.mode!==`no-git`&&o===null?(0,$.jsxs)(`div`,{className:`space-y-1 rounded-md border border-muted-foreground/30 bg-muted/40 p-3 text-sm`,"data-testid":`settings-sharing-tracked-info`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:(0,$.jsx)(p,{id:`LhWYpm`})}),(0,$.jsx)(`ul`,{className:`list-disc pl-5 font-mono text-xs text-muted-foreground`,children:n.trackedUpstream.map(Gn)}),(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`1XSMhZ`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]}):null,e[30]=o,e[31]=n.mode,e[32]=n.trackedUpstream,e[33]=T):T=e[33];let E;return e[34]!==T||e[35]!==x||e[36]!==S||e[37]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":Vn,className:`space-y-4`,"data-testid":`settings-sharing`,children:[b,x,S,w,T]}),e[34]=T,e[35]=x,e[36]=S,e[37]=w,e[38]=E):E=e[38],E}function Gn(e){return(0,$.jsx)(`li`,{children:e},e)}function Kn(e){return e??{kind:`status`,mode:`no-git`,excluded:[],trackedUpstream:[],skillsShared:!1}}function qn(e){let t=(0,Z.c)(35),{authQueryTransport:n,authTransport:r}=e,{_:i}=m(),a;t[0]===n?a=t[1]:(a=n??fe(),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s={phase:`loading`},t[2]=s):s=t[2];let[c,l]=(0,Q.useState)(s),[u,d]=(0,Q.useState)(!1),[f,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(null),v=(0,Q.useRef)(!1),y;t[3]===o?y=t[4]:(y=async function(){l({phase:`loading`});try{let e=await o.status();l({phase:`loaded`,result:e}),De(e.authenticated)}catch(e){console.warn(`[AccountSection] GitHub status check failed`,e),l({phase:`check-failed`})}},t[3]=o,t[4]=y);let b=y,x;t[5]===b?x=t[6]:(x=()=>{b()},t[5]=b,t[6]=x);let S;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[7]=S):S=t[7],(0,Q.useEffect)(x,S);let w;t[8]!==i||t[9]!==b||t[10]!==o?(w=async function(){if(v.current)return;v.current=!0,d(!1),h(!0),_(null);let e=null;try{let t=o.signout?await o.signout():{ok:!1,error:i({id:`8cpOa8`})};t.ok||(e=t.error??i({id:`8cpOa8`}))}catch(t){console.warn(`[AccountSection] GitHub disconnect failed`,t),e=i({id:`8cpOa8`})}await b(),e&&_(e),h(!1),v.current=!1},t[8]=i,t[9]=b,t[10]=o,t[11]=w):w=t[11];let T=w,E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`h3`,{id:`settings-account-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`AeXO77`})}),t[12]=E):E=t[12];let D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[E,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`E6lrpp`})})]}),t[13]=D):D=t[13];let O;t[14]!==g||t[15]!==f||t[16]!==T||t[17]!==b||t[18]!==c.phase||t[19]!==c.result?(O=c.phase===`loading`?(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-loading`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(p,{id:`IWGfGF`})}),(0,$.jsx)(Tn,{className:`h-4 w-40`}),(0,$.jsx)(Tn,{className:`h-8 w-32`})]}):c.phase===`check-failed`?(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-check-failed`,children:[(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`T_wG4n`})}),(0,$.jsx)(C,{variant:`outline`,size:`sm`,onClick:()=>void b(),children:(0,$.jsx)(p,{id:`KDw4GX`})})]}):c.result.authenticated?c.result.tier===`A`?(0,$.jsx)(Yn,{login:c.result.login}):(0,$.jsx)(Jn,{login:c.result.login,disconnecting:f,error:g,onDisconnect:()=>void T()}):(0,$.jsx)(Xn,{onConnect:()=>d(!0)}),t[14]=g,t[15]=f,t[16]=T,t[17]=b,t[18]=c.phase,t[19]=c.result,t[20]=O):O=t[20];let k;t[21]===b?k=t[22]:(k=e=>{d(e),e||b()},t[21]=b,t[22]=k);let A=c.phase===`loaded`?c.result.host:void 0,j=c.phase===`loaded`?c.result.ghAvailable:void 0,M;t[23]===b?M=t[24]:(M=()=>{b()},t[23]=b,t[24]=M);let N;t[25]!==u||t[26]!==r||t[27]!==k||t[28]!==A||t[29]!==j||t[30]!==M?(N=(0,$.jsx)(je,{open:u,onOpenChange:k,transport:r,host:A,ghAvailable:j,onSuccess:M}),t[25]=u,t[26]=r,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N):N=t[31];let P;return t[32]!==N||t[33]!==O?(P=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-account-title`,className:`space-y-3`,"data-testid":`settings-account`,children:[D,O,N]}),t[32]=N,t[33]=O,t[34]=P):P=t[34],P}function Jn(e){let t=(0,Z.c)(20),{login:n,disconnecting:r,error:i,onDisconnect:a}=e,o;t[0]===n?o=t[1]:(o=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(p,{id:`nxlOpL`})}),t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[3]=o,t[4]=c);let l;t[5]===r?l=t[6]:(l=r?(0,$.jsx)(p,{id:`rppgXF`}):(0,$.jsx)(p,{id:`-K0AvT`}),t[5]=r,t[6]=l);let u;t[7]!==r||t[8]!==a||t[9]!==l?(u=(0,$.jsx)(C,{variant:`outline`,onClick:a,disabled:r,"aria-describedby":`settings-account-disconnect-caveat`,"data-testid":`settings-account-disconnect`,children:l}),t[7]=r,t[8]=a,t[9]=l,t[10]=u):u=t[10];let d;t[11]!==c||t[12]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[c,u]}),t[11]=c,t[12]=u,t[13]=d):d=t[13];let f;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`p`,{id:`settings-account-disconnect-caveat`,className:`text-muted-foreground text-1sm`,"data-testid":`settings-account-disconnect-caveat`,children:(0,$.jsx)(p,{id:`msOK6I`})}),t[14]=f):f=t[14];let m;t[15]===i?m=t[16]:(m=i?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-account-disconnect-error`,children:i}):null,t[15]=i,t[16]=m);let h;return t[17]!==d||t[18]!==m?(h=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,"data-testid":`settings-account-connected`,children:[d,f,m]}),t[17]=d,t[18]=m,t[19]=h):h=t[19],h}function Yn(e){let t=(0,Z.c)(5),{login:n}=e,r;t[0]===n?r=t[1]:(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(p,{id:`ny6vNn`})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-gh-cli`,children:(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[r,i]})}),t[3]=r,t[4]=a),a}function Xn(e){let t=(0,Z.c)(5),{onConnect:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`S33tz3`})}),t[0]=r):r=t[0];let i;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(p,{id:`EJuO7B`})})]}),t[1]=i):i=t[1];let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(p,{id:`5lWFkC`}),t[2]=a):a=t[2];let o;return t[3]===n?o=t[4]:(o=(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-account-disconnected`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[i,(0,$.jsx)(C,{onClick:n,"data-testid":`settings-account-connect`,children:a})]})}),t[3]=n,t[4]=o),o}function Zn(e){return e.kind===`editor`?`editor:${e.id}`:e.kind===`skill`?`skill:${e.id}`:`path`}function Qn(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=m(),a;t[0]===i?a=t[1]:(a=i({id:`2B6eYX`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(en,{className:`size-3.5`}),t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==n?(s=(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(C,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 h-6 w-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":a,"data-testid":n,children:o})}),t[3]=a,t[4]=n,t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=(0,$.jsx)(D,{side:`left`,className:`max-w-sm text-left`,children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:r})}),t[6]=r,t[7]=c);let l;return t[8]!==s||t[9]!==c?(l=(0,$.jsxs)(O,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function $n(){let e=(0,Z.c)(38),{_:t}=m(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),l,u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{if(!n)return;let e=!1;return n.integrations.status().then(t=>{e||i(t)}).catch(()=>{e||o(!0)}),()=>{e=!0}},u=[n],e[0]=l,e[1]=u):(l=e[0],u=e[1]),(0,Q.useEffect)(l,u);let d;e[2]===t?d=e[3]:(d=async function(e,r){if(n){c(Zn(e));try{let t=await n.integrations.setComponent({component:e,enabled:r});i(t.status),t.ok||X.error(t.error)}catch(e){let n=e;X.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}c(null)}},e[2]=t,e[3]=d);let f=d,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`h3`,{id:`settings-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`_5qBNl`})}),e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`mLAjyL`})})]}),e[5]=g):g=e[5];let _=g;if(!n||a){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`ai-tools-unavailable`,children:(0,$.jsx)(p,{id:`O4PnDd`})})]}),e[6]=t):t=e[6],t}if(r===null){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`ai-tools-loading`,children:[(0,$.jsx)(Tn,{className:`h-10 w-full`}),(0,$.jsx)(Tn,{className:`h-10 w-full`}),(0,$.jsx)(Tn,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}let v=s!==null||!r.available,y=r.path.shellDetected||r.path.installed,b;e[8]===r.available?b=e[9]:(b=!r.available&&(0,$.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,"data-testid":`ai-tools-read-only`,children:(0,$.jsx)(p,{id:`OplnBG`})}),e[8]=r.available,e[9]=b);let x;e[10]!==t||e[11]!==f||e[12]!==v||e[13]!==y||e[14]!==r.path.installed||e[15]!==r.path.rcFilesToTouch?(x=y&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(p,{id:`ALhMYW`})}),(0,$.jsxs)(`div`,{className:`flex items-start overflow-hidden rounded-md border border-border bg-card/50 hover:bg-accent`,children:[(0,$.jsxs)(W,{htmlFor:`ai-tools-path`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(B,{id:`ai-tools-path`,checked:r.path.installed,disabled:v,onCheckedChange:()=>void f({kind:`path`},!r.path.installed),className:`mt-0.5`,"data-testid":`ai-tools-path-checkbox`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(p,{id:`Fsx78O`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-path-status`,children:r.path.installed?t({id:`yhdqox`}):t({id:`04XyCH`,values:{0:r.path.rcFilesToTouch.join(`, `)}})})]})]}),(0,$.jsxs)(Qn,{testId:`ai-tools-path-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(p,{id:`f9lQNJ`})}),r.path.rcFilesToTouch.map(tr),(0,$.jsx)(`p`,{className:`pt-1`,children:(0,$.jsx)(p,{id:`CWzc2T`,components:{0:(0,$.jsx)(`code`,{}),1:(0,$.jsx)(`code`,{})}})})]})]})]}),e[10]=t,e[11]=f,e[12]=v,e[13]=y,e[14]=r.path.installed,e[15]=r.path.rcFilesToTouch,e[16]=x):x=e[16];let S;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(p,{id:`psfGPX`})}),e[17]=S):S=e[17];let C;if(e[18]!==t||e[19]!==f||e[20]!==v||e[21]!==r.editors){let n;e[23]!==t||e[24]!==f||e[25]!==v?(n=e=>{let n=e.state===`installed`||e.state===`foreign`,r=v||e.state===`unmanageable`,i=e.state===`not-installed`&&!e.detected,a=`https://openknowledge.ai/docs/integrations/${ct[e.id]}`,o=e.state===`installed`?t({id:`eQkgKV`}):e.state===`foreign`?t({id:`AczYxH`}):e.state===`unmanageable`?t({id:`LbmLyU`}):e.detected?t({id:`bBE5tC`}):null,s=e.state===`foreign`||e.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`;return(0,$.jsxs)(`li`,{className:r?`flex items-start`:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(W,{htmlFor:`ai-tools-editor-${e.id}`,className:r?`flex flex-1 items-start gap-2.5 px-3 py-2.5 font-normal`:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(B,{id:`ai-tools-editor-${e.id}`,checked:n,disabled:r,onCheckedChange:()=>void f({kind:`editor`,id:e.id},!n),className:`mt-0.5`,"data-testid":`ai-tools-editor-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.label}),o!==null&&(0,$.jsx)(`span`,{className:s,"data-testid":`ai-tools-editor-status-${e.id}`,children:o})]})]}),i&&(0,$.jsxs)(`a`,{href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Cn(e,a),onAuxClick:e=>Cn(e,a),"aria-label":t({id:`D-Oh1s`,values:{0:e.label}}),className:`flex shrink-0 items-center gap-0.5 px-2 py-2.5 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`,"data-testid":`ai-tools-editor-status-${e.id}`,children:[(0,$.jsx)(p,{id:`P_bX4O`}),(0,$.jsx)(jt,{className:`size-3`,"aria-hidden":!0})]}),(0,$.jsxs)(Qn,{testId:`ai-tools-editor-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(p,{id:`J2eKUI`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.configPath??t({id:`ndwmea`})})}),(0,$.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,$.jsx)(p,{id:`VIwCaD`})}),(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e.entryLocator})})]})]},e.id)},e[23]=t,e[24]=f,e[25]=v,e[26]=n):n=e[26],C=r.editors.map(n),e[18]=t,e[19]=f,e[20]=v,e[21]=r.editors,e[22]=C}else C=e[22];let w;e[27]===C?w=e[28]:(w=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[S,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:C})]}),e[27]=C,e[28]=w);let T;e[29]!==f||e[30]!==v||e[31]!==r.skills?(T=r.skills.length>0&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(p,{id:`28B21t`})}),(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:r.skills.map(e=>(0,$.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(W,{htmlFor:`ai-tools-skill-${e.id}`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(B,{id:`ai-tools-skill-${e.id}`,checked:e.installed,disabled:v,onCheckedChange:()=>void f({kind:`skill`,id:e.id},!e.installed),className:`mt-0.5`,"data-testid":`ai-tools-skill-checkbox-${e.id}`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(`code`,{children:e.name})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`ai-tools-skill-status-${e.id}`,children:e.id===`discovery`?(0,$.jsx)(p,{id:`0inVGS`}):(0,$.jsx)(p,{id:`FXk_zY`})})]})]}),(0,$.jsxs)(Qn,{testId:`ai-tools-skill-info-${e.id}`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(p,{id:`HSh8u_`})}),e.paths.map(er)]})]},e.id))})]}),e[29]=f,e[30]=v,e[31]=r.skills,e[32]=T):T=e[32];let E;return e[33]!==T||e[34]!==b||e[35]!==x||e[36]!==w?(E=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-ai-tools-title`,className:`space-y-4`,children:[_,b,x,w,T]}),e[33]=T,e[34]=b,e[35]=x,e[36]=w,e[37]=E):E=e[37],E}function er(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function tr(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}var nr=ce,rr=Q.createContext({}),ir=e=>{let t=(0,Z.c)(9),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;t[2]===n.name?r=t[3]:(r={name:n.name},t[2]=n.name,t[3]=r);let i;t[4]===n?i=t[5]:(i=(0,$.jsx)(Fe,{...n}),t[4]=n,t[5]=i);let a;return t[6]!==r||t[7]!==i?(a=(0,$.jsx)(rr.Provider,{value:r,children:i}),t[6]=r,t[7]=i,t[8]=a):a=t[8],a},ar=()=>{let e=(0,Z.c)(13),t=Q.use(rr),n=Q.use(or),{getFieldState:r}=re(),i;e[0]===t.name?i=e[1]:(i={name:t.name},e[0]=t.name,e[1]=i);let a=Ce(i),o;e[2]!==t.name||e[3]!==a||e[4]!==r?(o=r(t.name,a),e[2]=t.name,e[3]=a,e[4]=r,e[5]=o):o=e[5];let s=o;if(!t)throw Error(`useFormField should be used within <FormField>`);let{id:c}=n,l=`${c}-form-item`,u=`${c}-form-item-description`,d=`${c}-form-item-message`,f;return e[6]!==t.name||e[7]!==s||e[8]!==c||e[9]!==l||e[10]!==u||e[11]!==d?(f={id:c,name:t.name,formItemId:l,formDescriptionId:u,formMessageId:d,...s},e[6]=t.name,e[7]=s,e[8]=c,e[9]=l,e[10]=u,e[11]=d,e[12]=f):f=e[12],f},or=Q.createContext({});function sr(e){let t=(0,Z.c)(13),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=Q.useId(),a;t[3]===i?a=t[4]:(a={id:i},t[3]=i,t[4]=a);let o;t[5]===n?o=t[6]:(o=T(`grid gap-2`,n),t[5]=n,t[6]=o);let s;t[7]!==r||t[8]!==o?(s=(0,$.jsx)(`div`,{"data-slot":`form-item`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9];let c;return t[10]!==a||t[11]!==s?(c=(0,$.jsx)(or.Provider,{value:a,children:s}),t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function cr(e){let t=(0,Z.c)(10),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{error:i,formItemId:a}=ar(),o=!!i,s;t[3]===n?s=t[4]:(s=T(`data-[error=true]:text-destructive`,n),t[3]=n,t[4]=s);let c;return t[5]!==a||t[6]!==r||t[7]!==o||t[8]!==s?(c=(0,$.jsx)(W,{"data-slot":`form-label`,"data-error":o,className:s,htmlFor:a,...r}),t[5]=a,t[6]=r,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function lr(e){let t=(0,Z.c)(7),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{error:r,formItemId:i,formDescriptionId:a,formMessageId:o}=ar(),s=r?`${a} ${o}`:`${a}`,c=!!r,l;return t[2]!==i||t[3]!==n||t[4]!==s||t[5]!==c?(l=(0,$.jsx)(S,{"data-slot":`form-control`,id:i,"aria-describedby":s,"aria-invalid":c,...n}),t[2]=i,t[3]=n,t[4]=s,t[5]=c,t[6]=l):l=t[6],l}function ur(e){let t=(0,Z.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{formDescriptionId:i}=ar(),a;t[3]===n?a=t[4]:(a=T(`text-1sm text-muted-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==r||t[7]!==a?(o=(0,$.jsx)(`p`,{"data-slot":`form-description`,id:i,className:a,...r}),t[5]=i,t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function dr(e){let t=(0,Z.c)(11),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let{error:i,formMessageId:a}=ar(),o=i?String(i?.message??``):r.children;if(!o)return null;let s=i?`alert`:void 0,c;t[3]===n?c=t[4]:(c=T(`text-sm text-destructive`,n),t[3]=n,t[4]=c);let l;return t[5]!==o||t[6]!==a||t[7]!==r||t[8]!==s||t[9]!==c?(l=(0,$.jsx)(`p`,{"data-slot":`form-message`,id:a,role:s,className:c,...r,children:o}),t[5]=o,t[6]=a,t[7]=r,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function fr(e){return{chrome:e.sidebar,surface:e.background,bar:e.primary,line:e.border,dots:[e[`syntax-string`],e[`syntax-keyword`],e[`syntax-atom`]]}}function pr(e,t){return e.id===`custom`?fr(gt(yn(gn(t)))):e.base?fr(gt(e.base)):{chrome:`var(--sidebar)`,surface:`var(--background)`,bar:`var(--primary)`,line:`var(--border)`,dots:[`var(--chart-2)`,`var(--chart-4)`,`var(--chart-3)`]}}function mr(e){let t=(0,Z.c)(35),{theme:n,customSeed:r}=e,i,a,o,s,c,l,u,d,f;t[0]!==r||t[1]!==n?(i=pr(n,r),l=!0,u=`aspect-[4/3] w-full overflow-hidden rounded-md border`,d={backgroundColor:i.surface,borderColor:i.line},f=(0,$.jsxs)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:{backgroundColor:i.chrome,borderBottom:`1px solid ${i.line}`},children:[(0,$.jsx)(`span`,{className:`h-1.5 w-5 rounded-full`,style:{backgroundColor:i.bar}}),(0,$.jsx)(`span`,{className:`h-1.5 flex-1 rounded-full opacity-50`,style:{backgroundColor:i.line}})]}),c=`flex h-2/3`,a=`flex w-1/4 flex-col items-center justify-center gap-1`,o={backgroundColor:i.chrome,borderRight:`1px solid ${i.line}`},s=i.dots.map(hr),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f):(i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10]);let p;t[11]!==a||t[12]!==o||t[13]!==s?(p=(0,$.jsx)(`div`,{className:a,style:o,children:s}),t[11]=a,t[12]=o,t[13]=s,t[14]=p):p=t[14];let m;t[15]===i.dots[1]?m=t[16]:(m=(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded-full`,style:{backgroundColor:i.dots[1]}}),t[15]=i.dots[1],t[16]=m);let h;t[17]===i.line?h=t[18]:(h=(0,$.jsx)(`span`,{className:`h-1.5 w-1/2 rounded-full opacity-60`,style:{backgroundColor:i.line}}),t[17]=i.line,t[18]=h);let g;t[19]===i.dots[0]?g=t[20]:(g=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:i.dots[0]}}),t[19]=i.dots[0],t[20]=g);let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col justify-center gap-1 px-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;t[25]!==_||t[26]!==c||t[27]!==p?(v=(0,$.jsxs)(`div`,{className:c,children:[p,_]}),t[25]=_,t[26]=c,t[27]=p,t[28]=v):v=t[28];let y;return t[29]!==v||t[30]!==l||t[31]!==u||t[32]!==d||t[33]!==f?(y=(0,$.jsxs)(`div`,{"aria-hidden":l,className:u,style:d,children:[f,v]}),t[29]=v,t[30]=l,t[31]=u,t[32]=d,t[33]=f,t[34]=y):y=t[34],y}function hr(e,t){return(0,$.jsx)(`span`,{className:`size-1.5 rounded-full`,style:{backgroundColor:e}},t)}function gr(e){let t=(0,Z.c)(10),{value:n,onSelect:r,customSeed:i,id:a,"aria-label":o,"aria-describedby":s}=e,{_:c}=m(),l=bt.some(e=>e.id===n)?n:`default`,u;t[0]!==c||t[1]!==i?(u=bt.map(e=>(0,$.jsxs)(G,{value:e.id,className:T(`group/tile flex flex-col gap-1.5 rounded-lg border-2 border-transparent p-1 text-left outline-none`,`hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40`,`data-checked:border-primary`),children:[(0,$.jsx)(mr,{theme:e,customSeed:i}),(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-0.5`,children:[(0,$.jsx)(`span`,{className:`text-1sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:e.id===`custom`?hn(gn(i))===`dark`?c({id:`pvnfJD`}):c({id:`1njn7W`}):e.kind===`system`?c({id:`R9Khdg`}):e.kind===`light`?c({id:`1njn7W`}):c({id:`pvnfJD`})})]})]},e.id)),t[0]=c,t[1]=i,t[2]=u):u=t[2];let d;return t[3]!==s||t[4]!==o||t[5]!==a||t[6]!==r||t[7]!==l||t[8]!==u?(d=(0,$.jsx)(ee,{id:a,"aria-label":o,"aria-describedby":s,value:l,onValueChange:r,className:`grid w-full grid-cols-2 gap-2 sm:grid-cols-3`,children:u}),t[3]=s,t[4]=o,t[5]=a,t[6]=r,t[7]=l,t[8]=u,t[9]=d):d=t[9],d}function _r(e,t){if(e.length===0)throw Error(`buildPatch: path must be non-empty`);let[n,...r]=e;return r.length===0?{[String(n)]:t}:{[String(n)]:_r(r,t)}}function vr(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(e?.type===`default`){let t=e.defaultValue;return typeof t==`function`?t():t}let n=t?._zod?.def?.innerType;if(n===void 0)return;t=n}}function yr(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`default`||e.type===`optional`||e.type===`nullable`){t=e.innerType;continue}return e.type}}function br(e){let t=e;for(let e=0;e<16;e++){if(t==null)return;let e=t?._zod?.def;if(!e)return;if(e.type===`enum`)return e.entries?Object.values(e.entries):void 0;if(e.innerType!==void 0){t=e.innerType;continue}return}}function xr(e){if(!at(e)||e.code!==`SCHEMA_INVALID`)return null;let t=e.issues[0];return!t||t.path.length===0?null:t.path.map(String).join(`.`)}function Sr(){let e=(0,Z.c)(3),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Tn,{className:`h-5 w-32`}),n=(0,$.jsx)(Tn,{className:`h-4 w-64`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[t,n,(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(Tn,{className:`h-9 w-full`}),(0,$.jsx)(Tn,{className:`h-9 w-full`})]})]}),e[2]=r):r=e[2],r}function Cr({field:e,scope:t,commitField:n,isFlashed:r}){"use no memo";let{_:i}=m(),a=re(),o=ot(_t,e.path),s=o?yr(o):void 0,c=o?vr(o):void 0,l=o?br(o):void 0,u=o?wt(o):void 0,d=u?.scope===`project`&&t!==`project`||u?.scope===`user`&&t!==`user`,f=e.path.join(`.`),h=i(e.label),[g,_]=(0,Q.useState)(!1),v=(0,Q.useRef)(null);(0,Q.useEffect)(()=>()=>{v.current&&clearTimeout(v.current)},[]);let y=()=>{_(!0),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>_(!1),1200)},b=()=>{let e=n(f);return e&&y(),e},x=()=>a.getFieldState(f).isDirty?b():!0,S=()=>{let e=c===void 0?null:c;a.setValue(f,e,{shouldDirty:!1}),b()},w=T(`relative`,r&&`animate-settings-flash`);return(0,$.jsx)(ir,{control:a.control,name:f,render:({field:n})=>{let r=!d&&(c!==void 0||n.value!==void 0);return(0,$.jsxs)(sr,{className:w,"data-field":e.path.join(`.`),"data-scope":t,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsx)(cr,{className:`text-sm font-medium`,children:h}),r?(0,$.jsxs)(O,{children:[(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(C,{variant:`ghost`,size:`icon`,className:`h-5 w-5 text-muted-foreground opacity-60 hover:opacity-100`,onClick:S,"aria-label":i({id:`lhjq3G`,values:{labelText:h}}),children:(0,$.jsx)(_e,{className:`size-3.5`})})}),(0,$.jsx)(D,{children:(0,$.jsx)(p,{id:`L-rMC9`})})]}):null]}),e.description?(0,$.jsx)(ur,{className:`text-muted-foreground text-1sm`,children:i(e.description)}):null,(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(lr,{children:(0,$.jsx)(wr,{field:e,ctl:n,typeTag:s,enumOptions:l,onCommit:x})}),(0,$.jsx)(Or,{visible:g,srOnly:e.control===`theme-tiles`})]}),(0,$.jsx)(dr,{"data-field-error":e.path.join(`.`)})]})}})}function wr({field:e,ctl:t,typeTag:n,enumOptions:r,onCommit:i,...a}){"use no memo";let{_:o}=m(),{setTheme:s}=g(),c=Sn()?.merged??null;if(e.control===`theme-tiles`){let{id:n,...r}=a,l=c?.appearance?.customTheme;return(0,$.jsx)(gr,{...r,id:n,value:typeof t.value==`string`?t.value:`default`,customSeed:l,"aria-label":o(e.label),onSelect:e=>{if(vn(e,l),e===`custom`)s(hn(gn(l))===`dark`?`dark`:`light`);else{let t=Tt(e);t&&s(t)}t.onChange(e),i()}})}if(n===`boolean`)return(0,$.jsx)(d,{...a,checked:!!t.value,ref:t.ref,onCheckedChange:e=>{t.onChange(e),i()},onBlur:t.onBlur});if(n===`enum`&&r&&r.length>0&&(e.control===`enum-toggle`||r.length<=4)){let{id:n,...c}=a,l=e.path[0]===`appearance`&&e.path[1]===`theme`;return(0,$.jsx)(Be,{...c,type:`single`,value:typeof t.value==`string`?t.value:``,ref:t.ref,onValueChange:e=>{e&&(l&&s(e),t.onChange(e),i())},onBlur:t.onBlur,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-lg`,"aria-label":o(e.label),children:r.map((e,t)=>(0,$.jsx)(ze,{value:e,id:t===0?n:void 0,className:`text-1sm capitalize`,children:e},e))})}return n===`number`||n===`int`?(0,$.jsx)(Er,{ctl:t,onCommit:i,...a}):n===`array`?(0,$.jsx)(Dr,{ctl:t,onCommit:i,...a}):(0,$.jsx)(Tr,{ctl:t,onCommit:i,...a})}function Tr({ctl:e,onCommit:t,...n}){"use no memo";return(0,$.jsx)(on,{...n,value:typeof e.value==`string`?e.value:``,ref:e.ref,onChange:t=>e.onChange(t.target.value),onBlur:()=>{e.onBlur(),t()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),t())},className:`h-8 text-sm`})}function Er({ctl:e,onCommit:t,...n}){"use no memo";let[r,i]=(0,Q.useState)(e.value===void 0?``:String(e.value)),a=(0,Q.useRef)(e.value);(0,Q.useEffect)(()=>{a.current!==e.value&&(i(e.value===void 0?``:String(e.value)),a.current=e.value)},[e.value]);let o=()=>{let n=Number(r);if(!Number.isFinite(n)){e.onChange(r),t();return}e.onChange(n),t(),a.current=n};return(0,$.jsx)(on,{...n,type:`number`,value:r,ref:e.ref,onChange:e=>i(e.target.value),onBlur:()=>{e.onBlur(),o()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())},className:`h-8 w-28 text-sm tabular-nums`})}function Dr({ctl:e,onCommit:t,...n}){"use no memo";let r=Array.isArray(e.value)?e.value.join(`
|
|
2
|
+
`):``,[i,a]=(0,Q.useState)(r),o=(0,Q.useRef)(r);(0,Q.useEffect)(()=>{let t=Array.isArray(e.value)?e.value.join(`
|
|
3
|
+
`):``;t!==o.current&&(a(t),o.current=t)},[e.value]);let s=()=>{let n=i.split(`
|
|
4
|
+
`).map(e=>e.trim()).filter(e=>e.length>0);e.onChange(n),t(),o.current=n.join(`
|
|
5
|
+
`)};return(0,$.jsx)(Ln,{...n,value:i,ref:e.ref,onChange:e=>a(e.target.value),onBlur:()=>{e.onBlur(),s()},rows:Math.max(2,Math.min(6,i.split(`
|
|
6
|
+
`).length)),className:`field-sizing-fixed min-h-16 rounded-md bg-background px-3 py-1.5 font-mono text-xs md:text-xs dark:bg-background`})}function Or(e){let t=(0,Z.c)(5),{visible:n,srOnly:r}=e,i=r===void 0?!1:r,a;t[0]!==i||t[1]!==n?(a=n?(0,$.jsxs)($.Fragment,{children:[i?null:(0,$.jsx)(Nt,{"aria-hidden":`true`,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(p,{id:`idD8Ev`})})]}):null,t[0]=i,t[1]=n,t[2]=a):a=t[2];let o;return t[3]===a?o=t[4]:(o=(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`text-emerald-600`,children:a}),t[3]=a,t[4]=o),o}function kr(e){let t=(0,Z.c)(14),n;t[0]===e?n=t[1]:(n=e.current(),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i={defaultValues:r,mode:`onBlur`},t[2]=r,t[3]=i);let a=we(i),o,s;t[4]!==e||t[5]!==a?(o=()=>e.subscribe(e=>{Ar(a,e)}),s=[e,a],t[4]=e,t[5]=a,t[6]=o,t[7]=s):(o=t[6],s=t[7]),(0,Q.useEffect)(o,s);let c;t[8]!==e||t[9]!==a?(c=t=>jr(a,e,t),t[8]=e,t[9]=a,t[10]=c):c=t[10];let l=c,u;return t[11]!==l||t[12]!==a?(u={form:a,commitField:l},t[11]=l,t[12]=a,t[13]=u):u=t[13],u}function Ar(e,t){e.reset(t,{keepDirtyValues:!0,keepDirty:!0,keepTouched:!0})}function jr(e,t,n){let r=e.getValues(n),i=_r(Pr(n),r),a=t.patch(i);if(a.ok)return e.clearErrors(n),e.resetField(n,{defaultValue:r,keepError:!1}),!0;if(at(a.error)&&a.error.code===`SCHEMA_INVALID`&&a.error.issues.length>0){e.clearErrors(n);for(let t of a.error.issues){let r=t.path.length>0?t.path.map(String).join(`.`):n;e.setError(r,{type:`config-binding`,message:t.message})}}else e.setError(n,{type:`config-binding`,message:Mr(a.error,n)});return!1}function Mr(e,t){if(at(e)&&e.code===`SCHEMA_INVALID`){let n=e.issues.find(e=>Nr(e,t));if(n)return n.message}return pt(e)}function Nr(e,t){return e.path.map(String).join(`.`)===t}function Pr(e){return e.split(`.`)}var Fr=`content.attachmentFolderPath`,Ir=`attachments`;function Lr(e){let t=st(e);return t===`./`?`same-folder`:t===`/`?`content-root`:t.startsWith(`./`)?`current-folder-subfolder`:`content-root-folder`}function Rr(e){let t=st(e);return t===`./`||t===`/`?Ir:t.startsWith(`./`)?t.slice(2)||Ir:t}function zr(e){return e.trim().replace(/^(?:\.\/)+/,``).replace(/\/{2,}/g,`/`).replace(/\/+$/g,``)}function Br(e,t){let n=zr(t)||Ir;return e===`same-folder`?`./`:e===`content-root`?`/`:e===`current-folder-subfolder`?`./${n}`:n}function Vr(){let e=(0,Z.c)(4),{projectBinding:t,projectConfig:n,projectSynced:r}=xn();if(!t||!r||!n){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Sr,{}),e[0]=t):t=e[0],t}let i=n.content.attachmentFolderPath??`./`,a;return e[1]!==i||e[2]!==t?(a=(0,$.jsx)(Hr,{binding:t,value:i},i),e[1]=i,e[2]=t,e[3]=a):a=e[3],a}function Hr(e){let t=(0,Z.c)(50),{binding:n,value:s}=e,{_:c}=m(),l;t[0]===s?l=t[1]:(l=()=>Lr(s),t[0]=s,t[1]=l);let[d,f]=(0,Q.useState)(l),h;t[2]===s?h=t[3]:(h=()=>Rr(s),t[2]=s,t[3]=h);let[g,_]=(0,Q.useState)(h),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(!1),w=(0,Q.useRef)(null),E=(0,Q.useRef)(null),D,O;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>()=>{w.current&&clearTimeout(w.current),E.current&&clearTimeout(E.current)},O=[],t[4]=D,t[5]=O):(D=t[4],O=t[5]),(0,Q.useEffect)(D,O);let k,A;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>Se(e=>{if(e.docName!==`__config__/project`||xr(e.error)!==Fr)return;let t=Mr(e.error,Fr);X.error(pt(e.error),{duration:8e3}),y(t),C(!0),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{C(!1),y(null)},600)}),A=[],t[6]=k,t[7]=A):(k=t[6],A=t[7]),(0,Q.useEffect)(k,A);let j;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{x(!0),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>x(!1),1200)},t[8]=j):j=t[8];let M=j,N;t[9]!==c||t[10]!==n?(N=e=>{let t=n.patch({content:{attachmentFolderPath:e}});if(t.ok){y(null),M();return}let r=Mr(t.error,Fr);y(r),X.error(c({id:`eQxm13`,values:{detail:r}}))},t[9]=c,t[10]=n,t[11]=N):N=t[11];let P=N,F;t[12]!==P||t[13]!==g?(F=e=>{if(e!==`same-folder`&&e!==`content-root`&&e!==`current-folder-subfolder`&&e!==`content-root-folder`)return;let t=e,n=t===`current-folder-subfolder`||t===`content-root-folder`?g||Ir:g;f(t),_(n),P(Br(t,n))},t[12]=P,t[13]=g,t[14]=F):F=t[14];let I=F,L;t[15]!==P||t[16]!==g||t[17]!==d?(L=()=>{let e=Br(d,g);_(Rr(e)),P(e)},t[15]=P,t[16]=g,t[17]=d,t[18]=L):L=t[18];let R=L,z=d===`current-folder-subfolder`||d===`content-root-folder`,B;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(`h3`,{id:`settings-attachments-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`w_Sphq`})}),t[19]=B):B=t[19];let V;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[B,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`Hnl9nT`})})]}),t[20]=V):V=t[20];let H=S&&`animate-settings-flash`,U;t[21]===H?U=t[22]:(U=T(`rounded-md border p-3`,H),t[21]=H,t[22]=U);let W;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,$.jsx)(`div`,{className:`text-sm font-medium`,id:`settings-attachments-location-label`,children:(0,$.jsx)(p,{id:`AsqRE_`})}),t[23]=W):W=t[23];let ee;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[W,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(p,{id:`vppAju`})})]}),t[24]=ee):ee=t[24];let G;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(o,{"aria-labelledby":`settings-attachments-location-label`,"data-testid":`settings-attachments-mode`,size:`sm`,children:(0,$.jsx)(i,{})}),t[25]=G):G=t[25];let K;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(u,{value:`same-folder`,children:(0,$.jsx)(p,{id:`Q7W-mC`})}),t[26]=K):K=t[26];let te;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(u,{value:`content-root`,children:(0,$.jsx)(p,{id:`yWSvcf`})}),t[27]=te):te=t[27];let ne;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(u,{value:`current-folder-subfolder`,children:(0,$.jsx)(p,{id:`0YUS3Q`})}),t[28]=ne):ne=t[28];let re;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsxs)(r,{children:[K,te,ne,(0,$.jsx)(u,{value:`content-root-folder`,children:(0,$.jsx)(p,{id:`qAx7xG`})})]}),t[29]=re):re=t[29];let ie;t[30]!==d||t[31]!==I?(ie=(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(16rem,18rem)] sm:items-start`,children:[ee,(0,$.jsxs)(a,{value:d,onValueChange:I,children:[G,re]})]}),t[30]=d,t[31]=I,t[32]=ie):ie=t[32];let q;t[33]!==c||t[34]!==R||t[35]!==g||t[36]!==z?(q=z?(0,$.jsxs)(`div`,{className:`mt-3 max-w-sm space-y-1`,children:[(0,$.jsx)(`label`,{className:`text-sm font-medium`,htmlFor:`settings-attachments-folder-input`,children:(0,$.jsx)(p,{id:`kNqMMd`})}),(0,$.jsx)(on,{id:`settings-attachments-folder-input`,value:g,placeholder:c({id:`OeAl1e`}),onChange:e=>_(e.target.value),onBlur:R,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),R())},className:`h-8 text-sm`,"data-testid":`settings-attachments-folder`})]}):null,t[33]=c,t[34]=R,t[35]=g,t[36]=z,t[37]=q):q=t[37];let ae;t[38]===v?ae=t[39]:(ae=v?(0,$.jsx)(`p`,{className:`text-1sm text-destructive`,"data-field-error":Fr,role:`alert`,children:v}):null,t[38]=v,t[39]=ae);let J;t[40]===b?J=t[41]:(J=(0,$.jsx)(Or,{visible:b}),t[40]=b,t[41]=J);let oe;t[42]!==ae||t[43]!==J?(oe=(0,$.jsxs)(`div`,{className:`mt-2 flex min-h-5 items-center gap-2`,children:[ae,J]}),t[42]=ae,t[43]=J,t[44]=oe):oe=t[44];let Y;return t[45]!==U||t[46]!==ie||t[47]!==q||t[48]!==oe?(Y=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-attachments-title`,className:`space-y-3`,"data-testid":`settings-attachments`,children:[V,(0,$.jsxs)(`div`,{className:U,"data-field":Fr,"data-scope":`project`,children:[ie,q,oe]})]}),t[45]=U,t[46]=ie,t[47]=q,t[48]=oe,t[49]=Y):Y=t[49],Y}function Ur(e){let t=(0,Z.c)(21),{icon:n,name:r,hint:i,checked:a,disabled:o,ariaLabel:s,testId:c,onToggle:l}=e,u;t[0]===n?u=t[1]:(u=(0,$.jsx)(`span`,{className:`flex h-5 shrink-0 items-center`,children:n}),t[0]=n,t[1]=u);let f;t[2]===r?f=t[3]:(f=(0,$.jsx)(`span`,{className:`truncate text-sm leading-5`,children:r}),t[2]=r,t[3]=f);let p;t[4]===i?p=t[5]:(p=i?(0,$.jsx)(`span`,{className:`truncate text-muted-foreground text-1sm`,children:i}):null,t[4]=i,t[5]=p);let m;t[6]!==f||t[7]!==p?(m=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[f,p]}),t[6]=f,t[7]=p,t[8]=m):m=t[8];let h;t[9]!==u||t[10]!==m?(h=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[u,m]}),t[9]=u,t[10]=m,t[11]=h):h=t[11];let g;t[12]!==s||t[13]!==a||t[14]!==o||t[15]!==l||t[16]!==c?(g=(0,$.jsx)(d,{checked:a,disabled:o,onCheckedChange:l,"aria-label":s,"data-testid":c}),t[12]=s,t[13]=a,t[14]=o,t[15]=l,t[16]=c,t[17]=g):g=t[17];let _;return t[18]!==h||t[19]!==g?(_=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[h,g]}),t[18]=h,t[19]=g,t[20]=_):_=t[20],_}function Wr(e){let t=(0,Z.c)(9),{label:n,children:r,labelId:i}=e,a;t[0]!==n||t[1]!==i?(a=(0,$.jsx)(`h4`,{id:i,className:`mb-2 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:n}),t[0]=n,t[1]=i,t[2]=a):a=t[2];let o;t[3]===r?o=t[4]:(o=(0,$.jsx)(`div`,{className:`divide-y overflow-hidden rounded-md border`,children:r}),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==a||t[7]!==o?(s=(0,$.jsxs)(`section`,{"aria-labelledby":i,children:[a,o]}),t[5]=i,t[6]=a,t[7]=o,t[8]=s):s=t[8],s}function Gr(){let e=(0,Z.c)(50),{_:t}=m(),n=qe(),r=Ve(),{states:i,refresh:a}=Ht(),o=zt(),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(!1),f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={queryKey:[`acp-catalog`],queryFn:Jr,staleTime:3e5},e[0]=f):f=e[0];let p=h(f),g;e[1]===a?g=e[2]:(g=()=>{a()},e[1]=a,e[2]=g);let _=(0,Q.useEffectEvent)(g),v;e[3]===_?v=e[4]:(v=()=>{_()},e[3]=_,e[4]=v);let y;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=[],e[5]=y):y=e[5],(0,Q.useEffect)(v,y);let b=p.data?.agents,x;e[6]===r?x=e[7]:(x=new Set(r.map(qr)),e[6]=r,e[7]=x);let S=x,w;e[8]===o?.installedClis?w=e[9]:(w=o?.installedClis??{},e[8]=o?.installedClis,e[9]=w);let T=w,E;if(e[10]!==t||e[11]!==p||e[12]!==b||e[13]!==T||e[14]!==n||e[15]!==c||e[16]!==S||e[17]!==u||e[18]!==i||e[19]!==o){let r=c.trim().toLowerCase(),a=e=>r===``||e.toLowerCase().includes(r),f=(b??[]).filter(e=>a(e.name)),m=o===null?[]:ft.filter(e=>a(lt[e].displayName)),h=Je.filter(e=>a(e.displayName)),g=r!==``,_=!p.isLoading&&!p.isError,v=g&&_&&f.length===0&&m.length===0&&h.length===0,y=!g||p.isLoading||p.isError||f.length>0,x=o!==null&&(!g||m.length>0),w=!g||h.length>0,D;e[21]!==n||e[22]!==S?(D=e=>{let t=S.has(`${e.source}:${e.id}`),r=e.supported===!0&&e.harness?.availability===`present`;return Xe(n,e.source,e.id,t||r,e.supported)},e[21]=n,e[22]=S,e[23]=D):D=e[23];let O=D,k;e[24]===O?k=e[25]:(k=e=>e.harness!==void 0||O(e),e[24]=O,e[25]=k);let A=f.filter(k),j=g||u?f:A,M=g?0:f.length-A.length,N;e[26]===t?N=e[27]:(N=t({id:`jRAGrQ`}),e[26]=t,e[27]=N);let P;e[28]===N?P=e[29]:(P=(0,$.jsx)(`h3`,{id:`settings-configure-agents-title`,className:`font-semibold text-base`,children:N}),e[28]=N,e[29]=P);let F;e[30]===t?F=e[31]:(F=t({id:`OcBurH`}),e[30]=t,e[31]=F);let I;e[32]===F?I=e[33]:(I=(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:F}),e[32]=F,e[33]=I);let L;e[34]!==P||e[35]!==I?(L=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[P,I]}),e[34]=P,e[35]=I,e[36]=L):L=e[36];let R;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(s,{className:`-translate-y-1/2 absolute top-1/2 left-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),e[37]=R):R=e[37];let z;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>l(e.target.value),e[38]=z):z=e[38];let B;e[39]===t?B=e[40]:(B=t({id:`-7s4fw`}),e[39]=t,e[40]=B);let V;e[41]===t?V=e[42]:(V=t({id:`-7s4fw`}),e[41]=t,e[42]=V);let H;e[43]!==c||e[44]!==B||e[45]!==V?(H=(0,$.jsxs)(`div`,{className:`relative`,children:[R,(0,$.jsx)(on,{value:c,onChange:z,placeholder:B,"aria-label":V,className:`pl-8`,"data-testid":`configure-agents-search`})]}),e[43]=c,e[44]=B,e[45]=V,e[46]=H):H=e[46];let U;e[47]!==t||e[48]!==v?(U=v?(0,$.jsx)(`p`,{className:`py-6 text-center text-muted-foreground text-sm`,"data-testid":`configure-agents-no-results`,children:t({id:`Nay2Yr`})}):null,e[47]=t,e[48]=v,e[49]=U):U=e[49],E=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-configure-agents-title`,className:`space-y-6`,"data-testid":`settings-configure-agents`,children:[L,H,U,y?(0,$.jsx)(Wr,{label:(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[t({id:`RXEbZy`}),(0,$.jsx)($e,{})]}),labelId:`settings-configure-agents-in-app`,children:p.isLoading?(0,$.jsxs)(`div`,{className:`flex items-center justify-center gap-2 px-3 py-6 text-muted-foreground text-sm`,children:[(0,$.jsx)(tn,{className:`size-4 animate-spin`,"aria-hidden":`true`}),t({id:`ucXZ0k`})]}):p.isError?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-3 py-6 text-center text-muted-foreground text-sm`,children:[(0,$.jsx)(Bn,{className:`size-5`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:t({id:`FqGWeR`})}),(0,$.jsx)(C,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void p.refetch(),children:t({id:`6gRgw8`})})]}):(b?.length??0)===0?(0,$.jsx)(`p`,{className:`px-3 py-6 text-center text-muted-foreground text-sm`,children:t({id:`QQbwzK`})}):(0,$.jsxs)($.Fragment,{children:[j.map(e=>{let r=O(e),i=e.supported?e.description:t({id:`5jEnaB`});return(0,$.jsx)(Ur,{icon:(0,$.jsx)(Mt,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),name:e.name,hint:i,checked:r,disabled:!e.supported,ariaLabel:t({id:`FZtBeR`,values:{0:e.name}}),testId:`configure-agents-in-app-${e.source}:${e.id}`,onToggle:t=>{t?(He({source:e.source,id:e.id,name:e.name,supported:e.supported,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}},{makeDefault:!1}),tt(Ye(e.source,e.id),!0)):(tt(Ye(e.source,e.id),!1),nt(`${e.source}:${e.id}`,e=>Xe(n,e.source,e.id,!0,e.supported)))}},`${e.source}:${e.id}`)}),M>0?(0,$.jsx)(C,{type:`button`,variant:`ghost`,onClick:()=>d(Kr),className:`w-full justify-center rounded-none font-normal text-1sm text-muted-foreground`,"data-testid":`configure-agents-in-app-show-more`,children:t(u?{id:`6lGV3K`}:{id:`np9pbC`,values:{inAppHiddenCount:M}})}):null]})}):null,x?(0,$.jsx)(Wr,{label:t({id:`ALhMYW`}),labelId:`settings-configure-agents-terminal`,children:m.map(e=>{let{displayName:r}=lt[e],i=T[e]===!1;return(0,$.jsx)(Ur,{icon:(0,$.jsx)(Ze,{id:Ue(e),className:`size-4`,"aria-hidden":`true`}),name:t({id:`QYfQdv`,values:{displayName:r}}),hint:i?t({id:`5SwVv1`}):void 0,checked:Qe(n,e,T),ariaLabel:t({id:`27TLNq`,values:{displayName:r}}),testId:`configure-agents-terminal-${e}`,onToggle:t=>tt(Ke(e),t)},e)})}):null,w?(0,$.jsx)(Wr,{label:t({id:`BBqGS9`}),labelId:`settings-configure-agents-desktop`,children:h.map(e=>{let r=i[e.id]?.installed??null;return(0,$.jsx)(Ur,{icon:(0,$.jsx)(Ze,{id:e.id,className:`size-4`,"aria-hidden":`true`}),name:e.displayName,hint:r===!1?t({id:`5SwVv1`}):void 0,checked:et(n,e.id),ariaLabel:t({id:`FZtBeR`,values:{0:e.displayName}}),testId:`configure-agents-desktop-${e.id}`,onToggle:t=>tt(Ge(e.id),t)},e.id)})}):null]}),e[10]=t,e[11]=p,e[12]=b,e[13]=T,e[14]=n,e[15]=c,e[16]=S,e[17]=u,e[18]=i,e[19]=o,e[20]=E}else E=e[20];return E}function Kr(e){return!e}function qr(e){return`${e.source}:${e.id}`}function Jr(e){let{signal:t}=e;return it(t)}async function Yr(e){try{let t=yt.safeParse(await e.json());if(t.success)return t.data.title}catch{}}async function Xr(e,t){try{let n=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return n.ok?{ok:!0}:{ok:!1,error:await Yr(n)}}catch{return{ok:!1}}}function Zr(){return{setKey:e=>Xr(`/api/local-op/embeddings/set-key`,{key:e}),clearKey:()=>Xr(`/api/local-op/embeddings/clear-key`,{})}}function Qr(e){let t=(0,Z.c)(29),{transport:n}=e,{_:r}=m(),i;t[0]===n?i=t[1]:(i=n??Zr(),t[0]=n,t[1]=i);let a=i,{status:o,refresh:s}=oe(),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(!1),[f,h]=(0,Q.useState)(null),g=o?.keyPresent??!1,_=o?.keySource??null,v=o?.keyHint??null,y;t[2]!==r||t[3]!==u||t[4]!==c||t[5]!==s||t[6]!==a?(y=async function(){let e=c.trim();if(!e||u)return;d(!0),h(null);let t=await a.setKey(e);d(!1),t.ok?(l(``),s()):h(t.error??r({id:`Ck9XRt`}))},t[2]=r,t[3]=u,t[4]=c,t[5]=s,t[6]=a,t[7]=y):y=t[7];let b=y,x;t[8]!==r||t[9]!==u||t[10]!==s||t[11]!==a?(x=async function(){if(u)return;d(!0),h(null);let e=await a.clearKey();d(!1),e.ok?s():h(e.error??r({id:`CSL0l1`}))},t[8]=r,t[9]=u,t[10]=s,t[11]=a,t[12]=x):x=t[12];let S=x,w;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(`h3`,{id:`settings-embeddings-key-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`nh3wwx`})}),t[13]=w):w=t[13];let T;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[w,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`wccmX0`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})})]}),t[14]=T):T=t[14];let E;t[15]!==r||t[16]!==u||t[17]!==v||t[18]!==c||t[19]!==g||t[20]!==_||t[21]!==S||t[22]!==b?(E=_===`env`?(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-embeddings-key-env`,children:(0,$.jsx)(p,{id:`KH5bQi`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})}):(0,$.jsxs)($.Fragment,{children:[g?(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,"data-testid":`settings-embeddings-key-set`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`div`,{className:`mb-1.5 text-sm font-medium`,children:(0,$.jsx)(p,{id:`AqnqMJ`})}),v?(0,$.jsxs)(`p`,{className:`truncate font-mono text-muted-foreground text-xs`,title:r({id:`qEIFZu`,values:{keyHint:v}}),"data-testid":`settings-embeddings-key-hint`,children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`••••••••`}),v]}):null,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(p,{id:`3TCafD`})})]}),(0,$.jsx)(C,{variant:`outline`,onClick:()=>void S(),disabled:u,"data-testid":`settings-embeddings-key-clear`,children:(0,$.jsx)(p,{id:`xCJdfg`})})]}):null,(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`label`,{htmlFor:`settings-embeddings-key-input`,className:`mb-2 block text-sm font-medium`,children:g?(0,$.jsx)(p,{id:`UW93oq`}):(0,$.jsx)(p,{id:`K6jxcj`})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(on,{id:`settings-embeddings-key-input`,type:`password`,value:c,onChange:e=>l(e.target.value),placeholder:r({id:`tsiTqO`}),autoComplete:`off`,spellCheck:!1,disabled:u,"data-testid":`settings-embeddings-key-input`,className:`h-8 font-mono text-sm`}),(0,$.jsx)(C,{onClick:()=>void b(),disabled:u||c.trim().length===0,"data-testid":`settings-embeddings-key-save`,children:u?(0,$.jsx)(p,{id:`uF9ruK`}):(0,$.jsx)(p,{id:`tfDRzk`})})]})]})]}),t[15]=r,t[16]=u,t[17]=v,t[18]=c,t[19]=g,t[20]=_,t[21]=S,t[22]=b,t[23]=E):E=t[23];let D;t[24]===f?D=t[25]:(D=f?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`settings-embeddings-key-error`,children:f}):null,t[24]=f,t[25]=D);let O;return t[26]!==E||t[27]!==D?(O=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-embeddings-key-title`,className:`space-y-3`,"data-testid":`settings-embeddings-key`,children:[T,(0,$.jsxs)(`div`,{className:`space-y-3 rounded-md border p-3`,children:[E,D]})]}),t[26]=E,t[27]=D,t[28]=O):O=t[28],O}function $r({binding:e}){return sn(e).split(` / `).map((e,t)=>t===0?(0,$.jsx)(c,{"aria-label":un(e),children:e},`kbd-${e}`):(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(p,{id:`qEue6Q`})}),(0,$.jsx)(`span`,{"aria-hidden":`true`,children:` / `}),(0,$.jsx)(c,{"aria-label":un(e),children:e})]},`or-${e}`))}function ei(){let e=(0,Z.c)(6),{_:t}=m(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`h3`,{id:`settings-hotkeys-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`4KmEoC`})}),e[0]=n):n=e[0];let r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[n,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`RaPMZv`})})]}),e[1]=r):r=e[1];let i;e[2]===t?i=e[3]:(i=ln.map(e=>{let n=dn.filter(t=>t.category===e);return n.length===0?null:(0,$.jsxs)(`section`,{"aria-labelledby":`settings-hotkeys-${e}`,children:[(0,$.jsx)(`h4`,{id:`settings-hotkeys-${e}`,className:`mb-2 font-mono text-muted-foreground text-xs uppercase tracking-wide`,children:t(cn[e])}),(0,$.jsx)(`ul`,{"aria-labelledby":`settings-hotkeys-${e}`,className:`m-0 list-none overflow-hidden rounded-md border p-0`,children:n.map(e=>{let n=`settings-hotkey-${e.id}-title`,r=`settings-hotkey-${e.id}-description`,i=e.bindings.reduce(ti,0)>4;return(0,$.jsxs)(`li`,{"aria-describedby":r,"aria-labelledby":n,className:T(`grid gap-2 border-border border-b px-3 py-3 last:border-b-0`,i?`sm:grid-cols-1`:`sm:grid-cols-[minmax(0,1fr)_minmax(0,auto)]`),"data-testid":`settings-hotkey-${e.id}`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`p`,{className:`font-medium text-sm`,id:n,children:t(e.title)}),(0,$.jsxs)(mn,{variant:`gray`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(p,{id:`iXTp5j`})}),t(e.scope)]})]}),(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,id:r,children:t(e.description)})]}),(0,$.jsx)(`div`,{className:T(`flex min-w-0 max-w-full self-start content-start flex-wrap items-start gap-1.5`,i?`sm:justify-start`:`sm:max-w-[38rem] sm:justify-end`),children:e.bindings.map(t=>(0,$.jsx)($r,{binding:t},`${e.id}-${t.mac}-${t.windowsLinux}`))})]},e.id)})})]},e)}),e[2]=t,e[3]=i);let a;return e[4]===i?a=e[5]:(a=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-hotkeys-title`,className:`space-y-5`,"data-testid":`settings-hotkeys`,children:[r,(0,$.jsx)(`div`,{className:`space-y-6`,"data-testid":`settings-hotkeys-list`,children:i})]}),e[4]=i,e[5]=a),a}function ti(e,t){return e+sn(t).split(` / `).length}function ni(){(0,Z.c)(16);let[e,t]=(0,Q.useState)(!1),{skillInstalled:n,refresh:r}=ae();return null}function ri(){let e=(0,Z.c)(32),{_:t}=m(),{projectLocalConfig:n,projectLocalSynced:r,projectLocalBinding:i}=xn(),[a,o]=(0,Q.useState)(!1),s=(0,Q.useRef)(null),c=n?.linkPreviews?.enabled??!1,l=r&&i!==null,u;e[0]!==t||e[1]!==i?(u=function(e){if(i===null)return X.error(t({id:`ax9kie`})),!1;let n=i.patch({linkPreviews:{enabled:e}});if(!n.ok){let r=pt(n.error);return X.error(t(e?{id:`ZatAO_`,values:{detail:r}}:{id:`RO-yts`,values:{detail:r}})),!1}return!0},e[0]=t,e[1]=i,e[2]=u):u=e[2];let f=u,h;e[3]===f?h=e[4]:(h=function(e){if(e){o(!0);return}f(!1)},e[3]=f,e[4]=h);let g=h,_;e[5]===f?_=e[6]:(_=function(){f(!0)&&o(!1)},e[5]=f,e[6]=_);let v=_,y;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`h3`,{id:`settings-link-previews-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`gh27t1`})}),e[7]=y):y=e[7];let b;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[y,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`cGV6Mh`})})]}),e[8]=b):b=e[8];let x;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(`label`,{htmlFor:`settings-link-previews-toggle`,className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`ENpRJV`})}),e[9]=x):x=e[9];let S;e[10]===c?S=e[11]:(S=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[x,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-link-previews-body`,children:c?(0,$.jsx)(p,{id:`rVJpLz`}):(0,$.jsx)(p,{id:`YjMLg2`})})]}),e[10]=c,e[11]=S);let C=!l,w;e[12]!==t||e[13]!==c?(w=t(c?{id:`5Umg9i`}:{id:`KpOJFY`}),e[12]=t,e[13]=c,e[14]=w):w=e[14];let T;e[15]!==c||e[16]!==g||e[17]!==C||e[18]!==w?(T=(0,$.jsx)(d,{ref:s,id:`settings-link-previews-toggle`,checked:c,disabled:C,onCheckedChange:g,"aria-label":w,"data-testid":`settings-link-previews-toggle`}),e[15]=c,e[16]=g,e[17]=C,e[18]=w,e[19]=T):T=e[19];let E;e[20]!==S||e[21]!==T?(E=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[S,T]}),e[20]=S,e[21]=T,e[22]=E):E=e[22];let D;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm mt-2`,children:(0,$.jsx)(p,{id:`Xk0-VC`})}),e[23]=D):D=e[23];let O;e[24]===E?O=e[25]:(O=(0,$.jsxs)(`div`,{className:`rounded-md border p-3`,children:[E,D]}),e[24]=E,e[25]=O);let k;e[26]!==a||e[27]!==v?(k=(0,$.jsx)(ii,{open:a,onOpenChange:o,onConfirm:v,returnFocusRef:s}),e[26]=a,e[27]=v,e[28]=k):k=e[28];let A;return e[29]!==O||e[30]!==k?(A=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-link-previews-title`,className:`space-y-3`,"data-testid":`settings-link-previews`,children:[b,O,k]}),e[29]=O,e[30]=k,e[31]=A):A=e[31],A}function ii(e){let t=(0,Z.c)(17),{open:n,onOpenChange:r,onConfirm:i,returnFocusRef:a}=e,o;t[0]===a?o=t[1]:(o=e=>{e.preventDefault(),a.current?.focus()},t[0]=a,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(N,{children:(0,$.jsx)(p,{id:`MqsbfN`})}),t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(R,{children:[s,(0,$.jsx)(M,{children:(0,$.jsx)(p,{id:`VFQXPl`})})]}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(`p`,{className:`mb-2 font-medium`,children:(0,$.jsx)(p,{id:`2Snes1`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(F,{children:(0,$.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2.5 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,children:[l,(0,$.jsxs)(`ul`,{className:`list-disc space-y-1.5 pl-5`,children:[(0,$.jsx)(`li`,{children:(0,$.jsx)(p,{id:`My0wYT`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(p,{id:`lmBPt0`})}),(0,$.jsx)(`li`,{children:(0,$.jsx)(p,{id:`5AzM72`})})]})]})}),t[5]=u):u=t[5];let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(L,{asChild:!0,children:(0,$.jsx)(C,{variant:`outline`,children:(0,$.jsx)(p,{id:`dEgA5A`})})}),t[6]=d):d=t[6];let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(p,{id:`iMkWoF`}),t[7]=f):f=t[7];let m;t[8]===i?m=t[9]:(m=(0,$.jsxs)(I,{children:[d,(0,$.jsx)(C,{onClick:i,"data-testid":`settings-link-previews-confirm-enable`,children:f})]}),t[8]=i,t[9]=m);let h;t[10]!==o||t[11]!==m?(h=(0,$.jsxs)(P,{className:`sm:max-w-lg`,"data-testid":`settings-link-previews-confirm`,onCloseAutoFocus:o,children:[c,u,m]}),t[10]=o,t[11]=m,t[12]=h):h=t[12];let g;return t[13]!==r||t[14]!==n||t[15]!==h?(g=(0,$.jsx)(z,{open:n,onOpenChange:r,children:h}),t[13]=r,t[14]=n,t[15]=h,t[16]=g):g=t[16],g}function ai(e){let t=(0,Z.c)(10),{scope:n}=e,r=`settings-scope-badge-${n}`,i;t[0]===n?i=t[1]:(i=n===`user`?(0,$.jsx)(p,{id:`7PzzBU`}):(0,$.jsx)(p,{id:`e0NrBM`}),t[0]=n,t[1]=i);let a;t[2]!==r||t[3]!==i?(a=(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(mn,{variant:`gray`,tabIndex:0,className:`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"data-testid":r,children:i})}),t[2]=r,t[3]=i,t[4]=a):a=t[4];let o;t[5]===n?o=t[6]:(o=(0,$.jsx)(D,{children:n===`user`?(0,$.jsx)(p,{id:`a7P3nH`}):(0,$.jsx)(p,{id:`494br3`})}),t[5]=n,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=(0,$.jsxs)(O,{children:[a,o]}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function oi(){let e=(0,Z.c)(7),{_:t}=m(),{projectConfig:n,projectSynced:r,projectBinding:i}=xn(),a=n?.contentRules,o=r&&i!==null,s;e[0]!==t||e[1]!==i?(s=function(e){if(i===null)return X.error(t({id:`dVaXnv`})),!1;let n=i.patch({contentRules:e});return n.ok?!0:(X.error(t({id:`NrFwux`,values:{0:pt(n.error)}})),!1)},e[0]=t,e[1]=i,e[2]=s):s=e[2];let c=s,l;return e[3]!==o||e[4]!==a||e[5]!==c?(l={contentRules:a,bindingReady:o,write:c},e[3]=o,e[4]=a,e[5]=c,e[6]=l):l=e[6],l}function si(e,t){return{[e]:{enabled:t}}}function ci(e){let t=(0,Z.c)(1),{id:n}=e;switch(n){case`markdownlint`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(p,{id:`Vftef5`}),t[0]=e):e=t[0],e}}}function li(){let e=(0,Z.c)(12),{_:t}=m(),{contentRules:n,bindingReady:r,write:i}=oi(),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`h3`,{id:`settings-plugins-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`ohUJJM`})}),e[0]=a):a=e[0];let o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[a,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`oXlLi4`})})]}),e[1]=o):o=e[1];let s;e[2]!==t||e[3]!==r||e[4]!==n||e[5]!==i?(s=ue.map(e=>{let a=n?.[e.id]?.enabled===!0;return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(W,{htmlFor:`settings-plugin-toggle-${e.id}`,className:`text-sm font-medium`,children:e.label}),(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(ci,{id:e.id})})]}),(0,$.jsx)(d,{id:`settings-plugin-toggle-${e.id}`,checked:a,disabled:!r,onCheckedChange:t=>i(si(e.id,t)),"aria-label":t(a?{id:`y5UgU8`,values:{0:e.label}}:{id:`FZtBeR`,values:{0:e.label}}),"data-testid":`settings-plugin-toggle-${e.id}`})]},e.id)}),e[2]=t,e[3]=r,e[4]=n,e[5]=i,e[6]=s):s=e[6];let c;e[7]===s?c=e[8]:(c=(0,$.jsx)(`div`,{className:`divide-y rounded-md border`,"data-testid":`settings-plugins-list`,children:s}),e[7]=s,e[8]=c);let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`settings-plugins-audit-pointer`,children:(0,$.jsx)(p,{id:`9KooKn`})}),e[9]=l):l=e[9];let u;return e[10]===c?u=e[11]:(u=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-plugins-title`,className:`space-y-4`,"data-testid":`settings-plugins-manage`,children:[o,c,l]}),e[10]=c,e[11]=u),u}function ui(e){let t=(0,Z.c)(15),{userBinding:n}=e,{_:r}=m(),{userConfig:i}=xn(),a=i?.appearance?.colorThemeEnabled!==!1,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`h3`,{id:`settings-user-plugins-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`ohUJJM`})}),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`k2fEi7`})})]}),t[1]=s):s=t[1];let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(W,{htmlFor:`settings-plugin-toggle-theme`,className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`fJ3EbT`})}),t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[c,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`YRavYS`})})]}),t[3]=l):l=t[3];let u=n===null,f;t[4]!==r||t[5]!==n?(f=e=>{n&&(n.patch({appearance:{colorThemeEnabled:e}}).ok||X.error(r({id:`C_Lyvh`})))},t[4]=r,t[5]=n,t[6]=f):f=t[6];let h;t[7]!==r||t[8]!==a?(h=r(a?{id:`cOJyVj`}:{id:`G_hVTP`}),t[7]=r,t[8]=a,t[9]=h):h=t[9];let g;return t[10]!==u||t[11]!==f||t[12]!==h||t[13]!==a?(g=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-user-plugins-title`,className:`space-y-4`,"data-testid":`settings-user-plugins-manage`,children:[s,(0,$.jsx)(`div`,{className:`rounded-md border p-3`,"data-testid":`settings-user-plugins-list`,children:(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[l,(0,$.jsx)(d,{id:`settings-plugin-toggle-theme`,checked:a,disabled:u,onCheckedChange:f,"aria-label":h,"data-testid":`settings-plugin-toggle-theme`})]})})]}),t[10]=u,t[11]=f,t[12]=h,t[13]=a,t[14]=g):g=t[14],g}function di(e){let t=(0,Z.c)(13),{titleId:n,title:r,scope:i,children:a}=e,o;t[0]!==r||t[1]!==n?(o=(0,$.jsx)(`h3`,{id:n,className:`text-base font-semibold`,children:r}),t[0]=r,t[1]=n,t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=i?(0,$.jsx)(ai,{scope:i}):null,t[3]=i,t[4]=s);let c;t[5]!==o||t[6]!==s?(c=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;t[8]===a?l=t[9]:(l=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),t[8]=a,t[9]=l);let u;return t[10]!==c||t[11]!==l?(u=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[c,l]}),t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function fi(e){let t=(0,Z.c)(5),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{initialRuleQuery:r}=n,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(di,{titleId:`settings-plugin-markdownlint-title`,title:`markdownlint`,scope:`project`,children:(0,$.jsx)(p,{id:`WFEbV1`,components:{0:(0,$.jsx)(`a`,{href:`https://github.com/DavidAnson/markdownlint`,target:`_blank`,rel:`noopener noreferrer`,onClick:mi,onAuxClick:pi,className:`inline-flex items-center gap-0.5 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline`}),1:(0,$.jsx)(jt,{"aria-hidden":!0,className:`size-3`})}})}),t[2]=i):i=t[2];let a;return t[3]===r?a=t[4]:(a=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-plugin-markdownlint-title`,className:`space-y-4`,"data-testid":`settings-plugin-markdownlint`,children:[i,(0,$.jsx)(le,{initialRuleQuery:r})]}),t[3]=r,t[4]=a),a}function pi(e){return Cn(e,`https://github.com/DavidAnson/markdownlint`)}function mi(e){return Cn(e,`https://github.com/DavidAnson/markdownlint`)}var hi={markdownlint:fi},gi=ue.map(e=>({...e,Section:hi[e.id]})),_i=e(t(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}var r=``,i=` `,a=`\\`,o=/^\s+$/,s=/(?:[^\\]|^)\\$/,c=/^\\!/,l=/^\\#/,u=/\r?\n/g,d=/^\.*\/|^\.+$/,f=`/`,p=`node-ignore`;typeof Symbol<`u`&&(p=Symbol.for(`node-ignore`));var m=p,h=(e,t,n)=>Object.defineProperty(e,t,{value:n}),g=/([0-z])-([0-z])/g,_=()=>!1,v=e=>e.replace(g,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:r),y=e=>{let{length:t}=e;return e.slice(0,t-t%2)},b=[[/^\uFEFF/,()=>r],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?i:r)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+i}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>a],[/\\\\/g,()=>a],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===a?`\\[${n}${y(r)}${i}`:i===`]`&&r.length%2==0?`[${v(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],x=Object.create(null),S=(e,t)=>{let n=x[e];return n||(n=b.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),x[e]=n),t?new RegExp(n,`i`):new RegExp(n)},C=e=>typeof e==`string`,w=e=>e&&C(e)&&!o.test(e)&&!s.test(e)&&e.indexOf(`#`)!==0,T=e=>e.split(u),E=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}},D=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(c,`!`).replace(l,`#`);let i=S(e,t);return new E(n,e,r,i)},O=(e,t)=>{throw new t(e)},k=(e,t,n)=>C(e)?e?k.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),A=e=>d.test(e);k.isNotRelative=A,k.convert=e=>e;var j=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){h(this,m,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[m]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(w(e)){let t=D(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(C(e)?T(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&k.convert(e);return k(i,e,this._allowRelativePaths?_:O),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(f),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(f)+f,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},M=e=>new j(e);if(M.isPathValid=e=>k(e&&k.convert(e),e,_),M.default=M,t.exports=M,typeof process<`u`&&({}.IGNORE_TEST_WIN32||process.platform===`win32`)){k.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;k.isNotRelative=t=>e.test(t)||A(t)}}))(),1),vi=new Map;function yi(e){let t=vi.get(e);if(t)return vi.delete(e),vi.set(e,t),t;let n=(0,_i.default)();if(n.add(e),vi.set(e,n),vi.size>256){let e=vi.keys().next().value;e!==void 0&&vi.delete(e)}return n}function bi(e,t){let n=e.trim();if(n.length===0||n.startsWith(`#`))return 0;let r=yi(n),i=0;for(let e of t)e.length!==0&&r.ignores(e)&&(i+=1);return i}var xi={"trailing-backslash":`Trailing backslash — line continuation isn't supported.`,"unmatched-bracket":`Unmatched [ — character class is open.`,"lone-bang":`Lone ! — negation needs a pattern after it.`,"leading-whitespace":`Leading whitespace — the rule may not match as expected.`,"embedded-newline":`Embedded line break — the row spans multiple lines.`};function Si(e){let t=[];if(e.length===0||e.trimStart().startsWith(`#`))return t;/[\r\n]/.test(e)&&t.push({code:`embedded-newline`,message:xi[`embedded-newline`]}),/^\s/.test(e)&&t.push({code:`leading-whitespace`,message:xi[`leading-whitespace`]});let n=e.trim();return n===`!`&&t.push({code:`lone-bang`,message:xi[`lone-bang`]}),n.endsWith(`\\`)&&t.push({code:`trailing-backslash`,message:xi[`trailing-backslash`]}),Ci(n,`[`)>Ci(n,`]`)&&t.push({code:`unmatched-bracket`,message:xi[`unmatched-bracket`]}),t}function Ci(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}var wi=`https://openknowledge.ai/docs/features/ignore-patterns`,Ti=1200,Ei=150,Di=150,Oi=5e3,ki=600,Ai=400,ji=`okignore-show-advanced`;function Mi(e){let t=(0,Z.c)(3),{binding:n,synced:r}=e;if(n===null||!r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ni,{}),t[0]=e):e=t[0],e}let i;return t[1]===n?i=t[2]:(i=(0,$.jsx)(Pi,{binding:n}),t[1]=n,t[2]=i),i}function Ni(){let e=(0,Z.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-okignore-title`,className:`space-y-3`,"data-testid":`settings-okignore-skeleton`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`h3`,{id:`settings-okignore-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`3zyg_A`})}),(0,$.jsx)(Tn,{className:`h-4 w-72`})]}),(0,$.jsx)(Tn,{className:`h-20 w-full`})]}),e[0]=t):t=e[0],t}function Pi(e){let t=(0,Z.c)(72),{binding:n}=e,{_:r}=m(),i;t[0]===n?i=t[1]:(i=()=>n.current(),t[0]=n,t[1]=i);let[a,o]=(0,Q.useState)(i),s,c;t[2]===n?(s=t[3],c=t[4]):(s=()=>n.subscribe(e=>{o(e)}),c=[n],t[2]=n,t[3]=s,t[4]=c),(0,Q.useEffect)(s,c);let{pages:l,pageMeta:u,assetPaths:d}=Ft(),f;t[5]!==d||t[6]!==u||t[7]!==l?(f=ta(l,u,d),t[5]=d,t[6]=u,t[7]=l,t[8]=f):f=t[8];let h=f,g,_;t[9]===a?(g=t[10],_=t[11]):(g=Ee(a),_=Ae(g),t[9]=a,t[10]=g,t[11]=_);let v=_,y=v.length===0,[b,x]=(0,Q.useState)(null),S=(0,Q.useRef)(null),C,w;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>()=>{S.current&&clearTimeout(S.current)},w=[],t[12]=C,t[13]=w):(C=t[12],w=t[13]),(0,Q.useEffect)(C,w);let T;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{x({key:e,ts:Date.now()}),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>x(null),Ti)},t[14]=T):T=t[14];let E=T,[D,O]=(0,Q.useState)(null),k=(0,Q.useRef)(null),A,j;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>()=>{k.current&&clearTimeout(k.current)},A=[],t[15]=A,t[16]=j):(A=t[15],j=t[16]),(0,Q.useEffect)(j,A);let M,N;t[17]===n?(M=t[18],N=t[19]):(M=()=>Se(e=>{e.docName===`__config__/okignore`&&n.notifyRejection(e.error)}),N=[n],t[17]=n,t[18]=M,t[19]=N),(0,Q.useEffect)(M,N);let P,F;t[20]===n?(P=t[21],F=t[22]):(P=()=>n.subscribeRejection(e=>{let{error:t}=e,n=Zi(t);O({message:n?.detail??pt(t),lineNumber:n?.lineNumber,ts:Date.now()}),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>O(null),Oi)}),F=[n],t[20]=n,t[21]=P,t[22]=F),(0,Q.useEffect)(P,F);let I,L;t[23]===r?(I=t[24],L=t[25]):(I=()=>ke(e=>{let{path:t}=e;X.error(r({id:`3oh0nQ`,values:{path:t}}),{description:e.error,id:`okignore-nested-error:${e.path}`,duration:8e3})}),L=[r],t[23]=r,t[24]=I,t[25]=L),(0,Q.useEffect)(I,L);let R;t[26]===n?R=t[27]:(R=e=>{n.patch(e)},t[26]=n,t[27]=R);let z=R,B;t[28]!==z||t[29]!==g||t[30]!==v?(B=(e,t)=>{let n=t.trim(),r=v[e];if(r&&n!==r.text){if(n.length===0){z(pe(xe(g,e)));return}z(pe(ve(g,e,n))),E(Xi(n,e))}},t[28]=z,t[29]=g,t[30]=v,t[31]=B):B=t[31];let V=B,H;t[32]!==z||t[33]!==g?(H=e=>{z(pe(xe(g,e)))},t[32]=z,t[33]=g,t[34]=H):H=t[34];let U=H,W;t[35]!==z||t[36]!==g||t[37]!==v.length?(W=e=>{let t=e.trim();if(t.length===0)return;let n=ye(g,t);if(n>=0){E(Xi(t,n));return}z(pe(Ne(g,t))),E(Xi(t,v.length))},t[35]=z,t[36]=g,t[37]=v.length,t[38]=W):W=t[38];let ee=W,G;t[39]!==z||t[40]!==g?(G=e=>{let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=Yi(t),i=Yi(n);r<0||i<0||r===i||z(pe(be(g,r,i)))},t[39]=z,t[40]=g,t[41]=G):G=t[41];let K=G,te;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(te={activationConstraint:{distance:4}},t[42]=te):te=t[42];let ne;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ne={coordinateGetter:kn},t[43]=ne):ne=t[43];let re=Nn(On(In,te),On(An,ne)),ie=D===null?null:`rejection-${D.ts}`,[q,ae]=ia(),J;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(`h3`,{id:`settings-okignore-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`3zyg_A`})}),t[44]=J):J=t[44];let oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[J,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`Z5h97D`,components:{0:(0,$.jsx)(`a`,{href:wi,target:`_blank`,rel:`noreferrer noopener`,className:`text-primary underline-offset-2 hover:underline`,"data-testid":`settings-okignore-primer`})}})})]}),t[45]=oe):oe=t[45];let Y;t[46]===D?Y=t[47]:(Y=D===null?null:(0,$.jsx)(Li,{rejection:D}),t[46]=D,t[47]=Y);let se;t[48]!==n||t[49]!==h||t[50]!==ee||t[51]!==K||t[52]!==V||t[53]!==U||t[54]!==y||t[55]!==v||t[56]!==ie||t[57]!==b||t[58]!==re||t[59]!==q||t[60]!==a?(se=q?(0,$.jsx)(Fi,{binding:n,text:a}):y?(0,$.jsx)(Ri,{onAdd:ee,rejectionFlashKey:ie,filePaths:h}):(0,$.jsx)(zi,{patterns:v,sensors:re,onDragEnd:K,onEdit:V,onRemove:U,onAdd:ee,savedFlash:b,rejectionFlashKey:ie,filePaths:h}),t[48]=n,t[49]=h,t[50]=ee,t[51]=K,t[52]=V,t[53]=U,t[54]=y,t[55]=v,t[56]=ie,t[57]=b,t[58]=re,t[59]=q,t[60]=a,t[61]=se):se=t[61];let ce;t[62]!==ae||t[63]!==q?(ce=()=>ae(!q),t[62]=ae,t[63]=q,t[64]=ce):ce=t[64];let le;t[65]!==q||t[66]!==ce?(le=(0,$.jsx)(`div`,{className:`flex justify-end`,children:(0,$.jsx)(Ii,{enabled:q,onToggle:ce})}),t[65]=q,t[66]=ce,t[67]=le):le=t[67];let ue;return t[68]!==Y||t[69]!==se||t[70]!==le?(ue=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-okignore-title`,className:`space-y-3`,"data-testid":`settings-okignore-section`,children:[oe,Y,se,le]}),t[68]=Y,t[69]=se,t[70]=le,t[71]=ue):ue=t[71],ue}function Fi(e){let t=(0,Z.c)(31),{binding:n,text:r}=e,{_:i}=m(),[a,o]=(0,Q.useState)(r),s=(0,Q.useRef)(r),c=(0,Q.useRef)(!1),l=(0,Q.useRef)(r),u=(0,Q.useRef)(null),d,f;t[0]===r?(d=t[1],f=t[2]):(d=()=>{c.current||r!==s.current&&(o(r),l.current=r,s.current=r)},f=[r],t[0]=r,t[1]=d,t[2]=f),(0,Q.useEffect)(d,f);let p,h;t[3]===a?(p=t[4],h=t[5]):(p=()=>{l.current=a},h=[a],t[3]=a,t[4]=p,t[5]=h),(0,Q.useEffect)(p,h);let g,_;t[6]===n?(g=t[7],_=t[8]):(g=()=>()=>{u.current&&(clearTimeout(u.current),u.current=null,l.current!==s.current&&(n.patch(l.current),s.current=l.current))},_=[n],t[6]=n,t[7]=g,t[8]=_),(0,Q.useEffect)(g,_);let v;t[9]===n?v=t[10]:(v=e=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,e!==s.current&&(s.current=e,n.patch(e))},Ai)},t[9]=n,t[10]=v);let y=v,b;t[11]===n?b=t[12]:(b=()=>{u.current&&=(clearTimeout(u.current),null),l.current!==s.current&&(s.current=l.current,n.patch(l.current))},t[11]=n,t[12]=b);let x=b,S;t[13]===y?S=t[14]:(S=e=>{o(e.target.value),y(e.target.value)},t[13]=y,t[14]=S);let C;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{c.current=!0},t[15]=C):C=t[15];let w;t[16]===x?w=t[17]:(w=()=>{c.current=!1,x()},t[16]=x,t[17]=w);let T;t[18]===a?T=t[19]:(T=a.split(`
|
|
7
|
+
`),t[18]=a,t[19]=T);let E=Math.max(6,Math.min(20,T.length+1)),D;t[20]===i?D=t[21]:(D=i({id:`rssK8c`}),t[20]=i,t[21]=D);let O;t[22]===i?O=t[23]:(O=i({id:`AeHuzT`}),t[22]=i,t[23]=O);let k;return t[24]!==a||t[25]!==w||t[26]!==E||t[27]!==D||t[28]!==O||t[29]!==S?(k=(0,$.jsx)(`textarea`,{value:a,onChange:S,onFocus:C,onBlur:w,spellCheck:!1,rows:E,"aria-label":D,placeholder:O,className:`min-h-32 w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-xs outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,"data-testid":`settings-okignore-advanced-textarea`}),t[24]=a,t[25]=w,t[26]=E,t[27]=D,t[28]=O,t[29]=S,t[30]=k):k=t[30],k}function Ii(e){let t=(0,Z.c)(6),{enabled:n,onToggle:r}=e,i;t[0]===n?i=t[1]:(i=n?(0,$.jsx)(p,{id:`9PQysm`}):(0,$.jsx)(p,{id:`Nv3mUj`}),t[0]=n,t[1]=i);let a;return t[2]!==n||t[3]!==r||t[4]!==i?(a=(0,$.jsx)(C,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,"aria-pressed":n,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,"data-testid":`settings-okignore-show-advanced-toggle`,children:i}),t[2]=n,t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function Li(e){let t=(0,Z.c)(7),{rejection:n}=e,{_:r}=m(),{lineNumber:i,message:a}=n,o;t[0]!==r||t[1]!==i||t[2]!==a?(o=r(i===void 0?{id:`G7-rf8`,values:{message:a}}:{id:`P3NS4G`,values:{lineNumber:i,message:a}}),t[0]=r,t[1]=i,t[2]=a,t[3]=o):o=t[3];let s=o,c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(rn,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0`}),t[4]=c):c=t[4];let l;return t[5]===s?l=t[6]:(l=(0,$.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":`settings-okignore-rejection-banner`,className:`flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive animate-in fade-in`,children:[c,(0,$.jsx)(`span`,{children:s})]}),t[5]=s,t[6]=l),l}function Ri(e){let t=(0,Z.c)(8),{onAdd:n,rejectionFlashKey:r,filePaths:i}=e,{_:a}=m(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`makN88`})}),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=a({id:`Gx0VS1`}),t[1]=a,t[2]=s);let c;return t[3]!==i||t[4]!==n||t[5]!==r||t[6]!==s?(c=(0,$.jsxs)(`div`,{className:`space-y-3 rounded-md border border-dashed p-4`,"data-testid":`settings-okignore-empty`,children:[o,(0,$.jsx)(Ui,{onAdd:n,placeholder:s,rejectionFlashKey:r,filePaths:i})]}),t[3]=i,t[4]=n,t[5]=r,t[6]=s,t[7]=c):c=t[7],c}function zi(e){let t=(0,Z.c)(35),{patterns:n,sensors:r,onDragEnd:i,onEdit:a,onRemove:o,onAdd:s,savedFlash:c,rejectionFlashKey:l,filePaths:u}=e,{_:d}=m(),f;t[0]===n?f=t[1]:(f=n.map(Bi),t[0]=n,t[1]=f);let p=f,h;t[2]===d?h=t[3]:(h=d({id:`3zyg_A`}),t[2]=d,t[3]=h);let g;if(t[4]!==u||t[5]!==a||t[6]!==o||t[7]!==n||t[8]!==c){let e;t[10]!==u||t[11]!==a||t[12]!==o||t[13]!==c?(e=(e,t)=>{let n=Xi(e.text,t),r=c!==null&&c.key===n;return(0,$.jsx)(Vi,{sortableId:Ji(t),patternIndex:t,pattern:e,onEdit:a,onRemove:o,flashActive:r,filePaths:u},Ji(t))},t[10]=u,t[11]=a,t[12]=o,t[13]=c,t[14]=e):e=t[14],g=n.map(e),t[4]=u,t[5]=a,t[6]=o,t[7]=n,t[8]=c,t[9]=g}else g=t[9];let _;t[15]!==h||t[16]!==g?(_=(0,$.jsx)(`ul`,{"aria-label":h,className:`divide-y rounded-md border`,"data-testid":`settings-okignore-list`,children:g}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==p||t[19]!==_?(v=(0,$.jsx)(Fn,{items:p,strategy:Mn,children:_}),t[18]=p,t[19]=_,t[20]=v):v=t[20];let y;t[21]!==i||t[22]!==r||t[23]!==v?(y=(0,$.jsx)(Pn,{sensors:r,collisionDetection:Dn,onDragEnd:i,children:v}),t[21]=i,t[22]=r,t[23]=v,t[24]=y):y=t[24];let b;t[25]===d?b=t[26]:(b=d({id:`cZGNlb`}),t[25]=d,t[26]=b);let x;t[27]!==u||t[28]!==s||t[29]!==l||t[30]!==b?(x=(0,$.jsx)(Ui,{onAdd:s,placeholder:b,rejectionFlashKey:l,filePaths:u}),t[27]=u,t[28]=s,t[29]=l,t[30]=b,t[31]=x):x=t[31];let S;return t[32]!==y||t[33]!==x?(S=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[y,x]}),t[32]=y,t[33]=x,t[34]=S):S=t[34],S}function Bi(e,t){return Ji(t)}function Vi(e){let t=(0,Z.c)(47),{sortableId:n,patternIndex:r,pattern:i,onEdit:a,onRemove:o,flashActive:s,filePaths:c}=e,{_:l}=m(),u;t[0]===n?u=t[1]:(u={id:n},t[0]=n,t[1]=u);let{attributes:d,listeners:f,setNodeRef:p,transform:h,transition:g,isDragging:_}=En(u),v=i.text,y;t[2]===h?y=t[3]:(y=jn.Transform.toString(h),t[2]=h,t[3]=y);let b=_?.5:void 0,x=_?1:void 0,S;t[4]!==y||t[5]!==b||t[6]!==x||t[7]!==g?(S={transform:y,transition:g,opacity:b,zIndex:x},t[4]=y,t[5]=b,t[6]=x,t[7]=g,t[8]=S):S=t[8];let w=S,T;t[9]!==l||t[10]!==v?(T=l({id:`7_bFEL`,values:{patternText:v}}),t[9]=l,t[10]=v,t[11]=T):T=t[11];let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(Zt,{className:`size-3.5`}),t[12]=E):E=t[12];let D;t[13]!==d||t[14]!==f||t[15]!==T?(D=(0,$.jsx)(C,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`settings-okignore-drag-handle`,"aria-label":T,...d,...f,className:`h-7 w-4 shrink-0 cursor-grab touch-none px-0 text-muted-foreground/40 hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing`,children:E}),t[13]=d,t[14]=f,t[15]=T,t[16]=D):D=t[16];let O;t[17]!==a||t[18]!==r?(O=e=>a(r,e),t[17]=a,t[18]=r,t[19]=O):O=t[19];let k;t[20]!==c||t[21]!==i.text||t[22]!==r||t[23]!==O?(k=(0,$.jsx)(Hi,{patternIndex:r,initialText:i.text,onCommit:O,filePaths:c}),t[20]=c,t[21]=i.text,t[22]=r,t[23]=O,t[24]=k):k=t[24];let A;t[25]===s?A=t[26]:(A=(0,$.jsx)(qi,{visible:s}),t[25]=s,t[26]=A);let j;t[27]!==l||t[28]!==v?(j=l({id:`S9Vnum`,values:{patternText:v}}),t[27]=l,t[28]=v,t[29]=j):j=t[29];let M;t[30]!==o||t[31]!==r?(M=()=>o(r),t[30]=o,t[31]=r,t[32]=M):M=t[32];let N;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(an,{className:`size-3.5`}),t[33]=N):N=t[33];let P;t[34]!==j||t[35]!==M?(P=(0,$.jsx)(C,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`settings-okignore-remove`,"aria-label":j,onClick:M,className:`h-7 w-7 shrink-0 text-muted-foreground hover:text-destructive`,children:N}),t[34]=j,t[35]=M,t[36]=P):P=t[36];let F;t[37]!==k||t[38]!==A||t[39]!==P||t[40]!==D?(F=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[D,k,A,P]}),t[37]=k,t[38]=A,t[39]=P,t[40]=D,t[41]=F):F=t[41];let I;return t[42]!==r||t[43]!==p||t[44]!==w||t[45]!==F?(I=(0,$.jsx)(`li`,{ref:p,style:w,className:`flex flex-col gap-0.5 px-2 py-1.5`,"data-testid":`settings-okignore-row`,"data-pattern-index":r,children:F}),t[42]=r,t[43]=p,t[44]=w,t[45]=F,t[46]=I):I=t[46],I}function Hi(e){let t=(0,Z.c)(31),{patternIndex:n,initialText:r,onCommit:i,filePaths:a}=e,{_:o}=m(),[s,c]=(0,Q.useState)(r),l=(0,Q.useRef)(r),u=(0,Q.useRef)(!1),d,f;t[0]===r?(d=t[1],f=t[2]):(d=()=>{u.current||r!==l.current&&(c(r),l.current=r)},f=[r],t[0]=r,t[1]=d,t[2]=f),(0,Q.useEffect)(d,f);let p=Qi(s),h=$i(s,a),g=n+1,_;t[3]!==s||t[4]!==i?(_=()=>{s!==l.current&&(l.current=s,i(s))},t[3]=s,t[4]=i,t[5]=_):_=t[5];let v=_,y,b;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>c(e.target.value),b=()=>{u.current=!0},t[6]=y,t[7]=b):(y=t[6],b=t[7]);let x;t[8]===v?x=t[9]:(x=()=>{u.current=!1,v()},t[8]=v,t[9]=x);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),c(l.current),e.currentTarget.blur())},t[10]=S):S=t[10];let C;t[11]!==o||t[12]!==g?(C=o({id:`-YV1Uo`,values:{patternNumber:g}}),t[11]=o,t[12]=g,t[13]=C):C=t[13];let w=p.length>0?`border-amber-500/60 focus-visible:ring-amber-500/40`:``,E;t[14]===w?E=t[15]:(E=T(`h-7 flex-1 font-mono text-xs`,w),t[14]=w,t[15]=E);let D;t[16]!==s||t[17]!==E||t[18]!==x||t[19]!==C?(D=(0,$.jsx)(on,{value:s,onChange:y,onFocus:b,onBlur:x,onKeyDown:S,"aria-label":C,className:E,"data-testid":`settings-okignore-row-input`}),t[16]=s,t[17]=E,t[18]=x,t[19]=C,t[20]=D):D=t[20];let O;t[21]===p?O=t[22]:(O=(0,$.jsx)(Wi,{warnings:p}),t[21]=p,t[22]=O);let k;t[23]!==D||t[24]!==O?(k=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[D,O]}),t[23]=D,t[24]=O,t[25]=k):k=t[25];let A;t[26]===h?A=t[27]:(A=(0,$.jsx)(ea,{count:h}),t[26]=h,t[27]=A);let j;return t[28]!==k||t[29]!==A?(j=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[k,A]}),t[28]=k,t[29]=A,t[30]=j):j=t[30],j}function Ui(e){let t=(0,Z.c)(34),{onAdd:n,placeholder:r,rejectionFlashKey:i,filePaths:a}=e,{_:o}=m(),[s,c]=(0,Q.useState)(``),l=Qi(s),u=$i(s,a),d=oa(i),f;t[0]!==n||t[1]!==s?(f=()=>{let e=s.trim();e.length!==0&&(n(e),c(``))},t[0]=n,t[1]=s,t[2]=f):f=t[2];let h=f,g;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>c(e.target.value),t[3]=g):g=t[3];let _;t[4]===h?_=t[5]:(_=e=>{e.key===`Enter`&&(e.preventDefault(),h())},t[4]=h,t[5]=_);let v;t[6]===o?v=t[7]:(v=o({id:`p9sdCy`}),t[6]=o,t[7]=v);let y=d?`border-destructive ring-2 ring-destructive/30 focus-visible:ring-destructive/50`:l.length>0?`border-amber-500/60 focus-visible:ring-amber-500/40`:``,b;t[8]===y?b=t[9]:(b=T(`h-8 text-sm`,y),t[8]=y,t[9]=b);let x=d?`true`:void 0,S;t[10]!==s||t[11]!==r||t[12]!==_||t[13]!==v||t[14]!==b||t[15]!==x?(S=(0,$.jsx)(on,{value:s,onChange:g,onKeyDown:_,placeholder:r,"aria-label":v,className:b,"data-testid":`settings-okignore-add-input`,"data-rejection-flashing":x}),t[10]=s,t[11]=r,t[12]=_,t[13]=v,t[14]=b,t[15]=x,t[16]=S):S=t[16];let w;t[17]===l?w=t[18]:(w=(0,$.jsx)(Wi,{warnings:l}),t[17]=l,t[18]=w);let E;t[19]===s?E=t[20]:(E=s.trim(),t[19]=s,t[20]=E);let D=E.length===0,O;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(p,{id:`BY-g4_`}),t[21]=O):O=t[21];let k;t[22]!==h||t[23]!==D?(k=(0,$.jsx)(C,{size:`sm`,onClick:h,disabled:D,"data-testid":`settings-okignore-add-button`,children:O}),t[22]=h,t[23]=D,t[24]=k):k=t[24];let A;t[25]!==k||t[26]!==S||t[27]!==w?(A=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[S,w,k]}),t[25]=k,t[26]=S,t[27]=w,t[28]=A):A=t[28];let j;t[29]===u?j=t[30]:(j=(0,$.jsx)(ea,{count:u}),t[29]=u,t[30]=j);let M;return t[31]!==A||t[32]!==j?(M=(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5`,"data-testid":`settings-okignore-add`,children:[A,j]}),t[31]=A,t[32]=j,t[33]=M):M=t[33],M}function Wi(e){let t=(0,Z.c)(31),{warnings:n}=e,{_:r}=m();if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`flex w-4 shrink-0 justify-center`,"data-testid":`settings-okignore-warning-indicator`,"data-warnings":`0`}),t[0]=e):e=t[0],e}let i,a,o,s,c,l,u;t[1]!==r||t[2]!==n?(o=n.map(Ki).join(` `),a=O,i=E,u=!0,s=`status`,c=`polite`,l=r({id:`NORKZU`,values:{summary:o}}),t[1]=r,t[2]=n,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u):(i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9]);let d=String(n.length),f;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(rn,{"aria-hidden":`true`,className:`size-3.5`}),t[10]=f):f=t[10];let p;t[11]===o?p=t[12]:(p=(0,$.jsx)(`span`,{className:`sr-only`,children:o}),t[11]=o,t[12]=p);let h;t[13]!==s||t[14]!==c||t[15]!==l||t[16]!==d||t[17]!==p?(h=(0,$.jsxs)(`span`,{role:s,"aria-live":c,"aria-label":l,className:`flex w-4 shrink-0 cursor-help justify-center text-amber-500`,"data-testid":`settings-okignore-warning-indicator`,"data-warnings":d,children:[f,p]}),t[13]=s,t[14]=c,t[15]=l,t[16]=d,t[17]=p,t[18]=h):h=t[18];let g;t[19]!==i||t[20]!==u||t[21]!==h?(g=(0,$.jsx)(i,{asChild:u,children:h}),t[19]=i,t[20]=u,t[21]=h,t[22]=g):g=t[22];let _;t[23]===n?_=t[24]:(_=n.map(Gi),t[23]=n,t[24]=_);let v;t[25]===_?v=t[26]:(v=(0,$.jsx)(D,{side:`top`,className:`max-w-xs`,children:(0,$.jsx)(`ul`,{className:`list-disc space-y-1 pl-4`,children:_})}),t[25]=_,t[26]=v);let y;return t[27]!==a||t[28]!==v||t[29]!==g?(y=(0,$.jsxs)(a,{children:[g,v]}),t[27]=a,t[28]=v,t[29]=g,t[30]=y):y=t[30],y}function Gi(e){return(0,$.jsx)(`li`,{children:e.message},e.code)}function Ki(e){return e.message}function qi(e){let t=(0,Z.c)(4),{visible:n}=e,r;t[0]===n?r=t[1]:(r=n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Nt,{"aria-hidden":`true`,className:`size-3.5`}),(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(p,{id:`idD8Ev`})})]}):null,t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`flex w-4 shrink-0 justify-center text-emerald-600`,"data-testid":`settings-okignore-saved-indicator`,children:r}),t[2]=r,t[3]=i),i}function Ji(e){return`okignore-pattern-${e}`}function Yi(e){let t=e.match(/^okignore-pattern-(\d+)$/);if(!t)return-1;let n=Number.parseInt(t[1]??``,10);return Number.isNaN(n)?-1:n}function Xi(e,t){return`${t}::${e}`}function Zi(e){return!at(e)||e.code!==`OKIGNORE_INVALID`?null:{detail:e.detail,lineNumber:e.lineNumber}}function Qi(e){let t=(0,Z.c)(5),n;t[0]===e?n=t[1]:(n=()=>e.length===0?[]:Si(e),t[0]=e,t[1]=n);let[r,i]=(0,Q.useState)(n),a,o;return t[2]===e?(a=t[3],o=t[4]):(a=()=>{if(e.length===0){i([]);return}let t=setTimeout(()=>{i(Si(e))},Ei);return()=>clearTimeout(t)},o=[e],t[2]=e,t[3]=a,t[4]=o),(0,Q.useEffect)(a,o),r}function $i(e,t){let n=(0,Z.c)(9),r;n[0]===e?r=n[1]:(r=e.trim(),n[0]=e,n[1]=r);let i=r,a;n[2]!==t||n[3]!==i?(a=()=>i.length===0?null:bi(i,t),n[2]=t,n[3]=i,n[4]=a):a=n[4];let[o,s]=(0,Q.useState)(a),c,l;return n[5]!==t||n[6]!==i?(c=()=>{if(i.length===0){s(null);return}let e=setTimeout(()=>{s(bi(i,t))},Di);return()=>clearTimeout(e)},l=[i,t],n[5]=t,n[6]=i,n[7]=c,n[8]=l):(c=n[7],l=n[8]),(0,Q.useEffect)(c,l),o}function ea(e){let t=(0,Z.c)(12),{count:n}=e;if(n===null){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`block h-3.5`,"data-testid":`settings-okignore-preview`,"data-preview-state":`hidden`}),t[0]=e):e=t[0],e}let r=n===0,i=String(n),a=r?`text-muted-foreground/70`:`text-muted-foreground`,o;t[1]===a?o=t[2]:(o=T(`block text-xs`,a),t[1]=a,t[2]=o);let s;t[3]===n?s=t[4]:(s=(0,$.jsx)(p,{id:`-3Qbv7`,values:{count:n}}),t[3]=n,t[4]=s);let c;t[5]===r?c=t[6]:(c=r?(0,$.jsx)(`span`,{className:`ml-1 text-muted-foreground/60`,children:(0,$.jsx)(p,{id:`5kWklo`})}):null,t[5]=r,t[6]=c);let l;return t[7]!==i||t[8]!==o||t[9]!==s||t[10]!==c?(l=(0,$.jsxs)(`span`,{role:`status`,"aria-live":`polite`,"data-testid":`settings-okignore-preview`,"data-preview-state":`visible`,"data-preview-count":i,className:o,children:[s,c]}),t[7]=i,t[8]=o,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function ta(e,t,n){let r=[];for(let n of e){let e=t.get(n)?.docExt??`.md`;r.push(n+e)}for(let e of n)r.push(e);return r}function na(){try{return globalThis.localStorage?.getItem(ji)===`true`}catch{return!1}}function ra(e){try{globalThis.localStorage?.setItem(ji,e?`true`:`false`)}catch(e){console.debug(`[OkignoreSection] localStorage unavailable; advanced toggle will not persist:`,e)}}function ia(){let e=(0,Z.c)(3),[t,n]=(0,Q.useState)(aa),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=e=>{n(e),ra(e)},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a=[t,i],e[1]=t,e[2]=a),a}function aa(){return na()}function oa(e){let t=(0,Z.c)(3),[n,r]=(0,Q.useState)(!1),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(e===null)return;r(!0);let t=setTimeout(()=>r(!1),ki);return()=>clearTimeout(t)},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function sa(e){return`editor:${e}`}var ca=`skill`;function la(e){let t=(0,Z.c)(11),{testId:n,children:r}=e,{_:i}=m(),a;t[0]===i?a=t[1]:(a=i({id:`2B6eYX`}),t[0]=i,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(en,{className:`size-3.5`}),t[2]=o):o=t[2];let s;t[3]!==a||t[4]!==n?(s=(0,$.jsx)(E,{asChild:!0,children:(0,$.jsx)(C,{variant:`ghost`,size:`icon`,className:`mt-1.5 mr-1.5 h-6 w-6 shrink-0 text-muted-foreground opacity-60 hover:opacity-100`,"aria-label":a,"data-testid":n,children:o})}),t[3]=a,t[4]=n,t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=(0,$.jsx)(D,{side:`left`,className:`max-w-sm text-left`,children:(0,$.jsx)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:r})}),t[6]=r,t[7]=c);let l;return t[8]!==s||t[9]!==c?(l=(0,$.jsxs)(O,{children:[s,c]}),t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function ua(e){let t=(0,Z.c)(5),{followUp:n,testId:r}=e;if(n===`none`)return null;let i;t[0]===n?i=t[1]:(i=n===`approve-once`?(0,$.jsx)(p,{id:`HTW0Zw`,components:{0:(0,$.jsx)(`code`,{className:`inline-code`})}}):n===`enable-manually`?(0,$.jsx)(p,{id:`NNJsn7`}):(0,$.jsx)(p,{id:`n8DwqQ`}),t[0]=n,t[1]=i);let a;return t[2]!==i||t[3]!==r?(a=(0,$.jsx)(`span`,{role:`status`,className:`text-xs text-amber-600 dark:text-amber-400`,"data-testid":r,children:i}),t[2]=i,t[3]=r,t[4]=a):a=t[4],a}function da(){let e=(0,Z.c)(29),{_:t}=m(),n=typeof window<`u`?window.okDesktop??null:null,[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),l,u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{if(!n)return;let e=!1;return n.projectIntegrations.status().then(t=>{e||i(t)}).catch(()=>{e||o(!0)}),()=>{e=!0}},u=[n],e[0]=l,e[1]=u):(l=e[0],u=e[1]),(0,Q.useEffect)(l,u);let d;e[2]===t?d=e[3]:(d=async function(e,r){if(n){c(e.kind===`editor`?sa(e.id):ca);try{let t=await n.projectIntegrations.setComponent({component:e,enabled:r});i(t.status),t.ok||X.error(t.error)}catch(e){let n=e;X.error(t({id:`gfdqcY`,values:{0:n instanceof Error?n.message:String(n)}}))}c(null)}},e[2]=t,e[3]=d);let f=d,h;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`h3`,{id:`settings-project-ai-tools-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`crqzW5`})}),e[4]=h):h=e[4];let g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[h,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`ZYtq3m`})})]}),e[5]=g):g=e[5];let _=g;if(!n||a){let t;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-project-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`project-ai-tools-unavailable`,children:(0,$.jsx)(p,{id:`g4WlQK`})})]}),e[6]=t):t=e[6],t}if(r===null){let t;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-project-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsxs)(`div`,{className:`space-y-2`,"data-testid":`project-ai-tools-loading`,children:[(0,$.jsx)(Tn,{className:`h-10 w-full`}),(0,$.jsx)(Tn,{className:`h-10 w-full`})]})]}),e[7]=t):t=e[7],t}if(!r.hasProject){let t;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-project-ai-tools-title`,className:`space-y-4`,children:[_,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,"data-testid":`project-ai-tools-no-project`,children:(0,$.jsx)(p,{id:`yaPGPa`})})]}),e[8]=t):t=e[8],t}let v=s!==null||!r.available,y;e[9]===r.available?y=e[10]:(y=!r.available&&(0,$.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,"data-testid":`project-ai-tools-read-only`,children:(0,$.jsx)(p,{id:`_NX6gG`})}),e[9]=r.available,e[10]=y);let b;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(p,{id:`psfGPX`})}),e[11]=b):b=e[11];let x;if(e[12]!==f||e[13]!==v||e[14]!==r.editors){let t;e[16]!==f||e[17]!==v?(t=e=>(0,$.jsx)(pa,{editor:e,busy:v,onToggle:t=>void f({kind:`editor`,id:e.id},t)},e.id),e[16]=f,e[17]=v,e[18]=t):t=e[18],x=r.editors.map(t),e[12]=f,e[13]=v,e[14]=r.editors,e[15]=x}else x=e[15];let S;e[19]===x?S=e[20]:(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[b,(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 divide-y divide-border overflow-hidden`,children:x})]}),e[19]=x,e[20]=S);let C;e[21]!==f||e[22]!==v||e[23]!==r.skill?(C=r.skill!==null&&(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:(0,$.jsx)(p,{id:`LtiJ5c`})}),(0,$.jsx)(`ul`,{className:`rounded-md border border-border bg-card/50 overflow-hidden`,children:(0,$.jsxs)(`li`,{className:`flex items-start hover:bg-accent`,children:[(0,$.jsxs)(W,{htmlFor:`project-ai-tools-skill`,className:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,children:[(0,$.jsx)(B,{id:`project-ai-tools-skill`,checked:r.skill.installed,disabled:v,onCheckedChange:()=>void f({kind:`skill`},!r.skill?.installed),className:`mt-0.5`,"data-testid":`project-ai-tools-skill-checkbox`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:(0,$.jsx)(`code`,{children:`open-knowledge`})}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,$.jsx)(p,{id:`khCa4M`})})]})]}),(0,$.jsxs)(la,{testId:`project-ai-tools-skill-info`,children:[(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(p,{id:`HSh8u_`})}),r.skill.paths.map(fa)]})]})})]}),e[21]=f,e[22]=v,e[23]=r.skill,e[24]=C):C=e[24];let w;return e[25]!==y||e[26]!==S||e[27]!==C?(w=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-project-ai-tools-title`,className:`space-y-4`,children:[_,y,S,C]}),e[25]=y,e[26]=S,e[27]=C,e[28]=w):w=e[28],w}function fa(e){return(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:e})},e)}function pa(e){let t=(0,Z.c)(45),{editor:n,busy:r,onToggle:i}=e,{_:a}=m(),o=n.state===`installed`||n.state===`foreign`,s=r||n.state===`unmanageable`,c;t[0]!==a||t[1]!==n.state?(c=n.state===`installed`?a({id:`eQkgKV`}):n.state===`foreign`?a({id:`AczYxH`}):n.state===`unmanageable`?a({id:`CXTwen`}):null,t[0]=a,t[1]=n.state,t[2]=c):c=t[2];let l=c,u=n.state===`foreign`||n.state===`unmanageable`?`text-xs text-amber-600 dark:text-amber-400`:`text-xs text-muted-foreground`,d=s?`flex items-start`:`flex items-start hover:bg-accent`,f=`project-ai-tools-editor-${n.id}`,h=s?`flex flex-1 items-start gap-2.5 px-3 py-2.5 font-normal`:`flex flex-1 cursor-pointer items-start gap-2.5 px-3 py-2.5 font-normal`,g=`project-ai-tools-editor-${n.id}`,_;t[3]!==o||t[4]!==i?(_=()=>i(!o),t[3]=o,t[4]=i,t[5]=_):_=t[5];let v=`project-ai-tools-editor-checkbox-${n.id}`,y;t[6]!==o||t[7]!==s||t[8]!==g||t[9]!==_||t[10]!==v?(y=(0,$.jsx)(B,{id:g,checked:o,disabled:s,onCheckedChange:_,className:`mt-0.5`,"data-testid":v}),t[6]=o,t[7]=s,t[8]=g,t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]===n.label?b=t[13]:(b=(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:n.label}),t[12]=n.label,t[13]=b);let x;t[14]!==n.id||t[15]!==u||t[16]!==l?(x=l!==null&&(0,$.jsx)(`span`,{className:u,"data-testid":`project-ai-tools-editor-status-${n.id}`,children:l}),t[14]=n.id,t[15]=u,t[16]=l,t[17]=x):x=t[17];let S;t[18]!==o||t[19]!==n.followUp||t[20]!==n.id?(S=o&&(0,$.jsx)(ua,{followUp:n.followUp,testId:`project-ai-tools-editor-followup-${n.id}`}),t[18]=o,t[19]=n.followUp,t[20]=n.id,t[21]=S):S=t[21];let C;t[22]!==x||t[23]!==S||t[24]!==b?(C=(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[b,x,S]}),t[22]=x,t[23]=S,t[24]=b,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==f||t[28]!==h||t[29]!==y?(w=(0,$.jsxs)(W,{htmlFor:f,className:h,children:[y,C]}),t[26]=C,t[27]=f,t[28]=h,t[29]=y,t[30]=w):w=t[30];let T=`project-ai-tools-editor-info-${n.id}`,E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(`p`,{className:`opacity-70`,children:(0,$.jsx)(p,{id:`J2eKUI`})}),t[31]=E):E=t[31];let D;t[32]===n.configPath?D=t[33]:(D=(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:n.configPath})}),t[32]=n.configPath,t[33]=D);let O;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(`p`,{className:`pt-1 opacity-70`,children:(0,$.jsx)(p,{id:`VIwCaD`})}),t[34]=O):O=t[34];let k;t[35]===n.entryLocator?k=t[36]:(k=(0,$.jsx)(`p`,{children:(0,$.jsx)(`code`,{className:`break-all`,children:n.entryLocator})}),t[35]=n.entryLocator,t[36]=k);let A;t[37]!==T||t[38]!==D||t[39]!==k?(A=(0,$.jsxs)(la,{testId:T,children:[E,D,O,k]}),t[37]=T,t[38]=D,t[39]=k,t[40]=A):A=t[40];let j;return t[41]!==w||t[42]!==A||t[43]!==d?(j=(0,$.jsxs)(`li`,{className:d,children:[w,A]}),t[41]=w,t[42]=A,t[43]=d,t[44]=j):j=t[44],j}function ma(e){let t=(0,Z.c)(68),{config:n}=e,{state:r,refresh:i}=Me(``),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(!1),u=We(),d;t[0]===u?d=t[1]:(d=function(e,t){$t(l(e,t)),u.close()},t[0]=u,t[1]=d);let f=d,m,h,g,_,v,y,b,x,S;if(t[2]!==n||t[3]!==s||t[4]!==f||t[5]!==i||t[6]!==r){S=Symbol.for(`react.early_return_sentinel`);bb0:{let e=r.status===`ready`?(r.data.folder.templates_available??[]).filter(e=>e.scope===n.scope).sort(ga):[];if(r.status===`error`){let{loadErrorTitle:e}=n,{message:a}=r,o=`settings-${n.testIdPrefix}-section`,l;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>c(!0),t[16]=l):l=t[16];let u;t[17]===n?u=t[18]:(u=(0,$.jsx)(_a,{config:n,onNewClick:l}),t[17]=n,t[18]=u);let d;t[19]!==e||t[20]!==a?(d=(0,$.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,$.jsx)(p,{id:`uH_S-u`,values:{loadErrorTitle:e,message:a}})}),t[19]=e,t[20]=a,t[21]=d):d=t[21];let m;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(m=new Set,t[22]=m):m=t[22];let h;t[23]!==f||t[24]!==i?(h=e=>{i(),f(``,e)},t[23]=f,t[24]=i,t[25]=h):h=t[25];let g;t[26]!==s||t[27]!==h?(g=(0,$.jsx)(J,{folderPath:``,existingNames:m,open:s,onOpenChange:c,onCreated:h}),t[26]=s,t[27]=h,t[28]=g):g=t[28];let _;t[29]!==n.settingsId||t[30]!==o||t[31]!==u||t[32]!==d||t[33]!==g?(_=(0,$.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":n.settingsId,"data-testid":o,children:[u,d,g]}),t[29]=n.settingsId,t[30]=o,t[31]=u,t[32]=d,t[33]=g,t[34]=_):_=t[34],S=_;break bb0}if(r.status===`idle`||r.status===`loading`){let e=`settings-${n.testIdPrefix}-section`,r;t[35]===n?r=t[36]:(r=(0,$.jsx)(_a,{config:n}),t[35]=n,t[36]=r);let i;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`rounded-lg border bg-card p-3 space-y-2`,children:[(0,$.jsx)(Tn,{className:`h-12 w-full`}),(0,$.jsx)(Tn,{className:`h-12 w-full`})]}),t[37]=i):i=t[37];let a;t[38]!==n.settingsId||t[39]!==e||t[40]!==r?(a=(0,$.jsxs)(`section`,{className:`space-y-3`,"aria-labelledby":n.settingsId,"data-testid":e,children:[r,i]}),t[38]=n.settingsId,t[39]=e,t[40]=r,t[41]=a):a=t[41],S=a;break bb0}_=`space-y-3`,v=n.settingsId,y=`settings-${n.testIdPrefix}-section`;let a;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>c(!0),t[42]=a):a=t[42],t[43]===n?b=t[44]:(b=(0,$.jsx)(_a,{config:n,onNewClick:a}),t[43]=n,t[44]=b);let l=e.length===0?(0,$.jsx)(`p`,{className:`px-3 py-4 text-sm text-muted-foreground`,"data-testid":`settings-${n.testIdPrefix}-empty`,children:n.emptyMessage}):(0,$.jsx)(`ul`,{className:`space-y-1 p-2`,"data-testid":`settings-${n.testIdPrefix}-list`,children:e.map(e=>(0,$.jsx)(de,{template:e,onEdit:()=>f(e.source_folder,e.name),onDelete:()=>o(e),badge:(0,$.jsx)(mn,{variant:n.badge.variant,className:`text-2xs`,children:n.badge.label})},e.name))});t[45]===l?x=t[46]:(x=(0,$.jsx)(`div`,{className:`rounded-lg border bg-card`,children:l}),t[45]=l,t[46]=x),m=J,h=``,g=new Set(e.map(ha))}t[2]=n,t[3]=s,t[4]=f,t[5]=i,t[6]=r,t[7]=m,t[8]=h,t[9]=g,t[10]=_,t[11]=v,t[12]=y,t[13]=b,t[14]=x,t[15]=S}else m=t[7],h=t[8],g=t[9],_=t[10],v=t[11],y=t[12],b=t[13],x=t[14],S=t[15];if(S!==Symbol.for(`react.early_return_sentinel`))return S;let C;t[47]!==f||t[48]!==i?(C=e=>{i(),f(``,e)},t[47]=f,t[48]=i,t[49]=C):C=t[49];let w;t[50]!==m||t[51]!==s||t[52]!==C||t[53]!==h||t[54]!==g?(w=(0,$.jsx)(m,{folderPath:h,existingNames:g,open:s,onOpenChange:c,onCreated:C}),t[50]=m,t[51]=s,t[52]=C,t[53]=h,t[54]=g,t[55]=w):w=t[55];let T;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e||o(null)},t[56]=T):T=t[56];let E;t[57]!==a||t[58]!==i?(E=(0,$.jsx)(q,{template:a,onOpenChange:T,onDeleted:i}),t[57]=a,t[58]=i,t[59]=E):E=t[59];let D;return t[60]!==w||t[61]!==E||t[62]!==_||t[63]!==v||t[64]!==y||t[65]!==b||t[66]!==x?(D=(0,$.jsxs)(`section`,{className:_,"aria-labelledby":v,"data-testid":y,children:[b,x,w,E]}),t[60]=w,t[61]=E,t[62]=_,t[63]=v,t[64]=y,t[65]=b,t[66]=x,t[67]=D):D=t[67],D}function ha(e){return e.name}function ga(e,t){return(e.title??e.name).toLowerCase().localeCompare((t.title??t.name).toLowerCase())}function _a(e){let t=(0,Z.c)(14),{config:n,onNewClick:r}=e,i;t[0]!==n.settingsId||t[1]!==n.title?(i=(0,$.jsx)(`h3`,{id:n.settingsId,className:`text-base font-semibold`,children:n.title}),t[0]=n.settingsId,t[1]=n.title,t[2]=i):i=t[2];let a;t[3]===n.description?a=t[4]:(a=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.description}),t[3]=n.description,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=(0,$.jsxs)(`div`,{children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s;t[8]!==n.testIdPrefix||t[9]!==r?(s=r?(0,$.jsxs)(C,{variant:`outline`,size:`sm`,className:`font-mono uppercase shrink-0`,onClick:r,"data-testid":`settings-${n.testIdPrefix}-new-button`,children:[(0,$.jsx)(b,{className:`size-3.5`,"aria-hidden":!0}),(0,$.jsx)(p,{id:`G1Gw0v`})]}):null,t[8]=n.testIdPrefix,t[9]=r,t[10]=s):s=t[10];let c;return t[11]!==o||t[12]!==s?(c=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[o,s]}),t[11]=o,t[12]=s,t[13]=c):c=t[13],c}function va(){let e=(0,Z.c)(16),{_:t}=m(),n;e[0]===t?n=e[1]:(n=t({id:`hBMK4W`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(p,{id:`nft48x`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}}),e[2]=r):r=e[2];let i;e[3]===t?i=e[4]:(i=t({id:`6Pxqwv`}),e[3]=t,e[4]=i);let a;e[5]===t?a=e[6]:(a=t({id:`BD0XSC`}),e[5]=t,e[6]=a);let o;e[7]===t?o=e[8]:(o=t({id:`ysxgu8`}),e[7]=t,e[8]=o);let s;e[9]===o?s=e[10]:(s={label:o,variant:`gray`},e[9]=o,e[10]=s);let c;return e[11]!==n||e[12]!==i||e[13]!==a||e[14]!==s?(c=(0,$.jsx)(ma,{config:{scope:`local`,title:n,description:r,emptyMessage:i,loadErrorTitle:a,badge:s,settingsId:`settings-project-templates-title`,testIdPrefix:`project-templates`}}),e[11]=n,e[12]=i,e[13]=a,e[14]=s,e[15]=c):c=e[15],c}var ya=[2500,5e3];function ba(){let e=(0,Z.c)(87),{_:t}=m(),{projectLocalConfig:n,projectLocalSynced:r,projectLocalBinding:i}=xn(),{status:a,refresh:o}=oe(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),[f,h]=(0,Q.useState)(!1),g;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=[],e[0]=g):g=e[0];let _=(0,Q.useRef)(g),v,y;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>()=>{for(let e of _.current)clearTimeout(e)},y=[],e[1]=v,e[2]=y):(v=e[1],y=e[2]),(0,Q.useEffect)(v,y);let b=n?.search?.semantic?.baseUrl??`https://api.openai.com/v1`,[x,S]=(0,Q.useState)(b);b!==x&&(S(b),h(!1),u(null));let C=n?.search?.semantic?.enabled??!1,w=r&&i!==null,T;e[3]===o?T=e[4]:(T=function(){for(let e of _.current)clearTimeout(e);_.current=ya.map(e=>setTimeout(o,e))},e[3]=o,e[4]=T);let E=T,D;e[5]!==t||e[6]!==i||e[7]!==o||e[8]!==E?(D=function(e){if(i===null)return X.error(t({id:`YW7Q86`})),!1;let n=i.patch({search:{semantic:{enabled:e}}});if(!n.ok){let r=pt(n.error);return X.error(t(e?{id:`LYufDw`,values:{detail:r}}:{id:`5mksg0`,values:{detail:r}})),!1}return o(),E(),!0},e[5]=t,e[6]=i,e[7]=o,e[8]=E,e[9]=D):D=e[9];let O=D,k;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(k=function(e){return e.trim()||`https://api.openai.com/v1`},e[10]=k):k=e[10];let A=k,j;e[11]!==t||e[12]!==b||e[13]!==i||e[14]!==o||e[15]!==E?(j=function(e){if(i===null)return X.error(t({id:`YW7Q86`})),!1;let n=A(e);if(n===b)return!0;let r=i.patch({search:{semantic:{baseUrl:n}}});if(!r.ok){let e=pt(r.error);return X.error(t({id:`eLl1VX`,values:{detail:e}})),!1}return o(),E(),!0},e[11]=t,e[12]=b,e[13]=i,e[14]=o,e[15]=E,e[16]=j):j=e[16];let M=j,N;e[17]===O?N=e[18]:(N=function(e){if(e){c(!0);return}O(!1)},e[17]=O,e[18]=N);let P=N,F;e[19]===O?F=e[20]:(F=function(){O(!0)&&c(!1)},e[19]=O,e[20]=F);let I=F,L;e[21]===t?L=e[22]:(L=function(e){let n=e.trim();if(!n)return null;let r=mt(n);return r===null?null:t(r===`invalid-url`?{id:`2j1kfc`}:{id:`JM_aq-`})},e[21]=t,e[22]=L);let R=L,z;e[23]!==R||e[24]!==f?(z=function(e){f&&u(R(e))},e[23]=R,e[24]=f,e[25]=z):z=e[25];let B=z,V;e[26]!==R||e[27]!==M?(V=function(e){h(!0);let t=R(e.value);if(u(t),t!==null)return;let n=A(e.value);M(e.value)&&(e.value=n)},e[26]=R,e[27]=M,e[28]=V):V=e[28];let H=V,U=a?.enabled??!1,W=a?.keyPresent??!1,ee=a?.ready??!1,G=a?.capable??!1,K=a?.embedded??0,te=a?.total??0,ne;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(`h3`,{id:`settings-search-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`3y6XTb`})}),e[29]=ne):ne=e[29];let re;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[ne,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`dUQ7_J`})})]}),e[30]=re):re=e[30];let ie;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(`label`,{htmlFor:`settings-search-semantic-toggle`,className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`3y6XTb`})}),e[31]=ie):ie=e[31];let q;e[32]===C?q=e[33]:(q=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[ie,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-search-body`,children:C?(0,$.jsx)(p,{id:`stlgky`}):(0,$.jsx)(p,{id:`kdzzOK`})})]}),e[32]=C,e[33]=q);let ae=!w,J;e[34]!==t||e[35]!==C?(J=t(C?{id:`fNr-MX`}:{id:`Aif3E7`}),e[34]=t,e[35]=C,e[36]=J):J=e[36];let Y;e[37]!==C||e[38]!==P||e[39]!==ae||e[40]!==J?(Y=(0,$.jsx)(d,{id:`settings-search-semantic-toggle`,checked:C,disabled:ae,onCheckedChange:P,"aria-label":J,"data-testid":`settings-search-semantic-toggle`}),e[37]=C,e[38]=P,e[39]=ae,e[40]=J,e[41]=Y):Y=e[41];let se;e[42]!==q||e[43]!==Y?(se=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[q,Y]}),e[42]=q,e[43]=Y,e[44]=se):se=e[44];let ce;e[45]!==G||e[46]!==K||e[47]!==C||e[48]!==W||e[49]!==ee||e[50]!==U||e[51]!==a||e[52]!==te?(ce=C?(0,$.jsx)(xa,{loaded:a!==null,serverEnabled:U,keyPresent:W,ready:ee,capable:G,embedded:K,total:te}):null,e[45]=G,e[46]=K,e[47]=C,e[48]=W,e[49]=ee,e[50]=U,e[51]=a,e[52]=te,e[53]=ce):ce=e[53];let le;e[54]!==se||e[55]!==ce?(le=(0,$.jsxs)(`div`,{className:`rounded-md border p-3`,children:[se,ce]}),e[54]=se,e[55]=ce,e[56]=le):le=e[56];let ue;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,$.jsx)(`label`,{htmlFor:`settings-search-base-url`,className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`L1rRuU`})}),e[57]=ue):ue=e[57];let de;e[58]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[ue,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(p,{id:`pmOGtg`})})]}),e[58]=de):de=e[58];let fe;e[59]===B?fe=e[60]:(fe=e=>B(e.currentTarget.value),e[59]=B,e[60]=fe);let pe,me;e[61]===H?(pe=e[62],me=e[63]):(pe=e=>H(e.currentTarget),me=e=>{e.key===`Enter`&&(e.preventDefault(),H(e.currentTarget))},e[61]=H,e[62]=pe,e[63]=me);let he=!w,ge=l!==null,_e;e[64]!==b||e[65]!==fe||e[66]!==pe||e[67]!==me||e[68]!==he||e[69]!==ge?(_e=(0,$.jsx)(on,{id:`settings-search-base-url`,defaultValue:b,onChange:fe,onBlur:pe,onKeyDown:me,placeholder:St,disabled:he,spellCheck:!1,autoComplete:`off`,"aria-invalid":ge,"aria-describedby":`settings-search-base-url-message`,"data-testid":`settings-search-base-url`,className:`h-8 font-mono text-sm`},b),e[64]=b,e[65]=fe,e[66]=pe,e[67]=me,e[68]=he,e[69]=ge,e[70]=_e):_e=e[70];let ve=l?`text-1sm text-destructive`:`text-muted-foreground text-1sm`,ye=l?`settings-search-base-url-error`:`settings-search-base-url-help`,be;e[71]===l?be=e[72]:(be=l??(0,$.jsx)(p,{id:`lHCR4I`}),e[71]=l,e[72]=be);let xe;e[73]!==ve||e[74]!==ye||e[75]!==be?(xe=(0,$.jsx)(`p`,{id:`settings-search-base-url-message`,"aria-live":`polite`,className:ve,"data-testid":ye,children:be}),e[73]=ve,e[74]=ye,e[75]=be,e[76]=xe):xe=e[76];let Se;e[77]!==_e||e[78]!==xe?(Se=(0,$.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,children:[de,_e,xe]}),e[77]=_e,e[78]=xe,e[79]=Se):Se=e[79];let Ce;e[80]!==s||e[81]!==I?(Ce=(0,$.jsx)(Sa,{open:s,onOpenChange:c,onConfirm:I}),e[80]=s,e[81]=I,e[82]=Ce):Ce=e[82];let we;return e[83]!==le||e[84]!==Se||e[85]!==Ce?(we=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-search-title`,className:`space-y-3`,"data-testid":`settings-search`,children:[re,le,Se,Ce]}),e[83]=le,e[84]=Se,e[85]=Ce,e[86]=we):we=e[86],we}function xa(e){let t=(0,Z.c)(12),{loaded:n,serverEnabled:r,keyPresent:i,ready:a,capable:o,embedded:s,total:c}=e;if(!n||!r){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-1sm mt-2`,"data-testid":`settings-search-settling`,children:(0,$.jsx)(p,{id:`AdcGcG`})}),t[0]=e):e=t[0],e}if(!i){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{role:`alert`,className:`mt-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-1sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,"data-testid":`settings-search-needs-key`,children:(0,$.jsx)(p,{id:`dN20LW`,components:{0:(0,$.jsx)(`span`,{className:`font-medium`})}})}),t[1]=e):e=t[1],e}if(a&&!o){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`div`,{role:`alert`,className:`mt-2 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-1sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,"data-testid":`settings-search-provider-error`,children:(0,$.jsx)(p,{id:`oEgEn_`,components:{0:(0,$.jsx)(`span`,{className:`font-medium`})}})}),t[2]=e):e=t[2],e}if(!a){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{role:`status`,className:`text-muted-foreground text-1sm mt-2`,"data-testid":`settings-search-pending`,children:(0,$.jsx)(p,{id:`VZSBXL`})}),t[3]=e):e=t[3],e}let l;t[4]!==s||t[5]!==c?(l=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(p,{id:`lVWEIL`,values:{embedded:s,total:c}})}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===s?u=t[8]:(u=s===0?(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(p,{id:`ku0yLQ`})}):null,t[7]=s,t[8]=u);let d;return t[9]!==l||t[10]!==u?(d=(0,$.jsxs)(`div`,{className:`mt-2 space-y-0.5`,"data-testid":`settings-search-coverage`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}function Sa(e){let t=(0,Z.c)(14),{open:n,onOpenChange:r,onConfirm:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(N,{children:(0,$.jsx)(p,{id:`vhAnzJ`})}),t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(R,{children:[a,(0,$.jsx)(M,{children:(0,$.jsx)(p,{id:`aENGMB`})})]}),t[1]=o):o=t[1];let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`p`,{className:`mb-2 font-medium`,children:(0,$.jsx)(p,{id:`7PNNNs`})}),t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(`li`,{children:(0,$.jsx)(p,{id:`UfW9Kr`})}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(`li`,{children:(0,$.jsx)(p,{id:`Emz5BG`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-amber-100 px-1 py-0.5 font-mono text-xs dark:bg-amber-900`})}})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(F,{children:(0,$.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2.5 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,children:[s,(0,$.jsxs)(`ul`,{className:`list-disc space-y-1.5 pl-5`,children:[c,l,(0,$.jsx)(`li`,{children:(0,$.jsx)(p,{id:`o5gfs1`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-amber-100 px-1 py-0.5 font-mono text-xs dark:bg-amber-900`})}})})]})]})}),t[5]=u):u=t[5];let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(L,{asChild:!0,children:(0,$.jsx)(C,{variant:`outline`,children:(0,$.jsx)(p,{id:`dEgA5A`})})}),t[6]=d):d=t[6];let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(p,{id:`iMkWoF`}),t[7]=f):f=t[7];let m;t[8]===i?m=t[9]:(m=(0,$.jsxs)(P,{className:`sm:max-w-lg`,"data-testid":`settings-search-confirm`,children:[o,u,(0,$.jsxs)(I,{children:[d,(0,$.jsx)(C,{onClick:i,"data-testid":`settings-search-confirm-enable`,children:f})]})]}),t[8]=i,t[9]=m);let h;return t[10]!==r||t[11]!==n||t[12]!==m?(h=(0,$.jsx)(z,{open:n,onOpenChange:r,children:m}),t[10]=r,t[11]=n,t[12]=m,t[13]=h):h=t[13],h}function Ca(e){let t=(0,Z.c)(64),{overrides:n,terminalLaunch:r,disabled:i,registeredAgents:a,onPick:o,onLaunchTerminal:s,onStartThreadWith:c,onOpenSettings:l}=e,{_:u}=m(),[d,f]=(0,Q.useState)(``),h,g,_,v,y,b,x,S,w,T,E;if(t[0]!==u||t[1]!==i||t[2]!==d||t[3]!==s||t[4]!==o||t[5]!==c||t[6]!==n||t[7]!==a||t[8]!==r){let e;t[20]===n?e=t[21]:(e=e=>et(n,e.id),t[20]=n,t[21]=e);let l=Je.filter(e),m;t[22]===n?m=t[23]:(m=e=>Xe(n,e.source,e.id,!0,e.supported),t[22]=n,t[23]=m);let D=a.filter(m),O=r?ft.filter(e=>Qe(n,e,r.installedClis)):[];h=l.length>0,g=O.length>0,_=D.length>0,T=`flex flex-col gap-1`;let k;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>f(e.target.value),t[24]=k):k=t[24];let A;t[25]===u?A=t[26]:(A=u({id:`Rah7yq`}),t[25]=u,t[26]=A);let j;t[27]===u?j=t[28]:(j=u({id:`ZBt4rI`}),t[27]=u,t[28]=j),t[29]!==d||t[30]!==A||t[31]!==j?(E=(0,$.jsx)(`div`,{className:`px-2 pt-2 pb-1.5`,children:(0,$.jsx)(on,{value:d,onChange:k,placeholder:A,"aria-label":j,"data-testid":`open-in-agent-instruction`})}),t[29]=d,t[30]=A,t[31]=j,t[32]=E):E=t[32],x=`flex max-h-72 flex-col gap-0.5 overflow-y-auto subtle-scrollbar`,S=_?(0,$.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-0.5 border-0 p-0`,children:[(0,$.jsxs)(`legend`,{className:`flex items-center gap-1.5 px-1.5 py-1 font-medium text-muted-foreground text-xs`,"data-testid":`open-in-agent-thread-label`,children:[(0,$.jsx)(p,{id:`RXEbZy`}),(0,$.jsx)($e,{})]}),D.map(e=>{let t=e.name;return(0,$.jsxs)(C,{type:`button`,variant:`ghost`,className:`h-auto w-full justify-start gap-1.5 rounded-md px-1.5 py-1 font-normal text-foreground`,disabled:i,"data-testid":`open-in-agent-thread-start-${e.id}`,onClick:()=>c({source:e.source,id:e.id},d),children:[(0,$.jsx)(Mt,{agentId:e.id,iconUrl:e.iconUrl,className:`size-4`}),(0,$.jsx)(`span`,{children:u({id:`5PrrYw`,values:{agentName:t}})})]},`${e.source}:${e.id}`)})]}):null,t[33]!==h||t[34]!==g||t[35]!==_?(w=_&&(g||h)?(0,$.jsx)(me,{className:`my-1`}):null,t[33]=h,t[34]=g,t[35]=_,t[36]=w):w=t[36],v=`flex flex-col gap-0.5`,y=g?(0,$.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-0.5 border-0 p-0`,children:[(0,$.jsx)(`legend`,{className:`px-1.5 py-1 font-medium text-muted-foreground text-xs`,"data-testid":`open-in-agent-terminal-label`,children:(0,$.jsx)(p,{id:`ALhMYW`})}),O.map(e=>{let{displayName:t}=lt[e];return(0,$.jsxs)(C,{type:`button`,variant:`ghost`,className:`h-auto w-full justify-start gap-1.5 rounded-md px-1.5 py-1 font-normal text-foreground`,disabled:i,"data-testid":`open-in-agent-terminal-${e}`,"aria-label":u({id:`QYfQdv`,values:{displayName:t}}),onClick:()=>s(e,d),children:[(0,$.jsx)(Ze,{id:Ue(e),"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:t})]},e)})]}):null,b=h?(0,$.jsxs)($.Fragment,{children:[g?(0,$.jsx)(me,{className:`my-1`}):null,(0,$.jsxs)(`fieldset`,{className:`m-0 flex min-w-0 flex-col gap-0.5 border-0 p-0`,children:[(0,$.jsx)(`legend`,{className:`px-1.5 py-1 font-medium text-muted-foreground text-xs`,"data-testid":`open-in-agent-desktop-label`,children:(0,$.jsx)(p,{id:`BBqGS9`})}),l.map(e=>{let{displayName:t}=e;return(0,$.jsxs)(C,{type:`button`,variant:`ghost`,className:`h-auto w-full justify-start gap-1.5 rounded-md px-1.5 py-1 font-normal text-foreground`,disabled:i,"data-testid":`open-in-agent-item-${e.id}`,"aria-label":u({id:`WqLq6M`,values:{displayName:t}}),onClick:()=>o(e,d),children:[(0,$.jsx)(Ze,{id:e.id,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:t})]},e.id)})]})]}):null,t[0]=u,t[1]=i,t[2]=d,t[3]=s,t[4]=o,t[5]=c,t[6]=n,t[7]=a,t[8]=r,t[9]=h,t[10]=g,t[11]=_,t[12]=v,t[13]=y,t[14]=b,t[15]=x,t[16]=S,t[17]=w,t[18]=T,t[19]=E}else h=t[9],g=t[10],_=t[11],v=t[12],y=t[13],b=t[14],x=t[15],S=t[16],w=t[17],T=t[18],E=t[19];let D;t[37]!==v||t[38]!==y||t[39]!==b?(D=(0,$.jsxs)(`div`,{className:v,children:[y,b]}),t[37]=v,t[38]=y,t[39]=b,t[40]=D):D=t[40];let O;t[41]!==h||t[42]!==g||t[43]!==_?(O=_||g||h?(0,$.jsx)(me,{className:`my-1`}):null,t[41]=h,t[42]=g,t[43]=_,t[44]=O):O=t[44];let k;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(nn,{className:`size-4 text-muted-foreground`,"aria-hidden":`true`}),t[45]=k):k=t[45];let A;t[46]===u?A=t[47]:(A=u({id:`jRAGrQ`}),t[46]=u,t[47]=A);let j;t[48]===A?j=t[49]:(j=(0,$.jsx)(`span`,{children:A}),t[48]=A,t[49]=j);let M;t[50]!==l||t[51]!==j?(M=(0,$.jsxs)(C,{type:`button`,variant:`ghost`,className:`h-auto w-full justify-start gap-1.5 rounded-md px-1.5 py-1 font-normal text-foreground`,"data-testid":`open-in-agent-settings`,onClick:l,children:[k,j]}),t[50]=l,t[51]=j,t[52]=M):M=t[52];let N;t[53]!==O||t[54]!==M||t[55]!==x||t[56]!==S||t[57]!==w||t[58]!==D?(N=(0,$.jsxs)(`div`,{className:x,children:[S,w,D,O,M]}),t[53]=O,t[54]=M,t[55]=x,t[56]=S,t[57]=w,t[58]=D,t[59]=N):N=t[59];let P;return t[60]!==N||t[61]!==T||t[62]!==E?(P=(0,$.jsxs)(`div`,{className:T,children:[E,N]}),t[60]=N,t[61]=T,t[62]=E,t[63]=P):P=t[63],P}function wa(e){let t=(0,Z.c)(50),{input:n,open:r,onOpenChange:i}=e,{_:a}=m(),{states:o,refresh:s}=Ht(),{dispatch:c}=Rt(),l=zt(),u=Ve(),d=qe(),[f,h]=(0,Q.useState)(!1),g=(0,Q.useRef)(!1),_=Yt(),b=r??f,S;t[0]===s?S=t[1]:(S=()=>{s()},t[0]=s,t[1]=S);let w=(0,Q.useEffectEvent)(S),T;t[2]!==b||t[3]!==w?(T=()=>{b&&w()},t[2]=b,t[3]=w,t[4]=T):T=t[4];let E;if(t[5]===b?E=t[6]:(E=[b],t[5]=b,t[6]=E),(0,Q.useEffect)(T,E),_)return null;let D=typeof window<`u`&&window.okDesktop!=null,O;t[7]!==i||t[8]!==r?(O=e=>{r===void 0&&h(e),i?.(e)},t[7]=i,t[8]=r,t[9]=O):O=t[9];let k=O,A=n===null,j;t[10]===n?j=t[11]:(j=e=>{if(n===null)return null;let t=e.trim();return t?{...n,instruction:t}:n},t[10]=n,t[11]=j);let M=j,N;t[12]!==c||t[13]!==k||t[14]!==M||t[15]!==o?(N=(e,t)=>{let n=M(t);if(n!==null){if(o[e.id]?.installed!==!0){Gt(e),k(!1);return}c(e.id,n),k(!1)}},t[12]=c,t[13]=k,t[14]=M,t[15]=o,t[16]=N):N=t[16];let P=N,F;t[17]!==k||t[18]!==M||t[19]!==l?(F=(e,t)=>{let n=M(t);n===null||l===null||(l.launchInTerminal(n,e),k(!1))},t[17]=k,t[18]=M,t[19]=l,t[20]=F):F=t[20];let I=F,L;t[21]!==k||t[22]!==M?(L=(e,t)=>{let n=M(t);n!==null&&(Kt(n,{agent:e}),k(!1))},t[21]=k,t[22]=M,t[23]=L):L=t[23];let R=L,z;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(z=D?()=>{g.current=!0}:void 0,t[24]=z):z=t[24];let B;t[25]===k?B=t[26]:(B=D?()=>{if(g.current){g.current=!1;return}k(!0)}:void 0,t[25]=k,t[26]=B);let V,H;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(Jt,{className:`size-3.5`,"aria-hidden":`true`}),H=(0,$.jsx)(p,{id:`O7_W_a`}),t[27]=V,t[28]=H):(V=t[27],H=t[28]);let U;t[29]!==B||t[30]!==A?(U=(0,$.jsx)(y,{asChild:!0,children:(0,$.jsxs)(C,{variant:`ghost`,size:`sm`,disabled:A,className:`gap-1.5 text-muted-foreground px-1.5`,"data-testid":`open-in-agent-trigger`,onPointerDown:z,onClick:B,children:[V,H]})}),t[29]=B,t[30]=A,t[31]=U):U=t[31];let W;t[32]===a?W=t[33]:(W=a({id:`O7_W_a`}),t[32]=a,t[33]=W);let ee=n===null,G;t[34]!==I||t[35]!==P||t[36]!==R||t[37]!==d||t[38]!==u||t[39]!==ee||t[40]!==l?(G=(0,$.jsx)(Ca,{overrides:d,terminalLaunch:l,disabled:ee,registeredAgents:u,onPick:P,onLaunchTerminal:I,onStartThreadWith:R,onOpenSettings:rt}),t[34]=I,t[35]=P,t[36]=R,t[37]=d,t[38]=u,t[39]=ee,t[40]=l,t[41]=G):G=t[41];let K;t[42]!==W||t[43]!==G?(K=(0,$.jsx)(x,{align:`end`,className:`p-1`,"aria-label":W,"data-testid":`open-in-agent-menu`,children:G}),t[42]=W,t[43]=G,t[44]=K):K=t[44];let te;return t[45]!==k||t[46]!==b||t[47]!==U||t[48]!==K?(te=(0,$.jsxs)(v,{open:b,onOpenChange:k,children:[U,K]}),t[45]=k,t[46]=b,t[47]=U,t[48]=K,t[49]=te):te=t[49],te}function Ta(e){let t=(0,Z.c)(37),{skill:n,onEdit:r,onDelete:i,onInstall:a,onUninstall:o,installing:s}=e,{_:c}=m(),l=wn(),u;t[0]!==n.name||t[1]!==n.scope||t[2]!==l?(u=Bt({skillName:n.name,scope:n.scope,workspace:l}),t[0]=n.name,t[1]=n.scope,t[2]=l,t[3]=u):u=t[3];let d=u,f=`skill-row-${n.name}`,h;t[4]===n.name?h=t[5]:(h=(0,$.jsx)(`code`,{className:`truncate font-mono font-medium`,children:n.name}),t[4]=n.name,t[5]=h);let g;t[6]!==c||t[7]!==n.installed||t[8]!==n.managed?(g=n.managed?(0,$.jsxs)(mn,{variant:`gray`,className:`gap-1 text-2xs`,title:c({id:`VITWk5`}),children:[(0,$.jsx)(Lt,{className:`size-3`,"aria-hidden":!0}),(0,$.jsx)(p,{id:`waFx9W`})]}):(0,$.jsx)(ge,{installed:n.installed,className:`text-2xs`}),t[6]=c,t[7]=n.installed,t[8]=n.managed,t[9]=g):g=t[9];let _;t[10]!==h||t[11]!==g?(_=(0,$.jsxs)(`span`,{className:`flex w-full items-center gap-2`,children:[h,g]}),t[10]=h,t[11]=g,t[12]=_):_=t[12];let v;t[13]===n.description?v=t[14]:(v=n.description?(0,$.jsx)(`span`,{className:`block w-full truncate text-sm text-muted-foreground`,children:n.description}):(0,$.jsx)(`span`,{className:`block w-full truncate text-sm italic text-muted-foreground`,children:(0,$.jsx)(p,{id:`xnP32l`})}),t[13]=n.description,t[14]=v);let y;t[15]===n.hosts?y=t[16]:(y=n.hosts.length>0?(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1 pt-0.5`,children:[(0,$.jsx)(`span`,{className:`sr-only`,children:(0,$.jsx)(p,{id:`G_efLf`})}),n.hosts.map(Ea)]}):null,t[15]=n.hosts,t[16]=y);let b;t[17]!==r||t[18]!==_||t[19]!==v||t[20]!==y?(b=(0,$.jsxs)(C,{type:`button`,variant:`ghost`,onClick:r,className:`h-auto min-w-0 flex-1 flex-col items-start gap-0.5 px-1.5 py-1 text-left font-normal hover:bg-transparent`,children:[_,v,y]}),t[17]=r,t[18]=_,t[19]=v,t[20]=y,t[21]=b):b=t[21];let x;t[22]===d?x=t[23]:(x=(0,$.jsx)(`span`,{className:`shrink-0 self-center opacity-0 group-hover:opacity-100 focus-within:opacity-100 data-[state=open]:opacity-100`,children:(0,$.jsx)(wa,{input:d})}),t[22]=d,t[23]=x);let S;t[24]!==c||t[25]!==s||t[26]!==i||t[27]!==r||t[28]!==a||t[29]!==o||t[30]!==n?(S=n.managed?null:(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(C,{type:`button`,variant:`ghost`,size:`sm`,className:`shrink-0 self-center font-mono uppercase opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,onClick:a,disabled:s,"data-testid":`skill-install-${n.name}`,children:[(0,$.jsx)(It,{className:`size-3.5`,"aria-hidden":!0}),n.installed?(0,$.jsx)(p,{id:`eQkgKV`}):(0,$.jsx)(p,{id:`TKQ7K-`})]}),(0,$.jsxs)(U,{children:[(0,$.jsx)(V,{asChild:!0,children:(0,$.jsx)(C,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 self-center opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":c({id:`RlLl3G`,values:{0:n.name}}),children:(0,$.jsx)(Pe,{className:`size-4`,"aria-hidden":!0})})}),(0,$.jsx)(H,{align:`end`,className:`min-w-52`,children:(0,$.jsx)(Wt,{skill:n,onEdit:r,onUninstall:o,onDelete:i})})]})]}),t[24]=c,t[25]=s,t[26]=i,t[27]=r,t[28]=a,t[29]=o,t[30]=n,t[31]=S):S=t[31];let w;return t[32]!==S||t[33]!==f||t[34]!==b||t[35]!==x?(w=(0,$.jsxs)(`li`,{className:`group flex items-start gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-muted/50`,"data-testid":f,children:[b,x,S]}),t[32]=S,t[33]=f,t[34]=b,t[35]=x,t[36]=w):w=t[36],w}function Ea(e){return(0,$.jsx)(mn,{variant:`gray`,className:`text-2xs`,children:e},e)}function Da(){let e=(0,Z.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Q.useState)(t),[i,a]=(0,Q.useState)(0),[o,s]=(0,Q.useState)(!1),c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/skill-targets`).then(ja).then(t=>{if(e)return;let n=dt.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skill-targets response failed schema validation:`,n.error.issues),r({status:`error`,message:`Server returned an incomplete skill-targets response.`});return}r({status:`ready`,data:n.data})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[1]=c):c=e[1];let l;e[2]===i?l=e[3]:(l=[i],e[2]=i,e[3]=l),(0,Q.useEffect)(c,l);let u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=async e=>{s(!0);let t=await fetch(`/api/skill-targets`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({targets:e})}).catch(Aa);if(!t?.ok){s(!1);let e=t?await t.json().catch(ka):null;throw Error(fn(e)??(t?`HTTP ${t.status}`:`Request failed`))}pn(),a(Oa),s(!1)},e[4]=u):u=e[4];let d=u,f;return e[5]!==o||e[6]!==n?(f={state:n,save:d,saving:o},e[5]=o,e[6]=n,e[7]=f):f=e[7],f}function Oa(e){return e+1}function ka(){return null}function Aa(){return null}async function ja(e){if(!e.ok){let t=await e.json().catch(Ma);throw Error(fn(t)??`HTTP ${e.status}`)}return e.json()}function Ma(){return null}function Na(){let e=(0,Z.c)(21),{_:t}=m(),{state:n,save:r,saving:i}=Da(),a=vt,o;e[0]!==n.data||e[1]!==n.status?(o=n.status===`ready`?new Set(n.data.targets):new Set,e[0]=n.data,e[1]=n.status,e[2]=o):o=e[2];let s=o,c;e[3]!==t||e[4]!==r||e[5]!==n.data||e[6]!==n.status?(c=async(e,i)=>{if(n.status!==`ready`)return;let a=new Set(n.data.targets);i?a.add(e):a.delete(e);try{await r([...a])}catch(e){let n=e;X.error(t({id:`XqNHcm`,values:{0:n instanceof Error?n.message:String(n)}}))}},e[3]=t,e[4]=r,e[5]=n.data,e[6]=n.status,e[7]=c):c=e[7];let l=c,u;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`h4`,{id:`settings-skill-targets-heading`,className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`el312q`})}),e[8]=u):u=e[8];let d;e[9]!==n.data||e[10]!==n.status?(d=(0,$.jsxs)(`div`,{children:[u,(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:n.status===`ready`&&!n.data.configured?(0,$.jsx)(p,{id:`4XL6N4`}):(0,$.jsx)(p,{id:`Ea1prf`})})]}),e[9]=n.data,e[10]=n.status,e[11]=d):d=e[11];let f;e[12]!==i||e[13]!==s||e[14]!==n.message||e[15]!==n.status||e[16]!==l?(f=n.status===`error`?(0,$.jsx)(`div`,{className:`text-1sm text-destructive`,role:`alert`,"data-testid":`skill-targets-error`,children:(0,$.jsx)(p,{id:`yitgD9`,values:{0:n.message}})}):n.status===`idle`||n.status===`loading`?(0,$.jsxs)(`div`,{className:`space-y-2 pt-1`,children:[(0,$.jsx)(Tn,{className:`h-5 w-40`}),(0,$.jsx)(Tn,{className:`h-5 w-40`})]}):(0,$.jsxs)(`fieldset`,{className:`flex flex-col gap-2 pt-1`,disabled:i,children:[(0,$.jsx)(`legend`,{className:`sr-only`,children:(0,$.jsx)(p,{id:`Sq8lf2`})}),a.map(e=>{let t=`skill-target-${e}`;return(0,$.jsxs)(W,{htmlFor:t,className:`text-sm font-normal`,children:[(0,$.jsx)(B,{id:t,checked:s.has(e),onCheckedChange:t=>l(e,t===!0),disabled:i,"data-testid":`skill-target-${e}`}),(0,$.jsx)(`span`,{children:ut[e]})]},e)})]}),e[12]=i,e[13]=s,e[14]=n.message,e[15]=n.status,e[16]=l,e[17]=f):f=e[17];let h;return e[18]!==d||e[19]!==f?(h=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-skill-targets-heading`,className:`space-y-2 rounded-lg border bg-card p-3`,"data-testid":`settings-skill-targets`,children:[d,f]}),e[18]=d,e[19]=f,e[20]=h):h=e[20],h}function Pa(){let e=(0,Z.c)(19),{_:t}=m(),n=Xt(),r=n.global,i;e[0]===t?i=e[1]:(i=t({id:`2bVHbB`}),e[0]=t,e[1]=i);let a;e[2]===t?a=e[3]:(a=t({id:`MmqnGI`}),e[2]=t,e[3]=a);let o;e[4]!==n.global||e[5]!==i||e[6]!==a?(o={title:r,blurb:i,empty:a},e[4]=n.global,e[5]=i,e[6]=a,e[7]=o):o=e[7];let s=n.project,c;e[8]===t?c=e[9]:(c=t({id:`RXNu_r`}),e[8]=t,e[9]=c);let l;e[10]===t?l=e[11]:(l=t({id:`uFOL2y`}),e[10]=t,e[11]=l);let u;e[12]!==n.project||e[13]!==c||e[14]!==l?(u={title:s,blurb:c,empty:l},e[12]=n.project,e[13]=c,e[14]=l,e[15]=u):u=e[15];let d;return e[16]!==o||e[17]!==u?(d={global:o,project:u},e[16]=o,e[17]=u,e[18]=d):d=e[18],d}function Fa(){let e=(0,Z.c)(26),t=Vt(),n=Pa(),r=We(),[i,a]=(0,Q.useState)(!1),o;e[0]===r?o=e[1]:(o=function(e){e.managed?Qt({scope:e.scope,name:e.name,path:`SKILL.md`}):$t(xt(e.scope,e.name)),r.close()},e[0]=r,e[1]=o);let s=o,c=Ut(),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(`h3`,{id:`settings-skills-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`PCSkw2`})}),e[2]=l):l=e[2];let u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[l,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`wn8EJi`})})]}),e[3]=u):u=e[3];let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>a(!0),e[4]=d):d=e[4];let f,m;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[u,(0,$.jsxs)(C,{variant:`outline`,size:`sm`,className:`shrink-0 font-mono uppercase`,onClick:d,"data-testid":`settings-skills-new-button`,children:[(0,$.jsx)(b,{className:`size-3.5`,"aria-hidden":!0}),(0,$.jsx)(p,{id:`MdpSC1`})]})]}),m=(0,$.jsx)(Na,{}),e[5]=f,e[6]=m):(f=e[5],m=e[6]);let h;e[7]!==c.install||e[8]!==c.installingName||e[9]!==c.requestDelete||e[10]!==c.uninstall||e[11]!==n||e[12]!==s||e[13]!==t.data||e[14]!==t.message||e[15]!==t.status?(h=t.status===`error`?(0,$.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,"data-testid":`settings-skills-error`,children:(0,$.jsx)(p,{id:`OEu_0l`,values:{0:t.message}})}):t.status===`idle`||t.status===`loading`?(0,$.jsxs)(`div`,{className:`rounded-lg border bg-card p-3 space-y-2`,children:[(0,$.jsx)(Tn,{className:`h-12 w-full`}),(0,$.jsx)(Tn,{className:`h-12 w-full`})]}):qt.map(e=>{let r=t.data.filter(t=>t.scope===e).sort(Ia);return e===`global`&&r.length===0?null:(0,$.jsx)(La,{chrome:n[e],scope:e,skills:r,installingName:c.installingName,onEdit:e=>s(e),onDelete:c.requestDelete,onInstall:c.install,onUninstall:c.uninstall},e)}),e[7]=c.install,e[8]=c.installingName,e[9]=c.requestDelete,e[10]=c.uninstall,e[11]=n,e[12]=s,e[13]=t.data,e[14]=t.message,e[15]=t.status,e[16]=h):h=e[16];let g;e[17]===s?g=e[18]:(g=e=>{let{scope:t,name:n}=e;return s({scope:t,name:n})},e[17]=s,e[18]=g);let _;e[19]!==i||e[20]!==g?(_=(0,$.jsx)(Te,{defaultScope:`project`,open:i,onOpenChange:a,onCreated:g}),e[19]=i,e[20]=g,e[21]=_):_=e[21];let v;return e[22]!==c.dialogs||e[23]!==h||e[24]!==_?(v=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-skills-title`,className:`space-y-4`,"data-testid":`settings-skills-section`,children:[f,m,h,c.dialogs,_]}),e[22]=c.dialogs,e[23]=h,e[24]=_,e[25]=v):v=e[25],v}function Ia(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())}function La(e){let t=(0,Z.c)(22),{chrome:n,scope:r,skills:i,installingName:a,onEdit:o,onDelete:s,onInstall:c,onUninstall:l}=e,u=`settings-skills-${r}-heading`,d=`skills-group-${r}`,f;t[0]!==n.title||t[1]!==u?(f=(0,$.jsx)(`h4`,{id:u,className:`text-sm font-medium`,children:n.title}),t[0]=n.title,t[1]=u,t[2]=f):f=t[2];let p;t[3]===n.blurb?p=t[4]:(p=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:n.blurb}),t[3]=n.blurb,t[4]=p);let m;t[5]!==f||t[6]!==p?(m=(0,$.jsxs)(`div`,{children:[f,p]}),t[5]=f,t[6]=p,t[7]=m):m=t[7];let h;t[8]!==n.empty||t[9]!==a||t[10]!==s||t[11]!==o||t[12]!==c||t[13]!==l||t[14]!==r||t[15]!==i?(h=(0,$.jsx)(`div`,{className:`rounded-lg border bg-card`,children:i.length===0?(0,$.jsx)(`p`,{className:`px-3 py-4 text-sm text-muted-foreground`,"data-testid":`skills-group-${r}-empty`,children:n.empty}):(0,$.jsx)(`ul`,{className:`space-y-1 p-2`,"data-testid":`skills-group-${r}-list`,children:i.map(e=>(0,$.jsx)(Ta,{skill:e,installing:a===e.name,onEdit:()=>o(e),onDelete:()=>s(e),onInstall:()=>c(e),onUninstall:()=>l(e)},e.name))})}),t[8]=n.empty,t[9]=a,t[10]=s,t[11]=o,t[12]=c,t[13]=l,t[14]=r,t[15]=i,t[16]=h):h=t[16];let g;return t[17]!==u||t[18]!==d||t[19]!==m||t[20]!==h?(g=(0,$.jsxs)(`section`,{"aria-labelledby":u,className:`space-y-2`,"data-testid":d,children:[m,h]}),t[17]=u,t[18]=d,t[19]=m,t[20]=h,t[21]=g):g=t[21],g}var Ra=`data-[state=on]:border-primary data-[state=on]:bg-primary data-[state=on]:text-primary-foreground data-[state=on]:hover:bg-primary/90`;function za(){let e=(0,Z.c)(79),{_:t}=m(),n=Dt(),{projectConfig:r,projectLocalConfig:i,projectLocalSynced:a,projectSynced:o}=xn(),s=Et(),c=Ot(),{confirmOpen:l,setConfirmOpen:u,onToggleRequest:f,onConfirm:h}=kt(s),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(!1);if(n&&!n.hasRemote&&n.state===`dormant`){let t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(`h3`,{id:`settings-sync-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`Nu4DdT`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[t,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`AiNMQ7`})})]}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`3_6U6f`})}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[r,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(p,{id:`i92eAT`})})]}),e[3]=i):i=e[3];let a;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>_(!0),e[4]=a):a=e[4];let o;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[i,(0,$.jsx)(C,{onClick:a,"data-testid":`settings-sync-setup`,children:(0,$.jsx)(p,{id:`zkz0Fg`})})]}),e[5]=o):o=e[5];let s;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(A,{asChild:!0,children:(0,$.jsxs)(C,{variant:`ghost`,size:`sm`,className:`group gap-1 px-1.5 text-muted-foreground`,children:[(0,$.jsx)(Pt,{className:`size-3.5 transition-transform group-data-[state=open]:rotate-90`,"aria-hidden":!0}),(0,$.jsx)(p,{id:`6caB2T`})]})}),e[6]=s):s=e[6];let c;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(j,{children:[s,(0,$.jsx)(k,{className:`px-1.5 pt-2 text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`44DSl0`,components:{0:(0,$.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-xs`})}})})]}),e[7]=c):c=e[7];let l;return e[8]===g?l=e[9]:(l=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-sync-title`,className:`space-y-4`,"data-testid":`settings-sync-empty`,children:[n,o,c,(0,$.jsx)(ie,{open:g,onOpenChange:_})]}),e[8]=g,e[9]=l),l}let b=i?.autoSync?.enabled??!1,x=n?.pushPermission?.checkStatus,S;e[10]!==a||e[11]!==x?(S=he(a,x),e[10]=a,e[11]=x,e[12]=S):S=e[12];let w=S,T=n?.pushPermission?.checkStatus===`denied`||n?.pausedReason===`no-push-permission`,E;e[13]!==T||e[14]!==n?(E=T||!n?.pausedReason?null:Le(n.pausedReason),e[13]=T,e[14]=n,e[15]=E):E=e[15];let D=E,O=r?.autoSync?.default??null,M=O===!0?`on`:O===!1?`off`:`ask`,N;e[16]!==t||e[17]!==c?(N=function(e){if(e!==`ask`&&e!==`on`&&e!==`off`)return;if(c===null){X.error(t({id:`fiMNLl`}));return}let n=c(e===`on`?!0:e===`off`?!1:null);if(!n.ok){let e=n.error;X.error(t({id:`oAFVKX`,values:{detail:e}}))}},e[16]=t,e[17]=c,e[18]=N):N=e[18];let P=N,F;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(`h3`,{id:`settings-sync-title`,className:`text-base font-semibold`,children:(0,$.jsx)(p,{id:`Nu4DdT`})}),e[19]=F):F=e[19];let I;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[F,(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,$.jsx)(p,{id:`T67A0Y`})})]}),e[20]=I):I=e[20];let L;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(`label`,{htmlFor:`settings-sync-toggle`,className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`Nx7BWE`})}),e[21]=L):L=e[21];let R;e[22]!==b||e[23]!==T||e[24]!==n?.pushPermission?(R=(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,"data-testid":`settings-sync-body`,children:T?Ie(n?.pushPermission)?(0,$.jsx)(p,{id:`tnG-m6`}):(0,$.jsx)(p,{id:`Nm-3m-`}):b?(0,$.jsx)(p,{id:`-gdcIo`}):(0,$.jsx)(p,{id:`qUB_o_`})}),e[22]=b,e[23]=T,e[24]=n?.pushPermission,e[25]=R):R=e[25];let z;e[26]!==t||e[27]!==n?(z=n?.remote?(0,$.jsxs)(`p`,{className:`text-muted-foreground text-1sm truncate`,"data-testid":`settings-sync-remote`,children:[(0,$.jsx)(p,{id:`Q8A-U_`}),` `,n.remote.webUrl?(0,$.jsxs)(`a`,{href:n.remote.webUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-foreground hover:text-primary hover:underline inline-flex items-center gap-0.5`,"aria-label":t({id:`1nke1r`,values:{0:n.remote.label}}),"data-testid":`settings-sync-remote-link`,children:[(0,$.jsx)(`span`,{children:n.remote.label}),(0,$.jsx)(jt,{className:`inline size-3.5`,"aria-hidden":!0})]}):(0,$.jsx)(`span`,{className:`font-medium text-foreground`,"data-testid":`settings-sync-remote-label`,children:n.remote.label})]}):null,e[26]=t,e[27]=n,e[28]=z):z=e[28];let B;e[29]!==R||e[30]!==z?(B=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[L,R,z]}),e[29]=R,e[30]=z,e[31]=B):B=e[31];let V;e[32]!==t||e[33]!==b||e[34]!==n?.pushPermission?.checkStatus?(V=n?.pushPermission?.checkStatus===`denied`?t({id:`FnMkli`}):t(b?{id:`OmHTGj`}:{id:`MKOVhz`}),e[32]=t,e[33]=b,e[34]=n?.pushPermission?.checkStatus,e[35]=V):V=e[35];let H;e[36]!==w||e[37]!==b||e[38]!==f||e[39]!==V?(H=(0,$.jsx)(d,{id:`settings-sync-toggle`,checked:b,disabled:w,onCheckedChange:f,"aria-label":V,"data-testid":`settings-sync-toggle`}),e[36]=w,e[37]=b,e[38]=f,e[39]=V,e[40]=H):H=e[40];let U;e[41]!==H||e[42]!==B?(U=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[B,H]}),e[41]=H,e[42]=B,e[43]=U):U=e[43];let W;e[44]===D?W=e[45]:(W=D!==null&&(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground mt-2`,"data-testid":`settings-sync-reason`,children:D}),e[44]=D,e[45]=W);let ee;e[46]===n?.pushPermission?ee=e[47]:(ee=se(n?.pushPermission)&&(0,$.jsxs)(`div`,{className:`mt-2 flex items-start gap-2`,"data-testid":`settings-sync-signin-again`,children:[(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground flex-1 min-w-0`,children:(0,$.jsx)(p,{id:`C_cPoW`})}),(0,$.jsx)(C,{variant:`outline`,size:`xs`,className:`self-start`,onClick:()=>y(!0),children:(0,$.jsx)(p,{id:`5lWFkC`})})]}),e[46]=n?.pushPermission,e[47]=ee);let G;e[48]===n?.pushPermission?G=e[49]:(G=Ie(n?.pushPermission)&&(0,$.jsx)(`div`,{className:`mt-2 flex justify-start`,"data-testid":`settings-sync-reconnect`,children:(0,$.jsx)(C,{variant:`outline`,onClick:()=>y(!0),children:(0,$.jsx)(p,{id:`5lWFkC`})})}),e[48]=n?.pushPermission,e[49]=G);let K;e[50]!==U||e[51]!==W||e[52]!==ee||e[53]!==G?(K=(0,$.jsxs)(`div`,{className:`rounded-md border p-3`,children:[U,W,ee,G]}),e[50]=U,e[51]=W,e[52]=ee,e[53]=G,e[54]=K):K=e[54];let te;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,$.jsx)(`div`,{className:`text-sm font-medium`,children:(0,$.jsx)(p,{id:`j_Z6g7`})}),e[55]=te):te=e[55];let ne;e[56]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[te,(0,$.jsx)(`p`,{className:`text-muted-foreground text-1sm`,children:(0,$.jsx)(p,{id:`W3Xlpc`})})]}),e[56]=ne):ne=e[56];let re=!o,q;e[57]===t?q=e[58]:(q=t({id:`dvGKu2`}),e[57]=t,e[58]=q);let ae;e[59]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(ze,{value:`ask`,className:Ra,"data-testid":`settings-sync-default-ask`,children:(0,$.jsx)(p,{id:`EdQY6l`})}),e[59]=ae):ae=e[59];let J;e[60]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(ze,{value:`on`,className:Ra,"data-testid":`settings-sync-default-on`,children:(0,$.jsx)(p,{id:`Z5HWHd`})}),e[60]=J):J=e[60];let oe;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(ze,{value:`off`,className:Ra,"data-testid":`settings-sync-default-off`,children:(0,$.jsx)(p,{id:`az8lvo`})}),e[61]=oe):oe=e[61];let Y;e[62]!==M||e[63]!==P||e[64]!==re||e[65]!==q?(Y=(0,$.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,"data-testid":`settings-sync-default`,children:[ne,(0,$.jsxs)(Be,{type:`single`,variant:`outline`,spacing:2,value:M,onValueChange:P,disabled:re,"aria-label":q,"data-testid":`settings-sync-default-toggle`,children:[ae,J,oe]})]}),e[62]=M,e[63]=P,e[64]=re,e[65]=q,e[66]=Y):Y=e[66];let ce;e[67]!==l||e[68]!==h||e[69]!==u?(ce=(0,$.jsx)(At,{open:l,onOpenChange:u,onConfirm:h}),e[67]=l,e[68]=h,e[69]=u,e[70]=ce):ce=e[70];let le;e[71]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>y(!1),e[71]=le):le=e[71];let ue;e[72]===v?ue=e[73]:(ue=(0,$.jsx)(je,{open:v,onOpenChange:y,onSuccess:le,reauth:!0}),e[72]=v,e[73]=ue);let de;return e[74]!==K||e[75]!==Y||e[76]!==ce||e[77]!==ue?(de=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-sync-title`,className:`space-y-3`,children:[I,K,Y,ce,ue]}),e[74]=K,e[75]=Y,e[76]=ce,e[77]=ue,e[78]=de):de=e[78],de}function Ba(e){let t=(0,Z.c)(15),{title:n,description:r,scope:i,binding:a,fields:o,scopeBadge:s}=e,{form:c,commitField:l}=kr(a),[u,d]=(0,Q.useState)(null),f=(0,Q.useRef)(null),p,m;t[0]!==c||t[1]!==i?(p=()=>{let e=i===`project`?Ct:ht,t=Se(t=>{if(t.docName!==e)return;X.error(pt(t.error),{duration:8e3});let n=xr(t.error);n&&(c.setError(n,{type:`config-validation-rejected`,message:Mr(t.error,n)}),c.setFocus(n),d(n),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{d(null),c.clearErrors(n)},600))});return()=>{t(),f.current&&clearTimeout(f.current)}},m=[i,c],t[0]=c,t[1]=i,t[2]=p,t[3]=m):(p=t[2],m=t[3]),(0,Q.useEffect)(p,m);let h;t[4]!==l||t[5]!==r||t[6]!==o||t[7]!==u||t[8]!==i||t[9]!==s||t[10]!==n?(h=(0,$.jsx)(Va,{title:n,description:r,scope:i,scopeBadge:s,fields:o,commitField:l,flashedPath:u}),t[4]=l,t[5]=r,t[6]=o,t[7]=u,t[8]=i,t[9]=s,t[10]=n,t[11]=h):h=t[11];let g;return t[12]!==c||t[13]!==h?(g=(0,$.jsx)(nr,{...c,children:h}),t[12]=c,t[13]=h,t[14]=g):g=t[14],g}function Va(e){let t=(0,Z.c)(28),{title:n,description:r,scope:i,scopeBadge:a,fields:o,commitField:s,flashedPath:c}=e,l=`settings-section-${i}-title`,u;t[0]!==n||t[1]!==l?(u=(0,$.jsx)(`h3`,{id:l,className:`text-base font-semibold`,children:n}),t[0]=n,t[1]=l,t[2]=u):u=t[2];let d;t[3]===a?d=t[4]:(d=a?(0,$.jsx)(ai,{scope:a}):null,t[3]=a,t[4]=d);let f;t[5]!==u||t[6]!==d?(f=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u,d]}),t[5]=u,t[6]=d,t[7]=f):f=t[7];let p;t[8]===r?p=t[9]:(p=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}),t[8]=r,t[9]=p);let m;t[10]!==f||t[11]!==p?(m=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[f,p]}),t[10]=f,t[11]=p,t[12]=m):m=t[12];let h;if(t[13]!==s||t[14]!==o||t[15]!==c||t[16]!==i){let e;t[18]!==s||t[19]!==c||t[20]!==i?(e=e=>(0,$.jsx)(Cr,{field:e,scope:i,commitField:s,isFlashed:c===e.path.join(`.`)},e.path.join(`.`)),t[18]=s,t[19]=c,t[20]=i,t[21]=e):e=t[21],h=o.map(e),t[13]=s,t[14]=o,t[15]=c,t[16]=i,t[17]=h}else h=t[17];let g;t[22]===h?g=t[23]:(g=(0,$.jsx)(`div`,{className:`space-y-10`,children:h}),t[22]=h,t[23]=g);let _;return t[24]!==m||t[25]!==g||t[26]!==l?(_=(0,$.jsxs)(`section`,{"aria-labelledby":l,className:`space-y-3`,children:[m,g]}),t[24]=m,t[25]=g,t[26]=l,t[27]=_):_=t[27],_}function Ha(){let e=(0,Z.c)(71),{_:t}=m(),{enabled:n,synced:r}=zn(),i=Rn(),a=n!==!1,{userConfig:o,userBinding:s,userSynced:c}=xn(),l=o?.agents?.autoApproveOkTools!==!1,[u,f]=(0,Q.useState)(!1),p,h;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{let e=window.okDesktop;if(!e)return;let t=!1;return e.terminal.cliPreflight(`codex`).then(e=>{t||f(e.onPath===`present`&&e.okServerConfigured!==!0)}).catch(Ua),()=>{t=!0}},h=[],e[0]=p,e[1]=h):(p=e[0],h=e[1]),(0,Q.useEffect)(p,h);let g;e[2]!==t||e[3]!==i?(g=function(e){if(i===null){X.error(t({id:`w6sBjd`}));return}let n=i(e);n.ok||X.error(t(e?{id:`jKd3AP`,values:{0:n.error}}:{id:`pajIrl`,values:{0:n.error}}))},e[2]=t,e[3]=i,e[4]=g):g=e[4];let _=g,v;e[5]!==t||e[6]!==s?(v=function(e){if(s===null){X.error(t({id:`fnlBN4`}));return}let n=s.patch({agents:{autoApproveOkTools:e}});if(!n.ok){let e=pt(n.error);X.error(t({id:`habOU_`,values:{detail:e}}))}},e[5]=t,e[6]=s,e[7]=v):v=e[7];let y=v,b;e[8]===t?b=e[9]:(b=t({id:`ALhMYW`}),e[8]=t,e[9]=b);let x;e[10]===b?x=e[11]:(x=(0,$.jsx)(`h3`,{id:`settings-terminal-title`,className:`text-base font-semibold`,children:b}),e[10]=b,e[11]=x);let S;e[12]===t?S=e[13]:(S=t({id:`FCAcjR`}),e[12]=t,e[13]=S);let C;e[14]===S?C=e[15]:(C=(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:S}),e[14]=S,e[15]=C);let w;e[16]!==x||e[17]!==C?(w=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[x,C]}),e[16]=x,e[17]=C,e[18]=w):w=e[18];let T;e[19]===t?T=e[20]:(T=t({id:`E4XYYH`}),e[19]=t,e[20]=T);let E;e[21]===T?E=e[22]:(E=(0,$.jsx)(`label`,{htmlFor:`settings-terminal-toggle`,className:`text-sm font-medium`,children:T}),e[21]=T,e[22]=E);let D;e[23]!==t||e[24]!==a?(D=t(a?{id:`AQGtjK`}:{id:`R65q-K`}),e[23]=t,e[24]=a,e[25]=D):D=e[25];let O;e[26]===D?O=e[27]:(O=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-body`,children:D}),e[26]=D,e[27]=O);let k;e[28]!==E||e[29]!==O?(k=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[E,O]}),e[28]=E,e[29]=O,e[30]=k):k=e[30];let A=!r||i===null,j;e[31]===t?j=e[32]:(j=t({id:`E4XYYH`}),e[31]=t,e[32]=j);let M;e[33]!==_||e[34]!==a||e[35]!==A||e[36]!==j?(M=(0,$.jsx)(d,{id:`settings-terminal-toggle`,checked:a,onCheckedChange:_,disabled:A,"aria-label":j,"data-testid":`settings-terminal-toggle`}),e[33]=_,e[34]=a,e[35]=A,e[36]=j,e[37]=M):M=e[37];let N;e[38]!==k||e[39]!==M?(N=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[k,M]}),e[38]=k,e[39]=M,e[40]=N):N=e[40];let P;e[41]===t?P=e[42]:(P=t({id:`ilodsp`}),e[41]=t,e[42]=P);let F;e[43]===P?F=e[44]:(F=(0,$.jsx)(`label`,{htmlFor:`settings-terminal-autoapprove-toggle`,className:`text-sm font-medium`,children:P}),e[43]=P,e[44]=F);let I;e[45]===t?I=e[46]:(I=t({id:`nP76lk`}),e[45]=t,e[46]=I);let L;e[47]===I?L=e[48]:(L=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-autoapprove-body`,children:I}),e[47]=I,e[48]=L);let R;e[49]!==t||e[50]!==l||e[51]!==u?(R=l&&u?(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`settings-terminal-autoapprove-codex-note`,children:t({id:`Kr3VPS`})}):null,e[49]=t,e[50]=l,e[51]=u,e[52]=R):R=e[52];let z;e[53]!==F||e[54]!==L||e[55]!==R?(z=(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[F,L,R]}),e[53]=F,e[54]=L,e[55]=R,e[56]=z):z=e[56];let B=!c||s===null,V;e[57]===t?V=e[58]:(V=t({id:`ilodsp`}),e[57]=t,e[58]=V);let H;e[59]!==y||e[60]!==l||e[61]!==B||e[62]!==V?(H=(0,$.jsx)(d,{id:`settings-terminal-autoapprove-toggle`,checked:l,onCheckedChange:y,disabled:B,"aria-label":V,"data-testid":`settings-terminal-autoapprove-toggle`}),e[59]=y,e[60]=l,e[61]=B,e[62]=V,e[63]=H):H=e[63];let U;e[64]!==z||e[65]!==H?(U=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border p-3`,children:[z,H]}),e[64]=z,e[65]=H,e[66]=U):U=e[66];let W;return e[67]!==N||e[68]!==U||e[69]!==w?(W=(0,$.jsxs)(`section`,{"aria-labelledby":`settings-terminal-title`,className:`space-y-3`,children:[w,N,U]}),e[67]=N,e[68]=U,e[69]=w,e[70]=W):W=e[70],W}function Ua(){}var Wa=[`background`,`surface`,`foreground`,`primary`,`accent`,`border`];function Ga(e){let t=(0,Z.c)(27),{seed:n}=e,r;t[0]===n?r=t[1]:(r=gt(yn(n)),t[0]=n,t[1]=r);let i=r,a;t[2]!==i.background||t[3]!==i.border?(a={backgroundColor:i.background,borderColor:i.border},t[2]=i.background,t[3]=i.border,t[4]=a):a=t[4];let o=`1px solid ${i.border}`,s;t[5]!==i.sidebar||t[6]!==o?(s={backgroundColor:i.sidebar,borderBottom:o},t[5]=i.sidebar,t[6]=o,t[7]=s):s=t[7];let c;t[8]===i.primary?c=t[9]:(c=(0,$.jsx)(`span`,{className:`h-1.5 w-6 rounded-full`,style:{backgroundColor:i.primary}}),t[8]=i.primary,t[9]=c);let l;t[10]!==s||t[11]!==c?(l=(0,$.jsx)(`div`,{className:`flex h-1/3 items-center gap-1 px-1.5`,style:s,children:c}),t[10]=s,t[11]=c,t[12]=l):l=t[12];let u=i[`syntax-keyword`],d;t[13]===u?d=t[14]:(d=(0,$.jsx)(`span`,{className:`h-1.5 w-4/5 rounded-full`,style:{backgroundColor:u}}),t[13]=u,t[14]=d);let f;t[15]===i.foreground?f=t[16]:(f=(0,$.jsx)(`span`,{className:`h-1.5 w-3/5 rounded-full opacity-70`,style:{backgroundColor:i.foreground}}),t[15]=i.foreground,t[16]=f);let p=i[`syntax-string`],m;t[17]===p?m=t[18]:(m=(0,$.jsx)(`span`,{className:`h-1.5 w-2/3 rounded-full`,style:{backgroundColor:p}}),t[17]=p,t[18]=m);let h;t[19]!==m||t[20]!==d||t[21]!==f?(h=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1 p-1.5`,children:[d,f,m]}),t[19]=m,t[20]=d,t[21]=f,t[22]=h):h=t[22];let g;return t[23]!==h||t[24]!==a||t[25]!==l?(g=(0,$.jsxs)(`div`,{"aria-hidden":!0,className:`h-20 w-32 shrink-0 overflow-hidden rounded-md border`,style:a,children:[l,h]}),t[23]=h,t[24]=a,t[25]=l,t[26]=g):g=t[26],g}function Ka(e){let t=(0,Z.c)(67),{userBinding:n}=e,{_:r}=m(),{setTheme:i}=g(),a=Sn()?.merged??null,o=a?.appearance?.customTheme,s;t[0]===o?s=t[1]:(s=gn(o),t[0]=o,t[1]=s);let c=s,l=a?.appearance?.colorTheme===`custom`,[u,d]=(0,Q.useState)(c),f;t[2]===c?f=t[3]:(f=JSON.stringify(c),t[2]=c,t[3]=f);let p=f,h;t[4]===c?h=t[5]:(h=()=>{d(c)},t[4]=c,t[5]=h);let _;t[6]===p?_=t[7]:(_=[p],t[6]=p,t[7]=_),(0,Q.useEffect)(h,_);let v,y,b,x,S,w,T,E;if(t[8]!==r||t[9]!==l||t[10]!==u||t[11]!==i||t[12]!==n){let e={background:r({id:`GtJbUa`}),surface:r({id:`qiN9NB`}),foreground:r({id:`xeiujy`}),primary:r({id:`T_R-Qz`}),accent:r({id:`Eax_et`}),border:r({id:`dCIGNG`})},a;t[21]!==l||t[22]!==i?(a=function(e){l&&(vn(`custom`,e),i(hn(e)===`dark`?`dark`:`light`))},t[21]=l,t[22]=i,t[23]=a):a=t[23];let o=a,s;t[24]!==o||t[25]!==u?(s=function(e,t){let n={...u,[e]:t};d(n),bn(t)&&o(n)},t[24]=o,t[25]=u,t[26]=s):s=t[26];let c=s,f;t[27]===n?f=t[28]:(f=function(e,t){bn(t)&&n.patch({appearance:{customTheme:{[e]:t}}})},t[27]=n,t[28]=f);let p=f,m;t[29]!==o||t[30]!==n?(m=function(){d(_n),o(_n),n.patch({appearance:{customTheme:{..._n}}})},t[29]=o,t[30]=n,t[31]=m):m=t[31];let h=m;v=`settings-custom-theme-title`,y=`space-y-3`,b=`custom-theme`;let g;t[32]===r?g=t[33]:(g=r({id:`DcLaew`}),t[32]=r,t[33]=g);let _;t[34]===g?_=t[35]:(_=(0,$.jsx)(`h3`,{id:`settings-custom-theme-title`,className:`font-medium text-sm`,children:g}),t[34]=g,t[35]=_);let D;t[36]!==r||t[37]!==l?(D=r(l?{id:`YEIS9T`}:{id:`4ieVh2`}),t[36]=r,t[37]=l,t[38]=D):D=t[38];let O;t[39]===D?O=t[40]:(O=(0,$.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:D}),t[39]=D,t[40]=O);let k;t[41]!==_||t[42]!==O?(k=(0,$.jsxs)(`div`,{children:[_,O]}),t[41]=_,t[42]=O,t[43]=k):k=t[43];let A;t[44]===r?A=t[45]:(A=r({id:`OfhWJH`}),t[44]=r,t[45]=A);let j;t[46]!==h||t[47]!==A?(j=(0,$.jsx)(C,{variant:`ghost`,size:`sm`,onClick:h,className:`text-muted-foreground`,children:A}),t[46]=h,t[47]=A,t[48]=j):j=t[48],t[49]!==k||t[50]!==j?(x=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[k,j]}),t[49]=k,t[50]=j,t[51]=x):x=t[51],T=`flex items-start gap-4`,t[52]===u?E=t[53]:(E=(0,$.jsx)(Ga,{seed:u}),t[52]=u,t[53]=E),S=`grid flex-1 grid-cols-1 gap-2 sm:grid-cols-2`,w=Wa.map(t=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(on,{type:`color`,"aria-label":e[t],value:u[t],onChange:e=>c(t,e.target.value),onBlur:e=>p(t,e.target.value),className:`h-8 w-9 shrink-0 cursor-pointer rounded-md p-1`}),(0,$.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,$.jsx)(W,{className:`text-1sm text-muted-foreground`,children:e[t]}),(0,$.jsx)(on,{value:u[t],spellCheck:!1,"aria-label":r({id:`I-xnra`,values:{0:e[t]}}),"aria-invalid":!bn(u[t]),onChange:e=>c(t,e.target.value),onBlur:e=>p(t,e.target.value),onKeyDown:e=>{e.key===`Enter`&&p(t,e.target.value)},className:`h-7 font-mono text-1sm uppercase`}),bn(u[t])?null:(0,$.jsx)(Oe,{className:`absolute top-full left-0 mt-0.5 text-xs leading-tight`,"data-testid":`custom-theme-hex-error-${t}`,children:r({id:`yR5LHI`})})]})]},t)),t[8]=r,t[9]=l,t[10]=u,t[11]=i,t[12]=n,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=w,t[19]=T,t[20]=E}else v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],w=t[18],T=t[19],E=t[20];let D;t[54]!==S||t[55]!==w?(D=(0,$.jsx)(`div`,{className:S,children:w}),t[54]=S,t[55]=w,t[56]=D):D=t[56];let O;t[57]!==D||t[58]!==T||t[59]!==E?(O=(0,$.jsxs)(`div`,{className:T,children:[E,D]}),t[57]=D,t[58]=T,t[59]=E,t[60]=O):O=t[60];let k;return t[61]!==v||t[62]!==y||t[63]!==b||t[64]!==x||t[65]!==O?(k=(0,$.jsxs)(`section`,{"aria-labelledby":v,className:y,"data-section":b,children:[x,O]}),t[61]=v,t[62]=y,t[63]=b,t[64]=x,t[65]=O,t[66]=k):k=t[66],k}function qa(e){let t=(0,Z.c)(13),{userBinding:n}=e,{_:r}=m(),i;t[0]===r?i=t[1]:(i=r({id:`fJ3EbT`}),t[0]=r,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`J_bJiH`}),t[2]=r,t[3]=a);let o;t[4]!==i||t[5]!==a||t[6]!==n?(o=(0,$.jsx)(Ba,{title:i,description:a,scope:`user`,scopeBadge:`user`,binding:n,fields:Y}),t[4]=i,t[5]=a,t[6]=n,t[7]=o):o=t[7];let s;t[8]===n?s=t[9]:(s=(0,$.jsx)(Ka,{userBinding:n}),t[8]=n,t[9]=s);let c;return t[10]!==o||t[11]!==s?(c=(0,$.jsxs)(`div`,{className:`space-y-6`,children:[o,s]}),t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Ja(e){let t=(0,Z.c)(36),{activeId:n,userBinding:r,okignoreBinding:i,okignoreSynced:a,markdownlintRuleQuery:o}=e,{_:s}=m();if(n===`preferences`){let e;t[0]!==s||t[1]!==r?(e=r?(0,$.jsx)(Ba,{title:s({id:`Q6hhn8`}),description:s({id:`Y_kL7X`}),scope:`user`,binding:r,fields:Re}):(0,$.jsx)(Sr,{}),t[0]=s,t[1]=r,t[2]=e):e=t[2];let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Vr,{}),t[3]=n):n=t[3];let i;return t[4]===e?i=t[5]:(i=(0,$.jsxs)(`div`,{className:`space-y-8`,children:[e,n]}),t[4]=e,t[5]=i),i}if(n===`configure-agents`){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Gr,{}),t[6]=e):e=t[6],e}if(n===`hotkeys`){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ei,{}),t[7]=e):e=t[7],e}if(n===`account`){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`div`,{className:`space-y-8`,children:[(0,$.jsx)(qn,{}),(0,$.jsx)(Qr,{})]}),t[8]=e):e=t[8],e}if(n===`sync`){let e;return t[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(za,{}),t[9]=e):e=t[9],e}if(n===`search`){let e;return t[10]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ba,{}),t[10]=e):e=t[10],e}if(n===`plugins-manage`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(li,{}),t[11]=e):e=t[11],e}if(n===`user-plugins-manage`){let e;return t[12]===r?e=t[13]:(e=(0,$.jsx)(ui,{userBinding:r}),t[12]=r,t[13]=e),e}if(n===`plugin:theme`){let e;return t[14]===r?e=t[15]:(e=r?(0,$.jsx)(qa,{userBinding:r}):(0,$.jsx)(Sr,{}),t[14]=r,t[15]=e),e}if(n===`plugin:markdownlint`){let e=o??null,n;return t[16]===e?n=t[17]:(n=(0,$.jsx)(fi,{initialRuleQuery:e}),t[16]=e,t[17]=n),n}if(n.startsWith(`plugin:`)){let e;t[18]===n?e=t[19]:(e=n.slice(7),t[18]=n,t[19]=e);let r=e,i;t[20]===r?i=t[21]:(i=gi.find(e=>e.id===r),t[20]=r,t[21]=i);let a=i;if(!a)return null;let o=a.Section,s;return t[22]!==o||t[23]!==n?(s=(0,$.jsx)(o,{},n),t[22]=o,t[23]=n,t[24]=s):s=t[24],s}if(n===`link-previews`){let e;return t[25]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ri,{}),t[25]=e):e=t[25],e}if(n===`terminal`){let e;return t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Ha,{}),t[26]=e):e=t[26],e}if(n===`project-templates`){let e;return t[27]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(va,{}),t[27]=e):e=t[27],e}if(n===`skills`){let e;return t[28]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Fa,{}),t[28]=e):e=t[28],e}if(n===`sharing`){let e;return t[29]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Hn,{}),t[29]=e):e=t[29],e}if(n===`okignore`){let e;return t[30]!==i||t[31]!==a?(e=(0,$.jsx)(Mi,{binding:i,synced:a}),t[30]=i,t[31]=a,t[32]=e):e=t[32],e}if(n===`ai-tools`){let e;return t[33]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)($n,{}),t[33]=e):e=t[33],e}if(n===`project-ai-tools`){let e;return t[34]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(da,{}),t[34]=e):e=t[34],e}if(n===`claude-desktop`){let e;return t[35]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(ni,{}),t[35]=e):e=t[35],e}return null}export{Ja as SettingsDialogBody};
|